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 } }
public function render_html_onEnd($value = '') { if ($this->getAttribute('mode') != 'container') { parent::render_html_onEnd(); if ($this->allowBlocks) { $this->addOutputCode('<div class="js-glizycmsBlocksEdit" data-menuid="' . $this->menuId . '" data-ajaxurl="' . $this->getAjaxUrl() . '"></div>'); } } }
public function render_html_onStart() { // TODO localizzare il javascript $this->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('jquery-simplemodal/jquery.simplemodal.1.4.1.min.js')); $this->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('progressBar/progressBar.js')); $this->addOutputCode(org_glizy_helpers_CSS::linkCoreCSSfile2('progressBar/progressBar.css'), 'head'); $this->addOutputCode(org_glizy_helpers_JS::linkCoreJSfile('formWithAjaxSteps.js?v=' . GLZ_CORE_VERSION)); parent::render_html_onStart(); $ajaxUrl = $this->getAttribute('controllerName') ? $this->getAjaxUrl() : ''; $output = <<<EOD <div id="progress_bar" class="js-glizycms-FormEditWithAjaxSteps ui-progress-bar ui-container" data-ajaxurl="{$ajaxUrl}"> <div class="ui-progress" style="width: 0%;"> <span class="ui-label" style="display:none;"><b class="value">0%</b></span> </div> </div> EOD; $this->addOutputCode($output); }
public function render_html_onEnd($value = '') { if ($this->getAttribute('mode') != 'container') { parent::render_html_onEnd(); } }