Index: pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php	(revision 861)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php	(revision 873)
@@ -162,4 +162,53 @@
         return $item;
     }
+    
+    private function createPreview($fileurl, $userId, $fileid) {
+    	$url = "https://docs.google.com/gview?url=" .urlencode($fileurl) . "";
+    	file_put_contents("1.html", $url);
+    	$content="";
+    	$ch = curl_init();
+    	curl_setopt($ch, CURLOPT_URL, $url);
+    	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
+    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    	$content = curl_exec($ch);
+    	file_put_contents("1.html", $content);
+    	preg_match("'img\?id\\\u003d(.*?)%3D'si", $content, $matches);
+    	$count=0;
+    	if (isset($matches[1]))
+    	{
+    		$id = $matches[1];
+    		$count=0;
+    		for ($i = 0; $i <= 20; $i++) {
+    			$imgurl = "https://docs.google.com/viewerng/img?id=" . $id . "&w=600&page=" . $i;
+    			$ch = curl_init();
+    			curl_setopt($ch, CURLOPT_URL, $imgurl);
+    			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
+    			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    			$image = curl_exec($ch);
+    			$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+    			if ($code == 200)
+    			{
+    
+    				$count++;
+    				if (!file_exists('previews/'. $userId."/")) {
+    					mkdir('previews/'. $userId."/", 0777, true);
+    				}
+    
+    				if (!file_exists('previews/'. $userId."/".$fileid."/")) {
+    
+    					mkdir('previews/'. $userId."/".$fileid."/", 0777, true);
+    
+    				}
+    				file_put_contents("previews/" . $userId . "/" . $fileid . "/" . $i . ".png", $image);
+    
+    			} else {
+    				break;
+    			}
+    		}
+    
+    	}
+    	return $count;
+    }    
+    
     public function executePreview(){
         $fileId = $this->getRequestParameter('fileId');
@@ -428,54 +477,4 @@
     }
 
-    private function createPreview($fileurl, $userId, $fileid) {
-
-       
-        $url = "https://docs.google.com/gview?url=" .urlencode($fileurl) . "";
-        file_put_contents("1.html", $url);
-        $content="";
-        $ch = curl_init();
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-        $content = curl_exec($ch);
-       file_put_contents("1.html", $content);
-        preg_match("'img\?id\\\u003d(.*?)%3D'si", $content, $matches);
-        $count=0;
-        if (isset($matches[1]))
-        {
-        $id = $matches[1];
-        $count=0;
-        for ($i = 0; $i <= 20; $i++) {
-            $imgurl = "https://docs.google.com/viewerng/img?id=" . $id . "&w=600&page=" . $i;
-            $ch = curl_init();
-            curl_setopt($ch, CURLOPT_URL, $imgurl);
-            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
-            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-            $image = curl_exec($ch); 
-            $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-            if ($code == 200) 
-            {
-                
-                $count++;
-                if (!file_exists('previews/'. $userId."/")) {
-                    mkdir('previews/'. $userId."/", 0777, true); 
-                }
-                
-                if (!file_exists('previews/'. $userId."/".$fileid."/")) {
-                    
-                    mkdir('previews/'. $userId."/".$fileid."/", 0777, true); 
-                    
-                }
-                file_put_contents("previews/" . $userId . "/" . $fileid . "/" . $i . ".png", $image);
-
-            } else {
-                break;
-            }
-        }
-        
-        }
-        return $count;
-    }
-
     public function executeSave() {
         $content = file_get_contents('php://input');
@@ -546,9 +545,10 @@
         return sfView::NONE;
     }
+    
     public function executeGetFiles()
     {
        $tblfile = TblspacefilePeer::retrieveByPk(64);
        print_r($tblfile);
-      return sfView::NONE;
+       return sfView::NONE;
     }
 }
