Index: pro-bachkim-filespace/sourcecode/application/config/autoload.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/config/autoload.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/config/autoload.php	(revision 66)
@@ -65,5 +65,5 @@
 */
 
-$autoload['helper'] = array('url','text');
+$autoload['helper'] = array('url','text','file');
 
 
Index: pro-bachkim-filespace/sourcecode/application/config/foreign_chars.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/config/foreign_chars.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/config/foreign_chars.php	(revision 66)
@@ -17,6 +17,15 @@
 	'/Ã|Ã|Ã|Ã|Ã|Ã
 |Çº|Ä|Ä|Ä|Ç/' => 'A',
+	'/Ã|Ã|áº |áº¢|áºŠ|áº€|áºš|áºª|áº¬|áº°|áº®|áº²|áºª|áº¶/' => 'A',
 	'/Ã |Ã¡|Ã¢|Ã£|Ã¥|Ç»|Ä|Ä|Ä
 |Ç|Âª/' => 'a',
+	'/aÌ|aÌ|Ã£|áº¡|áº£|Ã¢Ì|áº¥|áº©|áº«|Ã¢Ì£|áº±|áº¯|áº³|áºµ|áº·|aÌ£/' => 'a',
+	'/nháº­t/' => 'nhat',
+	'/Nháº­t/' => 'Nhat',
+	'/láº§n/' => 'lan',
+	'/Láº§n/' => 'Lan',
+	'/táº­p/' => 'tap',
+	'/Táº­p/' => 'Tap',
+	'/\|/' => '-',
 	'/Ã|Ä|Ä|Ä|Ä/' => 'C',
 	'/Ã§|Ä|Ä|Ä|Ä/' => 'c',
@@ -24,11 +33,14 @@
 	'/Ã°|Ä|Ä/' => 'd',
 	'/Ã|Ã|Ã|Ã|Ä|Ä|Ä|Ä|Ä/' => 'E',
+	'/Ã|Ã|áºº|áºž|áºŒ|á»|áºŸ|á»|á»|á»/' => 'E',
 	'/Ãš|Ã©|Ãª|Ã«|Ä|Ä|Ä|Ä|Ä/' => 'e',
+	'/Ãš|Ã©|áº»|áºœ|áº¹|á»|áº¿|á»|á»
+|á»|ÃªÌ|eÌ|eÌ/' => 'e',
 	'/Ä|Ä|Ä |Ä¢/' => 'G',
 	'/Ä|Ä|Ä¡|Ä£/' => 'g',
 	'/Ä€|ÄŠ/' => 'H',
 	'/Ä¥|Ä§/' => 'h',
-	'/Ã|Ã|Ã|Ã|Äš|Äª|Ä¬|Ç|Ä®|Ä°/' => 'I',
-	'/Ã¬|Ã­|Ã®|Ã¯|Ä©|Ä«|Ä­|Ç|Ä¯|Ä±/' => 'i',
+	'/Ã|Ã|Ã|Ã|Äš|Äª|Ä¬|Ç|Ä®|Ä°|á»|á»/' => 'I',
+	'/Ã¬|Ã­|Ã®|Ã¯|Ä©|Ä«|Ä­|Ç|Ä¯|Ä±|á»|á»/' => 'i',
 	'/ÄŽ/' => 'J',
 	'/Äµ/' => 'j',
@@ -41,5 +53,7 @@
 	'/Ã±|Å|Å|Å|Å/' => 'n',
 	'/Ã|Ã|Ã|Ã|Å|Å|Ç|Å|Æ |Ã|ÇŸ/' => 'O',
+	'/Ã|Ã|á»|Ã|á»|Ã|á»|á»|á»|á»|á»|Æ |á»|á»|á»|á» |á»¢/' => 'O',
 	'/Ã²|Ã³|ÃŽ|Ãµ|Å|Å|Ç|Å|Æ¡|Ãž|Ç¿|Âº/' => 'o',
