当前位置: 首页>>代码示例>>PHP>>正文


PHP drupal_add_html_head函数代码示例

本文整理汇总了PHP中drupal_add_html_head函数的典型用法代码示例。如果您正苦于以下问题:PHP drupal_add_html_head函数的具体用法?PHP drupal_add_html_head怎么用?PHP drupal_add_html_head使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drupal_add_html_head函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: treetopstravel_preprocess_html

/**
 * Implements hook_preprocess_html().
 * Meta tags https://drupal.org/node/1468582#comment-5698732
 */
function treetopstravel_preprocess_html(&$variables)
{
    $meta_charset = array('#tag' => 'meta', '#attributes' => array('charset' => 'utf-8'));
    drupal_add_html_head($meta_charset, 'meta_charset');
    $meta_x_ua_compatible = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'x-ua-compatible', 'content' => 'ie=edge, chrome=1'));
    drupal_add_html_head($meta_x_ua_compatible, 'meta_x_ua_compatible');
    $meta_mobile_optimized = array('#tag' => 'meta', '#attributes' => array('name' => 'MobileOptimized', 'content' => 'width'));
    drupal_add_html_head($meta_mobile_optimized, 'meta_mobile_optimized');
    $meta_handheld_friendly = array('#tag' => 'meta', '#attributes' => array('name' => 'HandheldFriendly', 'content' => 'true'));
    drupal_add_html_head($meta_handheld_friendly, 'meta_handheld_friendly');
    $meta_viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1'));
    drupal_add_html_head($meta_viewport, 'meta_viewport');
    $meta_cleartype = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'cleartype', 'content' => 'on'));
    drupal_add_html_head($meta_cleartype, 'meta_cleartype');
    // Use html5shiv.
    if (theme_get_setting('html5shim')) {
        $element = array('element' => array('#tag' => 'script', '#value' => '', '#attributes' => array('type' => 'text/javascript', 'src' => file_create_url(drupal_get_path('theme', 'treetopstravel') . '/js/html5shiv-printshiv.js'))));
        $html5shim = array('#type' => 'markup', '#markup' => "<!--[if lt IE 9]>\n" . theme('html_tag', $element) . "<![endif]-->\n");
        drupal_add_html_head($html5shim, 'treetopstravel_html5shim');
    }
    // Use Respond.js.
    if (theme_get_setting('respond_js')) {
        drupal_add_js(drupal_get_path('theme', 'treetopstravel') . '/js/respond.min.js', array('group' => JS_LIBRARY, 'weight' => -100));
    }
    // Use normalize.css
    if (theme_get_setting('normalize_css')) {
        drupal_add_css(drupal_get_path('theme', 'treetopstravel') . '/css/normalize.css', array('group' => CSS_SYSTEM, 'weight' => -100));
    }
    if (arg(0) == 'taxonomy' && arg(1) == 'term') {
        $term = taxonomy_term_load(arg(2));
        $variables['classes_array'][] = 'vocabulary-' . strtolower($term->vocabulary_machine_name);
    }
    flexslider_add();
}
开发者ID:juanmnl07,项目名称:treetopstravel_test,代码行数:38,代码来源:template.php

示例2: cstark_preprocess_node

function cstark_preprocess_node(&$variables)
{
    if (user_access('administer nodes')) {
        $variables['edit_link'] = l(t('Edit'), 'node/' . $variables['nid'] . '/edit');
        if ($variables['type'] == 'painting') {
            $title = $variables['promote'] ? t('Remove from front page') : t('Add to front page');
            $variables['set_as_main_link'] = l($title, 'set-as-main/' . $variables['nid']);
            // Facebook share.
            $url = url('node/' . $variables['nid'], array('absolute' => TRUE));
            $variables['share_link'] = l(t('Share'), "http://www.facebook.com/sharer.php?u={$url}", array('attributes' => array('class' => array('facebook'))));
        }
    }
    if ($variables['type'] == 'painting') {
        $wrapper = entity_metadata_wrapper('node', $variables['nid']);
        if ($image = $wrapper->field_image->value()) {
            $element = array('#tag' => 'meta', '#attributes' => array('property' => 'og:image', 'content' => file_create_url($image['uri'])));
            drupal_add_html_head($element, 'cstark_painting_image');
            $element = array('#tag' => 'meta', '#attributes' => array('property' => 'og:title', 'content' => $wrapper->label()));
            drupal_add_html_head($element, 'cstark_painting_title');
        }
    }
    if ($variables['type'] == 'painting' && !drupal_is_front_page()) {
        $variables['pager'] = shapira_get_painting_pager($variables['nid']);
    }
    if ($variables['type'] != 'news') {
        $variables['hide_title'] = true;
    }
    if ($variables['type'] == 'painting') {
        if ($variables['field_image']) {
            $info = image_get_info(image_style_path('painting', $variables['field_image'][0]['uri']));
            $variables['node_width'] = $info['width'];
        }
    }
}
开发者ID:bitamar,项目名称:rashapira,代码行数:34,代码来源:template.php

