本文整理汇总了PHP中org_glizy_ObjectFactory类的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory类的具体用法?PHP org_glizy_ObjectFactory怎么用?PHP org_glizy_ObjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了org_glizy_ObjectFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ¤t()
{
$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
示例16: compile
function compile($options)
{
$this->initOutput();
// esegue il parsing del file di configurazione
$xml = org_glizy_ObjectFactory::createObject('org.glizy.parser.XML');
$xml->loadAndParseNS($this->_fileName);
$services = $xml->getElementsByTagName('AclService');
$this->output .= '$acl = array();';
foreach ($services as $service) {
$name = strtolower($service->getAttribute('name'));
$default = $service->hasAttribute('default') ? $service->getAttribute('default') : 'true';
$this->output .= '$acl[\'' . $name . '\'] = array(\'default\' => ' . $default . ', \'rules\' => array(';
$rules = $service->getElementsByTagName('AclAction');
foreach ($rules as $rule) {
$name = strtolower($rule->getAttribute('name'));
$allowGroups = $rule->getAttribute('allowGroups');
$allowGroups = !empty($allowGroups) ? 'array(\'' . str_replace(',', '\', \'', $allowGroups) . '\')' : 'array()';
$allowUsers = $rule->getAttribute('allowUsers');
$allowUsers = !empty($allowUsers) ? 'array(\'' . str_replace(',', '\', \'', $allowUsers) . '\')' : 'array()';
$this->output .= '\'' . $name . '\' => array(\'allowGroups\' => ' . $allowGroups . ', \'allowUsers\' => ' . $allowUsers . '), ';
}
$this->output .= '))' . GLZ_COMPILER_NEWLINE;
}
return $this->save();
}
开发者ID:GruppoMeta,项目名称:Movio,代码行数:25,代码来源:Acl.php
示例17: createChildComponents
function createChildComponents()
{
$entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$properties = $entityTypeService->getEntityTypeAttributeProperties(__Request::get('entityTypeId'), $this->_parent->getId());
$moduleId = $properties['entity_properties_params'];
$this->_content['title'] = $this->data->text;
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'title', 'title');
$this->addChild($c);
$this->_content['url'] = __Routing::makeUrl($moduleId, array('document_id' => $this->data->id, 'title' => $this->data->text));
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'url', 'url');
$this->addChild($c);
$module = org_glizy_Modules::getModule($moduleId);
$ar = org_glizy_ObjectFactory::createModel($module->classPath . '.models.Model');
$ar->load($this->data->id);
if ($ar->fieldExists('image')) {
$this->_content['__image'] = $ar->image;
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Image', $this->_application, $this, 'glz:Image', '__image', '__image');
$c->setAttribute('width', __Config::get('THUMB_WIDTH'));
$c->setAttribute('height', __Config::get('THUMB_HEIGHT'));
$c->setAttribute('crop', true);
$this->addChild($c);
} else {
$c =& org_glizy_ObjectFactory::createComponent('movio.modules.ontologybuilder.views.components.NoImage', $this->_application, $this, 'glz:Image', '__image', '__image');
$c->setAttribute('width', __Config::get('THUMB_SMALL_WIDTH'));
$c->setAttribute('height', __Config::get('THUMB_SMALL_HEIGHT'));
$this->addChild($c);
}
}
开发者ID:GruppoMeta,项目名称:Movio,代码行数:28,代码来源:Module.php
示例18: 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
示例19: execute
public function execute()
{
$c = $this->view->getComponentById('dp');
if (stripos($this->application->getPageId(), 'picker') !== false) {
// picker
$sessionEx = org_glizy_ObjectFactory::createObject('org.glizy.SessionEx', $c->getId());
$mediaType = org_glizy_Request::get('mediaType', '');
if (empty($mediaType)) {
$mediaType = $sessionEx->get('mediaType', 'ALL', false, false);
}
if (!empty($mediaType) && strtoupper($mediaType) != 'ALL') {
$sessionEx->set('mediaType', $mediaType, GLZ_SESSION_EX_PERSISTENT);
$c->setAttribute('query', 'all' . ucfirst(strtolower(str_replace(',', '_', $mediaType))));
// $this->setAttribute('filters', 'media_type IN (\''.str_replace(',', '\',\'',$mediaType).'\')');
}
if (stripos($this->application->getPageId(), 'tiny') !== false) {
$this->setComponentsVisibility('buttonsBar', false);
}
} else {
$query = str_replace('all', '', __Request::get('tabs_state', 'allMedia'));
// $query = str_replace('mediaarchive_all', '', strtolower($this->application->getPageId()));
if (empty($query) || $query == 'mediaarchive') {
$query = 'media';
}
$query = 'all' . ucfirst($query);
$c->setAttribute('query', $query);
}
// TODO disabilitare il pulsane aggiungi in base all'acl
}
开发者ID:GruppoMeta,项目名称:Movio,代码行数:29,代码来源:Index.php
示例20: render
/**
* Render
*
* @return void
* @access public
*/
function render($outputMode = NULL, $skipChilds = false)
{
$sets = $this->_application->getSets();
if (!count($sets)) {
$this->_application->setError('noSetHierarchy');
} else {
$metadataFormat = $this->_application->getMetadataFormat();
$output = '<ListSets>';
foreach ($sets as $v) {
$setClass = org_glizy_ObjectFactory::createObject($v);
if ($setClass) {
$info = $setClass->getSetInfo();
$output .= '<set>';
$output .= '<setSpec>' . org_glizy_oaipmh_OaiPmh::encode($info['setSpec']) . '</setSpec>';
$output .= '<setName>' . org_glizy_oaipmh_OaiPmh::encode($info['setName']) . '</setName>';
if (!empty($info['setDescription'])) {
$output .= '<setDescription>';
$output .= org_glizy_oaipmh_OaiPmh::openMetadataHeader($metadataFormat['oai_dc']);
$output .= '<dc:description>' . org_glizy_oaipmh_OaiPmh::encode($info['setDescription']) . '</dc:description>';
$output .= '<dc:creator>' . org_glizy_oaipmh_OaiPmh::encode($info['setCreator']) . '</dc:creator>';
$output .= org_glizy_oaipmh_OaiPmh::closeMetadataHeader($metadataFormat['oai_dc']);
$output .= '</setDescription>';
}
$output .= '</set>';
}
}
$output .= '</ListSets>';
$this->addOutputCode($output);
}
}
开发者ID:GruppoMeta,项目名称:Movio,代码行数:36,代码来源:ListSets.php
注:本文中的org_glizy_ObjectFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论