Changeset 892


Ignore:
Timestamp:
Apr 16, 2015 11:46:05 AM (10 years ago)
Author:
quyenla
Message:

download fix

Location:
pro-violet-viettel/www/deploy/20150304
Files:
3 edited

Legend:

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

    r889 r892  
    7373                                foreach($this->xml->tree->filelist->file as $key=>$value){
    7474                                        //$fileUrl = dirname(dirname(dirname($value->_param['fileurl'])));
    75                                         $fileUrl = $value->_param['fileurl'];
    76                                         $aryFiles[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid'], 'minetype' => $value->_param['filetype'], 'size' => $value->_param['size'],'thumbnail' => $value->_param['thumbnail'],'fileurl' => $fileUrl);
     75                                        $fileUrl="";
     76                                        if ($value->_param['fileurl']!=""){
     77                                        $fileUrl = $this->config->item('api_url').$value->_param['fileurl'];
     78                                        }
     79                                        $thumbnail="";
     80                                        if ($value->_param['thumbnail']!=""){
     81                                        $thumbnail = $this->config->item('api_url').$value->_param['thumbnail'];
     82                                        }
     83                                        $aryFiles[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid'], 'minetype' => $value->_param['filetype'], 'size' => $value->_param['size'],'thumbnail' => $thumbnail,'fileurl' => $fileUrl);
    7784                                }
    7885                        }else {
     
    161168        }
    162169
    163         public function upload() {
    164 
     170        public function test() {
     171            echo $this->vservices->actionExecute('test');
    165172        }
    166173}
  • pro-violet-viettel/www/deploy/20150304/assets/js/grid.js

    r891 r892  
    2424                                var thumb = null;
    2525                                var filehosting = o.manager.getFileHosting();
    26                 if (node.item.thumbnail != "")
    27                 { 
    28                     thumb = $('<img>', {src:node.item.thumbnail,align:'middle'});
    29                 }
    30                 else
    31                 {
    32                                         if($.inArray( type.toLowerCase(), [ "jpg", "jpeg", "png", "bmp"])>=0)
    33                                         {
    34                                                  thumb = $('<img>', {src: ""+ node.item.fileurl,align:'middle'});
    35                                         }
    36                 }
    37 
    38                                 var div = $('<div></div>',{'class':icon});
    39                                 if (thumb != null) $(div).append(thumb);
     26                                var filedomain = o.manager.getFileDomain();
     27                                   
     28
     29                                if (node.item.thumbnail != '')
     30                                { 
     31                                    thumb = $('<img>', {src:node.item.thumbnail,align:'middle'});
     32                                   
     33                                }
     34                                var div = $('<div></div>',{'class':icon});
     35                                 $(div).append(thumb);
     36
     37                               
     38                               
     39                               
    4040
    4141                                var typeid = type == 'directory' ? 'directory':'file';
  • pro-violet-viettel/www/deploy/20150304/assets/js/manager.js

    r891 r892  
    1 if (jQuery)
     1if (jQuery) 
    22    (function ($) {
    33        $
     
    4141                                if (o.filehosting == undefined)
    4242                                    o.filehosting = 'http://sbgapi.violet.vn/uploads/space';
    43 
     43                                if (o.filedomain == undefined)
     44                                    o.filedomain = 'http://sbgapi.violet.vn';
    4445                                if (o.invisibledButtons == undefined)
    4546                                    o.invisibledButtons = null;
     
    415416                                var btnDownloadClick = function () {
    416417                                    var items = o.oGrid.getHighLightItem();
    417                                      /*       
    418                                     if ($(items).length == 0) {
    419                                         var node = o.oTree.getSelectedNode();
    420                                         var itemID = $(node).attr('id');
    421 
    422                                         if (itemID == 0)
    423                                             return false;
    424 
    425                                         items[0] = o.data.DIRECTORIES[searchItemByID(
    426                                                 itemID, 'directory')];
    427                                         items[0].type = 'directory';
    428                                     }
    429                                     */
     418                                   
     419
    430420                                    for (var i = 0; i < items.length; i++) {
    431421                                        if (items[i].type == 'directory') {
     422                                           
    432423                                            items[i] = self.getAllDirChilds(items[i]);
    433424                                        }
     
    623614                                    $ext = $ext.toLowerCase();
    624615                                    if ($.inArray($ext, ["jpg", "jpeg", "png","gif","tiff","dvg","bmp"]) >= 0) {
    625                                         alert (node.fileurl);
     616                                       
    626617                                        content = "<img style='width:100%' src='"
    627618                                                + node.fileurl
     
    806797                                                                for (var i = 0; i < $(newFileData.FILES).length; i++) {
    807798                                                                    var file = newFileData.FILES[i];
     799                                                                   
    808800                                                                    var node = {
    809                                                                         thumbnail: file.thumbnail,
     801                                                                       
     802                                                                        thumbnail: o.filedomain+"/"+file.thumbnail,
    810803                                                                        id: file.id,
    811804                                                                        name: file.name,
     
    821814                                                                for (var i = 0; i < $(newFileData.DIRECTORIES).length; i++) {
    822815                                                                    var file = newFileData.DIRECTORIES[i];
     816                                                       
    823817                                                                    var node = {
    824818                                                                        id: file.id,
     
    14541448                                        return o.filehosting;
    14551449                                }
     1450                                this.getFileDomain = function () {
     1451                                        return o.filedomain;
     1452                                }
    14561453
    14571454                                this.initialize = function () {
Note: See TracChangeset for help on using the changeset viewer.