Commit 7cb803fd authored by vermeul's avatar vermeul

group categories and only display every annotation once in search results

parent 7cb61ec9
......@@ -49,6 +49,7 @@ class YATA {
//
public static function annotation_query( $parser, $querystring) {
$title = $parser->getTitle();
$wikiPage = new WikiPage( $title );
$queries_found = preg_match_all(
......@@ -277,7 +278,7 @@ class YATA {
if ($dbr->numRows($annotations) > 0) {
$page_attributes = array();
$column_no = 0;
$table_rows = array();
$seen_annot = array();
# compose the wiki table
foreach($annotations as $annotation) {
......@@ -324,7 +325,12 @@ class YATA {
}
$table_row[$p_annotation->name] = $p_annotation->value;
}
array_push($table_rows, $table_row);
if ($seen_annot[$link]) {
$seen_annot[$link]["category"] .= "<br/>". $cat;
}
else {
$seen_annot[$link] = $table_row;
}
}
$new_table = $table . '<table class="wikitable sortable jquery-tablesorter">';
......@@ -349,7 +355,7 @@ class YATA {
$table .= $new_table . $table_header;
$rows_rendered = "";
foreach($table_rows as $table_row) {
foreach($seen_annot as $link => $table_row) {
$rows_rendered .= "<tr>";
foreach($all_columns as $column) {
$rows_rendered .= "<td>";
......
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