Source for file flatviewtable.class.php
Documentation is available at flatviewtable.class.php
include_once (dirname(__FILE__ ). '/../../../inc/global.inc.php');
include_once (dirname(__FILE__ ). '/../be.inc.php');
* Table to display flat view (all evaluations and links for all students)
* @author Bert Stepp� (refactored, optimised)
function FlatViewTable ($selectcat, $users= array (), $evals= array (), $links= array (), $limit_enabled = false, $offset = 0, $addparams = null)
parent :: SortableTable ('flatviewlist', null, null, 0);
$this->set_additional_parameters($addparams);
* Function used by SortableTable to get total number of items in the table
return $this->datagen->get_total_users_count();
* Function used by SortableTable to generate the data to display
// create page navigation if needed
$totalitems = $this->datagen->get_total_items_count();
$selectlimit = $totalitems;
$header .= '<div class="normal-message">'
. '<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="2">'
$header .= '<td style="width:40%;">';
. '<img src="../img/lp_leftarrow.gif" alt="'. get_lang('Previous'). '/" />'
$header .= '<img src="../img/lp_leftarrow.gif" alt="'. get_lang('Previous'). ' ' . get_lang('Evaluations'). '/" />'. get_lang('Previous'). ' ' . get_lang('Evaluations');
$header .= '<td style="width:20%;"></td>';
$calcnext = (($this->offset+ (2* LIMIT)) > $totalitems) ?
$header .= '<td style="text-align: right; width: 40%;">';
. '<img src="../img/lp_rightarrow.gif" alt="'. get_lang('Next'). '/" />'
$header .= get_lang('Next'). ' '. get_lang('Evaluations'). '<img src="../img/lp_rightarrow.gif" alt="'. get_lang('Next'). '/" />';
$header .= '</tr></tbody></table></div>';
if ($this->direction == 'DESC')
// step 1: generate columns: evaluations and links
$header_names = $this->datagen->get_header_names($this->offset, $selectlimit);
$this->set_header($column++ , $header_names[0]);
$this->set_header($column++ , $header_names[1]);
while ($column < count($header_names))
$this->set_header($column, $header_names[$column], false);
// step 2: generate rows: students
$data_array = $this->datagen->get_data($users_sorting,
foreach ($data_array as $user_row)
$table_row[]= $this->build_name_link($user_row[$count++ ], $user_row[$count++ ]);
$table_row[]= $user_row[$count++ ];
while ($count < count($user_row))
$table_row[] = $user_row[$count++ ];
$table_data[]= $table_row;
return '<a href="user_stats.php?userid='. $user_id. '&selectcat='. $this->selectcat->get_id(). '">'. $lastname. '</a>';
|