/** * Constructor. */ public function __construct() { parent::__construct(); BackendMenu::setContext('October.Cms', 'cms', true); try { if (!($theme = Theme::getEditTheme())) { throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found')); } $this->theme = $theme; new TemplateList($this, 'pageList', function () use($theme) { return Page::listInTheme($theme, true); }); new TemplateList($this, 'partialList', function () use($theme) { return Partial::listInTheme($theme, true); }); new TemplateList($this, 'layoutList', function () use($theme) { return Layout::listInTheme($theme, true); }); new TemplateList($this, 'contentList', function () use($theme) { return Content::listInTheme($theme, true); }); new ComponentList($this, 'componentList'); new AssetList($this, 'assetList'); } catch (Exception $ex) { $this->handleError($ex); } }
/** * Constructor. */ public function __construct() { parent::__construct(); BackendMenu::setContext('RainLab.Pages', 'pages', 'pages'); try { if (!($this->theme = Theme::getEditTheme())) { throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found')); } new PageList($this, 'pageList'); new MenuList($this, 'menuList'); new SnippetList($this, 'snippetList'); $theme = $this->theme; new TemplateList($this, 'contentList', function () use($theme) { return Content::listInTheme($theme, true); }); } catch (Exception $ex) { $this->handleError($ex); } $this->addJs('/modules/backend/assets/js/october.treeview.js', 'core'); $this->addJs('/plugins/rainlab/pages/assets/js/pages-page.js'); $this->addJs('/plugins/rainlab/pages/assets/js/pages-snippets.js'); $this->addCss('/plugins/rainlab/pages/assets/css/pages.css'); // Preload the code editor class as it could be needed // before it loads dynamically. $this->addJs('/modules/backend/formwidgets/codeeditor/assets/js/codeeditor.js', 'core'); $this->bodyClass = 'compact-container side-panel-not-fixed'; $this->pageTitle = 'rainlab.pages::lang.plugin.name'; $this->pageTitleTemplate = '%s Pages'; }
/** * Constructor. */ public function __construct() { parent::__construct(); BackendMenu::setContext('Shahin.Pages', 'pages', 'pages'); try { if (!($this->theme = Theme::getEditTheme())) { throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found')); } new MenuList($this, 'menuList'); $theme = $this->theme; new TemplateList($this, 'contentList', function () use($theme) { return Content::listInTheme($theme, true); }); } catch (Exception $ex) { $this->handleError($ex); } }
/** * Constructor. */ public function __construct() { parent::__construct(); BackendMenu::setContext('October.Cms', 'cms', 'pages'); try { if (!($theme = Theme::getEditTheme())) { throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found')); } $this->theme = $theme; new TemplateList($this, 'pageList', function () use($theme) { return Page::listInTheme($theme, true); }); new TemplateList($this, 'partialList', function () use($theme) { return Partial::listInTheme($theme, true); }); new TemplateList($this, 'layoutList', function () use($theme) { return Layout::listInTheme($theme, true); }); new TemplateList($this, 'contentList', function () use($theme) { return Content::listInTheme($theme, true); }); new ComponentList($this, 'componentList'); new AssetList($this, 'assetList'); } catch (Exception $ex) { $this->handleError($ex); } $this->addJs('/modules/cms/assets/js/october.cmspage.js', 'core'); $this->addJs('/modules/cms/assets/js/october.dragcomponents.js', 'core'); $this->addCss('/modules/cms/assets/css/october.components.css', 'core'); // Preload Ace editor modes explicitly, because they could be changed dynamically // depending on a content block type $this->addJs('/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ace.js', 'core'); $aceModes = ['markdown', 'plain_text', 'html', 'less', 'css', 'scss', 'sass', 'javascript']; foreach ($aceModes as $mode) { $this->addJs('/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-' . $mode . '.js', 'core'); } $this->bodyClass = 'compact-container side-panel-not-fixed'; $this->pageTitle = Lang::get('cms::lang.cms.menu_label'); }