diff options
author | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-25 22:18:22 +0000 |
---|---|---|
committer | nickw <nickw@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-05-25 22:18:22 +0000 |
commit | 76d3b27335145459e1b9da4e07cf37ad8bd050c1 (patch) | |
tree | 7ac84ed02686061d1ced1e1951598e30334da9c3 /mod/defaultwidgets/start.php | |
parent | 6a64b7d0b595c97c4bef9a8fa22d567611fb3fd1 (diff) | |
download | elgg-76d3b27335145459e1b9da4e07cf37ad8bd050c1.tar.gz elgg-76d3b27335145459e1b9da4e07cf37ad8bd050c1.tar.bz2 |
Updating administration plugins with admin submenu views.
git-svn-id: http://code.elgg.org/elgg/trunk@6220 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/defaultwidgets/start.php')
-rw-r--r-- | mod/defaultwidgets/start.php | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/mod/defaultwidgets/start.php b/mod/defaultwidgets/start.php index 1143cafa6..ceebbe285 100644 --- a/mod/defaultwidgets/start.php +++ b/mod/defaultwidgets/start.php @@ -30,11 +30,6 @@ global $CONFIG; * @param unknown_type $object */ function defaultwidgets_init() { - global $CONFIG; - - // Load system configuration - register_page_handler ( 'defaultwidgets', 'defaultwidgets_page_handler' ); - // register create user event hook register_elgg_event_handler ( 'create', 'user', 'defaultwidgets_newusers' ); @@ -43,20 +38,9 @@ function defaultwidgets_init() { register_elgg_event_handler('validate', 'user', 'defaultwidgets_reset_access'); } - // Override metadata permissions - //register_plugin_hook ( 'permissions_check:metadata', 'object', 'defaultwidgets_can_edit_metadata' ); - - elgg_add_submenu_item(array( - 'text' => elgg_echo('defaultwidgets:menu:profile'), - 'href' => "{$CONFIG->wwwroot}pg/defaultwidgets/profile", - 'parent_id' => 'appearance', - ), 'admin', 'default'); - - elgg_add_submenu_item(array( - 'text' => elgg_echo('defaultwidgets:menu:dashboard'), - 'href' => "{$CONFIG->wwwroot}pg/defaultwidgets/dashboard", - 'parent_id' => 'appearance', - ), 'admin', 'default'); + // @todo These submenu pages should be DRYed up + elgg_add_admin_submenu_item('default_profile_widgets', elgg_echo('defaultwidgets:menu:profile'), 'appearance'); + elgg_add_admin_submenu_item('default_dashboard_widgets', elgg_echo('defaultwidgets:menu:dashboard'), 'appearance'); } /** @@ -220,32 +204,6 @@ function defaultwidgets_reset_access($event, $object_type, $object) { return true; } -/** - * Default widgets page handler; allows the use of fancy URLs - * - * @param array $page From the page_handler function - * @return true|false Depending on success - */ -function defaultwidgets_page_handler($page) { - global $CONFIG; - - if (isset ( $page [0] )) { - - switch ($page [0]) { - case "profile" : - include (dirname ( __FILE__ ) . "/profile.php"); - break; - case "dashboard" : - include (dirname ( __FILE__ ) . "/dashboard.php"); - break; - } - } else { - register_error ( elgg_echo ( "defaultwidgets:admin:notfound" ) ); - forward ( $CONFIG->wwwroot ); - } - return true; -} - // Make sure the status initialisation function is called on initialisation register_elgg_event_handler ( 'init', 'system', 'defaultwidgets_init' ); |