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


PHP Page::listInTheme方法代码示例

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


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

示例1: getMenuTypeInfo

 /**
  * Handler for the pages.menuitem.getTypeInfo event.
  * Returns a menu item type information. The type information is returned as array
  * with the following elements:
  * - references - a list of the item type reference options. The options are returned in the
  *   ["key"] => "title" format for options that don't have sub-options, and in the format
  *   ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional,
  *   required only if the menu item type requires references.
  * - nesting - Boolean value indicating whether the item type supports nested items. Optional,
  *   false if omitted.
  * - dynamicItems - Boolean value indicating whether the item type could generate new menu items.
  *   Optional, false if omitted.
  * - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to 
  *   resolve the item URL.
  * @param string $type Specifies the menu item type
  * @return array Returns an array
  */
 public static function getMenuTypeInfo($type)
 {
     $result = [];
     if ($type == 'blog-category') {
         $references = [];
         $categories = self::orderBy('name')->get();
         foreach ($categories as $category) {
             $references[$category->id] = $category->name;
         }
         $result = ['references' => $references, 'nesting' => false, 'dynamicItems' => false];
     }
     if ($type == 'all-blog-categories') {
         $result = ['dynamicItems' => true];
     }
     if ($result) {
         $theme = Theme::getActiveTheme();
         $pages = CmsPage::listInTheme($theme, true);
         $cmsPages = [];
         foreach ($pages as $page) {
             if (!$page->hasComponent('blogPosts')) {
                 continue;
             }
             $properties = $page->getComponentProperties('blogPosts');
             if (!isset($properties['categoryFilter']) || substr($properties['categoryFilter'], 0, 1) !== ':') {
                 continue;
             }
             $cmsPages[] = $page;
         }
         $result['cmsPages'] = $cmsPages;
     }
     return $result;
 }
开发者ID:janusnic,项目名称:OctoberCMS,代码行数:49,代码来源:Category.php

示例2: getMenuTypeInfo

 /**
  * Handler for the pages.menuitem.getTypeInfo event.
  * Returns a menu item type information. The type information is returned as array
  * with the following elements:
  * - references - a list of the item type reference options. The options are returned in the
  *   ["key"] => "title" format for options that don't have sub-options, and in the format
  *   ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional,
  *   required only if the menu item type requires references.
  * - nesting - Boolean value indicating whether the item type supports nested items. Optional,
  *   false if omitted.
  * - dynamicItems - Boolean value indicating whether the item type could generate new menu items.
  *   Optional, false if omitted.
  * - cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to 
  *   resolve the item URL.
  * @param string $type Specifies the menu item type
  * @return array Returns an array
  */
 public static function getMenuTypeInfo($type)
 {
     $result = [];
     if ($type == 'blog-category') {
         $result = ['references' => self::listSubCategoryOptions(), 'nesting' => true, 'dynamicItems' => true];
     }
     if ($type == 'all-blog-categories') {
         $result = ['dynamicItems' => true];
     }
     if ($result) {
         $theme = Theme::getActiveTheme();
         $pages = CmsPage::listInTheme($theme, true);
         $cmsPages = [];
         foreach ($pages as $page) {
             if (!$page->hasComponent('blogPosts')) {
                 continue;
             }
             /*
              * Component must use a category filter with a routing parameter
              * eg: categoryFilter = "{{ :somevalue }}"
              */
             $properties = $page->getComponentProperties('blogPosts');
             if (!isset($properties['categoryFilter']) || !preg_match('/{{\\s*:/', $properties['categoryFilter'])) {
                 continue;
             }
             $cmsPages[] = $page;
         }
         $result['cmsPages'] = $cmsPages;
     }
     return $result;
 }
开发者ID:rainlab,项目名称:blog-plugin,代码行数:48,代码来源:Category.php

示例3: getCmsPageOptions

 public function getCmsPageOptions()
 {
     if (!($theme = Theme::getEditTheme())) {
         throw new ApplicationException('Unable to find the active theme.');
     }
     return Page::listInTheme($theme)->lists('fileName', 'fileName');
 }
开发者ID:aaronleslie,项目名称:aaronunix,代码行数:7,代码来源:MaintenanceSetting.php

示例4: __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

