- Timestamp:
- 2012/02/06 11:05:15 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/helper/SC_Helper_FileManager.php
r21420 r21441 52 52 // アルファベットと数字でソート 53 53 natcasesort($arrDir); 54 foreach ($arrDir as $file) {54 foreach ($arrDir as $file) { 55 55 // ./ と ../を除くファイルのみを取得 56 if ($file != "." && $file != "..") {56 if ($file != "." && $file != "..") { 57 57 58 58 $path = $dir."/".$file; … … 63 63 64 64 // ディレクトリとファイルで格納配列を変える 65 if (is_dir($path)) {65 if (is_dir($path)) { 66 66 $arrDirList[$cnt]['file_name'] = $file; 67 67 $arrDirList[$cnt]['file_path'] = $path; … … 95 95 function sfGetDirSize($dir) { 96 96 $bytes = 0; 97 if (file_exists($dir)) {97 if (file_exists($dir)) { 98 98 // ディレクトリの場合下層ファイルの総量を取得 99 99 if (is_dir($dir)) { … … 129 129 function sfDeleteDir($dir) { 130 130 $arrResult = array(); 131 if (file_exists($dir)) {131 if (file_exists($dir)) { 132 132 // ディレクトリかチェック 133 133 if (is_dir($dir)) { … … 176 176 $dir = ereg_replace("/$", "", $dir); 177 177 // 最上位層を格納(user_data/) 178 if ($this->sfDirChildExists($dir)) {178 if ($this->sfDirChildExists($dir)) { 179 179 $arrTree[$cnt]['type'] = "_parent"; 180 180 } else { … … 185 185 $arrTree[$cnt]['count'] = $cnt; 186 186 // 初期表示はオープン 187 if ($_POST['mode'] != '') {187 if ($_POST['mode'] != '') { 188 188 $arrTree[$cnt]['open'] = $this->lfIsFileOpen($dir, $tree_status); 189 189 } else { … … 210 210 function sfGetFileTreeSub($dir, $default_rank, &$cnt, &$arrTree, $tree_status) { 211 211 212 if (file_exists($dir)) {212 if (file_exists($dir)) { 213 213 if ($handle = opendir("$dir")) { 214 214 while (false !== ($item = readdir($handle))) $arrDir[] = $item; 215 215 // アルファベットと数字でソート 216 216 natcasesort($arrDir); 217 foreach ($arrDir as $item) {217 foreach ($arrDir as $item) { 218 218 if ($item != "." && $item != "..") { 219 219 // 文末の/を取り除く … … 223 223 if (is_dir($path)) { 224 224 $arrTree[$cnt]['path'] = $path; 225 if ($this->sfDirChildExists($path)) {225 if ($this->sfDirChildExists($path)) { 226 226 $arrTree[$cnt]['type'] = "_parent"; 227 227 } else { … … 254 254 */ 255 255 function sfDirChildExists($dir) { 256 if (file_exists($dir)) {256 if (file_exists($dir)) { 257 257 if (is_dir($dir)) { 258 258 $handle = opendir($dir); … … 281 281 function lfIsFileOpen($dir, $tree_status) { 282 282 $arrTreeStatus = explode('|', $tree_status); 283 if (in_array($dir, $arrTreeStatus)) {283 if (in_array($dir, $arrTreeStatus)) { 284 284 return true; 285 285 } … … 312 312 function sfCreateFile($file, $mode = "") { 313 313 // 行末の/を取り除く 314 if ($mode != "") {314 if ($mode != "") { 315 315 $ret = @mkdir($file, $mode); 316 316 } else { … … 332 332 $fp = @fopen($filename, 'rb' ); 333 333 //ファイル内容を全て変数に読み込む 334 if ($fp) {334 if ($fp) { 335 335 $str = @fread($fp, filesize($filename)+1); 336 336 } … … 375 375 // ファイル一覧取得 376 376 $arrFileHash = SC_Utils_Ex::sfGetFileList($dir); 377 foreach ($arrFileHash as $val) {377 foreach ($arrFileHash as $val) { 378 378 $arrFileList[] = $val['file_name']; 379 379 $debug_message.= "圧縮:".$val['file_name']."\n";
Note: See TracChangeset
for help on using the changeset viewer.
