stable9.theme

Same filename in other branches
  1. 10 core/themes/stable9/stable9.theme

Functions to support theming in the Stable9 theme.

File

core/themes/stable9/stable9.theme

View source
<?php


/**
 * @file
 * Functions to support theming in the Stable9 theme.
 */

/**
 * Implements hook_preprocess_item_list__search_results().
 *
 * Converts the markup of #empty for search results.
 */
function stable9_preprocess_item_list__search_results(&$variables) {
    if (isset($variables['empty']['#tag'])) {
        $variables['empty']['#tag'] = 'h3';
    }
}

/**
 * Implements hook_preprocess_views_view().
 *
 * Adds BC classes that were previously added by the Views module.
 */
function stable9_preprocess_views_view(&$variables) {
    if (!empty($variables['attributes']['class'])) {
        $bc_classes = preg_replace('/[^a-zA-Z0-9- ]/', '-', $variables['attributes']['class']);
        $variables['attributes']['class'] = array_merge($variables['attributes']['class'], $bc_classes);
    }
    if (!empty($variables['css_class'])) {
        $existing_classes = explode(' ', $variables['css_class']);
        $bc_classes = preg_replace('/[^a-zA-Z0-9- ]/', '-', $existing_classes);
        $variables['css_class'] = implode(' ', array_merge($existing_classes, $bc_classes));
    }
}

Functions

Title Deprecated Summary
stable9_preprocess_item_list__search_results Implements hook_preprocess_item_list__search_results().
stable9_preprocess_views_view Implements hook_preprocess_views_view().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.