To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 71acdde8 authored by vermeul's avatar vermeul
Browse files

annotated text is now displayed

parent 157b21ce
......@@ -129,36 +129,48 @@ class YATA {
)
);
$table = <<<"EOT"
{| class="wikitable sortable"
|-
! Category !! Comment !! Link !! Annotated text !! Last edited by !! Modification date
$table = "<b>Querystring:</b><pre>$querystring</pre><b>Result</b> ";
$table .= '([' . $title->getFullURL() . '?action=purge' . ' refresh page]):';
$table .= '
<table class="wikitable sortable jquery-tablesorter">
<tr>
<th class="headerSort headerSortUp" tabindex="0" role="columnheader button" title="Sort descending"> Category </th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending"> Comment </th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending"> Link </th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending"> Annotated text </th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending"> Last edited by </th>
<th class="headerSort" tabindex="0" role="columnheader button" title="Sort ascending"> Modification
date </th>
</tr>';
EOT;
# compose the wiki table
$i = 0;
foreach($annotations as $annotation) {
# if a category has no parent, just show the category name
# in all other cases show parent_category:child_category
#$wikitext = preg_replace(
# '/{{\s*#annot(?:<end>end)?.*?}}/',
# '',
# $annotation->wiki_text
#);
#if (strlen($wikitext) > 40) {
# $wikitext = substr($wikitext, 0, 20) . ' ... ';
#}
$cat = $annotation->parent_category ? $annotation->parent_category . "/" . $annotation->category : $annotation->category;
$table .= "|-\n";
$table .= "| ".$cat
." || ".$annotation->comment
." || [[".$annotation->title."#".$annotation->bookmark . "]]"
#." || <pre>" . $wikitext . "</pre>"
." || "
."\n || " . $annotation->last_edited_by
."\n || " . wfTimestamp( TS_ISO_8601, $annotation->last_modified)
."\n";
$wikitext = $annotation->wiki_text;
$wikitext = htmlentities($wikitext, ENT_QUOTES);
$a = array('=', '{', '|', '}');
$b = array('&#61;', '&#123;', '&#124;', '&#125;');
$wikitext = str_replace($a, $b, $wikitext);
$table .= "<tr><td>".$cat
."</td><td>".$annotation->comment
."</td><td>[[".$annotation->title."#".$annotation->bookmark . "]]"
."</td><td><pre>" . $wikitext . "</pre>"
#." || "
."</td><td>" . $annotation->last_edited_by
."</td><td>" . wfTimestamp( TS_ISO_8601, $annotation->last_modified)
."</td></tr>\n";
}
$table .= "|}";
$table .= "</table>";
return $table;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment