Beispiel #1
0
 public function execute()
 {
     if (false === ($this->page = GWF_Page::getByID(Common::getGetString('pageid')))) {
         return $this->module->lang('err_page');
     }
     if ($this->page->isLocked()) {
         return $this->module->lang('err_locked');
     }
     $this->user = GWF_User::getStaticOrGuest();
     if (false === ($this->is_author = $this->module->isAuthor($this->user))) {
         if (false === $this->module->cfgLockedPosting()) {
             return GWF_HTML::err('ERR_NO_PERMISSION');
         } else {
             $this->locked_mode = true;
         }
     }
     $back = '';
     if (isset($_POST['translate'])) {
         $back .= $this->onTranslate($this->page);
     } elseif (isset($_POST['upload'])) {
         require_once GWF_CORE_PATH . 'module/PageBuilder/PB_Uploader.php';
         $back .= PB_Uploader::onUpload($this->module);
     }
     return $back . $this->templateTranslate($this->page);
 }
Beispiel #2
0
 public function execute()
 {
     if (false === ($page = GWF_Page::getByID(Common::getGetString('pageid')))) {
         return $this->module->error('err_page');
     }
     $user = GWF_User::getStaticOrGuest();
     $this->is_author = $this->module->isAuthor($user);
     $this->is_owner = $this->is_author || $page->isOwner($user);
     if (!$this->is_owner && !$this->is_author) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     $this->page = $page;
     $this->user = $user;
     $this->is_oowner = $this->is_author ? true : $page->getOtherPage()->isOwner($user);
     $back = '';
     if (isset($_POST['edit'])) {
         $back .= $this->onEdit();
     } elseif (isset($_POST['unlock'])) {
         return $this->onUnlock() . $this->templateEdit();
     } elseif (isset($_POST['delete'])) {
         return $this->onDelete() . $this->templateEdit();
     } elseif (isset($_POST['translate'])) {
         GWF_Website::redirect($this->module->getMethodURL('Translate', '&pageid=' . $page->getID()));
         die;
     } elseif (isset($_POST['upload'])) {
         require_once GWF_CORE_PATH . 'module/PageBuilder/PB_Uploader.php';
         $back .= PB_Uploader::onUpload($this->module) . $this->templateEdit();
     }
     return $back . $this->templateEdit();
 }
Beispiel #3
0
 public function execute()
 {
     $this->user = GWF_User::getStaticOrGuest();
     if (false === ($this->is_author = $this->module->isAuthor($this->user))) {
         if (false === $this->module->cfgLockedPosting()) {
             return GWF_HTML::err('ERR_NO_PERMISSION');
         } else {
             $this->locked_mode = true;
         }
     }
     if (isset($_POST['preview'])) {
         return $this->onPreview() . $this->templateAdd();
     } elseif (isset($_POST['add'])) {
         return $this->onAdd();
     } elseif (isset($_POST['upload'])) {
         require_once GWF_CORE_PATH . 'module/PageBuilder/PB_Uploader.php';
         return PB_Uploader::onUpload($this->module) . $this->templateAdd();
     }
     return $this->templateAdd();
 }