Example #1
0
function mx_optiontitle($option, $title)
{
    global $mxuser;
    if (MXDEFFEATURES & MXFTDROPMENU) {
        return;
    }
    echo "<h3><span class='headericon'>" . (file_exists(mx_iconfile($option)) ? mx_icon($option, $title, '16px') : '') . "</span>{$title}</h3>";
}
Example #2
0
function mx_showmenu($menu, $menutype, $curpage = '', $curopt = '')
{
    global $mx_ctxmenu, $mx_fbmenu, $mxuser;
    define('MXMENUVERTUSER', 0);
    define('MXMENUHORIZTOP', 1);
    define('MXMENUHORIZBOT', 2);
    define('MXMENUHORIZICON', 3);
    define('MXMENUHORIZHELP', 4);
    define('MXMENUVERTMAIN', 5);
    define('MXMENUHORIZFB', 6);
    define('MXMENUVERTICON', 7);
    if ($menutype != 0 && $menutype != 4 && $menutype != 6 && $menu != $mx_ctxmenu && array_key_exists($curpage, $mx_ctxmenu) && ($mx_ctxmenu[$curpage][0] == 1 && is_logged() || $mx_ctxmenu[$curpage][0] == 1.5 && !is_confirmed() || $mx_ctxmenu[$curpage][0] == 2 && !is_logged() || $mx_ctxmenu[$curpage][0] == 2.4 && (!is_logged() || is_confirmed()) || $mx_ctxmenu[$curpage][0] == 2.5 && (!is_confirmed() || is_setup()) || $mx_ctxmenu[$curpage][0] >= 3 && !is_setup() || $mx_ctxmenu[$curpage][0] == 10 && !(is_setup() && is_artist()) || $mx_ctxmenu[$curpage][0] == 11 && !(is_setup() && is_artist() && is_pageadmin()) || $mx_ctxmenu[$curpage][0] == 20 && !is_privileged() || $mx_ctxmenu[$curpage][0] < 0 || $mx_ctxmenu[$curpage][0] == 127 && !is_admin() || $mx_ctxmenu[$curpage][0] == 126 && !is_pseudoadmin())) {
        return;
    }
    if ($menutype == 6 && ($mx_fbmenu[$curpage][0] == 1 && is_logged() || $mx_fbmenu[$curpage][0] == 1.5 && !is_confirmed() || $mx_fbmenu[$curpage][0] == 2 && !is_logged() || $mx_fbmenu[$curpage][0] == 2.4 && (!is_logged() || is_confirmed()) || $mx_fbmenu[$curpage][0] == 2.5 && (!is_confirmed() || is_setup()) || $mx_fbmenu[$curpage][0] >= 3 && !is_setup() || $mx_fbmenu[$curpage][0] == 10 && !(is_setup() && is_artist()) || $mx_fbmenu[$curpage][0] == 11 && !(is_setup() && is_artist() && is_pageadmin()) || $mx_fbmenu[$curpage][0] < 0 || $mx_fbmenu[$curpage][0] == 127 && !is_admin() || $mx_fbmenu[$curpage][0] == 126 && !is_pseudoadmin())) {
        //error_log(print_r($mx_fbmenu[$curpage][0],true));
        return;
    }
    switch ($menutype) {
        case MXMENUVERTUSER:
            // user vertical menu
            $style = 'usermenu menusep';
            break;
        case MXMENUHORIZTOP:
            // topbar horizontal menu
            $style = 'ctxmenu';
            break;
        case MXMENUHORIZBOT:
            // bottom screen menu
            $style = 'musxmenu';
            break;
        case MXMENUHORIZICON:
            // topbar icon menu
            $style = 'iconmenu';
            break;
        case MXMENUHORIZHELP:
            // help menu
            $style = 'helpmenu';
            break;
        case MXMENUVERTMAIN:
            // main vertical menu
            $style = 'mainmenu menusep';
            break;
        case MXMENUHORIZFB:
            // facebook menu
            $style = 'fbmenu';
            break;
        case MXMENUVERTICON:
            // big icons menu
            $style = 'bigmenu';
            break;
    }
    echo '<div class=\'' . $style . '\'>';
    echo '<ul>';
    if ($mxuser->id && ($menutype == MXMENUVERTUSER || $menutype == MXMENUVERTMAIN)) {
        echo '<li class="menutitle">' . ($menutype == MXMENUVERTMAIN ? '' : strtoupper(mx_pagename($curpage))) . '</li>';
    }
    foreach ($menu as $menuopt => $menutable) {
        /*if (abs($menutable[0])>1 && !is_confirmed()
        		&& $menuopt!='signoff'
        		//&& $menuopt!='messages'
        		&& $menuopt!='help'
        		//&& $menuopt!='friends'
        		&& $menuopt!='setup') continue;*/
        if (array_key_exists(2, $menutable) && !is_array($menutable[2]) && $menutable[2] != '#') {
            // redirection
            $page = $menutable[2];
            $option = $menutable[3] != '' ? $menutable[3] : '';
        } else {
            if (array_key_exists(2, $menutable) && $menutable[2] == '#') {
                // javascript (feedback)
                $page = '#';
                $option = '';
            } else {
                if ($menutype == 1 || $menutype == 0 || $menutype == 7) {
                    // top or user menu
                    $page = $curpage;
                    $option = $menuopt;
                } else {
                    if ($menutype == 4) {
                        // help menu
                        if ($mx_ctxmenu['help'][2][$curpage][3] == '') {
                            $page = 'help';
                            $option = $curpage;
                        } else {
                            $page = 'help';
                            $option = $mx_ctxmenu['help'][2][$curpage][3];
                        }
                    } else {
                        $page = $menuopt;
                        $option = '';
                    }
                }
            }
        }
        if (($menutype != 4 || $curpage != $menuopt) && (!$menutable[0] || $menutable[0] == 1 && !is_logged() || $menutable[0] == 1.5 && !is_logged() || $menutable[0] == 2 && is_logged() || $menutable[0] == 2.4 && is_logged() && !is_confirmed() || $menutable[0] == 2.5 && is_confirmed() && !is_setup() || $menutable[0] == 3 && is_setup() || $menutable[0] == 10 && is_setup() && is_artist() || $menutable[0] == 11 && is_setup() && is_artist() && is_pageadmin() || $menutable[0] == 20 && is_privileged() || $menutable[0] == 127 && is_admin() || $menutable[0] == 126 && is_pseudoadmin())) {
            if ($menutype == 3) {
                // icon menu
                $label = mx_icon($menuopt, $menutable[1], '20px');
                if ($menuopt == 'messages' && $mxuser->newmsgs > 0) {
                    $label .= '<div class="newmsgs"><div>' . $mxuser->newmsgs . '</div></div>';
                }
                if ($menuopt == 'cart' && $mxuser->cart && $mxuser->cart->items > 0) {
                    $label .= '<div class="cartitems"><div>' . $mxuser->cart->items . '</div></div>';
                }
            } else {
                if ($menutype == 7) {
                    // big menu
                    $label = mx_icon($menuopt . '-big', $menutable[1], '112px');
                    if ($menuopt == 'messages' && $mxuser->newmsgs > 0) {
                        $label .= '<div class="newmsgs"><div>' . $mxuser->newmsgs . '</div></div>';
                    }
                    if ($menuopt == 'cart' && $mxuser->cart && $mxuser->cart->items > 0) {
                        $label .= '<div class="cartitems"><div>' . $mxuser->cart->items . '</div></div>';
                    }
                } else {
                    if ($menutype == 0 || $menutype == 5 || $menutype == 6) {
                        // vertical menus
                        if ($menutype != 6 && file_exists(mx_iconfile($menuopt . 'btn'))) {
                            $label = '<span class="menubutton"><div>' . mx_icon($menuopt . 'btn', $menutable[1], '', 'xx', $menuopt . 'btnhover') . '</div></span>';
                        } else {
                            if (file_exists(mx_iconfile($menuopt))) {
                                $label = '<span class="menuicon">' . mx_icon($menuopt, $menutable[1], '16px') . '</span>';
                            } else {
                                $label = '<span class="menuicon">' . mx_icon('blank', '', '16px') . '</span>';
                            }
                            if ($menuopt == 'messages' && $mxuser->newmsgs > 0) {
                                $label .= '<div class="newmsgs2"><div>' . $mxuser->newmsgs . '</div></div>';
                            }
                            if ($menuopt == 'cart' && $mxuser->cart && $mxuser->cart->items > 0) {
                                $label .= '<div class="cartitems2"><div>' . $mxuser->cart->items . '</div></div>';
                            }
                            $label .= '<span class="menulabel">' . $menutable[1] . '</span>';
                        }
                        //$label.=$menutable[1];
                    } else {
                        $label = $menutable[1];
                    }
                }
            }
            echo '<li';
            if ($menutype != 6 && file_exists(mx_iconfile($menuopt . 'btn'))) {
                echo ' class="button"';
            } else {
                if ($curpage == $menuopt || $curopt == $menuopt) {
                    echo ' class="selected"';
                } else {
                    if (!function_exists('mx_mn' . $menuopt)) {
                        echo ' class="inactive"';
                    }
                }
            }
            echo '>';
            if ($page == "#") {
                echo '<a href="#" onclick="' . $menutable[3] . '"' . ' alt="' . $menutable[1] . '">' . $label . '</a>';
            } else {
                if (function_exists('mx_mn' . $menuopt)) {
                    echo '<a href="' . mx_optionurl($page, $option) . '">' . $label . '</a>' . ($menutable[4] ? '<div class="newmenu">' . mx_icon('new', _('New'), '16px') . '</div>' : '');
                } else {
                    echo '<span class="inactive">' . $label . ' ' . _('(soon)') . '</span>';
                }
            }
            echo '</li>';
        }
    }
    echo '</ul></div>';
}