/**
  * Exports designer project
  */
 public function export($info)
 {
     $chunk = new Chunk();
     if (!$chunk->save($info)) {
         header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request', true, 400);
         return array();
     }
     if ($chunk->last()) {
         ProviderLog::start('export');
         ProviderLog::start('export:json_decode');
         $content = json_decode($chunk->complete(), true);
         ProviderLog::end('export:json_decode');
         $this->_exportTheme($content);
         ProviderLog::end('export');
         return array('result' => 'done', 'log' => ProviderLog::getLog());
     }
     return array('result' => 'processed');
 }
 public function ajaxProcessFsoZip()
 {
     try {
         $chunk = new Chunk();
         if (!$chunk->save($this->_getChunkInfo())) {
             header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request', true, 400);
             return array();
         }
         if (!$chunk->last()) {
             return array('result' => 'processed');
         }
         $data = json_decode($chunk->complete(), true);
         if (!isset($data['fso'])) {
             throw new Exception('Empty fso');
         }
         $designer = $this->getDesignerObj();
         $response = $designer->zipFso($data);
         die(Tools::jsonEncode($response));
     } catch (PermissionsException $e) {
         die($this->_exceptionResponse($e));
     }
 }