示例#1
0
 public function view($ptID = false)
 {
     $this->pagetype = PageType::getByID($ptID);
     if (!$this->pagetype) {
         $this->redirect('/dashboard/pages/types');
     }
     $cmp = new \Permissions($this->pagetype);
     if (!$cmp->canEditPageType()) {
         throw new \Exception(t('You do not have access to edit this page type.'));
     }
     $this->set('pagetype', $this->pagetype);
 }
示例#2
0
 protected function setupPageType($ptID)
 {
     $this->pagetype = PageType::getByID($ptID);
     if (!$this->pagetype) {
         $this->redirect('/dashboard/pages/types');
     }
     $cmp = new \Permissions($this->pagetype);
     if (!$cmp->canEditPageType()) {
         throw new \Exception(t('You do not have access to edit this page type.'));
     }
     $this->defaultPage = $this->pagetype->getPageTypePageTemplateDefaultPageObject();
 }
示例#3
0
 public function view($ptID = false, $message = false)
 {
     $this->pagetype = PageType::getByID($ptID);
     if (!$this->pagetype) {
         $this->redirect('/dashboard/pages/types');
     }
     $cmp = new \Permissions($this->pagetype);
     if (!$cmp->canEditPageType()) {
         throw new \Exception(t('You do not have access to edit this page type.'));
     }
     switch ($message) {
         case 'layout_set_added':
             $this->set('success', t('Form layout set added.'));
             break;
         case 'layout_set_deleted':
             $this->set('success', t('Form layout set deleted.'));
             break;
         case 'layout_set_updated':
             $this->set('success', t('Form layout set updated.'));
             break;
     }
     $this->set('pagetype', $this->pagetype);
     $this->set('sets', PageTypeComposerFormLayoutSet::getList($this->pagetype));
 }