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


PHP page_manager_get_current_page函数代码示例

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


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

示例1: rogue_preprocess

/**
* Implements hook_preprocess().
*/
function rogue_preprocess(&$variables)
{
    // All panel templates will have access to the "is_panel_page" variable.
    if (isset($variables['layout']['plugin module']) && $variables['layout']['plugin module'] == 'panels') {
        $variables['is_panel_page'] = module_exists('page_manager') && page_manager_get_current_page();
    }
}
开发者ID:cpa-gardens,项目名称:rogue-theme,代码行数:10,代码来源:template.php

示例2: proud_base_preprocess_page

/**
 *
 * Implements template_prerocess_page().
 */
function proud_base_preprocess_page(&$vars)
{
    // If panels arent being used at all.
    $vars['no_panels'] = !(module_exists('page_manager') && page_manager_get_current_page());
    $vars['copyright'] = '';
    // Add select2
    if (module_exists('libraries')) {
        $path = libraries_get_path('select2');
        drupal_add_js($path . '/select2.min.js');
        drupal_add_css($path . '/select2.css');
    }
}
开发者ID:proudcity,项目名称:proudtheme,代码行数:16,代码来源:template.php

示例3: mission_respondable_preprocess_page

/**
 * Override or insert variables into the page templates.
 *
 * @param $variables
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("page" in this case.)
 */
function mission_respondable_preprocess_page(&$variables, $hook)
{
    // if this is a panel page, add template suggestions
    if ($panel_page = page_manager_get_current_page()) {
        // add a generic suggestion for all panel pages
        $variables['theme_hook_suggestions'][] = 'page__panel';
        // add the panel page machine name to the template suggestions
        $variables['theme_hook_suggestions'][] = 'page__' . $panel_page['name'];
        //add a body class for good measure
        $body_classes[] = 'page-panel';
    }
}
开发者ID:usaodrovers,项目名称:mission_respondable,代码行数:20,代码来源:template.php

示例4: bootstrap_subtheme_preprocess_html

/**
 * Preprocess HTML.
 */
function bootstrap_subtheme_preprocess_html(&$variables)
{
    if (in_array('node-type-voice', $variables['classes_array'])) {
        $variables['classes_array'][] = 'individual-voice';
    }
    if ($page_panel = page_manager_get_current_page()) {
        // Make sure CSS_ID defined in panels is attached  to the page.
        if (!empty($page_panel['handler']->conf['css_id'])) {
            $css_id_array = array('id' => $page_panel['handler']->conf['css_id']);
            $variables['attributes_array'] = empty($variables['attributes_array']) ? $css_id_array : ($variables['attributes_array'] += $css_id_array);
        }
    }
}
开发者ID:Gizra,项目名称:planet-elm,代码行数:16,代码来源:template.php

示例5: radix_preprocess_page

/**
 * Implements template_preprocess_page().
 */
function radix_preprocess_page(&$variables)
{
    global $base_url;
    // Add Bootstrap JS.
    $base = parse_url($base_url);
    drupal_add_js($base['scheme'] . '://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js', 'external');
    // Add CSS for Font Awesome
    // drupal_add_css('//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css', 'external');
    // Determine if the page is rendered using panels.
    $variables['is_panel'] = FALSE;
    if (module_exists('page_manager') && count(page_manager_get_current_page())) {
        $variables['is_panel'] = TRUE;
    }
    // Make sure tabs is empty.
    if (empty($variables['tabs']['#primary']) && empty($variables['tabs']['#secondary'])) {
        $variables['tabs'] = '';
    }
    // Add search_form to theme.
    $variables['search_form'] = '';
    if (module_exists('search') && user_access('search content')) {
        $search_box_form = drupal_get_form('search_form');
        $search_box_form['basic']['keys']['#title'] = '';
        $search_box_form['basic']['keys']['#attributes'] = array('placeholder' => 'Search');
        $search_box_form['basic']['keys']['#attributes']['class'][] = 'search-query';
        $search_box_form['basic']['submit']['#value'] = t('Search');
        $search_box_form['#attributes']['class'][] = 'navbar-form';
        $search_box_form['#attributes']['class'][] = 'pull-right';
        $search_box = drupal_render($search_box_form);
        $variables['search_form'] = user_access('search content') ? $search_box : NULL;
    }
    // Format and add main menu to theme.
    $variables['main_menu'] = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
    $variables['main_menu']['#theme_wrappers'] = array('menu_tree__primary');
    // Add a copyright message.
    $variables['copyright'] = t('Drupal is a registered trademark of Dries Buytaert.');
    // Display a message if Sass has not been compiled.
    $theme_path = drupal_get_path('theme', $GLOBALS['theme']);
    $stylesheet_path = $theme_path . '/assets/stylesheets/screen.css';
    if (_radix_current_theme() == 'radix') {
        $stylesheet_path = $theme_path . '/assets/stylesheets/radix-style.css';
    }
    if (!file_exists($stylesheet_path)) {
        drupal_set_message(t('It looks like %path has not been created yet. Run <code>@command</code> in your theme directory to create it.', array('%path' => $stylesheet_path, '@command' => 'compass watch')), 'error');
    }
}
开发者ID:cesardmoro,项目名称:openatrium-2-quickstart,代码行数:48,代码来源:template.php

