diff --git a/modules/system/system.admin.css b/modules/system/system.admin.css index 43340b5..1711ca0 100644 --- a/modules/system/system.admin.css +++ b/modules/system/system.admin.css @@ -65,10 +65,10 @@ div.admin-required { font-size: 0.9em; color: #444; } -span.admin-disabled { +span.admin-inactive { color: #800; } -span.admin-enabled { +span.admin-active { color: #080; } span.admin-missing { @@ -148,6 +148,10 @@ tr.merge-up td { table.screenshot { margin-right: 1em; /* LTR */ } +.system-themes-page .theme-status { + font-size: 1.1em; + text-transform: none; +} .theme-info h2 { margin-bottom: 0; } @@ -155,10 +159,10 @@ table.screenshot { margin-top: 0; } .system-themes-list { - margin-bottom: 20px; + margin: 20px 0; } -.system-themes-list-disabled { - border-top: 1px solid #cdcdcd; +.system-themes-list-inactive { + background: #f8f8f8; padding-top: 20px; } .system-themes-list h2 { @@ -169,27 +173,25 @@ table.screenshot { } .theme-selector .screenshot, .theme-selector .no-screenshot { - border: 1px solid #e0e0d8; - padding: 2px; vertical-align: bottom; - width: 294px; - height: 219px; - line-height: 219px; + width: 160px; + height: 120px; + line-height: 120px; text-align: center; } .theme-default .screenshot { - border: 1px solid #aaa; + border-width: 0px; } -.system-themes-list-enabled .theme-selector .screenshot, -.system-themes-list-enabled .theme-selector .no-screenshot { - float: left; /* LTR */ - margin: 0 20px 0 0; /* LTR */ +.system-themes-list-active .theme-selector .screenshot, +.system-themes-list-active .theme-selector .no-screenshot { + /* margin: 0 20px 0 0; *//* LTR */ } -.system-themes-list-disabled .theme-selector .screenshot, -.system-themes-list-disabled .theme-selector .no-screenshot { - width: 194px; - height: 144px; - line-height: 144px; +.system-themes-list-inactive .theme-selector .screenshot, +.system-themes-list-inactive .theme-selector .no-screenshot { + width: 160px; + height: 120px; + line-height: 120px; + float: left; } .theme-selector h3 { font-weight: normal; @@ -197,19 +199,58 @@ table.screenshot { .theme-default h3 { font-weight: bold; } -.system-themes-list-enabled .theme-selector h3 { +.system-themes-list-active .theme-selector { + float: left; + width: 202px; + min-height: 230px; + margin: 22px 22px 0 0; /* LTR */ + padding: 44px 0 12px 0; + background: #f2f2f2; +} +.system-themes-list-active .theme-default { + padding-top: 0; + min-height: 289px; +} +.system-themes-list-active .theme-selector h4, +.system-themes-list-inactive .theme-selector h4 { margin-top: 0; + font-size: 1em; } -.system-themes-list-disabled .theme-selector { - width: 300px; - float: left; /* LTR */ - padding: 20px 20px 20px 0; /* LTR */ +.system-themes-list-inactive h2 { + padding: 0 20px 10px; +} +.system-themes-list-active .theme-name { + min-height: 2.75em; +} +.system-themes-list .theme-selector h4 { + color: #666666; +} +.system-themes-list-inactive .theme-selector h4 { + font-size: 1em; +} +.system-themes-list-inactive .theme-selector { + padding: 20px; +} +.system-themes-list-active .theme-status { + background: #a6a7a2; + color: #ffffff; + font-size: 1em; + line-height: 1.2em; + margin: 0; + padding: 14px 20px; +} +.system-themes-list-active .theme-info { + padding: 10px 20px 0 20px; +} +.system-themes-list-inactive .theme-info { + padding: 0 20px 0 0; + margin-left: 180px; /* LTR */ } -.system-themes-list-enabled .theme-info { - max-width: 940px; +.system-themes-list-inactive .theme-selector img { + margin: 0 20px 0 0; } -.system-themes-list-disabled .theme-info { - min-height: 170px; +.system-themes-list-inactive .theme-description { + color: #666666; } .theme-selector .incompatible { margin-top: 10px; @@ -219,18 +260,23 @@ table.screenshot { margin: 10px 0 0 0; padding: 0; } +.system-themes-list-inactive .theme-selector .operations { + margin-top: 0; +} .theme-selector .operations li { - float: left; /* LTR */ margin: 0; - padding: 0 0.7em; list-style-type: none; +} +.system-themes-list-inactive .theme-selector .operations li { + float: left; /* LTR */ + padding: 0 0.7em; border-right: 1px solid #cdcdcd; /* LTR */ } -.theme-selector .operations li.last { +.system-themes-list-inactive .theme-selector .operations li.last { padding: 0 0 0 0.7em; /* LTR */ border-right: none; /* LTR */ } -.theme-selector .operations li.first { +.system-themes-list-inactive .theme-selector .operations li.first { padding: 0 0.7em 0 0; /* LTR */ } #system-themes-admin-form { diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 9e7d69d..23b21c7 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -177,21 +177,21 @@ function system_themes_page() { $query['theme'] = $theme->name; if (drupal_theme_access($theme)) { $theme->operations[] = array( - 'title' => t('Settings'), - 'href' => 'admin/appearance/settings/' . $theme->name, - 'attributes' => array('title' => t('Settings for !theme theme', array('!theme' => $theme->info['name']))), + 'title' => t('Configure'), + 'href' => 'admin/appearance/configure/' . $theme->name, + 'attributes' => array('title' => t('Configure !theme', array('!theme' => $theme->info['name']))), ); } if (!empty($theme->status)) { if (!$theme->is_default) { $theme->operations[] = array( - 'title' => t('Disable'), - 'href' => 'admin/appearance/disable', + 'title' => t('Deactivate'), + 'href' => 'admin/appearance/deactivate', 'query' => $query, - 'attributes' => array('title' => t('Disable !theme theme', array('!theme' => $theme->info['name']))), + 'attributes' => array('title' => t('Deactivate !theme', array('!theme' => $theme->info['name']))), ); $theme->operations[] = array( - 'title' => t('Set default'), + 'title' => t('Set as default theme'), 'href' => 'admin/appearance/default', 'query' => $query, 'attributes' => array('title' => t('Set !theme as default theme', array('!theme' => $theme->info['name']))), @@ -200,16 +200,16 @@ function system_themes_page() { } else { $theme->operations[] = array( - 'title' => t('Enable'), - 'href' => 'admin/appearance/enable', + 'title' => t('Activate'), + 'href' => 'admin/appearance/activate', 'query' => $query, - 'attributes' => array('title' => t('Enable !theme theme', array('!theme' => $theme->info['name']))), + 'attributes' => array('title' => t('Activate !theme', array('!theme' => $theme->info['name']))), ); $theme->operations[] = array( - 'title' => t('Enable and set default'), + 'title' => t('Activate and set as default'), 'href' => 'admin/appearance/default', 'query' => $query, - 'attributes' => array('title' => t('Enable !theme as default theme', array('!theme' => $theme->info['name']))), + 'attributes' => array('title' => t('Activate !theme and set as default theme', array('!theme' => $theme->info['name']))), ); } } @@ -223,18 +223,18 @@ function system_themes_page() { } // Sort enabled and disabled themes into their own groups. - $theme_groups[$theme->status ? 'enabled' : 'disabled'][] = $theme; + $theme_groups[$theme->status ? 'active' : 'inactive'][] = $theme; } // There are two possible theme groups. $theme_group_titles = array( - 'enabled' => format_plural(count($theme_groups['enabled']), 'Enabled theme', 'Enabled themes'), + 'active' => format_plural(count($theme_groups['active']), 'Active theme', 'Active themes'), ); - if (!empty($theme_groups['disabled'])) { - $theme_group_titles['disabled'] = format_plural(count($theme_groups['disabled']), 'Disabled theme', 'Disabled themes'); + if (!empty($theme_groups['inactive'])) { + $theme_group_titles['inactive'] = format_plural(count($theme_groups['inactive']), 'Inactive theme', 'Inactive themes'); } - uasort($theme_groups['enabled'], 'system_sort_themes'); + uasort($theme_groups['active'], 'system_sort_themes'); drupal_alter('system_themes_page', $theme_groups); $admin_form = drupal_get_form('system_themes_admin_form', $admin_theme_options); @@ -2642,40 +2642,120 @@ function theme_system_themes_page($variables) { continue; } // Start new theme group. - $output .= '

'. $title .'

'; + $output .= '

'. $title .'

'; foreach ($theme_groups[$state] as $theme) { + $theme_function = "system_themes_page_theme_{$state}"; + if (function_exists("theme_{$theme_function}")) { + $output .= theme($theme_function, array('theme' => $theme)); + } + } + $output .= '
'; + } + $output .= '
'; + + return $output; +} + +/** + * Returns HTML for active theme on page Appearance. + * + * @param $variables + * An associative array containing: + * - theme: An object containing the theme information. + * + * @ingroup themeable + */ +function theme_system_themes_page_theme_active($variables) { + if (!isset($variables['theme'])) { + return ''; + } + $theme = $variables['theme']; + $output = ''; + // Theme the screenshot. + $screenshot = $theme->screenshot ? theme('image', $theme->screenshot) : '
' . t('no screenshot') . '
'; - // Theme the screenshot. - $screenshot = $theme->screenshot ? theme('image', $theme->screenshot) : '
' . t('no screenshot') . '
'; + // Localize the theme description. + $description = t($theme->info['description']); - // Localize the theme description. - $description = t($theme->info['description']); + // Additional notes. + $notes = count($theme->notes) ? ' (' . join(', ', $theme->notes) . ')' : ''; - // Style theme info - $notes = count($theme->notes) ? ' (' . join(', ', $theme->notes) . ')' : ''; - $theme->classes[] = 'theme-selector'; - $theme->classes[] = 'clearfix'; - $output .= '
' . $screenshot . '

' . $theme->info['name'] . ' ' . (isset($theme->info['version']) ? $theme->info['version'] : '') . $notes . '

' . $description . '
'; + // Style theme info + $theme->classes[] = 'theme-selector'; + $theme->classes[] = 'clearfix'; + $output .= '
'; + if ($theme->is_default) { + $output .= '

' . t('Current default theme') . '

'; + } + $output .= '

' . $theme->info['name'] . (isset($theme->info['version']) ? ' ' . $theme->info['version'] : '') . '

'; + $output .= $screenshot; - // Make sure to provide feedback on compatibility. - if (!empty($theme->incompatible_core)) { - $output .= '
' . t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)) . '
'; - } - elseif (!empty($theme->incompatible_php)) { - if (substr_count($theme->info['php'], '.') < 2) { - $theme->info['php'] .= '.*'; - } - $output .= '
' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())) . '
'; - } - else { - $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix')))); - } - $output .= '
'; + // Make sure to provide feedback on compatibility. + if (!empty($theme->incompatible_core)) { + $output .= '
' . t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)) . '
'; + } + elseif (!empty($theme->incompatible_php)) { + if (substr_count($theme->info['php'], '.') < 2) { + $theme->info['php'] .= '.*'; } - $output .= '
'; + $output .= '
' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())) . '
'; } - $output .= '
'; + else { + $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix')))); + } + $output .= ''; + + return $output; +} + +/** + * Returns HTML for inactive theme on page Appearance. + * + * @param $variables + * An associative array containing: + * - theme: An object containing the theme information. + * + * @ingroup themeable + */ +function theme_system_themes_page_theme_inactive($variables) { + if (!isset($variables['theme'])) { + return ''; + } + $theme = $variables['theme']; + $output = ''; + // Theme the screenshot. + $screenshot = $theme->screenshot ? theme('image', $theme->screenshot) : '
' . t('no screenshot') . '
'; + + // Localize the theme description. + $description = t($theme->info['description']); + + // Additional notes. + $notes = count($theme->notes) ? ' (' . join(', ', $theme->notes) . ')' : ''; + + // Style theme info + $theme->classes[] = 'theme-selector'; + $theme->classes[] = 'clearfix'; + $output .= '
'; + + $output .= $screenshot; + $output .= '

' . $theme->info['name'] . (isset($theme->info['version']) ? ' ' . $theme->info['version'] : '') . '

'; + $output .= '
' . $description . '
'; + + // Make sure to provide feedback on compatibility. + if (!empty($theme->incompatible_core)) { + $output .= '
' . t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => DRUPAL_CORE_COMPATIBILITY)) . '
'; + } + elseif (!empty($theme->incompatible_php)) { + if (substr_count($theme->info['php'], '.') < 2) { + $theme->info['php'] .= '.*'; + } + $output .= '
' . t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())) . '
'; + } + else { + $output .= theme('links', array('links' => $theme->operations, 'attributes' => array('class' => array('operations', 'clearfix')))); + } + $output .= '
'; return $output; } diff --git a/modules/system/system.module b/modules/system/system.module index 3ebc657..d000fa2 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -150,6 +150,14 @@ function system_theme() { 'variables' => array('theme_groups' => NULL), 'file' => 'system.admin.inc', ), + 'system_themes_page_theme_active' => array( + 'variables' => array('theme' => NULL), + 'file' => 'system.admin.inc', + ), + 'system_themes_page_theme_inactive' => array( + 'variables' => array('theme' => NULL), + 'file' => 'system.admin.inc', + ), 'system_settings_form' => array( 'render element' => 'form', ), @@ -597,15 +605,15 @@ function system_menu() { 'weight' => -1, 'file' => 'system.admin.inc', ); - $items['admin/appearance/enable'] = array( - 'title' => 'Enable theme', + $items['admin/appearance/activate'] = array( + 'title' => 'Activate theme', 'page callback' => 'system_theme_enable', 'access arguments' => array('administer themes'), 'type' => MENU_CALLBACK, 'file' => 'system.admin.inc', ); - $items['admin/appearance/disable'] = array( - 'title' => 'Disable theme', + $items['admin/appearance/deactivate'] = array( + 'title' => 'Deactivate theme', 'page callback' => 'system_theme_disable', 'access arguments' => array('administer themes'), 'type' => MENU_CALLBACK, @@ -618,8 +626,8 @@ function system_menu() { 'type' => MENU_CALLBACK, 'file' => 'system.admin.inc', ); - $items['admin/appearance/settings'] = array( - 'title' => 'Settings', + $items['admin/appearance/configure'] = array( + 'title' => 'Configure', 'description' => 'Configure default and theme specific settings.', 'page callback' => 'drupal_get_form', 'page arguments' => array('system_theme_settings'),