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