private function getForm(GWF_VoteMulti $poll, GWF_User $user) { $data = array(); $data['title'] = array(GWF_Form::STRING, $poll->getVar('vm_title'), $this->module->lang('th_title')); $data['guest'] = array(GWF_Form::CHECKBOX, $poll->isGuestVoteAllowed(), $this->module->lang('th_guests')); $data['multi'] = array(GWF_Form::CHECKBOX, $poll->isMultipleChoice(), $this->module->lang('th_multi')); $data['enabled'] = array(GWF_Form::CHECKBOX, $poll->isEnabled(), $this->module->lang('th_enabled')); if (Module_Votes::mayAddGlobalPoll(GWF_Session::getUser())) { $data['public'] = array(GWF_Form::CHECKBOX, $poll->isGlobal(), $this->module->lang('th_vm_public')); } $data['view'] = array(GWF_Form::SELECT, GWF_VoteMulti::getViewSelect($this->module, 'view', $poll->getViewFlag()), $this->module->lang('th_mvview')); $data['gid'] = array(GWF_Form::SELECT, GWF_GroupSelect::single('gid', $poll->getGroupID(), true, true), $this->module->lang('th_vm_gid')); $data['level'] = array(GWF_Form::INT, $poll->getLevel(), $this->module->lang('th_vm_level')); $data['edit'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_edit')); return new GWF_Form($this, $data); }
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); }
private function getForm() { $l = $this->link; $data = array('link_score' => array(GWF_Form::STRING, $l->getVar('link_score'), $this->module->lang('th_link_score'), $this->module->lang('tt_link_score')), 'link_gid' => array(GWF_Form::SELECT, GWF_GroupSelect::single('link_gid', $l->getGroupID(), true, true), $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, $l->getVar('link_tags'), $this->module->lang('th_link_tags')), 'div1' => array(GWF_Form::DIVIDER), 'link_href' => array(GWF_Form::STRING, $l->getVar('link_href'), $this->module->lang('th_link_href'), $this->module->lang('tt_link_href')), 'link_descr' => array(GWF_Form::STRING, $l->getVar('link_descr'), $this->module->lang('th_link_descr'))); if ($this->module->cfgLongDescription()) { $data['link_descr2'] = array(GWF_Form::MESSAGE, $l->display('link_descr2'), $this->module->lang('th_link_descr2')); } $data['link_options&' . GWF_Links::UNAFILIATE] = array(GWF_Form::CHECKBOX, $l->isUnafiliated(), $this->module->lang('th_link_options&' . GWF_Links::UNAFILIATE)); $data['link_options&' . GWF_Links::MEMBER_LINK] = array(GWF_Form::CHECKBOX, $l->isMemberLink(), $this->module->lang('th_link_options&' . GWF_Links::MEMBER_LINK)); $data['link_options&' . GWF_Links::ONLY_PRIVATE] = array(GWF_Form::CHECKBOX, $l->isPrivate(), $this->module->lang('th_link_options&' . GWF_Links::ONLY_PRIVATE)); if (GWF_User::isStaffS()) { $data['link_options&' . GWF_Links::STICKY] = array(GWF_Form::CHECKBOX, $l->isSticky(), $this->module->lang('th_link_options&' . GWF_Links::STICKY)); $data['link_options&' . GWF_Links::IN_MODERATION] = array(GWF_Form::CHECKBOX, $l->isInModeration(), $this->module->lang('th_link_options&' . GWF_Links::IN_MODERATION)); } $data['edit'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_edit'), ''); $data['delete'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_delete'), ''); return new GWF_Form($this, $data); }
private function getForm(GWF_Download $dl) { $data = array(); $data['filename'] = array(GWF_Form::STRING, $dl->getVar('dl_filename'), $this->module->lang('th_dl_filename')); $data['group'] = array(GWF_Form::SELECT, GWF_GroupSelect::single('group', $dl->getVar('dl_gid')), $this->module->lang('th_dl_gid')); $data['level'] = array(GWF_Form::INT, $dl->getVar('dl_level'), $this->module->lang('th_dl_level')); if (GWF_User::isAdminS()) { $data['price'] = array(GWF_Form::FLOAT, $dl->getVar('dl_price'), $this->module->lang('th_dl_price')); } $data['expire'] = array(GWF_Form::STRING, GWF_Time::humanDuration($dl->getVar('dl_expire')), $this->module->lang('th_dl_expire'), $this->module->lang('tt_dl_expire')); $data['guest_view'] = array(GWF_Form::CHECKBOX, $dl->isOptionEnabled(GWF_Download::GUEST_VISIBLE), $this->module->lang('th_dl_guest_view'), $this->module->lang('tt_dl_guest_view')); $data['guest_down'] = array(GWF_Form::CHECKBOX, $dl->isOptionEnabled(GWF_Download::GUEST_DOWNLOAD), $this->module->lang('th_dl_guest_down'), $this->module->lang('tt_dl_guest_down')); $data['adult'] = array(GWF_Form::CHECKBOX, $dl->isOptionEnabled(GWF_Download::ADULT), $this->module->lang('th_adult')); $data['huname'] = array(GWF_Form::CHECKBOX, $dl->isOptionEnabled(GWF_Download::HIDE_UNAME), $this->module->lang('th_huname')); $data['enabled'] = array(GWF_Form::CHECKBOX, $dl->isEnabled(), $this->module->lang('th_enabled')); $data['descr'] = array(GWF_Form::MESSAGE, $dl->getVar('dl_descr'), $this->module->lang('th_dl_descr')); $data['buttons'] = array(GWF_Form::SUBMITS, array('edit' => $this->module->lang('btn_edit'), 'delete' => $this->module->lang('btn_delete'))); return new GWF_Form($this, $data); }
private function getForm() { $data = array(); if (false === ($file = $this->getFile())) { $name = ''; $size = ''; } else { $_POST['filename'] = $name = $file['name']; $size = $file['size']; } $data['filename'] = array(GWF_Form::STRING, $name, $this->module->lang('th_dl_filename')); if ($file === false) { $data['file'] = array(GWF_Form::FILE_OPT, '', $this->module->lang('th_file')); if (GWF_User::isLoggedIn()) { $data['upload'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_upload')); } } else { $data['size'] = array(GWF_Form::SSTRING, $size, $this->module->lang('th_dl_size')); $data['remove'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_remove')); } $data['group'] = array(GWF_Form::SELECT, GWF_GroupSelect::single('group', Common::getPost('group')), $this->module->lang('th_dl_gid')); $data['level'] = array(GWF_Form::INT, '0', $this->module->lang('th_dl_level')); if (GWF_User::isAdminS()) { $data['price'] = array(GWF_Form::FLOAT, '0.00', $this->module->lang('th_dl_price')); } $data['expire'] = array(GWF_Form::STRING, '0 seconds', $this->module->lang('th_dl_expire'), $this->module->lang('tt_dl_expire')); $data['guest_view'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_dl_guest_view'), $this->module->lang('tt_dl_guest_view')); $data['guest_down'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_dl_guest_down'), $this->module->lang('tt_dl_guest_down')); $data['adult'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_adult')); if (GWF_User::isLoggedIn()) { $data['huname'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_huname')); } $data['descr'] = array(GWF_Form::MESSAGE, '', $this->module->lang('th_dl_descr')); if (!GWF_User::isLoggedIn() && $this->module->cfgGuestCaptcha()) { $data['captcha'] = array(GWF_Form::CAPTCHA); } $data['add'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_add')); return new GWF_Form($this, $data); }
public function getForm() { $data = array('opt' => array(GWF_Form::VALIDATOR)); $buttons = array('add_opt' => $this->module->lang('btn_add_opt'), 'rem_opts' => $this->module->lang('btn_rem_opts'), 'create' => $this->module->lang('btn_create')); $data['title'] = array(GWF_Form::STRING, '', $this->module->lang('th_title')); $data['reverse'] = array(GWF_Form::CHECKBOX, true, $this->module->lang('th_reverse')); $data['multi'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_multi')); $data['guests'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_guests')); if (Module_Votes::mayAddGlobalPoll(GWF_Session::getUser())) { $data['public'] = array(GWF_Form::CHECKBOX, false, $this->module->lang('th_vm_public')); } $data['view'] = array(GWF_Form::SELECT, GWF_VoteMulti::getViewSelect($this->module, 'view', intval(Common::getPost('view', GWF_VoteMulti::SHOW_RESULT_VOTED))), $this->module->lang('th_mvview')); $data['gid'] = array(GWF_Form::SELECT, GWF_GroupSelect::single('gid', Common::getPostString('gid', '0')), $this->module->lang('th_vm_gid')); $data['level'] = array(GWF_Form::INT, '0', $this->module->lang('th_vm_level')); $i = 1; foreach (GWF_Session::getOrDefault(self::SESS_OPTIONS, array()) as $item) { $data['opt[' . $i . ']'] = array(GWF_Form::STRING, $item, $this->module->lang('th_option', array($i))); $i++; } $data['cmds'] = array(GWF_Form::SUBMITS, $buttons); return new GWF_Form($this, $data); }
public function getGroupSelect($selected = '0', $name = 'groupid') { return GWF_GroupSelect::single($name, $selected, true, false); }