示例#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;
    }
示例#2
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");
     }
 }
示例#3
0
文件: config.php 项目: utopszkij/lmp
 public function main()
 {
     global $task;
     $isSend = MRequest::int("send", 0);
     $_task = !$task || $task == "default" ? "main" : $task;
     $this->view->add2Menu(MConfigHelper::getMenu());
     $config = MConfig::instance();
     $err = array();
     if ($isSend) {
         $request = $config->request();
         if (!sizeof($request->error)) {
             if (!_FM_IS_DEMO) {
                 $config->mixinAndSave($request->data);
             }
             MPeer::redirect(MURL::_("config", null, "main") . MSaved::url());
         } else {
             $config->mixin($request->data);
             $err = $request->error;
         }
     }
     $this->view->add2Content(MConfigHelper::generate($_task, $config, $err));
 }
示例#4
0
    function save()
    {
        if (!MRights::can("edit")) {
            return $this->_noAuth("edit");
        }
        global $dir;
        $is_close = MRequest::int("close", 0);
        $info = MFile::info($dir);
        $content = MRequest::raw("content");
        $sid = MRequest::int("sid", null);
        MFile::writeData($dir, $content);
        if ($is_close) {
            $this->view->content('<script noCache="1">
					_Delayed500(function(){
					_LoadTo("' . MURL::_("xhrfiles", MURL::safePath($info->dirName)) . '", "splitInnerRight", function() {
					parseAll(_("splitInnerRight")); evalButtons();});  });
					closePopup("Edit' . $sid . '");</script>');
        } else {
            $this->_default();
            $this->view->add2Content('
				<div id="mSavedAdvice" class="savedAdvice"><div>' . MText::_("saved") . '</div></div>
				<script noCache="1" type="text/javascript">
					dojo.addOnLoad(function(){
							var node = dojo.byId("mSavedAdvice");
							dojo.style(node,{opacity: 0});
							_fx.fadeOpacity(node,300,0,1,function(){
								setTimeout(function(){
									var node = dojo.byId("mSavedAdvice");
									dojo.style(node,{opacity: 1});
									_fx.fadeOpacity(node,400,1,0,function(){
										 _removeNode(dojo.byId("mSavedAdvice"));
									});
								},2000);
							});
					});
				</script>
			');
        }
    }
示例#5
0
 function chmod()
 {
     global $dir;
     if ($dir == _START_FOLDER) {
         $this->view->add2Content("_fmError" . MText::_("notforroot"));
         return;
     }
     if (!MRights::can("chmod")) {
         $this->view->authError("chmod");
         return;
     }
     $mode = MRequest::int('chmod', null);
     if (!$mode) {
         $this->view->add2Content("_fmError");
         return null;
     }
     $status = MFile::chmod($dir, $mode);
     if (!$status) {
         $this->view->add2Content("_fmError");
     } else {
         $this->view->add2Content(fmGetFinfo($dir));
     }
 }
示例#6
0
$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);
    }
} else {
    setcookie("mtoggleimageview", $imageViewState, _FM_COOKIE_EXPIRE);
}
define('_M_IMAGE_VIEW_STATE', $imageViewState);
//Security processing
require_once 'includes' . DS . 'secure.php';
//Files View
$filesView = MRequest::int('filesview', null);
if ($filesView !== null) {
    MRequest::setCookie('filesView', $filesView);
    $GLOBALS['filesView'] = $filesView;
} else {
    $GLOBALS['filesView'] = MRequest::getCookie('filesView', 1, MREQUEST_INT);
}
// Processing the view
$viewName = $view . "view";
if (file_exists(_FM_HOME_DIR . DS . 'view' . DS . $viewName . '.php')) {
    require_once 'view' . DS . $viewName . '.php';
} else {
    $viewName = null;
}
// Processing controller
$controllerName = $view == 'default' ? 'defaulttask' : $view;
示例#7
0
 function chmod()
 {
     if (!MRights::can("chmod")) {
         $this->popupError("chmod");
         return;
     }
     $mode = MRequest::int('chmod', null);
     if (!$mode) {
         $error = MText::_("no_mode_set");
         $this->view->add2Content('<script noCache="1">newDarkenPopup(\'error\',mText.error,\'' . $error . '\',500,250);</script>');
         $this->view->add2Content(fmGetFiles());
         return false;
     }
     $this->view->add2Content('<div style="display:none;">' . md5(uniqid()) . '</div>');
     $selectedFiles = $_REQUEST["selectedFiles"];
     $error = null;
     foreach ($selectedFiles as $selectedFile) {
         $selectedFile = _START_FOLDER . urldecode($selectedFile);
         $selectedFile = MValidate::path($selectedFile);
         $info = MFile::info($selectedFile);
         $status = MFile::chmod($selectedFile, $mode);
         if (!$status) {
             $error .= "File: <b>" . $info->baseName . "</b> " . MText::_("mode_cannot_change") . "<br>";
         }
     }
     if ($error) {
         $this->view->add2Content('<script noCache="1">newDarkenPopup(\'error\',mText.error,\'' . $error . '\',500,250);</script>');
     }
     $this->view->add2Content(fmGetFiles());
 }
