diff --git a/CHANGELOG.md b/CHANGELOG.md index b0ba323..0937386 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file. - New {mygroupings} tag. ### Updated - Link to External LTI now only available in Moodle 4.3+. +- Addressed compatibility issue with mod_hvp that prevents link to current theme settings from working. - Refactoring in preparations for Moodle 4.5. - Added more documentation to README.md. - Fixed links and updated table of contents in README.md. diff --git a/classes/text_filter.php b/classes/text_filter.php index 90ccf2b..71a304c 100644 --- a/classes/text_filter.php +++ b/classes/text_filter.php @@ -887,16 +887,18 @@ private function generatortags(&$text) { $menu .= '-{getstring}site{/getstring}: {getstring:admin}' . $label . '{/getstring}|/admin/settings.php' . '?section=' . $section . '|Including custom menus, designer mode, theme in URL' . PHP_EOL; - if (file_exists($CFG->dirroot . '/theme/' . $theme . '/settings.php')) { - require_once($CFG->libdir . '/adminlib.php'); - if (admin_get_root()->locate('theme_' . $theme)) { - // Settings use categories interface URL. - $url = '/admin/category.php?category=theme_' . $theme . PHP_EOL; - } else { - // Settings use tabs interface URL. - $url = '/admin/settings.php?section=themesetting' . $theme . PHP_EOL; + if (!file_exists($CFG->dirroot . '/mod/hvp/version.php')) { // Not compatible with mod_hvp. + if (file_exists($CFG->dirroot . '/theme/' . $theme . '/settings.php')) { + require_once($CFG->libdir . '/adminlib.php'); + if (admin_get_root()->locate('theme_' . $theme)) { + // Settings use categories interface URL. + $url = '/admin/category.php?category=theme_' . $theme . PHP_EOL; + } else { + // Settings use tabs interface URL. + $url = '/admin/settings.php?section=themesetting' . $theme . PHP_EOL; + } + $menu .= '-{getstring}site{/getstring}: {getstring:admin}currenttheme{/getstring}|' . $url; } - $menu .= '-{getstring}site{/getstring}: {getstring:admin}currenttheme{/getstring}|' . $url; } $menu .= '-{getstring}site{/getstring}: {getstring}notifications{/getstring} ({getstring}admin{/getstring})' . '|/admin/index.php' . PHP_EOL; @@ -1045,16 +1047,19 @@ private function generatortags(&$text) { $menu .= '-###' . PHP_EOL; $menu .= '-{getstring:admin}' . $label . '{/getstring}|/admin/settings.php' . '?section=' . $section . '|Including custom menus, designer mode, theme in URL' . PHP_EOL; - if (file_exists($CFG->dirroot . '/theme/' . $theme . '/settings.php')) { - require_once($CFG->libdir . '/adminlib.php'); - if (admin_get_root()->locate('theme_' . $theme)) { - // Settings using categories interface URL. - $url = '/admin/category.php?category=theme_' . $theme . PHP_EOL; - } else { - // Settings using tabs interface URL. - $url = '/admin/settings.php?section=themesetting' . $theme . PHP_EOL; + + if (!file_exists($CFG->dirroot . '/mod/hvp/version.php')) { // Not compatible with mod_hvp. + if (file_exists($CFG->dirroot . '/theme/' . $theme . '/settings.php')) { + require_once($CFG->libdir . '/adminlib.php'); + if (admin_get_root()->locate('theme_' . $theme)) { + // Settings use categories interface URL. + $url = '/admin/category.php?category=theme_' . $theme . PHP_EOL; + } else { + // Settings use tabs interface URL. + $url = '/admin/settings.php?section=themesetting' . $theme . PHP_EOL; + } + $menu .= '-{getstring:admin}currenttheme{/getstring}|' . $url; } - $menu .= '-{getstring:admin}currenttheme{/getstring}|' . $url; } } }