Index: pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php
===================================================================
--- pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php	(revision 840)
+++ pro-violet-viettel/www/deploy/20150304/application/modules/ajax/controllers/download.php	(revision 841)
@@ -14,13 +14,44 @@
 	
 	public function getFile () {
-                $file = $this->config->item('api_url').'uploads/space/3/3854/1.JPG';
-                header('Content-Description: File Transfer');
-                header('Content-Type: application/octet-stream');
-                header('Content-Disposition: attachment; filename='.basename($file));
-                header('Expires: 0');
-                header('Cache-Control: must-revalidate');
-                header('Pragma: public');
-                header('Content-Length: ' . filesize($file));
-                readfile($file);
+                $file=  $this->input->post('file');
+                $folder=  $this->input->post('folder');
+                $files = $this->vservices->actionExecute('getFiles',array("file"=>$file,"folder"=>$folder));
+                echo "<pre>";
+                print_r($files); 
+                echo "</pre>"; 
+                die();
+                $file = file_get_contents($fileurl);  
+                file_put_contents("1.jpg", $file);
+                $local_file="1.jpg";
+                $download_rate = 512;
+                $download_file = $this->input->post('filename');
+ 
+                    // send headers
+    header('Cache-control: private');
+    header('Content-Type: application/octet-stream');
+    header('Content-Length: '.filesize($local_file));
+    header('Content-Disposition: filename='.$download_file);
+ 
+    // flush content
+    flush();
+ 
+    // open file stream
+    $file = fopen($local_file, "r");
+ 
+    while (!feof($file)) {
+ 
+        // send the current file part to the browser
+        print fread($file, round($download_rate * 1024));
+ 
+        // flush the content to the browser
+        flush();
+ 
+        // sleep one second
+        sleep(1);
+    }
+ 
+    // close file stream
+    fclose($file);
+    
                 exit;
             
Index: pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php
===================================================================
--- pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php	(revision 840)
+++ pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/index.php	(revision 841)
@@ -11,3 +11,4 @@
 <script type="text/javascript">
  $(".html5gallery").html5gallery();  
+ $( ".bootbox" ).addClass( "preview" );
 </script>
Index: pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/video.php
===================================================================
--- pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/video.php	(revision 840)
+++ pro-violet-viettel/www/deploy/20150304/application/modules/ajax/views/preview/video.php	(revision 841)
@@ -1,8 +1,9 @@
 
-<div style="display:none;" class="html5gallery" data-skin="darkness" data-width="540" data-height="300">
-    <a href="<?php echo $fileurl;?>"><img src="<?php echo $fileurl;?>" title="<?php echo $name;?>" alt="<?php echo $name;?>"></a>
+<div  data-autoplayvideo="true"  data-playvideoonclick="true"  style="display:none;" class="html5gallery" data-skin="darkness" data-width="540" data-height="300">
+    <a  href="<?php echo $fileurl;?>"><img src="<?php echo $fileurl;?>" title="<?php echo $name;?>" alt="<?php echo $name;?>"></a>
 
 </div>
 <script type="text/javascript">
- $(".html5gallery").html5gallery();  
+ $(".html5gallery").html5gallery(); 
+ $( ".bootbox" ).addClass( "preview" );
 </script>
Index: pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
===================================================================
--- pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 840)
+++ pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 841)
@@ -317,6 +317,21 @@
                 var btnDownloadClick = function () {
                     var items = o.oGrid.getHightLightItem();
-                    
-                    window.location.href = o.host+"download/getFile/"+items[0].id;
+                    var fileid= new Array();
+                    var folder= new Array();
+                    for (var i = 0; i < $(items).length; i++) {
+                                        if(items[i].type=="file")
+                                        {
+                                        var file = items[i].id;              
+                                        fileid.push(file);
+                                        }
+                                        if(items[i].type=="directory")
+                                        {
+                                        var file = items[i].id;              
+                                        folder.push(file);
+                                        }
+                    }
+                    console.log(fileid.toString());
+                    var redirect = o.host+"download/getFile/";  
+                    $.redirectPost(redirect, {file: fileid.toString(),folder: folder.toString()}); 
                 }
 
@@ -522,5 +537,5 @@
                     if($.inArray( $ext, ["ppt","xls","doc","pdf","docx","pptx","xlsx"])>=0)
 		   {
-                          
+                            
                             $.ajax({
                             url: o.host+"preview/getFilePreview/"+node.id,
@@ -540,9 +555,9 @@
                     if($.inArray( $ext, [ "xvl"])>=0)
 		   {
-                       var redirect = o.host + 'frontend/lecture/';
+                       var url = o.host.replace("ajax/", "");  
+                       var redirect = url + 'frontend/lecture/';
                        self.redirectPost(redirect, {fileid: node.id}); 
                     } 
-                    
-                     
+                    $( ".bootbox" ).addClass( "preview" );
                 }
                 
@@ -1011,5 +1026,5 @@
                 }
                 
-    			this.formatFileSize = function (size) {
+    		this.formatFileSize = function (size) {
     		        var i;
     		        i = Math.floor(Math.log(size) / Math.log(1024));
@@ -1021,6 +1036,6 @@
     		        } else {
     		            return (size / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][i];
-    		        }
-    			}
+    		        }}
+    			
 
                 this.initialize = function () {
@@ -1031,4 +1046,5 @@
                 return this.initialize();
             }
+        
         });
     })(jQuery);