示例3: radix_preprocess_html

/**
 * Implementation of template_preprocess_html().
 */
function radix_preprocess_html(&$variables)
{
    // Add meta for Bootstrap Responsive.
    // <meta name="viewport" content="width=device-width, initial-scale=1.0">
    $element = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'));
    drupal_add_html_head($element, 'bootstrap_responsive');
}
开发者ID:TechEnterprises,项目名称:Open_Atrium_2.0,代码行数:10,代码来源:template.php

示例4: webskillet_preprocess_html

/**
 * Implements hook_preprocess_html().
 * Adding extra meta tags to the head for iPhone, Google domain verification
 */
function webskillet_preprocess_html(&$variables)
{
    $meta_xuacompatible = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge,chrome=1'));
    drupal_add_html_head($meta_xuacompatible, 'meta_xuacompatible');
    $meta_viewport = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, maximum-scale=1.0'));
    drupal_add_html_head($meta_viewport, 'meta_viewport');
    $mobileStyle = theme_get_setting('webskillet_navigation_style');
    $variables['classes_array'][] = 'mobile-style-' . $mobileStyle;
    $dismissStyle = theme_get_setting('webskillet_dismiss_style');
    $variables['classes_array'][] = 'dismiss-style-' . $dismissStyle;
    $settings = array('pathToTheme' => drupal_get_path('theme', variable_get('theme_default', NULL)), 'themeOptions' => array('validateForms' => theme_get_setting('webskillet_js_validate_forms'), 'fixFooter' => theme_get_setting('webskillet_js_fix_footer'), 'shortenLinks' => theme_get_setting('webskillet_js_shorten_links'), 'externalLinks' => theme_get_setting('webskillet_external_links'), 'externalLinksExceptions' => theme_get_setting('webskillet_external_links_exceptions'), 'sectionNavigationSelector' => theme_get_setting('webskillet_section_navigation_selector'), 'sectionNavigationPadding' => theme_get_setting('webskillet_section_navigation_padding')));
    drupal_add_js('jQuery.extend(Drupal.settings, ' . json_encode((object) $settings) . ');', 'inline');
    $q = isset($_GET['q']) ? $_GET['q'] : 'front';
    $page_id = str_replace('/', '-', $q);
    $page_id = strtolower($page_id);
    $page_id = preg_replace('/[^-_a-z0-9]/', '', $page_id);
    $variables['page_id'] = 'page-' . $page_id;
    $googlefonts = theme_get_setting('webskillet_google_webfonts');
    if ($googlefonts) {
        drupal_add_css('https://fonts.googleapis.com/css?family=' . $googlefonts, array('type' => 'external', 'group' => CSS_SYSTEM, 'every_page' => TRUE, 'weight' => -100));
    }
    // load fontawesome
    drupal_add_css('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array('type' => 'external', 'group' => CSS_SYSTEM, 'every_page' => TRUE, 'weight' => -99));
    if ($google_site_verification = theme_get_setting('webskillet_google_site_verification')) {
        $meta_google_site_verification = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'google-site-verification', 'content' => $google_site_verification));
        drupal_add_html_head($meta_google_site_verification, 'meta_google_site_verification');
    }
}
开发者ID:Webskillet,项目名称:webskillet,代码行数:32,代码来源:template.php

示例5: cu_omega_preprocess_html

/**
 * Implements hook_preprocess_html().
 */