示例#8
0
 protected function _rightsSave($id = null)
 {
     if ($id === null || $id < 0) {
         MPeer::redirect(MURL::_("rootsandrights", null, "rights"));
     }
     $rights = MRights::getInstance($id);
     $rights->fetchData();
     if (!_FM_IS_DEMO) {
         $rights->save();
     }
     $groupTab = MRequest::int("grouptab", null);
     $gtab = $groupTab !== null ? '&grouptab=' . $groupTab : '';
     $this->view->addPreToContent($_REQUEST);
     MPeer::redirect(MURL::_("rootsandrights", null, "rights") . '&id=' . $id . $gtab . MSaved::url());
 }
示例#9
0
defined('_JEXEC') or die;

?>
		<a href="<?PHP echo MURL::_("rootsandrights"). (isset($rootfolderid) ? '&id='. $rootfolderid : '') ; ?>" name="rootfolder"
			class="buttonBox <?php if(! $GLOBALS["task"]) echo 'active'; ?>" onclick="window.location.href= this.href;" > <img src="<?php echo _FM_HOME_FOLDER; ?>/images/rootfolder.png" /> <span><?php §(MText::_("rootfolder"));?></span>
		</a> 
		
		<a href="<?PHP echo MURL::_("rootsandrights",null,"rights"). (isset($rootfolderid) ? '&id='. $rootfolderid : ''); ?>"  name="rights"
			class="buttonBox <?php if($GLOBALS["task"]== "rights") echo 'active'; ?>" onclick="window.location.href= this.href;"> <img src="<?php echo _FM_HOME_FOLDER; ?>/images/rights.png" /> <span><?php §(MText::_("rights"));?></span>
		</a> 

		
		<div class="toRight">
		<?php 
			$_id = MRequest::int("id", 1); 
			$isDisabled = ' id="disabled"';
			$cursor = "default";
			if(!$GLOBALS["task"] && $_id > -1){
				$isDisabled = '';
				$cursor= "pointer";
			}
			
		?>
		<a name="delete" <?php echo $isDisabled; ?> style="cursor: <?php echo $cursor;?>;"
			class="buttonBox " onclick="javascript: if(this.id == 'disabled') return false; askRemove();" > 
			<img src="<?php echo _FM_HOME_FOLDER; ?>/images/trash.png" /> 
			<span><?php §(MText::_("delete"));?></span>
		</a> 
		
		<a name="save" style="cursor: pointer;"
示例#10
0
 public function xhr()
 {
     if (!MRights::can("upload")) {
         return $this->view->authError("upload");
     }
     global $dir;
     $size = MRequest::int("size", null);
     if ($size === null) {
         return;
     }
     // 		print_r($_SERVER); die();
     $fn = isset($_SERVER['HTTP_X_FILENAME']) ? MRequest::filter($_SERVER['HTTP_X_FILENAME'], MREQUEST_STRING) : false;
     if (!$fn) {
         return null;
     }
     $fileName = $dir . DS . $fn;
     file_put_contents($fileName, file_get_contents('php://input'));
     // Delete on abbort
     if (MFile::getSize($fileName) != $size) {
         MFile::remove($fileName);
     }
     $this->view->add2Content("ok");
 }