Пример #1
0
 /**
  * Constructor creates the table element
  * @param string $id         Id of the table
  * @param object $htmlPage   (optional) A HtmlPage object that will be used to add javascript code
  *                           or files to the html output page.
  * @param bool   $hoverRows  (optional) If set to @b true then the active selected row will be marked with special css code
  * @param bool   $datatables (optional) If set to @b true then the jQuery plugin Datatables will be used to create the table.
  *                           Then column sort, search within the table and other features are possible.
  * @param string $class      (optional) An additional css classname. The class @b table
  *                           is set as default and need not set with this parameter.
  */
 public function __construct($id, $htmlPage = null, $hoverRows = true, $datatables = false, $class = '')
 {
     global $g_root_path, $gL10n;
     if ($class === '') {
         $class = 'table';
     }
     if ($hoverRows) {
         $class .= ' table-hover';
     }
     parent::__construct($id, $class);
     // initialize class member parameters
     $this->messageNoRowsFound = $gL10n->get('SYS_NO_DATA_FOUND');
     $this->id = $id;
     $this->datatables = $datatables;
     $this->datatablesInitParameters = array();
     $this->groupedColumn = -1;
     $this->columnCount = 0;
     $this->rowsPerPage = 25;
     $this->orderColumns = array();
     $this->datatablesColumnDefs = array();
     // when using DataTables we must set the width attribute so that all columns will change
     // dynamic their width if the browser window size change.
     if ($datatables) {
         $this->addAttribute('width', '100%');
         $this->datatablesInitParameters[] = '"language": {"url": "' . $g_root_path . '/adm_program/libs/datatables/language/datatables.' . $gL10n->getLanguageIsoCode() . '.lang"}';
     }
     if (is_object($htmlPage)) {
         $this->htmlPage =& $htmlPage;
     }
 }