function cu_omega_preprocess_html(&$vars)
{
    // Remove page-node- body class
    foreach ($vars['attributes_array']['class'] as $key => $value) {
        if ($value == 'page-node-') {
            unset($vars['attributes_array']['class'][$key]);
        }
    }
    $vars['head_title_array']['slogan'] = 'University of Colorado Boulder';
    $vars['head_title'] = implode(' | ', $vars['head_title_array']);
    //$vars['attributes_array']['class'][]='banner-white';
    $headings = theme_get_setting('headings') ? theme_get_setting('headings') : 'headings-bold';
    $vars['attributes_array']['class'][] = $headings;
    $page_title_image_background = theme_get_setting('page_title_image_background') ? theme_get_setting('page_title_image_background') : 'page-title-image-background-white';
    $vars['attributes_array']['class'][] = $page_title_image_background;
    $icon_color = theme_get_setting('block_icons_color') ? theme_get_setting('block_icons_color') : 'block-icons-inherit';
    $vars['attributes_array']['class'][] = $icon_color;
    drupal_add_js(drupal_get_path('theme', 'cu_omega') . '/js/mobile-menu-toggle.js');
    drupal_add_js(drupal_get_path('theme', 'cu_omega') . '/js/track-focus.js', array('scope' => 'footer'));
    $element = array('#tag' => 'link', '#attributes' => array('href' => '//fast.fonts.net/cssapi/86696b99-fb1a-4964-9676-9233fb4fca8f.css', 'rel' => 'stylesheet', 'type' => 'text/css'));
    if (variable_get('use_fonts', TRUE)) {
        drupal_add_html_head($element, 'web_fonts');
    }
    // Turn off IE Compatibility Mode
    $element = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'X-UA-Compatible', 'content' => 'IE=edge'));
    drupal_add_html_head($element, 'ie_compatibility_mode');
    // Check to see if site is responsive or not...
    $responsive = theme_get_setting('alpha_responsive') ? 'is-responsive' : 'is-not-responsive';
    $vars['attributes_array']['class'][] = $responsive;
}
开发者ID:CuBoulder,项目名称:cu-express-drops-7,代码行数:33,代码来源:template.php

示例6: cetaviano_preprocess_html

/**
 * Implements hook_preprocess_html().
 * Meta tags https://drupal.org/node/1468582#comment-5698732
 */
function cetaviano_preprocess_html(&$variables)
{
    $meta_charset = array('#tag' => 'meta', '#attributes' => array('charset' => 'utf-8'));
    drupal_add_html_head($meta_charset, 'meta_charset');
    $meta_x_ua_compatible = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'x-ua-compatible', 'content' => 'ie=edge, chrome=1'));
    drupal_add_html_head($meta_x_ua_compatible, 'meta_x_ua_compatible');
    $meta_mobile_optimized = array('#tag' => 'meta', '#attributes' => array('name' => 'MobileOptimized', 'content' => 'width'));
    drupal_add_html_head($meta_mobile_optimized, 'meta_mobile_optimized');
    $meta_handheld_friendly = array('#tag' => 'meta', '#attributes' => array('name' => 'HandheldFriendly', 'content' => 'true'));
    drupal_add_html_head($meta_handheld_friendly, 'meta_handheld_friendly');
    $meta_viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1'));
    drupal_add_html_head($meta_viewport, 'meta_viewport');
    $meta_cleartype = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'cleartype', 'content' => 'on'));
    drupal_add_html_head($meta_cleartype, 'meta_cleartype');
    // TODO: Include this using Yeoman generator settings
    // Use html5shiv.
    $element = array('element' => array('#tag' => 'script', '#value' => '', '#attributes' => array('type' => 'text/javascript', 'src' => 'https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js')));
    $html5shiv = array('#type' => 'markup', '#markup' => "<!--[if lt IE 9]>\n" . theme('html_tag', $element) . "<![endif]-->\n");
    drupal_add_html_head($html5shiv, 'cetaviano_theme_html5shiv');
    // ENDTODO
    // TODO: Include this using Yeoman generator settings
    // Use Respond.js.
    $element = array('element' => array('#tag' => 'script', '#value' => '', '#attributes' => array('type' => 'text/javascript', 'src' => 'https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js')));
    $respondjs = array('#type' => 'markup', '#markup' => "<!--[if lt IE 9]>\n" . theme('html_tag', $element) . "<![endif]-->\n");
    drupal_add_html_head($respondjs, 'cetaviano_theme_respondjs');
    // ENDTODO
    // TODO: Include this using Yeoman generator settings
    // Use normalize.css
    drupal_add_css('https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css', array('type' => 'external', 'group' => CSS_SYSTEM, 'weight' => -1000));
    // ENDTODO
}
开发者ID:KimQuiros,项目名称:cetav-2015,代码行数:35,代码来源:template.php

