文件浏览器]";
$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("旧名称:","");
$win->AddItem("新名称:","");
$winform = $win->GetWindow("ok");
$win->Display();
}
//新建目录
else if($fmdo=="newdir")
{
if($activepath=="") $activepathname="根目录";
else $activepathname=$activepath;
$wintitle = " 文件管理";
$wecome_info = " 文件管理::新建目录 [文件浏览器]";
$win = new OxWindow();
$win->Init("file_manage_control.php","js/blank.js","POST");
$win->AddHidden("fmdo",$fmdo);
$win->AddHidden("activepath",$activepath);
$win->AddHidden("token",make_hash());
$win->AddTitle("当前目录 $activepathname ");
$win->AddItem("新目录:","");
$winform = $win->GetWindow("ok");
$win->Display();
}
//移动文件
else if($fmdo=="move")
{
$wintitle = " 文件管理";
$wecome_info = " 文件管理::移动文件 [文件浏览器]";
$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("新位置:","");
$winform = $win->GetWindow("ok");
$win->Display();
}
//删除文件
else if($fmdo=="del")
{
$wintitle = " 文件管理";
$wecome_info = " 文件管理::删除文件 [文件浏览器]";
$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 = dede_htmlspecialchars($content);
}
$contentView = "\r\n";
$GLOBALS['filename'] = $filename;
$path_parts = pathinfo($filename);
if ( $path_parts['extension'] == 'php' )
{
$GLOBALS['extension'] = 'text/x-php';
} else if($path_parts['extension'] == 'js'){
$GLOBALS['extension'] = 'text/javascript';
} else if($path_parts['extension'] == 'css'){
$GLOBALS['extension'] = 'text/css';
} else {
$GLOBALS['extension'] = 'text/html';
}
$ctp = new DedeTagParse();
$ctp->LoadTemplate(DEDEADMIN."/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("LoadTemplate(DEDEADMIN."/templets/file_edit_view.htm");
$ctp->display();
}
*/
//新建文件
else if($fmdo=="newfile")
{
$content = "";
$GLOBALS['filename'] = "newfile.txt";
$GLOBALS['extension'] = 'text/html';
$contentView = "\r\n";
$GLOBALS['token'] = make_hash();
$ctp = new DedeTagParse();
$ctp->LoadTemplate(DEDEADMIN."/templets/file_edit.htm");
$ctp->display();
}
//上传文件
else if($fmdo=="upload")
{
$ctp = new DedeTagParse();
$ctp->LoadTemplate(DEDEADMIN."/templets/file_upload.htm");
$ctp->display();
}