From a0ac16cb88925ebc68bb8f215d05d338c7f61967 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Wed, 6 Jan 2016 16:53:33 +0800 Subject: [PATCH] MDL-49662 core: dropped support for legacy local_* navigation API --- lib/navigationlib.php | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index b3b79cc1b39..1675ae1750d 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -1296,18 +1296,8 @@ class global_navigation extends navigation_node { } // Give the local plugins a chance to include some navigation if they want. - foreach (core_component::get_plugin_list_with_file('local', 'lib.php', true) as $plugin => $unused) { - $function = "local_{$plugin}_extend_navigation"; - $oldfunction = "local_{$plugin}_extends_navigation"; - - if (function_exists($function)) { - $function($this); - - } else if (function_exists($oldfunction)) { - debugging("Deprecated local plugin navigation callback: Please rename '{$oldfunction}' to '{$function}'. ". - "Support for the old callback will be dropped in Moodle 3.1", DEBUG_DEVELOPER); - $oldfunction($this); - } + foreach (get_plugin_list_with_function('local', 'extend_navigation') as $function) { + $function($this); } // Remove any empty root nodes @@ -4828,18 +4818,8 @@ class settings_navigation extends navigation_node { */ protected function load_local_plugin_settings() { - foreach (core_component::get_plugin_list_with_file('local', 'lib.php', true) as $plugin => $unused) { - $function = "local_{$plugin}_extend_settings_navigation"; - $oldfunction = "local_{$plugin}_extends_settings_navigation"; - - if (function_exists($function)) { - $function($this, $this->context); - - } else if (function_exists($oldfunction)) { - debugging("Deprecated local plugin navigation callback: Please rename '{$oldfunction}' to '{$function}'. ". - "Support for the old callback will be dropped in Moodle 3.1", DEBUG_DEVELOPER); - $oldfunction($this, $this->context); - } + foreach (get_plugin_list_with_function('local', 'extend_settings_navigation') as $function) { + $function($this, $this->context); } }