示例7: chctheme_2013_preprocess_html

/**
 * @file
 * Contains theme override functions and preprocess functions for the theme.
 *
 * ABOUT THE TEMPLATE.PHP FILE
 *
 *   The template.php file is one of the most useful files when creating or
 *   modifying Drupal themes. You can modify or override Drupal's theme
 *   functions, intercept or make additional variables available to your theme,
 *   and create custom PHP logic. For more information, please visit the Theme
 *   Developer's Guide on Drupal.org: http://drupal.org/theme-guide
 *
 * OVERRIDING THEME FUNCTIONS
 *
 *   The Drupal theme system uses special theme functions to generate HTML
 *   output automatically. Often we wish to customize this HTML output. To do
 *   this, we have to override the theme function. You have to first find the
 *   theme function that generates the output, and then "catch" it and modify it
 *   here. The easiest way to do it is to copy the original function in its
 *   entirety and paste it here, changing the prefix from theme_ to STARTERKIT_.
 *   For example:
 *
 *     original: theme_breadcrumb()
 *     theme override: STARTERKIT_breadcrumb()
 *
 *   where STARTERKIT is the name of your sub-theme. For example, the
 *   zen_classic theme would define a zen_classic_breadcrumb() function.
 *
 *   If you would like to override either of the two theme functions used in Zen
 *   core, you should first look at how Zen core implements those functions:
 *     theme_breadcrumbs()      in zen/template.php
 *     theme_menu_local_tasks() in zen/template.php
 *
 *   For more information, please visit the Theme Developer's Guide on
 *   Drupal.org: http://drupal.org/node/173880
 *
 * CREATE OR MODIFY VARIABLES FOR YOUR THEME
 *
 *   Each tpl.php template file has several variables which hold various pieces
 *   of content. You can modify those variables (or add new ones) before they
 *   are used in the template files by using preprocess functions.
 *
 *   This makes THEME_preprocess_HOOK() functions the most powerful functions
 *   available to themers.
 *
 *   It works by having one preprocess function for each template file or its
 *   derivatives (called template suggestions). For example:
 *     THEME_preprocess_page    alters the variables for page.tpl.php
 *     THEME_preprocess_node    alters the variables for node.tpl.php or
 *                              for node-forum.tpl.php
 *     THEME_preprocess_comment alters the variables for comment.tpl.php
 *     THEME_preprocess_block   alters the variables for block.tpl.php
 *
 *   For more information on preprocess functions and template suggestions,
 *   please visit the Theme Developer's Guide on Drupal.org:
 *   http://drupal.org/node/223440
 *   and http://drupal.org/node/190815#template-suggestions
 */
function chctheme_2013_preprocess_html(&$variables)
{
    drupal_add_css('https://www.lehigh.edu/~inis/includes/SiteStyleFooter.css', array('type' => 'external'));
    drupal_add_css('https://cf.lehigh.edu/webdev/projects/wms/footer-official.css', array('type' => 'external'));
    $viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, user-scalable=yes'));
    drupal_add_html_head($viewport, 'viewport');
}
开发者ID:remlingj,项目名称:Test1,代码行数:65,代码来源:template.php

示例8: psf_atc_preprocess_html

/**
 * Preprocess variables for the html template.
 */
