Пример #1
0
/**
 * Preprocess variables for the html template.
 */
function outreach_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = $theme_key;
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_name));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
}
Пример #2
0
/**
 * Override or insert variables into the html template.
 */
function pixture_reloaded_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = 'pixture_reloaded';
    $path_to_theme = drupal_get_path('theme', $theme_name);
    // Load the media queries styles
    $media_queries_css = array($theme_name . '.responsive.style.css', $theme_name . '.responsive.gpanels.css');
    load_subtheme_media_queries($media_queries_css, $theme_name);
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_key));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_key);
    // Add theme settings classes
    $settings_array = array('font_size', 'box_shadows', 'body_background', 'menu_bullets', 'menu_bar_position', 'corner_radius', 'image_alignment');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = theme_get_setting($setting);
    }
    // Fonts
    $fonts = array('bf' => 'base_font', 'snf' => 'site_name_font', 'ssf' => 'site_slogan_font', 'ptf' => 'page_title_font', 'ntf' => 'node_title_font', 'ctf' => 'comment_title_font', 'btf' => 'block_title_font');
    $families = get_font_families($fonts, $theme_key);
    if (!empty($families)) {
        foreach ($families as $family) {
            $vars['classes_array'][] = $family;
        }
    }
    // Add Noggin module settings extra classes, not all designs can support header images
    if (module_exists('noggin')) {
        if (variable_get('noggin:use_header', FALSE)) {
            $va = theme_get_setting('noggin_image_vertical_alignment');
            $ha = theme_get_setting('noggin_image_horizontal_alignment');
            $vars['classes_array'][] = 'ni-a-' . $va . $ha;
            $vars['classes_array'][] = theme_get_setting('noggin_image_repeat');
            $vars['classes_array'][] = theme_get_setting('noggin_image_width');
        }
    }
    // Special case for PIE htc rounded corners, not all themes include this
    if (theme_get_setting('ie_corners') == 1) {
        drupal_add_css($path_to_theme . '/css/ie-htc.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
    }
    // Headings styles
    if (theme_get_setting('headings_styles_caps') == 1) {
        $vars['classes_array'][] = 'hs-caps';
    }
    if (theme_get_setting('headings_styles_weight') == 1) {
        $vars['classes_array'][] = 'hs-fwn';
    }
    if (theme_get_setting('headings_styles_shadow') == 1) {
        $vars['classes_array'][] = 'hs-ts';
    }
}
Пример #3
0
/**
 * Override or insert variables into the html template.
 */
function ibm_apim_theme_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = $theme_key;
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_name));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_name);
    // Add theme settings classes
    $settings_array = array('box_shadows', 'body_background', 'menu_bullets', 'menu_bar_position', 'content_corner_radius', 'tabs_corner_radius');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = at_get_setting($setting);
    }
}
Пример #4
0
/**
 * Override or insert variables into the html template.
 */
function sky_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = $theme_key;
    // Add a class for the active color scheme
    if (module_exists('color') && function_exists('get_color_scheme_name')) {
        $class = check_plain(get_color_scheme_name($theme_name));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_name);
    // Browser sniff and add a class, unreliable but quite useful
    // $vars['classes_array'][] = css_browser_selector();
    // Add theme settings classes
    $settings_array = array('box_shadows', 'body_background', 'menu_bullets', 'menu_bar_position', 'content_corner_radius', 'tabs_corner_radius');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = at_get_setting($setting);
    }
}
Пример #5
0
/**
 * Override or insert vars into the html template.
 */
function corolla_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = 'corolla';
    // Load the media queries styles
    $media_queries_css = array($theme_name . '.responsive.style.css', $theme_name . '.responsive.gpanels.css');
    load_subtheme_media_queries($media_queries_css, $theme_name);
    // Load IE specific stylesheets
    $ie_files = array('lte IE 9' => 'ie-lte-9.css');
    load_subtheme_ie_styles($ie_files, $theme_name);
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_key));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_key);
    // Add theme settings classes
    $settings_array = array('font_size', 'box_shadows', 'body_background', 'menu_bullets', 'content_corner_radius', 'tabs_corner_radius', 'image_alignment');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = theme_get_setting($setting);
    }
    // Fonts
    $fonts = array('bf' => 'base_font', 'snf' => 'site_name_font', 'ssf' => 'site_slogan_font', 'ptf' => 'page_title_font', 'ntf' => 'node_title_font', 'ctf' => 'comment_title_font', 'btf' => 'block_title_font');
    $families = get_font_families($fonts, $theme_key);
    if (!empty($families)) {
        foreach ($families as $family) {
            $vars['classes_array'][] = $family;
        }
    }
    // Heading styles
    if (theme_get_setting('headings_styles_caps') == 1) {
        $vars['classes_array'][] = 'hs-caps';
    }
    if (theme_get_setting('headings_styles_weight') == 1) {
        $vars['classes_array'][] = 'hs-fwn';
    }
    if (theme_get_setting('headings_styles_shadow') == 1) {
        $vars['classes_array'][] = 'hs-ts';
    }
}
Пример #6
0
/**
 * Override or insert variables into the html template.
 */
