示例#1
0
 public function execute()
 {
     $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->application->getEditingLanguage(), ''));
     if ($siteProp) {
         $this->view->setData($siteProp);
     }
 }
示例#2
0
 public function publish()
 {
     $exportPath = __Paths::get('CACHE') . 'export/';
     $mediaPath = $exportPath . 'media/';
     $zipPath = __Paths::get('BASE') . 'export/' . 'mobileContents.zip';
     org_glizy_helpers_Files::deleteDirectory($exportPath);
     @unlink($zipPath);
     @mkdir($exportPath);
     @mkdir($mediaPath);
     $exportService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.ExportService');
     $exportService->export();
     $medias = $exportService->getMedias();
     foreach ($medias as $id => $fileName) {
         $media = org_glizycms_mediaArchive_MediaManager::getMediaById($id);
         copy($media->getFileName(), $mediaPath . $fileName);
     }
     $dbHost = __Config::get('DB_HOST');
     $dbUser = __Config::get('DB_USER');
     $dbPass = __Config::get('DB_PSW');
     $dbName = __Config::get('DB_NAME');
     $tableName = __Config::get('movio.modules.publishApp.mobileContentsTable');
     $sqliteDb = $exportPath . __Config::get('movio.modules.publishApp.sqliteDbName');
     $mysql2SqliteService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.Mysql2SqliteService');
     $mysql2SqliteService->convert($dbHost, $dbUser, $dbPass, $dbName, $tableName, $sqliteDb);
     $this->createZip($exportPath, $zipPath);
     org_glizy_Registry::set('movio/modules/publishApp/lastUpdate', time());
 }
示例#3
0
 public function render($application, $view, $templateData)
 {
     $templateData = $this->getTemplateDataFromCache($templateData);
     $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $view->_application->getLanguage(), ''));
     $view->addOutputCode($templateData->css, 'css');
     $view->addOutputCode($siteProp['title'], 'siteTitle');
     $view->addOutputCode($siteProp['subtitle'], 'siteSubtitle');
     $this->fixTemplateName($view);
     $this->addCustomOutput($view, $templateData);
 }
示例#4
0
 function execute($exportPath, $zipFile)
 {
     if ($this->user->isLogged()) {
         require_once __Paths::get('APPLICATION') . '/libs/dZip.inc.php';
         $zip = new dZip($zipFile);
         $this->addFolderToZip($zip, $exportPath, $exportPath);
         $zip->save();
         org_glizy_Registry::set('movio/modules/publishApp/lastUpdate', strval(time()));
     }
 }
示例#5
0
 static function query($path)
 {
     $params =& org_glizy_Registry::_getValuesArray();
     $iterator = org_glizy_ObjectFactory::createModelIterator('org.glizy.models.Registry', 'all', array('filters' => array('registry_path' => $path)));
     // TODO controlare se ci sono stati errori
     $result = array();
     foreach ($iterator as $ar) {
         $params[$ar->registry_path] = $ar->registry_value;
         $result[$ar->registry_path] = $ar->registry_value;
     }
     return $result;
 }
示例#6
0
文件: Save.php 项目: GruppoMeta/Movio
 public function execute($data)
 {
     $data = json_decode($data);
     $newData = array();
     $newData['title'] = $data->title;
     $newData['address'] = $data->address;
     $newData['copyright'] = $data->copyright;
     $newData['slideShow'] = $data->slideShow;
     $newData['analytics'] = $data->analytics;
     org_glizy_Registry::set(__Config::get('REGISTRY_SITE_PROP') . $this->application->getEditingLanguage(), serialize($newData));
     return true;
 }
示例#7
0
 function render($application, $view, $templateData)
 {
     $templateData = $this->getTemplateDataFromCache($templateData);
     $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $view->_application->getLanguage(), ''));
     $view->addOutputCode($templateData->css, 'css');
     $view->addOutputCode($siteProp['title'], 'siteTitle');
     $view->addOutputCode($siteProp['subtitle'], 'siteSubtitle');
     if ($templateData->footerLogo) {
         $view->addOutputCode($templateData->footerLogo, 'logoFooter');
     }
     $view->setAttribute('templateFileName', 'page.php');
 }
示例#8
0
 public static function getSiteTemplatePath()
 {
     $templateName = org_glizy_Registry::get(__Config::get('REGISTRY_TEMPLATE_NAME'), '');
     if (empty($templateName)) {
         $templateName = __Config::get('glizycms.template.default');
     }
     $templatePath = __Paths::get('TEMPLATE_FOLDER');
     if (empty($templatePath)) {
         // TODO verificare perché il path è sbagliato ed è necessartio mettere ../
         $templatePath = __Paths::get('APPLICATION_STATIC') . 'templates/';
     }
     $templatePath .= $templateName;
     return '../' . $templatePath;
 }
