コード例 #1
0
ファイル: template.php プロジェクト: khoegenauer/exframe
/**
 * @file
 * This file is empty by default because the base theme chain (Alpha & Omega) provides
 * all the basic functionality. However, in case you wish to customize the output that Drupal
 * generates through Alpha & Omega this file is a good place to do so.
 *
 * Alpha comes with a neat solution for keeping this file as clean as possible while the code
 * for your subtheme grows. Please read the README.txt in the /preprocess and /process subfolders
 * for more information on this topic.
 */
function scc_preprocess_region(&$vars)
{
    $theme = alpha_get_theme();
    switch ($vars['elements']['#region']) {
        case 'content':
            $vars['is_node_page'] = isset($theme->page['node']);
    }
    if ($vars['region'] == 'menu') {
        $main_menu = menu_main_menu();
        $secondary_menu = menu_secondary_menu();
        if ($main_menu) {
            if (module_exists('nice_menus')) {
                $vars['primary_nav'] = theme('nice_menus_main_menu');
            } else {
                $vars['primary_nav'] = theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix', 'main-menu')), 'heading' => array('text' => t('Main menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
            }
        } else {
            $vars['primary_nav'] = false;
        }
        if ($secondary_menu) {
            $vars['secondary_nav'] = theme('links__system_secondary_menu', array('links' => $secondary_menu, 'attributes' => array('id' => 'secondary-menu', 'class' => array('links', 'inline', 'clearfix', 'secondary-menu')), 'heading' => array('text' => t('Secondary menu'), 'level' => 'h2', 'class' => array('element-invisible'))));
        } else {
            $vars['secondary_nav'] = false;
        }
    }
}
コード例 #2
0
/**
 * Implements theme_preprocess_region().
 */
function expressbase_preprocess_region(&$vars)
{
    global $base_url;
    // add classes to regions and blocks for column configuration
    $columns = array('1' => 'region-one-column', '2' => 'region-two-columns', '3' => 'region-three-columns', '4' => 'region-four-columns', '5' => 'region-five-columns', '6' => 'region-six-columns');
    // Get column theme settings
    $after_content_columns = theme_get_setting('after_content_columns') ? theme_get_setting('after_content_columns') : '1';
    $lower_columns = theme_get_setting('lower_columns') ? theme_get_setting('lower_columns') : '1';
    $footer_columns = theme_get_setting('footer_columns') ? theme_get_setting('footer_columns') : '1';
    // Add variables to regions
    switch ($vars['region']) {
        case 'branding':
            $vars['logo'] = theme_get_setting('logo');
            $vars['front_page'] = url('<front>');
            if (variable_get('site_name_2', '')) {
                $vars['site_name'] = '<span class="site-name-two-lines">' . variable_get('site_name_1', NULL) . '<br />' . variable_get('site_name_2', NULL) . '</span>';
            } else {
                $vars['site_name'] = variable_get('site_name', NULL);
            }
            $slogan_display = variable_get('site_slogan_display', 'University of Colorado <strong>Boulder</strong>');
            $vars['site_slogan'] = $slogan_display;
            $vars['print_logo'] = '<img src="' . $base_url . '/' . drupal_get_path('theme', 'expressbase') . '/images/print-logo.png" alt="University of Colorado Boulder" />';
            break;
        case 'secondary_menu':
            $vars['secondary_menu'] = menu_secondary_menu();
            $vars['secondary_menu_heading'] = theme_get_setting('secondary_menu_label') ? theme_get_setting('secondary_menu_label') : '';
            break;
        case 'menu':
            $vars['main_menu'] = menu_main_menu();
            expressbase_home_icon($vars, 'main_menu');
            $vars['secondary_menu'] = menu_secondary_menu();
            if (theme_get_setting('use_action_menu')) {
                $color = theme_get_setting('action_menu_color') ? theme_get_setting('action_menu_color') : 'action-blue';
                $vars['classes_array'][] = $color;
            }
            break;
        case 'after_content':
            $vars['classes_array'][] = $columns[$after_content_columns];
            $vars['classes_array'][] = 'block-column-container';
            break;
        case 'lower':
            $vars['classes_array'][] = $columns[$lower_columns];
            $vars['classes_array'][] = 'block-column-container';
            break;
        case 'footer':
            $vars['classes_array'][] = $columns[$footer_columns];
            $vars['classes_array'][] = 'block-column-container';
            break;
        case 'site_info':
            $vars['base_url'] = $base_url;
            $vars['beboulder']['color'] = 'white';
            $vars['classes_array'][] = !empty($vars['content']) ? 'footer-2col' : 'footer-1col';
            break;
        case 'sidebar_first':
            //$vars['classes_array'][] = 'sidebar';
            //$vars['classes_array'][] = 'col-lg-4 col-md-4';
            break;
        case 'sidebar_second':
            //$vars['classes_array'][] = 'sidebar';
            //$vars['classes_array'][] = 'col-lg-4 col-md-4';
            break;
        case 'content':
            break;
    }
}
コード例 #3
0
/**
 * Override or insert variables into the page template.
 *
 * @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 clf_preprocess_page(&$variables, $hook)
{
    if (isset($variables['node']->type)) {
        $nodetype = $variables['node']->type;
        $vars['theme_hook_suggestions'][] = 'page__' . $nodetype;
    }
    $variables['main_menu'] = menu_main_menu();
    // Find the title of the menu used by the secondary links.
    $secondary_links = variable_get('menu_secondary_links_source', 'user-menu');
    if ($secondary_links) {
        $menus = function_exists('menu_get_menus') ? menu_get_menus() : menu_list_system_menus();
        $variables['secondary_menu_heading'] = $menus[$secondary_links];
    } else {
        $variables['secondary_menu_heading'] = '';
    }
}
コード例 #4
0
ファイル: template.php プロジェクト: neochief/373.kiev.ua
/**
 * Override or insert variables into the page template.
 */
function k373k_preprocess_page(&$vars) {
  $vars['main_menu'] = menu_main_menu();
}