Esempio n. 1
0
 function init()
 {
     if (__Config::get('QUERY_CACHING_INIT')) {
         org_glizy_dataAccessDoctrine_DataAccess::initCache();
     }
     glz_loadLocale('org.glizycms.*');
     glz_loadLocale('org.glizycms.contents.*');
     glz_loadLocale('org.glizycms.languages.*');
     $application = org_glizy_ObjectValues::get('org.glizy', 'application');
     if ($application) {
         if (!$application->isAdmin()) {
             org_glizy_ObjectFactory::remapClass('org.glizy.components.Page', 'org.glizycms.views.components.Page');
             org_glizy_ObjectFactory::remapClass('org.glizy.mvc.components.Page', 'org.glizycms.views.components.MvcPage');
             org_glizycms_userManager_fe_Module::registerModule();
         }
         // la creazione dell'istanza serve per il listener
         $speakingUrlManager = $application->registerProxy('org.glizycms.speakingUrl.Manager');
         // registra il resolver di default
         org_glizycms_speakingUrl_Manager::registerResolver(org_glizy_ObjectFactory::createObject('org.glizycms.speakingUrl.PageResolver'));
     }
     if (is_null(__Config::get('glizycms.sitemap.cacheLife'))) {
         __Config::set('glizycms.sitemap.cacheLife', 36000);
     }
     if (is_null(__Config::get('glizycms.content.history', ''))) {
         __Config::set('glizycms.content.history', true);
     }
     if (is_null(__Config::get('glizycms.content.history.comment', ''))) {
         __Config::set('glizycms.content.history.comment', false);
     }
     __Config::set('glizy.dataAccess.document.enableComment', __Config::get('glizycms.content.history.comment'));
     if (is_null(__Config::get('glizycms.pageEdit.editUrlEnabled', ''))) {
         __Config::set('glizycms.pageEdit.editUrlEnabled', true);
     }
     if (is_null(__Config::get('glizycms.mediaArchive.exifEnabled', ''))) {
         __Config::set('glizycms.mediaArchive.exifEnabled', false);
     }
     if (is_null(__Config::get('glizycms.speakingUrl', ''))) {
         __Config::set('glizycms.speakingUrl', false);
     }
     if (is_null(__Config::get('glizycms.content.showAllPageTypes', ''))) {
         __Config::set('glizycms.content.showAllPageTypes', true);
     }
     if (is_null(__Config::get('glizycms.form.actionLink.cssClass', ''))) {
         __Config::set('glizycms.form.actionLink.cssClass', 'btn action-link');
     }
     if (is_null(__Config::get('glizycms.print.enabled', ''))) {
         __Config::set('glizycms.print.enabled', false);
     }
     if (is_null(__Config::get('glizycms.print.pdf.enabled', ''))) {
         __Config::set('glizycms.print.pdf.enabled', false);
     }
     if (is_null(__Config::get('glizycms.mediaArchive.bridge', ''))) {
         __Config::set('glizycms.mediaArchive.bridge', 'org.glizycms.mediaArchive.Bridge');
     }
     self::$mediaArchiveBridge = org_glizy_ObjectFactory::createObject(__Config::get('glizycms.mediaArchive.bridge'));
     if ($application && __Config::get('glizycms.mediaArchive.mediaMappingEnabled')) {
         $application->registerProxy('org.glizycms.mediaArchive.services.MediaMappingService');
     }
 }
Esempio n. 2
0
 function findTerm($fieldName, $model, $query, $term, $proxyParams)
 {
     $oldMultisite = __Config::get('MULTISITE_ENABLED');
     if ($proxyParams && property_exists($proxyParams, 'multisite') && !$proxyParams->multisite) {
         __Config::set('MULTISITE_ENABLED', false);
     }
     $document = org_glizy_objectFactory::createObject('org.glizy.dataAccessDoctrine.ActiveRecordDocument');
     $document->addField(new org_glizy_dataAccessDoctrine_DbField($fieldName, Doctrine\DBAL\Types\Type::STRING, 255, false, null, '', false));
     $it = $document->createRecordIterator()->select('index0.document_index_text_value')->where('document_type', 'glizycms.content')->groupBy('index0.document_index_text_value')->allStatuses();
     if ($term != '') {
         $it->where($fieldName, '%' . $term . '%', 'LIKE');
     }
     $it->orderBy($fieldName);
     $result = array();
     foreach ($it as $ar) {
         $result[] = array('id' => $ar->document_index_text_value, 'text' => $ar->document_index_text_value);
     }
     __Config::set('MULTISITE_ENABLED', $oldMultisite);
     return $result;
 }
Esempio n. 3
0
 function getItems()
 {
     $oldCacheValue = __Config::get('QUERY_CACHING');
     __Config::set('QUERY_CACHING', $this->getAttribute('cache'));
     if (is_null($this->iterator)) {
         $this->process();
     }
     $items = org_glizy_ObjectValues::get('org.glizy.components.DataDictionary', $this->getAttribute('recordClassName') . '.' . $this->getAttribute('field') . $this->getAttribute('query'));
     if (is_null($items)) {
         $items = __Session::get($this->getAttribute('recordClassName') . '.' . $this->getAttribute('field') . $this->getAttribute('query'));
     }
     if (is_null($items)) {
         $items = $this->loadDictionary($this->getAttribute('field'), $this->getAttribute('query'), unserialize($this->getAttribute('queryParams')), $this->getAttribute('skipEmpty'), $this->getAttribute('delimiter'));
         org_glizy_ObjectValues::set('org.glizy.components.DataDictionary', $this->getAttribute('recordClassName') . '.' . $this->getAttribute('field') . $this->getAttribute('query'), $items);
         if ($this->getAttribute('delimiter') != '') {
             __Session::set($this->getAttribute('recordClassName') . '.' . $this->getAttribute('field') . $this->getAttribute('query'), $items);
         }
     }
     __Config::set('QUERY_CACHING', $oldCacheValue);
     return $items;
 }