Changeset 865
- Timestamp:
- Mar 31, 2015 2:58:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php
r864 r865 20 20 $treeArray = json_decode($data, TRUE); 21 21 22 foreach ($treeArray as $idx=>$tree) { 23 $treeArray[$idx]['fileurl'] = $this->encodePath($treeArray[$idx]['fileurl']); 24 $treeArray[$idx]['name']= $this->convert_vi_to_en($treeArray[$idx]['name']); 25 if ($tree['type'] == 'file') { 26 $path = $folder . "/" . $tree['name']; 27 $filecontent = file_get_contents($tree['fileurl']); 28 file_put_contents($path, $filecontent); 29 } 30 if ($tree['type'] == 'directory') { 31 $childDirs = $this->aasort($tree['childDirs'], "id"); 32 foreach ($childDirs as $index => $dir) { 33 $treeArray[$idx]['childDirs'][$index]['fileurl'] = $this->encodePath($treeArray[$idx]['childDirs'][$index]['fileurl']); 34 $treeArray[$idx]['childDirs'][$index]['name']= $this->convert_vi_to_en($treeArray[$idx]['childDirs'][$index]['name']); 35 } 36 $childDirs = $this->aasort($tree['childFiles'], "id"); 37 foreach ($childDirs as $index => $dir) { 38 echo $dir['name']."<br />"; 39 $treeArray[$idx]['childDirs'][$index]['fileurl'] = $this->encodePath($treeArray[$idx]['childDirs'][$index]['fileurl']); 40 $treeArray[$idx]['childDirs'][$index]['name']= $this->convert_vi_to_en($treeArray[$idx]['childDirs'][$index]['name']); 41 } 42 43 } 44 45 } 22 23 echo "<pre>"; 24 print_r($treeArray); 25 echo "</pre>"; 46 26 die(); 47 27 if ((count($treeArray) == 1) && ($treeArray[0]['type'] == 'file')) {
Note: See TracChangeset
for help on using the changeset viewer.