?? file_manage_view.php
字號:
<?php
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/../include/pub_oxwindow.php");
CheckPurview('plus_文件管理器');
$activepath = str_replace("..","",$activepath);
$activepath = ereg_replace("^/{1,}","/",$activepath);
if($activepath == "/") $activepath = "";
if($activepath == "") $inpath = $cfg_basedir;
else $inpath = $cfg_basedir.$activepath;
//顯示控制層
//更改文件名
if($fmdo=="rename")
{
if($activepath=="") $ndirstring = "根目錄";
$ndirstring = $activepath;
$wintitle = "文件管理";
$wecome_info = "文件管理::更改文件名 [<a href='file_manage_main.php?activepath=$activepath'>文件瀏覽器</a>]</a>";
$win = new OxWindow();
$win->Init("file_manage_control.php","js/blank.js","POST");
$win->AddHidden("fmdo",$fmdo);
$win->AddHidden("activepath",$activepath);
$win->AddHidden("filename",$filename);
$win->AddTitle("更改文件名,當前路徑:$ndirstring");
$win->AddItem("舊名稱:","<input name='oldfilename' type='input' id='oldfilename' size='40' value='$filename'>");
$win->AddItem("新名稱:","<input name='newfilename' type='input' size='40' id='newfilename'>");
$winform = $win->GetWindow("ok");
$win->Display();
}
//新建目錄
else if($fmdo=="newdir")
{
if($activepath=="") $activepathname="根目錄";
else $activepathname=$activepath;
$wintitle = "文件管理";
$wecome_info = "文件管理::新建目錄 [<a href='file_manage_main.php?activepath=$activepath'>文件瀏覽器</a>]</a>";
$win = new OxWindow();
$win->Init("file_manage_control.php","js/blank.js","POST");
$win->AddHidden("fmdo",$fmdo);
$win->AddHidden("activepath",$activepath);
//$win->AddHidden("filename",$filename);
$win->AddTitle("當前目錄 $activepathname ");
$win->AddItem("新目錄:","<input name='newpath' type='input' id='newpath'>");
$winform = $win->GetWindow("ok");
$win->Display();
}
//移動文件
else if($fmdo=="move")
{
$wintitle = "文件管理";
$wecome_info = "文件管理::移動文件 [<a href='file_manage_main.php?activepath=$activepath'>文件瀏覽器</a>]</a>";
$win = new OxWindow();
$win->Init("file_manage_control.php","js/blank.js","POST");
$win->AddHidden("fmdo",$fmdo);
$win->AddHidden("activepath",$activepath);
$win->AddHidden("filename",$filename);
$win->AddTitle("新位置前面不加'/'表示相對于當前位置,加'/'表示相對于根目錄。");
$win->AddItem("被移動文件:",$filename);
$win->AddItem("當前位置:",$activepath);
$win->AddItem("新位置:","<input name='newpath' type='input' id='newpath' size='40'>");
$winform = $win->GetWindow("ok");
$win->Display();
}
//刪除文件
else if($fmdo=="del")
{
$wintitle = "文件管理";
$wecome_info = "文件管理::刪除文件 [<a href='file_manage_main.php?activepath=$activepath'>文件瀏覽器</a>]</a>";
$win = new OxWindow();
$win->Init("file_manage_control.php","js/blank.js","POST");
$win->AddHidden("fmdo",$fmdo);
$win->AddHidden("activepath",$activepath);
$win->AddHidden("filename",$filename);
if(@is_dir($cfg_basedir.$activepath."/$filename"))
$wmsg = "你確信要刪除目錄:$filename 嗎?";
else
$wmsg = "你確信要刪除文件:$filename 嗎?";
$win->AddTitle("刪除文件確認");
$win->AddMsgItem($wmsg,"50");
$winform = $win->GetWindow("ok");
$win->Display();
}
//編輯文件
else if($fmdo=="edit")
{
if(!isset($backurl)) $backurl = "";
$activepath = str_replace("..","",$activepath);
$filename = str_replace("..","",$filename);
$file = "$cfg_basedir$activepath/$filename";
$content = "";
if(is_file($file)){
$fp = fopen($file,"r");
$content = fread($fp,filesize($file));
fclose($fp);
$content = eregi_replace("<textarea","< textarea",$content);
$content = eregi_replace("</textarea","< /textarea",$content);
$content = eregi_replace("<form","< form",$content);
$content = eregi_replace("</form","< /form",$content);
}
$contentView = "<textarea name='str' style='width:100%;height:400'>$content</textarea>\r\n";
$GLOBALS['filename'] = $filename;
$ctp = new DedeTagParse();
$ctp->LoadTemplate(dirname(__FILE__)."/templets/file_edit.htm");
$ctp->display();
}
//編輯文件,可視化模式
else if($fmdo=="editview")
{
if(!isset($backurl)) $backurl = "";
if(!isset($ishead)) $ishead = "";
$activepath = str_replace("..","",$activepath);
$filename = str_replace("..","",$filename);
$file = "$cfg_basedir$activepath/$filename";
$fp = fopen($file,"r");
@$content = fread($fp,filesize($file));
fclose($fp);
if((eregi("<html",$content) && eregi("<body",$content)) || $ishead == "yes")
{ $contentView = GetEditor("str",$content,"500","Default","string","true"); }
else
{ $contentView = GetEditor("str",$content,"500","Default","string","false"); }
$GLOBALS['filename'] = $filename;
$ctp = new DedeTagParse();
$ctp->LoadTemplate(dirname(__FILE__)."/templets/file_edit_view.htm");
$ctp->display();
}
//新建文件
else if($fmdo=="newfile")
{
$content = "";
$GLOBALS['filename'] = "newfile.txt";
$contentView = "<textarea name='str' style='width:100%;height:400'></textarea>\r\n";
$ctp = new DedeTagParse();
$ctp->LoadTemplate(dirname(__FILE__)."/templets/file_edit.htm");
$ctp->display();
}
//上傳文件
else if($fmdo=="upload")
{
$ctp = new DedeTagParse();
$ctp->LoadTemplate(dirname(__FILE__)."/templets/file_upload.htm");
$ctp->display();
}
ClearAllLink();
?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -