function execute($languages, $menuIdArray, $title, $subtitle, $creditPageId, $isExhibitionActive) { if ($this->user->isLogged()) { $languages = is_array($languages) ? $languages : array($languages); $exportPath = __Paths::get('CACHE') . 'export/'; $mediaPath = $exportPath . 'media/'; $graphPath = $exportPath . 'graph/'; $zipFolder = __Paths::get('BASE') . 'export/'; $zipFile = $zipFolder . 'mobileContents.zip'; $creditPageId = str_replace('internal:', '', $creditPageId); $steps = array(); $steps[] = array('action' => 'PrepareExport', 'params' => array('exportPath' => $exportPath, 'languages' => $languages, 'mediaPath' => $mediaPath, 'graphPath' => $graphPath, 'zipFolder' => $zipFolder, 'zipFile' => $zipFile)); $steps[] = array('action' => 'ExportCodes'); foreach ($languages as $languageId) { $ar = __ObjectFactory::createModel('org.glizycms.core.models.Language'); $ar->load($languageId); $sqliteDb = $exportPath . $ar->language_name . '.db'; $languageCode = $ar->language_code; $steps[] = array('action' => 'Export', 'params' => array('mediaPath' => $mediaPath, 'languageId' => $languageId, 'languageCode' => $languageCode, 'menuIdArray' => $menuIdArray, 'title' => $title, 'subtitle' => $subtitle, 'creditPageId' => $creditPageId, 'isExhibitionActive' => $isExhibitionActive)); $steps[] = array('action' => 'Mysql2Sqlite', 'params' => array('exportPath' => $exportPath, 'sqliteDb' => $sqliteDb)); } $steps[] = array('action' => 'CreateJSON', 'params' => array('exportPath' => $exportPath, 'languages' => $languages)); $steps[] = array('action' => 'CreateZip', 'params' => array('exportPath' => $exportPath, 'mediaPath' => $mediaPath, 'zipFile' => $zipFile)); return $steps; } }
function execute($exportPath, $languages) { if ($this->user->isLogged()) { $json = array(); foreach ($languages as $language) { $ar = __ObjectFactory::createModel('org.glizycms.core.models.Language'); $ar->load($language); $languageObj = new StdClass(); $languageObj->code = $ar->language_code; $languageObj->label = $ar->language_name; $languageObj->file = $ar->language_name . '.db'; $json[] = $languageObj; } file_put_contents($exportPath . 'package.json', json_encode($json)); } }
function execute($exportPath, $languages, $mediaPath, $graphPath, $zipFolder, $zipFile) { if ($this->user->isLogged()) { org_glizy_helpers_Files::deleteDirectory($exportPath); @unlink($zipFile); @mkdir($exportPath); @mkdir($mediaPath); @mkdir($graphPath); @mkdir($graphPath . 'document'); foreach ($languages as $language) { $ar = __ObjectFactory::createModel('org.glizycms.core.models.Language'); $ar->load($language); @mkdir($graphPath . $ar->language_code); @mkdir($graphPath . 'document/' . $ar->language_code); } @mkdir($zipFolder); @chmod($zipFolder, 0777); $mobileCodesTable = __Config::get('movio.modules.publishApp.mobileCodesTable'); org_glizy_dataAccessDoctrine_DataAccess::truncateTable($mobileCodesTable); } }
function execute_step4($oldState) { $model = __Request::get('mbTable') . '.models.Model'; $ar = __ObjectFactory::createModel($model); // reindicizza se necessario if (method_exists($ar, 'reIndex')) { $it = __ObjectFactory::createModelIterator($model); foreach ($it as $ar) { $ar->reIndex(); $data = $ar->getValuesAsArray(); $ar->fulltext = org_glizycms_core_helpers_Fulltext::make($data, $ar); $ar->forceModified('fulltext'); $ar->save(); } } }