)(.*)(<\/body>.*)$/i",$body,$m)){ $header=tag_encode($m[1]);$body=$m[2];$footer=str_replace("\r"," ",$m[3]);$heads=split("\r",$m[1]);if(count($heads)){foreach($heads as $l){if(preg_match("/href=(\"|\')(.+)(\.css)(\"|\')/i",$l,$m)){ $css="$m[2]$m[3]";if(!in_array($css,$styles)){ $styles[]=$css;}}elseif(preg_match("/src=(\"|\')(.+)(\.js)(\"|\')/i",$l,$m)){ $js="$m[2]$m[3]";if(!in_array($js,$scripts)){ $scripts[]=$js;}}if(preg_match("/meta name=\"permission\" content=\"uid=(.*);gid=(.*);.*\"/i",$l,$m)){ $contents_uid=$m[1];$contents_gid=$m[2];}}}}$body=str_replace("<","<",$body);$body=str_replace(">",">",$body);}if($Setup['edit']&&$contents_uid&&$_COOKIE['admin']!=$contents_uid&&$_COOKIE['admin']!='root'&&$_COOKIE['admin']!='superadmin'){ $html.="";$javascript=" var nontree='$nontree';document.getElementById('confirmdialog').innerHTML='指定のドキュメントは所有権が設定されています。
このファイルは所有者又は、監理者以外編集できません。

テキストエディタでの編集は可能ですがリスクが大きくお勧めできません。';$(function(){ $('#confirmdialog').dialog({title: '所有権エラー',resizable: false,width: 400,height:190,modal:true,show:'blind',hide:'blind',buttons:{ 戻る: function(){history.back();},閉じる: function(){ $(this).dialog('close');}}});});";}else{ $style="";foreach($styles as $v){ $style_options.="";$style&&$style.=",";$style.=$v;}foreach($scripts as $v){ $script_options.="";}foreach($mb_encode as $v){ $select="";$encode&&$encode==$v&&$select="selected";$encode_options.="";}$abs=str_replace("../","/",$_REQUEST['dir']);if($_COOKIE['admin']!="root"&&$_COOKIE['admin']!="superadmin"){if(!$contents_uid){ $contents_uid=$Admin['Uid'];$contents_gid=$Admin['Depart'];}}$html.="
ヘッダーフッタープレビュー
編集
文字コード : 再読み込み保存
名前を付けて保存保存して終了
編集
";$javascript=" var nontree='$nontree';var filedialog;var previewwin;tinymce_initialize('#editor','100%','','$style','ja','".$Init['mce_skin']."');parent.top.set_status('mainwindow','ファイルマネージャのhtmlエディタでの編集は、保存と同時に反映されます。');function preview(){previewwin=window.open('','previewwin','toolbar=yes,menubar=yes,scrollbars=yes');document.editform.target='previewwin';document.editform.cmd.value='preview';document.editform.submit();previewwin.focus();}function subeditor(mode){if(mode=='footer'||mode=='header'){if(mode=='footer'){subj='フッター編集';}else if(mode=='header'){subj='ヘッダー編集';}document.getElementById('confirmdialog').innerHTML='';}else{subj='スタイル「' + mode + '」編集';getAjaxText('fileman.php?ajax=styleform&css='+mode,'confirmdialog');}$('textarea#subeditor').editor();$(function(){ $('#confirmdialog').dialog({title: subj,resizable: true,width: '95%',height:520,modal:true,show:'blind',hide:'blind',buttons:{ 保存する: function(){ $(this).dialog('close');if(mode=='footer'||mode=='header'){document.getElementById(mode).value=document.getElementById('subeditor').value;}else{document.getElementById('optionform').submit();}},キャンセル: function(){ $(this).dialog('close');}}});});}function save(flag){if(document.editform.filename.value==''){saveas(flag);}else{document.editform.saveflag.value=flag;var text='上書き保存しても宜しいですか?';if(!flag){text +='
保存後はエディタが閉じられます。';}document.getElementById('confirmdialog').innerHTML=text;$(function(){ $('#confirmdialog').dialog({title: '上書き確認',resizable: false,width: 400,height:170,modal:true,show:'blind',hide:'blind',buttons:{ 上書き保存: function(){ $(this).dialog('close');if(flag){document.editform.target='blind';}else{document.editform.target='';}document.editform.cmd.value='';document.editform.submit();},キャンセル: function(){ $(this).dialog('close');}}});});}}function saveas(flag){document.editform.saveflag.value=flag;path=document.editform.dir.value+document.editform.filename.value;fileDialog=window.open('filedialog.php?cd=1&ud=../&ua=/&func=savefile&types=html&path='+path,'fileDialog','width=840,height=600,status=no');filedialog.focus();}function savefile(file){file='..' + file;var Split=file.split('/');var cnt=Split.length;var dir='';for(i=0;i",">",$text);$text=str_replace("\r\n","\n",$text);$text=str_replace("\r","\n",$text);if($_REQUEST['encode']){ $encode=$_REQUEST['encode'];}else{ $encode=getEncoding($text,$Init['Encode']);}$encode !="UTF-8"&&$text=mb_convert_encoding($text,"UTF-8",$encode);}foreach($mb_encode as $v){ $select="";$encode&&$encode==$v&&$select="selected";$encode_options.="";}$abs=str_replace("../","/",$_REQUEST['dir']);$html.="
文字コード : 再読み込み
保存する
名前を付けて保存
";$javascript=" var nontree='$nontree';var filedialog;parent.top.set_status('mainwindow','ファイルマネージャのテキストエディタでの編集は、保存と同時に反映されます。');jQuery(document).ready(function(){ $(\"textarea#texteditor\").tabby();});function save(){if(document.editform.filename.value==''){saveas();}else{var text='上書き保存しても宜しいですか?';document.getElementById('confirmdialog').innerHTML=text;$(function(){ $('#confirmdialog').dialog({title: '上書き確認',resizable: false,width: 400,height:170,modal:true,show:'blind',hide:'blind',buttons:{ 上書き保存: function(){ $(this).dialog('close');document.editform.submit();},キャンセル: function(){ $(this).dialog('close');}}});});}}function saveas(){path=document.editform.dir.value+document.editform.filename.value;fileDialog=window.open('filedialog.php?cd=1;ud=../&ua=/&func=savefile&path='+path,'fileDialog','width=840,height=600,status=no');filedialog.focus();}function savefile(file){file='..' + file;var Split=file.split('/');var cnt=Split.length;var dir='';for(i=0;i
";$n=0;tree_view('../','','','');$html.="
Document Root
";$javascript=" var nontree='$nontree';var oldicon;function activeDir(dir){if(oldicon){document.getElementById(oldicon).src='images/closedir.png';}var id=dir.replace('../','');id=id.replace(/\/$/,'');id=id.replace('/','_','g');id='D'+id;document.getElementById(id).src='images/opendir.png';oldicon=id;}";}elseif($_REQUEST['cmd']=="dir"){if($_REQUEST['action']=="mkdir"){if($_REQUEST['mode']==777){mkdir($_REQUEST['dir'].$_REQUEST['name'],0777);}elseif($_REQUEST['mode']==750){mkdir($_REQUEST['dir'].$_REQUEST['name'],0750);}else{mkdir($_REQUEST['dir'].$_REQUEST['name'],0755);}$javascript=" var nontree='$nontree';if(!nontree)parent.listview.location.replace('fileman.php?cmd=tree');";$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);logregist("ディレクトリ作成($abs)");}elseif($_REQUEST['action']=="del"){ $abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);if($_REQUEST['type']=="dir"){ $com=$_REQUEST['dir'].$_REQUEST['name'];`rm -rf $com`;$javascript=" var nontree='$nontree';if(!nontree)parent.listview.location.replace('fileman.php?cmd=tree');";logregist("ディレクトリの削除($abs)");}else{unlink($_REQUEST['dir'].$_REQUEST['name']);logregist("ファイルの削除($abs)");}}elseif($_REQUEST['action']=="newfile"){ !preg_match("/\.".$_REQUEST['type']."$/",$_REQUEST['name'])&&$_REQUEST['name'].=".".$_REQUEST['type'];$src="";if($_REQUEST['type']=="html"){ $src="".$Init['Title']."";$src=str_replace("\t","",$src);$Init['Encode']!="UTF-8"&&$src=mb_convert_encoding($src,$Init['Encode'],"UTF-8");}file_put_contents($_REQUEST['dir'].$_REQUEST['name'],$src);$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);logregist("ファイル作成($abs)");}elseif($_REQUEST['action']=="chmod"){ $_REQUEST['mode']<644&&$_REQUEST['mode']=644;$_REQUEST['mode']>777&&$_REQUEST['mode']=777;$_REQUEST['mode']=sprintf("%04d",$_REQUEST['mode']);if($_REQUEST['ftp_action']&&$Init['FTPserver']&&$Init['FTPaccount']&&$Init['FTPpasswd']){if($ftp=ftp_connect($Init['FTPserver'])){if(ftp_login($ftp,$Init['FTPaccount'],$Init['FTPpasswd'])){ $abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);$_Init['FTProot']=preg_replace("/\/$/","",$_Init['FTProot']);$cmd="ftp_chmod(\$ftp,".$_REQUEST['mod'].",\"".$_Init['FTProot'].$abs."\");";eval($cmd);ftp_close($ftp);}}}else{ $cmd="chmod(\"".$_REQUEST['dir'].$_REQUEST['name']."\",0".$_REQUEST['mode'].");";eval($cmd);}$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);logregist("パーミッションの変更($abs)");}elseif($_REQUEST['action']=="unzip"){ $com=$_REQUEST['dir'].$_REQUEST['name']." -d ".$_REQUEST['dir'];`unzip -o $com`;$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);logregist("ファイルの解凍($abs)");}elseif($_REQUEST['action']=="lha"){ $com="-ew=".$_REQUEST['dir']." ".$_REQUEST['dir'].$_REQUEST['name'];`lha $com`;$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);logregist("ファイルの解凍($abs)");}elseif($_REQUEST['action']=="rename"){if($new=$_REQUEST['newname']){ $com=$_REQUEST['dir'].$_REQUEST['name']." ".$_REQUEST['dir'];`mv $com$new`;$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['name']);logregist("ファイル名変更($abs,".$_REQUEST['newname'].")");}}elseif($_REQUEST['action']=="paste"){if(is_file($_REQUEST['src'])){copy($_REQUEST['src'],$_REQUEST['dir'].$_REQUEST['file']);}$abs=str_replace("../","/",$_REQUEST['dir'].$_REQUEST['file']);logregist("ファイルのコピー($abs)");}elseif($_REQUEST['action']=="press"){ $src=$_REQUEST['dir'].$_REQUEST['src'];if($_REQUEST['mode']=="zip"){ $des=$src.".zip";`zip $des $src`;}else{ $des=$src.".zip";`lha a $des $src`;}$abs=str_replace("../","/",$des);logregist("ファイルの圧縮($abs)");}elseif($_REQUEST['action']=="upload"){if($_FILES['upload']['name']){ $filename=$_FILES['upload']['name'];$filepath=$_REQUEST['dir'].$filename;move_uploaded_file($_FILES['upload']['tmp_name'],$filepath);`chmod -f 0644 $filepath`;}$abs=str_replace("../","/",$filepath);logregist("ファイルのアップロード($abs)");}elseif($_REQUEST['action']=="multiupload"){for($i=0;$i<10;$i++){if($_FILES['upload']['name'][$i]){ $filepath=$_REQUEST['dir'].$_FILES['upload']['name'][$i];move_uploaded_file($_FILES['upload']['tmp_name'][$i],$filepath);}}$abs=str_replace("../","/",$_REQUEST['dir']);logregist("複数ファイルのアップロード($abs)");}$html.="
複数選択可能 : 
";dir_view($_REQUEST['dir']);$html.="
";$abs=str_replace("../","/",$_REQUEST['dir']);$javascript.=" var nontree='$nontree';parent.document.commandform.addressvar.value='$abs';parent.document.commandform.currentdir.value='".$_REQUEST['dir']."';if(!nontree){if(parent.listview.document.getElementById('D')){parent.listview.activeDir('".$_REQUEST['dir']."');}}function progracebar(){ $('#alertdialog').html('処理中です。
このまましばらくお待ちください。

\"\"');$(function(){ $('#alertdialog').dialog({title: '処理中',resizable:false,width:430,height:140,modal:false,show:'blind',hide:'explode'});});}";}elseif($_REQUEST['cmd']=="find"){ $html.="";findfile($_REQUEST['currentdir'],"");$html.="
";}else{ !$_REQUEST['dir']&&!$_REQUEST['dir']="../";$html.="
";if($Init['nontree']){ $html.="
fileman');\">
Text
";if($Init['lha']){ $html.="";}$html.="";if($Init['zip']){ $html.="";}$html.="
CopyPasteLha
DirFileTextHtmlNameChmdDelZip
";}else{ $html.="";}$html.="
";$javascript=" var nontree='$nontree';function findfile(){if(document.commandform.keyword.value==''){alertdialog('エラー','検索するキーワードが指定されていません。');}else{document.getElementById('confirmdialog').innerHTML='現在アクティブなカレントディレクトリ以下の階層から、キーワード「'+document.commandform.keyword.value+'」が含まれるファイル及び、ディレクトリを検索します。サイトの規模や、階層やの深さにより長い時間が必要です。

検索を開始しても宜しいですか?';$(function(){ $('#confirmdialog').dialog({title: 'ファイルの検索',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 検索する: function(){ $(this).dialog('close');with(document.commandform){cmd.value='find';target='dirview';submit();}},キャンセル: function(){ $(this).dialog('close');}}});});}}function uploads(){var html='
';for(i=1;i<=10;i++){html +='';}html +='
  1. 複数のファイルを一度にアップロードします。
  2. 一度のアップロード可能なファイルは10個までです。これより多いファイルをアップロードする場合は、パソコン側であらかじめ圧縮して、圧縮ファイルをアップロードし、サーバで解凍してください。
  3. アップロードされたファイルは、現在のカレントディレクトリに保存されます。
'+i+'
';document.getElementById('confirmdialog').innerHTML=html;$(function(){ $('#confirmdialog').dialog({title: 'アップロード',resizable: false,width: 480,height:520,modal:true,show:'blind',hide:'blind',buttons:{ アップロード: function(){ $(this).dialog('close');document.uploadform.dir.value=document.commandform.currentdir.value;document.uploadform.submit();},キャンセル: function(){ $(this).dialog('close');}}});});}function fileupload(){with(document.commandform){if(upload.value==''){alertdialog('エラー','[参照...]ボタンを押してアップロードするファイルを選択してください。');return;}dirview.progracebar();target='dirview';cmd.value='dir';dir.value=currentdir.value;action.value='upload';submit();}}function press(mode){var selectfile=getselectobj();if(selectfile){Split=selectfile.split(':');document.getElementById('confirmdialog').innerHTML='圧縮ファイルは同じディレクトリに[.'+mode+']の拡張を変更して作成されます。
作成しても宜しいですか?';$(function(){ $('#confirmdialog').dialog({title: 'ファイルの圧縮',resizable: false,width: 400,height:180,modal:true,show:'blind',hide:'blind',buttons:{ 作成する: function(){ $(this).dialog('close');dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=press&src='+Split[0]+'&mode='+mode);},キャンセル: function(){ $(this).dialog('close');}}});});}else{alertdialog('警告','圧縮するファイルまたは、ディレクトリを選択してください。','Close.png');}}function copy(){var selectfile=getselectobj();if(selectfile){Split=selectfile.split(':');if(Split[1]==\"dir\"){alertdialog('警告','選択されたファイルはディレクトリです。
ディレクトリをコピーすることはできません。','Close.png');}else{ $.cookie('fileman_dir',document.commandform.currentdir.value,{expires:1});$.cookie('fileman_file',Split[0],{expires:1});}}else{alertdialog('警告','コピー元のファイルが選択されていません。','Close.png');}}function paste(){var dir=$.cookie('fileman_dir');var file=$.cookie('fileman_file');if(dir&&file){document.getElementById('confirmdialog').innerHTML='ファイル['+dir+file+']をアクティブなディレクトリに貼り付けます。コピー元のファイルがすでに削除されている場合は貼り付けできません。
貼り付けても宜しいですか?';$(function(){ $('#confirmdialog').dialog({title: '貼り付け',resizable: false,width: 400,height:180,modal:true,show:'blind',hide:'blind',buttons:{ 貼り付け: function(){ $(this).dialog('close');dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=paste&src='+dir+file+'&file='+file);},キャンセル: function(){ $(this).dialog('close');}}});});}else{alertdialog('警告','コピー元のファイルが選択されていません。','Close.png');}}function htmledit(){var selectfile=getselectobj();if(selectfile){var Split=selectfile.split(':');if(Split[0].match(/\.html$/i)){tinymce(Split[0],'');}else{document.getElementById('confirmdialog').innerHTML='選択されたファイルはhtmlドキュメントでは有りません。
選択を無視して新しいhtmlを作成、編集しますか?';$(function(){ $('#confirmdialog').dialog({title: 'html編集',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 作成する: function(){ $(this).dialog('close');newhtml();},キャンセル: function(){ $(this).dialog('close');}}});});}}else{newhtml();}}function newhtml(){getAjaxText('fileman.php?ajax=templist','confirmdialog');$(function(){ $('#confirmdialog').dialog({title: 'ページの作成',resizable: false,width: 400,height:480,modal:true,show:'blind',hide:'blind',buttons:{ キャンセル: function(){ $(this).dialog('close');}}});});}function tinymce(file,temp){parent.job.location.href='fileman.php?cmd=htmledit&dir='+document.commandform.currentdir.value+'&name='+file+'&temp='+temp;}function textedit(){var selectfile=getselectobj();var Split=new Array();Split[0]='';Split[1]='';if(selectfile){Split=selectfile.split(':');if(Split[1]==\"dir\"){alertdialog('警告','選択されたファイルはディレクトリです。
ディレクトリを編集できません。','Close.png');return;}if(Split[0].match(/\.php$/i)||Split[0].match(/\.cgi$/i)||Split[0].match(/\.inc$/i)||Split[0].match(/\.pl$/i)||Split[0].match(/\.js$/i)){document.getElementById('confirmdialog').innerHTML='選択されたファイルはシステムファイルです。システムファイルの編集は重大な影響を及ぼすことがあります。

十分ご注意ください。';$(function(){ $('#confirmdialog').dialog({title: '注意',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 編集する: function(){parent.job.location.href='fileman.php?cmd=textedit&dir='+document.commandform.currentdir.value+'&name='+Split[0];},キャンセル: function(){ $(this).dialog('close');}}});});return;}if(Split[0].match(/\./)==null){alertdialog('警告','形式が不明なファイルは、安全のため編集を制限しています。','Close.png');return;}}parent.job.location.href='fileman.php?cmd=textedit&dir='+document.commandform.currentdir.value+'&name='+Split[0];}function rename(){var selectfile=getselectobj();if(selectfile){Split=selectfile.split(':');var html='
';if(Split[1]=='dir'){html +='ディレクトリ「';}else{html +='ファイル「';}html +=Split[0]+'」の名前を変更します。
ファイル名を変更することで動作に問題が生じることもあります。
名前 : 
';document.getElementById('confirmdialog').innerHTML=html;$(function(){ $('#confirmdialog').dialog({title: '名前の変更',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 変更する: function(){ $(this).dialog('close');if(Split[0]!=document.actionform.newname.value){dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=rename&name='+Split[0]+'&type='+Split[1]+'&newname='+document.actionform.newname.value);}},キャンセル: function(){ $(this).dialog('close');}}});});}else{alertdialog('警告','名前を変更するファイルまたは、ディレクトリが選択されていません。');}}function chmod(){";if($Init['FTPserver']&&$Init['FTPaccount']&&$Init['FTPpasswd']){ $ftpmode="
";}$javascript.=" var selectfile=getselectobj();if(selectfile){Split=selectfile.split(':');var html='
';if(Split[1]=='dir'){html +='ディレクトリ「';}else{html +='ファイル「';}html +=Split[0]+'」のパーミッションを変更します。パーミッションは[0755]、[0644]のような8進数の数値形式でなければなりません。不正な値を設定するとアクセスできない場合がありますのでご注意ください。
パーミッション : ".$ftpmode."
';document.getElementById('confirmdialog').innerHTML=html;$(function(){ $('#confirmdialog').dialog({title: 'パーミッションの変更',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 変更する: function(){ $(this).dialog('close');dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=chmod&name='+Split[0]+'&type='+Split[1]+'&mode='+document.actionform.mode.value);},キャンセル: function(){ $(this).dialog('close');}}});});}else{alertdialog('警告','パーミッションを変更するファイルまたは、ディレクトリが選択されていません。');}}function newfile(){document.getElementById('confirmdialog').innerHTML='
新しいテキストファイルを作成します。ファイルのタイプとファイル名を指定してください。日本語のファイル名は正常に動作しない場合があります。
タイプ : 
ファイル名 : 
';$(function(){ $('#confirmdialog').dialog({title: 'ファイルの作成',resizable: false,width: 400,height:220,modal:true,show:'blind',hide:'blind',buttons:{ 作成する: function(){if(document.actionform.name.value==''){alert('作成するファイル名が設定されていません。');return;}$(this).dialog('close');dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=newfile&name='+document.actionform.name.value+'&type='+document.actionform.type.value);},キャンセル: function(){ $(this).dialog('close');}}});});}function del(){var selectfile=getselectobj();if(selectfile){var obj=document.getElementById('confirmdialog');Split=selectfile.split(':');if(Split[1]=='dir'){obj.innerHTML='
選択されたファイル「'+Split[0]+'」はディレクトリです。ディレクトリを削除すると、ディレクトリ内のファイルもすべて削除されます。

ディレクトリ「'+Split[0]+'」を削除しても宜しいですか?
';}else{obj.innerHTML='
ファイル「'+Split[0]+'」を削除しても宜しいですか?
';}$(function(){ $('#confirmdialog').dialog({title: 'ファイルの削除',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 削除する: function(){ $(this).dialog('close');dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=del&name='+Split[0]+'&type='+Split[1]);},キャンセル: function(){ $(this).dialog('close');}}});});}else{alertdialog('警告','削除するファイルが選択されていません。');}}function getselectobj(){var rn='';with(dirview.document.dirviewForm){var max=objcount.value;for(i=0;i<=max;i++){if(selectfile[i].checked){rn=selectfile[i].value;break;}}}return(rn);}function mkDir(){document.getElementById('confirmdialog').innerHTML='
作成するディレクトリ名と、パーミッションを設定してください。
日本語の名称は正常に動作しない場合があります。
ディレクトリ名 : 
パーミッション : 
';$(function(){ $('#confirmdialog').dialog({title: 'ディレクトリの作成',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 作成する: function(){if(document.actionform.name.value==''){alert('作成するディレクトリ名が設定されていません。');return;}$(this).dialog('close');dirview.location.replace('fileman.php?cmd=dir&dir='+document.commandform.currentdir.value+'&action=mkdir&name='+document.actionform.name.value+'&mode='+document.actionform.mode.value);},キャンセル: function(){ $(this).dialog('close');}}});});}function diraccess(addr){ /* abs=addr.replace('../','/');document.commandform.addressvar.value=abs;document.commandform.currentdir.value=addr;*/ dirview.location.href='fileman.php?cmd=dir&dir='+addr;}function updir(){var currentdir=document.commandform.currentdir.value;if(currentdir !='../'){var Split=currentdir.split('/');var cnt=Split.length - 2;var newdir='';for(i=0;i";}else{ $icons.="";}}$i=1;foreach($DIR as $val){ $addr="$viewdir$val/";$addr=str_replace($Webex['open_cgi_path'],$Webex['open_path'],$addr);if($i==$count){ $vicon=$icons."";$next=0;}else{ $vicon=$icons."";$next=1;}$disp="$viewdir$val";$id=str_replace("../","","D$disp");$id=str_replace("/","_",$id);$vicon.="";if(preg_match("/^\.\.\/trycms/",$disp)){ $click=" document.getElementById('confirmdialog').innerHTML='このディレクトリは[システム]です。全てのファイルが重要なシステムファイルですので、取り扱いには十分ご注意ください';$(function(){ $('#confirmdialog').dialog({title: '重要',resizable: false,width: 240,height:180,modal:true,show:'blind',hide:'blind',buttons:{ キャンセル: function(){ $(this).dialog('close');},はい: function(){ $(this).dialog('close');parent.diraccess('$disp/');}}});});";}else{ $click="parent.diraccess('$disp/')";}$html.="
$vicon$val
";$n++;tree_view($viewdir,"$val/",$layrer,$next);$i++;}}}function dir_view($dir){global $mt,$EXT,$nonDirs,$Init,$System,$html;!$Init['Cols']&&$Init['Cols']=6;if($_SERVER['SERVER_NAME']=='sample.trycms.net'||($_COOKIE['admin']!="root"&&$_COOKIE['admin']!="superadmin")){ $nonDirs['trycms']=true;}!preg_match("/\/$/",$dir)&&$dir.="/";if($dh=opendir($dir)){while(($file=readdir($dh))!==false){if($file !='.'&&$file !='..'){ $type="";eval("\$type=filetype(\$dir.\$file);");if($type){if($type=="dir"){if((!preg_match("/^\./",$file)&&!$nonDirs[$file])&&(!(preg_match("/trycms/",$dir)&&$file=='inc')||$_COOKIE['admin']=="superadmin")){ $DIR[]=$file;}}elseif($type=="file"){if($_COOKIE['admin']=="superadmin"||!preg_match("/^\./",$file)||!(preg_match("/trycms/",$dir)&&preg_match("/\.php$/i",$file))){ $FILES[]=$file;}}}}}closedir($dh);if(count($DIR)){sort($DIR);$Allfiles=$DIR;}if(count($FILES)){sort($FILES);if(count($EXT)){ $FILES=preg_grep("/$mt$/i",$FILES);}foreach($FILES as $val){ $Allfiles[]=mb_convert_encoding($val,"UTF-8","auto");}}}$html.="";$col=1;$obj=-1;$cellwidth=int(100 / $Init['Cols']);if(count($Allfiles)){foreach($Allfiles as $val){ $fl=$val;if($col>$Init['Cols']){ $col=1;$html.="\n";}$fullpath="$addr$val";$filepath="$dir$val";$date=date("Y/m/d",filemtime($filepath));$size=filesize($filepath);$mode=substr(sprintf('%o',fileperms($filepath)),-3);$attribute=posix_getpwuid(fileowner($filepath));$ft="";if(is_file($filepath)){ $filetype='file';if(preg_match("/\.gif$/i",$val)||preg_match("/\.jpg$/i",$val)||preg_match("/\.jpeg$/i",$val)||preg_match("/\.bmp$/i",$val)||preg_match("/\.png$/i",$val)){list($width,$height,$type,$attr)=getimagesize($filepath);$w=$width;$h=$height;if($width>80||$height>80){if($height>$width){ $ritu=$width / $height;$height=80;$width=80 * $ritu;}else{ $ritu=$height / $width;$width=80;$height=80 * $ritu;}}$icon="$filepath\" width=\"$width\" height=\"$height";$ft="image";}else{if(preg_match("/\.htm/i",$val)||preg_match("/\.shtm/i",$val)){ $icon="images/exp/htmlfile.png";}elseif(preg_match("/\.doc$/i",$val)){ $icon="images/exp/word.png";}elseif(preg_match("/\.pdf$/i",$val)){ $icon="images/exp/pdffile.png";}elseif(preg_match("/\.js$/i",$val)){ $icon="images/exp/js.png";}elseif(preg_match("/\.css$/i",$val)){ $icon="images/exp/css.png";}elseif(preg_match("/\.ini$/i",$val)){ $icon="images/exp/ini.png";}elseif(preg_match("/\.fla$/i",$val)||preg_match("/\.swf$/i",$val)){ $icon="images/exp/flash.png";}elseif(preg_match("/\.csv$/i",$val)||preg_match("/\.xls$/i",$val)||preg_match("/\.xlt$/i",$val)||preg_match("/\.xlw$/i",$val)){ $icon="images/exp/excel.png";}elseif(preg_match("/\.inc$/i",$val)||preg_match("/\.php$/i",$val)){ $icon="images/exp/php.png";}elseif(preg_match("/\.cgi$/i",$val)||preg_match("/\.pl$/i",$val)){ $icon="images/exp/cgi.png";}elseif(preg_match("/\.zip/i",$val)){ $icon="images/exp/zip.png";$ft="zip";}elseif(preg_match("/\.lzh/i",$val)){ $icon="images/exp/lzh.png";$ft="lzh";}elseif(preg_match("/\.mov/i",$val)||preg_match("/\.mpg/i",$val)||preg_match("/\.mpeg/i",$val)||preg_match("/\.mid/i",$val)||preg_match("/\.wav/i",$val)||preg_match("/\.au$/i",$val)){ $icon="images/exp/movie.ong";}elseif(preg_match("/\.txt$/i",$val)){ $icon="images/exp/textfile.png";}else{ $icon="images/exp/bin.png";}}}else{if($val=="trycms"){ $filetype="sys";$icon="images/exp/folder_sys.png";}elseif($val=="jquery"){ $filetype="sys";$icon="images/exp/jquery.png";}else{ $filetype="dir";$icon="images/exp/folder.png";}}if($filetype=="dir"||$filetype=="sys"){ $absolutelypath=str_replace("../","/","$dir$val");$href="javascript:parent.diraccess('$dir$val/')";}else{if($ft=="image"){ $key=str_replace(".","-",$val);$key=preg_replace("/[\ \(\)]/","_",$key);$href="$dir$val\" id=\"$key\" title=\"$w x $h\" onclick=\"$(function(){ $('#$key').colorbox({transition:'default',overlayClose:true});});";}elseif($ft=="zip"&&$Init['unzip']){ $href=" javascript:void(0)\" onclick=\" document.getElementById('confirmdialog').innerHTML=' このファイルは[zip形式]の圧縮ファイルです。
ダウンロードは右クリックして「対象をファイルに保存」を選択します。

この場所に解凍しても宜しいですか?';$(function(){ $('#confirmdialog').dialog({title: '圧縮ファイルの解凍',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 解凍する: function(){ $(this).dialog('close');location.replace('fileman.php?cmd=dir&dir=$dir&action=unzip&name=$val');},キャンセル: function(){ $(this).dialog('close');}}});});";$href=preg_replace("/[\r\t\n]/","",$href);}elseif($ft=="lzh"&&$Init['lha']){ $href=" javascript:void(0)\" onclick=\" document.getElementById('confirmdialog').innerHTML=' このファイルは[lha形式]の圧縮ファイルです。
[ダウンロード]または、[解凍する]を選択してください。

この場所に解凍しても宜しいですか?';$(function(){ $('#confirmdialog').dialog({title: '圧縮ファイルの解凍',resizable: false,width: 400,height:200,modal:true,show:'blind',hide:'blind',buttons:{ 解凍する: function(){ $(this).dialog('close');location.replace('fileman.php?cmd=dir&dir=$dir&action=lha&name=$val');},ダウンロード: function(){ $(this).dialog('close');location.href='$dir$val';},キャンセル: function(){ $(this).dialog('close');}}});});";$href=preg_replace("/[\r\t\n]/","",$href);}else{ $href="$dir$val\" target=\"_blank";}}if($filetype=='file'){if($ft=="image"){ $size="
$w"." x ".$h."px";}else{ $size="
$size Byte";}}else{ $size="";}if($filetype=="sys"){ $html.="";}else{if($icon){ $html.="";$obj++;}}$col++;}}$html.="

$val
$date
$mode


";}function findfile($startdir="./",$dir=""){global $nonDirs,$html,$row;if($_SERVER['SERVER_NAME']=='sample.trycms.net'||($_COOKIE['admin']!="root"&&$_COOKIE['admin']!="superadmin")){ $nonDirs['trycms']=true;}!preg_match("/\/$/",$startdir)&&$startdir.="/";$viewdir=$startdir.$dir;if($dh=opendir($viewdir)){while(($file=readdir($dh))!==false){ $path="";if(!preg_match("/^\./",$file)){ $type=filetype("$viewdir$file");if($type=="dir"){if(!$nonDirs[$file]){ $DIR[]=$file;if(preg_match("/".$_REQUEST['keyword']."/",$file)){ $path="$viewdir$file,dir";}}}else{if(preg_match("/".$_REQUEST['keyword']."/",$file)){ $path="$viewdir$file,file";}}if($path){ $row++;list($path,$type)=split(",",$path);if($type=="dir"){ $access=$path;$icon="exdirclose.gif";}else{ $dummy=split("/",$path);$access="";for($i=0;$i$row
$abs
";}}}closedir($dh);count($DIR)&&sort($DIR);}if(count($DIR)){foreach($DIR as $val){findfile($viewdir,"$val/");}}}?>