function editCSS() { $absolute_path = JPATH_ROOT; $file = $absolute_path . '/modules/mod_swmenufree/styles/menu.css'; $fp = fopen($file, 'r'); if ($fp) { $content = fread($fp, filesize($file)); //$content = htmlspecialchars( $content ); $database =& JFactory::getDBO(); $sql = "SELECT title FROM #__modules where module='mod_swmenufree' and published > -1"; $database->setQuery($sql); $title = $database->loadResult(); HTML_swmenufree::editCSS($content, $title); HTML_swmenufree::footer(); } }
function editCSS($id, $option) { global $mainframe; $absolute_path = JPATH_ROOT; if (!$id) { $id = intval(JRequest::getVar('id', 0)); } $file = $absolute_path . '/modules/mod_swmenufree/styles/menu.css'; if ($fp = fopen($file, 'r')) { $content = fread($fp, filesize($file)); //$content = htmlspecialchars( $content ); $database =& JFactory::getDBO(); $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->source = @$params->menutype ? $params->menutype : 'mainmenu'; $menu->name = $row->title; HTML_swmenufree::editCSS($id, $content, $menu); HTML_swmenufree::footer(); } else { $mainframe->redirect('index2.php?option=' . $option . '&client=' . $client, 'Operation Failed: Could not open' . $file); } }