Beispiel #1
0
 public function validate_langid(Module_News $module, $langid)
 {
     if (!GWF_LangSelect::isValidLanguage($langid, false)) {
         return $this->module->lang('err_langid');
     }
     return false;
 }
Beispiel #2
0
 private function getForm()
 {
     $langid = $this->lang->getID();
     $t = $this->news->getTranslationB($langid);
     $title = $t['newst_title'];
     $message = $t['newst_message'];
     //		GWF_Language::setShowSupported(true);
     $data = array('langid' => array(GWF_Form::HIDDEN, $langid), 'title' => array(GWF_Form::STRING, $title, $this->module->lang('th_title')), 'message' => array(GWF_Form::MESSAGE, $message, $this->module->lang('th_message')), 'hidden' => array(GWF_Form::CHECKBOX, $this->news->isHidden(), $this->module->lang('th_hidden')), 'mailme' => array(GWF_Form::CHECKBOX, $this->news->isToBeMailed(), $this->module->lang('th_mail_me')), 'preview' => array(GWF_Form::SUBMIT, $this->module->lang('btn_preview'), ''), 'edit' => array(GWF_Form::SUBMIT, $this->module->lang('btn_edit'), ''), 'transid' => array(GWF_Form::SELECT, GWF_LangSelect::single(GWF_Language::SUPPORTED, 'transid'), $this->module->lang('th_transid')), 'translate' => array(GWF_Form::SUBMIT, $this->module->lang('btn_translate'), ''));
     return new GWF_Form($this, $data);
 }
Beispiel #3
0
 private function getForm($row)
 {
     $user = GWF_User::getStaticOrGuest();
     if ($row === false) {
         $email = $user->getValidMail();
         $type = 0;
         $langid = GWF_Language::getCurrentID();
     } else {
         $email = $row->getEMail();
         $type = $row->getType();
         $langid = $row->getLangID();
     }
     $data = array('email' => array(GWF_Form::STRING, $email, $this->module->lang('th_email')), 'type' => array(GWF_Form::SELECT, GWF_Newsletter::getTypeSelectB($this->module, 'type', $type), $this->module->lang('th_type')), 'langid' => array(GWF_Form::SELECT, GWF_LangSelect::single(GWF_Language::SUPPORTED, 'langid', $langid), $this->module->lang('th_langid')), 'sign' => array(GWF_Form::SUBMIT, $this->module->lang('btn_sign'), ''));
     return new GWF_Form(GDO::table('GWF_Newsletter'), $data);
 }
Beispiel #4
0
 private function getForm()
 {
     $tags = Common::getPostString('link_tags', Common::getGet('tag'));
     $data = array('link_lang' => array(GWF_Form::SELECT, GWF_LangSelect::single(GWF_LangSelect::TYPE_SUPPORTED, 'link_lang'), $this->module->lang('th_link_lang')), 'link_score' => array(GWF_Form::STRING, '0', $this->module->lang('th_link_score'), $this->module->lang('tt_link_score')), 'link_gid' => array(GWF_Form::SELECT, GWF_GroupSelect::single('link_gid'), $this->module->lang('th_link_gid'), $this->module->lang('tt_link_gid')), 'tag_info' => array(GWF_Form::HEADLINE, '', $this->module->lang('info_tag')), 'known_tags' => array(GWF_Form::HEADLINE, '', $this->collectTags()), 'link_tags' => array(GWF_Form::STRING, $tags, $this->module->lang('th_link_tags')), 'div1' => array(GWF_Form::DIVIDER), 'link_href' => array(GWF_Form::STRING, '', $this->module->lang('th_link_href'), $this->module->lang('tt_link_href')), 'link_descr' => array(GWF_Form::STRING, '', $this->module->lang('th_link_descr')));
     if ($this->module->cfgLongDescription()) {
         $data['link_descr2'] = array(GWF_Form::MESSAGE, '', $this->module->lang('th_link_descr2'));
     }
     $data['link_options&' . GWF_Links::MEMBER_LINK] = array(GWF_Form::CHECKBOX, isset($_POST['link_options&' . GWF_Links::MEMBER_LINK]), $this->module->lang('th_link_options&' . GWF_Links::MEMBER_LINK));
     if (GWF_User::isLoggedIn()) {
         $data['link_options&' . GWF_Links::UNAFILIATE] = array(GWF_Form::CHECKBOX, isset($_POST['link_options&' . GWF_Links::UNAFILIATE]), $this->module->lang('th_link_options&' . GWF_Links::UNAFILIATE));
         $data['link_options&' . GWF_Links::ONLY_PRIVATE] = array(GWF_Form::CHECKBOX, isset($_POST['link_options&' . GWF_Links::ONLY_PRIVATE]), $this->module->lang('th_link_options&' . GWF_Links::ONLY_PRIVATE));
     }
     if (!GWF_Session::isLoggedIn() && $this->module->cfgGuestCaptcha()) {
         $data['captcha'] = array(GWF_Form::CAPTCHA);
     }
     $data['buttons'] = array(GWF_Form::SUBMITS, array('preview' => $this->module->lang('btn_preview'), 'add' => $this->module->lang('btn_add')));
     return new GWF_Form($this, $data);
 }
