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


PHP org_glizy_ObjectFactory类代码示例

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


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

示例1: process

 /**
  * Process
  *
  * @return	boolean	false if the process is aborted
  * @access	public
  */
 function process()
 {
     $acl = $this->getAttribute('acl');
     if (!empty($acl)) {
         list($service, $action) = explode(',', $acl);
         if (!$this->_user->acl($service, $action)) {
             $this->breakCycle();
             $this->addOutputCode("403 Forbidden");
             return;
         }
     }
     $this->loadContentFromDB();
     $this->loadTemplate();
     $this->sessionEx = org_glizy_ObjectFactory::createObject('org.glizy.SessionEx', $this->getId());
     $this->action = __Request::get($this->actionName);
     $oldAction = $this->sessionEx->get($this->actionName);
     foreach ($this->childComponents as $c) {
         if (is_a($c, 'org_glizy_mvc_components_State')) {
             $c->deferredChildCreation();
         }
     }
     $this->callController();
     $this->canCallController = true;
     $this->action = strtolower($this->action);
     $this->processChilds();
     $this->sessionEx->set($this->actionName, $oldAction);
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:33,代码来源:MvcPage.php

示例2: apply

 function apply(&$regionContent)
 {
     $this->checkRequiredValues($regionContent);
     foreach ($regionContent as $k => $v) {
         if (!isset(${$k})) {
             ${$k} = $v;
         } else {
             ${$k} .= $v;
         }
     }
     $compiler = org_glizy_ObjectFactory::createObject('org.glizy.compilers.LayoutManagerPHP');
     $compiledFileName = $compiler->verify($this->fileName);
     if ($compiledFileName === false) {
         $templateSource = @implode('', file($this->fileName));
         $templateSource = $this->fixUrl($templateSource);
         $compiledFileName = $compiler->compile($templateSource);
     }
     ob_start();
     include $compiledFileName;
     $templateSource = ob_get_contents();
     ob_end_clean();
     if (isset($regionContent['__body__'])) {
         $templateSource = $this->modifyBodyTag($regionContent['__body__'], $templateSource);
     }
     $templateSource = $this->fixLanguages($templateSource);
     return $templateSource;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:27,代码来源:PHP.php

示例3: executeLater

 public function executeLater()
 {
     if ($this->user->isLogged() && $this->submit && $this->controller->validate()) {
         $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
         $ar->load($this->user->id);
         $email = org_glizy_Request::get('user_email', '');
         if ($email != $ar->user_loginId) {
             $ar2 = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
             if ($ar2->find(array('user_loginId' => $email)) && $ar2->user_id != $ar->user_id) {
                 $this->view->validateAddError('L\'email è già presente nel database, usare un\'altra email');
                 return;
             }
         }
         // TODO migliorare così siamo esposti a problemi di sicurezza
         $fields = $ar->getFields();
         foreach ($fields as $k => $v) {
             if ($k == 'user_password') {
                 continue;
             }
             if (__Request::exists($k)) {
                 $ar->{$k} = __Request::get($k);
             }
         }
         $password = __Request::get('user_password');
         if ($password) {
             $ar->user_password = glz_password($password);
         }
         $ar->user_loginId = $email;
         $ar->user_email = $email;
         $ar->save();
         $this->changeAction('modifyConfirm');
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:33,代码来源:Modify.php

示例4: execute

 public function execute($data)
 {
     // TODO: controllo acl
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     $templateProxy->saveEditData($data);
     return true;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:7,代码来源:Save.php

示例5: addDefaultComponents

 private function addDefaultComponents()
 {
     $id = '__id';
     $c = org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', $id, $id);
     $this->addChild($c);
     $c->init();
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:7,代码来源:TemplateEdit.php

示例6: execute

 public function execute()
 {
     $authClass = org_glizy_ObjectFactory::createObject(__Config::get('glizy.authentication'));
     $authClass->logout();
     org_glizy_helpers_Navigation::gotoUrl(GLZ_HOST);
     exit;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:7,代码来源:Logout.php

示例7: execute

 public function execute($menuId)
 {
     // TODO: CONTROLLO ACL
     $menuProxy = org_glizy_ObjectFactory::createObject('org.glizycms.contents.models.proxy.MenuProxy');
     $menuProxy->deleteMenu($menuId);
     return true;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:7,代码来源:Delete.php

示例8: execute

 function execute()
 {
     if (__Request::get('mbModuleType') == 'csv') {
         $tableName = $this->parent->getTableName();
         $fields = __Request::get('fieldName');
         $modelName = 'userModules.' . $tableName . '.models.Model';
         $fieldsMap = array();
         foreach ($fields as $f) {
             $col = str_replace('row_', '', $f);
             $fieldsMap[] = array($f, $col);
         }
         $ar = org_glizy_ObjectFactory::createModel($modelName);
         $csvIterator = org_glizy_ObjectFactory::createObject('movio.modules.modulesBuilder.services.CVSImporter', __Request::get('mbCsvOptions'));
         foreach ($csvIterator as $row) {
             if ($f) {
                 $ar->emptyRecord();
                 foreach ($fieldsMap as $f) {
                     $ar->{$f[0]} = $row->{$f[1]};
                 }
                 $ar->publish();
             }
         }
     }
     return true;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:25,代码来源:12ImportCsvData.php

示例9: executeLater

 public function executeLater()
 {
     if ($this->submit && $this->controller->validate()) {
         $email = org_glizy_Request::get('user_email', '');
         $ar = org_glizy_ObjectFactory::createModel('org.glizy.models.User');
         if ($ar->find(array('user_loginId' => $email))) {
             // TODO tradurre
             $this->view->validateAddError('L\'email è già presente nel database, usare un\'altra email o richiedere la password');
             return;
         }
         $fields = $ar->getFields();
         foreach ($fields as $k => $v) {
             if (__Request::exists($k)) {
                 $ar->{$k} = __Request::get($k);
             }
         }
         $ar->user_FK_usergroup_id = __Config::get('USER_DEFAULT_USERGROUP');
         $ar->user_isActive = __Config::get('USER_DEFAULT_ACTIVE_STATE');
         $ar->user_password = glz_password(__Request::get('user_password'));
         $ar->user_loginId = $email;
         $ar->user_email = $email;
         $ar->user_dateCreation = new org_glizy_types_DateTime();
         $ar->save();
         $this->changeAction('registrationConfirm');
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:26,代码来源:Registration.php

示例10: publish

 public function publish()
 {
     $exportPath = __Paths::get('CACHE') . 'export/';
     $mediaPath = $exportPath . 'media/';
     $zipPath = __Paths::get('BASE') . 'export/' . 'mobileContents.zip';
     org_glizy_helpers_Files::deleteDirectory($exportPath);
     @unlink($zipPath);
     @mkdir($exportPath);
     @mkdir($mediaPath);
     $exportService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.ExportService');
     $exportService->export();
     $medias = $exportService->getMedias();
     foreach ($medias as $id => $fileName) {
         $media = org_glizycms_mediaArchive_MediaManager::getMediaById($id);
         copy($media->getFileName(), $mediaPath . $fileName);
     }
     $dbHost = __Config::get('DB_HOST');
     $dbUser = __Config::get('DB_USER');
     $dbPass = __Config::get('DB_PSW');
     $dbName = __Config::get('DB_NAME');
     $tableName = __Config::get('movio.modules.publishApp.mobileContentsTable');
     $sqliteDb = $exportPath . __Config::get('movio.modules.publishApp.sqliteDbName');
     $mysql2SqliteService = org_glizy_ObjectFactory::createObject('movio.modules.publishApp.service.Mysql2SqliteService');
     $mysql2SqliteService->convert($dbHost, $dbUser, $dbPass, $dbName, $tableName, $sqliteDb);
     $this->createZip($exportPath, $zipPath);
     org_glizy_Registry::set('movio/modules/publishApp/lastUpdate', time());
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:27,代码来源:PublishAppService.php

示例11: process

 function process()
 {
     if (!$this->_application->isAdmin()) {
         $this->_content = array();
         $this->_content['label'] = $this->getAttribute('label');
         $this->_content['buttonLabel'] = $this->getAttribute('buttonLabel');
         $this->_content['comment'] = $this->getAttribute('comment');
         $this->_content['comment1'] = org_glizy_locale_Locale::get('GLZ_SEARCH_RESULT');
         $this->_content['value'] = org_glizy_Request::get('search', '');
         $this->_content['result'] = null;
         // preg_match( '/"([^"]*)"/i', $this->_content['value'], $match );
         // if ( count( $match ) )
         // {
         //     $searchArray2 = array( $match[ 1 ] );
         // }
         // else
         // {
         //     if ($this->getAttribute('explodeWords')) {
         //         $searchArray = explode(' ', $this->_content['value']);
         //         $searchArray2 = array();
         //         foreach ($searchArray as $word)
         //         {
         //             if (strlen($word)>=3) $searchArray2[] = $word;
         //         }
         //     } else {
         //         $searchArray2 = $this->_content['value'];
         //     }
         // }
         if (strlen($this->_content['value']) >= 3) {
             $pluginObj =& org_glizy_ObjectFactory::createObject('org.glizy.plugins.Search');
             $this->_content['result'] = $pluginObj->run(array('search' => $this->_content['value'], 'languageId' => $this->_application->getLanguageId()));
         }
         $this->_content['total'] = org_glizy_locale_Locale::get('GLZ_SEARCH_RESULT_TOTAL') . ' ' . count($this->_content['result']);
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:35,代码来源:Search.php

示例12: searchDocumentsByTerm

 public function searchDocumentsByTerm($term, $id, $protocol = '', $filterType = '')
 {
     $result = array();
     if ($protocol && $protocol != $this->protocol) {
         return $result;
     }
     $languageId = $this->editLanguageId;
     $it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.core.models.Menu');
     if ($term) {
         $it->load('autocompletePagePicker', array('search' => '%' . $term . '%', 'languageId' => $languageId, 'menuId' => '', 'pageType' => $filterType));
     } else {
         if ($id) {
             if (!is_numeric($id) && strpos($id, $this->protocol) !== 0) {
                 return $result;
             } elseif (is_string($id)) {
                 $id = $this->getIdFromLink($id);
             }
             $it->load('autocompletePagePicker', array('search' => '', 'languageId' => $languageId, 'menuId' => $id));
         } else {
             return $result;
         }
     }
     foreach ($it as $ar) {
         $result[] = array('id' => $this->protocol . $ar->menu_id, 'text' => $ar->menudetail_title, 'path' => ltrim($ar->p1 . '/' . $ar->p2 . '/' . $ar->p3, '/') . '/' . $ar->menudetail_title);
     }
     return $result;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:27,代码来源:PageResolver.php

示例13: getTemplateDataFromCache

 private function getTemplateDataFromCache($templateData)
 {
     $templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
     // $templateProxy->invalidateCache();
     $cache = $templateProxy->getTemplateCache();
     $cssFileName = __Paths::get('CACHE') . md5($this->getClassName() . '_' . $templateData->__id) . '.css';
     $self = $this;
     $templateData = $cache->get($cssFileName, array(), function () use($self, $templateData, $cssFileName) {
         $newTemplateData = new StdClass();
         $newTemplateData->footerLogo = '';
         $self->updateTemplateData($templateData);
         $self->compileCss($templateData, $cssFileName);
         $templateData->footerLogo = @json_decode($templateData->footerLogo);
         if ($templateData->footerLogo && $templateData->footerLogo->id) {
             $image = org_glizy_helpers_Media::getImageById($templateData->footerLogo->id);
             if ($templateData->footerLogoLink) {
                 $image = __Link::formatLink($templateData->footerLogoLink, $templateData->footerLogoTitle, $image);
             }
             $newTemplateData->footerLogo = $image;
         }
         $newTemplateData->css = $templateData->css;
         return $newTemplateData;
     });
     return $templateData;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:25,代码来源:Template.php

示例14:

 function &current()
 {
     $fields = $this->_rs->fields;
     $activeRecord =& org_glizy_ObjectFactory::createModel($this->_recordClassName);
     $activeRecord->loadFromArray($fields);
     return $activeRecord;
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:7,代码来源:RecordIterator.php

示例15: compile

 public static function compile($compiler, &$node, &$registredNameSpaces, &$counter, $parent = 'NULL')
 {
     if ($node->hasAttribute('src')) {
         $src = $node->getAttribute('src');
         if (strpos($src, '.xml') === strlen($src) - 4) {
             $src = substr($src, 0, -4);
         }
         $pageType = org_glizy_ObjectFactory::resolvePageType($src) . '.xml';
         $path = $compiler->getPath();
         $fileName = $path . $pageType;
         if (!file_exists($fileName)) {
             $fileName = glz_findClassPath($src);
             if (is_null($fileName)) {
                 // TODO: file non trovato visualizzare errore
             }
         }
         $compiler2 = org_glizy_ObjectFactory::createObject('org.glizy.compilers.Component');
         $compiledFileName = $compiler2->verify($fileName);
         $className = GLZ_basename($compiledFileName);
         $componentId = $node->hasAttribute('id') ? $node->getAttribute('id') : '';
         $compiler->_classSource .= '// TAG: ' . $node->nodeName . ' ' . $node->getAttribute('src') . GLZ_COMPILER_NEWLINE2;
         $compiler->_classSource .= 'if (!$skipImport) {' . GLZ_COMPILER_NEWLINE2;
         $compiler->_classSource .= 'org_glizy_ObjectFactory::requireComponent(\'' . $compiledFileName . '\', \'' . addslashes($fileName) . '\')' . GLZ_COMPILER_NEWLINE;
         $compiler->_classSource .= '$n' . $counter . ' = new ' . $className . '($application, ' . $parent . ')' . GLZ_COMPILER_NEWLINE;
         $compiler->_classSource .= $parent . '->addChild($n' . $counter . ')' . GLZ_COMPILER_NEWLINE;
         $compiler->_classSource .= '}' . GLZ_COMPILER_NEWLINE;
     }
 }
开发者ID:GruppoMeta,项目名称:Movio,代码行数:28,代码来源:Import.php


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