function psf_atc_preprocess_html(&$variables)
{
    // Disable compatibility mode.  Not sure if this is the best place for this
    // line, but it works.
    header("X-UA-Compatible: IE=Edge");
    // Add Cycle2 plugin to front page.
    if ($variables['is_front']) {
        drupal_add_js(libraries_get_path('jquery.cycle2') . '/jquery.cycle2.js', 'file');
        drupal_add_js(libraries_get_path('jquery.cycle2.carousel') . '/jquery.cycle2.carousel.js', 'file');
    }
    // Auto-discover RSS feed.
    $element = array('#tag' => 'link', '#attributes' => array('href' => '/rss.xml', 'rel' => 'alternate', 'type' => 'application/rss+xml'));
    drupal_add_html_head($element, 'psf_atc');
    // Fix zooming of colorbox for mobile.
    drupal_add_js('
    (function ($) {
      Drupal.behaviors.psfColorbox = {
        attach: function (context, settings) {
          if (!Modernizr.touch && typeof(Drupal.settings.colorbox) != "undefined") {
            Drupal.settings.colorbox.fixed = true;
          }
        }
      };
    })(jQuery);
  ', array('type' => 'inline', 'group' => JS_LIBRARY));
}
开发者ID:jacobembree,项目名称:psf-atc,代码行数:29,代码来源:template.php

示例9: radix_preprocess_html

/**
 * Implements template_preprocess_html().
 */
function radix_preprocess_html(&$variables)
{
    global $base_url;
    // Add Bootstrap JS from CDN if bootstrap library is not installed.
    if (!module_exists('bootstrap_library')) {
        $base = parse_url($base_url);
        $url = $base['scheme'] . '://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js';
        drupal_add_js($url, 'external');
    }
    // Add support for the Modenizr module.
    // Load modernizr.js only if modernizr module is not present.
    if (!module_exists('modernizr')) {
        drupal_add_js(drupal_get_path('theme', 'radix') . '/assets/javascripts/modernizr.js');
    }
    // Add meta for Bootstrap Responsive.
    // <meta name="viewport" content="width=device-width, initial-scale=1.0">
    $element = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'));
    drupal_add_html_head($element, 'bootstrap_responsive');
    // Add some custom classes for panels pages.
    if (module_exists('page_manager') && count(page_manager_get_current_page())) {
        $variables['is_panel'] = TRUE;
        // Get the current panel display and add some classes to body.
        if ($display = panels_get_current_page_display()) {
            $variables['classes_array'][] = 'panel-layout-' . $display->layout;
            // Add a custom class for each region that has content.
            $regions = array_keys($display->panels);
            foreach ($regions as $region) {
                $variables['classes_array'][] = 'panel-region-' . $region;
            }
        }
    }
}
开发者ID:rhabbachi,项目名称:data_starter,代码行数:35,代码来源:template.php

示例10: importacionesgm_preprocess_html

/**
 * Implements hook_preprocess_html().
 * Meta tags https://drupal.org/node/1468582#comment-5698732
 */
function importacionesgm_preprocess_html(&$variables)
{
    $meta_charset = array('#tag' => 'meta', '#attributes' => array('charset' => 'utf-8'));
    drupal_add_html_head($meta_charset, 'meta_charset');
    $meta_x_ua_compatible = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'x-ua-compatible', 'content' => 'ie=edge, chrome=1'));
    drupal_add_html_head($meta_x_ua_compatible, 'meta_x_ua_compatible');
    $meta_mobile_optimized = array('#tag' => 'meta', '#attributes' => array('name' => 'MobileOptimized', 'content' => 'width'));
    drupal_add_html_head($meta_mobile_optimized, 'meta_mobile_optimized');
    $meta_handheld_friendly = array('#tag' => 'meta', '#attributes' => array('name' => 'HandheldFriendly', 'content' => 'true'));
    drupal_add_html_head($meta_handheld_friendly, 'meta_handheld_friendly');
    $meta_viewport = array('#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1'));
    drupal_add_html_head($meta_viewport, 'meta_viewport');
    $meta_cleartype = array('#tag' => 'meta', '#attributes' => array('http-equiv' => 'cleartype', 'content' => 'on'));
    drupal_add_html_head($meta_cleartype, 'meta_cleartype');
    // Use html5shiv.
    if (theme_get_setting('html5shim')) {
        $element = array('element' => array('#tag' => 'script', '#value' => '', '#attributes' => array('type' => 'text/javascript', 'src' => file_create_url(drupal_get_path('theme', 'importacionesgm') . '/js/html5shiv-printshiv.js'))));
        $html5shim = array('#type' => 'markup', '#markup' => "<!--[if lt IE 9]>\n" . theme('html_tag', $element) . "<![endif]-->\n");
        drupal_add_html_head($html5shim, 'sonambulo_html5shim');
    }
    // Use Respond.js.
    if (theme_get_setting('respond_js')) {
        drupal_add_js(drupal_get_path('theme', 'importacionesgm') . '/js/respond.min.js', array('group' => JS_LIBRARY, 'weight' => -100));
    }
    // Use normalize.css
    if (theme_get_setting('normalize_css')) {
        drupal_add_css(drupal_get_path('theme', 'importacionesgm') . '/css/normalize.css', array('group' => CSS_SYSTEM, 'weight' => -100));
    }
}
开发者ID:keylorm,项目名称:importacionesgm,代码行数:33,代码来源:template.php

