Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public function onEnable(GWF_Page $page)
 {
     # Already enabled
     if (!$page->isLocked()) {
         return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__));
     }
     # Push to history
     if (false === GWF_PageHistory::push($page)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     # Save flag
     if (false === $page->saveOption(GWF_Page::LOCKED, false)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     # Yay!
     return $this->module->message('msg_enabled', htmlspecialchars($page->hrefShow()));
 }