function _default() { $heap = '{ "textEdit": {'; $textEdit = MFile::parseData(_FM_HOME_DIR . DS . "data" . DS . "stextedit.ini", true, false); //All editable text based file extensions $count = 0; foreach ($textEdit as $key => $value) { $count++; $heap .= '"' . $key . '":"' . $value . '",'; } $heap .= '"length": ' . $count . ' }, ' . "\n"; //All playable files and routing to the player task $count = 0; $heap .= '"players": {'; $players = MFile::parseData(_FM_HOME_DIR . DS . "data" . DS . "players.ini", true, false); foreach ($players as $key => $value) { $count++; $heap .= '"' . $key . '":"' . $value . '",'; } $heap .= '"length": ' . $count . ' }, ' . "\n"; // All compressors allowed $heap .= '"package": ["zip"] ' . "\n"; // Close Main Object $heap .= "}"; //Output $this->view->add2Content($heap); }
public static function init(){ if(! self::$lookUp){ $name = _FM_HOME_DIR.DS."data".DS."icons.ini"; if(MFile::is($name)){ self::$lookUp = MFile::parseData($name, true, false); }else{ self::$lookUp = new stdClass(); } } }
public static function includeScope($scopeName = null) { $scopeName = strtolower(trim($scopeName)); if (!$scopeName) { return false; } $tag = _MY_LANGUAGE; // Tag security $tag = (string) preg_replace('/[^A-Za-z-]/i', '', $tag); $path = _FM_LANGUAGE_DIR; if (!file_exists($path . DS . strtolower($scopeName) . "." . $tag . ".ini")) { $tag = "en-GB"; } $englishTextArray = MFile::parseData($path . DS . strtolower($scopeName) . ".en-GB.ini"); $currentTextArray = MFile::parseData($path . DS . strtolower($scopeName) . "." . $tag . ".ini"); if ($currentTextArray) { $newTextArray = array_merge($englishTextArray, $currentTextArray); self::$scope[$scopeName] = $newTextArray; return true; } else { self::$scope[$scopeName] = $englishTextArray; return false; } }
foreach ($GLOBALS['folderAccess'] as $key => $value) { $tmp = (int) $key; break; } MPeer::setSessionInfo("currentFolder", $tmp); $GLOBALS['currentMainFolder'] = $tmp; } if (isset($GLOBALS['folderAccess'][$GLOBALS['currentMainFolder']])) { define('_START_FOLDER', $GLOBALS['folderAccess'][$GLOBALS['currentMainFolder']]); } 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) {
public static function action($name, $action, $arguments) { if (!file_exists($name)) { return null; } switch ($action) { case 'parseData': return MFile::parseData($name); break; case 'chmod': return MFile::chmod($name, $arguments); break; case 'mode': return MFile::mode($name); break; default: case 'info': return MFile::info($name); break; } }