Example #1
0
 function process()
 {
     $this->recordId = org_glizy_Request::get($this->getAttribute('idName'), NULL);
     if (is_null($this->recordId)) {
         return;
     }
     $dataProvider =& $this->getAttribute('dataProvider');
     if ($dataProvider) {
         $this->ar = $dataProvider->load($this->recordId);
         $processCell = org_glizy_ObjectFactory::createObject($this->getAttribute('processCell'), $this->_application);
         if ($processCell) {
             $ar =& $this->ar;
             call_user_func_array(array($processCell, 'renderCell'), array($ar, $this->getAttribute('processCellParams')));
         }
         $this->_content = org_glizy_ObjectFactory::createObject('org.glizy.components.RecordDetailVO', $this->ar);
         $ogTitle = $this->getAttribute('ogTitle');
         if ($ogTitle) {
             org_glizy_ObjectValues::set('org.glizy.og', 'title', $this->ar->{$ogTitle});
             if ($this->getAttribute('modifyBreadcrumbs')) {
                 $evt = array('type' => GLZ_EVT_BREADCRUMBS_UPDATE, 'data' => $this->ar->{$ogTitle});
                 $this->dispatchEvent($evt);
                 $evt = array('type' => GLZ_EVT_PAGETITLE_UPDATE, 'data' => $this->ar->{$ogTitle});
                 $this->dispatchEvent($evt);
             }
         }
         // TODO controllare che i dati siano stati caricati correttamento
     } else {
         // TODO generare errore, dataprovider non valid
     }
     $this->_content->__url__ = !is_null($this->getAttribute('routeUrl')) ? org_glizy_helpers_Link::makeURL($this->getAttribute('routeUrl'), $this->_content) : '';
     parent::process();
 }
Example #2
0
 function process()
 {
     $template = __Config::get('glizycms.form.buttonsPanel');
     if ($template) {
         list($templateStart, $templateEnd) = explode('##CONTENT##', $template);
         $this->templateStart = str_replace('##ID##', $this->getid(), $templateStart);
         $this->templateEnd = $templateEnd;
     }
     parent::process();
 }
Example #3
0
 /**
  * @param org_glizy_components_Component $targetComponent
  *
  * @return array
  */
 private function processAjaxCallController($targetComponent)
 {
     if (__Request::exists('controllerName')) {
         $targetComponent->setAttribute('controllerName', __Request::get('controllerName'));
     }
     $result = array('status' => false);
     $r = $targetComponent->callController();
     if ($r !== null && $r !== false) {
         if ($targetComponent->controllerDirectOutput()) {
             return $r;
         }
         $result['status'] = true;
         if (is_array($r) && isset($r['error'])) {
             $result['status'] = false;
             $result['error'] = $r['error'];
             return $result;
         }
         $outputFormatInHtml = false;
         $html = '';
         if (is_array($r) && isset($r['sendOutput'])) {
             // controlla se c'รจ renderizzare dei componenti da mandare all'output
             __Request::set('action', isset($r['sendOutputState']) ? $r['sendOutputState'] : '');
             $outputFormatInHtml = isset($r['sendOutputFormat']) && $r['sendOutputFormat'] == 'html';
             $this->_rootComponent->process();
             $componentsId = $r['sendOutput'];
             unset($r['sendOutput']);
             unset($r['sendOutputState']);
             if (!is_array($componentsId)) {
                 $componentsId = array($componentsId);
             }
             foreach ($componentsId as $id) {
                 $c = $this->_rootComponent->getComponentById($id);
                 if (is_object($c)) {
                     $this->_rootComponent->_output = array();
                     $c->render();
                     //$r[ 'sendOutput' ][ $id ] = $this->_output[ 0 ][ 'code' ];
                     $r[$id] = '';
                     foreach ($this->_rootComponent->_output as $o) {
                         if (strpos($o['editableRegion'], '__') !== false) {
                             continue;
                         }
                         $r[$id] .= $o['code'];
                         $html .= $o['code'];
                     }
                 }
             }
         }
         if ($outputFormatInHtml) {
             $result['html'] = $html;
         } else {
             $result['result'] = $r;
         }
     }
     return $result;
 }
Example #4
0
 function process()
 {
     $dictionaryId = $this->loadContent($this->getId() . '-dictionaryId');
     parent::process();
     if (!$this->_application->isAdmin()) {
         $thesaurusProxy = org_glizy_ObjectFactory::createObject('movio.modules.thesaurus.models.proxy.ThesaurusProxy');
         $this->type = $thesaurusProxy->getTypeByDictionaryId($dictionaryId);
         $this->_content = array('type' => $this->type, 'records' => array());
         $this->readTermsList($dictionaryId, $this->type);
     }
 }