예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function collect()
 {
     $application = org_glizy_ObjectValues::get('org.glizy', 'application');
     $result = array();
     $result['pageId'] = $application->getPageId();
     $result['routing'] = __Request::get('__routingName__') . ' > ' . __Request::get('__routingPattern__');
     $result['controllers'] = implode(', ', $this->calledControllers);
     $user = $application->getCurrentUser();
     $userData = array('id' => $user->id, 'firstName' => $user->firstName, 'lastName' => $user->lastName, 'email' => $user->email, 'groupId' => $user->groupId, 'backEndAccess' => $user->backEndAccess);
     $result['user'] = $this->getDataFormatter()->formatVar($userData);
     $menu = $application->getCurrentMenu();
     $menuData = array('id' => $menu->id, 'title' => $menu->title, 'parentId' => $menu->parentId, 'pageType' => $menu->pageType, 'type' => $menu->type, 'depth' => $menu->depth);
     $result['menu'] = $this->getDataFormatter()->formatVar($menuData);
     // request
     $data = __Request::getAllAsArray();
     $tempData = array();
     foreach ($data as $k => $v) {
         if (strpos($k, '__') !== 0) {
             $tempData[$k] = $v;
         }
     }
     $result['__Request'] = $this->getDataFormatter()->formatVar($tempData);
     $result['__Config'] = $this->getDataFormatter()->formatVar(__Config::getAllAsArray());
     $result['__Routing'] = $this->getDataFormatter()->formatVar(__Routing::getAllAsArray());
     $result['__Session'] = $this->getDataFormatter()->formatVar(__Session::getAllAsArray());
     return $result;
 }
 function executeLater_deleteModule($oldState)
 {
     if (strtolower(__Request::get('action', '')) == 'next') {
         $pageType = $this->_parent->_application->getPageType();
         list($moduleName) = explode('.', $pageType);
         __Session::set('mbTable', $moduleName);
         glz_import('movio.modules.modulesBuilder.builder.*', array('Builder.php', 'AbstractCommand.php'));
         $builder = org_glizy_ObjectFactory::createObject('movio.modules.modulesBuilder.builder.Builder');
         $builder->executeDelete();
         glz_import('org.glizy.helpers.Navigation');
         org_glizy_helpers_Navigation::gotoUrl(__Link::makeUrl('link', array('pageId' => 'SiteMap')));
     }
 }
예제 #3
0
파일: State.php 프로젝트: GruppoMeta/Movio
 function deferredChildCreation($force = false)
 {
     if ($this->isCurrentState() || $force) {
         // aggiunge i figli
         if (!count($this->childComponents)) {
             $function = 'addChild_' . $this->getId();
             $function($this->_application, $this);
             $this->initChilds();
             $this->execDoLater();
         }
         if ($this->getAttribute('backUrl')) {
             __Session::set('__backUrl__', __Request::get('__backUrl__'));
         }
     }
 }
예제 #4
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;
 }
예제 #5
0
 function setValuesForNextRefresh($values)
 {
     __Session::set('__valuesForNextRefresh', $values);
 }
예제 #6
0
 function _initSiteMap($forceReload = false)
 {
     $this->log("initSiteMap", GLZ_LOG_SYSTEM);
     $this->siteMap =& org_glizy_ObjectFactory::createObject('org.glizycms.core.application.SiteMapDB');
     $this->siteMap->getSiteArray($forceReload);
     // controlla se l'utente ha i permessi per modificare la pagina
     // per velocizzare vengono precaricate tutte le relazioni in memoria
     $this->_aclPage = array();
     if (__Config::get('ACL_ENABLED')) {
         $this->_aclPage = __Session::get('glizy.aclFront', NULL);
         if (is_null($this->_aclPage)) {
             $this->_aclPage = array();
             $it = org_glizy_ObjectFactory::createModelIterator('org.glizy.models.Join', 'all', array('filters' => array('join_objectName' => 'menus_tbl#rel_aclFront')));
             foreach ($it as $arC) {
                 if (!isset($this->_aclPage[$arC->join_FK_source_id])) {
                     $this->_aclPage[$arC->join_FK_source_id] = array();
                 }
                 $this->_aclPage[$arC->join_FK_source_id][] = $arC->join_FK_dest_id;
             }
             // scorre tutti i menù per attribuire l'acl ai menù che non ce l'hanno
             // ereditandola dal padre
             $siteMapIterator =& org_glizy_ObjectFactory::createObject('org.glizy.application.SiteMapIterator', $this->siteMap);
             while (!$siteMapIterator->EOF) {
                 $n = $siteMapIterator->getNode();
                 $siteMapIterator->moveNext();
                 if (!isset($this->_aclPage[$n->id])) {
                     $n2 = $n;
                     while (true) {
                         if ($n2->parentId == 0) {
                             break;
                         }
                         $parentNode = $n2->parentNode();
                         $n2 = $parentNode;
                         if (isset($this->_aclPage[$parentNode->id])) {
                             $this->_aclPage[$n->id] = $this->_aclPage[$parentNode->id];
                             break;
                         }
                     }
                 }
             }
             __Session::set('glizy.aclFront', $this->_aclPage);
         }
     }
 }
예제 #7
0
 private function addTranslateInfo($target, $label, $buttonValue)
 {
     $infoName = '__translateInfo_' . strtolower($this->_application->getPageId());
     $translateInfo = __Session::get($infoName, array());
     $newTranslateInfo = array();
     foreach ($translateInfo as $value) {
         if ($value['target_name'] != $this->getOriginalId()) {
             $newTranslateInfo[] = $value;
         }
     }
     $newTranslateInfo[] = array('target_name' => $this->getOriginalId(), 'target' => $target, 'label' => $label, 'value' => $buttonValue);
     __Session::set($infoName, $newTranslateInfo);
 }
예제 #8
0
 function _init()
 {
     // inizializzazione delle classi
     // classe statica per la gestione dei path
     org_glizy_Paths::init($this->_pathApplication, $this->_pathCore);
     // legge i parametri di configurazione
     org_glizy_Config::init($this->_configHost);
     $sessionPrefix = org_glizy_Config::get('SESSION_PREFIX');
     if (empty($sessionPrefix)) {
         // se non è stato specificato un prefisso per la sessione
         // viene usato il nome dell'applicazione
         org_glizy_Config::set('SESSION_PREFIX', str_replace(array('.', ' ', '/'), '', $this->_pathApplication) . '_');
     }
     // inizializzazione della sessione
     __Session::start();
     if (org_glizy_config::get('LOG_FILE') != '') {
         if (org_glizy_config::get('LOG_FILE') != "firebug") {
             $this->_logObj = org_glizy_log_LogFactory::create('File', org_glizy_Paths::get('APPLICATION') . '/' . org_glizy_config::get('LOG_FILE'), array(), org_glizy_config::get('LOG_LEVEL'));
         } else {
             $this->_logObj = org_glizy_log_LogFactory::create('FireBug', array(), org_glizy_config::get('LOG_LEVEL'));
         }
         $this->log("Start application", GLZ_LOG_SYSTEM);
     }
     if (__Config::get('glizy.exception.log.format') == 'elasticsearch') {
         org_glizy_log_LogFactory::create('ElasticSearch', array(), 0);
         // Questo serve per poter istanziare la classe in Exception.php (gruppo 0 non logga nulla)
     }
     $this->login();
     $this->_initLanguage();
 }
예제 #9
0
 function changeBackPage()
 {
     $url = __Session::get('__backUrl__', '');
     org_glizy_helpers_Navigation::gotoUrl($url);
 }