/** * (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; }