示例#9
0
 public function execute()
 {
     if (method_exists($this->view, 'setData')) {
         $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->application->getLanguage(), ''));
         $lastUpdate = org_glizy_Registry::get('movio/modules/publishApp/lastUpdate');
         $data = new StdClass();
         $data->title = $siteProp['title'];
         $data->subtitle = $siteProp['subtitle'];
         if ($lastUpdate) {
             $data->lastUpdate = '<p>' . __T('Last exportation date') . ': ' . date(__T('GLZ_DATETIME_FORMAT') . '</p>', $lastUpdate);
         }
         $data->isExhibitionActive = 1;
         $it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Language')->load('getLanguageDictionary');
         $this->setComponentsAttribute('languages', 'rows', $it->count());
         $this->view->setData($data);
     }
 }
示例#10
0
 private function setData()
 {
     org_glizy_Registry::set(__Config::get('REGISTRY_TEMPLATE_VALUES') . $this->getSelectedTemplate(), json_encode($this->templateValues));
 }
示例#11
0
 private function renderTemplateHeader($view, $templateData)
 {
     $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $view->_application->getLanguage(), ''));
     $view->addOutputCode($siteProp['title'], 'title1');
     $view->addOutputCode($siteProp['subtitle'], 'title2');
     /*
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title1), 'title1');
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title2), 'title2');
     */
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title3), 'title3');
     $view->addOutputCode(str_replace('../getImage.php', 'getImage.php', $templateData->title4), 'title4');
     $templateData->footerLogo = @json_decode($templateData->footerLogo);
     if ($templateData->footerLogo && $templateData->footerLogo->id) {
         $image = org_glizy_helpers_Media::getImageById($templateData->footerLogo->id);
         if ($templateData->footerLogoLink) {
             $image = __Link::formatLink($templateData->footerLogoLink, $templateData->footerLogoTitle, $image);
         }
         $view->addOutputCode($image, 'logoFooter');
     }
     $view->addOutputCode(org_glizy_helpers_CSS::CSScode($templateData->customCss), 'head');
 }
示例#12
0
 public static function setSharingButtonList($shareButtons)
 {
     org_glizy_Registry::set(__Config::get('BASE_REGISTRY_PATH') . self::REGISTRY_SHAREBUTTONS, serialize($shareButtons));
 }
示例#13
0
<?php

require_once "core/core.inc.php";
$application = org_glizy_ObjectFactory::createObject('org.glizycms.core.application.Application', 'application');
org_glizy_Paths::addClassSearchPath('admin/application/classes/');
$application->runSoft();
$timestamp = __Request::get('timestamp');
$lastUpdate = org_glizy_Registry::get('movio/modules/publishApp/lastUpdate');
$result = array('updated' => $lastUpdate > $timestamp, 'lastUpdate' => $lastUpdate, 'fileSize' => @filesize(__Paths::getRealPath('BASE') . 'export/mobileContents.zip'), 'url' => GLZ_HOST . '/export/' . 'mobileContents.zip', 'checkUpdateUrl' => GLZ_HOST . '/checkUpdate.php');
header("Content-Type: application/json");
echo json_encode($result);
示例#14
0
 private function readSiteProperties()
 {
     $siteProp = unserialize(org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $this->getLanguage(), ''));
     if (!is_array($siteProp)) {
         // if the site properties are not defined
         // try to read the properties from default language
         $ar = org_glizy_ObjectFactory::createModel('org.glizycms.core.models.Language');
         $ar->language_isDefault = 1;
         $ar->find();
         $siteProp = org_glizy_Registry::get(__Config::get('REGISTRY_SITE_PROP') . $ar->language_code, '');
         org_glizy_Registry::set(__Config::get('REGISTRY_SITE_PROP') . $this->getLanguage(), $siteProp);
         $siteProp = unserialize($siteProp);
     }
     if (!is_array($siteProp)) {
         $siteProp = array();
     }
     $this->_siteProperty = $siteProp;
 }
示例#15
0
 /**
  * @param $state
  */
 function setModulesState($state)
 {
     org_glizy_Registry::set(__Config::get('BASE_REGISTRY_PATH') . '/modules', serialize($state));
     org_glizy_cache_CacheFile::cleanPHP();
 }