Exemplo n.º 1
0
    function _default()
    {
        $this->authAndDie("open");
        $syntax = MRequest::clean("syntax");
        $sid = MRequest::int("sid", null);
        $height = MRequest::int("height", 550);
        $syntax = $syntax == "text" ? "robotstxt" : $syntax;
        header('Content-type: text/javascript');
        echo '
		var mCodeMirror' . $sid . ' = CodeMirror.fromTextArea(
				_("mEditArea-' . $sid . '"), 
				{  lineNumbers: true,
				   theme: "eclipse",
				   matchBrackets: true,
				   mode: "' . $syntax . '",
				   indentUnit: 4,
				   indentWithTabs: true,
				   enterMode: "keep",
				   tabMode: "shift"
  				});
  				
  		mCodeMirror' . $sid . '.setSize("100%","' . $height . 'px");	
		';
        exit;
    }
Exemplo n.º 2
0
    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>');
        }
    }
Exemplo n.º 3
0
 function _default()
 {
     $isGet = MRequest::int("isget");
     $name = MRequest::clean("name");
     $value = MRequest::clean("value");
     if (isGet == 1) {
         $this->view->add2Content($_COOKIE["name"]);
     } else {
         setcookie($name, $value, _FM_COOKIE_EXPIRE);
         $this->view->add2Content("1");
     }
 }
Exemplo n.º 4
0
    $dieOut = ob_get_clean();
    ob_get_clean();
    die($dieOut);
}
//File
$file = MRequest::clean('file');
$file = urldecode(myStripSlashes($file));
$file = MRequest::filter($file, MREQUEST_CLEANPATH);
$GLOBALS['file'] = $file;
//Destination
$destination = urldecode(MRequest::clean('destination'));
$destination = MRequest::filter($destination, MREQUEST_CLEANPATH);
$destination = _START_FOLDER . myStripSlashes($destination);
$GLOBALS['destination'] = $destination;
//New
$new = MRequest::clean('new');
$new = MRequest::filter($new, MREQUEST_CLEANPATH);
$GLOBALS['new'] = $new;
//Dir
$dir = _START_FOLDER . myStripSlashes(urldecode(strip_tags(MRequest::raw('dir'))));
$dir = MRequest::filter($dir, MREQUEST_CLEANPATH);
$GLOBALS['dir'] = $dir;
// Image View State
$imageViewState = MRequest::int("imageviewstate", -1);
if ($imageViewState == -1) {
    if (isset($_COOKIE["mtoggleimageview"])) {
        $imageViewState = (int) $_COOKIE["mtoggleimageview"];
    } else {
        $imageViewState = 0;
        setcookie("mtoggleimageview", $imageViewState, _FM_COOKIE_EXPIRE);
    }
Exemplo n.º 5
0
//CUSTOMPLACEHOLDER
//CUSTOMPLACEHOLDER2

defined('_JEXEC') or die;


if(isset($_REQUEST["selectedFiles"])){
	if(is_array($_REQUEST["selectedFiles"])){

		foreach($_REQUEST["selectedFiles"] as & $item){
			$item = trim( MRequest::filter( urldecode($item), MREQUEST_CLEANPATH));
		}

	}else{
		$_REQUEST["selectedFiles"] = array();
	}
}


$checkPaths = array("dir","destination");

foreach($checkPaths as $variable){
	$evalPath = _START_FOLDER . stripslashes(MRequest::clean($variable,null));
	if(!MFile::isSubDir($evalPath,$GLOBALS['folderAccess']) && $evalPath !=null){
		die("No Access!");
	}
}


?>
Exemplo n.º 6
0
 function newitem()
 {
     global $dir;
     if (!MRights::can("new")) {
         $this->view->authError("new");
         return;
     }
     $name = MRequest::clean('newname', null);
     $name = end(preg_split("/[\\/\\,]+/", $name));
     $error = null;
     if (!$dir) {
         $error .= MText::_("nodir") . "<br>";
     }
     if (!$name) {
         $error .= MText::_("noname") . "<br>";
     }
     if (!$error) {
         $status = @mkdir($dir . DS . $name, 0755);
         if ($status) {
             $this->view->add2Content('ok');
         } else {
             $error .= MText::_("nocreatefolder");
             $this->view->add2Content('_fmError' . $error);
         }
     } else {
         $this->view->add2Content('_fmError' . $error);
     }
 }
Exemplo n.º 7
0
 function newitem()
 {
     global $dir;
     if (!MRights::can("new")) {
         $this->view->authError("new");
         // 			$this->popupError("new");
         return;
     }
     $name = MRequest::clean('newname', null);
     $name = end(preg_split("/[\\/\\,]+/", $name));
     $error = null;
     if (!$dir) {
         $error .= MText::_("nodir") . "<br>";
     }
     if (!$name) {
         $error .= MText::_("noname") . "<br>";
     }
     if (!$error) {
         $status = fopen($dir . DS . $name, 'w');
         if ($status) {
             fwrite($status, pack("CCC", 0xef, 0xbb, 0xbf));
             fwrite($status, " ");
             fclose($status);
             $this->view->add2Content('ok');
         } else {
             $this->view->add2Content('_fmError' . $error);
         }
     } else {
         $this->view->add2Content('_fmError' . $error);
     }
 }
Exemplo n.º 8
0
    function webm()
    {
        if (!MRights::can("open")) {
            return $this->_noAuth("open");
        }
        global $dir;
        $unique = MRequest::clean("unique", null);
        $info = MFile::info($dir);
        $timestamp = $unique ? $unique : uniqid();
        $this->view->add2Content('<video id="profiles_video_' . $timestamp . '" class="video-js vjs-default-skin vjs-big-play-centered"
							  controls preload="auto" width="640" height="264"
							  poster="">
						 <source src="' . htmlentities(MURL::_("xhrvideo", str_replace(_START_FOLDER, "", $dir))) . '" type="video/webm">
					</video>
					<script type="text/javascript">videojs("profiles_video_' . $timestamp . '", {}, function(){});</script>');
    }
Exemplo n.º 9
0
 /**
  * @return MDO
  */
 protected function _fetchData()
 {
     $names = $this->getVarNames();
     $data = new stdClass();
     $data->isError = false;
     $data->name = MRequest::clean("name", null);
     $data->nameError = "";
     $data->path = str_replace("\\", "/", MRequest::clean("path", null));
     $data->pathError = "";
     if (!$data->name) {
         $data->nameError .= MRightsHelper::wrapError(MText::_("error_noname"));
     }
     // Just validate if not in demo mode
     if (!_FM_IS_DEMO) {
         if (!$data->path) {
             $data->pathError .= MRightsHelper::wrapError(MText::_("error_nopath"));
         } else {
             if (!MFile::isDir($data->path)) {
                 $data->pathError .= MRightsHelper::wrapError(MText::_("error_pathnofolder"));
             }
         }
     }
     //EOF is not demo
     foreach ($names as $name) {
         $errVar = strtolower($name) . "Error";
         $data->isError = $data->isError || (bool) $data->{$errVar};
     }
     return MDO::instance(null, $data);
 }