本文整理汇总了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, ' ');
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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++;
}
}
示例6: markPreviousFrontendPage
public function markPreviousFrontendPage(Page $c)
{
$app = Application::getFacadeApplication();
$app['session']->set('frontendPreviousPageID', $c->getCollectionID());
}
示例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;
}
}
示例8: setPage
public function setPage(Page $page)
{
$this->cID = $page->getCollectionID();
}
示例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);
}
}
示例10: canPublishPageTypeBeneathTarget
public function canPublishPageTypeBeneathTarget(Type $pagetype, \Concrete\Core\Page\Page $page)
{
return $page->getCollectionID() == $this->getParentPageID();
}
示例11: setPageObject
public function setPageObject(Page $c)
{
$this->cID = $c->getCollectionPointerOriginalID() > 0 ? $c->getCollectionPointerOriginalID() : $c->getCollectionID();
}
示例12: getCollectionID
public function getCollectionID()
{
return parent::getCollectionID();
}
示例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);
}
}
}