示例6: alfred_preprocess_page

function alfred_preprocess_page(&$vars, $hook)
{
    //typekit
    //drupal_add_js('http://use.typekit.com/XXX.js', 'external');
    //drupal_add_js('try{Typekit.load();}catch(e){}', array('type' => 'inline'));
    //webfont
    //drupal_add_css('http://cloud.webtype.com/css/CXXXX.css','external');
    //googlefont
    //  drupal_add_css('http://fonts.googleapis.com/css?family=Bree+Serif','external');
    // If this is a panel page, add template suggestions.
    // Must have Ctools Page Manager enabled. Uncomment to use.
    if (module_exists('page_manager')) {
        if (isset($panel_page) && $panel_page === page_manager_get_current_page()) {
            // add a generic suggestion for all panel pages
            $vars['theme_hook_suggestions'][] = 'page__panel';
            // add the panel page machine name to the template suggestions
            $vars['theme_hook_suggestions'][] = 'page__' . $panel_page['name'];
            //add a body class for good measure
            $body_classes[] = 'page-panel';
        }
    }
}
开发者ID:heliogabal,项目名称:alfred,代码行数:22,代码来源:template.php

示例7: dguk_preprocess_page

/**
 *  Implements hook_preprocess_page().
 */
function dguk_preprocess_page(&$variables)
{
    // If this is a node view page add content type to the template suggestions.
    if (isset($variables['node'])) {
        $variables['theme_hook_suggestions'][] = 'page__node__' . $variables['node']->type;
    }
    // If this is a panel page.
    if ($panel_page = page_manager_get_current_page()) {
        // Add a generic suggestion for all panel pages.
        $variables['theme_hook_suggestions'][] = 'page__panel';
        // Add the panel page machine name to the template suggestions.
        $variables['theme_hook_suggestions'][] = 'page__panel__' . $panel_page['name'];
        // If this is node_view panel
        if (isset($variables['node'])) {
            // Add panel page machine name and content type to the template suggestions.
            // e.g. "page__panel__node_view__blog"
            $variables['theme_hook_suggestions'][] = 'page__panel__' . $panel_page['name'] . '__' . $variables['node']->type;
        }
    }
    if (!empty($variables['node']) && $variables['node']->type == 'book' && !empty($variables['node']->parent_book)) {
        $variables['title'] = $variables['node']->parent_book->title;
    }
}
开发者ID:davidread,项目名称:dgu_d7,代码行数:26,代码来源:template.php

示例8: gavias_laikafood_preprocess_page

/**
 * Assign theme hook suggestions for custom templates and pass color theme setting
 */
function gavias_laikafood_preprocess_page(&$vars, $hook)
{
    if (isset($vars['node'])) {
        $suggest = "page__node__{$vars['node']->type}";
        $vars['theme_hook_suggestions'][] = $suggest;
    }
    if (arg(0) == 'taxonomy' && arg(1) == 'term') {
        $term = taxonomy_term_load(arg(2));
        $vars['theme_hook_suggestions'][] = 'page--taxonomy--vocabulary--' . $term->vid;
    }
    if ($panel_page = page_manager_get_current_page()) {
        // Add a generic suggestion for all panel pages.
        $vars['theme_hook_suggestions'][] = 'page__panel';
        // Add the panel page machine name to the template suggestions.
        $vars['theme_hook_suggestions'][] = 'page__' . $panel_page['name'];
        // Add a body class for good measure.
        $body_classes[] = 'page-panel';
    }
    $alias = drupal_get_path_alias($_GET['q']);
    if ($alias != $_GET['q']) {
        $vars['theme_hook_suggestions'][] = 'page__' . str_replace('-', '_', $alias);
    }
}
开发者ID:ucaka,项目名称:forestway,代码行数:26,代码来源:template.php

