Skip to content
Snippets Groups Projects
Commit 688037d7 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #783580 by dmitrig01: what's the point of _system_theme_list()?

parent 7745a082
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -191,35 +191,21 @@ function system_settings_overview() {
return $output;
}
/**
* Retrieve the list of themes that are not hidden.
*/
function _system_theme_list() {
// Get current list of themes.
$themes = system_rebuild_theme_data();
// Remove hidden themes from the display list.
foreach ($themes as $theme_key => $theme) {
if (!empty($theme->info['hidden'])) {
unset($themes[$theme_key]);
}
}
uasort($themes, 'system_sort_modules_by_info_name');
return $themes;
}
/**
* Menu callback; displays a listing of all themes.
*/
function system_themes_page() {
// Get current list of themes.
$themes = _system_theme_list();
$themes = list_themes();
uasort($themes, 'system_sort_modules_by_info_name');
$theme_default = variable_get('theme_default', 'garland');
$theme_groups = array();
foreach ($themes as &$theme) {
if (!empty($theme->info['hidden'])) {
continue;
}
$admin_theme_options[$theme->name] = $theme->info['name'];
$theme->is_default = ($theme->name == $theme_default);
......@@ -373,7 +359,7 @@ function system_theme_enable() {
if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
$theme = $_REQUEST['theme'];
// Get current list of themes.
$themes = _system_theme_list();
$themes = list_themes();
// Check if the specified theme is one recognized by the system.
if (!empty($themes[$theme])) {
......@@ -395,7 +381,7 @@ function system_theme_disable() {
if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
$theme = $_REQUEST['theme'];
// Get current list of themes.
$themes = _system_theme_list();
$themes = list_themes();
// Check if the specified theme is one recognized by the system.
if (!empty($themes[$theme])) {
......@@ -423,7 +409,7 @@ function system_theme_default() {
if (isset($_REQUEST['theme']) && isset($_REQUEST['token']) && drupal_valid_token($_REQUEST['token'], 'system-theme-operation-link')) {
$theme = $_REQUEST['theme'];
// Get current list of themes.
$themes = _system_theme_list();
$themes = list_themes();
// Check if the specified theme is one recognized by the system.
if (!empty($themes[$theme])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment