Exemplo n.º 1
0
function doClickTransMenu($ordered, $swmenupro, $css_load, $active_menu, $expand, $padding_hack)
{
    $live_site = JURI::base();
    if (substr($live_site, strlen($live_site) - 1, 1) == "/") {
        $live_site = substr($live_site, 0, strlen($live_site) - 1);
    }
    $str = "";
    if (!defined('_trans_defined')) {
        $headtag = "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenupro/transmenu_Packed.js\"></script>\n";
        $GLOBALS['mainframe']->addCustomHeadTag($headtag);
        define('_trans_defined', 1);
    }
    if (!defined('_click_defined')) {
        $headtag = "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenupro/ClickShowHideMenu_Packed.js\"></script>\n";
        $GLOBALS['mainframe']->addCustomHeadTag($headtag);
        define('_click_defined', 1);
    }
    if (!$css_load) {
        if (substr(swmenuGetBrowser(), 0, 5) != "MSIE6" && $padding_hack) {
            $swmenupro = fixPadding($swmenupro);
        }
        $str .= "\n<style type='text/css'>\n";
        $str .= "<!--\n";
        $str .= ClickTransMenuStyle($swmenupro, $ordered);
        $str .= "\n-->\n";
        $str .= "</style>\n";
        $GLOBALS['mainframe']->addCustomHeadTag($str);
    }
    $str = ClickTransMenu($ordered, $swmenupro, $active_menu, $expand);
    return $str;
}
Exemplo n.º 2
0
function doTransMenuPreview($ordered, $swmenufree, $active_menu, $sub_indicator, $parent_id, $css_load, $selectbox_hack, $show_shadow, $auto_position, $padding_hack, $overlay_hack = 0)
{
    global $mosConfig_live_site;
    echo previewHead();
    echo '<script type="text/javascript" src="../modules/mod_swmenufree/transmenu_Packed.js"></script>';
    $manual = JRequest::getVar("preview", 0);
    if ($manual == 1) {
        $css = JRequest::getVar("filecontent", '');
        echo "\n<style type='text/css'>\n";
        echo "<!--\n";
        echo str_replace('\\', '', $css);
        echo "\n-->\n";
        echo "</style>\n";
    } else {
        if ($css_load) {
            echo "<link type='text/css' href='" . $mosConfig_live_site . "/modules/mod_swmenufree/styles/menu.css' rel='stylesheet' />\n";
        } else {
            if (substr(swmenuGetBrowser(), 0, 5) != "MSIE6" && $padding_hack) {
                $swmenufree = fixPadding($swmenufree);
            }
            echo "\n<style type='text/css'>\n";
            echo "<!--\n";
            echo transMenuStyle($swmenufree, $show_shadow);
            echo "\n-->\n";
            echo "</style>\n";
        }
    }
    echo "</head><body>";
    echo transMenu($ordered, $swmenufree, $active_menu, $sub_indicator, $parent_id, $selectbox_hack, $auto_position, $overlay_hack = 0);
    echo changeBgColor();
    echo "</body></html>";
}
Exemplo n.º 3
0
function TigraMenu($ordered, $swmenufree, $active_menu, $overlay_hack)
{
    global $absolute_path, $live_site;
    $topcounter = 0;
    $counter = 0;
    $doMenu = 1;
    $uniqueID = $swmenufree['id'];
    $number = count($ordered);
    $mymenu_content = "\n<script type=\"text/javascript\">\n";
    $mymenu_content .= "<!--\n";
    $mymenu_content .= "var MENU_ITEMS = [";
    if ($swmenufree['orientation'] == "vertical") {
        $swmenufree['level1_sub_left'] = $swmenufree['level1_sub_left'] + $swmenufree['main_width'];
        $swmenufree['level2_sub_left'] = $swmenufree['level2_sub_left'] + $swmenufree['sub_width'];
    } else {
        $swmenufree['level1_sub_top'] = $swmenufree['level1_sub_top'] + $swmenufree['main_height'];
        $swmenufree['level2_sub_left'] = $swmenufree['level2_sub_left'] + $swmenufree['sub_width'];
    }
    while ($doMenu) {
        //$ordered[$counter]['TITLE']=str_replace("'","",$ordered[$counter]['TITLE']);
        if ($ordered[$counter]['indent'] == 0) {
            //$ordered[$counter]['URL'] = str_replace( '&', '&amp;', $ordered[$counter]['URL'] );
            $hasSub = 0;
            $topcounter++;
            $name = "'" . addslashes($ordered[$counter]['TITLE']) . "',";
            //if ($ordered[$counter]['URL']!="seperator"){
            if ($ordered[$counter]['ID'] == $active_menu) {
                $name = "'<sw_active>" . addslashes($ordered[$counter]['TITLE']) . "',";
            }
            $name .= "'" . $ordered[$counter]['URL'] . "',";
            switch ($ordered[$counter]['TARGET']) {
                // cases are slightly different
                case 1:
                    // open in a new window
                    $name .= "{ 'tw' : '_blank' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "'}";
                    break;
                case 2:
                    // open in a popup window
                    $name .= "{ 'tw' : '_blank' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "', 'tl' : '1'}";
                    break;
                case 3:
                    // don't link it
                    $name .= "{ 'tw' : '_self' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "'}";
                    break;
                default:
                    // formerly case 2
                    // open in parent window
                    $name .= "{ 'tw' : '_self' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "'}";
                    break;
            }
            if ($counter + 1 == $number) {
                $mymenu_content .= "\n  [" . $name . "],";
                $doSubMenu = 0;
                $doMenu = 0;
            } elseif ($ordered[$counter + 1]['indent'] == 0) {
                $mymenu_content .= "\n  [" . $name . "],";
                $doSubMenu = 0;
            } else {
                $mymenu_content .= "\n  [" . $name . ",";
                $doSubMenu = 1;
            }
            $counter++;
            while ($doSubMenu) {
                if ($ordered[$counter]['indent'] != 0) {
                    //$ordered[$counter]['URL'] = str_replace( '&', '&amp;', $ordered[$counter]['URL'] );
                    $name = addslashes($ordered[$counter]['TITLE']) . "',";
                    $name .= "'" . $ordered[$counter]['URL'] . "',";
                    switch ($ordered[$counter]['TARGET']) {
                        // cases are slightly different
                        case 1:
                            // open in a new window
                            $name .= "{ 'tw' : '_blank' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "'}";
                            break;
                        case 2:
                            // open in a popup window
                            $name .= "{ 'tw' : '_blank' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "', 'tl' : '1'}";
                            break;
                        case 3:
                            // don't link it
                            $name .= "{ 'tw' : '_self' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "'}";
                            break;
                        default:
                            // formerly case 2
                            // open in parent window
                            $name .= "{ 'tw' : '_self' , 'sb' : '" . addslashes($ordered[$counter]['TITLE']) . "'}";
                            break;
                    }
                    if ($counter + 1 == $number) {
                        $mymenu_content .= "\n  ['" . $name . str_repeat('],', $ordered[$counter]['indent'] + 1);
                        //  $mymenu_content.=")\n";
                        $doSubMenu = 0;
                        $doMenu = 0;
                    } elseif ($ordered[$counter]['indent'] < $ordered[$counter + 1]['indent']) {
                        $mymenu_content .= "\n  ['" . $name . ",";
                        if ($ordered[$counter + 1]['indent'] == 0) {
                            $doSubMenu = 0;
                        }
                    } elseif ($ordered[$counter]['indent'] == $ordered[$counter + 1]['indent']) {
                        $mymenu_content .= "\n  ['" . $name . "],";
                        if ($ordered[$counter + 1]['indent'] == 0) {
                            $doSubMenu = 0;
                        }
                    } elseif ($ordered[$counter]['indent'] > $ordered[$counter + 1]['indent']) {
                        $mymenu_content .= "\n  ['" . $name . str_repeat('],', $ordered[$counter]['indent'] - $ordered[$counter + 1]['indent'] + 1);
                        //$mymenu_content.="]),\n";
                        if ($ordered[$counter + 1]['indent'] == 0) {
                            $doSubMenu = 0;
                        }
                    }
                    $counter++;
                    $hasSub++;
                }
            }
        }
    }
    $mymenu_content .= "\n ];";
    $mymenu_content .= "\n -->";
    $mymenu_content .= "\n </SCRIPT> \n";
    //echo $mymenu_content;
    $mymenu_content .= "<script type=\"text/javaScript\">\n";
    $mymenu_content .= "<!-- \n";
    $mymenu_content .= "var MENU_POS = [\n";
    $mymenu_content .= "{\n";
    // item sizes
    $mymenu_content .= "'height':";
    if (substr(swmenuGetBrowser(), 0, 5) == "MSIE6") {
        $border1 = explode(" ", $swmenufree['main_border']);
        $offset = rtrim(trim($border1[0]), 'px');
    } else {
        $offset = 0;
    }
    $mymenu_content .= $swmenufree['main_height'] + $offset;
    $mymenu_content .= ",\n";
    $mymenu_content .= "'width':" . ($swmenufree['main_width'] + $offset);
    $mymenu_content .= ",\n";
    $mymenu_content .= "'block_top': " . $swmenufree['main_top'] . ",\n";
    $mymenu_content .= "'block_left': " . $swmenufree['main_left'] . ",\n";
    $mymenu_content .= "'top':";
    if ($swmenufree['orientation'] == "vertical") {
        if (substr(swmenuGetBrowser(), 0, 5) != "MSIE6") {
            $border1 = explode(" ", $swmenufree['main_border']);
            $offset3 = rtrim(trim($border1[0]), 'px');
        } else {
            $offset3 = 0;
        }
        $mymenu_content .= $swmenufree['main_height'] + $offset3;
    } else {
        $mymenu_content .= "0";
    }
    $mymenu_content .= ",\n";
    $mymenu_content .= "'left':";
    if ($swmenufree['orientation'] == "vertical") {
        $mymenu_content .= "0";
    } else {
        $mymenu_content .= $swmenufree['main_width'];
    }
    $mymenu_content .= ",\n";
    $mymenu_content .= "'hide_delay':" . $swmenufree['specialB'] . ",\n";
    $mymenu_content .= "'expd_delay': " . $swmenufree['specialB'] . ",\n";
    $mymenu_content .= "'css' : {\n";
    $mymenu_content .= "'outer': ['m0l0oout', 'm0l0oover'],\n";
    $mymenu_content .= "'inner': ['m0l0iout', 'm0l0iover']\n";
    $mymenu_content .= "}\n";
    $mymenu_content .= "}, \n";
    $mymenu_content .= "{\n";
    $mymenu_content .= "'height': ";
    if (substr(swmenuGetBrowser(), 0, 5) == "MSIE6") {
        $border2 = explode(" ", $swmenufree['sub_border']);
        $offset2 = rtrim(trim($border2[0]), 'px');
    } else {
        $offset2 = 0;
    }
    $mymenu_content .= $swmenufree['sub_height'] + $offset2;
    $mymenu_content .= ",\n";
    $mymenu_content .= "'width':" . ($swmenufree['sub_width'] + $offset2);
    $mymenu_content .= ",\n";
    $mymenu_content .= "'block_top': " . $swmenufree['level1_sub_top'] . " ,\n";
    $mymenu_content .= "'block_left':" . $swmenufree['level1_sub_left'] . ",\n";
    $mymenu_content .= "'top': ";
    if (substr(swmenuGetBrowser(), 0, 5) != "MSIE6") {
        $border1 = explode(" ", $swmenufree['sub_border']);
        $offset3 = rtrim(trim($border1[0]), 'px');
    } else {
        $offset3 = 0;
    }
    $mymenu_content .= $swmenufree['sub_height'] + $offset3;
    $mymenu_content .= ",\n";
    $mymenu_content .= "'left': 0, \n";
    $mymenu_content .= "'css': {\n";
    $mymenu_content .= "'outer' : ['m0l1oout', 'm0l1oover'],\n";
    $mymenu_content .= "'inner' : ['m0l1iout', 'm0l1iover'] \n";
    $mymenu_content .= "}\n";
    $mymenu_content .= "}, \n";
    $mymenu_content .= "{\n";
    $mymenu_content .= "'block_top': " . $swmenufree['level2_sub_top'] . ",\n";
    $mymenu_content .= "'block_left':" . $swmenufree['level2_sub_left'] . ",\n";
    $mymenu_content .= "'css': {\n";
    $mymenu_content .= "'outer' : ['m0l1oout', 'm0l1oover'],\n";
    $mymenu_content .= "'inner' : ['m0l1iout', 'm0l1iover'] \n";
    $mymenu_content .= "} \n";
    $mymenu_content .= "} \n";
    $mymenu_content .= "] \n";
    $mymenu_content .= "--> \n";
    $mymenu_content .= "</script> \n";
    if (substr(swmenuGetBrowser(), 0, 5) != "MSIE6") {
        $border1 = explode(" ", $swmenufree['main_border']);
        $offset3 = rtrim(trim($border1[0]), 'px');
        $swmenufree['main_height'] = $swmenufree['main_height'] + $offset3;
        //$swmenufree['main_width'] = $swmenufree['main_width'] + $offset3;
    }
    $mymenu_content .= "<div id=\"sw-wrap\" style=\"position:" . $swmenufree['position'] . ";z-index:1; top:0px; left:0px; width:";
    if ($swmenufree['orientation'] == "vertical") {
        $mymenu_content .= $swmenufree['main_width'] . "px; height:" . $swmenufree['main_height'] * $topcounter . "px \" >";
    } else {
        $mymenu_content .= $swmenufree['main_width'] * $topcounter . "px; height:" . $swmenufree['main_height'] . "px \">";
    }
    $mymenu_content .= "\n<script type=\"text/javaScript\">\n";
    $mymenu_content .= "<!--\n";
    $mymenu_content .= "new menu(MENU_ITEMS, MENU_POS);\n";
    $mymenu_content .= "--> \n";
    $mymenu_content .= "</script>\n";
    $mymenu_content .= "</div>\n";
    if ($overlay_hack) {
        $mymenu_content .= "<script type=\"text/javascript\">\n";
        $mymenu_content .= "<!--\n";
        $mymenu_content .= "jQuery.noConflict();\n";
        //$str.="alert($.topZIndex());\n";
        $mymenu_content .= "jQuery(document).ready(function(\$){\n";
        //$str.="alert($.topZIndex());\n";
        //  $str.="$('#left_container').topZIndex();\n";
        //  $str.="$('#sw-wrap').parents().css('position','static');\n";
        $mymenu_content .= "\$('#sw-wrap').parents().css('overflow','visible');\n";
        $mymenu_content .= "\$('html').css('overflow','auto');\n";
        $mymenu_content .= "\$('#sw-wrap').parents().css('z-index','100');\n";
        $mymenu_content .= "\$('#sw-wrap').css('z-index','101');\n";
        $mymenu_content .= "});\n";
        $mymenu_content .= "//--> \n";
        $mymenu_content .= "</script>  \n";
    }
    return $mymenu_content;
}
Exemplo n.º 4
0
function doSuperfishMenu($ordered, $swmenufree, $active_menu, $css_load, $selectbox_hack, $padding_hack, $sub_active, $show_shadow, $sub_indicator, $overlay_hack)
{
    $live_site = JURI::base();
    if (substr($live_site, strlen($live_site) - 1, 1) == "/") {
        $live_site = substr($live_site, 0, strlen($live_site) - 1);
    }
    $str = "";
    //$show_shadow=1;
    if (!$css_load) {
        if (substr(swmenuGetBrowser(), 0, 5) != "MSIE6" && $padding_hack) {
            $swmenufree = fixPadding($swmenufree);
        }
        $str .= "\n<style type='text/css'>\n";
        $str .= "<!--\n";
        $str .= superfishMenuStyle($swmenufree, $sub_indicator);
        $str .= "\n-->\n";
        $str .= "</style>\n";
        $doc =& JFactory::getDocument();
        $doc->addCustomTag($str);
    }
    $headtag = "";
    $headtag .= "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenufree/jquery-1.2.6.pack.js\"></script>\n";
    //$headtag.= "<script type=\"text/javascript\" src=\"".$live_site."/modules/mod_swmenufree/jquery.topzindex.min.js\"></script>\n";
    $headtag .= "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenufree/hoverIntent.js\"></script>\n";
    $headtag .= "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenufree/superfish.js\"></script>\n";
    $headtag .= "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenufree/supersubs.js\"></script>\n";
    //if (!defined( '_swshadow_defined' )&&$show_shadow){
    //$headtag.= "<script type=\"text/javascript\" src=\"".$live_site."/modules/mod_swmenupro/jquery.dropshadow.js\"></script>\n";
    //$headtag.= "<script type=\"text/javascript\" src=\"".$live_site."/modules/mod_swmenupro/shadedborder.js\"></script>\n";
    //define( '_swshadow_defined', 1 );
    //}
    $doc =& JFactory::getDocument();
    $doc->addCustomTag($headtag);
    $str = SuperfishMenu($ordered, $swmenufree, $active_menu, $selectbox_hack, $sub_active, $show_shadow, $sub_indicator, $overlay_hack);
    return $str;
}