Beispiel #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);
 }
Beispiel #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();
 }
Beispiel #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->canEditPageTypePermissions()) {
         throw new \Exception(t('You do not have access to edit this page type permissions.'));
     }
     switch ($message) {
         case 'updated':
             $this->set('success', t('Permissions updated successfully.'));
             break;
     }
     $this->set('defaultPage', $this->pagetype->getPageTypePageTemplateDefaultPageObject());
     $this->set('pagetype', $this->pagetype);
 }
Beispiel #4
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));
 }