summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-08-22 14:43:49 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-08-22 14:43:49 +0000
commit98a9d5ee2d6a272b9f65ad8b69fa3580f3d0ab93 (patch)
treecbfc1981ff5729d6f2e5a25255d43874729856c6
parent05714da2ec41bcb389c73d4f95fcbebe78af140c (diff)
downloadbrdo-98a9d5ee2d6a272b9f65ad8b69fa3580f3d0ab93.tar.gz
brdo-98a9d5ee2d6a272b9f65ad8b69fa3580f3d0ab93.tar.bz2
- #9576: Patch by TDobes, only allow the user to choose between enabled themes.
-rw-r--r--includes/theme.inc2
-rw-r--r--modules/system.module11
-rw-r--r--modules/system/system.module11
3 files changed, 21 insertions, 3 deletions
diff --git a/includes/theme.inc b/includes/theme.inc
index a4b0b1274..d9f8a5de6 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -43,7 +43,7 @@ function init_theme() {
// Allow modules to override the present theme... only select custom theme
// if it is available in the list of enabled themes.
- $theme = $custom_theme && $themes[$custom_theme]->status ? $custom_theme : $theme;
+ $theme = $custom_theme && $themes[$custom_theme] ? $custom_theme : $theme;
// Store the identifier for retrieving theme settings with.
$theme_key = $theme;
diff --git a/modules/system.module b/modules/system.module
index 5508f868d..a2ec2f332 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -113,7 +113,16 @@ function system_menu() {
*/
function system_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
- if (count($themes = list_themes()) > 1) {
+ $allthemes = list_themes();
+
+ // list only active themes
+ foreach ($allthemes as $key => $theme) {
+ if ($theme->status) {
+ $themes[$key] = $theme;
+ }
+ }
+
+ if (count($themes) > 1) {
$rows = array();
foreach ($themes as $key => $value) {
$row = array();
diff --git a/modules/system/system.module b/modules/system/system.module
index 5508f868d..a2ec2f332 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -113,7 +113,16 @@ function system_menu() {
*/
function system_user($type, $edit, &$user, $category = NULL) {
if ($type == 'form' && $category == 'account') {
- if (count($themes = list_themes()) > 1) {
+ $allthemes = list_themes();
+
+ // list only active themes
+ foreach ($allthemes as $key => $theme) {
+ if ($theme->status) {
+ $themes[$key] = $theme;
+ }
+ }
+
+ if (count($themes) > 1) {
$rows = array();
foreach ($themes as $key => $value) {
$row = array();