+	'/Ã²|Ã³|á»|Ãµ|á»|ÃŽ|á»|á»|á»|á»|á»|Æ¡|á»|á»|Æ¡Ì|á»¡|á»£|oÌ|oÌ|oÌ£/' => 'o',
 	'/Å|Å|Å/' => 'R',
 	'/Å|Å|Å/' => 'r',
@@ -48,8 +62,9 @@
 	'/Å¢|Å€|ÅŠ/' => 'T',
 	'/Å£|Å¥|Å§/' => 't',
-	'/Ã|Ã|Ã|Åš|Åª|Å¬|Å®|Å°|Å²|Æ¯|Ç|Ç|Ç|Ç|Ç/' => 'U',
-	'/Ã¹|Ãº|Ã»|Å©|Å«|Å­|Å¯|Å±|Å³|Æ°|Ç|Ç|Ç|Ç|Ç/' => 'u',
-	'/Ã|Åž|Å¶/' => 'Y',
-	'/Ãœ|Ã¿|Å·/' => 'y',
+	'/Ã|Ã|Ã|Åš|Åª|Å¬|Å®|Å°|Å²|Æ¯|Ç|Ç|Ç|Ç|Ç|Åš|á»Š|á»€|á»ª|á»š|á»¬|á»®|á»°/' => 'U',
+	'/Ã¹|Ãº|Ã»|Å©|Å«|Å­|Å¯|Å±|Å³|Æ°|Ç|Ç|Ç|Ç|Ç|uÌ|á»§|á»¥|á»«|á»©|á»­|Æ°Ì|á»±|Æ°Ì|uÌ|uÌ/' => 'u',
+	'/uÌ/' => 'u',
+	'/Ã|Åž|Å¶|á»ž|á»¶|á»Ž|á»²/' => 'Y',
+	'/Ãœ|Ã¿|Å·|á»¹|á»·|á»µ|á»³/' => 'y',
 	'/ÅŽ/' => 'W',
 	'/Åµ/' => 'w',
@@ -61,5 +76,6 @@
 	'/Ä³/' => 'ij',
 	'/Å/' => 'OE',
-	'/Æ/' => 'f'
+	'/Æ/' => 'f',
+	'/: |\//' => ' - ',
 );
 
Index: pro-bachkim-filespace/sourcecode/application/libraries/vservices.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/libraries/vservices.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/libraries/vservices.php	(revision 66)
@@ -6,4 +6,5 @@
 	private $_curlObj;
 	private $_userId;
+	private $_password;
 	
 	public function __construct() {
@@ -23,4 +24,8 @@
 	}
 	
+	public function setPassword ($password) {
+		$this->_password = $password;
+	}
+	
 	public function getPrivateTree () {
 		$this->_curlObj->create($this->_apiUrl. 'space/dir/isgetall/1');
@@ -30,4 +35,20 @@
 		$post = array('userid' => $this->_userId);
 		$this->_curlObj->post($post);
+		return $this->_curlObj->execute();
+	}
+	
+	/**
+	 * $aryParams
+	 * 
+	 * @param unknown $action
+	 * @param unknown $aryParams
+	 */
+	public function actionExecute ($action, $aryParams = array()) {
+		$this->_curlObj->create($this->_apiUrl. 'space/'.$action);
+		$this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
+		$this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
+		
+		$aryParams['userid'] = $this->_userId;
+		$this->_curlObj->post($aryParams);
 		return $this->_curlObj->execute();
 	}
@@ -42,4 +63,14 @@
 		return $this->_curlObj->execute();
 	}
