当前位置: 首页>>代码示例>>PHP>>正文


PHP org_glizy_ObjectFactory::createPage方法代码示例

本文整理汇总了PHP中org_glizy_ObjectFactory::createPage方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::createPage方法的具体用法?PHP org_glizy_ObjectFactory::createPage怎么用?PHP org_glizy_ObjectFactory::createPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org_glizy_ObjectFactory的用法示例。


在下文中一共展示了org_glizy_ObjectFactory::createPage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addComponentsToEdit

 function addComponentsToEdit($menu)
 {
     $templatePath = org_glizycms_Glizycms::getSiteTemplatePath();
     $originalRootComponent =& $this->_application->getRootComponent();
     $originalChildren = $this->childComponents;
     $this->childComponents = array();
     $this->addDefaultComponents($menu);
     $this->_pageTypeObj =& org_glizy_ObjectFactory::createPage($this->_application, $menu->menu_pageType, org_glizy_Paths::get('APPLICATION_TO_ADMIN_PAGETYPE'), array('idPrefix' => $this->getId() . '-', 'skipImport' => true, 'pathTemplate' => $templatePath, 'mode' => 'edit'));
     $rootComponent =& $this->_application->getRootComponent();
     $rootComponent->init();
     $this->_application->_rootComponent =& $originalRootComponent;
     $editComponents = $rootComponent->getAttribute('adm:editComponents');
     $this->allowBlocks = $rootComponent->getAttribute('allowBlocks');
     if (count($editComponents)) {
         foreach ($editComponents as $id) {
             $component =& $rootComponent->getComponentById($this->getId() . '-' . $id);
             if (!is_object($component)) {
                 continue;
             }
             $component->remapAttributes($this->getId() . '-');
             $this->addChild($component);
             $component->_parent =& $this;
             $component->setAttribute('visible', true);
         }
     } else {
         for ($i = 0; $i < count($rootComponent->childComponents); $i++) {
             $rootComponent->childComponents[$i]->remapAttributes($this->getId() . '-');
             $this->addChild($rootComponent->childComponents[$i]);
             $rootComponent->childComponents[$i]->_parent =& $this;
         }
     }
     $this->childComponents = array_merge($this->childComponents, $originalChildren);
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:33,代码来源:PageEdit.php

示例2: process

 /**
  * Process
  *
  * @return	boolean	false if the process is aborted
  * @access	public
  */
 function process()
 {
     $tagContent = $this->getText();
     if (empty($tagContent)) {
         // richiede il contenuto al padre
         $tagContent = $this->_parent->loadContent($this->getId());
         $this->setText($tagContent);
     }
     if ($this->_parent->_tagname == 'glz:Page') {
         if (strpos($this->getText(), '.xml') !== false) {
             // crea i componenti leggendoli dal pageType specificato
             $fileName = org_glizy_Paths::getRealPath('APPLICATION_PAGE_TYPE', $this->getText());
             if (!empty($fileName)) {
                 $originalRootComponent =& $this->_application->getRootComponent();
                 $this->_pageTypeObj =& org_glizy_ObjectFactory::createPage($this->_application, preg_replace('/.xml$/', '', $this->getText()));
                 $rootComponent =& $this->_application->getRootComponent();
                 $rootComponent->init();
                 $this->_application->_rootComponent =& $originalRootComponent;
                 for ($i = 0; $i < count($rootComponent->childComponents); $i++) {
                     $rootComponent->childComponents[$i]->remapAttributes($this->getId() . '-');
                     $this->addChild($rootComponent->childComponents[$i]);
                     $rootComponent->childComponents[$i]->_parent =& $this;
                 }
                 $this->processChilds();
             }
         } else {
             $newComponent =& org_glizy_ObjectFactory::createComponent($this->getText(), $this->_application, $this, '', '', '');
             $newComponent->init();
             $this->addChild($newComponent);
             $this->processChilds();
         }
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:39,代码来源:EmbedPage.php

示例3: getEditForm

 protected function getEditForm($pageId, $formId = 'editForm', $formAction = 'edit')
 {
     $oldAction = __Request::get('action');
     __Request::set('action', $formAction);
     $application = org_glizy_ObjectValues::get('org.glizy', 'application');
     $originalRootComponent = $application->getRootComponent();
     $siteMap = $application->getSiteMap();
     $siteMapNode = $siteMap->getNodeById($pageId);
     $pageType = $siteMapNode->getAttribute('pageType');
     $path = org_glizy_Paths::get('APPLICATION_PAGETYPE');
     $templatePath = org_glizycms_Glizycms::getSiteTemplatePath();
     $options = array('skipImport' => true, 'pathTemplate' => $templatePath, 'mode' => 'edit');
     $pageTypeObj =& org_glizy_ObjectFactory::createPage($application, $pageType, $path, $options);
     $rootComponent = $application->getRootComponent();
     $rootComponent->init();
     $application->_rootComponent =& $originalRootComponent;
     __Request::set('action', $oldAction);
     return $rootComponent->getComponentById($formId);
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:19,代码来源:Modules.php

示例4: attachPageToComponent

 /**
  * @param org_glizy_components_Component $component
  * @param org_glizy_application_Application $application
  * @param string $pageType
  * @param string $path
  * @param array $options
  * @param string $remapId
  * @param bool $atTop
  */
 function attachPageToComponent($component, $application, $pageType, $path, $options, $remapId, $atTop = true)
 {
     $originalRootComponent = $application->getRootComponent();
     $originalChildren = $component->childComponents;
     $component->childComponents = array();
     org_glizy_ObjectFactory::createPage($application, $pageType, $path, $options);
     $rootComponent = $application->getRootComponent();
     $rootComponent->init();
     $rootComponent->execDoLater();
     $application->_rootComponent =& $originalRootComponent;
     for ($i = 0; $i < count($rootComponent->childComponents); $i++) {
         $rootComponent->childComponents[$i]->remapAttributes($remapId);
         $component->addChild($rootComponent->childComponents[$i]);
         $rootComponent->childComponents[$i]->_parent =& $component;
     }
     $component->childComponents = $atTop ? array_merge($component->childComponents, $originalChildren) : array_merge($originalChildren, $component->childComponents);
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:26,代码来源:ObjectFactory.php

示例5: _startProcess

 /**
  * @param bool $readPageId
  */
 function _startProcess($readPageId = true)
 {
     $this->log("startProcess", GLZ_LOG_SYSTEM);
     if ($this->_logObj) {
         $this->log(array('Request' => __Request::getAllAsArray()), GLZ_LOG_SYSTEM);
     }
     if ($readPageId) {
         $evt = array('type' => GLZ_EVT_BEFORE_CREATE_PAGE);
         $this->dispatchEvent($evt);
         $this->_readPageId();
     }
     org_glizy_ObjectValues::set('org.glizy.application', 'pageId', $this->_pageId);
     $this->_pageType = $this->siteMapMenu->pageType;
     if (__Request::exists('__middleware__')) {
         $middlewareObj = org_glizy_ObjectFactory::createObject(__Request::get('__middleware__'));
         // verify the cache before page rendering
         // this type of cache is available only for Static Page
         if ($middlewareObj) {
             $middlewareObj->beforeProcess($this->_pageId, $this->_pageType);
         }
     }
     org_glizy_ObjectFactory::createPage($this, $this->_pageType, null, array('pathTemplate' => org_glizy_Paths::get('APPLICATION_TEMPLATE')));
     if (!is_null($this->_rootComponent)) {
         if (!$this->_ajaxMode) {
             // serve per resettare lo stato del sessionEx ad ogni caricamento delle pagine
             // altrimenti gli stati vecchi non vengono cancellati
             // quando c'è un cambio di pagina e SessionEx non è usato
             org_glizy_ObjectFactory::createObject('org.glizy.SessionEx', '');
             $this->_rootComponent->resetDoLater();
             $this->_rootComponent->init();
             $this->_rootComponent->execDoLater();
             $this->log("Process components", GLZ_LOG_SYSTEM);
             $this->_rootComponent->resetDoLater();
             $evt = array('type' => GLZ_EVT_START_PROCESS);
             $this->dispatchEvent($evt);
             if (method_exists($this, 'process_onStart')) {
                 $this->process_onStart();
             }
             $this->_rootComponent->process();
             if (method_exists($this, 'process_onEnd')) {
                 $this->process_onEnd();
             }
             $this->_rootComponent->execDoLater();
             $evt = array('type' => GLZ_EVT_END_PROCESS);
             $this->dispatchEvent($evt);
             // check if enable the PDF output
             if ($this->getCurrentMenu()->printPdf) {
                 $pdfPage = org_glizy_Paths::getRealPath('APPLICATION_TEMPLATE', 'pdf.php');
                 if ($pdfPage !== false) {
                     if (__Request::get('printPdf', '0')) {
                         org_glizy_ObjectValues::set('org.glizy.application', 'pdfMode', __Request::get('printPdf', '0') == '1');
                     }
                 } else {
                     $this->getCurrentMenu()->printPdf = false;
                 }
             }
             $evt = array('type' => GLZ_EVT_START_RENDER);
             $this->dispatchEvent($evt);
             $this->_rootComponent->resetDoLater();
             if (method_exists($this, 'render_onStart')) {
                 $this->render_onStart();
             }
             $this->addJScoreLibraries();
             $output = $this->_rootComponent->render();
             if (method_exists($this, 'render_onEnd')) {
                 $this->render_onEnd();
             }
             $this->_rootComponent->execDoLater();
             $evt = array('type' => GLZ_EVT_END_RENDER);
             $this->dispatchEvent($evt);
             $headerErrorCode = __Request::get('glizyHeaderCode', '');
             if ($headerErrorCode == '404') {
                 header("HTTP/1.1 404 Not Found");
                 header("Status: 404 Not Found");
             }
             header("Content-Type: " . $this->contentType . "; charset=" . __Config::get('CHARSET'));
             if ($middlewareObj) {
                 // verify the cache after content rendering
                 $middlewareObj->afterRender($output);
             }
             echo $output;
         } else {
             $this->startProcessAjax();
         }
     } else {
         // TODO
         // visualizzare errore
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:92,代码来源:Application.php


注:本文中的org_glizy_ObjectFactory::createPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。