Commit cbf0f4df authored by vermeul's avatar vermeul

bugfixes in get_page_annotations

parent 6783c96e
......@@ -346,7 +346,10 @@ EOT;
//
// Rendering of {{#annotpage}}
//
public static function annotation_page( $parser ) {
public static function annotation_page( $parser, $method ) {
if (! $method == "list") {
return "";
}
$title = $parser->getTitle();
$wikiPage = new WikiPage( $title );
$dbr = wfGetDB( DB_MASTER );
......@@ -360,14 +363,14 @@ EOT;
EOT;
foreach($annotation as $annotations) {
foreach($annotations as $annotation) {
# if a annotations has no parent, just show the annotations name
# in all other cases show parent_annotations:child_annotations
$table .= "|-\n";
$table .= "| ".$annotations->name
." || ".$annotations->value
." || ".$annotations->insert_date
." || ".$annotations->user_name
$table .= "| ".$annotation->name
." || ".$annotation->value
." || ".$annotation->insert_date
." || ".$annotation->user_name
."\n";
}
$table .= "|}";
......@@ -783,10 +786,8 @@ EOT;
return $row;
}
public static function get_page_annotations($dbr, $wikiPage, $order_by) {
if (! $order_by) {
$order_by = array('ORDER BY' => 'name');
}
public static function get_page_annotations($dbr, $wikiPage) {
$order_by = array('ORDER BY' => 'name');
$annotations = $dbr->select(
array('pa' => 'yata_page_annotation',
......@@ -800,9 +801,7 @@ EOT;
'u.user_name'
),
array(
'pa.page_id' => $wikiPage->getId(),
'pa.user_id' => 'u.user_id'
'pa.page_id' => $wikiPage->getId()
),
__METHOD__,
$order_by,
......@@ -1273,7 +1272,7 @@ EOT;
// this is called after �Save changes�
// and after onEditFilter
public static function onArticlePrepareTextForEdit(&$wikiPage, &$popts) {
public static function onArticlePrepareTextForEdit($wikiPage, $popts) {
}
// first hook called when editing a page
......
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