+	
+	public function deleteDir ($dirId) {
+		$this->_curlObj->create($this->_apiUrl. 'space/delete');
+		$this->_curlObj->option(CURLOPT_BUFFERSIZE, 10);
+		$this->_curlObj->options(array(CURLOPT_BUFFERSIZE => 10));
+		
+		$post = array('userid' => $this->_userId, 'type' => 'folder', 'id' => $dirId);
+		$this->_curlObj->post($post);
+		return $this->_curlObj->execute();
+	}
 		
 	public function __destruct() {
Index: pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/modules/ajax/controllers/privatecontent.php	(revision 66)
@@ -42,27 +42,38 @@
 		$xmlData = $this->vservices->getPrivateTree();
 		$this->xml->parse($xmlData);
-
 		$aryDirs = array();
 		$aryFiles = array();
+		write_file('log.txt', var_export($xmlData, true));
 		
-		$aryError = array('err' => $this->xml->tree->_param['err'], 'errCode' => $this->xml->tree->_param['errCode']);
+		if (!isset($this->xml->tree)) {
+			$aryError = array('err' => 'KhÃŽng thá» káº¿t ná»i Äáº¿n mÃ¡y chá»§!', 'errCode' => '-1');
+			$aryData = array('DIRECTORIES' =>  array() , 'FILES' => array(), 'ERROR' => $aryError);
+			echo json_encode($aryData);
+			return;
+		}
 		
-		if (is_array($this->xml->tree->folderlist->folder)) {
-			foreach($this->xml->tree->folderlist->folder as $key=>$value){
-				$aryDirs[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid']);
+		$aryError = array('err' => $this->xml->tree->_param['err'], 'errCode' => (int)$this->xml->tree->_param['errCode']);
+		
+		if (isset($this->xml->tree->folderlist->folder)) {
+			if (is_array($this->xml->tree->folderlist->folder)) {
+				foreach($this->xml->tree->folderlist->folder as $key=>$value){
+					$aryDirs[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid']);
+				}
+			}
+			else {
+				$folder = $this->xml->tree->folderlist->folder;
+				$aryDirs[] = array('id' => $folder->_param['id'], 'name' => $folder->_value,'parentID' => $folder->_param['parentid'] == -1 ? 0:$folder->_param['parentid']);
 			}
 		}
-		else if (isset($this->xml->tree->folderlist->folder)) {
-			$folder = $this->xml->tree->folderlist->folder;
-			$aryDirs[] = array('id' => $folder->_param['id'], 'name' => $folder->_value,'parentID' => $folder->_param['parentid'] == -1 ? 0:$folder->_param['parentid']);
-		}
 		
-		if (is_array($this->xml->tree->filelist->file)) {
-			foreach($this->xml->tree->filelist->file as $key=>$value){
-				$aryFiles[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid'], 'minetype' => $value->_param['filetype']);
+		if (isset($this->xml->tree->filelist->file)) {
+			if (is_array($this->xml->tree->filelist->file)) {
+				foreach($this->xml->tree->filelist->file as $key=>$value){
+					$aryFiles[] = array('id' => $value->_param['id'], 'name' => $value->_value, 'parentID' => $value->_param['parentid'] == -1 ? 0:$value->_param['parentid'], 'minetype' => $value->_param['filetype']);
+				}
+			}else {
+				$file = $this->xml->tree->filelist->file;
+				$aryFiles[] = array('id' => $file->_param['id'], 'name' => $file->_value,'parentID' => $file->_param['parentid'] == -1 ? 0:$file->_param['parentid'], 'minetype' => $file->_param['filetype']);
 			}
-		}else if (isset($this->xml->tree->filelist->file)) {
-			$file = $this->xml->tree->filelist->file;
-			$aryFiles[] = array('id' => $file->_param['id'], 'name' => $file->_value,'parentID' => $file->_param['parentid'] == -1 ? 0:$file->_param['parentid'], 'minetype' => $file->_param['filetype']);
 		}
 		
@@ -74,8 +85,8 @@
 		$parentDir =  $this->input->post('fparentid',TRUE);
 		$name =  $this->input->post('fname',TRUE);
-		$xmlData = $this->vservices->actionExecute('mkdir',array('name' => $name, 'parent_id' => $parentDir));
+		$xmlData = $this->vservices->actionExecute('mkdir',array('name' => $name, 'parent_id' => $parentDir == 0 ? -1:$parentDir));
 		
 		$this->xml->parse($xmlData);
-		$aryError = array('err' => $this->xml->status->_param['err'], 'errCode' => $this->xml->status->_param['errCode']);
+		$aryError = array('err' => $this->xml->status->_param['err'], 'errCode' => (int)$this->xml->status->_param['errCode']);
 		$aryData = array('id' => $this->xml->status->_param['id'], 'name' => $name, 'parentID' => $parentDir, 'ERROR' => $aryError);
 		echo json_encode($aryData);
@@ -83,14 +94,10 @@
 	
 	public function deleteDir () {
-		$dirID =  $this->input->post('id',TRUE);
-		$xmlData = $this->vservices->actionExecute('delete',array('id' => $dirID, 'type' => 'folder'));
-		
-		
-		/* $delAllChild = $this->input->post('delallchild',TRUE);
-		
-		$aryChild = $this->objDirectory->getAllDirChild($dirID);
-		$aryResult = array('isSuccess' => TRUE);
-		
-		echo json_encode($aryChild); */
+		$delobj =  $this->input->post('delobj',TRUE);
+		$xmlData = $this->vservices->actionExecute('deletemulti',array('delobj' => $delobj));
+		$this->xml->parse($xmlData);
+		$aryError = array('err' => $this->xml->tree->_param['err'], 'errCode' => (int)$this->xml->tree->_param['errCode']);
+		$aryData = array('ERROR' => $aryError);
+		echo json_encode($aryData);
 	}
 	
Index: pro-bachkim-filespace/sourcecode/application/views/layout/contextmenu.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/views/layout/contextmenu.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/views/layout/contextmenu.php	(revision 66)
@@ -7,6 +7,5 @@
 	<li class="rename separator"><a href="#rename">Äá»i tÃªn</a></li>
 </ul>
-
-<ul id="gridMenu" class="contextMenu">
+<ul id="gridMenuDir" class="contextMenu">
 	<li class="open"><a href="#open">Má»</a></li>
 	<li class="preview"><a href="#preview">Xem trÆ°á»c</a></li>
@@ -18,5 +17,14 @@
 	<li class="rename separator"><a href="#rename">Äá»i tÃªn</a></li>
 </ul>
-
+<ul id="gridMenuFile" class="contextMenu">
+	<li class="open"><a href="#open">Má»</a></li>
+	<li class="preview"><a href="#preview">Xem trÆ°á»c</a></li>
+	<li class="newfolder separator"><a href="#newfolder">Táº¡o thÆ° má»¥c má»i</a></li>
+	<li class="share separator"><a href="#share">Chia sáº»</a></li>
+	<li class="copy separator"><a href="#copy">Sao chÃ©p Äáº¿n ...</a></li>
+	<li class="cut"><a href="#cut">Di chuyá»n Äáº¿n...</a></li>
+	<li class="delete"><a href="#delete">XÃ³a</a></li>
+	<li class="rename separator"><a href="#rename">Äá»i tÃªn</a></li>
+</ul>
 <ul id="gridMenuParent" class="contextMenu">
 	<li class="open"><a href="#open">Má»</a></li>
Index: pro-bachkim-filespace/sourcecode/application/views/layout/footer.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/views/layout/footer.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/views/layout/footer.php	(revision 66)
@@ -3,5 +3,5 @@
 $this->load->view('layout/modalform');
 ?>
-<script type="text/javascript">
+<!-- <script type="text/javascript">
 	window.jQuery || document.write("<script src='assets/js/jquery/jquery-1.11.1.min.js'>"+"<"+"/script>");
 </script>
@@ -23,11 +23,30 @@
 <script src="assets/js/vsgrid.js"></script>
 <script src="assets/js/vstree.js"></script>
+<script type="text/javascript" src="assets/js/filemanager/filemanager.js"></script> -->
 
-<!-- <script src="assets/js/vscontextmenu.js"></script>
-<script src="assets/js/jquery/jqueryFileTree.js"></script> -->
+<script src="assets/js/jquery/jquery-1.11.1.min.js"></script>
+<script src="assets/js/jquery/jquery-ui-1.10.4.min.js"></script>
+<script src="assets/js/jquery/jquery.contextMenu.js"></script>
+<script src="assets/js/bootstrap/bootstrap.min.js"></script>
+<script src="assets/js/bootstrap/bootbox.min.js"></script>
 
-<script type="text/javascript" src="assets/js/filemanager/filemanager.js">
-
-</script>
+<script src="assets/js/tree.js"></script>
+<script src="assets/js/grid.js"></script>
+<script src="assets/js/manager.js"></script>
+	<script type="text/javascript">
+		var data = {"DIRECTORIES":[{"id":"1","name":"Dir1","parentID":0},{"id":"2","name":"E1","parentID":0},{"id":"4","name":"Th\u01b0 m\u1ee5c c\u1ee7a D\u0169ng","parentID":0},{"id":"3","name":"E1.1","parentID":"2"},{"id":"5","name":"D\u0169ng 1","parentID":"4"},{"id":"8","name":"D\u0169ng 2","parentID":"4"},{"id":"6","name":"Dir 3","parentID":"5"},{"id":"7","name":"Dir3.1","parentID":"6"}],"FILES":[{"id":"1","name":"File 1","parentID":"1","minetype":"text"},{"id":"2","name":"File in root 1","parentID":0,"minetype":"text"}],"ERROR":{"err":"","errCode":""}}
+		if(jQuery){
+			var manager = $().violetFileManager({
+				tree: 'treeview-container',
+				grid: 'file-container',
+				maincontainer: 'main-content',
+				titlebar: 'title-bar',
+				toolsbar: 'tools-bar',
+				statusbar: 'status-bar',
+				datasource: 'ajax'/* 'json' ,
+				data: data*/
+			});
+		}
+	</script>
 </body>
 </html>
Index: pro-bachkim-filespace/sourcecode/application/views/layout/modalform.php
===================================================================
--- pro-bachkim-filespace/sourcecode/application/views/layout/modalform.php	(revision 44)
+++ pro-bachkim-filespace/sourcecode/application/views/layout/modalform.php	(revision 66)
@@ -141,42 +141,2 @@
 </div>
 <!-- END:UPLOAD modal box -->
-
-<!-- BEGIN:New folder box -->
-<div id="box-newfolder" class="modal" tabindex="-1">
-	<div class="modal-dialog">
-		<div class="modal-content">
-			<div class="modal-header">
-				<button type="button" class="close" data-dismiss="modal">&times;</button>
-				<h4 class="blue bigger">Táº¡o thÆ° má»¥c má»i</h4>
-			</div>
-			<div class="modal-body overflow-visible">
-				<form id="frm-newfolder">
-					<div class="row">
-						<div class="col-xs-12">
-							<div class="input-group">
-								<div class="radio">
-									<label for="f-newfoldername">TÃªn thÆ° má»¥c</label>
-									<div>
-										<input type="text" id="f-newfoldername" name="fname" class="form-control" style="width:525px">
-										<input type="hidden" id="f-parentid" name="fparentid">
-									</div>
-								</div>
-							</div>
-						</div>
-					</div>
-				</form>
-			</div>
-			<div class="modal-footer">
-				<button id="btn-submit-newfolder" class="btn btn-sm btn-primary">
-					<i class="icon-folder-close"></i>
-					OK
-				</button>
-				<button class="btn btn-sm" data-dismiss="modal">
-					<i class="icon-remove"></i>
-					ÄÃ³ng
-				</button>
-			</div>
-		</div>
-	</div>
-</div>
-<!-- END:New folder box -->
