} foreach ($clues as $clue) { if ($position >= POSITION_ADMIN) { $all_clues .= displayClueSummary($clue) . '<br />'; } } if ($displayed == 0) { $past_clues = 'No past clues.'; } $past_clues = '<div id="pastclues">' . $past_clues . '</div>'; $text = UIText::exactText($past_clues); $page->addElement($text->setTitle('Past Clues')); if ($position >= POSITION_ADMIN) { $text = UIText::exactText($all_clues); $page->addElement($text->setTitle('All Clues (Admin only)')); $datePicker = ui_select('date', Date::getAllDates()); $page->addElement(UIText::exactText(<<<EOT \t\t\t<form method="POST" action="clues.php"> \t\t\tName (admin use only): <input type="text" name="name" /> \t\t\tDate (for sorting): {$datePicker} <input type="text" size="8" name="time" /> \t\t\t<input type="submit" name="new" value="Create New Clue" /> \t\t\t</form> EOT )->setTitle('Create Clue (Admin only)')); } } } else { $page->addElement("You don't have permission to view this page."); } // OUTPUT echo $page->fullPageHTML();
$element = id(new UIContainer())->setTitle('Challenge Dashboard'); $winners = ChallengeWinner::getAllChallengeWinners(); if (count($winners) == 0) { $element->addElement('No challenges have been won yet.'); } foreach ($winners as $winner) { $element->addElement(UIText::exactText(challenge_winner($position, $winner))); } $page->addElement($element); if ($position >= POSITION_ADMIN) { $element = id(new UIContainer())->setTitle('All Challenges (Admin only)'); $challenges = Challenge::getAllChallenges(); if (count($challenges) == 0) { $element->addElement('No challenges.'); } foreach ($challenges as $challenge) { $element->addElement(UIText::exactText(challenge_list($challenge))); } $page->addElement($element); $page->addElement(UIText::exactText(<<<EOT <form method="POST" action="challenges.php"> Name: <input type="text" name="name" /> Points: <input type="text" name="points" /> Claim Code (optional): <input type="text" name="code" /> <input type="submit" name="new" value="Create New Challenge" /> </form> EOT )->setTitle('Create Challenge (Admin only)')); } // STEP 5: OUTPUT PAGE echo $page->fullPageHTML();
return ''; case POSITION_ACCOUNT: $text .= $member->getDisplayName() . ' '; case POSITION_PLAYER: case POSITION_ADMIN: $text .= $member->getDisplayName() . ' (<i>'; $text .= $member->getPhoneNumber() . '</i>) '; $text .= '<br />'; } } return $text; } $teams = Team::getAllTeams(); if (count($teams) == 0 && $position >= POSITION_ACCOUNT) { $page->addElement('No teams'); } foreach ($teams as $team) { $page->addElement(UIText::exactText(team_summary($position, $team))); $page->addElement(UIText::exactText(team_members($position, $team))); } if ($position >= POSITION_ADMIN) { $page->addElement(UIText::exactText(<<<EOT <form method="POST" action="teams.php"> Name: <input type="text" name="name" /> <input type="submit" name="new" value="Create New Team" /> </form> EOT )->setTitle('Create Team (Admin only)')); } // STEP 5: OUTPUT PAGE echo $page->fullPageHTML();