function pixture_reloaded_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = 'pixture_reloaded';
    $path_to_theme = drupal_get_path('theme', $theme_name);
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_key));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_key);
    // Add theme settings classes
    $settings_array = array('box_shadows', 'body_background', 'menu_bullets', 'menu_bar_position', 'corner_radius');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = theme_get_setting($setting);
    }
    // Special case for PIE htc rounded corners, not all themes include this
    if (theme_get_setting('ie_corners') == 1) {
        drupal_add_css($path_to_theme . '/css/ie-htc.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
    }
}
/**
 * Override or insert variables into the html template.
 */
function at_commerce_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = 'at_commerce';
    $path_to_theme = drupal_get_path('theme', $theme_name);
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_key));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_key);
    // Add browser and platform classes
    $vars['classes_array'][] = css_browser_selector();
    // Add theme settings classes
    $settings_array = array('body_background', 'header_layout', 'menu_bullets', 'main_menu_alignment', 'corner_radius_form_input_text', 'corner_radius_form_input_submit');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = at_get_setting($setting);
    }
    // Special case for PIE htc rounded corners, not all themes include this
    if (at_get_setting('ie_corners') == 1) {
        drupal_add_css($path_to_theme . '/css/ie-htc.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
    }
    // Custom settings for AT Commerce
    // Content displays
    $show_frontpage_grid = at_get_setting('content_display_grids_frontpage') == 1 ? TRUE : FALSE;
    $show_taxopage_grid = at_get_setting('content_display_grids_taxonomy_pages') == 1 ? TRUE : FALSE;
    if ($show_frontpage_grid == TRUE || $show_taxopage_grid == TRUE) {
        drupal_add_js($path_to_theme . '/scripts/equalheights.js');
    }
    if ($show_frontpage_grid == TRUE) {
        $cols_fpg = at_get_setting('content_display_grids_frontpage_colcount');
        $vars['classes_array'][] = $cols_fpg;
        drupal_add_js($path_to_theme . '/scripts/eq.fp.grid.js');
    }
    if ($show_taxopage_grid == TRUE) {
        $cols_tpg = at_get_setting('content_display_grids_taxonomy_pages_colcount');
        $vars['classes_array'][] = $cols_tpg;
        drupal_add_js($path_to_theme . '/scripts/eq.tp.grid.js');
    }
    // Do stuff for the slideshow
    if (at_get_setting('show_slideshow') == 1) {
        // Add some js and css
        drupal_add_css($path_to_theme . '/css/styles.slideshow.css', array('preprocess' => TRUE, 'group' => CSS_THEME, 'media' => 'screen', 'every_page' => TRUE));
        drupal_add_js($path_to_theme . '/scripts/jquery.flexslider-min.js');
        drupal_add_js($path_to_theme . '/scripts/slider.options.js');
        // Add some classes to do evil hiding of elements with CSS...
        if (at_get_setting('show_slideshow_navigation_controls') == 0) {
            $vars['classes_array'][] = 'hide-ss-nav';
        }
        if (at_get_setting('show_slideshow_direction_controls') == 0) {
            $vars['classes_array'][] = 'hide-ss-dir';
        }
        // Write some evil inline CSS in the head, oh er..
        $slideshow_width = check_plain(at_get_setting('slideshow_width'));
        $slideshow_css = '.flexible-slideshow,.flexible-slideshow .article-inner,.flexible-slideshow .article-content,.flexslider {max-width: ' . $slideshow_width . 'px;}';
        drupal_add_css($slideshow_css, array('group' => CSS_DEFAULT, 'type' => 'inline'));
    }
    // Draw stuff
    drupal_add_js($path_to_theme . '/scripts/draw.js');
}
Пример #8
0
/**
 * Override or insert variables into the html template.
 */
