Example #1
0
 /**
  * Add a row
  *
  * @param mixed $row Table row of data
  * @return mr_html_table
  */
 public function add_row($row)
 {
     if (is_object($row)) {
         $row = (array) $row;
     }
     // Send the row to export or store internally
     if ($this->export instanceof mr_file_export and $this->export->is_exporting()) {
         $this->export->instance()->add_row($this->extract_data($row));
     } else {
         $this->rows[] = $row;
     }
     return $this;
 }
Example #2
0
 /**
  * Set the export instance
  *
  * This will set the limitfrom and limitnum
  * appropriately for exporting
  *
  * @param mr_file_export $export The export plugin
  * @return mr_html_paging
  */
 public function set_export($export)
 {
     if ($export->is_exporting()) {
         // Start from the beginning
         $this->page = 0;
         // Grab as many rows as the exporter can handle
         $this->perpage = $export->instance()->max_rows();
     }
     return $this;
 }