private function onTranslate() { $form = $this->getForm(); if (false !== ($error = $form->validate($this->module))) { #, array('transid', 'langid', 'title', 'message')))) { return $error . $this->templateEdit(); } $transid = $form->getVar('transid'); if (false === ($lang = GWF_Language::getByID($transid))) { return $this->module->error('err_lang_dest') . $this->templateEdit(); } if ($form->getVar('langid') === $transid) { return $this->module->error('err_equal_translang', array($this->lang->displayName())) . $this->templateEdit(); } if (false === $this->news->saveTranslation($transid, $form->getVar('title'), $form->getVar('message'))) { return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__)) . $this->templateEdit(); } $this->lang = $lang; $back = ''; // if ($this->module->cfgNewsInForum() && (!$this->news->isHidden())) // { // $back = $this->newsToForum($this->news); // } return $back . $this->module->message('msg_translated', array($this->news->displayTitle(), $lang->displayName())) . $this->templateEdit(); }
private function onReply(Module_Comments $mod_c, GWF_News $news, GWF_Comments $comments) { $ipp = 10; $nItems = $comments->getVar('cmts_count'); $nPages = GWF_PageMenu::getPagecount($ipp, $nItems); $page = Common::clamp(Common::getGetInt('cpage'), 1, $nPages); $href = GWF_WEB_ROOT . 'news-comments-' . $news->getID() . '-' . $news->displayTitle() . '-page-' . $page . '.html'; $me = $mod_c->getMethod('Reply'); $me instanceof Comments_Reply; return $me->onReply($href); }