function exportMenu($id, $option) { global $my, $mainframe, $dbprefix; global $lang, $offset, $db; $absolute_path = JPATH_ROOT; $database =& JFactory::getDBO(); include $absolute_path . "/modules/mod_swmenupro/styles.php"; $css = ""; $database->setQuery("SELECT * FROM #__swmenu_config WHERE id='" . $id . "'"); $result = $database->loadObjectList(); $swmenupro = array(); while (list($key, $val) = each($result[0])) { $swmenupro[$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; $moduleID = @$params->moduleID; $parent_id = @$params->parentid ? $params->parentid : '0'; $modulename = $row->title; $swmenupro_array = array(); $swmenupro_array = swGetMenuLinks2($menu, $row->id, $hybrid, $use_table); if (count($swmenupro_array)) { $ordered = chain2('ID', 'PARENT', 'ORDER', $swmenupro_array, 0, 25); } switch ($menustyle) { case "popoutmenu": $css = TigraMenuStyle($swmenupro, $ordered); break; case "clickmenu": $css = ClickMenuStyle($swmenupro, $ordered); break; case "treemenu": $css = TreeMenuStyle($swmenupro, $ordered); break; case "gosumenu": $css = gosuMenuStyle($swmenupro, $ordered); break; case "transmenu": $css = transMenuStyle($swmenupro, $ordered, $show_shadow); break; case "clicktransmenu": $css = clickTransMenuStyle($swmenupro, $ordered); break; case "tabmenu": $css = cssTabMenuStyle($swmenupro, $ordered); break; case "slideclick": $css = SlideClickStyle($swmenupro, $ordered); break; case "dynamictabmenu": $css = dynamicTabMenuStyle($swmenupro, $ordered); break; } $file = $absolute_path . "/modules/mod_swmenupro/styles/menu" . $id . ".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; $limit = intval(JRequest::getVar('limit', 10)); $limitstart = intval(JRequest::getVar('limitstart', 0)); // mosRedirect( "index2.php?task=showmodules&option=$option&limit=$limit&limitstart=$limitstart",$msg ); }
function doTabMenu($ordered, $swmenupro, $parent_id, $css_load, $active_menu) { $str = ""; if (!$css_load) { $str .= "\n<style type='text/css'>\n"; $str .= "<!--\n"; $str .= cssTabMenuStyle($swmenupro, $ordered); $str .= "\n-->\n"; $str .= "</style>\n"; $GLOBALS['mainframe']->addCustomHeadTag($str); } $str = TabMenu($ordered, $swmenupro, $parent_id, $active_menu); return $str; }
function doTabMenuPreview($ordered, $swmenupro, $parent_id, $css_load, $active_menu) { echo previewHead(); //echo "<!--SWmenuPro CSS Tab Menu-->\n"; $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='../modules/mod_swmenupro/styles/menu" . $swmenupro['id'] . ".css' rel='stylesheet' />\n"; } else { echo "\n<style type='text/css'>\n"; echo "<!--\n"; echo cssTabMenuStyle($swmenupro, $ordered); echo "\n-->\n"; echo "</style>\n"; } } echo "</head><body>"; echo TabMenu($ordered, $swmenupro, $parent_id, $active_menu); echo changeBgColor(); echo "</body></html>"; }