Exemple #1
0
 /**
  * Fill table with data
  *
  * @return void
  */
 public function table_fill()
 {
     if ($this->is_exporting()) {
         $this->table->set_export($this->export);
         $this->paging->set_export($this->export);
     }
     $total = $this->count_records($this->filter_sql());
     if ($this->config->maxrows == 0 or $total <= $this->config->maxrows) {
         $rs = $this->get_recordset($this->filter_sql(), $this->table->get_sql_sort(), $this->paging->get_limitfrom(), $this->paging->get_limitnum());
         foreach ($rs as $row) {
             $this->table_fill_row($row);
         }
         $rs->close();
         if ($this->paging->get_perpage() > 0) {
             $this->paging->set_total($total);
         }
     } else {
         $this->table->set_emptymessage(get_string('toomanyrows', 'local_mr', (object) array('total' => $total, 'max' => $this->config->maxrows)));
     }
 }