private function getForm() { $data = array('username' => array(GWF_Form::STRING, '', $this->module->lang('th_username'), $this->module->lang('tt_username', array(GWF_User::USERNAME_LENGTH))), 'password' => array(GWF_Form::PASSWORD, '', $this->module->lang('th_password'), $this->module->lang('tt_password'))); if ($this->module->wantEmailActivation()) { $data['email'] = array(GWF_Form::STRING, '', $this->module->lang('th_email'), $this->module->lang('tt_email')); } if ($this->module->hasMinAge()) { $data['birthdate'] = array(GWF_Form::DATE, 0, $this->module->lang('th_birthdate'), '', GWF_Date::LEN_DAY); } if ($this->module->wantCountrySelect()) { $cid = isset($_POST['countryid']) ? $_POST['countryid'] : GWF_IP2Country::detectCountryID(); $data['countryid'] = array(GWF_Form::SELECT, GWF_CountrySelect::single('countryid', $cid), $this->module->lang('th_countryid')); } if ($this->module->isTOSForced()) { if ('' !== ($href_tos = $this->module->cfgHrefTos())) { $data['tos'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_tos2', array(htmlspecialchars($href_tos)))); } else { $data['tos'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_tos')); } $data['eula'] = array(GWF_Form::VALIDATOR); } if ($this->module->wantCaptcha()) { $data['captcha'] = array(GWF_Form::CAPTCHA); } $data['register'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_register')); return new GWF_Form($this, $data); }
public function getForm(WC_Site $site, $is_admin) { $data = array(); $data['site_name'] = array(GWF_Form::STRING, $site->getVar('site_name'), $this->module->lang('th_site_name')); if ($is_admin) { $data['site_classname'] = array(GWF_Form::STRING, $site->getVar('site_classname'), $this->module->lang('th_site_classname')); $data['site_basescore'] = array(GWF_Form::INT, $site->getVar('site_basescore'), $this->module->lang('th_site_basescore')); $data['site_usercount'] = array(GWF_Form::INT, $site->getVar('site_usercount'), $this->module->lang('th_site_usercount')); $data['site_challcount'] = array(GWF_Form::INT, $site->getVar('site_challcount'), $this->module->lang('th_site_challcount')); $data['site_powarg'] = array(GWF_Form::INT, $site->getVar('site_powarg'), $this->module->lang('th_site_powarg')); $data['site_spc'] = array(GWF_Form::INT, $site->getVar('site_spc'), $this->module->lang('th_site_spc')); $data['site_color'] = array(GWF_Form::STRING, $site->getVar('site_color'), $this->module->lang('th_site_color')); } $data['site_status'] = array(GWF_Form::SELECT, $this->getStatusSelect($site), $this->module->lang('th_site_status')); $data['no_urlencode'] = array(GWF_Form::CHECKBOX, $site->isOptionEnabled(WC_Site::NO_URLENCODE), $this->module->lang('th_no_urlencode')); $data['auto_update'] = array(GWF_Form::CHECKBOX, $site->hasAutoUpdate(), $this->module->lang('th_autoupdate')); $data['onsite_rank'] = array(GWF_Form::CHECKBOX, $site->hasOnSiteRank(), $this->module->lang('th_site_has_osr')); $data['default_hide'] = array(GWF_Form::CHECKBOX, $site->isDefaultHidden(), $this->module->lang('th_default_hide')); if ($is_admin) { $data['linear'] = array(GWF_Form::CHECKBOX, $site->isLinear(), $this->module->lang('th_linear')); } $data['div0'] = array(GWF_Form::DIVIDER); if ($is_admin) { $data['divi0'] = array(GWF_Form::HEADLINE, $this->module->lang('pi_site_tags', array($site->displayTags(true)))); $data['site_tags'] = array(GWF_Form::STRING, $site->getVar('site_tags'), $this->module->lang('th_site_tags')); } $data['site_country'] = array(GWF_Form::SELECT, GWF_CountrySelect::single('site_country', Common::getPostString('site_country', $site->getCountryID())), $this->module->lang('th_site_country2')); if ($is_admin) { $data['site_language'] = array(GWF_Form::SELECT, GWF_LangSelect::single(0, 'site_language', $site->getLangID()), $this->module->lang('th_site_language2')); } if ($is_admin) { $data['site_joindate'] = array(GWF_Form::STRING, $site->getVar('site_joindate'), $this->module->lang('th_site_joindate'), '', GWF_Date::LEN_SECOND); } $data['site_launchdate'] = array(GWF_Form::DATE, $site->getVar('site_launchdate'), $this->module->lang('th_site_launchdate'), '', GWF_Date::LEN_DAY); if ($is_admin) { $data['site_authkey'] = array(GWF_Form::STRING, $site->getVar('site_authkey'), $this->module->lang('th_site_authkey')); } $data['site_xauthkey'] = array(GWF_Form::STRING, $site->getVar('site_xauthkey'), $this->module->lang('th_site_xauthkey')); $data['site_irc'] = array(GWF_Form::STRING, $site->getVar('site_irc'), $this->module->lang('th_site_irc')); $data['div2'] = array(GWF_Form::DIVIDER); $data['div3'] = array(GWF_Form::HEADLINE, $this->module->lang('pi_site_urls')); $data['site_url'] = array(GWF_Form::STRING, $site->getVar('site_url'), $this->module->lang('th_site_url')); $data['site_url_mail'] = array(GWF_Form::STRING, $site->getVar('site_url_mail'), $this->module->lang('th_site_url_mail')); $data['site_url_score'] = array(GWF_Form::STRING, $site->getVar('site_url_score'), $this->module->lang('th_site_url_score')); $data['site_url_profile'] = array(GWF_Form::STRING, $site->getVar('site_url_profile'), $this->module->lang('th_site_url_profile')); $data['div4'] = array(GWF_Form::DIVIDER); $data['div5'] = array(GWF_Form::HEADLINE, $this->l('pi_warboxes')); $data['no_v1'] = array(GWF_Form::CHECKBOX, $site->isNoV1(), $this->l('th_no_v1'), $this->l('tt_no_v1')); // $data['warenbl'] = array(GWF_Form::CHECKBOX, $site->isWarBox(), $this->l('th_warbox')); // $data['warhost'] = array(GWF_Form::STRING, $site->getWarHost(), $this->l('th_warhost')); // $data['warport'] = array(GWF_Form::INT, $site->getWarPort(), $this->l('th_warport')); // $data['warscrd'] = array(GWF_Form::INT, $site->getWarReduceScore(), $this->l('th_war_score_reduce')); // $data['site_description'] = array(GWF_Form::MESSAGE, $site->getVar('site_description'), $this->module->lang('th_site_description')); $data['edit'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_edit_site')); return new GWF_Form($this, $data); }
public function getCountrySelect($name = 'country') { return GWF_CountrySelect::single($name, Common::getPostString($name, $this->getCountryID())); }
private function getForm() { $g = $this->group; $data = array('group_name' => array(GWF_Form::STRING, $g->getVar('group_name'), $this->module->lang('th_group_name')), 'view' => array(GWF_Form::SELECT, $this->getGroupViewSelect($g->getVisibleMode(), 'view'), $this->module->lang('th_group_sel_view')), 'join' => array(GWF_Form::SELECT, $this->getGroupInviteSelect($g->getJoinMode(), 'join'), $this->module->lang('th_group_sel_join')), 'lang' => array(GWF_Form::SELECT, GWF_LangSelect::single(0, 'lang', $g->getVar('group_lang')), $this->module->lang('th_group_lang')), 'country' => array(GWF_Form::SELECT, GWF_CountrySelect::single('country', $g->getVar('group_country')), $this->module->lang('th_group_country')), 'founder' => array(GWF_Form::STRING, $g->getFounder()->getVar('user_name'), $this->module->lang('th_group_founder')), 'edit' => array(GWF_Form::SUBMIT, $this->module->lang('btn_edit'))); return new GWF_Form($this, $data); }
private static function getObjectSelect(GWF_Module $module, GDO $gdo, $c, $classname) { if ($classname === 'GWF_Country') { return GWF_CountrySelect::single($c, $gdo->getVar($c)); } die('Unsupported object in GWF_FormGDO::getObjectSelect: ' . $classname); }
private function formSearch() { $data = array('username' => array(GWF_Form::STRING, '', $this->module->lang('th_user_name')), 'minlevel' => array(GWF_Form::INT, 0, $this->module->lang('th_user_level')), 'email' => array(GWF_Form::STRING, '', $this->module->lang('th_user_email')), 'country' => array(GWF_Form::SELECT, GWF_CountrySelect::single('country', Common::getPost('country')), $this->module->lang('th_country')), 'language' => array(GWF_Form::SELECT, GWF_LangSelect::single(0, 'language', Common::getPost('language')), $this->module->lang('th_language')), 'gender' => array(GWF_Form::SELECT, GWF_Gender::select('gender', Common::getPost('gender')), $this->module->lang('th_gender')), 'hasmail' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_hasmail')), 'haswww' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_haswww')), 'icq' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_icq')), 'msn' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_msn')), 'jabber' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_jabber')), 'skype' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_skype')), 'yahoo' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_yahoo')), 'aim' => array(GWF_Form::CHECKBOX, false, $this->module->lang('th_aim')), 'search' => array(GWF_Form::SUBMIT, $this->module->lang('btn_search'))); return new GWF_Form($this, $data); }