Example #1
0
File: touch.php Project: xctcc/npt
function touch_theme_menu_top()
{
    $links = $main_menu_titles = array();
    if (setting_fetch('tophome', 'yes') == 'yes') {
        $main_menu_titles[] = __("Home");
    }
    if (setting_fetch('topreplies', 'yes') == 'yes') {
        $main_menu_titles[] = __("Replies");
    }
    if (setting_fetch('topdirects', 'yes') == 'yes') {
        $main_menu_titles[] = __("Directs");
    }
    if (setting_fetch('topsearch') == 'yes') {
        $main_menu_titles[] = __("Search");
    }
    foreach (menu_visible_items() as $url => $page) {
        $title = $url ? $page['title'] : __("Home");
        $type = in_array($title, $main_menu_titles) ? 'main' : 'extras';
        $links[$type][] = "<a href='" . BASE_URL . "{$url}'>{$title}</a>";
    }
    if (user_is_authenticated()) {
        $user = user_current_username();
        if (setting_fetch('topuser') == 'yes') {
            array_unshift($links['main'], "<b><a href='" . BASE_URL . "user/{$user}'>{$user}</a></b>");
        }
        array_unshift($links['extras'], "<b><a href='" . BASE_URL . "user/{$user}'>{$user}</a></b>");
    }
    array_push($links['main'], '<a href="#" onclick="return toggleMenu()">' . __('More') . '</a>');
    $html = '<div id="menu" class="menu">';
    $html .= theme('list', $links['main'], array('id' => 'menu-main'));
    $html .= theme('list', $links['extras'], array('id' => 'menu-extras'));
    $html .= '</div>';
    return $html;
}
Example #2
0
function theme_menu_both($menu)
{
    $links = array();
    foreach (menu_visible_items() as $url => $page) {
        $title = $url ? $url : 'home';
        $title = ucwords(str_replace("-", " ", $title));
        if ('yes' == setting_fetch('menu_icons')) {
            $display = $page['display'];
            $class = "menu";
        } else {
            $display = $title . " |";
            $class = "menu-text";
        }
        if (!$url) {
            $url = BASE_URL;
        }
        // Shouldn't be required, due to <base> element but some browsers are stupid.
        // if ($menu == 'bottom' ) { //&& isset($page['accesskey'])) {
        // 	$links[] = "<a href='$url'>$title</a> {$page['accesskey']}";
        // } else {
        // 	// $links[] = "<a href='$url'>$title</a>";
        // }
        $links[] = "<a href=\"{$url}\" title=\"{$title}\">{$display}</a>";
    }
    if (user_is_authenticated()) {
        // $user = user_current_username();
        // array_unshift($links, "<b><a href='user/$user'>$user</a></b>");
    }
    if ($menu == 'bottom') {
        // $links[] = "<a href='{$_GET['q']}' accesskey='5'>refresh</a> 5";
    }
    return "<div class='{$class}' id='menu'>" . implode('&ensp;', $links) . '</div>';
}
Example #3
0
function theme_menu_both($menu)
{
    $links = array();
    foreach (menu_visible_items() as $url => $page) {
        $title = $url ? $url : 'home';
        $title = str_replace("-", " ", $title);
        if (!$url) {
            $url = BASE_URL;
        }
        // Shouldn't be required, due to <base> element but some browsers are stupid.
        if ($menu == 'bottom' && isset($page['accesskey'])) {
            $links[] = "<a href='{$url}' accesskey='{$page['accesskey']}'>{$title}</a> {$page['accesskey']}";
        } else {
            $links[] = "<a href='{$url}'>{$title}</a>";
        }
    }
    if (user_is_authenticated()) {
        $user = user_current_username();
        array_unshift($links, "<b><a href='user/{$user}'>{$user}</a></b>");
    }
    if ($menu == 'bottom') {
        $links[] = "<a href='{$_GET['q']}' accesskey='5'>refresh</a> 5";
    }
    return "<div class='menu menu-{$menu}'>" . implode(' | ', $links) . '</div>';
}
Example #4
0
function touch_theme_menu_top()
{
    $links = array();
    $main_menu_titles = array('home', 'replies', 'directs', 'search');
    foreach (menu_visible_items() as $url => $page) {
        $title = $url ? $url : 'home';
        $type = in_array($title, $main_menu_titles) ? 'main' : 'extras';
        $links[$type][] = "<a href='{$url}'>{$title}</a>";
    }
    if (user_is_authenticated()) {
        $user = user_current_username();
        array_unshift($links['extras'], "<b><a href='user/{$user}'>{$user}</a></b>");
    }
    array_push($links['main'], '<a href="#" onclick="return toggleMenu()">more</a>');
    $html = '<div id="menu" class="menu">';
    $html .= theme('list', $links['main'], array('id' => 'menu-main'));
    $html .= theme('list', $links['extras'], array('id' => 'menu-extras'));
    $html .= '</div>';
    return $html;
}
Example #5
0
function theme_menu_top()
{
    $links = array();
    foreach (menu_visible_items() as $url => $page) {
        $title = $url ? $url : 'home';
        $title = ucwords(str_replace("-", " ", $title));
        if ('yes' == setting_fetch('dabr_show_icons', "yes")) {
            $display = $page['display'];
            $class = "menu";
        } else {
            $display = $title . " |";
            $class = "menu-text";
        }
        if (!$url) {
            $url = BASE_URL;
        }
        // Shouldn't be required, due to <base> element but some browsers are stupid.
        $links[] = "<a href=\"{$url}\" title=\"{$title}\">{$display}</a>";
    }
    // if (user_is_authenticated()) {
    // 	// $user = user_current_username();
    // 	// array_unshift($links, "<b><a href='user/$user'>$user</a></b>");
    // }
    // if ($menu == 'bottom') {
    // 	// $links[] = "<a href='{$_GET['q']}' accesskey='5'>refresh</a> 5";
    // }
    if (setting_fetch('dabr_colours') == null) {
        //	If the cookies haven't been set, remind the user that they can set how Dabr looks
        $ugly = "<div class='tweet'>" . _(UGLY) . "</div>";
    }
    if ('yes' == setting_fetch('dabr_float_menu', "yes")) {
        //	Horrible hack to make the height of the element corrent
        $padding = "<div class='{$class}' id='menu'>" . implode('&ensp;', $links) . "</div>" . $ugly;
        $class .= ' menu-float';
        return "<div class='{$class}' id='menu-float'>" . implode('&ensp;', $links) . "</div>" . $padding;
    }
    return "<div class='{$class}' id='menu'>" . implode('&ensp;', $links) . "</div>" . $ugly;
}