Exemplo n.º 1
0
function doTigraMenu($ordered, $swmenufree, $active_menu, $css_load, $selectbox_hack, $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 = "";
    $headtag = "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenufree/menu_Packed.js\"></script>\n";
    if ($overlay_hack) {
        $headtag .= "<script type=\"text/javascript\" src=\"" . $live_site . "/modules/mod_swmenufree/jquery-1.2.6.pack.js\"></script>\n";
    }
    $doc =& JFactory::getDocument();
    $doc->addCustomTag($headtag);
    if (!$css_load) {
        $str .= "\n<style type='text/css'>\n";
        $str .= "<!--\n";
        $str .= tigraMenuStyle($swmenufree);
        $str .= "\n-->\n";
        $str .= "</style>\n";
        $doc =& JFactory::getDocument();
        $doc->addCustomTag($str);
    }
    $str = TigraMenu($ordered, $swmenufree, $active_menu, $overlay_hack);
    return $str;
}
Exemplo n.º 2
0
function doTigraMenuPreview($ordered, $swmenufree, $active_menu, $css_load, $selectbox_hack)
{
    $live_site = JURI::base();
    echo previewHead();
    echo '<script type="text/javascript" src="../modules/mod_swmenufree/menu_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='" . $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 tigraMenuStyle($swmenufree);
            echo "\n-->\n";
            echo "</style>\n";
        }
    }
    echo "</head><body>";
    echo TigraMenu($ordered, $swmenufree, $active_menu, $overlay_hack = 1);
    echo changeBgColor();
    echo "</body></html>";
}
Exemplo n.º 3
0
function exportMenu($id, $option)
{
    global $my, $mainframe, $dbprefix;
    global $lang, $offset, $db;
    $absolute_path = JPATH_ROOT;
    $database =& JFactory::getDBO();
    include $absolute_path . "/modules/mod_swmenufree/styles.php";
    $css = "";
    $query = "SELECT * FROM #__swmenufree_config WHERE id = '1'";
    $database->setQuery($query);
    $result = $database->loadObjectList();
    $swmenufree = array();
    while (list($key, $val) = each($result[0])) {
        $swmenufree[$key] = $val;
    }
    $row =& JTable::getInstance('module');
    // load the row from the db table
    $row->load($id);
    $registry = new JRegistry();
    $registry->loadINI($row->params);
    $params = $registry->toObject();
    $menu = @$params->menutype ? $params->menutype : 'mainmenu';
    $menustyle = @$params->menustyle;
    $hybrid = @$params->hybrid ? $params->hybrid : 0;
    $css_load = @$params->cssload ? $params->cssload : 0;
    $use_table = @$params->tables ? $params->tables : 0;
    $levels = @$params->levels ? $params->levels : 25;
    $show_shadow = @$params->show_shadow ? $params->show_shadow : 0;
    $sub_indicator = @$params->sub_indicator ? $params->sub_indicator : 0;
    $moduleID = @$params->moduleID;
    $parent_id = @$params->parentid ? $params->parentid : '0';
    $modulename = $row->title;
    //echo $menustyle;
    switch ($menustyle) {
        case "mygosumenu":
            $css = gosuMenuStyle($swmenufree);
            break;
        case "superfishmenu":
            $css = superfishMenuStyle($swmenufree, $sub_indicator);
            break;
        case "tigramenu":
            $css = tigraMenuStyle($swmenufree);
            break;
        case "transmenu":
            $css = transMenuStyle($swmenufree, $show_shadow);
            break;
    }
    //echo "css:".$css;
    $file = $absolute_path . "/modules/mod_swmenufree/styles/menu.css";
    if (!file_exists($file)) {
        touch($file);
        $handle = fopen($file, 'w');
        // Let's open for read and write
    } else {
        $handle = fopen($file, 'w');
        // Let's open for read and write
    }
    rewind($handle);
    // Go back to the beginning
    if (fwrite($handle, $css)) {
        $msg = _SW_SAVE_MENU_CSS_MESSAGE;
    } else {
        $msg = _SW_NO_SAVE_MENU_CSS_MESSAGE;
    }
    // Don't forget to increment the counter
    fclose($handle);
    // Done
    return $msg;
}