Пример #1
0
 public function getAvailableTemplates()
 {
     $templatePath = __Paths::get('APPLICATION_TO_ADMIN_TEMPLATE');
     $templates = array();
     if ($dh = @opendir($templatePath)) {
         // scan the template repository
         while ($dirName = readdir($dh)) {
             // check if the item is a folder
             if ($dirName != "." && $dirName != ".." && is_dir($templatePath . '/' . $dirName)) {
                 // is a folder
                 // check if ther eis the rpeview image
                 // withou the preview the template isn't added
                 if (file_exists($templatePath . '/' . $dirName . '/preview.jpg') && !file_exists($templatePath . '/' . $dirName . '/disabled')) {
                     // check and include the locale file
                     if (file_exists($templatePath . '/' . $dirName . '/locale/' . $this->application->getLanguage() . '.php')) {
                         include $templatePath . '/' . $dirName . '/locale/' . $this->application->getLanguage() . '.php';
                         $templateName = __T($dirName);
                     } else {
                         $templateName = $dirName;
                     }
                     $templates[] = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.TemplateVO', $templateName, $dirName, $templatePath . '/' . $dirName . '/preview.jpg');
                 }
             }
         }
         closedir($dh);
     } else {
         // TODO
         // show error
     }
     return $templates;
 }
Пример #2
0
    function execute()
    {
        $tableName = $this->parent->getTableName();
        $sitemapCustom = __Paths::get('APPLICATION_TO_ADMIN') . 'startup/modules_custom.php';
        if (file_exists($sitemapCustom)) {
            $output = file_get_contents($sitemapCustom);
        } else {
            $output = <<<EOD
<?php
\$application = org_glizy_ObjectValues::get('org.glizy', 'application' );
if (\$application) {
    if (!\$application->isAdmin()) {
        __Paths::addClassSearchPath( __Paths::get( 'APPLICATION_CLASSES' ).'userModules/' );
    }
//modules_custom.php
}
EOD;
        }
        // cancella entry già presenti
        $output = preg_replace("/\\/\\/\\sstart\\s" . $tableName . "\\/\\/([^\\/])*\\/\\/\\send\\s" . $tableName . "\\/\\//i", "", $output);
        // aggiunge la nuova entry
        $output = str_replace('//modules_custom.php', '// start ' . $tableName . '//' . GLZ_COMPILER_NEWLINE2 . $tableName . '_Module::registerModule();' . GLZ_COMPILER_NEWLINE2 . '// end ' . $tableName . '//' . GLZ_COMPILER_NEWLINE2 . '//modules_custom.php', $output);
        $r = file_put_contents($sitemapCustom, $output);
        return true;
    }
Пример #3
0
 function _init()
 {
     parent::_init();
     $this->contentType = 'text/xml';
     __Paths::set('APPLICATION_PAGE_TYPE', __Paths::get('CORE_CLASSES') . 'org/glizy/oaipmh/pageTypes/');
     $this->addMetadataFormat('oai_dc', 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'http://www.openarchives.org/OAI/2.0/oai_dc/', 'dc', 'http://purl.org/dc/elements/1.1/');
 }
Пример #4
0
 function render()
 {
     parent::render();
     $this->addOutputCode(org_glizy_helpers_JS::linkJSfile(__Paths::get('STATIC_DIR') . 'dagre-d3/d3.v3.min.js'));
     $this->addOutputCode(org_glizy_helpers_JS::linkJSfile(__Paths::get('STATIC_DIR') . 'dagre-d3/dagre-d3.min.js'));
     $this->addOutputCode(org_glizy_helpers_JS::linkJSfile(__Paths::get('STATIC_DIR') . 'dagre-d3/graphlib-dot.min.js'));
 }
Пример #5
0
 protected function createZip($exportPath, $zipPath)
 {
     require_once __Paths::get('APPLICATION') . '/libs/dZip.inc.php';
     $zip = new dZip($zipPath);
     $this->addFolderToZip($zip, $exportPath, $exportPath);
     $zip->save();
 }
Пример #6
0
 private function getTemplateDataFromCache($templateData)
 {
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     // $templateProxy->invalidateCache();
     $cache = $templateProxy->getTemplateCache();
     $cssFileName = __Paths::get('CACHE') . md5($this->getClassName() . '_' . $templateData->__id) . '.css';
     $self = $this;
     $templateData = $cache->get($cssFileName, array(), function () use($self, $templateData, $cssFileName) {
         $newTemplateData = new StdClass();
         $newTemplateData->footerLogo = '';
         $self->updateTemplateData($templateData);
         $self->compileCss($templateData, $cssFileName);
         $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);
             }
             $newTemplateData->footerLogo = $image;
         }
         $newTemplateData->css = $templateData->css;
         return $newTemplateData;
     });
     return $templateData;
 }
Пример #7
0
 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;
     }
 }
Пример #8
0
 function execute($languageCode, $id, $svg, $type)
 {
     if ($this->user->isLogged()) {
         $exportPath = __Paths::get('CACHE') . 'export/';
         $graphPath = $exportPath . 'graph/' . $type . '/' . $languageCode . '/' . $id . '.svg';
         file_put_contents($graphPath, $svg);
     }
 }
Пример #9
0
 public function initCache()
 {
     $cacheDir = __Paths::get('CACHE') . 'doctrine';
     @mkdir($cacheDir);
     if (!self::$isLibLoaded) {
         self::loadLibrary();
     }
     self::$cacheDriver = new \Doctrine\Common\Cache\PhpFileCache($cacheDir);
 }
