Ejemplo n.º 1
0
 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();
 }