break; case "exportMenu": $msg = exportMenu($cid[0], $option); $mainframe->redirect("index2.php?task=showmodules&option={$option}&limit={$limit}&limitstart={$limitstart}", $msg); break; case "imagesave": saveImages($cid[0], $option); break; case "manualsave": saveCSS($cid[0], $option); break; case "editDhtmlMenu": editDhtmlMenu($cid[0], $option); break; case "editCSS": editCSS($cid[0], $option); break; case "remove": if (is_array($cid) && count($cid) > 1) { foreach ($cid as $delid) { removeMyMenu($delid, $option); } } else { $delid = $cid[0]; removeMyMenu($delid, $option); } break; default: showModules($option); break; }
function saveCSS() { $absolute_path = JPATH_ROOT; $css = JRequest::getVar('filecontent', ""); $css = str_replace('\\', '', $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 fwrite($handle, $css); // Don't forget to increment the counter fclose($handle); // Done //echo $css; $msg = _SW_SAVE_CSS_MESSAGE; sleep(3); echo "<dl id=\"system-message\"><dt class=\"message\">Message</dt>\n\t\t<dd class=\"message message fade\"><ul><li>" . $msg . "</li>\n\t </ul></dd></dl>\n"; editCSS(); }
function saveCSS($id, $option) { global $mainframe; $absolute_path = JPATH_ROOT; $returntask = JRequest::getVar('returntask', "showmodules"); $css = JRequest::getVar('filecontent', ""); $id = JRequest::getVar('id', 0); $css = str_replace('\\', '', $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 fwrite($handle, $css); // Don't forget to increment the counter fclose($handle); // Done //echo $css; $msg = _SW_SAVE_CSS_MESSAGE; if ($returntask == "editCSS") { sleep(3); echo "<dl id=\"system-message\"><dt class=\"message\">Message</dt>\r\r\n\t\t<dd class=\"message message fade\"><ul><li>" . $msg . "</li>\r\r\n\t </ul></dd></dl>\n"; editCSS($id, $option); } else { $mainframe->redirect("index2.php?option={$option}", $msg); } }