Details
Description
The themedir configuration option seems to be quite broken from a few perspectives.
In: lib/moodlelib.php, functio get_list_of_themes():
if (!file_exists("$CFG->dirroot/theme/$theme/config.php")) { // bad folder
Should be:
if (!file_exists("$CFG->themedir/theme/$theme/config.php")) { // bad folder
same goes for:
include("$CFG->dirroot/theme/$theme/config.php");
to:
include("$CFG->themedir/$theme/config.php");
In order to use theme/index.php to select a theme from this directory, one would have to change the get_list_of_plugins_line.
As a trivial example in theme/index.php, i'd need to change:
$themes = get_list_of_plugins("theme");
to:
$themes = get_list_of_plugins("local_theme_dir");
Where local_theme_dir would be under my dirroot. This is what i've found skimming the surface. (Configurable theme directory would be quite powerful for me)
Issue Links
| This issue will be resolved by: | ||||
| MDL-6784 | Fixing Theme Config Variables |
|
|
|
in course/search.php (around 185):
$pixpath = "$CFG->wwwroot/theme/$CFG->theme/pix";
should be:
$pixpath = "$CFG->themedir/$CFG->theme/pix";
In theme/index.php (around 90)L
link_to_popup_window('/theme/'.$theme.'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
Prsumably should be:
link_to_popup_window($CFG->themewww .$theme.'/README.html', $theme, $strinfo, 400, 500, '', 'none', true).'</li>';
(and same goes for the one under).
Quite a few of themes also don't use this variable. Will look at that later.