/** * Renders a voting form for a poll object * @param VanillaController $Sender controller object * @param stdClass $Poll poll object * @param boolean $Echo echo or return result string * @return mixed Will return string if $Echo is false, will return true otherwise */ protected function _RenderVotingForm($Sender, $Poll, $PartialAnswers, $Echo = TRUE) { $Sender->PollForm = new Gdn_Form(); $Sender->PollForm->AddHidden('DiscussionID', $Poll->DiscussionID); $Sender->PollForm->AddHidden('PollID', $Poll->PollID); if ($Sender->Data('DiscussionPollsMessage')) { $Sender->PollForm->AddError($Sender->Data('DiscussionPollsMessage')); } include_once $this->ThemeView('voting'); if ($Echo) { DiscussionPollAnswerForm($Sender->PollForm, $Poll, $PartialAnswers); return TRUE; } else { ob_start(); DiscussionPollAnswerForm($Sender->PollForm, $Poll, $PartialAnswers); $Result = ob_get_contents(); ob_end_clean(); return $Result; } }