public function view() { parent::view(); $bg = $this->city->fullbg; if ($bg) { $this->bodyData['bg'] = $bg->getURL(); } $this->bodyData['classes'][] = 'city-page'; $this->bodyData['pageViewName'] = 'CityPageView'; $this->set('bodyData', $this->bodyData); $this->set('pageType', 'city-page'); $this->set('isCityOrganizer', (new User())->getUserID() === $this->city->cityOrganizer->getUserID()); $this->set('isLoggedIn', (bool) Loader::helper('concrete/dashboard')->canRead()); $this->set('isCampaignActive', false); // Is the donations campaign running? $this->set('canEdit', is_object(ComposerPage::getByID($this->c->getCollectionID()))); $this->set('city', $this->city); // Make JSON available $this->addToJanesWalk(['city' => $this->city]); // Are there blog entries for this city? $blog = new PageList(); $blog->filterByCollectionTypeHandle('city_blog'); $blog->filterByParentID($this->c->getCollectionID()); $this->set('blog', $blog->get(1)[0]); }
public function view() { parent::view(); $dh = Loader::helper('concrete/dashboard'); $im = Loader::helper('image'); $c = Page::getCurrentPage(); $ui = UserInfo::getByID($c->getCollectionUserID()); if ($imAtt = $c->getAttribute('main_image')) { $this->set('headImage', $im->getThumbnail($imAtt, 800, 800)); } $this->set('isLoggedIn', $dh->canRead()); $this->set('canEdit', is_object(ComposerPage::getByID($c->getCollectionID()))); $this->set('authorName', ($first_name = $ui->getAttribute('first_name')) ? "{$first_name} {$ui->getAttribute('last_name')}" : $ui->getUserObject()->getUserName()); $this->set('publishDate', $c->getCollectionDatePublic(DATE_APP_GENERIC_MDY_FULL)); $this->set('pageType', 'blog'); }
public function getMyDrafts() { $db = Loader::db(); $u = new User(); $r = $db->Execute('select ComposerDrafts.cID from ComposerDrafts inner join Pages on ComposerDrafts.cID = Pages.cID inner join Collections on Collections.cID = Pages.cID where uID = ? order by cDateModified desc', array($u->getUserID())); $pages = array(); while ($row = $r->FetchRow()) { $entry = ComposerPage::getByID($row['cID']); if (is_object($entry)) { $pages[] = $entry; } } return $pages; }
<?php defined('C5_EXECUTE') or die("Access Denied."); Loader::model('collection_types'); $dh = Loader::helper('date'); $dt = Loader::helper('form/date_time'); if ($cp->canAdminPage()) { // if it's composer mode and we have a target, then we hack the permissions collection id if (isset($isComposer) && $isComposer) { $cd = ComposerPage::getByID($c->getCollectionID()); if ($cd->isComposerDraft()) { if ($cd->getComposerDraftPublishParentID() > 0) { if ($cd->getCollectionInheritance() == 'PARENT') { $c->cParentID = $cd->getComposerDraftPublishParentID(); $cpID = $c->getParentPermissionsCollectionID(); $c->cInheritPermissionsFromCID = $cpID; } } } } $gl = new GroupList($c); $gArray = $gl->getGroupList(); $ul = new UserInfoList($c); $ulArray = $ul->getUserInfoList(); $ctArray = CollectionType::getList($c); } $saveMsg = t('Save permissions first.'); ?> <div class="ccm-pane-controls">
public function select_publish_target() { $parent = Page::getByID($this->post('cPublishParentID')); $str = ''; if (!is_object($parent) || $parent->isError()) { print t('Invalid parent page.'); exit; } else { $entry = ComposerPage::getByID($this->post('entryID')); if (!is_object($entry) || (!$entry->isComposerDraft())) { print t('Invalid composer draft.'); exit; } $ct = CollectionType::getByID($entry->getCollectionTypeID()); $cp = new Permissions($parent); if (!$cp->canAddSubCollection($ct)) { print t('You do not have permissions to add this page type in that location.'); exit; } } $entry->setComposerDraftPublishParentID($this->post('cPublishParentID')); print $this->getComposerDraftPublishText($entry); exit; }
<?php defined('C5_EXECUTE') or die("Access Denied."); $navigation = Loader::helper('navigation'); $th = Loader::helper('text'); $sh = Loader::helper('concrete/dashboard'); if (!$sh->canAccessComposer()) { die(t('Access Denied')); } $entry = ComposerPage::getByID($_REQUEST['cID'], 'RECENT'); if (!is_object($entry)) { die(t('Access Denied')); } $ct = CollectionType::getByID($entry->getCollectionTypeID()); $function = 'ccm_composerSelectParentPage'; if ($_REQUEST['submitOnChoose']) { $function = 'ccm_composerSelectParentPageAndSubmit'; } switch($ct->getCollectionTypeComposerPublishMethod()) { case 'PAGE_TYPE': Loader::model('page_list'); $pages = array(); $pl = new PageList(); $pl->sortByName(); $pl->filterByCollectionTypeID($ct->getCollectionTypeComposerPublishPageTypeID()); $pages = $pl->get(); ?> <h1><?php echo t("Where do you want to publish this page?")?></h1>