Index: /pro-violet-viettel/www/deploy/20150304/application/config/routes.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/config/routes.php	(revision 823)
+++ /pro-violet-viettel/www/deploy/20150304/application/config/routes.php	(revision 824)
@@ -127,5 +127,5 @@
 $route['admin/card_log/trang'] = 'admin/cardlog/get_cardlogs/1';
 $route['admin/card_log/trang/:any'] = 'admin/cardlog/get_cardlogs/$1';
-
+$route['frontend/lecture/:any'] = 'frontend/lecture/index';
 $route['frontend/user/trade_history/:num/page'] = 'frontend/user/trade_history/$1/1';
 $route['frontend/user/trade_history/:num/page/:any'] = 'frontend/user/trade_history/$1/$2';
Index: /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/controllers/lecture.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/controllers/lecture.php	(revision 823)
+++ /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/controllers/lecture.php	(revision 824)
@@ -54,8 +54,9 @@
                $first_visit=1;
             }
+            $fileid=$this->uri->segment(3,"");
             
             $isOverDate = strtotime($u['expire_date']) < strtotime(date('Y-m-d')) ? 0:1; 
  
-            $this->load->view('lecture_editor', array('username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams,'update_user_info'=>$update_user_info,'us_id'=>$us_id,"p_period"=>$u['p_period'],"expire_date"=>date("d-m-Y", strtotime($u['expire_date'])), 'isOverDate' => $isOverDate , "fullname"=>$info['fullname'], "school"=>$info['school'], "province"=>$u['province'], "provinces"=>lang('_PROVINCES_')));
+            $this->load->view('lecture_editor', array('fileid'=>$fileid,'username' => $username, 'licenseAvailable' => $licenseAvailable, 'first_visit' => $first_visit, 'licflashVars' => $aryParams,'update_user_info'=>$update_user_info,'us_id'=>$us_id,"p_period"=>$u['p_period'],"expire_date"=>date("d-m-Y", strtotime($u['expire_date'])), 'isOverDate' => $isOverDate , "fullname"=>$info['fullname'], "school"=>$info['school'], "province"=>$u['province'], "provinces"=>lang('_PROVINCES_')));
         } else {
             redirect('/frontend/home/');
Index: /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/views/lecture_editor.php
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/views/lecture_editor.php	(revision 823)
+++ /pro-violet-viettel/www/deploy/20150304/application/modules/frontend/views/lecture_editor.php	(revision 824)
@@ -117,5 +117,7 @@
     var update_user_info="<?php echo $update_user_info;?>";
     var us_id="<?php echo $us_id;?>";
-    var is_overdate = <?php echo $isOverDate;?>
+    var is_overdate = <?php echo $isOverDate;?>;
+    var fileid = <?php echo $fileid;?>;
+
 </script>		
 <?php
Index: /pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js	(revision 823)
+++ /pro-violet-viettel/www/deploy/20150304/assets/js/frontend/lecture.js	(revision 824)
@@ -174,7 +174,12 @@
 
 $(document).ready(function () {
-    InitViolet();
-    //$('#open-lecture').click(function(e){DoOpenLecture('http://sbgapi.violet.vn/space/file/id/7');});
-	var inFormOrLink = false;
+      InitViolet();
+    if(fileid!="")
+    {
+      
+    $('#open-lecture').click(function(e){DoOpenLecture('http://sbgapi.violet.vn/space/file/id/'+fileid);});
+    }
+   
+        var inFormOrLink = false;
 
 	$(window).on('beforeunload', function() {
Index: /pro-violet-viettel/www/deploy/20150304/assets/js/manager.js
===================================================================
--- /pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 823)
+++ /pro-violet-viettel/www/deploy/20150304/assets/js/manager.js	(revision 824)
@@ -310,4 +310,9 @@
 
                 }
+                var btnDownloadClick = function () {
+                    var items = o.oGrid.getHightLightItem();
+                    
+                    window.location.href = o.host+"download/getFile/"+items[0].id;
+                }
 
                 var btnDelClick = function () {
@@ -360,4 +365,7 @@
                     $(btnPreview).click(function (e) {
                         btnPreviewClick()
+                    })
+                    $(btnDownload).click(function (e) {
+                        btnDownloadClick()
                     })
 
@@ -525,6 +533,9 @@
                         }); 
                     }
-
-                    
+                    if($.inArray( $ext, [ "xvl"])>=0)
+		   {
+                       var redirect = 'http://spacedemo.violet.vn/frontend/lecture/'+node.id;
+                        $.redirectPost(redirect, {fileid: node.id});
+                    } 
                     
                     
@@ -964,2 +975,13 @@
         });
     })(jQuery);
+$.extend(
+{
+    redirectPost: function(location, args)
+    {
+        var form = '';
+        $.each( args, function( key, value ) {
+            form += '<input type="hidden" name="'+key+'" value="'+value+'">';
+        });
+        $('<form action="'+location+'" method="POST">'+form+'</form>').appendTo('body').submit();
+    }
+});
