to the statusblock or the navbar) */ function renderHeader($renderStatusBlock=false) { global $steps; global $currentStep; $templateData = array(); $templateData['MainPage']['showHeader'] = 1; if ($renderStatusBlock) { $templateData['MainPage']['showStatusBlock'] = 1; } include(dirname(__FILE__) . '/templates/MainPage.html'); } /** * Render a single status message * @param string $title the status title * @param string $description the status description * @param float $percentComplete ranging from 0 to 1 * @return GalleryStatus a status code */ function renderStatusMessage($title, $description, $percentComplete) { $templateData = array(); $templateData['MainPage']['showStatus'] = 1; $templateData['MainPage']['status'] = array( 'title' => $title, 'description' => $description, 'percentComplete' => GalleryUtilities::roundToString($percentComplete, 2)); include(dirname(__FILE__) . '/templates/MainPage.html'); flush(); return null; } /** * Render the body and footer (everything below the status message) * @param array $templateData */ function renderBodyAndFooter($templateData) { global $steps; global $currentStep; global $stepNumber; $stepsComplete = max($stepNumber - ($currentStep->isComplete() ? 0 : 1), 0); $templateData['percentComplete'] = (int)((100 * ($stepsComplete / (sizeof($steps)-1))) / 5) * 5; $templateData['MainPage']['showBodyAndFooter'] = 1; include(dirname(__FILE__) . '/templates/MainPage.html'); } /** * Hide the status block */ function hideStatusBlock() { $templateData = array(); $templateData['MainPage']['hideStatusBlock'] = 1; include(dirname(__FILE__) . '/templates/MainPage.html'); } /** * Render the whole page, except for the status block and messages. This is the way * that we render most pages that don't have interactive status messages. * @param array $templateData */ function renderHeaderBodyAndFooter($templateData) { /* * This is a little inefficient because we're loading MainPage twice. But we're not * required to be really efficient here, and this is a nice way to compose it. */ $this->renderHeader(); $this->renderBodyAndFooter($templateData); } } ?>