diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index a3caa09..b77e343 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -24,6 +24,8 @@ function seven_preprocess_maintenance_page(&$variables) {
*/
function seven_preprocess_html(&$variables) {
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));
}
/**
@@ -39,105 +41,62 @@ function seven_preprocess_page(&$variables) {
}
/**
- * 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() ? '' : '';
}
- return $output;
}
/**
- * Overrides theme_tablesort_indicator().
+ * Implements hook_preprocess_HOOK() for tablesort-indicator.html.twig.
*
* Uses Seven's image versions, so the arrows show up as black and not gray on
* gray.
*/
-function seven_tablesort_indicator($variables) {
- $theme_path = drupal_get_path('theme', 'seven');
-
- if($variables['style'] == 'asc') {
- $image_uri = $theme_path . '/images/arrow-asc.png';
- $text = t('Sort ascending');
- }
- else {
- $image_uri = $theme_path . '/images/arrow-desc.png';
- $text = t('Sort descending');
- }
-
- $image = array(
- '#theme' => 'image',
- '#uri' => $image_uri,
- '#alt' => $text,
- '#width' => 13,
- '#height' => 13,
- '#title' => $text,
- );
- return drupal_render($image);
+function seven_preprocess_tablesort_indicator(&$variables) {
+ $variables['uri'] = drupal_get_path('theme', 'seven') . '/images/arrow-' . ($variables['style'] == 'asc' ? 'asc' : 'desc') . '.png';
+ $variables['attributes']['src'] = file_create_url($variables['uri']);
}
/**
@@ -145,9 +104,6 @@ function seven_tablesort_indicator($variables) {
*/
function seven_preprocess_install_page(&$variables) {
drupal_add_js(drupal_get_path('theme', 'seven') . '/js/mobile.install.js');
- drupal_add_css(drupal_get_path('theme', 'seven') . '/install-page.css', array('group' => CSS_AGGREGATE_THEME));
- $variables['styles'] = new RenderWrapper('drupal_get_css');
- $variables['scripts'] = new RenderWrapper('drupal_get_js');
}
/**
@@ -160,7 +116,7 @@ function seven_form_node_form_alter(&$form, &$form_state) {
$form['#theme'] = array('node_edit_form');
$form['#attached'] = array(
- 'css' => array(drupal_get_path('module', 'node') . '/css/node.module.css'),
+ 'css' => array(drupal_get_path('module', 'node') . '/node.edit.admin.css'),
);
$form['advanced']['#type'] = 'container';
diff --git a/core/themes/seven/templates/admin-block-content.html.twig b/core/themes/seven/templates/admin-block-content.html.twig
new file mode 100644
index 0000000..8960563
--- /dev/null
+++ b/core/themes/seven/templates/admin-block-content.html.twig
@@ -0,0 +1,25 @@
+{#
+/**
+ * @file
+ * Seven's theme implementation for the content of an administrative block.
+ *
+ * Available variables:
+ * - content: List of administrative menu items. Each menu item contains:
+ * - path: Path to the admin section.
+ * - label: Short name of the section.
+ * - description: Description of the administrative menu item.
+ * - compact: Class indicator for compact mode (empty if not compact).
+ *
+ * @see template_preprocess_admin_block_content()
+ * @see seven_preprocess_custom_block_add_list()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if content %}
+
+{% endif %}
diff --git a/core/themes/seven/templates/custom-block-add-list.html.twig b/core/themes/seven/templates/custom-block-add-list.html.twig
new file mode 100644
index 0000000..8e53e5c
--- /dev/null
+++ b/core/themes/seven/templates/custom-block-add-list.html.twig
@@ -0,0 +1,29 @@
+{#
+/**
+ * @file
+ * Overrides custom-block-add-list.html.twig.
+ *
+ * Displays the list of available custom block types for creation.
+ *
+ * Available variables:
+ * - types: A collection of all the available custom block types.
+ * Each type contains:
+ * - type: The custom block type, containing all the items below.
+ * - link: A link to add a block of this type.
+ * - description: A description of this custom block type.
+ * - label: The title of the custom block type.
+ * - path: A path for the link to add a block of this type.
+ *
+ * @see template_preprocess_custom_block_add_list()
+ * @see seven_preprocess_custom_block_add_list()
+ *
+ * @ingroup themeable
+ */
+ #}
+
diff --git a/core/themes/seven/templates/node-add-list.html.twig b/core/themes/seven/templates/node-add-list.html.twig
new file mode 100644
index 0000000..9886e2f
--- /dev/null
+++ b/core/themes/seven/templates/node-add-list.html.twig
@@ -0,0 +1,25 @@
+{#
+/**
+ * @file
+ * Seven's theme implementation to list node types available for adding content.
+ *
+ * Available variables:
+ * - types: List of content types. Each content type contains:
+ * - add_link: Link to create a piece of content of this type.
+ * - description: Description of this type of content.
+ *
+ * @see template_preprocess_node_add_list()
+ * @see seven_preprocess_node_add_list()
+ *
+ * @ingroup themeable
+ */
+#}
+{% if content %}
+
+{% else %}
+ {{ 'You have not created any content types yet. Go to the content type creation page to add a new content type.'|t({'@create-content': url('admin/structure/types/add')}) }}
+{% endif %}