*/
var $showdownloadbuttonsat= array(TABLE_P_TOP);
+
+ /**
+ * @var string Key of field returned by db query that is the id field of the
+ * user table or equivalent.
+ */
+ public $useridfield = 'id';
+
/**
* @var string which download plugin to use. Default '' means none - print
* html table with paging. Property set by is_downloading which typically
function wrap_html_finish(){
}
+
+ /**
+ *
+ * @param array $row row of data from db used to make one row of the table.
+ * @return array one row for the table, added using add_data_keyed method.
+ */
+ function format_row($row){
+ $formattedrow = array();
+ foreach (array_keys($this->columns) as $column){
+ $colmethodname = 'col_'.$column;
+ if (method_exists($this, $colmethodname)){
+ $formattedcolumn = $this->$colmethodname($row);
+ } else {
+ $formattedcolumn = $this->other_cols($column, $row);
+ if ($formattedcolumn===NULL){
+ $formattedcolumn = $row->$column;
+ }
+ }
+ $formattedrow[$column] = $formattedcolumn;
+ }
+ return $formattedrow;
+ }
+
+ /**
+ * Fullname is treated as a special columname in tablelib and should always
+ * be treated the same as the fullname of a user.
+ * @uses $this->useridfield if the userid field is not expected to be id
+ * then you need to override $this->useridfield to point at the correct
+ * field for the user id.
+ *
+ */
+ function col_fullname($row){
+ global $COURSE, $CFG;
+ if (!$this->download){
+
+ return '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$row->{$this->useridfield}.
+ '&course='.$COURSE->id.'">'.fullname($row).'</a>';
+ } else {
+ return fullname($row);
+ }
+ }
+
+ /**
+ * You can override this method in a child class. See the description of
+ * build_table which calls this method.
+ */
+ function other_cols($column, $row){
+ return NULL;
+ }
+
+
/**
* This method is deprecated although the old api is still supported.
* @deprecated 1.9.2 - Jun 2, 2008
*/
public $is_collapsible = true;
- /**
- * @var string Key of field returned by db query that is the id field of the
- * user table or equivalent.
- */
- public $useridfield = 'id';
-
/**
* @param string $uniqueid a string identifying this table.Used as a key in
$this->set_attribute('class', 'generaltable generalbox');
}
- /**
- *
- * @param array $row row of data from db used to make one row of the table.
- * @return array one row for the table, added using add_data_keyed method.
- */
- function format_row($row){
- $formattedrow = array();
- foreach (array_keys($this->columns) as $column){
- $colmethodname = 'col_'.$column;
- if (method_exists($this, $colmethodname)){
- $formattedcolumn = $this->$colmethodname($row);
- } else {
- $formattedcolumn = $this->other_cols($column, $row);
- if ($formattedcolumn===NULL){
- $formattedcolumn = $row->$column;
- }
- }
- $formattedrow[$column] = $formattedcolumn;
- }
- return $formattedrow;
- }
-
- /**
- * Fullname is treated as a special columname in tablelib and should always
- * be treated the same as the fullname of a user.
- * @uses $this->useridfield if the userid field is not expected to be id
- * then you need to override $this->useridfield to point at the correct
- * field for the user id.
- *
- */
- function col_fullname($row){
- global $COURSE, $CFG;
- if (!$this->download){
-
- return '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$row->{$this->useridfield}.
- '&course='.$COURSE->id.'">'.fullname($row).'</a>';
- } else {
- return fullname($row);
- }
- }
-
- /**
- * You can override this method in a child class. See the description of
- * build_table which calls this method.
- */
- function other_cols($column, $row){
- return NULL;
- }
-
/**
* Take the data returned from the db_query and go through all the rows
* processing each col using either col_{columnname} method or other_cols