function doGosuMenuPreview($ordered, $swmenufree) { echo '<script type="text/javascript" src="../modules/mod_swmenufree/DropDownMenuX_Packed.js"></script>'; if ($swmenufree['preview'] == "CSS") { $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 (substr(swmenuGetBrowserFree(), 0, 5) != "MSIE6" && $swmenufree['padding_hack']) { $swmenufree = fixPaddingFree($swmenufree); } echo "\n<style type='text/css'>\n"; echo "<!--\n"; echo gosuMenuStyleFree($swmenufree); echo "\n-->\n"; echo "</style>\n"; } // echo "</head><body>"; echo GosuMenuFree($ordered, $swmenufree); echo changeBgColor(); // echo "</body></html>"; }
function doGosuMenuFree($ordered, $swmenufree) { $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/DropDownMenuX.js\"></script>\n"; $doc =& JFactory::getDocument(); $doc->addCustomTag($headtag); if (!$swmenufree['cssload']) { if (substr(swmenuGetBrowserFree(), 0, 5) != "MSIE6" && $swmenufree['padding_hack']) { $swmenufree = fixPaddingFree($swmenufree); } $str .= "\n<style type='text/css'>\n"; $str .= "<!--\n"; $str .= gosuMenuStyleFree($swmenufree); $str .= "\n-->\n"; $str .= "</style>\n"; $doc =& JFactory::getDocument(); $doc->addCustomTag($str); } $str = GosuMenuFree($ordered, $swmenufree); return $str; }
function exportMenu() { $absolute_path = JPATH_ROOT; $database =& JFactory::getDBO(); include $absolute_path . "/modules/mod_swmenufree/styles.php"; $css = ""; $sql = "SELECT * FROM #__swmenufree_styles where id=1"; $database->setQuery($sql); $swmenufree_obj = $database->loadObject(); $params = sw_stringToObject($swmenufree_obj->params); //$row2=array(); while (list($key, $val) = each($params)) { $swmenufree[$key] = $val; } switch ($swmenufree['menustyle']) { case "mygosumenu": $css = gosuMenuStyleFree($swmenufree); break; case "superfishmenu": $css = superfishMenuStyleFree($swmenufree); break; case "transmenu": $css = transMenuStyleFree($swmenufree); 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; }