本文整理汇总了PHP中Contest::getChallenges方法的典型用法代码示例。如果您正苦于以下问题:PHP Contest::getChallenges方法的具体用法?PHP Contest::getChallenges怎么用?PHP Contest::getChallenges使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contest
的用法示例。
在下文中一共展示了Contest::getChallenges方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showFilterControl
/**
* Create the filter control and add it to the output.
*
* @since 0.2
*
* @param Contest $contest
*/
protected function showFilterControl(Contest $contest)
{
$challenges = array();
foreach ($contest->getChallenges() as $challenge) {
$challenges[$challenge->getField('title')] = $challenge->getField('title');
}
$yesNo = array('yes' => wfMsg('contest-contest-yes'), 'no' => wfMsg('contest-contest-no'));
$noneSome = array('none' => wfMsg('contest-contest-none'), 'some' => wfMsg('contest-contest-some'));
$title = $this->getTitle($this->subPage)->getFullText();
$this->getOutput()->addHTML('<fieldset>' . '<legend>' . wfMsgHtml('contest-contest-showonly') . '</legend>' . '<form method="post" action="' . htmlspecialchars(wfAppendQuery($GLOBALS['wgScript'], array('title' => $title))) . '">' . Html::hidden('title', $title) . $this->getDropdownHTML('challenge', $challenges) . $this->getDropdownHTML('volunteer', $yesNo) . $this->getDropdownHTML('wmf', $yesNo) . $this->getDropdownHTML('comments', $noneSome) . $this->getDropdownHTML('rating_count', $noneSome) . $this->getDropdownHTML('submission', $noneSome) . '<input type="submit" value="' . wfMsgHtml('contest-contest-go') . '">' . ' <button class="contest-pager-clear">' . wfMsgHtml('contest-contest-clear') . '</button>' . '</form>' . '</fieldset>');
}
示例2: getChallengesList
/**
* Gets a list of contests that can be fed directly to the options field of
* an HTMLForm radio input.
* challenge title => challenge id
*
* @since 0.1
*
* @param Contest $contest
*
* @return array
*/
protected function getChallengesList(Contest $contest)
{
$list = array();
foreach ($contest->getChallenges() as $challenge) {
$list[$challenge->getField('title')] = $challenge->getId();
}
return $list;
}
示例3: addContestJS
/**
* Output the needed JS data.
*
* @since 0.1
*
* @param Contest $contest
*/
protected function addContestJS(Contest $contest)
{
$challenges = array();
$output = $this->getOutput();
/**
* @var $challenge ContestChallenge
*/
foreach ($contest->getChallenges() as $challenge) {
$data = $challenge->toArray();
$data['target'] = $this->getSignupLink($contest->getField('name'), $challenge->getId());
$data['text'] = $output->parse($data['text']);
$challenges[] = $data;
}
$output->addScript(Skin::makeVariablesScript(array('ContestChallenges' => $challenges, 'ContestConfig' => array())));
}