From 1836d3b3656f77a2e98ffdcd4d04e45410c3897f Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 18 Aug 2005 22:07:14 +0000 Subject: - Patch #29002 by Neil: list_themes() currently returns all themes, not just enabled themes. This functionality is only used in one place- configuration for disabled themes. These configuration pages can be removed with a usability improvement since you shouldn't be able to configure things which are disabled. Additionally, this allows us to remove some extra logic in system_user(). And it it more consistent with the module API which only lists enabled modules. list_themes() sorts the results by name. This uses filesort in MySQL since there aren't any indexes. Sorting is not used except in system_user(). This one use can be handled with ksort since it is not often executed (only on the user edit screen when multiple themes are enabled). And a one line fix to remove a variable in system_user() is in here too. --- includes/theme.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/theme.inc b/includes/theme.inc index edbd8d58c..6c83bf086 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -99,7 +99,7 @@ function list_themes($refresh = FALSE) { if (!$list) { $list = array(); - $result = db_query("SELECT * FROM {system} WHERE type = 'theme' ORDER BY name"); + $result = db_query("SELECT * FROM {system} WHERE type = 'theme' AND status = 1"); while ($theme = db_fetch_object($result)) { if (file_exists($theme->filename)) { $list[$theme->name] = $theme; -- cgit v1.2.3