Exemple #1
0
/**
 * implements hook_preprocess_page()
 *
 **/
function odsherredweb_preprocess_page(&$variables)
{
    $current_theme = variable_get('theme_default', 'none');
    // Search form
    $variables['simple_navigation_search'] = module_invoke('search', 'block_view', 'search');
    // Navigation
    $variables['sidebar_borger'] = _bellcom_generate_menu('menu-indhold', 'sidebar');
    $variables['sidebar_erhverv'] = _bellcom_generate_menu('menu-erhverv', 'sidebar');
    $variables['sidebar_politik'] = _bellcom_generate_menu('menu-politik', 'sidebar');
    // Add the site structure term id to the page div
    $node = node_load(arg(1));
    if (is_object($node) && isset($node->field_os2web_spotbox_sitestruct)) {
        $termParents = taxonomy_get_parents($node->field_os2web_spotbox_sitestruct[LANGUAGE_NONE][0]['tid']);
        $termId = 'tid-' . $node->field_os2web_spotbox_sitestruct[LANGUAGE_NONE][0]['tid'];
        $termIdParent = "";
        if (!empty($termParents)) {
            $termIdParent = 'tid-' . key($termParents);
        }
        $variables['attributes_array']['class'] = $termIdParent . ' ' . $termId;
    }
    // Paths
    $variables['path_js'] = base_path() . drupal_get_path('theme', $current_theme) . '/js';
    $variables['path_img'] = base_path() . drupal_get_path('theme', $current_theme) . '/images';
    $variables['path_css'] = base_path() . drupal_get_path('theme', $current_theme) . '/css';
    $variables['path_font'] = base_path() . drupal_get_path('theme', $current_theme) . '/font';
}
Exemple #2
0
function bellcom_preprocess_page(&$variables)
{
    $current_theme = variable_get('theme_default', 'none');
    $primary_navigation_name = variable_get('menu_main_links_source', 'main-menu');
    $secondary_navigation_name = variable_get('menu_secondary_links_source', 'user-menu');
    // Navigation
    $variables['primary_navigation'] = _bellcom_generate_menu($primary_navigation_name, 'main-navigation');
    $variables['secondary_navigation'] = _bellcom_generate_menu($secondary_navigation_name, 'main-navigation');
    $variables['sidebar_primary_navigation'] = _bellcom_generate_menu($primary_navigation_name, 'sidebar');
    $variables['sidebar_secondary_navigation'] = _bellcom_generate_menu($secondary_navigation_name, 'sidebar');
    // Paths
    $variables['path_js'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/js';
    $variables['path_img'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/img';
    $variables['path_css'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/css';
    $variables['path_font'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/font';
    // Theme settings
    $variables['theme_settings'] = _bellcom_collect_theme_settings();
}
Exemple #3
0
function bellcom_preprocess_page(&$variables)
{
    $current_theme = variable_get('theme_default', 'none');
    $primary_navigation_name = variable_get('menu_main_links_source', 'main-menu');
    $secondary_navigation_name = variable_get('menu_secondary_links_source', 'user-menu');
    // Navigation
    $variables['primary_navigation'] = _bellcom_generate_menu($primary_navigation_name, 'main-navigation', 1);
    $variables['secondary_navigation'] = _bellcom_generate_menu($secondary_navigation_name, 'main-navigation');
    $variables['sidebar_primary_navigation'] = _bellcom_generate_menu($primary_navigation_name, 'sidebar');
    $variables['sidebar_secondary_navigation'] = _bellcom_generate_menu($secondary_navigation_name, 'sidebar');
    // Paths
    $variables['path_js'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/js';
    $variables['path_img'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/img';
    $variables['path_css'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/css';
    $variables['path_font'] = base_path() . drupal_get_path('theme', $current_theme) . '/dist/font';
    // Theme settings
    $variables['theme_settings'] = _bellcom_collect_theme_settings();
    if (!empty($settings['options']['footer_logo']['footer_logo_path'])) {
        $vars['options']['footer_logo']['footer_logo_path'] = $settings['options']['footer_logo']['footer_logo_path'];
    } else {
        $variables['options']['footer_logo']['footer_logo_path'] = path_to_theme() . '/small-logo.png';
    }
}