if ($condition == $condition_num) $condition_options .= ' selected="selected"';
$condition_options .= '>' . htmlspecialchars(utf8_encode($condition_text)) . "</option>\n";
}
- $description = htmlspecialchars($description);
+ $description_html = htmlspecialchars($description);
// Buttons
$buttons = '<button name="action" type="submit" value="preview">Vorschau';
<tr class="oddrow"><th>Bahnzustand*</th><td><select name="condition">
$condition_options
</select></td></tr>
- <tr class="evenrow"><th>Meinung</th><td><textarea name="description" cols="50" rows="7">$description</textarea></td></tr>
+ <tr class="evenrow"><th>Meinung</th><td><textarea name="description" cols="50" rows="7">$description_html</textarea></td></tr>
<tr class="oddrow"><th>Autor/in</th><td><input name="author_name" maxlength="30" size="30" value="$author_name" /></td></tr>
<tr class="evenrow"><th>Bericht abschicken</th><td>$buttons</td></tr>
</table>
-/// \brief sub-function of wrRenderReportTable
+/// \brief sub-function of wrReportTableRender - renders the table head
+///
+/// The input variables are either NULL (-> the column is not present) or a UTF-8 encoded string (that is ignored ;-) ).
/// \return UTF-8 encoded titles of HTML table
function wrReportTableTitleRender($page_id, $page_title, $date_report, $date_entry, $date_invalid, $condition, $description, $author_name) {
$out = '<tr>';
}
-/// sub-function of wrRenderReportTable
-/// The in- and output parameters are expected to be UTF-8 encoded
+/// \brief sub-function of wrReportTableRender - renders a table row
+///
+/// The in- and output parameters are expected to be UTF-8 encoded.
function wrReportTableRowRender($page_id, $page_title, $date_report, $date_entry, $date_invalid, $condition, $description, $author_name) {
$out = "<tr>";
if (!is_null($page_id)) $out .= '<td>' . $page_id . '</td>';
if (!is_null($date_entry)) $out .= '<td>' . date('Y-m-d, H:i', strtotime($date_entry)) . '</td>';
if (!is_null($date_invalid)) $out .= '<td>' . date('Y-m-d, H:i', strtotime($date_invalid)) . '</td>';
$out .= '<td>' . $condition . '</td>';
- $out .= '<td>' . htmlspecialchars($description) . '</td>';
+ $out .= '<td class="wrreportdescription">' . wrReportSandboxParse($description) . '</td>';
$out .= '<td>' . htmlspecialchars($author_name) . '</td>';
$out .= "</tr>\n";
return $out;
}
$out .= "</table>\n";
} else {
- $out .= "<p>Es wurden keine Bahnberichte in der Datenbank gefunden.</p>\n";
+ $out .= wrReportSandboxParse("''Es wurden keine Bahnberichte in der Datenbank gefunden.''\n\n");
}
$dbr->freeResult($res);
return $out;
// Action view
if ($action == 'view') {
- $wgOut->addHTML(wrRenderReportTable());
+ $wgOut->addHTML(wrReportTableRender());
}
// Action preview or store