/** * Vrátí základní sadu sloupců pro KT_CRUD_Admin_List * * @author Tomáš Kocifaj * @link http://www.ktstudio.cz * * @param string $className * @param string $tableName * @param string $templateTitle * @return \KT_CRUD_Admin_List */ public static function getCatalogCrudList($className, $tableName, $templateTitle = null) { $crudList = new KT_CRUD_Admin_List($className, $tableName); $crudList->setTemplateTitle($templateTitle); $crudList->addColumn(KT_Catalog_Model_Base::TITLE_COLUMN)->setType(KT_CRUD_Admin_Column::EDIT_LINK_TYPE)->setDeletable()->setLabel(__("Titulek", KT_DOMAIN)); $crudList->addColumn(KT_Catalog_Model_Base::CODE_COLUMN)->setLabel(__("Kód", KT_DOMAIN)); $crudList->addColumn(KT_Catalog_Model_Base::VISIBILITY_COLUMN)->setType(KT_CRUD_Admin_Column::SWITCH_BUTTON_TYPE)->setPosition(99)->setLabel(__("Viditelnost", KT_DOMAIN)); // výchozí řazení $crudList->getRepository()->addOrder(KT_Catalog_Model_Base::MENU_ORDER_COLUMN, KT_Repository::ORDER_ASC)->addOrder(KT_Catalog_Model_Base::TITLE_COLUMN, KT_Repository::ORDER_ASC); return $crudList; }
function kt_init_logger_tools_admin_page() { if (KT_Logger::getAllowToolsAdminPage()) { $template = new KT_Custom_Metaboxes_Subpage("tools.php", __("Výpis (KT) logů", KT_DOMAIN), __("(KT) Logy", KT_DOMAIN), "edit_theme_options", KT_Log_Model::FORM_PREFIX); $crudList = new KT_CRUD_Admin_List("KT_Log_Model", KT_Log_Model::TABLE); $crudList->setTemplateTitle(__("Přehled zaznamenaných (KT) logů", KT_DOMAIN)); $crudList->getRepository()->setOrder(KT_Log_Model::DATE_COLUMN, KT_Repository::ORDER_DESC); $crudList->addColumn(KT_Log_Model::LEVEL_ID_COLUMN)->setLabel(__("Level", KT_DOMAIN))->setType(KT_CRUD_Admin_Column::CUSTOM_TYPE)->setCustomCallbackFunction("getLevelColumnValue", true); $crudList->addColumn(KT_Log_Model::SCOPE_COLUMN)->setLabel(__("Scope", KT_DOMAIN)); $crudList->addColumn(KT_Log_Model::MESSAGE_COLUMN)->setLabel(__("Zpráva", KT_DOMAIN))->setType(KT_CRUD_Admin_Column::CUSTOM_TYPE)->setCustomCallbackFunction("getMessageColumnValue", true); $crudList->addColumn(KT_Log_Model::DATE_COLUMN)->setLabel(__("Datum", KT_DOMAIN)); $crudList->addColumn(KT_Log_Model::LOGGED_USER_NAME_COLUMN)->setLabel(__("Uživatel", KT_DOMAIN)); $crudList->addColumn(KT_Log_Model::FILE_COLUMN)->setLabel(__("Soubor", KT_DOMAIN))->setType(KT_CRUD_Admin_Column::CUSTOM_TYPE)->setCustomCallbackFunction("getFileColumnValue", true); $crudList->addColumn(KT_Log_Model::LINE_COLUMN)->setLabel(__("Řádek", KT_DOMAIN)); $template->setCrudList($crudList); // --- registrace stránky ------------------ $template->setDefaultCallBackFunction(KT_Custom_Metaboxes_Base::CRUD_LIST_SCREEN)->register(); } }