setHook('bahnberichtformular', 'bahnberichtformularParserHook'); $wgParser->setHook('bahnberichte', 'bahnberichteParserHook'); $wgParser->setHook('bahnbewertung', 'bahnbewertungParserHook'); return true; } // Tool functions // -------------- /// Forces a regeneration of region overview pages function wrRecacheRegions() { // TODO: Better implementation - it's a "quick fix" now. $title = Title::newFromText('Tirol'); $title->invalidateCache(); $title = Title::newFromText('Vorarlberg'); $title->invalidateCache(); $title = Title::newFromText('Steiermark'); $title->invalidateCache(); } // Render Functions // ---------------- /// \brief Returns a form to enter a report (string containing HTML). /// /// All parameters have to be UTF-8 encoded. /// \param $page_title Name of the sledding run. /// \return UTF-8 encoded HTML form function wrReportFormRender($hide_save_button = TRUE, $page_title = NULL, $date_report = NULL, $condition = NULL, $description = NULL, $author_name = NULL, $page_title_list = NULL) { if ($page_title) $page_title = htmlspecialchars($page_title); // Date options $daynames = array('Heute', 'Gestern', 'Vorgestern', 'Vor 3 Tagen', 'Vor 4 Tagen'); $date_options = ''; $date_selected = false; $time = time(); // number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) for ($day=0; $day!=5; ++$day) { $date = strtotime("-$day days", $time); $date_f = strftime("%Y-%m-%d", $date); // Formats it according to locale, that is set to CET. $date_options .= '\n" . $date_options; } // Condition options $condition_options = ''; global $wrConditions; // $wrConditions = array(1 => 'Sehr gut', 2 => 'Gut', 3 => utf8_encode('Mittelmäßig'), 4 => 'Schlecht', 5 => 'Geht nicht'); $condition_options .= utf8_encode('') . "\n"; foreach ($wrConditions as $condition_num => $condition_text) { $condition_options .= "