Beispiel #5
0
 private function formEdit(GWF_HelpdeskFAQ $faq)
 {
     $data = array('lang' => array(GWF_Form::SELECT, GWF_LangSelect::single(1, 'lang', $faq->getVar('hdf_langid')), $this->module->lang('th_lang'), $this->module->lang('tt_lang')), 'question' => array(GWF_Form::STRING, $faq->getVar('hdf_question'), $this->module->lang('th_question')), 'answer' => array(GWF_Form::MESSAGE, $faq->getVar('hdf_answer'), $this->module->lang('th_answer')), 'delete_confirm' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_confirm_del')), 'delete_confirm_v' => array(GWF_Form::VALIDATOR), 'add' => array(GWF_Form::SUBMITS, array('edit' => $this->module->lang('btn_edit_faq'), 'delete' => $this->module->lang('btn_rem_faq'))));
     return new GWF_Form($this, $data);
 }
Beispiel #6
0
 public function validate_lang2(Module_Admin $module, $arg)
 {
     return GWF_LangSelect::validate_langid($arg, true);
 }
Beispiel #7
0
 public function validate_lang($m, $arg)
 {
     if (false !== ($error = GWF_LangSelect::validate_langid($arg, true))) {
         return $error;
     }
     $lid = (int) $arg;
     $oid = $this->page->getOtherID();
     if (false === GDO::table('GWF_Page')->selectVar('1', "page_otherid={$oid} AND page_lang={$lid}")) {
         return false;
     }
     return $m->lang('err_dup_lid');
 }
Beispiel #8
0
 public function validate_site_language(Module_WeChall $m, $arg)
 {
     return GWF_LangSelect::validate_langid($arg, false);
 }
Beispiel #9
0
 private function getForm()
 {
     $data = array('langs' => array(GWF_Form::SELECT, GWF_LangSelect::single(0, 'langs', Common::getPost('langs', 'en'), true), $this->module->lang('th_langs')), 'warns' => array(GWF_Form::CHECKBOX, true, $this->module->lang('th_warns')), 'check' => array(GWF_Form::SUBMIT, $this->module->lang('btn_check')));
     return new GWF_Form($this, $data);
 }
Beispiel #10
0
 public static function vaildate_language(Module_Links $module, $arg)
 {
     return GWF_LangSelect::validate_langid($arg, false, GWF_LangSelect::TYPE_SUPPORTED);
 }
Beispiel #11
0
 public function validate_lang($m, $arg)
 {
     return GWF_LangSelect::validate_langid($arg, true);
 }
Beispiel #12
0
 public function validate_langid(Module_Category $module, $langid)
 {
     if (!GWF_LangSelect::isValidLanguage($langid, true)) {
         $_POST['langid'] = 0;
         return $this->module->lang('err_invalid_langid');
     }
     if (self::$cat->getTranslation($langid) !== false) {
         $_POST['langid'] = 0;
         return $this->module->lang('err_dup_langid');
     }
     return false;
 }
Beispiel #13
0
 private function getForm()
 {
     $data = array('target' => array(GWF_Form::SELECT, GWF_LangSelect::single(0, 'target', Common::getPost('target')), $this->module->lang('th_target')), 'all_targets' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_all_targets')), 'missing' => array(GWF_Form::SUBMIT, $this->module->lang('btn_missing')), 'bundle' => array(GWF_Form::SUBMIT, $this->module->lang('btn_bundle')));
     return new GWF_Form($this, $data);
 }
Beispiel #14
0
 public function validate_langid2(Module_Account $module, $arg)
 {
     if (false === GWF_LangSelect::isValidLanguage($arg, true)) {
         return $this->module->lang('err_lang2');
     }
     return false;
 }
Beispiel #15
0
 private function formQuicksearch()
 {
     $data = array('mo' => array(GWF_Form::HIDDEN, 'PageBuilder'), 'me' => array(GWF_Form::HIDDEN, 'Search'), 'lang' => array(GWF_Form::SELECT, GWF_LangSelect::single(GWF_Language::SUPPORTED, 'lang', Common::getGetInt('lang', 0))), 'term' => array(GWF_Form::STRING_NO_CHECK, '', $this->module->lang('th_term')), 'quicksearch' => array(GWF_Form::SUBMIT, $this->module->lang('btn_search')));
     return new GWF_Form($this, $data, GWF_Form::METHOD_GET);
 }
Beispiel #16
0
 public static function validate_language(Module_Usergroups $m, $v)
 {
     return GWF_LangSelect::validate_langid($v, true);
 }