示例9: hpszen_preprocess_html

/**
 * Override or insert variables into the html templates.
 *
 * @param $variables
 *   An array of variables to pass to the theme template.
 * @param $hook
 *   The name of the template being rendered ("html" in this case.)
 */
function hpszen_preprocess_html(&$variables, $hook)
{
    // Add classes for page names and panels layouts.
    // @note Zen theme uses page_callback on menu_item for determining if this is
    //       a panels page, but that assumes the page has a matching variant that
    //       invokes panels, which is not always the case.
    if ($panels_display = panels_get_current_page_display()) {
        $variables['classes_array'][] = drupal_clean_css_identifier($panels_display->layout);
    } else {
        $variables['classes_array'][] = 'no-panels';
    }
    if ($current_page = page_manager_get_current_page()) {
        $variables['classes_array'][] = drupal_clean_css_identifier($current_page['name']);
    }
    // Strip html from head title
    if ($variables['head_title']) {
        $variables['head_title'] = strip_tags(htmlspecialchars_decode($variables['head_title']));
    }
    // Pass behaviour settings to javascript
    drupal_add_js(array('hpszen' => array('toggleSubNavigation' => theme_get_setting('hpszen_navigation_dropdown'), 'toggleRelatedItemDetail' => theme_get_setting('hpszen_exhibits_js'))), 'setting');
    if (theme_get_setting('hpszen_position_sticky') && module_exists('libraries')) {
        foreach (array('fixedfixed', 'fixedsticky') as $library) {
            if ($library_path = libraries_get_path($library)) {
                $file_path = "{$library_path}/{$library}";
                if (file_exists("{$file_path}.js")) {
                    drupal_add_js("{$file_path}.js");
                    if (file_exists("{$file_path}.css")) {
                        drupal_add_css("{$file_path}.css");
                    }
                }
            }
        }
    }
    // The body tag's classes are controlled by the $classes_array variable. To
    // remove a class from $classes_array, use array_diff().
    //$variables['classes_array'] = array_diff($variables['classes_array'], array('class-to-remove'));
}
开发者ID:bubok,项目名称:hps-drupal-distribution,代码行数:45,代码来源:template.php

示例10: jollyany_preprocess_page

/**
 * Assign theme hook suggestions for custom templates.
 */
function jollyany_preprocess_page(&$vars, $hook)
{
    if (isset($vars['node'])) {
        $suggest = "page__{$vars['node']->type}";
        $vars['theme_hook_suggestions'][] = $suggest;
    }
    $status = drupal_get_http_header("status");
    if ($status == "404 Not Found") {
        $vars['theme_hook_suggestions'][] = 'page__404';
    }
    if (arg(0) == 'taxonomy' && arg(1) == 'term') {
        $term = taxonomy_term_load(arg(2));
        $vars['theme_hook_suggestions'][] = 'page--taxonomy--' . $term->vid;
    }
    // If this is a panel page, add template suggestions.
    if ($panel_page = page_manager_get_current_page()) {
        // Add a generic suggestion for all panel pages.
        $vars['theme_hook_suggestions'][] = 'page__panel';
        // Add the panel page machine name to the template suggestions.
        $vars['theme_hook_suggestions'][] = 'page__' . $panel_page['name'];
        // Add a body class for good measure.
        $body_classes[] = 'page-panel';
    }
}
开发者ID:pantasio,项目名称:hdso,代码行数:27,代码来源:template.php

示例11: eigefoundationtheme_preprocess_page

/**
 * Implements template_preprocess_page
 *
 * Add convenience variables and template suggestions.
 */
