private function buildChild(SiteDocIndexXmlItem $child) { $filepath = $this->httpRoot . $child->getLink(); if ($filepath[strlen($filepath) - 1] == '/') { $filepath .= 'index.html'; } if (!is_dir(dirname($filepath))) { mkdir(dirname($filepath), 0755, true); } $presentation = new UIViewPresentation('content'); $breadScrumbs = array(); // traverse over parents $_ = $child; while ($_ = $_->getParent()) { if ($_->getName()) { array_unshift($breadScrumbs, new ViewLink($_->getName(), $_->getLink())); } } $presentation->setModel(new Model(array('siteDoc' => $child->getDoc(), 'siteDocIndexItem' => $child, 'activeMenuItem' => $child->getSitePart(), 'breadScrumbs' => $breadScrumbs))); $presentation->setRouteTable(new PhoebiusRouter()); $page = new UIPage($presentation); $page->render(new FileWriteStream($filepath)); }
add_notification('You cannot claim a challenge if you have no team.'); } else { if (!$challenge) { add_notification('No challenge with this code found. If you think you received this message in error, bring your code to a coordinator in person.'); } else { if ($challenge->getWinners()) { add_notification('Someone else has already claimed the code you entered.'); } else { $winner = new ChallengeWinner(array('team' => $team->getID(), 'challenge' => $challenge->getID())); $winner->doAdd("Claimed code successfully."); } } } } // VIEW $page = new UIPage(); function challenge_claim_form() { return <<<EOT <form method="POST" action="challenges.php"> Enter Claim Code: <input type="text" name="code" /> <input type="submit" name="claim" value="Claim!" /> </form> EOT; } // condition on whether user is admin function challenge_winner($position, ChallengeWinner $winner) { switch ($position) { case POSITION_NONE: return '';
if ($team) { if ($latitude && $longitude) { $clue = Clue::getClue($clue_id); if ($clue) { CheckIn::doCheckIn($team, $latitude, $longitude, $guess); $team->doGuessAnswer($clue, $guess); } } else { add_notification('You must have location turned on to submit clue answers.'); } } else { add_notification('You must have a team to submit clue answers.'); } } // VIEW $page = new UIPage(); $position = Session::defaultPosition(); function answerForm($clueID, $clueSalt, $hashedAnswers, $serialized) { return <<<EOT <form id="answerform" method="POST" action="clues.php"> <input type="text" name="guess" size=30 id="g{$clueID}" /> <input type="submit" name="answer" value="Submit" /> <br /> <span id="feedback" style="font-size: 12px; color: #FF0000;"></span> <input type="hidden" id="clueID" name="id" value="{$clueID}" /> <input type="hidden" id="latitude" name="latitude" /> <input type="hidden" id="longitude" name="longitude" /> <input type="hidden" name="salt" id="s{$clueID}" value="{$clueSalt}" /> <input type="hidden" name="hashedAnswers" id="a{$clueID}" value="{$hashedAnswers}" /> </form>
function render(IOutput $output) { $this->output = $output; parent::render($output); $this->output = null; }
$user->doUpdate("Removed user {$sunetid} successfully."); } else { add_notification("User {$sunetid} is not on this team!"); } } else { add_notification("No user with SUNetID {$sunetid} exists!"); } break; case 'rename': $team = Team::getTeam($team_id); $team->makeChanges(array('name' => $team_name)); $team->doUpdate("Changed name to {$team_name} successfully."); break; } // VIEW $page = new UIPage(); // condition on whether user is admin function team_summary($position, Team $team) { switch ($position) { case POSITION_NONE: return ''; case POSITION_ACCOUNT: case POSITION_PLAYER: return '<b>' . $team->getName() . '</b>'; case POSITION_ADMIN: $name = '<b>' . $team->getName() . '</b>'; $id = $team->getID(); $locLink = $team->getLocationLink(); return <<<EOT {$name}
stop('Incorrect path to Phoebius directory'); } if (!is_file($frameworkPath . '/doc/ns/groups.xml')) { stop('Incorrect path to Phoebius directory (doc/ns/groups.xml not found at ' . $frameworkPath . ')'); } $rootDoxyGroup = XmlDoxyGroupBuilder::create($frameworkPath . '/doc/ns/groups.xml')->build(); $header = new TempFile(); DoxyHeaderWriter::create($rootDoxyGroup)->write($header); $doxyGen = new DoxyGen(PHOEBIUS_SITE_DOXYGEN_PARTS_PATH . '/doxygen.conf'); $htmlHeader = new TempFile(); $presentation = new UIViewPresentation('doxy/header'); $presentation->setModel(new Model(array('activeMenuItem' => 'Support', 'breadScrumbs' => array(new ViewLink('Support', '/support/'), new ViewLink('API', '/support/api/')), 'forDoxy' => true))); $presentation->setRouteTable(new PhoebiusRouter()); $page = new UIPage($presentation); $page->render($htmlHeader); $doxyGen->setHtmlHeader($htmlHeader->getPath()); $presentation = new UIViewPresentation('parts/footer'); $presentation->setRouteTable(new PhoebiusRouter()); $page = new UIPage($presentation); $htmlFooter = new TempFile(); $page->render($htmlFooter); $doxyGen->setHtmlFooter($htmlFooter->getPath()); $doxyGen->addInputPath(PHOEBIUS_SITE_DOXYGEN_PARTS_PATH . '/mainpage.php'); $doxyGen->addInputPath($header->getPath()); $doxyGen->addInputPath($frameworkPath . '/lib'); // $doxyGen->setOptions(array( // 'PROJECT_NUMBER' => PHOEBIUS_VERSION // )); // FSUtils::cleanDirectory(PHOEBIUS_SITE_API_PATH); $doxyGen->make(PHOEBIUS_SITE_API_PATH); echo 'Done';