Пример #1
0
 public function doPageDelete(CMSPage $page, $extra)
 {
     $page->delete();
 }
Пример #2
0
 /**
  * Return a string containing the admin interface for the Content Module
  *
  * @return string
  */
 public function getAdminInterface()
 {
     include 'include/CMSPage.php';
     $this->smarty->assign('hasRestriction', $this->hasRestriction());
     switch (@$_REQUEST['section']) {
         case 'viewLayers':
             switch (@$_REQUEST['action']) {
                 case 'deleteRev':
                     $this->deleteRev($_REQUEST['id']);
                     $this->topLevelInterface();
                     break;
                 default:
                     $this->viewLayers($_REQUEST['id']);
                     break;
             }
             break;
         case 'deletePage':
             $page = new CMSPage($_REQUEST['id']);
             $page->delete();
             $this->topLevelInterface();
             break;
         case 'wizard':
             if (@isset($_REQUEST['wizardStep'])) {
                 $this->startWizard(@$_REQUEST['wizardStep'] + 1);
             } else {
                 $this->startWizard();
             }
             break;
         case 'templates':
             $this->addJS('/modules/Content/js/admin.js');
             require_once 'include/ContentTemplate.php';
             $templates = ContentTemplate::getAllContentTemplates();
             $this->smarty->assign('templates', $templates);
             return $this->smarty->fetch('admin/content_templates.tpl');
             break;
         case 'addEdit':
             switch (@$_REQUEST['action']) {
                 case 'createRev':
                     $this->createRev($_REQUEST['id']);
                     break;
                 case 'updatePage':
                     $this->updateRev();
                     $this->topLevelInterface();
                     break;
                 case 'editMeta':
                     $this->getMetaEditor(@$_REQUEST['id']);
                     $this->template = 'admin/content_addedit.tpl';
                     if (isset($_REQUEST['submit'])) {
                         $this->topLevelInterface();
                     }
                     break;
             }
             break;
         case 'toggle':
             $page = new CMSPage($_REQUEST['id']);
             if ($page->getAccess() == 'public') {
                 $page->setAccess('restricted');
                 $page->save();
             } else {
                 $page->setAccess('public');
                 $page->save();
             }
             $this->topLevelInterface();
             break;
         default:
             switch (@$_REQUEST['action']) {
                 default:
                     $this->topLevelInterface();
                     break;
             }
     }
     return $this->smarty->fetch($this->template);
 }