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


PHP Page::getCollectionID方法代码示例

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


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

示例1: getMenuItemClass

 public function getMenuItemClass(Page $page)
 {
     $classes = [];
     if (is_object($this->currentPage) && $page->getCollectionID() == $this->currentPage->getCollectionID()) {
         $classes[] = 'nav-selected';
     }
     if (in_array($page->getCollectionID(), $this->trail)) {
         $classes[] = 'nav-path-selected';
     }
     return implode($classes, ' ');
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:11,代码来源:menu.php

示例2: isActive

 /**
  * Determines whether this nav item is the current page the user is on.
  *
  * @param \Concrete\Core\Page\Page $c The page object for the current page
  *
  * @return bool
  */
 public function isActive(&$c)
 {
     if ($c) {
         $cID = $c->getCollectionPointerID() > 0 ? $c->getCollectionPointerOriginalID() : $c->getCollectionID();
         return $cID == $this->cID;
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:14,代码来源:nav_item.php

示例3: getPageTypeComposerControlBlockObject

 public function getPageTypeComposerControlBlockObject(Page $c)
 {
     $app = Application::getFacadeApplication();
     $db = $app->make('database')->connection();
     if (!is_object($this->b)) {
         $setControl = $this->getPageTypeComposerFormLayoutSetControlObject();
         $r = $db->fetchAssoc($q = 'select cdb.bID, cdb.arHandle from PageTypeComposerOutputBlocks cdb inner join CollectionVersionBlocks cvb on (cdb.bID = cvb.bID and cvb.cID = cdb.cID and cvb.cvID = ?) where cdb.ptComposerFormLayoutSetControlID = ? and cdb.cID = ?', [$c->getVersionID(), $setControl->getPageTypeComposerFormLayoutSetControlID(), $c->getCollectionID()]);
         if (!$r) {
             // this is the first run. so we look for the proxy block.
             $pt = PageTemplate::getByID($c->getPageTemplateID());
             $outputControl = $setControl->getPageTypeComposerOutputControlObject($pt);
             if (is_object($outputControl)) {
                 $cm = $c->getPageTypeObject();
                 $mc = $cm->getPageTypePageTemplateDefaultPageObject($pt);
                 $r = $db->fetchAssoc('select bco.bID, cvb.arHandle from btCorePageTypeComposerControlOutput bco inner join CollectionVersionBlocks cvb on cvb.bID = bco.bID where ptComposerOutputControlID = ? and cvb.cID = ?', [$outputControl->getPageTypeComposerOutputControlID(), $mc->getCollectionID()]);
             }
         }
         if ($r) {
             $b = Block::getByID($r['bID'], $c, $r['arHandle']);
             $this->setPageTypeComposerControlBlockObject($b);
             return $this->b;
         }
     }
     return $this->b;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:25,代码来源:BlockControl.php

示例4: getBySectionOfSite

 /**
  * @param Page $page
  *
  * @return Section
  */
 public static function getBySectionOfSite($page)
 {
     $identifier = sprintf('/multilingual/section/%s', $page->getCollectionID());
     $cache = \Core::make('cache/request');
     $item = $cache->getItem($identifier);
     if (!$item->isMiss()) {
         $returnID = $item->get();
     } else {
         $item->lock();
         $tree = $page->getSiteTreeObject();
         $returnID = false;
         if ($tree instanceof SiteTree) {
             $returnID = $tree->getSiteHomePageID();
         }
         $cache->save($item->set($returnID));
     }
     if ($returnID) {
         return static::getByID($returnID);
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:25,代码来源:Section.php

示例5: movePageDisplayOrderToSibling

 public function movePageDisplayOrderToSibling(Page $c, $position = 'before')
 {
     // first, we get a list of IDs.
     $pageIDs = array();
     $db = Database::get();
     $r = $db->Execute('select cID from Pages where cParentID = ? and cID <> ? order by cDisplayOrder asc', array($this->getCollectionParentID(), $this->getCollectionID()));
     while ($row = $r->FetchRow()) {
         if ($row['cID'] == $c->getCollectionID() && $position == 'before') {
             $pageIDs[] = $this->cID;
         }
         $pageIDs[] = $row['cID'];
         if ($row['cID'] == $c->getCollectionID() && $position == 'after') {
             $pageIDs[] = $this->cID;
         }
     }
     $displayOrder = 0;
     foreach ($pageIDs as $cID) {
         $co = Page::getByID($cID);
         $co->updateDisplayOrder($displayOrder);
         $displayOrder++;
     }
 }
开发者ID:robertdamoc,项目名称:concrete5,代码行数:22,代码来源:Page.php

示例6: markPreviousFrontendPage

 public function markPreviousFrontendPage(Page $c)
 {
     $app = Application::getFacadeApplication();
     $app['session']->set('frontendPreviousPageID', $c->getCollectionID());
 }
开发者ID:a3020,项目名称:concrete5,代码行数:5,代码来源:User.php

示例7: refreshCollectionEdit

 /**
  * @param Page $c
  */
 public function refreshCollectionEdit(&$c)
 {
     if ($this->isLoggedIn() && $c->getCollectionCheckedOutUserID() == $this->getUserID()) {
         $app = Application::getFacadeApplication();
         $db = $app['database']->connection();
         $cID = $c->getCollectionID();
         $dh = $app->make('helper/date');
         $datetime = $dh->getOverridableNow();
         $q = 'update Pages set cCheckedOutDatetimeLastEdit = ? where cID = ?';
         $r = $db->executeQuery($q, array($datetime, $cID));
         $c->cCheckedOutDatetimeLastEdit = $datetime;
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:16,代码来源:User.php

示例8: setPage

 public function setPage(Page $page)
 {
     $this->cID = $page->getCollectionID();
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:4,代码来源:EditResponse.php

示例9: getBySectionOfSite

 /**
  * @param Page $page
  *
  * @return Section
  */
 public static function getBySectionOfSite($page)
 {
     $identifier = sprintf('/multilingual/section/%s', $page->getCollectionID());
     $cache = \Core::make('cache/request');
     $item = $cache->getItem($identifier);
     if (!$item->isMiss()) {
         $returnID = $item->get();
     } else {
         $item->lock();
         if ($page->getPageTypeHandle() == STACKS_PAGE_TYPE) {
             $parent = Page::getByID($page->getCollectionParentID());
             if ($parent->getCollectionPath() == STACKS_PAGE_PATH) {
                 // this is the default multilingual section.
                 return static::getDefaultSection();
             } else {
                 // this is a stack category page type
                 $locale = $parent->getCollectionHandle();
                 return static::getByLocale($locale);
             }
         }
         // looks at the page, traverses its parents until it finds the proper language
         $nav = \Core::make('helper/navigation');
         $pages = $nav->getTrailToCollection($page);
         $pages = array_reverse($pages);
         $pages[] = $page;
         $ids = self::getIDList();
         $returnID = false;
         foreach ($pages as $pc) {
             if (in_array($pc->getCollectionID(), $ids)) {
                 $returnID = $pc->getCollectionID();
             }
         }
         $item->set($returnID);
     }
     if ($returnID) {
         return static::getByID($returnID);
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:43,代码来源:Section.php

示例10: canPublishPageTypeBeneathTarget

 public function canPublishPageTypeBeneathTarget(Type $pagetype, \Concrete\Core\Page\Page $page)
 {
     return $page->getCollectionID() == $this->getParentPageID();
 }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:4,代码来源:ParentPageConfiguration.php

示例11: setPageObject

 public function setPageObject(Page $c)
 {
     $this->cID = $c->getCollectionPointerOriginalID() > 0 ? $c->getCollectionPointerOriginalID() : $c->getCollectionID();
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:4,代码来源:PagePath.php

示例12: getCollectionID

 public function getCollectionID()
 {
     return parent::getCollectionID();
 }
开发者ID:BacLuc,项目名称:newGryfiPage,代码行数:4,代码来源:__IDE_SYMBOLS__.php

示例13: getByDefaultsPage

 public static function getByDefaultsPage(Page $c)
 {
     if ($c->isMasterCollection()) {
         $db = Loader::db();
         $ptID = $db->GetOne('select ptID from PageTypePageTemplateDefaultPages where cID = ?', array($c->getCollectionID()));
         if ($ptID) {
             return static::getByID($ptID);
         }
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:10,代码来源:Type.php


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