Changeset 867 for pro-violet-viettel


Ignore:
Timestamp:
Mar 31, 2015 3:11:14 PM (10 years ago)
Author:
quyenla
Message:

download

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php

    r865 r867  
    2020        $treeArray = json_decode($data, TRUE);
    2121
    22    
    23         echo "<pre>";
    24         print_r($treeArray);
    25         echo "</pre>";
    26 die();
     22        foreach ($treeArray as $index=>$tree)
     23        {
     24            $treeArray[$index]['name']=$this->convert_vi_to_en($treeArray[$index]['name']);
     25            $treeArray[$index]['fileurl']=$this->encodePath($treeArray[$index]['fileurl']);
     26            foreach ($tree['childFiles'] as $index2=>$file)
     27            {
     28                $treeArray[$index]['childFiles'][$index2]['name']=$this->convert_vi_to_en($treeArray[$index]['childFiles'][$index2]['name']);
     29                $treeArray[$index]['childFiles'][$index2]['fileurl']=$this->encodePath($treeArray[$index]['childFiles'][$index2]['fileurl']);
     30            }
     31            foreach ($tree['childDirs'] as $index2=>$file)
     32            {
     33                $treeArray[$index]['childDirs'][$index2]['name']=$this->convert_vi_to_en($treeArray[$index]['childDirs'][$index2]['name']);
     34                $treeArray[$index]['childDirs'][$index2]['fileurl']=$this->encodePath($treeArray[$index]['childDirs'][$index2]['fileurl']);
     35            }
     36           
     37        }
     38       
    2739        if ((count($treeArray) == 1) && ($treeArray[0]['type'] == 'file')) {
    2840           
     
    6678                        if ($file['parentID'] == $tree['id']) {
    6779                            $path = $folder . "/" . $tree['name'] . "/" . $file['name'];
    68                             $file['fileurl'] = $this->encodePath($file['fileurl']);
     80                           
    6981                            $filecontent = file_get_contents($file['fileurl']);
    7082                            file_put_contents($path, $filecontent);
Note: See TracChangeset for help on using the changeset viewer.