Commit ca2891ef authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Add separate function for right nav menu"

parents 4e38850f 2fd431ba
......@@ -156,6 +156,19 @@ abstract class PluginArtefact extends Plugin implements IPluginArtefact {
public static function progressbar_metaartefact_count($name) {
return false;
}
/**
* This function returns an array of menu items
* to be displayed in the top right navigation menu
*
* See the function find_menu_children() in lib/web.php
* for a description of the expected array structure.
*
* @return array
*/
public static function right_nav_menu_items() {
return array();
}
}
/**
......
......@@ -98,6 +98,19 @@ abstract class PluginInteraction extends Plugin implements IPluginInteraction {
public static function menu_items() {
return array();
}
/**
* This function returns an array of menu items
* to be displayed in the top right navigation menu
*
* See the function find_menu_children() in lib/web.php
* for a description of the expected array structure.
*
* @return array
*/
public static function right_nav_menu_items() {
return array();
}
}
/**
......
......@@ -2729,8 +2729,9 @@ function right_nav() {
if ($plugins = plugins_installed($plugintype)) {
foreach ($plugins as &$plugin) {
safe_require($plugintype, $plugin->name);
$plugin_menu = call_static_method(generate_class_name($plugintype,$plugin->name), 'menu_items');
$menu = array_merge($menu, $plugin_menu);
$plugin_nav_menu = call_static_method(generate_class_name($plugintype, $plugin->name),
'right_nav_menu_items');
$menu = array_merge($menu, $plugin_nav_menu);
}
}
}
......
......@@ -37,4 +37,17 @@ abstract class PluginModule extends Plugin {
public static function menu_items() {
return array();
}
/**
* This function returns an array of menu items
* to be displayed in the top right navigation menu
*
* See the function find_menu_children() in lib/web.php
* for a description of the expected array structure.
*
* @return array
*/
public static function right_nav_menu_items() {
return array();
}
}
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