本文整理汇总了PHP中Contest::getStatusMessages方法的典型用法代码示例。如果您正苦于以下问题:PHP Contest::getStatusMessages方法的具体用法?PHP Contest::getStatusMessages怎么用?PHP Contest::getStatusMessages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contest
的用法示例。
在下文中一共展示了Contest::getStatusMessages方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormFields
/**
* (non-PHPdoc)
* @see FormSpecialPage::getFormFields()
* @return array
*/
protected function getFormFields()
{
/**
* @var $contest Contest
*/
$contest = $this->contest;
$fields = array();
$fields['id'] = array('type' => 'hidden');
$fields['name'] = array('type' => 'text', 'label-message' => 'contest-edit-name', 'id' => 'contest-name-field');
$fields['status'] = array('type' => 'radio', 'label-message' => 'contest-edit-status', 'options' => Contest::getStatusMessages(true));
$fields['intro'] = array('type' => 'text', 'label-message' => 'contest-edit-intro');
$fields['opportunities'] = array('type' => 'text', 'label-message' => 'contest-edit-opportunities');
$fields['rules_page'] = array('type' => 'text', 'label-message' => 'contest-edit-rulespage');
$fields['help'] = array('type' => 'text', 'label-message' => 'contest-edit-help');
$fields['signup_email'] = array('type' => 'text', 'label-message' => 'contest-edit-signup');
$fields['reminder_email'] = array('type' => 'text', 'label-message' => 'contest-edit-reminder');
$fields['end'] = array('type' => 'text', 'label-message' => 'contest-edit-end', 'id' => 'contest-edit-end', 'size' => 15);
if ($contest !== false) {
foreach ($fields as $name => $data) {
$default = $contest->getField($name);
if ($name == 'end') {
$default = wfTimestamp(TS_DB, $default);
}
$fields[$name]['default'] = $default;
}
}
$mappedFields = array();
foreach ($fields as $name => $field) {
$mappedFields['contest-' . $name] = $field;
}
if ($contest !== false) {
foreach ($contest->getChallenges() as $challenge) {
$mappedFields[] = array('class' => 'ContestChallengeField', 'options' => $challenge->toArray());
}
}
$mappedFields['delete-challenges'] = array('type' => 'hidden', 'id' => 'delete-challenges');
return $mappedFields;
}