diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index f798392..73a3fc0 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -921,7 +921,7 @@ function install_display_output($output, $install_state) { // Let the theming function know when every step of the installation has // been completed. $active_task = $install_state['installation_finished'] ? NULL : $install_state['active_task']; - drupal_add_region_content('sidebar_first', theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task))); + drupal_add_region_content('sidebar_first', theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task, 'variant' => 'install'))); } print theme('install_page', array('content' => $output)); exit; diff --git a/core/includes/install.inc b/core/includes/install.inc index 503b3da..4f96cfe 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -97,7 +97,7 @@ function drupal_install_profile_distribution_name() { // installation state (it might not be saved anywhere yet). if (drupal_installation_attempted()) { global $install_state; - return $install_state['profile_info']['distribution_name']; + return isset($install_state['profile_info']['distribution_name']) ? $install_state['profile_info']['distribution_name'] : 'Drupal'; } // At all other times, we load the profile via standard methods. else { diff --git a/core/includes/theme.inc b/core/includes/theme.inc index ae8ec15..5def799 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -388,6 +388,45 @@ function _theme_save_registry($theme, $registry) { } /** + * Adds mobile friendly meta tags to the head of the HTML page. + */ +function _theme_add_mobile_meta_tags() { + $elements = array( + 'MobileOptimized' => array( + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'MobileOptimized', + 'content' => 'width', + ), + ), + 'HandheldFriendly' => array( + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'HandheldFriendly', + 'content' => 'true', + ), + ), + 'viewport' => array( + '#tag' => 'meta', + '#attributes' => array( + 'name' => 'viewport', + 'content' => 'width=device-width', + ), + ), + 'cleartype' => array( + '#tag' => 'meta', + '#attributes' => array( + 'http-equiv' => 'cleartype', + 'content' => 'on', + ), + ), + ); + foreach ($elements as $name => $element) { + drupal_add_html_head($element, $name); + } +} + +/** * Forces the system to rebuild the theme registry. * * This function should be called when modules are added to the system, or when @@ -2784,6 +2823,9 @@ function template_preprocess_page(&$variables) { } } + // Add mobile meta tags. + _theme_add_mobile_meta_tags(); + // Set up layout variable. $variables['layout'] = 'none'; if (!empty($variables['page']['sidebar_first'])) { @@ -2999,6 +3041,9 @@ function template_preprocess_maintenance_page(&$variables) { drupal_add_html_head_link(array('rel' => 'shortcut icon', 'href' => drupal_strip_dangerous_protocols($favicon), 'type' => $type)); } + // Add mobile meta tags. + _theme_add_mobile_meta_tags(); + // Get all region content set with drupal_add_region_content(). foreach (array_keys($regions) as $region) { // Assign region to a region variable. @@ -3098,6 +3143,36 @@ function template_process_maintenance_page(&$variables) { $variables['scripts'] = drupal_get_js(); } + /** + * Preprocesses variables for region.tpl.php and for install page templates. + * + * Default template: install-page.html.twig + * + * @param array $variables + * An associative array containing variables to process. + * @todo Specify the elements in the array. + * + * @see template_preprocess_maintenance_page() + */ +function template_preprocess_install_page(&$variables) { + template_preprocess_maintenance_page($variables); + // Override the site name that is displayed on the page, since Drupal is + // still in the process of being installed. + $variables['site_name'] = drupal_install_profile_distribution_name(); +} + +/** + * Preprocess variables for install-page.tpl.php. + * + * @see install-page.html.twig + * @see template_process_html() + * + * @todo Remove this function. + */ +function template_process_install_page(&$variables) { + template_process_maintenance_page($variables); +} + /** * Preprocess variables for region.tpl.php * @@ -3205,10 +3280,11 @@ function drupal_common_theme() { 'template' => 'maintenance-page', ), 'install_page' => array( - 'variables' => array('content' => NULL), + 'variables' => array('content' => NULL, 'show_messages' => TRUE), + 'template' => 'install-page', ), 'task_list' => array( - 'variables' => array('items' => NULL, 'active' => NULL), + 'variables' => array('items' => NULL, 'active' => NULL, 'variant' => NULL), ), 'authorize_message' => array( 'variables' => array('message' => NULL, 'success' => TRUE), diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc index b9a513c..aec2932 100644 --- a/core/includes/theme.maintenance.inc +++ b/core/includes/theme.maintenance.inc @@ -115,6 +115,7 @@ function _theme_load_offline_registry($theme, $base_theme = NULL, $theme_engine * An associative array containing: * - items: An associative array of maintenance tasks. * - active: The key for the currently active maintenance task. + * - variant: A variant name to be used for a CSS class. * * @ingroup themeable */ @@ -122,10 +123,16 @@ function theme_task_list($variables) { $t = get_t(); $items = $variables['items']; $active = $variables['active']; + if(isset($variables['variant'])) { + $class = $variables['variant'] . '-task-list'; + } + else { + $class = 'task-list'; + } $done = isset($items[$active]) || $active == NULL; $output = '