当前位置: 首页>>代码示例>>PHP>>正文


PHP Contest::getChallenges方法代码示例

本文整理汇总了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') . '">' . '&#160;<button class="contest-pager-clear">' . wfMsgHtml('contest-contest-clear') . '</button>' . '</form>' . '</fieldset>');
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:18,代码来源:SpecialContest.php

示例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;
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:19,代码来源:SpecialContestSignup.php

示例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())));
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:22,代码来源:SpecialContestWelcome.php


注:本文中的Contest::getChallenges方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。