Пример #10
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()));
     }
 }
Пример #11
0
 function __construct($content, $pageId, $pageUrl)
 {
     GlizyClassLoader::addLib('Gregwar\\Captcha', __Paths::get('APPLICATION_LIBS') . 'captcha');
     $this->content = $content;
     $this->pageId = $pageId;
     $this->pageUrl = $pageUrl;
     $this->count = count($this->content);
     $this->sessionEx = new org_glizy_SessionEx($pageId);
     $this->captchaBuilder = new Gregwar\Captcha\CaptchaBuilder();
 }
Пример #12
0
 function execute()
 {
     $tableName = $this->parent->getTableName();
     $sitemapCustom = __Paths::get('APPLICATION_TO_ADMIN') . 'startup/modules_custom.php';
     if (file_exists($sitemapCustom)) {
         $output = file_get_contents($sitemapCustom);
         $output = preg_replace("/\\/\\/\\sstart\\s" . $tableName . "\\/\\/([^\\/])*\\/\\/\\send\\s" . $tableName . "\\/\\//i", "", $output);
         $r = file_put_contents($sitemapCustom, $output);
     }
     return true;
 }
Пример #13
0
 public function execute($data)
 {
     // TODO: controllo acl
     $data = json_decode($data);
     if ($data && property_exists($data, 'template')) {
         $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
         $templateProxy->setSelectedTemplate($data->template);
         org_glizy_cache_CacheFile::cleanPHP(__Paths::get('APPLICATION_TO_ADMIN_CACHE'));
         return true;
     }
     return false;
 }
Пример #14
0
 public function render_html_onStart()
 {
     if ($this->getAttribute('mode') == 'container') {
         $this->addOutputCode('<iframe id="js-glizycmsPageEdit" src="" data-emptysrc="' . $this->emptySrc . '" data-editsrc="' . $this->editSrc . '"></iframe>');
         $corePath = __Paths::get('CORE');
         $jQueryPath = $corePath . 'classes/org/glizycms/js/jquery/';
         $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.min.js'));
         $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.default.css'));
     } else {
         $this->addOutputCode('<div id="message-box"></div>');
         parent::render_html_onStart();
     }
 }
Пример #15
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;
 }
Пример #16
0
 public function __construct()
 {
     $this->source = __Paths::get('APPLICATION_TO_ADMIN') . 'config/fieldTypes.xml';
     $options = array('cacheDir' => org_glizy_Paths::get('CACHE_CODE'), 'lifeTime' => -1, 'readControlType' => '', 'fileExtension' => '.php');
     $cacheObj =& org_glizy_ObjectFactory::createObject('org.glizy.cache.CacheFile', $options);
     $cacheFileName = $cacheObj->verify($this->source, get_class($this));
     if ($cacheFileName === false) {
         $this->loadXml();
         $cacheObj->save(serialize($this->typeMap), NULL, get_class($this));
         $cacheObj->getFileName();
     } else {
         $this->typeMap = unserialize(file_get_contents($cacheFileName));
     }
 }
Пример #17
0
 protected function getTemplateDataFromCache($templateData)
 {
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     // $templateProxy->invalidateCache();
     $cache = $templateProxy->getTemplateCache();
     $cssFileName = __Paths::get('CACHE') . md5($this->getClassName() . '_' . $templateData->__id) . '.css';
     $self = $this;
     $templateData = $cache->get($cssFileName, array(), function () use($self, $templateData, $cssFileName) {
         $newTemplateData = new StdClass();
         $newTemplateData->footerLogo = '';
         $self->compileCss($templateData, $cssFileName);
         $self->fixTemplateData($templateData, $newTemplateData);
         $newTemplateData->css = $templateData->css;
         return $newTemplateData;
     });
     return $templateData;
 }
Пример #18
0
 function render($application, $view, $templateData)
 {
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     // $templateProxy->invalidateCache();
     $cache = $templateProxy->getTemplateCache();
     $cssFileName = __Paths::get('CACHE') . md5($this->getClassName() . '_' . $templateData->__id) . '.css';
     $self = $this;
     $templateData = $cache->get($cssFileName, array(), function () use($self, $templateData, $view, $cssFileName) {
         $self->updateTemplateData($templateData);
         $self->compileCss($templateData, $cssFileName);
         return $templateData;
     });
     $view->addOutputCode($templateData->css, 'css');
     $this->renderTemplateHeader($view, $templateData);
     if (!in_array($view->getAttribute('templateFileName'), array('1col.php', '2cols.php', '3cols.php', 'cover.php'))) {
         $view->setAttribute('templateFileName', '2cols.php');
     }
 }