示例11: webspark_seven_preprocess_html

/**
 * Didn't work with preprocess_html, so doing page
 */
function webspark_seven_preprocess_html(&$variables)
{
    // WEBSPARK-667 - Add meta tag to identify Innovation as a "Webspark" theme
    // in the DOM
    $meta_webspark_id = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('content' => 'Webspark', 'http-equiv' => 'X-Name-of-Distro'));
    drupal_add_html_head($meta_webspark_id, 'meta_webspark_id');
}
开发者ID:sourfacedcyclop,项目名称:webspark-drops-drupal7,代码行数:10,代码来源:template.php

示例12: favrskovtheme_preprocess_html

/**
 * Preprocess html.tpl.php
 */
function favrskovtheme_preprocess_html(&$vars)
{
    drupal_add_library('system', 'ui.widget');
    drupal_add_js(libraries_get_path('swiper') . '/idangerous.swiper.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));
    drupal_add_css('https://fast.fonts.net/cssapi/cb2b1123-533e-44b1-af78-e3702f6bd579.css', array('type' => 'external', 'group' => 'CSS_THEME', 'every_page' => TRUE, 'media' => 'projection, screen'));
    $jwplayer = drupal_get_js('jwplayer');
    $vars['jwplayer'] = $jwplayer;
    // Added meta tag for IE.
    $meta_ie_render_engine = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('content' => 'IE=10', 'http-equiv' => 'X-UA-Compatible'));
    // Add header meta tag for IE to head
    drupal_add_html_head($meta_ie_render_engine, 'meta_ie_render_engine');
    $multisite_links = theme_get_setting('favrskovtheme_multisite_links');
    if (!empty($multisite_links)) {
        $vars['classes_array'][] = theme_get_setting('favrskovtheme_multisite_links');
    }
    $header_links = theme_get_setting('favrskovtheme_header_links');
    if (!empty($header_links)) {
        $vars['classes_array'][] = $header_links;
    }
    if (!empty($vars['background'])) {
        $vars['classes_array'][] = 'dynamic-background';
    }
    // jQuery custom content scroller
    drupal_add_js(libraries_get_path('malihu') . '/js/minified/jquery.mCustomScrollbar.min.js', array('scope' => 'header', 'group' => JS_LIBRARY, 'every_page' => TRUE));
    drupal_add_css(libraries_get_path('malihu') . '/jquery.mCustomScrollbar.min.css', array('scope' => 'header', 'group' => CSS_THEME, 'every_page' => TRUE));
}
开发者ID:GitError404,项目名称:favrskov.dk,代码行数:29,代码来源:template.php

示例13: gavias_laikafood_preprocess_html

/**
 * Override or insert variables into the html template.
 * @param $vars
 *   An array of variables to pass to the theme template.
 */
