/** * Scans the theme templates for message references. * @return void */ public function scanForMessages() { $messages = []; foreach (Layout::all() as $layout) { $messages = array_merge($messages, $this->parseContent($layout->markup)); } foreach (Page::all() as $page) { $messages = array_merge($messages, $this->parseContent($page->markup)); } foreach (Partial::all() as $partial) { $messages = array_merge($messages, $this->parseContent($partial->markup)); } Message::importMessages($messages); }
public function register() { \Event::listen('backend.form.extendFields', function ($widget) { if (!$widget->model instanceof \Cms\Classes\Page) { return; } if (!($theme = Theme::getEditTheme())) { throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found')); } $pages = Page::all()->sort(function ($a, $b) { return strcasecmp($a->title, $b->title); }); $pageOptions = $this->buildPageOptions($pages); $widget->addFields(['settings[child_of]' => ['label' => 'Child Of', 'type' => 'dropdown', 'tab' => 'Breadcrumbs', 'span' => 'left', 'options' => $pageOptions, 'comment' => 'The parent of this page. Set to "None" if root page'], 'settings[hide_crumb]' => ['label' => 'Hide Breadcrumbs', 'type' => 'checkbox', 'tab' => 'Breadcrumbs', 'span' => 'right', 'comment' => 'Hide the breadcrumb trail on this page'], 'settings[crumb_title]' => ['label' => 'Crumb Title (Optional)', 'type' => 'text', 'tab' => 'Breadcrumbs', 'span' => 'left', 'comment' => 'Title text for this pages crumb, by default will use page title'], 'settings[remove_crumb_trail]' => ['label' => 'Remove From Breadcrumbs', 'type' => 'checkbox', 'tab' => 'Breadcrumbs', 'span' => 'right', 'comment' => 'Do not show this page in the breadcrumb trail'], 'settings[crumbElementTitle]' => ['label' => 'Crumb Title From Id (Optional)', 'type' => 'text', 'tab' => 'Breadcrumbs', 'span' => 'left', 'comment' => 'Use a DOM element as the crumb title for this page. Must be a a unique #id on the page.'], 'settings[crumb_disabled]' => ['label' => 'Disabled', 'type' => 'checkbox', 'tab' => 'Breadcrumbs', 'span' => 'right', 'comment' => 'Disable the link and add the disabled class to this crumb item in the breadcrumb list']], 'primary'); }); }
public function onRun() { $this->pages = $this->page['pages'] = Page::all(); $this->dependencyString = $this->page['dependencyString'] = $this->getModuleDependencies(); }