예제 #1
0
파일: Sign.php 프로젝트: sinfocol/gwf3
 private function getForm(GWF_Guestbook $gb, $gbe = false)
 {
     $data = array();
     $user = GWF_Session::getUser();
     if ($user === false) {
         $data['username'] = array(GWF_Form::STRING, '', $this->module->lang('th_gbm_username'));
     }
     if ($gb->isEMailAllowed() && $this->module->cfgAllowEMail()) {
         $email = $user === false ? '' : $user->getValidMail();
         $data['email'] = array(GWF_Form::STRING, $email, $this->module->lang('th_gbm_email'), $this->module->lang('tt_gbm_email'), 32, false);
     }
     if ($gb->isURLAllowed() && $this->module->cfgAllowURL()) {
         $data['url'] = array(GWF_Form::STRING, '', $this->module->lang('th_gbm_url'));
     }
     $msg = $gbe === false ? '' : $gbe->getVar('gbm_message');
     $data['message'] = array(GWF_Form::MESSAGE, $msg, $this->module->lang('th_gbm_message'));
     if ($user === false && $this->module->cfgGuestCaptcha()) {
         $data['captcha'] = array(GWF_Form::CAPTCHA);
     }
     $data['showmail'] = array(GWF_Form::CHECKBOX, true, $this->module->lang('th_opt_showmail'));
     $data['public'] = array(GWF_Form::CHECKBOX, true, $this->module->lang('th_opt_public'));
     $data['toggle'] = array(GWF_Form::CHECKBOX, true, $this->module->lang('th_opt_toggle'));
     $data['sign'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_sign', array($gb->displayTitle())));
     return new GWF_Form($this, $data);
 }
예제 #2
0
파일: Moderate.php 프로젝트: sinfocol/gwf3
 public function getForm(GWF_Guestbook $gb)
 {
     $data = array();
     $data['title'] = array(GWF_Form::STRING, $gb->getVar('gb_title'), $this->module->lang('th_gb_title'));
     $data['locked'] = array(GWF_Form::CHECKBOX, $gb->isLocked(), $this->module->lang('th_gb_locked'));
     $data['moderated'] = array(GWF_Form::CHECKBOX, $gb->isModerated(), $this->module->lang('th_gb_moderated'));
     $data['g_view'] = array(GWF_Form::CHECKBOX, $gb->isGuestViewable(), $this->module->lang('th_gb_guest_view'));
     $data['g_sign'] = array(GWF_Form::CHECKBOX, $gb->isGuestWriteable(), $this->module->lang('th_gb_guest_sign'));
     $data['bbcode'] = array(GWF_Form::CHECKBOX, $gb->isBBAllowed(), $this->module->lang('th_gb_bbcode'));
     $data['website'] = array(GWF_Form::CHECKBOX, $gb->isURLAllowed(), $this->module->lang('th_gb_urls'));
     $data['smileys'] = array(GWF_Form::CHECKBOX, $gb->isSmileyAllowed(), $this->module->lang('th_gb_smiles'));
     $data['emails'] = array(GWF_Form::CHECKBOX, $gb->isEMailAllowed(), $this->module->lang('th_gb_emails'));
     $data['emailentries'] = array(GWF_Form::CHECKBOX, $gb->isEMailOnSign(), $this->module->lang('th_mailonsign'));
     if ($this->module->cfgNesting()) {
         $data['nesting'] = array(GWF_Form::CHECKBOX, $gb->isNestingAllowed(), $this->module->lang('th_gb_nesting'));
     }
     $data['descr'] = array(GWF_Form::MESSAGE, $gb->getVar('gb_descr'), $this->module->lang('th_gb_descr'));
     $data['edit'] = array(GWF_Form::SUBMIT, $this->module->lang('btn_edit_gb'));
     return new GWF_Form($this, $data);
 }