예제 #1
0
function phptemplate_menu_links3($links)
{
    if (!count($links)) {
        return '';
    }
    $level_tmp = explode('-', key($links));
    $level = $level_tmp[1];
    $output = "";
    foreach ($links as $index => $link) {
        if (stristr($index, 'active')) {
            $is_active = true;
            //$class = 'active';
        } else {
            $is_active = false;
            //$class = '';
        }
        $link['attributes']['class'] = 'link5';
        $output .= "<li>" . l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']) . "<span class='hbar'><!-- # --></span></li>\n";
        if ($is_active && ($menu4 = theme('menu_links4', menu_primary_links(4), 4))) {
            $output .= $menu4;
        }
    }
    $output .= '';
    return $output;
}
예제 #2
0
function newsportal_primary_links()
{
    $links = menu_primary_links();
    if ($links) {
        $output .= '<ul id="navlist">';
        foreach ($links as $link) {
            $output .= '<li>' . $link . '</li>';
        }
        $output .= '</ul>';
    }
    return $output;
}
예제 #3
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;
}