Пример #19
0
 function _render_html()
 {
     if (!empty($this->mediaUrl)) {
         $attributes = $this->_content;
         if (is_string($this->mediaUrl) && (!is_null($this->getAttribute('width')) || !is_null($this->getAttribute('height')))) {
             if (strpos($this->mediaUrl, 'http://') === 0) {
                 $extension = pathinfo(parse_url($this->mediaUrl, PHP_URL_PATH), PATHINFO_EXTENSION);
                 $cacheFileName = 'external_' . md5($this->mediaUrl) . '.' . $extension;
                 $cacheFilePath = __Paths::get('CACHE') . $cacheFileName;
                 // scarica il file e lo mette in cache
                 if (!file_exists($cacheFilePath)) {
                     @file_put_contents($cacheFilePath, @file_get_contents($this->mediaUrl));
                 }
                 $params = array('media_id' => 0, 'media_fileName' => $cacheFilePath);
                 $this->media = __ObjectFactory::createObject('org.glizycms.mediaArchive.media.Image', $params);
             }
             $this->media->allowDownload = true;
             $thumbnail = $this->media->getResizeImage($this->getAttribute('width'), $this->getAttribute('height'), $this->getAttribute('crop'), $this->getAttribute('cropOffset'), false, false);
             $attributes['src'] = $thumbnail['fileName'];
             $attributes['width'] = $thumbnail['width'];
             $attributes['height'] = $thumbnail['height'];
             $this->_content['src'] = $thumbnail['fileName'];
             $this->_content['width'] = $thumbnail['width'];
             $this->_content['height'] = $thumbnail['height'];
         }
         unset($attributes['mediaUrl']);
         unset($attributes['zoom']);
         unset($attributes['size']);
         unset($attributes['mediaType']);
         $this->_content['__html__'] = '<img ' . $this->_renderAttributes($attributes) . '/>';
         if ($this->getAttribute('zoom') || $useZoom) {
             $this->_application->addLightboxJsCode();
             $attributes = array();
             $attributes['title'] = $this->_content['title'];
             $thumbnail = $this->media->getResizeImage(__Config::get('IMG_WIDTH_ZOOM'), __Config::get('IMG_HEIGHT_ZOOM'));
             $attributes['href'] = $thumbnail['fileName'];
             $attributes['rel'] = 'milkbox' . ($this->getAttribute('group') != '' ? '[' . $this->getAttribute('group') . ']' : '');
             $attributes['class'] = $zoomCssClass;
             $this->_content['__html__'] = org_glizy_helpers_Html::renderTag('a', $attributes, true, $this->_content['__html__']);
         }
     } else {
         $this->_content['__html__'] = '';
     }
 }
Пример #20
0
    function render()
    {
        parent::render();
        $rootComponent =& $this->getRootComponent();
        if (!org_glizy_ObjectValues::get('org.glizy.JS.textext', 'add', false)) {
            org_glizy_ObjectValues::set('org.glizy.JS.textext', 'add', true);
            $core = __Paths::get('CORE');
            $output = <<<EOD
<link rel="stylesheet" type="text/css" href="{$core}/classes/org/glizycms/js/jquery/select2/select2.css" />
<script type="text/javascript" src="{$core}/classes/org/glizycms/js/jquery/select2/select2.min.js" charset="UTF-8"></script>
EOD;
            $rootComponent->addOutputCode($output, 'head');
        }
        $id = $this->getId();
        $content = $this->_content ? json_encode($this->_content) : '[]';
        $ajaxUrl = 'ajax.php?pageId=' . __Request::get('pageId') . '&ajaxTarget=' . $this->getId();
        $output = <<<EOD
<script type="text/javascript">
\$(function(){
\t\$('#{$id}').val('');
    \$('#{$id}').select2({
        multiple: true,
        ajax: {
            url: '{$ajaxUrl}',
            dataType: 'json',
            quietMillis: 100,
            data: function(term, page) {
                return {
                    q: term,
                };
            },
            results: function(data, page ) {
                return { results: data }
            }
        },
    });

    \$('#{$id}').select2('data', {$content});
});
</script>
EOD;
        $rootComponent->addOutputCode($output, 'head');
    }
Пример #21
0
 function execute($id)
 {
     if ($id) {
         require_once __Paths::get('APPLICATION_LIBS') . 'phpqrcode/qrlib.php';
         $ar = org_glizy_objectFactory::createModel('movio.modules.codes.models.Model');
         $ar->load($id);
         $codeType = $ar->custom_code_mapping_code ? 'c' : 'm';
         $value = $codeType == 'c' ? $ar->custom_code_mapping_code : $ar->custom_code_mapping_link;
         $codeContents = GLZ_HOST_ROOT . ':' . $codeType . ':' . $value;
         $filePath = __Paths::get('CACHE') . $id . '.png';
         QRcode::png($codeContents, $filePath, QR_ECLEVEL_H, 4);
         header("Pragma: public");
         header("Expires: " . gmdate("D, d M Y H:i:s") . " GMT");
         header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
         header("Cache-Control: private", false);
         header("Content-Type: image/png");
         header("Content-Transfer-Encoding: binary");
         header("Content-Disposition: attachment; filename=\"" . $id . '.png' . "\"");
         @readfile($filePath) or die;
     }
 }
Пример #22
0
 public function init()
 {
     if (isset($_SERVER['GLIZY_APPNAME'])) {
         $serverName = $_SERVER['GLIZY_APPNAME'];
         $filename = 'filesystem_' . $serverName . '.xml';
     } else {
         $filename = 'filesystem.xml';
     }
     $this->source = __Paths::get('APPLICATION_TO_ADMIN') . 'config/' . $filename;
     if (!file_exists($this->source)) {
         $this->source = __Paths::get('APPLICATION') . 'config/' . $filename;
     }
     $options = array('cacheDir' => org_glizy_Paths::get('CACHE_CODE'), 'lifeTime' => -1, 'readControlType' => '', 'fileExtension' => '.php');
     $cacheObj =& org_glizy_ObjectFactory::createObject('org.glizy.cache.CacheFile', $options);
     $cacheFileName = $cacheObj->verify($this->source, get_class($this));
     if ($cacheFileName === false) {
         $this->loadXml();
         $cacheObj->save(serialize($this->fileSystemMap), NULL, get_class($this));
         $cacheObj->getFileName();
     } else {
         $this->fileSystemMap = unserialize(file_get_contents($cacheFileName));
     }
     $this->init = true;
 }
