From eec475fb1272a99134784b18b0451b306c5dbc4a Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 19 Mar 2011 15:03:28 +0000 Subject: Refs #3158 Fixes #3170 namespaces messageboard plugin page scripts git-svn-id: http://code.elgg.org/elgg/trunk@8767 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/messageboard/pages/messageboard/owner.php | 58 +++++++++++++++++++++++++++ mod/messageboard/pages/owner.php | 58 --------------------------- mod/messageboard/start.php | 5 +-- 3 files changed, 59 insertions(+), 62 deletions(-) create mode 100644 mod/messageboard/pages/messageboard/owner.php delete mode 100644 mod/messageboard/pages/owner.php (limited to 'mod/messageboard') diff --git a/mod/messageboard/pages/messageboard/owner.php b/mod/messageboard/pages/messageboard/owner.php new file mode 100644 index 000000000..7fd88a9d4 --- /dev/null +++ b/mod/messageboard/pages/messageboard/owner.php @@ -0,0 +1,58 @@ +name, $page_owner->getURL()); + +$options = array( + 'annotations_name' => 'messageboard', + 'guid' => $page_owner_guid, + 'limit' => 10 +); + +if ($history_user) { + $options['annotations_owner_guid'] = $history_user->getGUID(); + $title = elgg_echo('messageboard:owner_history', array($history_user->name, $page_owner->name)); + + if ($page_owner instanceof ElggGroup) { + $mb_url = "messageboard/group/$page_owner->guid/owner"; + } else { + $mb_url = "messageboard/owner/$page_owner->username"; + } +} else { + $title = elgg_echo('messageboard:owner', array($page_owner->name)); + $mb_url = ''; +} + +elgg_push_breadcrumb(elgg_echo('messageboard:board'), $mb_url); + +if ($history_user) { + elgg_push_breadcrumb($history_user->name); +} + +$content = elgg_list_annotations($options); + +if (!$content) { + $content = elgg_echo('messageboard:none'); +} + +$vars = array( + 'filter' => false, + 'buttons' => false, + 'content' => $content, + 'title' => $title, + 'reverse_order_by' => true +); + +$body = elgg_view_layout('content', $vars); + +echo elgg_view_page($title, $body); \ No newline at end of file diff --git a/mod/messageboard/pages/owner.php b/mod/messageboard/pages/owner.php deleted file mode 100644 index 7fd88a9d4..000000000 --- a/mod/messageboard/pages/owner.php +++ /dev/null @@ -1,58 +0,0 @@ -name, $page_owner->getURL()); - -$options = array( - 'annotations_name' => 'messageboard', - 'guid' => $page_owner_guid, - 'limit' => 10 -); - -if ($history_user) { - $options['annotations_owner_guid'] = $history_user->getGUID(); - $title = elgg_echo('messageboard:owner_history', array($history_user->name, $page_owner->name)); - - if ($page_owner instanceof ElggGroup) { - $mb_url = "messageboard/group/$page_owner->guid/owner"; - } else { - $mb_url = "messageboard/owner/$page_owner->username"; - } -} else { - $title = elgg_echo('messageboard:owner', array($page_owner->name)); - $mb_url = ''; -} - -elgg_push_breadcrumb(elgg_echo('messageboard:board'), $mb_url); - -if ($history_user) { - elgg_push_breadcrumb($history_user->name); -} - -$content = elgg_list_annotations($options); - -if (!$content) { - $content = elgg_echo('messageboard:none'); -} - -$vars = array( - 'filter' => false, - 'buttons' => false, - 'content' => $content, - 'title' => $title, - 'reverse_order_by' => true -); - -$body = elgg_view_layout('content', $vars); - -echo elgg_view_page($title, $body); \ No newline at end of file diff --git a/mod/messageboard/start.php b/mod/messageboard/start.php index 349885429..899df19c3 100644 --- a/mod/messageboard/start.php +++ b/mod/messageboard/start.php @@ -51,7 +51,7 @@ function messageboard_page_handler($page) { forward($url); } - $pages = dirname(__FILE__) . '/pages'; + $pages = dirname(__FILE__) . '/pages/messageboard'; switch ($page[0]) { case 'owner': @@ -83,9 +83,6 @@ function messageboard_page_handler($page) { break; } - // Include the standard messageboard index - include(elgg_get_plugins_path() . "messageboard/index.php"); - return true; } -- cgit v1.2.3