示例5: getMenuTypeInfo

 /**
  *
  * Returns an array of info about menu item type
  *
  * @param string $type item name
  * @return array
  */
 public static function getMenuTypeInfo($type)
 {
     $result = [];
     if ($type != 'all-archive-years') {
         return $result;
     }
     $result['dynamicItems'] = true;
     $theme = Theme::getActiveTheme();
     $result['cmsPages'] = CmsPage::listInTheme($theme, true);
     return $result;
 }
开发者ID:graker,项目名称:blogarchive,代码行数:18,代码来源:SitemapProvider.php

示例6: 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

示例7: pages

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

示例8: 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

示例9: 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

示例10: 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

示例11: 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) {
         $page->fill(['menu_text']);
         $page->fill(['menu_order']);
         if ($page->not_show_menu != "1" && !empty($page->menu_order)) {
             $result[$page->menu_order] = ['text' => $page->menu_text != '' ? $page->menu_text : $page->title, 'path' => $page->getBaseFileName(), 'order' => $page->menu_order != '' ? $page->menu_order : 1];
         }
     }
     ksort($result);
     return $result;
 }
开发者ID:janusnic,项目名称:OctoberCMS-Bootstrap,代码行数:17,代码来源:Menu.php

示例12: __construct

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

示例13: map

 /**
  * @param null|callable $map
  * The unique param it receives id an array with page informations
  *
  * @throws \ApplicationException
  * @throws \SystemException
  */
 public function map($map = null)
 {
     $theme = \Cms\Classes\Theme::getActiveTheme();
     $pages = \Cms\Classes\Page::listInTheme($theme, true);
     if (class_exists('\\RainLab\\Pages\\Classes\\Controller')) {
         // hack RainlabPage's Controller to avoid class name collision
         $classPath = \App::pluginsPath() . '/rainlab/pages/classes/Controller.php';
         file_put_contents($classPath, str_replace('use Cms\\Classes\\Page;', 'use Cms\\Classes\\Page as BasePage;', file_get_contents($classPath)));
         file_put_contents($classPath, str_replace('new Page(', 'new BasePage(', file_get_contents($classPath)));
         // end of hack
         $pages = array_merge($pages, \RainLab\Pages\Classes\Page::listInTheme($theme, true));
     }
     foreach ($pages as $i => $page) {
         if (!isset($this->pageInfos[$page->url])) {
             $this->pageInfos[$page->url] = ['url' => $page->url, 'content' => function () use($page) {
                 return $this->getPageContents($page->url);
             }, 'pageType' => $this->getPageTypeByUrl($page->url), 'urlParameters' => $this->getDynamicParameters($page->url)];
         }
         if (is_callable($map)) {
             $map($this->pageInfos[$page->url]);
         }
     }
 }
开发者ID:ebussola,项目名称:OC-Statefull-Website,代码行数:30,代码来源:PagesCrawler.php

示例14: getMenuTypeInfo

 /**
  * Handler for the pages.menuitem.getTypeInfo event.
  * @param string $type Specifies the menu item type
  * @return array Returns an array
  */
 public static function getMenuTypeInfo($type)
 {
     $result = [];
     if ($type == 'repertoire') {
         // Сюда все возможные ссылки (категории или scoupe)
         $references = [];
         $categories = self::getCategories();
         foreach ($categories as $category) {
             $references[$category->slug] = $category->title;
         }
         $result = ['references' => $references, 'nesting' => false, 'dynamicItems' => false];
     }
     if ($result) {
         $theme = Theme::getActiveTheme();
         $pages = CmsPage::listInTheme($theme, true);
         $cmsPages = [];
         foreach ($pages as $page) {
             if (!$page->hasComponent('theater')) {
                 continue;
             }
             $cmsPages[] = $page;
         }
         $result['cmsPages'] = $cmsPages;
     }
     return $result;
 }
开发者ID:chrisvidal,项目名称:oc-theater-plugin,代码行数:31,代码来源:Performance.php

示例15: listPages

 /**
  * Returns a list of pages in the theme.
  * This method is used internally in the routing process and in the back-end UI.
  * @param boolean $skipCache Indicates if the pages should be reloaded from the disk bypassing the cache.
  * @return array Returns an array of \Cms\Classes\Page objects.
  */
 public function listPages($skipCache = false)
 {
     return Page::listInTheme($this, $skipCache);
 }
开发者ID:360weboy,项目名称:october,代码行数:10,代码来源:Theme.php


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