private function onUnlock() { if (!$this->is_author) { return GWF_HTML::err('ERR_NO_PERMISSION'); } $href_unlock = GWF_WEB_ROOT . sprintf('index.php?mo=PageBuilder&me=Moderate&token=%s&pageid=%s&action=unlock', $this->page->getHashcode(), $this->page->getID()); return $this->module->message('msg_unlock_confirm', array($href_unlock)); }
private function getPageCommentsForm(GWF_Page $page) { if (isset($_POST['reply']) || !$page->isOptionEnabled(GWF_Page::COMMENTS)) { return ''; } $reply = $this->mod_c->getMethod('Reply'); $reply instanceof Comments_Reply; $href = $this->getMethodHREF('&pageid=' . $page->getID()); return $reply->templateReply($href); }
public static function onDelete(GWF_Page $page) { return self::table(__CLASS__)->deleteWhere('pgid_oid=' . $page->getID()); }
private function sendModMail($userid, GWF_Page $page) { if (false === ($user = GWF_User::getByID($userid))) { return false; } if ('' === ($email = $user->getValidMail())) { return false; } $mail = new GWF_Mail(); $mail->setSender(GWF_BOT_EMAIL); $mail->setReceiver($email); $mail->setSubject($this->module->lang('subj_mod')); # Collect data $token = $page->getHashcode(); $pid = $page->getID(); $href_enable = Common::getAbsoluteURL(sprintf('index.php?mo=PageBuilder&me=Moderate&token=%s&pageid=%s&action=unlock', $token, $pid)); $href_delete = Common::getAbsoluteURL(sprintf('index.php?mo=PageBuilder&me=Moderate&token=%s&pageid=%s&action=delete', $token, $pid)); $mail->setBody($this->module->lang('body_mod', array($user->displayUsername(), $page->display('page_author_name'), $page->display('page_url'), $page->display('page_title'), $page->display('page_meta_tags'), $page->display('page_meta_desc'), $page->display('page_inline_css'), $page->display('page_content'), GWF_HTML::anchor($href_enable, $href_enable), GWF_HTML::anchor($href_delete, $href_delete)))); return $mail->sendToUser($user); }