diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 9928ddd..850018a 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -8,134 +8,93 @@ /** * Implements hook_preprocess_HOOK() for maintenance-page.html.twig. */ -function seven_preprocess_maintenance_page(&$variables) { +function seven_preprocess_maintenance_page(&$vars) { // While markup for normal pages is split into page.tpl.php and html.tpl.php, // the markup for the maintenance page is all in the single // maintenance-page.html.twig template. So, to have what's done in // seven_preprocess_html() also happen on the maintenance page, it has to be // called here. - seven_preprocess_html($variables); + seven_preprocess_html($vars); } /** * Implements hook_preprocess_HOOK() for html.tpl.php. */ -function seven_preprocess_html(&$variables) { +function seven_preprocess_html(&$vars) { drupal_add_library('system', 'normalize'); + // Add conditional CSS for IE8 and below. + drupal_add_css(path_to_theme() . '/ie.css', array('group' => CSS_AGGREGATE_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'weight' => 999, 'preprocess' => FALSE)); } /** * Implements hook_preprocess_HOOK() for page.tpl.php. */ -function seven_preprocess_page(&$variables) { - $variables['primary_local_tasks'] = $variables['tabs']; - unset($variables['primary_local_tasks']['#secondary']); - $variables['secondary_local_tasks'] = array( +function seven_preprocess_page(&$vars) { + $vars['primary_local_tasks'] = $vars['tabs']; + unset($vars['primary_local_tasks']['#secondary']); + $vars['secondary_local_tasks'] = array( '#theme' => 'menu_local_tasks', - '#secondary' => isset($variables['tabs']['#secondary']) ? $variables['tabs']['#secondary'] : '', + '#secondary' => isset($vars['tabs']['#secondary']) ? $vars['tabs']['#secondary'] : '', ); } /** - * Displays the list of available node types for node creation. + * Implements hook_preprocess_HOOK() for node-add-list.html.twig. */ -function seven_node_add_list($variables) { - $content = $variables['content']; - $output = ''; - if ($content) { - $output = ''; } - else { - $output = '

' . t('You have not created any content types yet. Go to the content type creation page to add a new content type.', array('@create-content' => url('admin/structure/types/add'))) . '

'; - } - return $output; } /** - * Overrides theme_custom_block_add_list(). + * Implements hook_preprocess_HOOK() for custom-block-add-list.html.twig. + * + * Add variables for the label and the path separately. + * + * Displays the list of available custom block types for creation, adding + * separate variables for the label and the path. * - * Displays the list of available custom block types for creation. */ -function seven_custom_block_add_list($variables) { - $content = $variables['content']; - $output = ''; - if ($content) { - $output = ''; } - return $output; } /** - * Overrides theme_admin_block_content(). + * Implements hook_preprocess_HOOK() for theme_admin_block_content(). * * Uses an unordered list markup in both compact and extended mode. */ -function seven_admin_block_content($variables) { - $content = $variables['content']; - $output = ''; - if (!empty($content)) { - $output = system_admin_compact_mode() ? '