Example #1
0
function _phptemplate_variables($hook, $vars)
{
    $vars = array();
    if ($hook == 'page') {
        if (module_exists('page_title')) {
            $vars['head_title'] = page_title_page_get_title();
        }
    }
    return $vars;
}
Example #2
0
function _phptemplate_variables($hook, $vars)
{
    // Setup theme path variable
    $vars['path'] = base_path() . path_to_theme();
    if ($hook == 'page') {
        // Menüüde genereerimine
        $vars['menu_level_1'] = theme('menu_links', menu_primary_links(1), 1);
        $vars['menu_level_2'] = theme('menu_links_2', menu_primary_links(2), 2);
        // Eemalda druapi css
        $css = drupal_add_css();
        unset($css['all']['module']['modules/system/system.css']);
        unset($css['all']['module']['modules/system/defaults.css']);
        $vars['styles'] = drupal_get_css($css);
        // Kasuta agregeeritud javascripti
        if (module_exists('javascript_aggregator') && $vars['scripts']) {
            $vars['scripts'] = javascript_aggregator_cache($vars['scripts']);
        }
        // Määra title page_title mooduli kaudu
        if (module_exists('page_title')) {
            $vars['head_title'] = page_title_page_get_title();
        }
        // Eemalda ebavajalikud tab'id
        _phptemplate_adminlogo($vars);
        // Ära näita tabe otsingus
        if (preg_match("|search/node|", $_GET['q'])) {
            $vars['show_tabs'] = false;
        } else {
            $vars['show_tabs'] = true;
        }
        // Title näitamise flag
        if (isset($vars['node']->field_hide_page_title)) {
            if ($vars['node']->field_hide_page_title[0]['value'] == 1) {
                $vars['show_title'] = false;
            } else {
                $vars['show_title'] = true;
            }
        } else {
            $vars['show_title'] = true;
        }
    } else {
        if ($hook == 'node') {
            // ...
        } else {
            if ($hook == 'block') {
                // ...
            }
        }
    }
    return $vars;
}
Example #3
0
function phptemplate_preprocess_page(&$vars)
{
    global $user;
    $vars['path'] = base_path() . path_to_theme() . '/';
    $vars['user'] = $user;
    // Fixup the $head_title and $title vars to display better.
    $title = drupal_get_title();
    $vars['title'] = $title;
    $headers = drupal_set_header();
    // wrap taxonomy listing pages in quotes and prefix with topic
    if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
        $title = t('Topic') . ' “' . $title . '”';
    } elseif (strpos($headers, 'HTTP/1.1 403 Forbidden') && !$user->uid) {
        $title = t('Please login to continue');
    }
    // Body class & Params
    if (module_exists('path')) {
        $alias = drupal_get_path_alias($_GET['q']);
        $vars['params'] = explode('/', $alias);
        $vars['body_id'] = $vars['params'][0];
        if (empty($vars['body_id'])) {
            $vars['body_id'] = 'home';
        }
    }
    // Base url
    $vars['baseUrl'] = 'http://' . $_SERVER['HTTP_HOST'];
    if (!drupal_is_front_page()) {
        $vars['head_title'] = $title . ' | ' . $vars['site_name'];
        if ($vars['site_slogan'] != '') {
            $vars['head_title'] .= ' – ' . $vars['site_slogan'];
        }
    }
    // Head title
    if (module_exists('page_title')) {
        $vars['head_title'] = page_title_page_get_title();
    } elseif (!drupal_is_front_page()) {
        $vars['head_title'] = $title . ' | ' . $vars['site_name'];
        if ($vars['site_slogan'] != '') {
            $vars['head_title'] .= ' – ' . $vars['site_slogan'];
        }
    }
}
Example #4
0
function phptemplate_preprocess_page(&$vars)
{
    $eigen_risico = variable_get('eigen_risico', '');
    $fysio = variable_get('fysio', '');
    $tandarts = variable_get('tandarts', '');
    $keuzevrijheid = variable_get('keuzevrijheid', '');
    $default_title = variable_get('default_title', '0');
    $default_sort = variable_get('default_sort', 'premium');
    $default_beperkte_zorgkeuze = variable_get('default_beperkte_zorgkeuze', '0');
    $default_vrije_zorgkeuze = variable_get('default_vrije_zorgkeuze', '0');
    drupal_add_js(array('filter' => array('eigen_risico' => $eigen_risico, 'fysio' => $fysio, 'tandarts' => $tandarts, 'keuzevrijheid' => $keuzevrijheid, 'default_title' => $default_title, 'default_sort' => $default_sort, 'default_beperkte_zorgkeuze' => $default_beperkte_zorgkeuze, 'default_vrije_zorgkeuze' => $default_vrije_zorgkeuze)), 'setting');
    drupal_add_js(array('filter_counts' => variable_get('default_count_of_contacts', 10)), 'setting');
    if ($vars['node']->type == 'insurance' && isset($_GET['eigen_risico']) && isset($_GET['fysio']) && isset($_GET['tandarts']) && isset($_GET['keuzevrijheid'])) {
        $vars['contentBottom'] = '';
    }
    global $user;
    $vars['path'] = base_path() . path_to_theme() . '/';
    $vars['user'] = $user;
    if (!(!empty($_POST['save_Vergelijken']) && arg(0) == 'compare')) {
        if ($user->uid > 0) {
            db_query("DELETE FROM {flag_content} WHERE uid = %d", $user->uid);
        } else {
            db_query("DELETE FROM {flag_content} WHERE uid = 0 AND sid = %d", flag_get_sid(0));
        }
    }
    // Fixup the $head_title and $title vars to display better.
    $title = drupal_get_title();
    $vars['title'] = $title;
    $headers = drupal_set_header();
    // wrap taxonomy listing pages in quotes and prefix with topic
    if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
        $title = t('Topic') . ' “' . $title . '”';
    } elseif (strpos($headers, 'HTTP/1.1 403 Forbidden') && !$user->uid) {
        $title = t('Please login to continue');
    }
    // Body class & Params
    if (module_exists('path')) {
        $alias = drupal_get_path_alias($_GET['q']);
        $vars['params'] = explode('/', $alias);
        $vars['body_id'] = $vars['params'][0];
        if ($vars['body_id'] == 'compare') {
            $vars['body_id'] = 'vergelijk';
        }
        if (empty($vars['body_id'])) {
            $vars['body_id'] = 'home';
        }
    }
    // Base url
    $vars['baseUrl'] = 'http://' . $_SERVER['HTTP_HOST'];
    if (!drupal_is_front_page()) {
        $vars['head_title'] = $title . ' | ' . $vars['site_name'];
        if ($vars['site_slogan'] != '') {
            $vars['head_title'] .= ' – ' . $vars['site_slogan'];
        }
    }
    // Head title
    if (module_exists('page_title')) {
        $vars['head_title'] = page_title_page_get_title();
    } elseif (!drupal_is_front_page()) {
        $vars['head_title'] = $title . ' | ' . $vars['site_name'];
        if ($vars['site_slogan'] != '') {
            $vars['head_title'] .= ' – ' . $vars['site_slogan'];
        }
    }
    // determine layout
    // 3 columns
    if ($vars['layout'] == 'both') {
        $vars['colls'] = 'bothCol';
    } else {
        if ($vars['layout'] != 'none') {
            // left column & center
            if ($vars['layout'] == 'left') {
                $vars['colls'] = 'leftCol';
            } else {
                if ($vars['layout'] == 'right') {
                    $vars['colls'] = 'rightCol';
                }
            }
        } else {
            $vars['colls'] = 'noCol';
        }
    }
    $vars['scripts'] = drupal_get_js();
}