function gavias_laikafood_preprocess_html(&$vars)
{
    global $theme, $base_url;
    global $parent_root;
    $skin = theme_get_setting('theme_skin');
    drupal_add_css(drupal_get_path('theme', 'gavias_laikafood') . '/css/' . ($skin ? 'skins/' . $skin . '/' : '') . 'template.css', array('group' => CSS_DEFAULT, 'type' => 'file'));
    drupal_add_css(drupal_get_path('theme', 'gavias_laikafood') . '/css/' . ($skin ? 'skins/' . $skin . '/' : '') . 'bootstrap.css', array('group' => CSS_DEFAULT, 'type' => 'file'));
    if (module_exists('gavias_themer') && theme_get_setting('frontend_panel') == '1' && user_access('gavias_customize_preview')) {
        gavias_load_fontend();
    }
    if (theme_get_setting('enable_custom_style') == 1 && trim(variable_get('gavias_profile'))) {
        drupal_add_css(drupal_get_path('theme', 'gavias_laikafood') . '/customize/save/' . variable_get('gavias_profile') . '.css', array('group' => CSS_DEFAULT, 'type' => 'file'));
    }
    $viewport = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1, maximum-scale=1'), '#weight' => 1);
    drupal_add_html_head($viewport, 'viewport');
    // Add boxed class if layout is set that way.
    if (theme_get_setting('site_layout') == 'boxed') {
        $vars['classes_array'][] = 'boxed';
    }
    if (theme_get_setting('preloader') == '1') {
        $vars['classes_array'][] = 'js-preloader';
    } else {
        $vars['classes_array'][] = 'not-preloader';
    }
}
开发者ID:ucaka,项目名称:forestway,代码行数:30,代码来源:template.php

示例14: basetpl_process_page

/**
 * Implements theme_process_page().
 */
function basetpl_process_page(&$variables)
{
    global $base_path;
    // show/hide breadcrumb
    $variables['show_breadcrumb'] = TRUE;
    // var theme_path
    $variables['theme_path'] = $base_path . path_to_theme();
    // var site_info
    $variables['site_info'] = $variables['logo'] || $variables['site_name'] || $variables['site_slogan'] ? TRUE : FALSE;
    // check if page is system page
    $variables['system_page'] = isset($variables['node']) ? FALSE : TRUE;
    // backend
    if (user_is_logged_in() && path_is_admin(current_path())) {
        $variables['site_info'] = FALSE;
        $variables['system_page'] = TRUE;
        foreach (element_children($variables['page']) as $region) {
            if ($region != 'content') {
                $variables['page'][$region] = FALSE;
            }
        }
    }
    // show/hide page title
    $variables['title'] = $variables['system_page'] ? $variables['title'] : FALSE;
    // add robots to head
    if (theme_get_setting('robots') == 1) {
        $robots = array('#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array('name' => 'robots', 'content' => 'noindex,nofollow'));
        drupal_add_html_head($robots, 'robots');
    }
}
开发者ID:bert-bruggeman,项目名称:e2e_themes,代码行数:32,代码来源:page.inc.php

示例15: cignaglobal_preprocess_page

/**
 * Implements hook_preprocess_page().
 */
function cignaglobal_preprocess_page(&$vars)
{
    if (isset($vars['node']->type)) {
        // Add hook suggestion based on node type.
        $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']->type;
        // All broker urls begin with /brokers so use this fact to ensure pages
        // in this section use the page--brokers.tpl.php template.
        $is_broker_page = is_broker_page();
        if ($is_broker_page) {
            $vars['theme_hook_suggestions'][] = 'page__brokers';
            $vars['cigna_brokers_americas_tel_no'] = variable_get('cigna_brokers_americas_tel_no');
            $vars['cigna_brokers_europe_tel_no'] = variable_get('cigna_brokers_europe_tel_no');
            $vars['cigna_brokers_asia_pacific_tel_no'] = variable_get('cigna_brokers_asia_pacific_tel_no');
            $vars['cigna_broker_sales_email'] = variable_get('cigna_broker_sales_email');
            $vars['cigna_broker_service_email'] = variable_get('cigna_broker_service_email');
        }
    }
    // Add robots nofollow metatag for landing pages.
    $landing_page_urls = function_exists('cigna_lp_menu_keys') ? cigna_lp_menu_keys() : array();
    if (in_array(current_path(), $landing_page_urls)) {
        $data = array('#tag' => 'meta', '#attributes' => array('name' => 'robots', 'content' => 'noindex, nofollow'));
        drupal_add_html_head($data, 'cignaglobal_landing_page_no_follow');
    }
    // Site-wide variables.
    $vars['cigna_worldwide_tel_no'] = variable_get('cigna_worldwide_tel_no', '+44(0)1475 777625');
    $vars['cigna_usa_tel_no'] = variable_get('cigna_usa_tel_no', '877.539.6295');
}
开发者ID:kymunr,项目名称:DrupalProject,代码行数:30,代码来源:system.php


注:本文中的drupal_add_html_head函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。