function eigefoundationtheme_preprocess_page(&$variables)
{
    // EIGEDR-422 refactoring:
    // the only possible element (if exists) into the right sidebar (sidebar_second)
    // is the social media block, which is placed off the grid,
    // so it shouldn't be taken into count for the grid classes calculation
    // Convenience variables
    if (!empty($variables['page']['sidebar_first'])) {
        $left = $variables['page']['sidebar_first'];
    }
    $full_page_width = false;
    $current_path = drupal_get_path_alias();
    if ($variables["is_front"]) {
        $full_page_width = true;
    }
    $node = isset($variables['node']) ? $variables['node'] : null;
    if (strpos($current_path, 'gender-statistics/gender-equality-index') !== false && (empty($node) || $node->type != 'gender_equality_policy')) {
        $full_page_width = true;
    }
    if (strpos($current_path, 'gender-statistics/women-and-men-in-the-eu-facts-and-figures') !== false) {
        $full_page_width = true;
    }
    $variables['main_grid'] = 'large-10 large-push-2 small-push-0';
    if ($full_page_width) {
        $variables['main_grid'] = 'large-12';
    }
    if (!empty($left)) {
        $variables['sidebar_first_grid'] = 'large-2 small-12 large-pull-10 ';
        $variables['sidebar_sec_grid'] = '';
    } else {
        $variables['sidebar_first_grid'] = '';
        $variables['sidebar_sec_grid'] = '';
    }
    if ($panel_page = page_manager_get_current_page()) {
        if ($panel_page['name'] == 'page-country_profile' || $panel_page['name'] == 'page-country_about' || $panel_page['name'] == 'page-country_structures' || $panel_page['name'] == 'page-country_laws_policies' || $panel_page['name'] == 'page-country_methods_tools' || $panel_page['name'] == 'page-country_good_practices' || $panel_page['name'] == 'page-country_resources') {
            $variables['page']['content_header']['tabs'] = $variables['tabs'];
            unset($variables['tabs']);
        }
        if ($panel_page['name'] == 'page-eige_research' || $panel_page['name'] == 'page-eige_website' || $panel_page['name'] == 'page-eige_primo') {
            // tabs are appropriately placed in page via page manager/panel layout
            unset($variables['tabs']);
        }
    }
    // render search box programmatically
    $search_box_ref = drupal_get_form('search_block_form');
    $search_box = drupal_render($search_box_ref);
    $variables['search_box'] = $search_box;
    // custom libraries for lexicon page gender-mainstreaming/concepts-and-definitions
    if (arg(0) == 'gender-mainstreaming' && arg(1) == 'concepts-and-definitions') {
        $theme_path = drupal_get_path('theme', 'eigefoundationtheme');
        drupal_add_library('system', 'effects.highlight');
        drupal_add_js($theme_path . '/js/CustomScrollbar/jquery.mCustomScrollbar.min.js', 'file');
        drupal_add_css($theme_path . '/js/CustomScrollbar/jquery.mCustomScrollbar.css');
    }
    // Adds settings for the Structure node ENGE interoperability (EIGEDR-249).
    if (isset($variables['node'])) {
        $node = $variables['node'];
        if ($node->type == "structure") {
            if (isset($node->field_eurogender_user_id) && isset($node->field_eurogender_user_id['und']) && isset($node->field_eurogender_user_id['und'][0]) && isset($node->field_eurogender_user_id['und'][0]['value'])) {
                global $conf;
                drupal_add_js(array('enge_website' => $conf['enge_website'], 'eurogender_actor_id' => $node->field_eurogender_user_id['und'][0]['value']), 'setting');
            }
        }
    }
    // EIGEDR-331 home page carousel
    if (isset($variables['is_front']) && $variables['is_front']) {
        $theme_path = drupal_get_path('theme', 'eigefoundationtheme');
        drupal_add_css($theme_path . '/js/owl-carousel/owl.carousel.css');
        drupal_add_css($theme_path . '/js/owl-carousel/owl.theme.css');
        drupal_add_js($theme_path . '/js/owl-carousel/owl.carousel.js', 'file');
    }
    // EIGEDR-369 - hide default h1 from EuroGender event display
    $path = current_path();
    if (strpos($path, 'events-calendar/event/') !== false) {
        $variables['title'] = "";
    }
    // EIGEDR-278 - hide default h1 from Primo resource display
    if (strpos($path, 'rdc/library/resource/') !== false) {
        $variables['title'] = "";
    }
    _panelize_gm_nodes($variables);
}
开发者ID:EIGE,项目名称:www_staging,代码行数:87,代码来源:template.php

示例12: bootstrap_psdpt_preprocess_page


