Exemplo n.º 1
0
 public function process()
 {
     if ($this->getAttribute('global')) {
         $templateXml = 'TemplateAdminGlobal';
         $menuId = 0;
     } else {
         $templateXml = 'TemplateAdmin';
         $menuId = __Request::get('menuId', __Request::get('__id'));
         if (!$menuId) {
             // TODO ERRORE
         }
     }
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     $templateName = $templateProxy->getSelectedTemplate();
     if (!$templateName) {
         // TODO ERRORE
     }
     $templateProxy->loadTemplateLocale();
     // legge i dati del template
     $data = $templateProxy->getEditDataForMenu($menuId, __Request::exists('loadFromParent'));
     $customTemplate = $templateProxy->getTemplateCustomClass();
     if ($customTemplate && method_exists($customTemplate, 'updateTemplateData')) {
         $customTemplate->updateTemplateData($data);
     }
     $this->setData($data);
     $this->addDefaultComponents();
     $templateRealPath = $templateProxy->getTemplateRealpath();
     if ($templateRealPath) {
         org_glizy_ObjectFactory::attachPageToComponent($this, $this->_application, $templateXml, $templateRealPath . '/', array('idPrefix' => $this->getId() . '-', 'skipImport' => true, 'mode' => 'edit'), $this->getId() . '-');
         parent::process();
         // TODO visualizzare che non ci sono parametri di personalizzazione
     }
 }
Exemplo n.º 2
0
 public function process()
 {
     if ($this->getAttribute('mode') == 'container') {
         $this->emptySrc = __Routing::makeUrl('linkChangeAction', array('action' => $this->getAttribute('initialState')));
         $this->editSrc = __Routing::makeUrl('linkChangeAction', array('action' => $this->getAttribute('editState'))) . '?dictionaryId=' . __Request::get('dictionaryId') . '&termId=';
     } else {
         $termId = __Request::get('termId');
         $thesaurusProxy = org_glizy_ObjectFactory::createObject('movio.modules.thesaurus.models.proxy.ThesaurusProxy');
         $termVo = $thesaurusProxy->loadTerm($termId);
         $this->setData($termVo);
         parent::process();
     }
 }
Exemplo n.º 3
0
 public function process()
 {
     if ($this->getAttribute('mode') == 'container') {
         $this->emptySrc = __Routing::makeUrl('linkChangeAction', array('action' => $this->getAttribute('initialState')));
         $this->editSrc = __Routing::makeUrl('linkChangeAction', array('action' => $this->getAttribute('editState'))) . '?menuId=';
     } else {
         $this->menuId = __Request::get('menuId');
         // TODO: lanciare un'eccezione se l'id non è valido
         $menuProxy = org_glizy_ObjectFactory::createObject('org.glizycms.contents.models.proxy.MenuProxy');
         $menu = $menuProxy->getMenuFromId($this->menuId, org_glizy_ObjectValues::get('org.glizy', 'editingLanguageId'));
         // TODO: il menù viene letto due volte, in questo codice ed in readContentFromMenu
         $contentProxy = org_glizy_ObjectFactory::createObject('org.glizycms.contents.models.proxy.ContentProxy');
         $content = $contentProxy->readContentFromMenu($this->menuId, org_glizy_ObjectValues::get('org.glizy', 'editingLanguageId'));
         $this->setData($content);
         $this->addComponentsToEdit($menu);
         parent::process();
     }
 }