function SERVICE_CMSCSS_mambo() { global $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix, $include_path, $thename, $bgcolor1, $bgcolor2, $css, $row_colors, $jz_MenuItem, $jz_MenuItemHover, $jz_MenuItemLeft, $jz_MainItemHover, $jz_MenuSplit; $option = trim(strtolower(mosGetParam($_REQUEST, 'option'))); $Itemid = intval(mosGetParam($_REQUEST, 'Itemid', null)); $database = new database($mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix); $mainframe = new mosMainFrame($database, $option, '.'); $mainframe->initSession(); $thename = $mainframe->getTemplate(); // Now let's set the style sheet for CMS stuff $_SESSION['cms-style'] = "templates/" . $thename . "/css/template_css.css"; $_SESSION['cms-theme-data'] = urlencode($bgcolor1 . "|" . $bgcolor2); $row_colors = array('sectiontableentry2', 'tabheading'); $jz_MenuItemHover = "tabheading"; $jz_MenuItem = "sectiontableentry2"; $jz_MenuItemLeft = "jzMenuItemLeft"; $jz_MenuSplit = "jzMenuSplit"; $jz_MainItemHover = "jzMainItemHover"; // Now let's set the CSS $css = $include_path . "style/cms-theme/default.php"; return $css; }
<?php } if ($return) { mosRedirect($return); } else { mosRedirect('index.php'); } } } /** get the information about the current user from the sessions table */ $my = $mainframe->getUser(); /** detect first visit */ $mainframe->detect(); $gid = intval($my->gid); // gets template for page $cur_template = $mainframe->getTemplate(); /** temp fix - this feature is currently disabled */ /** @global A places to store information from processing of the component */ $_MOS_OPTION = array(); // precapture the output of the component require_once $mosConfig_absolute_path . '/editor/editor.php'; ob_start(); if ($path = $mainframe->getPath('front')) { $task = mosGetParam($_REQUEST, 'task', ''); $ret = mosMenuCheck($Itemid, $option, $task, $gid); if ($ret) { require_once $path; } else { mosNotAuth(); } } else {
require $path; } exit; } initGzip(); echo "<?xml version=\"1.0\"?>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo $mosConfig_sitename; ?> - Administration [Mambo]</title> <link rel="stylesheet" href="templates/<?php echo $mainframe->getTemplate() . (!$adminLanguage->RTLsupport ? '/css/template_css.css' : '/css/template_css_rtl.css'); ?> " type="text/css"> <!-- rtl change --> <link rel="stylesheet" href="templates/<?php echo $mainframe->getTemplate(); ?> /css/theme.css" type="text/css"> <script language="JavaScript" src="../includes/js/JSCookMenu.js" type="text/javascript"></script> <script language="JavaScript" src="includes/js/ThemeOffice/theme.js" type="text/javascript"></script> <script language="JavaScript" src="../includes/js/mambojavascript.js" type="text/javascript"></script> <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?> " /> </head> <body>
function botEditorArea($name, $content, $hiddenField, $width, $height, $col, $row) { global $my, $mosConfig_live_site, $database, $option, $_MAMBOTS, $mosConfig_absolute_path, $isInline, $bodyStyles, $template, $path_root; $gid = 20; $isInline = 0; $bodyStyles = ""; $template = ""; $content = str_replace("<", "<", $content); $content = str_replace(">", ">", $content); $content = str_replace("&", "&", $content); $content = str_replace(" ", " ", $content); $content = str_replace(""", "\"", $content); $mainframe = new mosMainFrame($database, $option, '.'); $query = "SELECT id FROM #__mambots WHERE element = 'legacy.fckeditor' AND folder = 'editors'"; $database->setQuery($query); $id = $database->loadResult(); $mambot = new mosMambot($database); $mambot->load($id); $params =& new mosParameters($mambot->params); $toolbar = $params->get('toolbar', 'Advanced'); $toolbar_ft = $params->get('toolbar_ft', 'Advanced'); $content_css = $params->get('content_css', '1'); $editor_css = $params->get('editor_css', '0'); $content_css_custom = $params->get('content_css_custom', ''); $text_direction = $params->get('text_direction', 'ltr'); $newlines = $params->get('newlines', 'false'); $skin = $params->get('skin', 'office2007'); $image_path = $params->get('imagePath', '/images/stories/'); $wwidth = $params->get('wwidth', '100%'); $hheight = $params->get('hheight', '480'); $formatSource = $params->get('FormatSource', 1); $add_stylesheet_path = $params->get('add_stylesheet_path', ''); $add_stylesheet = $params->get('add_stylesheet', ''); $bgcolor = $params->get('bgcolor', '#FFFFFF'); $fontcolor = $params->def('fontcolor', ''); $entermode = $params->def('entermode', 0); $shiftentermode = $params->def('shiftentermode', 1); $htmlentities = $params->def('htmlentities', 0); $crtlshiftentermode = $params->def('ctrlshiftentermode', 2); $includelatinentities = $params->def('includelatinentities', 0); $includegreekentities = $params->def('includegreekentities', 0); $numericentities = $params->def('numericentities', 0); $useRelativeURLPath = $params->def('UserRelativeFilePath', 1); $textAlign = $params->def('TextAlign', ''); $showerrors = $params->def('showerrors', 1); $ForceSpellCheck = $params->def('ForceSpellCheck', 0); //set default view for toolabar $toolbar = $toolbar == 'Default' ? 'Advanced' : $toolbar; $toolbar_ft = $toolbar_ft == 'Default' ? 'Advanced' : $toolbar_ft; //set flag to see if Pspell should be enabled $enablePspell = function_exists("pspell_check") ? 1 : 0; //define path_root for relative path $path_root = '../'; if (strpos($_SERVER['REQUEST_URI'], 'administrator')) { $logintime = mosGetParam($_SESSION, 'session_logintime', ''); $session_id = md5($my->id . $my->username . $my->usertype . $logintime); } else { $query = 'select s.session_id from #__session s' . ' join #__users u on u.id = s.userid ' . ' where u.id =' . $my->id . ' and s.guest = 0 and u.gid > 18 '; $database->setQuery($query); $session_id = $database->loadResult(); //set toolbar to compact mode $toolbar = $toolbar_ft; $path_root = ''; } //check to see if we have to change the install chmod settings changeFCKChmod($path_root); /* Need to check to see session recorded already created */ $ip = md5($_SERVER['REMOTE_ADDR']); $query = 'select session_id from #__session where session_id =\'' . $ip . '\''; $database->setQuery($query); $ip_recorded = $database->loadResult(); if (!isset($ip_recorded)) { $query = 'insert into #__session(username,time,session_id,gid) values(\'' . $session_id . '\',\'' . (time() + 7200) . '\',\'' . $ip . '\',0)'; } else { $query = 'update #__session set time = \'' . (time() + 7200) . '\',username = \'' . $session_id . '\' ' . 'where session_id =\'' . $ip . '\''; } $database->setQuery($query); $database->query(); $errors = ''; //Sanitize image path $image_path = preg_replace('/(^\\s*\\/|\\/\\s*$)/', '', $image_path); $xml_path = "{$mosConfig_absolute_path}/mambots/editors/fckeditor/fckstyles_template.xml"; $template = $mainframe->getTemplate(); if ($content_css || $editor_css) { if ($editor_css !== 0 & $content_css == 0) { if (is_file($mosConfig_absolute_path . '/templates/' . $template . '/css/editor_css.css')) { $content_css = 'templates/' . $template . '/css/editor_css.css'; } else { if ($my->gid > $gid) { $errors .= '<span style="color: red;">Warning: ' . $mosConfig_absolute_path . 'templates/' . $template . '/css/editor_css.css' . ' does not appear to be a valid file. Reverting to JoomlaFCK\'s default styles</span><br/>'; } //end if gid > 29 } //end if valid file } else { if (is_file($mosConfig_absolute_path . '/templates/' . $template . '/css/template_css.css')) { $content_css = 'templates/' . $template . '/css/template_css.css'; } else { if (is_file($mosConfig_absolute_path . '/templates/' . $template . '/css/template.css.php')) { $content_css = 'templates/' . $template . '/css/JFCKeditor.css.php'; if (!is_file($mosConfig_absolute_path . '/templates/' . $template . '/css/JFCKeditor.css.php') || filemtime($mosConfig_absolute_path . '/templates/' . $template . '/css/template.css.php') > filemtime($mosConfig_absolute_path . '/templates/' . $template . '/css/JFCKeditor.css.php')) { $file_content = file_get_contents('../templates/' . $template . '/css/template.css.php'); $file_content = preg_replace_callback("/(.*?)(@?ob_start\\('?\"?ob_gzhandler\"?'?\\))(.*)/", create_function('$matches', 'return ($matches[1]) .\';\';'), $file_content); $file_content = preg_replace("/(.*define\\().*DIRECTORY_SEPARATOR.*(;?)/", '', $file_content); $file_content = '<' . '?' . 'php' . ' function getYooThemeCSS() { ' . '?' . '>' . $file_content . '<' . '?' . 'php' . ' } ' . '?' . '>'; $fout = fopen($path_root . $content_css, "w"); fwrite($fout, $file_content); fclose($fout); } include $path_root . $content_css; $content_css = 'templates/' . $template . '/css/JFCKeditor.css'; ob_start(); getYooThemeCSS(); $file_content = ob_get_contents(); ob_end_clean(); $fout = fopen($path_root . $content_css, "w"); fwrite($fout, $file_content); fclose($fout); } else { if ($my->gid > $gid) { $errors .= '<span style="color: red;">Warning: ' . $mosConfig_absolute_path . 'templates/' . $template . '/css/template_css.css' . ' does not appear to be a valid file. Reverting to JoomlaFCK\'s default styles</span><br/>'; } //end if gid > 29 } } //end if valid file } //end if $editor_css !== 0 & $content_css == 0 /* Is the content_css == 0 or 1 then use FCK's default */ if ($errors != "") { $content_css = 'mambots/editors/fckeditor/editor/css/fck_editorarea.css'; $style_css = "fckstyles.xml"; } //end if /*write to xml file and read from css asnd store this file under editors*/ xml_writer($path_root . $content_css, $xml_path); $style_css = "fckstyles_template.xml"; } else { if ($content_css_custom) { $hasRoot = strpos(' ' . strtolower($content_css_custom), strtolower($mosConfig_absolute_path)); $file_path = ($hasRoot ? '' : $mosConfig_absolute_path) . ($hasRoot || substr($content_css_custom, 0, 1) == DIRECTORY_SEPARATOR ? '' : DIRECTORY_SEPARATOR) . $content_css_custom; if (is_file($file_path)) { $content_css = $file_path; $content_css = str_replace(strtolower($mosConfig_absolute_path) . DS, '', strtolower($content_css_custom)); xml_writer($path_root . $content_css, $xml_path); $style_css = "fckstyles_template.xml"; } else { if ($my->gid > $gid) { $errors .= '<span style="color: red;">Warning: ' . $mosConfig_absolute_path . '/' . $content_css_custom . ' does not appear to be a valid file.</span><br/>'; } //end if gid > $gid $content_css = 'mambots/editors/fckeditor/editor/css/fck_editorarea.css'; $style_css = "fckstyles.xml"; } //end if valid file } else { $content_css = 'mambots/editors/fckeditor/editor/css/fck_editorarea.css'; $style_css = "fckstyles.xml"; } //end if $content_css_custom } //end if $content_css || $editor_css if (strpos($width, '%') === false) { $WidthCSS = $width . 'px'; } else { $WidthCSS = $width; } if (strpos($height, '%') === false) { $HeightCSS = $height . 'px'; } else { $HeightCSS = $height; } //if additional stylesheets specified $stylesheet_name = ''; if ($add_stylesheet_path) { $hasRoot = strpos(' ' . strtolower($add_stylesheet_path), strtolower($mosConfig_absolute_path)); $add_stylesheet_path = str_replace(strtolower($mosConfig_absolute_path) . DIRECTORY_SEPARATOR, '', strtolower($add_stylesheet_path)); } else { $add_stylesheet_path = '/templates/' . $template . '/css/'; } $BaseAddCSSPath = (preg_match('/(^\\/|^\\\\)/', $add_stylesheet_path) ? '' : '/') . $add_stylesheet_path . (preg_match('/.(\\/$|\\\\$)/', $add_stylesheet_path) ? '' : '/'); $BaseAddCSSPath = str_replace('\\', '/', $BaseAddCSSPath); //echo $add_stylesheet_path; if ($add_stylesheet_path && $add_stylesheet) { if (strpos($add_stylesheet, ';')) { $stylesheets = explode(';', $add_stylesheet); } else { $stylesheets[] = $add_stylesheet; } $count = 0; foreach ($stylesheets as $stylesheet) { if (!preg_match('/\\.\\w{3}$/', $stylesheet)) { $stylesheet .= '.css'; } $fin = $path_root . substr($BaseAddCSSPath, 1, strlen($BaseAddCSSPath)) . $stylesheet; $file = $mosConfig_absolute_path . (preg_match('/(^\\/|^\\\\)/', $add_stylesheet_path) ? '' : DIRECTORY_SEPARATOR) . $add_stylesheet_path . (preg_match('/.(\\/$|\\\\$)/', $add_stylesheet_path) ? '' : DIRECTORY_SEPARATOR) . $stylesheet; $fout = $path_root . 'mambots/editors/fckeditor/' . str_replace('.css', '.xml', $stylesheet); if (is_file($file)) { xml_writer($fin, $fout); } else { if ($my->gid > $gid) { $errors .= '<span style="color: red;">Warning: ' . $file . ' does not appear to be a valid file.</span><br/>'; } //end if gid > $gid array_splice($stylesheets, $count, 1); } //end if valid file $count++; } $stylesheet_name = str_replace('.css', '', implode(';', $stylesheets)); } $results = $_MAMBOTS->trigger('onCustomEditorButton'); $buttons = array(); foreach ($results as $result) { if ($result[0]) { $buttons[] = '<img src="' . $mosConfig_live_site . '/mambots/editors-xtd/' . $result[0] . '" onclick="InsertHTML(\'' . $hiddenField . '\',\'' . $result[1] . '\')" />'; } } $buttons = implode("", $buttons); /* Lets sort out the directory issue */ $urlDetails = parse_url($mosConfig_live_site); $directory = str_replace(array($urlDetails['scheme'], $urlDetails['host'], '://'), '', $mosConfig_live_site); if ($showerrors && $my->gid > $gid) { //Version Checker if (function_exists("curl_init")) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.joomlafckeditor.com/version.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $version = curl_exec($ch); curl_close($ch); if ($version != '2.6.4.1' && $version) { $errors .= 'Please be aware there is a newer version of the JoomlaFCK Editor which can be downloaded from <a href="http://www.joomlafckeditor.com" target="_blank">http://www.joomlafckeditor.com</a>.<br/>'; } //end if } //end if /* Check to see if the path exists. */ if (!is_dir($mosConfig_absolute_path . '/' . $image_path)) { $errors .= '<span style="color: red;">Warning: ' . $mosConfig_absolute_path . $imagePath . ' does not appear to be a valid directory!</span><br/>'; } //end if if ($errors !== "") { echo $errors . '<span style="color:blue">Please note the above message will only displayed to Managers and above.</span>'; } //end if } $content_css = $mosConfig_live_site . '/' . $content_css; $content_css = str_replace('\\', '/', $content_css); // Define Enter & Shift Enter Mode $enterbehavior = array(); $enterbehavior[0] = 'br'; $enterbehavior[1] = 'p'; $enterbehavior[2] = 'div'; // Define Entities $htmlentities = $htmlentities ? 'true' : 'false'; $includelatinentities = $includelatinentities ? 'true' : 'false'; $includegreekentities = $includegreekentities ? 'true' : 'false'; $numericentities = $numericentities ? 'true' : 'false'; return <<<EOD <textarea name="{$hiddenField}" id="{$hiddenField}" cols="{$col}" rows="{$row}" style="width:{$WidthCSS}; height:{$HeightCSS};">{$content}</textarea> <script type="text/javascript"> \tvar oFCKeditor{$hiddenField} = new FCKeditor('{$hiddenField}'); \toFCKeditor{$hiddenField}.BasePath = "{$directory}/mambots/editors/fckeditor/" ; \toFCKeditor{$hiddenField}.Config["SitePath"] = "{$mosConfig_live_site}"; \toFCKeditor{$hiddenField}.Config["ImagePath"] = "{$image_path}"; \toFCKeditor{$hiddenField}.Config["UseRelativeURLPath"] = {$useRelativeURLPath}; \toFCKeditor{$hiddenField}.Config["CustomConfigurationsPath"] = "{$mosConfig_live_site}/mambots/editors/fckconfigjoomla.js"; \toFCKeditor{$hiddenField}.ToolbarSet = "{$toolbar}" ; \toFCKeditor{$hiddenField}.Config['BaseAddCSSPath'] = "{$BaseAddCSSPath}"; \toFCKeditor{$hiddenField}.Config['EditorAreaCSS'] = "{$content_css}"; \toFCKeditor{$hiddenField}.Config['ContentLangDirection'] = "{$text_direction}" ; \toFCKeditor{$hiddenField}.Config['SkinPath'] = oFCKeditor{$hiddenField}.BasePath + 'editor/skins/' + '{$skin}' + '/' ; \toFCKeditor{$hiddenField}.Config['StylesXmlPath']= oFCKeditor{$hiddenField}.BasePath +'{$style_css}'; \toFCKeditor{$hiddenField}.Config['FormatSource'] = {$formatSource};\t \toFCKeditor{$hiddenField}.Config['AddStylesheets'] = "{$stylesheet_name}"; \toFCKeditor{$hiddenField}.Config['BackgroundColor'] = "{$bgcolor}"; \toFCKeditor{$hiddenField}.Config['FontColor'] = "'.{$fontcolor}.'";\t \toFCKeditor{$hiddenField}.Config['EnterMode'] = "{$enterbehavior[$entermode]}"; \toFCKeditor{$hiddenField}.Config['ShiftEnterMode'] = "{$enterbehavior[$shiftentermode]}"; \toFCKeditor{$hiddenField}.Config['CrtlShiftEnterMode'] = "{$enterbehavior[$crtlshiftentermode]}"; \toFCKeditor{$hiddenField}.Config['ProcessHTMLEntities'] = {$htmlentities} ; \toFCKeditor{$hiddenField}.Config['IncludeLatinEntities'] = {$includelatinentities} ; \toFCKeditor{$hiddenField}.Config['IncludeGreekEntities'] = {$includegreekentities} ; \toFCKeditor{$hiddenField}.Config['ProcessNumericEntities'] = {$numericentities} ; \toFCKeditor{$hiddenField}.Config['Pspell'] = "{$enablePspell}"; \toFCKeditor{$hiddenField}.Config['ForceInlineStyles'] = {$isInline}; \toFCKeditor{$hiddenField}.Config['JTemplate'] = "{$template}"; \toFCKeditor{$hiddenField}.Config['BodyStyles'] = "{$bodyStyles}"; \toFCKeditor{$hiddenField}.Config['TextAlign'] = "{$textAlign}"; \toFCKeditor{$hiddenField}.Config['UseAspell'] = "{$enablePspell}"; \toFCKeditor{$hiddenField}.Width = "{$wwidth}" ; \toFCKeditor{$hiddenField}.Style_css = "{$style_css}" ; \toFCKeditor{$hiddenField}.Height = "{$hheight}" ; \t//oFCKeditor{$hiddenField}.ReplaceTextarea() ; \t \t \t \tvar forceSpellonSave = {$ForceSpellCheck}; \t \tif(forceSpellonSave) { \t \t \t\tif (!window.addEventListener) { \t\t\t window.addEventListener = function (type, listener, useCapture) { \t\t\twindow.attachEvent('on' + type, function() { listener(event) }); \t\t} \t\t} \t \t\twindow.addEventListener("load", function() { \t\t \t\tif(typeof FCKIndexOf != "function") \t\t{\t\t \t\t\t\tvar FCKIndexOf = ( Array.prototype.indexOf ) ? \t\t\t\t\t\tfunction( array, entry ) \t\t\t\t\t\t\t{ \t\t\t\t\t\t\t\treturn array.indexOf( entry ); \t\t\t\t\t\t\t} \t\t\t\t\t: \t\t\t\t\t\tfunction( array, entry ) \t\t\t\t\t\t{ \t\t\t\t\t\t\tfor ( var i = 0, len = array.length ; i < len ; i++ ) \t\t\t\t\t\t\t{ \t\t\t\t\t\t\t\tif ( array[ i ] === entry ) \t\t\t\t\t\t\t\t\treturn i; \t\t\t\t\t\t\t} \t\t\t\t\t\t\treturn -1; \t\t\t\t\t\t};\t \t\t\t \t\t\t\t\t\t \t\t\t\tfunction getElementByTitle( titles, obj ) { \t\t\t\t \t\t\t\t\tif (obj.title && FCKIndexOf(titles,obj.title) != -1 ) { \t\t\t\t\t\t return obj; \t\t\t\t\t} \t\t\t\t\tfor ( var i = 0; i < obj.childNodes.length; i++ ) \t\t\t\t\t\t{ \t\t\t\t\t\t\tvar child = getElementByTitle( titles, obj.childNodes[i] ); \t\t\t\t\t\t\tif(child) \t\t\t\t\t\t\t\treturn child; \t\t\t\t\t\t} \t\t\t\t\t \t\t\t\t}\t \t\t \t\t\t\tvar submitbuttonOrig = submitbutton; // save fuction defintion defined by component \t\t\t\t\t \t\t\t\tif(typeof submitbutton == "function") \t\t\t\t{ \t\t\t\t\t\t \t\t\t\t\tfunction submitbuttonNew(pressbutton) //overide function defintion to call spellcheck on save \t\t\t\t\t{ \t\t\t\t\t\t\t \t\t\t\t\t\tif(pressbutton == "cancel" || pressbutton == "close" || pressbutton =="cpanel" ) \t\t\t\t\t\t{ \t\t\t\t\t\t\tsubmitbuttonOrig(pressbutton); \t\t\t\t\t\t\treturn; \t\t\t\t\t\t} \t\t\t\t\t\t \t\t\t\t\t\t\t\t \t\t\t\t\t\tvar titles = ["Close","Cancel"]; \t\t\t\t\t\t \t\t\t\t\t\tvar obj = getElementByTitle(titles,document); \t\t\t\t\t\t \t\t\t\t\t\tvar exp = RegExp(pressbutton,"i"); \t\t\t\t\t\t \t\t\t\t\t\tif(obj && obj.parentNode && exp.test(obj.parentNode.getAttribute("href")) ) \t\t\t\t\t\t{ \t\t\t\t\t\t\tsubmitbuttonOrig(pressbutton); \t\t\t\t\t\t\treturn; \t\t\t\t\t\t} \t\t\t\t\t\t \t\t\t\t\t\tvar FCK = FCKeditorAPI.GetInstance("{$hiddenField}"); \t\t\t\t\t\tFCK.submitform = submitbuttonOrig; \t\t\t\t\t\tFCK.Config["saveAction"] = pressbutton; \t\t\t\t\t\tFCK.ToolbarSet.CurrentInstance.Commands.GetCommand( "SpellCheck" ).Execute() ; \t\t\t\t\t} \t\t\t\t\t \t\t\t\t\tsubmitbutton = submitbuttonNew; ' : "") . ' \t\t \t\t\t\t} \t\t\t}\t \t\t},false);\t \t} \t \t \tfunction ReplaceText{$hiddenField}() \t{ \t\toFCKeditor{$hiddenField}.ReplaceTextarea(); \t} \tif(window.addEvent) \t{ \t\twindow.addEvent("domready",ReplaceText{$hiddenField}) \t} \telse if(window.addEventListener) \t{ \t\twindow.addEventListener("DOMContentLoaded", ReplaceText{$hiddenField}, null); \t} \telse \t{ \t\twindow.attachEvent("onload",ReplaceText{$hiddenField}) \t \t}\t \tfunction InsertHTML(field, value) { \t\t// Get the editor instance that we want to interact with. \t\tvar oEditor = FCKeditorAPI.GetInstance(field) ; \t \t\t// Check the active editing mode. \t\tif ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )\t{ \t\t\t// Insert the desired HTML. \t\t\toEditor.InsertHtml( value ) ; \t\t} else { \t\t\talert( 'Please switch to WYSIWYG mode.' ) ; \t\t}//end if \t}//end function </script> <br /> <p>{$buttons}</p> EOD; }
require $path; } exit; } initGzip(); echo "<?xml version=\"1.0\"?>"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo $mosConfig_sitename; ?> - Administração [Joomla!]</title> <link rel="stylesheet" href="templates/<?php echo $mainframe->getTemplate(); ?> /css/template_css.css" type="text/css" /> <link rel="stylesheet" href="templates/<?php echo $mainframe->getTemplate(); ?> /css/theme.css" type="text/css" /> <script language="JavaScript" src="../includes/js/JSCookMenu_mini.js" type="text/javascript"></script> <script language="JavaScript" src="includes/js/ThemeOffice/theme.js" type="text/javascript"></script> <script language="JavaScript" src="../includes/js/joomla.javascript.js" type="text/javascript"></script> <meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?> " /> <?php $mainframe->set('loadEditor', true);
$database->setQuery("SELECT * FROM #__session" . "\nWHERE session_id='{$session_id}'"); if (!($result = $database->query())) { echo $database->stderr(); } if ($database->getNumRows($result) != 1) { echo "<script>document.location.href='index.php'</script>\n"; exit; } } else { echo "<script>document.location.href='{$mosConfig_live_site}/administrator/index.php'</script>\n"; exit; } // update session timestamp $current_time = time(); $database->setQuery("UPDATE #__session SET time='{$current_time}'" . "\nWHERE session_id='{$session_id}'"); $database->query(); // timeout old sessions $past = time() - 1800; $database->setQuery("DELETE FROM #__session WHERE time < '{$past}'"); $database->query(); // start the html output if ($no_html) { if ($path = $mainframe->getPath("admin")) { require $path; } exit; } initGzip(); $path = $mosConfig_absolute_path . "/administrator/templates/" . $mainframe->getTemplate() . "/index.php"; require_once $path; doGzip();
$mainframe->login(); mosRedirect('index.php'); } else { if ($option == 'logout') { $mainframe->logout(); mosRedirect('index.php'); } } if ($do_pdf == 1) { include $mosConfig_absolute_path . '/includes/pdf.php'; exit; } // detect first visit $mainframe->detect(); $gid = intval($my->gid); $cur_template = $mainframe->getTemplate(); // precapture the output of the component require_once $mosConfig_absolute_path . '/editor/editor.php'; ob_start(); if ($path = $mainframe->getPath('front')) { $task = strval(mosGetParam($_REQUEST, 'task', '')); $ret = mosMenuCheck($Itemid, $option, $task, $gid); if ($ret) { require_once $path; } else { mosNotAuth(); } } else { header("HTTP/1.0 404 Não Encontrado"); echo _NOT_EXIST; }
// check if auto_purge value set if ($my->cfg_name == 'auto_purge') { $purge = $my->cfg_value; } else { // if no value set, default is 7 days $purge = 7; } // calculation of past date $past = date('Y-m-d H:i:s', time() - $purge * 60 * 60 * 24); // if purge value is not 0, then allow purging of old messages if ($purge != 0) { // purge old messages at day set in message configuration $query = "DELETE FROM #__messages" . "\n WHERE date_time < " . $database->Quote($past) . "\n AND user_id_to = " . (int) $my->id; $database->setQuery($query); if (!$database->query()) { echo $database->stderr(); } } /** cannot using mosredirect as this stuffs up the cookie in IIS */ // redirects page to admin homepage by default or expired page echo "<script>document.location.href='{$expired}';</script>\n"; exit; } else { mosErrorAlert("Erro no nome do usuário ou senha. Por favor, verifique os dados introduzidos e tente novamente", "document.location.href='index.php?mosmsg=Erro no nome do usuário ou senha. Por favor, verifique os dados introduzidos e tente novamente'"); } } else { initGzip(); $path = $mosConfig_absolute_path . '/administrator/templates/' . $mainframe->getTemplate() . '/login.php'; require_once $path; doGzip(); }