Пример #23
0
    function render()
    {
        $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile(__Paths::get('APPLICATION_CLASSES') . 'movio/modules/publishApp/static/progressBar.css'), 'head');
        $output = <<<EOD
<script type="text/javascript">
\$(function() {
  var state = 'progress';

  (function (\$) {
  \t\$.fn.animateProgress = function (progress, callback) {
\t\t\tjQuery.fx.off = false;
\t\t\t//var myduration = (progress - old_progress) * 1000 * (durata_totale_stimata / 100);
\t\t\told_progress = progress;
\t\t\treturn this.each(function () {
\t\t\t\t\$(this).animate({
\t\t\t\t\twidth: String(progress) + '%'
\t\t\t\t}, {
\t\t\t\t\t//duration: myduration,

\t\t\t\t\teasing: 'swing',

\t\t\t\t\tstep: function (progress) {
\t\t\t\t\t\tif (state === 'progress') {

\t\t\t\t\t\t\tjQuery.fx.off = false;

\t\t\t\t\t\t\tvar labelEl = \$('.ui-label', this),
\t\t\t\t\t\t\t\tvalueEl = \$('.value', labelEl);

\t\t\t\t\t\t\tif (Math.ceil(progress) < 20) {
\t\t\t\t\t\t\t\tlabelEl.hide();
\t\t\t\t\t\t\t} else {
\t\t\t\t\t\t\t\tif (labelEl.is(":hidden")) {
\t\t\t\t\t\t\t\t\tlabelEl.fadeIn();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t}

\t\t\t  \t\tvalueEl.text(Math.ceil(progress) + '%');
            }
\t\t\t\t\t},

\t\t\t\t\tcomplete: function (scope, i, elem) {
\t\t\t\t\t\tif (callback) {
\t\t\t\t\t\t\tscope = 0;
\t\t\t\t\t\t\tcallback.call(this, i, elem);
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t});
\t\t\t});
\t\t};
\t}(jQuery));


\tvar resetProgressBar = function () {
\t\tjQuery.fx.off = true;
\t\t\$('#progress_bar .ui-progress').width("0%");
\t\t\$('#progress_bar .ui-label').hide();
\t};

  resetProgressBar();
});
</script>
EOD;
        $output .= '<div id="progress_bar" class="ui-progress-bar ui-container">
                  <div class="ui-progress" style="width: 0%;">
                  <span class="ui-label" style="display:none;"><b class="value">0%</b></span>
		              </div></div>';
        $this->addOutputCode($output);
    }
Пример #24
0
 private function decompressFiles($medias)
 {
     if (!property_exists($medias, '__expand')) {
         return $medias;
     }
     GlizyClassLoader::addLib('VIPSoft\\Unzip', __Paths::get('APPLICATION_LIBS') . 'VIPSoft/Unzip');
     $copyProperties = function (&$properties, &$medias, &$tempMedias, $pos) {
         foreach ($properties as $v) {
             $tempMedias->{$v}[] = @$medias->{$v}[$pos];
         }
     };
     $properties = array_keys(get_object_vars($medias));
     if (!in_array('media_title', $properties)) {
         $properties[] = 'media_title';
     }
     $tempMedias = new StdClass();
     foreach ($properties as $v) {
         $tempMedias->{$v} = array();
     }
     $numUploaded = count($medias->__uploadFilename);
     for ($i = 0; $i < $numUploaded; $i++) {
         if (!$medias->__uploadFilename[$i]) {
             continue;
         }
         if ($medias->__expand[$i] == 1) {
             $unzipper = new VIPSoft\Unzip\Unzip();
             $destFolder = $medias->__uploadFilename[$i] . md5(time());
             $filenames = $unzipper->extract($medias->__uploadFilename[$i], $destFolder);
             foreach ($filenames as $f) {
                 if (strpos($f, '__MACOSX') !== false || strpos($f, '.DS_Store') !== false) {
                     continue;
                 }
                 $filename = $destFolder . '/' . $f;
                 if (is_dir($filename)) {
                     continue;
                 }
                 $pos = count($tempMedias->__uploadFilename);
                 $copyProperties($properties, $medias, $tempMedias, $i);
                 $info = pathinfo($filename);
                 $tempMedias->__uploadFilename[$pos] = $filename;
                 $tempMedias->__originalFileName[$pos] = $info['basename'];
                 $tempMedias->media_title[$pos] = str_replace(array('_', '-'), ' ', $info['filename']);
             }
         } else {
             $copyProperties($properties, $medias, $tempMedias, $i);
         }
     }
     return $tempMedias;
 }
Пример #25
0
 public function export($languageId = 1, $languageCode = null, $menuIdArray = array(), $title = null, $subtitle = null, $creditPageId = null, $isExhibitionActive = null)
 {
     __Paths::set('APPLICATION_TEMPLATE_DEFAULT', __Paths::get('STATIC_DIR') . 'movio/templates/Default/');
     $menuIdArray = array_flip($menuIdArray);
     $menuIdArray = array_fill_keys(array_keys($menuIdArray), 1);
     $this->medias = array();
     $contentProxy = org_glizy_ObjectFactory::createObject('org.glizycms.contents.models.proxy.ContentProxy');
     // scorre tutti i menù
     $menus = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Menu');
     $menus->load('getAllMenu', array('params' => array('languageId' => $languageId)));
     foreach ($menus as $ar) {
         $menuId = $ar->menu_id;
         // salta tutte le pagine che non sono in menuIdArray
         if (!$menuIdArray[$menuId]) {
             continue;
         }
         $contentVO = $contentProxy->readContentFromMenu($menuId, $languageId);
         $contentJson = array();
         foreach ($contentVO as $k => $v) {
             if ($k == '__title') {
                 $contentJson['title'] = $v;
                 continue;
             }
             if (@strpos($k, '__') === 0) {
                 continue;
             }
             if (is_object($v)) {
                 $contentJson[$k] = $this->convertObjectToArray($v);
             } else {
                 if (@strpos($v, '{"id"') === 0) {
                     $v = $this->addMedia($v);
                 }
                 $contentJson[$k] = $v;
             }
         }
         $arMobile = org_glizy_objectFactory::createModel('movio.models.Mobilecontents');
         // informaizoni da salvare per il menu:
         // menuId, parent, titolo, pageType, type, contenuto
         // salvare solo i menu visibili
         // creare una tabella apposta e salvarci i dati dentro
         //
         if ($ar->menudetail_isVisible) {
             $arMobile->content_menuId = $menuId;
             $arMobile->content_pageType = $ar->menu_pageType;
             $arMobile->content_parent = $ar->menu_parentId;
             $arMobile->content_type = $ar->menu_type;
             $arMobile->content_title = $ar->menudetail_title;
             if ($arMobile->content_pageType == 'Storyteller') {
                 $contentJson = $this->processStoryTeller($contentJson);
             } elseif ($arMobile->content_pageType == 'Photogallery') {
                 $contentJson = $this->processPhotoGallery($contentJson);
             } elseif ($arMobile->content_pageType == 'Photogallery_category') {
                 $arMobile->content_pageType = 'Photogallery';
                 $contentJson = $this->processPhotoGalleryCategory($contentJson);
             } elseif ($arMobile->content_pageType == 'ImageHotspot') {
                 $contentJson = $this->processImageHotspot($contentJson);
             } elseif ($arMobile->content_pageType == 'Timeline') {
                 $contentJson = $this->processTimeline($menuId, $contentJson);
             } elseif ($arMobile->content_pageType == 'Page') {
                 $contentJson = $this->processPage($contentJson);
             } elseif ($arMobile->content_pageType == 'Exhibition') {
                 $contentJson = $this->processExhibition($contentJson);
                 $contentJson['isActive'] = $isExhibitionActive ? 1 : 0;
             } elseif ($arMobile->content_pageType == 'DigitalExhibition') {
                 $contentJson = $this->processDigitalExhibition($contentJson);
             } elseif ($arMobile->content_pageType == 'Home') {
                 $contentJson['title'] = $title;
                 $contentJson['subtitle'] = $subtitle;
             } elseif ($arMobile->content_pageType == 'Video') {
                 $contentJson = $this->processVideo($contentJson);
             } elseif ($arMobile->content_pageType == 'Cover') {
                 $contentJson = $this->processCover($contentJson);
             } elseif ($arMobile->content_pageType == 'GoogleMap') {
                 $contentJson = $this->processGoogleMap($contentJson);
             } elseif ($arMobile->content_pageType == 'Graph') {
                 $contentJson = $this->processGraph($contentJson, $menuId, $languageCode);
             }
             if ($menuId == $creditPageId) {
                 $arMobile->content_pageType = 'Credits';
                 $arMobile->content_parent = 0;
             }
             $arMobile->content_content = json_encode($contentJson);
             $contentId = $arMobile->save();
             $it = org_glizy_objectFactory::createModelIterator('org.glizycms.core.models.Content');
             $fulltextAr = $it->where("id", $menuId)->whereLanguageIs($languageId)->selectIndex('fulltext', 'document_index_fulltext_name', 'document_index_fulltext_value')->first();
             if ($fulltextAr->document_index_fulltext_value) {
                 $ar = org_glizy_objectFactory::createModel('movio.modules.publishApp.models.Mobilefulltext');
                 $ar->mobilefulltext_FK_content_id = $contentId;
                 $ar->mobilefulltext_text = str_replace(' ##', '', $fulltextAr->document_index_fulltext_value);
                 $ar->mobilefulltext_title = $contentJson['title'];
                 $ar->mobilefulltext_subtitle = $contentJson['subtitle'];
                 $ar->save();
             }
             // quando menu_pageType è Entity c'è da scorrere tutti i contenuti dell'entità
             // e caricare i dati
             // salvare
             // documenId, titolo, contenuto
             if ($arMobile->content_pageType == 'Entity') {
                 $parent = $arMobile->content_id;
                 $application = org_glizy_ObjectValues::get('org.glizy', 'application');
                 $it = __ObjectFactory::createModelIterator('movio.modules.ontologybuilder.models.EntityDocument');
                 $it->whereTypeIs('entity' . $contentJson['entitySelect']);
                 foreach ($it as $arEntitySelect) {
                     $documentId = $arEntitySelect->document_id;
                     $c = __ObjectFactory::createComponent('movio.modules.ontologybuilder.views.components.EntityToJSON', $application, $parent, 'glz:EntityToJSON', $documentId);
                     $c->setAttribute('visible', true);
                     $c->process();
                     $c->render();
                     $medias = $c->getMedias();
                     $this->addMediaArray($medias);
                     $graphCode = $c->getGraph();
                     $this->addGraph($languageCode, $documentId, $graphCode, 'document');
                     $jsonEntity = $c->getJson();
                     $jsonEntity['graph'] = 'graph/document/' . $languageCode . '/' . $documentId . '.svg';
                     $jsonEntity['content'] = $this->processText($jsonEntity['content']);
                     $arContentMobile = org_glizy_objectFactory::createModel('movio.models.Mobilecontents');
                     $arContentMobile->content_documentId = $documentId;
                     $arContentMobile->content_pageType = 'EntityChild';
                     $arContentMobile->content_parent = $parent;
                     $arContentMobile->content_title = $arEntitySelect->title;
                     $arContentMobile->content_content = json_encode($jsonEntity);
                     $contentId = $arContentMobile->save();
                     $fulltextAr = org_glizy_objectFactory::createModel('movio.modules.publishApp.models.DocumentIndexFulltext');
                     $result = $fulltextAr->find(array('document_index_fulltext_FK_document_detail_id' => $arEntitySelect->document_detail_id));
                     if ($result) {
                         $ar = org_glizy_objectFactory::createModel('movio.modules.publishApp.models.Mobilefulltext');
                         $ar->mobilefulltext_FK_content_id = $contentId;
                         $ar->mobilefulltext_text = str_replace(' ##', '', $fulltextAr->document_index_fulltext_value);
                         $ar->mobilefulltext_title = $arEntitySelect->title;
                         $ar->mobilefulltext_subtitle = $arEntitySelect->subtitle;
                         $ar->save();
                     }
                 }
             }
         }
     }
 }
Пример #26
0
 function __construct(&$application, &$parent, $tagName = '', $id = '', $originalId = '')
 {
     parent::__construct($application, $parent, $tagName, $id, $originalId);
     $debugBar = org_glizy_debug_Module::$debugBar;
     $this->debugbarRenderer = $debugBar->getJavascriptRenderer(GLZ_HOST . '/' . __Paths::get('CORE') . 'libs/DebugBar/Resources/');
 }
Пример #27
0
<?php

if (__Paths::get('APPLICATION_TO_ADMIN')) {
    require __Paths::get('APPLICATION_TO_ADMIN') . 'startup/movio.php';
}
Пример #28
0
    public function render_html()
    {
        $graphCode = '';
        $entityTypeId = $this->getAttribute('entityTypeId') ? $this->getAttribute('entityTypeId') : __Request::get('entityTypeId');
        if ($entityTypeId) {
            $visited = array();
            $edges = array();
            $graphCode = $this->getGraph($entityTypeId, $visited, $edges);
        }
        if (!$this->getAttribute('generateLinks')) {
            $this->language = $this->_application->getEditingLanguage();
            $this->localeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.LocaleService');
            $html = '<form id="myForm" method="post" class="form-horizontal row-fluid" >';
            $html .= '<label for="entityTypeId" class="control-label required">' . __T('Entity') . '</label>';
            $html .= '<select id="entityTypeId" name="entityTypeId">';
            $it = org_glizy_objectFactory::createModelIterator('movio.modules.ontologybuilder.models.Entity', 'all');
            foreach ($it as $ar) {
                $selected = __Request::get('entityTypeId') == $ar->getId() ? 'selected="selected"' : '';
                $html .= '<option value="' . $ar->getId() . '" ' . $selected . '>' . $this->localeService->getTranslation($this->language, $ar->entity_name) . '</option>';
            }
            $html .= '</select>';
            $html .= '<input class="submit btn btn-primary" type="submit" value="' . __T('Draw') . '">';
            $html .= '</form>';
        }
        $graphCode = <<<EOD
digraph "" {
    {$graphCode}
}
EOD;
        $graphCode = str_replace(array("\r", "\n"), '', addslashes($graphCode));
        $html .= <<<EOD
<div style="text-align: center; position: relative; width: 100%;">
    <svg width="800" height="600">
      <g transform="translate(20, 20)"/>
    </svg>
</div>
<script>
        function tryDraw() {
            var result;
            try {
                result = graphlibDot.parse('{$graphCode}');
            } catch (e) {
                alert('Errore di caricamento del grafo!');
                throw e;
            }

            if (result) {
                var svg = d3.select("svg");
                var svgGroup = svg.append('g');

                var renderer = new dagreD3.Renderer();

                var layout = renderer.run(result, svgGroup);

                var parentWidth = 800;
                svg.attr('width', parentWidth);
                svg.attr('height', layout.graph().height + 250);
                var xCenterOffset = (svg.attr('width') - layout.graph().width) / 2;
                svgGroup.attr('transform', 'translate(' + xCenterOffset + ', 100)');
            }
        }

        function fixBaseTagProblem() {
            \$('g[class^="edgePaths"]').find('path').each(function() {
                \$(this).attr('marker-end', 'url(' + window.location + '#arrowhead)');
            });
        }

        function selectRootNode() {
            \$('div[class="main-node"]').parent().parent().parent().parent().children('rect').attr('class', 'main-node');
        }

        \$(window).bind('load', function() {
            tryDraw();
            fixBaseTagProblem();
            selectRootNode();
        });
</script>
EOD;
        if ($this->getAttribute('addGraphJsLibs.js')) {
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile(__Paths::get('STATIC_DIR') . 'dagre-d3/d3.v3.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile(__Paths::get('STATIC_DIR') . 'dagre-d3/dagre-d3.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile(__Paths::get('STATIC_DIR') . 'dagre-d3/graphlib-dot.min.js'));
        }
        $this->addOutputCode($html);
    }
Пример #29
0
    public function render_html_onEnd($value = '')
    {
        parent::render_html_onEnd();
        $corePath = __Paths::get('CORE');
        $jQueryPath = $corePath . 'classes/org/glizycms/js/jquery/';
        $languageCode = $this->_application->getLanguage();
        $language = $languageCode . '-' . strtoupper($languageCode);
        if ($this->getAttribute('newCode')) {
            $formEditPath = $corePath . 'classes/org/glizycms/js/formEdit2/';
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/underscore/underscore-min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEdit.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditStandard.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCheckbox.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditRepeat.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDate.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDateTime.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.it.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-datetimepicker-master/css/datetimepicker.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditColorPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-colorpicker/js/bootstrap-colorpicker.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-colorpicker/css/bootstrap-colorpicker.min.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditGUID.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectFrom.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'select2/select2.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'select2/select2.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditTINYMCE.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditMediaPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditFile.js'));
            //$this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $jQueryPath.'fineuploader.jquery/jquery.fineuploader.js' ) );
            //$this->addOutputCode( org_glizy_helpers_CSS::linkCSSfile( $jQueryPath.'fineuploader.jquery/fineuploader.css' ) );
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.validVal-packed.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPermission.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPhotoGalleryCategory.js'));
            // $this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $formEditPath.'GlizyFormEditGoogleMaps.js' ) );
            // $this->addOutputCode(org_glizy_helpers_JS::linkJSfile( 'http://maps.google.com/maps/api/js?sensor=false' ));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCmsPagePicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectPageType.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditUrl.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditModalPage.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/glizy-locale/' . $language . '.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.default.css'));
            $id = $this->getId();
            $mediaPicker = $this->getMediaPickerUrl();
            $AJAXAtion = $this->getAttribute('controllerName') ? $this->getAjaxUrl() : '';
            $customValidation = $this->getAttribute('customValidation');
            if ($customValidation) {
                $customValidation = 'customValidation: "' . $customValidation . '",';
            }
            $tinyMceUrls = json_encode($this->getTinyMceUrls());
            $jsCode = <<<EOD
jQuery(function(){
    if ( Glizy.tinyMCE_options )
    {
        Glizy.tinyMCE_options.urls = {$tinyMceUrls};
    }

    var myFormEdit = Glizy.oop.create("glizy.FormEdit", '{$id}', {
        AJAXAction: "{$AJAXAtion}",
        mediaPicker: {$mediaPicker},
        formData: {$this->data},
        {$customValidation}
        lang: GlizyLocale.FormEdit
    });
});
EOD;
        } else {
            $formEditPath = $corePath . 'classes/org/glizycms/js/formEdit/';
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/underscore/underscore-min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEdit.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditTINYMCE.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditFile.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditMediaPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditGoogleMaps.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditGUID.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditColorPicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditValuesPreset.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDate.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditDatetime.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.it.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-datetimepicker-master/css/datetimepicker.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'bootstrap-colorpicker/js/bootstrap-colorpicker.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'bootstrap-colorpicker/css/bootstrap-colorpicker.min.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($corePath . 'classes/org/glizycms/js/glizy-locale/' . $language . '.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'dropzone/dropzone.min.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'dropzone/css/basic2.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.validVal-packed.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCmsPagePicker.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectFrom.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'select2/select2.min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.min.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPermission.js'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'select2/select2.css'));
            $this->addOutputCode(org_glizy_helpers_CSS::linkCSSfile($jQueryPath . 'jquery.pnotify/jquery.pnotify.default.css'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditCheckbox.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile('http://maps.google.com/maps/api/js?sensor=false'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditSelectPageType.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditPhotoGalleryCategory.js'));
            $this->addOutputCode(org_glizy_helpers_JS::linkJSfile($formEditPath . 'GlizyFormEditImageHotspot.js'));
            // $this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $formEditPath.'GlizyFormEditTreeSelect.js' ) );
            // $this->addOutputCode( org_glizy_helpers_JS::linkJSfile( $jQueryPath.'fancytree/jquery.fancytree-all.min.js' ) );
            // $this->addOutputCode( org_glizy_helpers_CSS::linkCSSfile( $jQueryPath.'fancytree/skin-win7/ui.fancytree.min.css' ) );
            $id = $this->getId();
            $mediaPicker = $this->getMediaPickerUrl();
            $AJAXAtion = $this->getAttribute('controllerName') ? $this->getAjaxUrl() : '';
            $customValidation = $this->getAttribute('customValidation');
            if ($customValidation) {
                $customValidation = 'customValidation: "' . $customValidation . '",';
            }
            $tinyMceUrls = json_encode($this->getTinyMceUrls());
            $jsCode = <<<EOD
jQuery(function(){
    if ( Glizy.tinyMCE_options )
    {
        Glizy.tinyMCE_options.urls = {$tinyMceUrls};
    }

    var ajaxUrl = "{$AJAXAtion}";
    jQuery( "#{$id}" ).GlizyFormEdit({
        AJAXAction: ajaxUrl ? ajaxUrl : Glizy.ajaxUrl,
        mediaPicker: {$mediaPicker},
        formData: {$this->data},
        {$customValidation}
        lang: GlizyLocale.FormEdit
    });
});
EOD;
        }
        $this->addOutputCode(org_glizy_helpers_JS::JScode($jsCode));
    }
Пример #30
0
 /**
  * Render
  *
  * @return	void
  * @access	public
  */
 function render($outputMode = NULL, $skipChilds = false)
 {
     $from = '';
     $until = '';
     $set = '';
     $limitStart = 0;
     if (__Request::exists('resumptionToken')) {
         if (!__Request::exists('from') && !__Request::exists('until') && !__Request::exists('set') && !__Request::exists('metadataPrefix')) {
             // TODO controllare la data di scadenza del token
             $tokenId = __Request::get('resumptionToken');
             $fileName = __Paths::get('CACHE') . $tokenId;
             if (file_exists($fileName)) {
                 $info = unserialize(file_get_contents($fileName));
                 $limitStart = $info['limitEnd'];
                 $filters = $info['filters'];
                 $metadataPrefix = $info['metadataPrefix'];
             } else {
                 $this->_application->setError('badResumptionToken', '', $tokenId);
                 return;
             }
         } else {
             $this->_application->setError('exclusiveArgument');
             return;
         }
     } else {
         // controlla i parametri ricevuti
         if (__Request::exists('from')) {
             $from = __Request::get('from');
             if (!org_glizy_oaipmh_OaiPmh::checkDateFormat($from)) {
                 $this->_application->setError('badGranularity', 'from', $from);
                 return;
             }
         }
         if (__Request::exists('until')) {
             $until = __Request::get('until');
             if (!org_glizy_oaipmh_OaiPmh::checkDateFormat($until)) {
                 $this->_application->setError('badGranularity', 'until', $until);
                 return;
             }
         }
         if (__Request::exists('set')) {
             $set = __Request::get('set');
         }
         if (__Request::exists('metadataPrefix')) {
             $metadataPrefix = __Request::get('metadataPrefix');
         } else {
             $this->_application->setError('missingArgument', 'metadataPrefix');
             return;
         }
         $filters = array();
         if ($from) {
             $filters[] = 'picoqueue_date >= ' . org_glizy_dataAccess_DataAccess::qstr($from);
         }
         if ($until) {
             $filters[] = 'picoqueue_date <= ' . org_glizy_dataAccess_DataAccess::qstr($until);
         }
         if ($set) {
             $filters[] = 'picoqueue_recordModule = ' . org_glizy_dataAccess_DataAccess::qstr($set);
         }
     }
     $metadata = $this->_application->getMetadataFormat();
     if (isset($metadata[$metadataPrefix])) {
         // TODO
         //$inc_record = $metadata[$metadataPrefix]['myhandler'];
     } else {
         $this->_application->setError('cannotDisseminateFormat', 'metadataPrefix', $metadataPrefix);
         return;
     }
     $limitLength = __Config::get('oaipmh.maxRecords');
     $it = org_glizy_ObjectFactory::createModelIterator('org.glizy.oaipmh.models.PicoQueue', 'all', array('filters' => $filters, 'limit' => array($limitStart, $limitLength), 'numRows' => true));
     $num_rows = $it->count();
     if ($num_rows > 0) {
         $oaiPrefix = __Config::get('oaipmh.oaiPrefix');
         $countrec = 0;
         $output = '<ListRecords>';
         $output .= org_glizy_oaipmh_OaiPmh::createResumptionToken('ListRecords', array('numRows' => $num_rows, 'limitStart' => $limitStart, 'limitEnd' => $limitStart + $limitLength, 'filters' => $filters, 'metadataPrefix' => $metadataPrefix));
         while ($it->hasMore()) {
             $countrec++;
             $arC = $it->current();
             $it->next();
             $setClass = org_glizy_ObjectFactory::createObject($arC->picoqueue_recordModule, $this->_application);
             if (is_null($setClass)) {
                 continue;
             }
             $setClass->loadRecord($arC->picoqueue_recordId);
             $identifier = $oaiPrefix . $arC->picoqueue_identifier;
             $datestamp = org_glizy_oaipmh_OaiPmh::formatDatestamp($arC->picoqueue_date);
             $status_deleted = $arC->picoqueue_action == 'delete' ? true : false;
             $output .= '<record>';
             $output .= '<header';
             if ($status_deleted) {
                 $output .= ' status="deleted"';
             }
             $output .= '>';
             // use xmlrecord since we use stuff from database
             $output .= '<identifier>' . org_glizy_oaipmh_OaiPmh::encode($identifier) . '</identifier>';
             $output .= '<datestamp>' . org_glizy_oaipmh_OaiPmh::encode($datestamp) . '</datestamp>';
             if (!$status_deleted) {
                 $output .= '<setSpec>' . org_glizy_oaipmh_OaiPmh::encode($arC->picoqueue_recordModule) . '</setSpec>';
             }
             $output .= '</header>';
             $output .= '<metadata>';
             $output .= $setClass->getRecord($identifier);
             $output .= '</metadata>';
             $output .= '</record>';
         }
         $output .= '</ListRecords>';
         $this->addOutputCode($output);
     } else {
         $this->_application->setError('noRecordsMatch');
     }
 }