当前位置: 首页>>代码示例>>PHP>>正文


PHP Theme::getEditTheme方法代码示例

本文整理汇总了PHP中Cms\Classes\Theme::getEditTheme方法的典型用法代码示例。如果您正苦于以下问题:PHP Theme::getEditTheme方法的具体用法?PHP Theme::getEditTheme怎么用?PHP Theme::getEditTheme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cms\Classes\Theme的用法示例。


在下文中一共展示了Theme::getEditTheme方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 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';
 }
开发者ID:vladimirzhukov,项目名称:octobercms,代码行数:32,代码来源:Index.php

示例2: __construct

 /**
  * 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);
     }
 }
开发者ID:rafasashi,项目名称:sd-laravel,代码行数:30,代码来源:Index.php

示例3: __construct

 public function __construct($controller, $alias)
 {
     $this->alias = $alias;
     $this->theme = Theme::getEditTheme();
     $this->dataIdPrefix = 'page-' . $this->theme->getDirName();
     parent::__construct($controller, []);
     $this->bindToController();
 }
开发者ID:rainlab,项目名称:pages-plugin,代码行数:8,代码来源:PageList.php

示例4: __construct

 public function __construct($controller, $alias)
 {
     $this->alias = $alias;
     $this->theme = Theme::getEditTheme();
     parent::__construct($controller, []);
     $this->bindToController();
     $this->checkUploadPostback();
 }
开发者ID:betes-curieuses-design,项目名称:ElieJosiePhotographie,代码行数:8,代码来源:AssetList.php

示例5: afterFetch

 /**
  * Restore the CMS page found in the mapping array, or disable the
  * maintenance mode.
  * @return void
  */
 public function afterFetch()
 {
     if (($theme = Theme::getEditTheme()) && ($themeMap = array_get($this->attributes, 'theme_map')) && ($cmsPage = array_get($themeMap, $theme->getDirName()))) {
         $this->cms_page = $cmsPage;
     } else {
         $this->is_enabled = false;
     }
 }
开发者ID:GoldBest,项目名称:october,代码行数:13,代码来源:MaintenanceSettings.php

示例6: getCodeOptions

 public function getCodeOptions()
 {
     $result = [];
     $theme = Theme::getEditTheme();
     $menus = PagesMenu::listInTheme($theme, true);
     foreach ($menus as $menu) {
         $result[$menu->code] = $menu->name;
     }
     return $result;
 }
开发者ID:negativa,项目名称:pages-plugin,代码行数:10,代码来源:StaticMenu.php

示例7: getTemplateScriptPath

 protected function getTemplateScriptPath()
 {
     $theme = Theme::getEditTheme();
     $assetPath = $theme->getPath() . '/assets';
     $fileName = $this->template->getBaseFileName();
     $jsPath = $assetPath . '/javascript';
     if (!File::isDirectory($jsPath)) {
         $jsPath = $assetPath . '/js';
     }
     return $jsPath . '/controllers/' . $fileName . '.js';
 }
开发者ID:romanov-acc,项目名称:angular-plugin,代码行数:11,代码来源:PageScript.php

示例8: getPagesDropDown

 public function getPagesDropDown()
 {
     if (!$this->pages) {
         $theme = Theme::getEditTheme();
         $pages = Page::listInTheme($theme, true);
         $this->pages = [];
         foreach ($pages as $page) {
             $this->pages[$page->baseFileName] = $page->title . ' (' . $page->url . ')';
         }
     }
     return $this->pages;
 }
开发者ID:janusnic,项目名称:OctoberCMS,代码行数:12,代码来源:Settings.php

示例9: partials

 public function partials()
 {
     if (!$this->partials) {
         $theme = Theme::getEditTheme();
         $partials = Prtl::listInTheme($theme, true);
         $options = [];
         foreach ($partials as $partial) {
             $options[$partial->baseFileName] = $partial->baseFileName;
         }
         asort($options);
         $this->partials = $options;
     }
     return $this->partials;
 }
开发者ID:jiiis,项目名称:ptn,代码行数:14,代码来源:DropDownHelper.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     BackendMenu::setContext('JofrySutanto.CustomFields', 'customfields', 'customfields');
     try {
         if (!($this->theme = Theme::getEditTheme())) {
             throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
         }
         new FieldGroupList($this, 'groupList');
         $theme = $this->theme;
     } catch (Exception $ex) {
         $this->handleError($ex);
     }
 }
开发者ID:jofrysutanto,项目名称:custom-fields,代码行数:14,代码来源:Index.php

示例11: getLayoutOptions

 /**
  * Returns a list of layouts available in the theme. 
  * This method is used by the form widget.
  * @return array Returns an array of strings.
  */
 public function getLayoutOptions()
 {
     if (!($theme = Theme::getEditTheme())) {
         throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
     }
     $layouts = Layout::listInTheme($theme, true);
     $result = [];
     $result[null] = Lang::get('cms::lang.page.no_layout');
     foreach ($layouts as $layout) {
         $baseName = $layout->getBaseFileName();
         $result[$baseName] = strlen($layout->name) ? $layout->name : $baseName;
     }
     return $result;
 }
开发者ID:peteryu1,项目名称:october,代码行数:19,代码来源:Page.php

示例12: listPages

 private static function listPages()
 {
     if (!($theme = Theme::getEditTheme())) {
         throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
     }
     $pages = Page::listInTheme($theme, true);
     $result = [];
     foreach ($pages as $page) {
         if ($page->show_menu == "1") {
             $result[$page->menu_order] = ['text' => $page->menu_text, 'path' => $page->getBaseFileName(), 'order' => $page->menu_order];
         }
     }
     ksort($result);
     return $result;
 }
开发者ID:janusnic,项目名称:oc-simplemenu-plugin,代码行数:15,代码来源:Menu.php

示例13: onRun

 public function onRun()
 {
     if (!($theme = Theme::getEditTheme())) {
         throw new ApplicationException(Lang::get('cms::lang.theme.edit.not_found'));
     }
     $currentPage = $this->page->baseFileName;
     $pages = Page::listInTheme($theme, true);
     $this->pagesList = $this->buildPagesList($pages);
     $breadcrumbList = $this->buildCrumbTrail($currentPage);
     $currentCrumb = array_slice($breadcrumbList, -1, 1, true);
     $currentCrumb = array_shift($currentCrumb);
     $this->page['breadcrumbs'] = $breadcrumbList;
     $this->page['currentCrumb'] = $currentCrumb;
     return;
 }
开发者ID:tysonrude,项目名称:bloom7,代码行数:15,代码来源:Breadcrumbs.php

示例14: getPageUrlOptions

 public function getPageUrlOptions()
 {
     $currentTheme = Theme::getEditTheme();
     $allThemePages = Page::listInTheme($currentTheme, true);
     $options = [];
     foreach ($allThemePages as $p) {
         $options['url=' . $p->url . '&type=cms_pages'] = $p->title;
     }
     $tree = StaticPageClass::buildMenuTree($currentTheme);
     foreach ($tree as $key => $page) {
         if (isset($page['title']) && isset($page['url'])) {
             $options['url=' . $page['url'] . '&type=pages_plugin'] = $page['title'];
         }
     }
     return $options;
 }
开发者ID:Kabangi,项目名称:subdomainlandingpages,代码行数:16,代码来源:Setting.php

示例15: register

 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');
     });
 }
开发者ID:tysonrude,项目名称:bloom7,代码行数:16,代码来源:Plugin.php


注:本文中的Cms\Classes\Theme::getEditTheme方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。