Skip to content

Commit

Permalink
Fixed compatibility with mod_hvp.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-milette committed Sep 7, 2024
1 parent e0978f3 commit 4146ef8
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions classes/text_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit 4146ef8

Please sign in to comment.