function at_commerce_preprocess_html(&$vars)
{
    global $theme_key;
    $theme_name = 'at_commerce';
    $path_to_theme = drupal_get_path('theme', $theme_name);
    // Load the media queries styles
    $media_queries_css = array($theme_name . '.responsive.style.css', $theme_name . '.responsive.gpanels.css');
    load_subtheme_media_queries($media_queries_css, $theme_name);
    // Load IE specific stylesheets
    $ie_files = array('IE 6' => 'ie-6.css', 'lte IE 7' => 'ie-lte-7.css', 'IE 8' => 'ie-8.css', 'lte IE 9' => 'ie-lte-9.css');
    load_subtheme_ie_styles($ie_files, $theme_name);
    // Add a class for the active color scheme
    if (module_exists('color')) {
        $class = check_plain(get_color_scheme_name($theme_key));
        $vars['classes_array'][] = 'color-scheme-' . drupal_html_class($class);
    }
    // Add class for the active theme
    $vars['classes_array'][] = drupal_html_class($theme_key);
    // Add browser and platform classes
    $vars['classes_array'][] = css_browser_selector();
    // Add theme settings classes
    $settings_array = array('font_size', 'body_background', 'header_layout', 'menu_bullets', 'main_menu_alignment', 'image_alignment', 'site_name_case', 'site_name_weight', 'site_name_alignment', 'site_name_shadow', 'site_slogan_case', 'site_slogan_weight', 'site_slogan_alignment', 'site_slogan_shadow', 'page_title_case', 'page_title_weight', 'page_title_alignment', 'page_title_shadow', 'node_title_case', 'node_title_weight', 'node_title_alignment', 'node_title_shadow', 'comment_title_case', 'comment_title_weight', 'comment_title_alignment', 'comment_title_shadow', 'block_title_case', 'block_title_weight', 'block_title_alignment', 'block_title_shadow', 'corner_radius_form_input_text', 'corner_radius_form_input_submit');
    foreach ($settings_array as $setting) {
        $vars['classes_array'][] = theme_get_setting($setting);
    }
    // Font family settings
    $fonts = array('bf' => 'base_font', 'snf' => 'site_name_font', 'ssf' => 'site_slogan_font', 'mmf' => 'main_menu_font', 'ptf' => 'page_title_font', 'ntf' => 'node_title_font', 'ctf' => 'comment_title_font', 'btf' => 'block_title_font');
    $families = get_font_families($fonts, $theme_key);
    if (!empty($families)) {
        foreach ($families as $family) {
            $vars['classes_array'][] = $family;
        }
    }
    // Add Noggin module settings extra classes, not all designs can support header images
    if (module_exists('noggin')) {
        if (variable_get('noggin:use_header', FALSE)) {
            $va = theme_get_setting('noggin_image_vertical_alignment');
            $ha = theme_get_setting('noggin_image_horizontal_alignment');
            $vars['classes_array'][] = 'ni-a-' . $va . $ha;
            $vars['classes_array'][] = theme_get_setting('noggin_image_repeat');
            $vars['classes_array'][] = theme_get_setting('noggin_image_width');
        }
    }
    // Special case for PIE htc rounded corners, not all themes include this
    if (theme_get_setting('ie_corners') == 1) {
        drupal_add_css($path_to_theme . '/css/ie-htc.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
    }
    // Custom settings for AT Commerce
    // Content displays
    $show_frontpage_grid = theme_get_setting('content_display_grids_frontpage') == 1 ? TRUE : FALSE;
    $show_taxopage_grid = theme_get_setting('content_display_grids_taxonomy_pages') == 1 ? TRUE : FALSE;
    if ($show_frontpage_grid == TRUE || $show_taxopage_grid == TRUE) {
        drupal_add_js($path_to_theme . '/js/equalheights.js');
    }
    if ($show_frontpage_grid == TRUE) {
        $cols_fpg = theme_get_setting('content_display_grids_frontpage_colcount');
        $vars['classes_array'][] = $cols_fpg;
        drupal_add_js($path_to_theme . '/js/eq.fp.grid.js');
    }
    if ($show_taxopage_grid == TRUE) {
        $cols_tpg = theme_get_setting('content_display_grids_taxonomy_pages_colcount');
        $vars['classes_array'][] = $cols_tpg;
        drupal_add_js($path_to_theme . '/js/eq.tp.grid.js');
    }
    // Do stuff for the slideshow
    if (theme_get_setting('show_slideshow') == 1) {
        // Add some js and css
        drupal_add_css($path_to_theme . '/css/styles.slideshow.css', array('preprocess' => TRUE, 'group' => CSS_THEME, 'media' => 'screen', 'every_page' => TRUE));
        drupal_add_js($path_to_theme . '/js/jquery.flexslider-min.js');
        drupal_add_js($path_to_theme . '/js/slider.options.js');
        // Add some classes to do evil hiding of elements with CSS...
        if (theme_get_setting('show_slideshow_navigation_controls') == 0) {
            $vars['classes_array'][] = 'hide-ss-nav';
        }
        if (theme_get_setting('show_slideshow_direction_controls') == 0) {
            $vars['classes_array'][] = 'hide-ss-dir';
        }
        // Write some evil inline CSS in the head, oh er..
        $slideshow_width = check_plain(theme_get_setting('slideshow_width'));
        $slideshow_css = '.flexible-slideshow,.flexible-slideshow .article-inner,.flexible-slideshow .article-content,.flexslider {max-width: ' . $slideshow_width . 'px;}';
        drupal_add_css($slideshow_css, array('group' => CSS_DEFAULT, 'type' => 'inline'));
    }
    // Draw stuff
    drupal_add_js($path_to_theme . '/js/draw.js');
}