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> '); } }
public static function save(){ $path = _FM_HOME_DIR . DS."data" . DS . "diagnostic_log.php"; $buffer = '<?PHP die(); /**'."\n"; foreach(self::$params as $key => $value){ $buffer .= $key . "\t" . $value . "\n"; } $buffer .= "*/"; return @MFile::writeData($path,$buffer); }
public function save($fileName = null) { if ($fileName && $this->endsWith($fileName, ".php")) { MFile::writeData($fileName, "<?PHP die();\n/*SPLIT\n" . wordwrap($this->serialize(), 75, "\n", true)); } return "FileName: " . $fileName . "<br>" . $this; }