public function beforeHandler()
 {
     global $TEMPLATE, $ARGS;
     parent::beforeHandler();
     $table = new \Atabix\DataTables\TableController("ABLanguageCategories");
     $table->setDOM('lTfrtip');
     $table->setDefaultOrder(array(array(0, "asc")));
     $table->setServerSide(true);
     $table->setResponsive(true);
     $table->setAjax("/admin/language/categories/search");
     $editor = new \Atabix\DataTables\Editor("/admin/language/categories/search", "id");
     $editor->addField("Name:", "name");
     $editor->addField("Order:", "order");
     $table->addEditor($editor);
     $table->addTableToolsButton("editor_create", "Add", true);
     $table->addTableToolsButton("editor_edit", "Edit", true);
     $table->addTableToolsButton("editor_remove", "Delete", true);
     $column = new \Atabix\DataTables\Column("id", "ID", false, false);
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("name", "Name");
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("order", "Order");
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("created", "Created");
     $table->addColumn($column);
     $this->table = $table;
     $TEMPLATE->assign("datatable", $table);
     $TEMPLATE->assign("activeSubmenu", "langCategories");
 }
 public function beforeHandler()
 {
     global $TEMPLATE, $ARGS;
     parent::beforeHandler();
     $table = new \Atabix\DataTables\TableController("ABLanguages");
     $table->setDefaultOrder(array(array(0, "asc")));
     $table->setServerSide(true);
     $table->setResponsive(true);
     $table->setAjax("/admin/language/languages/search");
     $table->setInitComplete(false);
     $column = new \Atabix\DataTables\Column("id", "ID", false, false);
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("language", "Lang Code");
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("name", "Language");
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("location", "Location");
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("published", "Published");
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column(null, "", "all");
     $column->setClassName("dt-body-center");
     $column->setWidth("10%");
     $column->setSearchable(false);
     $column->setOrderable(false);
     $column->setRender("return '<a href=\"#\" class=\"exportfile\" onclick=\"exportFile('+row.id+');\" data-id=\"'+row.id+'\">Export to file</a>'");
     $table->addColumn($column);
     $this->table = $table;
     $TEMPLATE->assign("datatable", $table);
     $TEMPLATE->assign("activeSubmenu", "langLanguages");
 }
 public function beforeHandler()
 {
     global $TEMPLATE, $ARGS, $SESS, $LE_LANGS, $LE_CATEGORIES;
     parent::beforeHandler();
     $catTriggerValues = array();
     $editorSelectValues = array();
     foreach ($LE_CATEGORIES as $k => $v) {
         $catTriggerValues[$v->c["id"]] = $v->c["id"];
         $editorSelectValues[$v->c["id"]] = $v->c["name"];
     }
     $table = new \Atabix\DataTables\TableController("ABTranslations");
     $table->setDOM('lTfrtip');
     $table->setDefaultOrder(array(array(0, "asc")));
     $table->setServerSide(true);
     $table->setResponsive(true);
     $table->setAjax("/admin/language/translations/search");
     $table->setExternalFilters("category", "category", "#categoryfilter", "=", $catTriggerValues);
     $editor = new \Atabix\DataTables\Editor("/admin/language/translations/search", "id");
     $editor->addField("Name:", "name");
     $editor->addField("Category:", "category", "select", $editorSelectValues);
     foreach ($LE_LANGS as $lang) {
         $editor->addField($lang->c["name"] . ":", $lang->c["language"], "textarea");
     }
     $table->addEditor($editor);
     /* 		$table->addTableToolsButton("editor_create", "Add", true); */
     $table->addTableToolsButton("editor_edit", "Edit", true);
     /* 		$table->addTableToolsButton("editor_remove", "Delete", true); */
     $column = new \Atabix\DataTables\Column("id", "ID", false, false);
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("category", "Category");
     $column->setWidth("10%");
     $column->setDefaultContent("unknown");
     $column->setRenderSelect($editorSelectValues);
     $table->addColumn($column);
     $column = new \Atabix\DataTables\Column("name", "Key Name");
     $column->setWidth("20%");
     $table->addColumn($column);
     foreach ($LE_LANGS as $lang) {
         $column = new \Atabix\DataTables\Column($lang->c["language"], $lang->c["name"]);
         $column->setWidth("15%");
         $table->addColumn($column);
     }
     $column = new \Atabix\DataTables\Column("created", "Created");
     $column->setWidth("10%");
     $table->addColumn($column);
     $this->table = $table;
     $TEMPLATE->assign("datatable", $table);
     $TEMPLATE->assign("activeSubmenu", "langTranslations");
 }