]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
updating plugins to use new page menu
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 29 Dec 2010 13:38:33 +0000 (13:38 +0000)
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>
Wed, 29 Dec 2010 13:38:33 +0000 (13:38 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@7740 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/defaultwidgets/start.php
mod/diagnostics/start.php
mod/logbrowser/start.php
mod/messages/start.php
mod/reportedcontent/start.php
mod/uservalidationbyemail/start.php

index acac3f33817df25a6cf44069a803f0646e75646c..5dc89503a3b718208b7a268700dda9f9c4f409b4 100644 (file)
@@ -32,8 +32,8 @@ function defaultwidgets_init() {
        }
 
        // @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');
+       elgg_add_admin_menu_item('default_profile_widgets', elgg_echo('defaultwidgets:menu:profile'), 'appearance');
+       elgg_add_admin_menu_item('default_dashboard_widgets', elgg_echo('defaultwidgets:menu:dashboard'), 'appearance');
 }
 
 /**
index 2ede7099df2b45c50f815ebda8dcda2d683991cf..a80513b6c05ed26e08651f77adb4ca2778100786 100644 (file)
@@ -9,8 +9,7 @@
  * Initialise the diagnostics tool
  *
  */
-function diagnostics_init()
-{
+function diagnostics_init() {
        global $CONFIG;
 
        // Register a page handler, so we can have nice URLs
@@ -24,10 +23,14 @@ function diagnostics_init()
  * Adding the diagnostics to the admin menu
  *
  */
-function diagnostics_pagesetup()
-{
+function diagnostics_pagesetup() {
        if (elgg_get_context() == 'admin' && isadminloggedin()) {
-               elgg_add_submenu_item(array('text' => elgg_echo('diagnostics'), 'href' => 'pg/diagnostics/'));
+               elgg_register_menu_item('page', array(
+                       'name' => 'diagnostics',
+                       'title' => elgg_echo('diagnostics'),
+                       'url' => 'pg/diagnostics/',
+                       'context' => 'admin',
+               ));
        }
 }
 
@@ -36,8 +39,7 @@ function diagnostics_pagesetup()
  *
  * @param array $page Array of page elements, forwarded by the page handling mechanism
  */
-function diagnostics_page_handler($page)
-{
+function diagnostics_page_handler($page) {
        global $CONFIG;
 
        // only interested in one page for now
@@ -52,8 +54,7 @@ function diagnostics_page_handler($page)
  * @param unknown_type $returnvalue
  * @param unknown_type $params
  */
-function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params) {
        global $CONFIG;
 
        // Get version information
@@ -73,8 +74,7 @@ function diagnostics_basic_hook($hook, $entity_type, $returnvalue, $params)
  * @param unknown_type $returnvalue
  * @param unknown_type $params
  */
-function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params) {
        $returnvalue .= elgg_echo('diagnostics:report:plugins', array(print_r(get_installed_plugins(), true)));
 
        return $returnvalue;
@@ -86,8 +86,7 @@ function diagnostics_plugins_hook($hook, $entity_type, $returnvalue, $params)
  * @param starting dir $dir
  * @param buffer $buffer
  */
-function diagnostics_md5_dir($dir)
-{
+function diagnostics_md5_dir($dir) {
        $extensions_allowed = array('.php', '.js', '.css');
 
        $buffer = "";
@@ -117,8 +116,7 @@ function diagnostics_md5_dir($dir)
  * @param unknown_type $returnvalue
  * @param unknown_type $params
  */
-function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params) {
        global $CONFIG;
 
        $returnvalue .= elgg_echo('diagnostics:report:md5', array(diagnostics_md5_dir($CONFIG->path)));
@@ -134,8 +132,7 @@ function diagnostics_sigs_hook($hook, $entity_type, $returnvalue, $params)
  * @param unknown_type $returnvalue
  * @param unknown_type $params
  */
-function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params) {
        global $CONFIG;
 
        ob_start();
@@ -169,8 +166,7 @@ function diagnostics_phpinfo_hook($hook, $entity_type, $returnvalue, $params)
  * @param unknown_type $params
  * @return unknown
  */
-function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params)
-{
+function diagnostics_globals_hook($hook, $entity_type, $returnvalue, $params) {
        global $CONFIG;
 
        $output = str_replace($CONFIG->dbpass, '<<DBPASS>>', print_r($GLOBALS, true));
@@ -189,4 +185,3 @@ elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_s
 
 elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_globals_hook"); // Global variables
 elgg_register_plugin_hook_handler("diagnostics:report", "system", "diagnostics_phpinfo_hook"); // PHP info
-?>
\ No newline at end of file
index dd3c24beee8692a4a813ca06602219e4ed2340b7..9a254ba11e9e690f198d7cb6a3750368cbbcee9e 100644 (file)
@@ -16,7 +16,7 @@ function logbrowser_init() {
 
        elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'logbrowser_user_hover_menu');
        
-       elgg_add_admin_submenu_item('logbrowser', elgg_echo('logbrowser'), 'overview');
+       elgg_add_admin_menu_item('logbrowser', elgg_echo('logbrowser'), 'overview');
 }
 
 /**
index e8f5105b28a61daeb3e61cd24bc1dff19a8820b4..cf17ee0131405e16bbc466329c1bc91cb4ba7844 100644 (file)
@@ -11,11 +11,19 @@ elgg_register_event_handler('init', 'system', 'messages_init');
 
 function messages_init() {
 
-       // add submenu options
-       if (elgg_get_context() == "messages") {
-               add_submenu_item(elgg_echo('messages:inbox'), "pg/messages/" . get_loggedin_user()->username);
-               add_submenu_item(elgg_echo('messages:sentmessages'), "mod/messages/sent.php");
-       }
+       // add page menu items
+       elgg_register_menu_item('page', array(
+               'name' => 'messages:inbox',
+               'title' => elgg_echo('messages:inbox'),
+               'url' => "pg/messages/" . get_loggedin_user()->username,
+               'context' => 'messages',
+       ));
+       elgg_register_menu_item('page', array(
+               'name' => 'messages:sentmessages',
+               'title' => elgg_echo('messages:sentmessages'),
+               'url' => "mod/messages/sent.php",
+               'context' => 'messages',
+       ));
 
        // Extend system CSS with our own styles, which are defined in the shouts/css view
        elgg_extend_view('css/screen', 'messages/css');
index b947927d945d1245261c22c74203191b7633b104..872cf82eab9f41c6e413b2ca25661750d7c1e92b 100644 (file)
@@ -26,7 +26,7 @@ function reportedcontent_init() {
        }
 
        // Add admin menu item
-       elgg_add_admin_submenu_item('reportedcontent', elgg_echo('reportedcontent'), 'overview');
+       elgg_add_admin_menu_item('reportedcontent', elgg_echo('reportedcontent'), 'overview');
 
        // Register actions
        $action_path = elgg_get_plugin_path() . "reportedcontent/actions";
index 79b8b7413fe759c18f28fbb56e4d06b204d0795e..9d4233f379af32bda92d9ed922124238f9c80615 100644 (file)
@@ -39,7 +39,7 @@ function uservalidationbyemail_init() {
        elgg_register_plugin_hook_handler('public_pages', 'walled_garden', 'uservalidationbyemail_public_pages');
 
        // admin interface to manually validate users
-       elgg_add_admin_submenu_item('unvalidated', elgg_echo('uservalidationbyemail:admin:unvalidated'), 'users');
+       elgg_add_admin_menu_item('unvalidated', elgg_echo('uservalidationbyemail:admin:unvalidated'), 'users');
 
        $action_path = dirname(__FILE__) . '/actions';