Patch #292253 by Damien Tournoud: remove the user-facing theme selection form.

From:  <>


---

 modules/color/color.module      |    7 ----
 modules/system/system.admin.inc |   22 -------------
 modules/system/system.module    |   67 ---------------------------------------
 3 files changed, 0 insertions(+), 96 deletions(-)


diff --git modules/color/color.module modules/color/color.module
index a38efbf..f6754a0 100644
--- modules/color/color.module
+++ modules/color/color.module
@@ -59,13 +59,6 @@ function color_form_system_themes_alter(&$form, &$form_state) {
 }
 
 /**
- * Implement hook_form_FORM_ID_alter().
- */
-function color_form_system_theme_select_form_alter(&$form, &$form_state) {
-  _color_theme_select_form_alter($form, $form_state);
-}
-
-/**
  * Helper for hook_form_FORM_ID_alter() implementations.
  */
 function _color_theme_select_form_alter(&$form, &$form_state) {
diff --git modules/system/system.admin.inc modules/system/system.admin.inc
index 0aee121..c74ef4c 100644
--- modules/system/system.admin.inc
+++ modules/system/system.admin.inc
@@ -2147,28 +2147,6 @@ function theme_system_modules_uninstall($form) {
 }
 
 /**
- * Theme the theme select form.
- * @param $form
- *   An associative array containing the structure of the form.
- * @ingroup themeable
- */
-function theme_system_theme_select_form($form) {
-  foreach (element_children($form) as $key) {
-    $row = array();
-    if (isset($form[$key]['description']) && is_array($form[$key]['description'])) {
-      $row[] = drupal_render($form[$key]['screenshot']);
-      $row[] = drupal_render($form[$key]['description']);
-      $row[] = drupal_render($form['theme'][$key]);
-    }
-    $rows[] = $row;
-  }
-
-  $header = array(t('Screenshot'), t('Name'), t('Selected'));
-  $output = theme('table', $header, $rows);
-  return $output;
-}
-
-/**
  * Theme function for the system themes form.
  *
  * @param $form
diff --git modules/system/system.module modules/system/system.module
index a0e20ac..7e5e086 100644
--- modules/system/system.module
+++ modules/system/system.module
@@ -150,10 +150,6 @@ function system_help($path, $arg) {
  */
 function system_theme() {
   return array_merge(drupal_common_theme(), array(
-    'system_theme_select_form' => array(
-      'arguments' => array('form' => NULL),
-      'file' => 'system.admin.inc',
-    ),
     'system_themes_form' => array(
       'arguments' => array('form' => NULL),
       'file' => 'system.admin.inc',
@@ -1380,7 +1376,6 @@ function system_preprocess_page(&$variables) {
  */
 function system_user_form(&$edit, &$user, $category = NULL) {
   if ($category == 'account') {
-    $form['theme_select'] = system_theme_select_form(t('Selecting a different theme will change the look and feel of the site.'), isset($edit['theme']) ? $edit['theme'] : NULL, 2);
     if (variable_get('configurable_timezones', 1)) {
       system_user_timezone($edit, $form);
     }
@@ -1586,68 +1581,6 @@ function system_admin_menu_block($item) {
 }
 
 /**
- * Returns a fieldset containing the theme select form.
- *
- * @param $description
- *    description of the fieldset
- * @param $default_value
- *    default value of theme radios
- * @param $weight
- *    weight of the fieldset
- * @return
- *    a form array
- */
-function system_theme_select_form($description = '', $default_value = '', $weight = 0) {
-  if (user_access('select different theme')) {
-    $enabled = array();
-    $themes = list_themes();
-
-    foreach ($themes as $theme) {
-      if ($theme->status) {
-        $enabled[] = $theme;
-      }
-    }
-
-    if (count($enabled) > 1) {
-      ksort($enabled);
-
-      $form['themes'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Theme configuration'),
-        '#description' => $description,
-        '#collapsible' => TRUE,
-        '#theme' => 'system_theme_select_form'
-      );
-
-      foreach ($enabled as $info) {
-        // For the default theme, revert to an empty string so the user's theme updates when the site theme is changed.
-        $info->key = $info->name == variable_get('theme_default', 'garland') ? '' : $info->name;
-
-        $screenshot = NULL;
-        $theme_key = $info->name;
-        while ($theme_key) {
-          if (file_exists($themes[$theme_key]->info['screenshot'])) {
-            $screenshot = $themes[$theme_key]->info['screenshot'];
-            break;
-          }
-          $theme_key = isset($themes[$theme_key]->info['base theme']) ? $themes[$theme_key]->info['base theme'] : NULL;
-        }
-
-        $screenshot = $screenshot ? theme('image', $screenshot, t('Screenshot for %theme theme', array('%theme' => $info->name)), '', array('class' => 'screenshot'), FALSE) : t('no screenshot');
-
-        $form['themes'][$info->key]['screenshot'] = array('#markup' => $screenshot);
-        $form['themes'][$info->key]['description'] = array('#type' => 'item', '#title' => $info->name, '#markup' => dirname($info->filename) . ($info->name == variable_get('theme_default', 'garland') ? '<br /> <em>' . t('(site default theme)') . '</em>' : ''));
-        $options[$info->key] = '';
-      }
-
-      $form['themes']['theme'] = array('#type' => 'radios', '#options' => $options, '#default_value' => $default_value ? $default_value : '');
-      $form['#weight'] = $weight;
-      return $form;
-    }
-  }
-}
-
-/**
  * Checks the existence of the directory specified in $form_element. This
  * function is called from the system_settings form to check both the
  * file_directory_path and file_directory_temp directories. If validation
