optional_variable($preview); // which theme to show
optional_variable($choose); // set this theme as default
+ if (! $site = get_site()) {
+ error("Site doesn't exist!");
+ }
+
+ require_login();
+
+ if (!isadmin()) {
+ error("You must be an administrator to change themes.");
+ }
+
if ($choose) {
+ if (!is_dir($choose)) {
+ error("This theme is not installed!");
+ }
$preview = $choose;
}
include ("$CFG->theme/config.php");
}
-
- if (! $site = get_site()) {
- error("Site doesn't exist!");
- }
-
- require_login();
-
- if (!isadmin()) {
- error("You must be an administrator to change themes.");
- }
-
-
$stradministration = get_string("administration");
$strchoosetheme = get_string("choosetheme");
$strpreview = get_string("preview");