diff --git a/mod/label/classes/local/views/secondary.php b/mod/label/classes/local/views/secondary.php new file mode 100644 index 00000000000..9c150bdf91c --- /dev/null +++ b/mod/label/classes/local/views/secondary.php @@ -0,0 +1,40 @@ +. + +namespace mod_label\local\views; + +use core\navigation\views\secondary as core_secondary; + +/** + * Class secondary_navigation_view. + * + * Custom implementation for a plugin. + * + * @package mod_label + * @category navigation + * @copyright 2021 onwards Peter Dias + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class secondary extends core_secondary { + protected function load_module_navigation(): void { + parent::load_module_navigation(); + $node = $this->find('modulepage', null); + if ($node) { + // Label does not have a view and redirects to the course page. Change text to indicate this. + $node->text = get_string('course'); + } + } +} diff --git a/mod/label/version.php b/mod/label/version.php index 58bc0020cd7..d437e14282c 100644 --- a/mod/label/version.php +++ b/mod/label/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2021052500; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2021052501; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2021052500; // Requires this Moodle version. $plugin->component = 'mod_label'; // Full name of the plugin (used for diagnostics) $plugin->cron = 0;