//.........这里部分代码省略.........
        $variables['secondary_nav']['#theme_wrappers'] = array('menu_tree__secondary');
    }
    // Navbar.
    $variables['navbar_classes_array'] = array('');
    if (theme_get_setting('bootstrap_navbar_position') !== '') {
        $variables['navbar_classes_array'][] = 'navbar-' . theme_get_setting('bootstrap_navbar_position');
    } else {
        $variables['navbar_classes_array'][] = '';
    }
    // Mega Menu Region.
    /*  if (module_exists('menu_block') && empty($variables['mega_menu'])) {
        $menu_name = 'main_menu';
        $data = array(
          '#pre_render' => array('_wetkit_menu_tree_build_prerender'),
          '#cache' => array(
            'keys' => array('bootstrap_psdpt', 'menu', 'mega_menu', $menu_name),
            'expire' => CACHE_TEMPORARY,
            'granularity' => DRUPAL_CACHE_PER_ROLE
          ),
          '#menu_name' => $menu_name,
        );
        $variables['page']['mega_menu'] = $data;
      }*/
    // Splash Page.
    if (current_path() == 'splashify-splash') {
        // GCWeb Theme.
        if ($wxt_active == 'gcweb') {
            $variables['background'] = $library_path . '/img/splash/sp-bg-2.jpg';
        }
    }
    // Panels Integration.
    if (module_exists('page_manager')) {
        // Page template suggestions for Panels pages.
        $panel_page = page_manager_get_current_page();
        if (!empty($panel_page)) {
            // Add the active WxT theme machine name to the template suggestions.
            $suggestions[] = 'page__panels__' . $wxt_active;
            if (drupal_is_front_page()) {
                $suggestions[] = 'page__panels__' . $wxt_active . '__front';
            }
            // Add the panel page machine name to the template suggestions.
            $suggestions[] = 'page__' . $panel_page['name'];
            // Merge the suggestions in to the existing suggestions
            // (as more specific than the existing suggestions).
            $variables['theme_hook_suggestions'] = array_merge($variables['theme_hook_suggestions'], $suggestions);
            $variables['panels_layout'] = TRUE;
        } else {
            $suggestions[] = 'page__' . $wxt_active;
            // Splash Page.
            if (current_path() == 'splashify-splash') {
                $suggestions[] = 'page__splash__' . $wxt_active;
            }
            // Merge the suggestions in to the existing suggestions (as more specific
            // than the existing suggestions).
            $variables['theme_hook_suggestions'] = array_merge($variables['theme_hook_suggestions'], $suggestions);
        }
    }
    // Header Navigation + Language Switcher.
    $menu = $is_multilingual ? i18n_menu_navigation_links('menu-wet-header') : menu_navigation_links('menu-wet-header');
    $nav_bar_markup = theme('links__menu_menu_wet_header', array('links' => $menu, 'attributes' => array('id' => 'menu', 'class' => array('links', 'clearfix')), 'heading' => array('text' => 'Language Selection', 'level' => 'h2')));
    $nav_bar_markup = strip_tags($nav_bar_markup, '<h2><li><a>');
    if (module_exists('wetkit_language')) {
        $language_link_markup = '<li id="' . $theme_menu_prefix . '-lang">' . strip_tags($variables['menu_lang_bar'], '<a><span>') . '</li>';
        if ($wxt_active == 'gcweb') {
            $variables['menu_bar'] = '<ul class="list-inline margin-bottom-none">' . $language_link_markup . '</ul>';
        } else {
开发者ID:atssc-scdata,项目名称:bootstrap_psdpt,代码行数:67,代码来源:page.vars.php

示例13: vac_preprocess_page

/**
 * Implements template_preprocess_page.
 */
function vac_preprocess_page(&$variables)
{
    if (!module_exists('page_manager') || !page_manager_get_current_page()) {
        $variables['not_panels'] = TRUE;
    }
}
开发者ID:stevebresnick,项目名称:iomedia_sf_themes,代码行数:9,代码来源:template.php

示例14: kalatheme_process_page

/**
 * Override or insert variables into the page template.
 *
 * Implements template_process_page().
 */
function kalatheme_process_page(&$variables)
{
    // Hook into color.module.
    if (module_exists('color')) {
        _color_page_alter($variables);
    }
    // Define variables to theme local actions as a dropdown.
    $dropdown_attributes = array('container' => array('class' => array('dropdown', 'actions', 'pull-right')), 'toggle' => array('class' => array('dropdown-toggle', 'enabled'), 'data-toggle' => array('dropdown'), 'href' => array('#')), 'content' => array('class' => array('dropdown-menu')));
    // Add local actions as the last item in the local tasks.
    if (!empty($variables['action_links'])) {
        $variables['tabs']['#primary'][]['#markup'] = theme('menu_local_actions', array('menu_actions' => $variables['action_links'], 'attributes' => $dropdown_attributes));
        $variables['action_links'] = FALSE;
    }
    // Get the entire main menu tree.
    $main_menu_tree = array();
    $main_menu_tree = menu_tree_all_data('main-menu', NULL, 2);
    // Add the rendered output to the $main_menu_expanded variable.
    $variables['main_menu_expanded'] = menu_tree_output($main_menu_tree);
    // Always print the site name and slogan, but if they are toggled off, we'll
    // just hide them visually.
    $variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE;
    $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE;
    if ($variables['hide_site_name']) {
        // If toggle_name is FALSE, the site_name will be empty, so we rebuild it.
        $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal'));
    }
    if ($variables['hide_site_slogan']) {
        // If toggle_site_slogan is FALSE, the site_slogan will be empty,
        // so we rebuild it.
        $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', ''));
    }
    // Since the title and the shortcut link are both block level elements,
    // positioning them next to each other is much simpler with a wrapper div.
    if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) {
        // Add a wrapper div using title_prefix and title_suffix render elements.
        $variables['title_prefix']['shortcut_wrapper'] = array('#markup' => '<div class="shortcut-wrapper clearfix">', '#weight' => 100);
        $variables['title_suffix']['shortcut_wrapper'] = array('#markup' => '</div>', '#weight' => -99);
        // Make sure the shortcut link is the first item in title_suffix.
        $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100;
    }
    // If panels arent being used at all.
    $variables['no_panels'] = !(module_exists('page_manager') && page_manager_get_current_page());
    // Check if we're to always print the page title, even on panelized pages.
    $variables['always_show_page_title'] = theme_get_setting('always_show_page_title') ? TRUE : FALSE;
}
开发者ID:niner9,项目名称:webspark-drops-drupal7,代码行数:50,代码来源:template.php

示例15: radix_preprocess_page

/**
 * Implements template_preprocess_page().
 */
function radix_preprocess_page(&$variables)
{
    // Determine if the page is rendered using panels.
    $variables['is_panel'] = FALSE;
    if (module_exists('page_manager') && count(page_manager_get_current_page())) {
        $variables['is_panel'] = TRUE;
    }
    // Make sure tabs is empty.
    if (empty($variables['tabs']['#primary']) && empty($variables['tabs']['#secondary'])) {
        $variables['tabs'] = '';
    }
    // Theme action links as buttons.
    if (!empty($variables['action_links'])) {
        foreach (element_children($variables['action_links']) as $key) {
            $variables['action_links'][$key]['#link']['localized_options']['attributes'] = array('class' => array('btn', 'btn-primary', 'btn-sm'));
        }
    }
    // Add search_form to theme.
    $variables['search_form'] = '';
    if (module_exists('search') && user_access('search content')) {
        $search_box_form = drupal_get_form('search_form');
        $search_box_form['basic']['keys']['#title'] = 'Search';
        $search_box_form['basic']['keys']['#title_display'] = 'invisible';
        $search_box_form['basic']['keys']['#size'] = 20;
        $search_box_form['basic']['keys']['#attributes'] = array('placeholder' => 'Search');
        $search_box_form['basic']['keys']['#attributes']['class'][] = 'form-control';
        $search_box_form['basic']['submit']['#value'] = t('Search');
        $search_box_form['#attributes']['class'][] = 'navbar-form';
        $search_box_form['#attributes']['class'][] = 'navbar-right';
        $search_box = drupal_render($search_box_form);
        $variables['search_form'] = user_access('search content') ? $search_box : NULL;
    }
    // Format and add main menu to theme.
    $variables['main_menu'] = menu_tree(variable_get('menu_main_links_source', 'main-menu'));
    $variables['main_menu']['#theme_wrappers'] = array();
    // Add a copyright message.
    $variables['copyright'] = t('Drupal is a registered trademark of Dries Buytaert.');
    // Display a message if Sass has not been compiled.
    //  $theme_path = drupal_get_path('theme', $GLOBALS['theme']);
    //  $stylesheet_path = $theme_path . '/assets/stylesheets/screen.css';
    //  if (_radix_current_theme() == 'radix') {
    //    $stylesheet_path = $theme_path . '/assets/stylesheets/radix-style.css';
    //  }
    //  if (!file_exists($stylesheet_path)) {
    //    drupal_set_message(t('It looks like %path has not been created yet. Run <code>@command</code> in your theme directory to create it.', array(
    //      '%path' => $stylesheet_path,
    //      '@command' => 'compass watch',
    //    )), 'error');
    //  }
}
开发者ID:rhabbachi,项目名称:data_starter,代码行数:53,代码来源:template.php


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