コード例 #1
0
ファイル: Polls.php プロジェクト: sinfocol/gwf3
 private function templatePoll($pollid)
 {
     if (false === ($poll = GWF_VoteMulti::getByID($pollid))) {
         return $this->module->error('err_poll') . $this->templatePolls();
     }
     return $poll->showResults(300);
 }
コード例 #2
0
ファイル: AddPoll.php プロジェクト: sinfocol/gwf3
 public function validate_pollid(Module_Forum $m, $arg)
 {
     if (false === ($p = GWF_VoteMulti::getByID($arg))) {
         return $m->lang('err_poll');
     }
     if ($p->getUserID() !== $this->user->getID()) {
         return $m->lang('err_poll');
     }
     return false;
 }
コード例 #3
0
ファイル: EditPoll.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     if (false === ($poll = GWF_VoteMulti::getByID(Common::getGet('vmid')))) {
         return $this->module->error('err_poll');
     }
     $user = GWF_Session::getUser();
     if (!$poll->mayEdit($user)) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (false !== Common::getPost('edit')) {
         return $this->onEdit($poll, $user) . $this->templateEdit($poll, $user);
     }
     return $this->templateEdit($poll, $user);
 }
コード例 #4
0
ファイル: VotePoll.php プロジェクト: sinfocol/gwf3
 public function execute()
 {
     if (false === ($poll = GWF_VoteMulti::getByID(Common::getPost('vmid')))) {
         return $this->module->error('err_poll');
     }
     $user = GWF_Session::getUser();
     if (false !== ($error = $this->checkReversible($poll, $user))) {
         return $error;
     }
     if (false === $poll->mayVote($user)) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (!$poll->isEnabled()) {
         return $this->module->error('err_poll_off');
     }
     return $this->onVote($poll, $user);
 }
コード例 #5
0
ファイル: Ajax.php プロジェクト: sinfocol/gwf3
 private function statsVoteMulti($vmid)
 {
     if (false === ($poll = GWF_VoteMulti::getByID($vmid))) {
         return $this->module->error('err_poll');
     }
 }
コード例 #6
0
ファイル: GWF_ForumThread.php プロジェクト: sinfocol/gwf3
 public function getPoll()
 {
     return GWF_VoteMulti::getByID($this->getPollID());
 }