public function postflight(){ define('_FM_COM', 'com_profiles'); if(!defined('DS')) define('DS',DIRECTORY_SEPARATOR); $lang = JFactory::getLanguage(); define('_MY_LANGUAGE',$lang->getTag()); define('_CLOSE_HREF','index.php'); $ABSOLUTE_URI = (getenv('HTTPS') == 'on') ? substr_replace( str_replace("http://", "https://", JURI::base() ), '', -1, 1) : substr_replace(JURI::base(), '', -1, 1) . "/"; define('_FM_ABSOLUTE_URI',$ABSOLUTE_URI); define('_FM_HOME_URL', "index.php?option="._FM_COM."&format=raw"); define('_FM_HOME_FOLDER','components/'._FM_COM.'/filemanager'); define('_FM_HOME_DIR', JPATH_ROOT . '/administrator/components/'._FM_COM.'/filemanager'); define('_FM_LANGUAGE_DIR', _FM_HOME_DIR. DS.'languages'); define('_FM_COOKIE_EXPIRE', time()+60*60*24*60); // Define Peer define('_FM_PEER','joomla'); require_once _FM_HOME_DIR . DS . 'classes'.DS.'file.php'; require_once _FM_HOME_DIR . DS . 'classes'.DS.'text.php'; require_once _FM_HOME_DIR . DS .'includes'.DS.'version.php'; $infoTemplates = _FM_HOME_DIR . DS ."languages" . DS . "info"; $infoPath = $infoTemplates . DS . _MY_LANGUAGE . ".php" ; if(!MFile::is($infoPath)){ $infoPath = $infoTemplates . DS . "en-GB.php"; } $isWelcome = 1; $jed = null; $version=null; require_once $infoPath; } //EOF install
function _default() { global $dir; if (!MRights::can("open")) { return $this->_noAuth("open"); } $syntax = MRequest::clean("syntax"); $uniq = getUnique(); $height = MRequest::int("height", 550); $sid = MRequest::int("sid", null); //$content = implode('', file($dir)); $content = ""; $encoding = MText::_("nofile"); if (MFile::is($dir) && MFile::isFile($dir)) { $content = MFile::readData($dir); $padding = $syntax == "text" ? "0px" : "0px"; $this->view->content('<form id="saveeditfile" method="post" action="' . MURL::_("xhredit", MURL::safePath($dir), "save", "sid=" . $sid) . '"> <input type="hidden" name="close" id="is_close" value="0"></input> <input type="hidden" name="syntax" value="' . htmlentities($syntax) . '"></input> <input type="hidden" name="height" value="' . htmlentities($height) . '"></input> <textarea id="mEditArea-' . $sid . '" name="content" style="width:100%; height:' . $height . 'px;margin:-4px;padding:' . $padding . ';">' . htmlentities($content) . '</textarea> <div class="toRight" style="margin-top:5px;"> <a href="" class="askButton" style="width:120px; text-align:center;" onclick="javascript: mCodeMirrorSubmit(\'' . $sid . '\'); mFormSubmit(_(\'saveeditfile\'));">' . MText::_("save") . '</a> <a href="" class="askButton" style="width:200px; text-align:center;" onclick="javascript: _(\'is_close\').value = 1; mCodeMirrorSubmit(\'' . $sid . '\'); mFormSubmit(_(\'saveeditfile\'));">' . MText::_("saveandclose") . '</a> <a href="" class="askButton" style="width:120px; text-align:center;" onclick="javascript: closePopup(\'Edit' . $sid . '\'); ">' . MText::_("cancel") . '</a> </div> </form> <span style="display:none;" class="mCodeMirrorData" syntax="' . $syntax . '" sid="' . $sid . '" height="' . $height . '"></span> '); //<script language="javascript" type="text/javascript" src="'.MURL::_("xhreditarea",null,null,"syntax=".$syntax."&sid=".$sid."&height=".urlencode($height) ).'" noCache="1"></script> } else { $this->view->content('<h2 style="color:red">' . $encoding . '</h2>'); } }
/** * * @param string $ext the extension of the file * @param int|bool $isBigIcon path is big icons or small icons */ public static function _($ext = "default", $isBigIcon = 0){ $ext = strtolower(trim($ext)); $path = $isBigIcon ? _FM_HOME_DIR.DS."images".DS."bigicons".DS : _FM_HOME_DIR.DS."images".DS."icons".DS; $uri = $isBigIcon ? _FM_HOME_FOLDER.'/images/bigicons/' : _FM_HOME_FOLDER.'/images/icons/'; $iconName = (isset(self::$lookUp->$ext)) ? self::$lookUp->$ext : $ext; $iconName = MFile::is($path.$iconName . ".png") ? $iconName : "default"; return $uri . $iconName . ".png"; }
public function _default() { $infoTemplates = _FM_HOME_FOLDER . DS . "languages" . DS . "info"; $infoPath = $infoTemplates . DS . _MY_LANGUAGE . ".php"; if (!MFile::is($infoPath)) { $infoPath = $infoTemplates . DS . "en-GB.php"; } $jed = "http://extensions.joomla.org/extensions/extension/core-enhancements/file-management/profiles"; // $jed = null; $render = MTemplater::get($infoPath, array("jed" => $jed, "version" => "http://info.mad4media.com/?package=profiles&lang=" . _MY_LANGUAGE)); $this->view->slot("jed", $jed); $this->view->add2Menu(""); $this->view->add2Content($render); }
} else { die("No such folder found!"); } define('_ROOTFOLDERID', (int) $GLOBALS['currentMainFolder']); // Prepaired for further versions of Profiles define("_FM_USE_FTP", false); $mimeTypes = MFile::parseData(_FM_HOME_DIR . DS . "data" . DS . "suffix.ini", true, false); $GLOBALS['mimeTypes'] = $mimeTypes; //Task $task = trim(MRequest::cmd('task')); $GLOBALS['task'] = $task; //View $view = trim(MRequest::cmd('view', 'default')); $GLOBALS['view'] = $view; //Check if this is a first time call if (!MFile::is(_FM_HOME_DIR . DS . "data" . DS . "diagnostic_log.php")) { $view = 'diagnostics'; $GLOBALS['view'] = $view; } //Check root only views $rootOnlyViews = array("rootsandrights", "config", "diagnostics"); if (in_array($view, $rootOnlyViews) && !MRights::userIsRoot() && !_FM_IS_DEMO) { ob_start(); include "templates" . DS . "noaccess.php"; $dieOut = ob_get_clean(); ob_get_clean(); die($dieOut); } //File $file = MRequest::clean('file'); $file = urldecode(myStripSlashes($file));
public static function checkFirstCall(){ $path = _FM_HOME_DIR . DS."data" . DS . "diagnostic_log.php"; if(! MFile::is($path)){ return '<span style="font-size: 16px; font-weight: bold; color: #0B55C4;">' . MText::_("first_call","diagnostics") . '</span><br/><br/>'; }else return ""; }
function deleterootfolder() { $id = MRequest::int("id", -1); if ($id > -1) { $roots = MRoots::getInstance(); $before = "ID: " . $id . "<br>" . $roots; if ($roots->get($id) !== false) { $roots->delete($id); if (!_FM_IS_DEMO) { $roots->save(); } if (MFile::is(_FM_HOME_DIR . DS . "data" . DS . "rights" . DS . "rf" . $id . ".php")) { MFile::remove(_FM_HOME_DIR . DS . "data" . DS . "rights" . DS . "rf" . $id . ".php", 1); } } } $demoAdvice = _FM_IS_DEMO ? MSaved::url() : ''; MPeer::redirect(MURL::_("rootsandrights", null, null) . $demoAdvice); }
public static function filesByType($dirName, $type) { if (!MFile::is($dirName) || !MFile::isDir($dirName)) { return null; } $isArray = gettype($type) == "array"; $array = array(); $dir = @opendir($dirName); while ($entry = @readdir($dir)) { if ($entry == '.' || $entry == '..') { continue; } if (MFile::isFile($dirName . DS . $entry)) { $info = MFile::info($dirName . DS . $entry); if ($isArray) { $typeMatching = in_array($info->extension, $type); } else { $typeMatching = $info->extension == $type; } if ($typeMatching) { $array[] = $info; } } } @closedir($dir); if (sizeof($array) > 0) { return $array; } else { return null; } }