From 8a30fad5bbdfd25c03a398c6f24ab33283df3f80 Mon Sep 17 00:00:00 2001 From: marcus Date: Mon, 4 Aug 2008 16:42:02 +0000 Subject: Adapted to use new menus. git-svn-id: https://code.elgg.org/elgg/trunk@1687 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/guidtool/index.php | 12 +++++++----- mod/guidtool/languages/en.php | 2 +- mod/guidtool/start.php | 19 +++++++++++++++++-- 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/mod/guidtool/index.php b/mod/guidtool/index.php index 105aa57c3..0f1bcd223 100644 --- a/mod/guidtool/index.php +++ b/mod/guidtool/index.php @@ -13,13 +13,14 @@ admin_gatekeeper(); + $title = elgg_echo("guidtool"); + $body = elgg_view_title($title); + $context = get_context(); set_context('search'); $limit = get_input('limit', 10); - $offset = get_input('offset'); - - $title = elgg_echo("guidtool"); + $offset = get_input('offset'); // Get entities $entities = get_entities("","","","",$limit, $offset); @@ -35,9 +36,10 @@ $wrapped_entries[] = $tmp; } - $body = elgg_view_title($title) . elgg_view_entity_list($wrapped_entries, $count, $offset, $limit, false); + $body .= elgg_view_entity_list($wrapped_entries, $count, $offset, $limit, false); + + set_context($context); // Display main admin menu page_draw($title,elgg_view_layout("two_column_left_sidebar", '', $body)); - set_context($context); ?> \ No newline at end of file diff --git a/mod/guidtool/languages/en.php b/mod/guidtool/languages/en.php index cb80143e2..0f88e9d11 100644 --- a/mod/guidtool/languages/en.php +++ b/mod/guidtool/languages/en.php @@ -16,7 +16,7 @@ */ 'guidtool' => 'GUID Tool', - 'guidtool:browse' => 'Browse GUID', + 'guidtool:browse' => 'Browse GUIDs', 'guidtool:import' => 'Import', 'guidtool:import:desc' => 'Paste the data you want to import in following window, this must be in "%s" format.', diff --git a/mod/guidtool/start.php b/mod/guidtool/start.php index 7c0ead331..f524d4694 100644 --- a/mod/guidtool/start.php +++ b/mod/guidtool/start.php @@ -19,8 +19,8 @@ if (isadminloggedin()) { add_menu(elgg_echo('guidtool'), $CONFIG->wwwroot . "pg/guidtool/",array( - menu_item(elgg_echo('guidtool:browse'), $CONFIG->wwwroot."pg/guidtool/"), - menu_item(elgg_echo('guidtool:import'), $CONFIG->wwwroot."pg/guidtool/import/"), +// menu_item(elgg_echo('guidtool:browse'), $CONFIG->wwwroot."pg/guidtool/"), +// menu_item(elgg_echo('guidtool:import'), $CONFIG->wwwroot."pg/guidtool/import/"), ),'guidtool'); } @@ -29,6 +29,20 @@ register_page_handler('guidtool','guidtool_page_handler'); } + /** + * Post init gumph. + */ + function guidtool_page_setup() + { + global $CONFIG; + + if (get_context()=='guidtool') + { + add_submenu_item(elgg_echo('guidtool:browse'), $CONFIG->wwwroot."pg/guidtool/"); + add_submenu_item(elgg_echo('guidtool:import'), $CONFIG->wwwroot."pg/guidtool/import/"); + } + } + /** * Log browser page handler * @@ -103,4 +117,5 @@ // Initialise log register_elgg_event_handler('init','system','guidtool_init'); + register_elgg_event_handler('pagesetup','system','guidtool_page_setup'); ?> \ No newline at end of file -- cgit v1.2.3