本文整理汇总了PHP中org_glizy_ObjectFactory::createObject方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::createObject方法的具体用法?PHP org_glizy_ObjectFactory::createObject怎么用?PHP org_glizy_ObjectFactory::createObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org_glizy_ObjectFactory
的用法示例。
在下文中一共展示了org_glizy_ObjectFactory::createObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: execute
public function execute()
{
$authClass = org_glizy_ObjectFactory::createObject(__Config::get('glizy.authentication'));
$authClass->logout();
org_glizy_helpers_Navigation::gotoUrl(GLZ_HOST);
exit;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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']);
}
}
示例6: 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;
}
}
示例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;
}
示例8: process
function process()
{
$params = __Request::get('params');
$query = json_decode($params, true);
$paginateClass = $this->getComponentById('paginate');
$paginateClass->setRecordsCount();
$limits = $paginateClass->getLimits();
$start = $limits['start'] + 1;
$checkBoxEnable = $query['imgCheckBox'] === "checkBoxEnable";
$rows = 18;
$diff = 0;
if ($query['maxResult'] && !$checkBoxEnable && $start + $rows > $query['maxResult']) {
$rows = $query['maxResult'] - $start + 1;
$diff = 18 - $rows;
}
$this->_content = array('id' => $this->getId(), 'records' => array(), 'error' => null, 'params' => $params, 'rows' => $rows, 'currentOffset' => $limits['start']);
$request = org_glizy_ObjectFactory::createObject('movio.modules.europeana.SendRequest');
$response = $request->execute($query, $start, $rows);
if (!$response->error) {
$this->_content['records'] = $response->records;
if ($checkBoxEnable) {
$this->_content['imgCheckBox'] = true;
$total = $response->totalResults;
} else {
$this->_content['imgCheckBox'] = false;
$total = $response->totalResults ? $query['maxResult'] : 0;
}
} else {
$this->_content['error'] = $response->error;
}
$this->_content['imgList'] = $query['imgList'] ? $query['imgList'] : array();
$paginateClass->setRecordsCount($total - $diff, $rows);
}
示例9: 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);
}
示例10: includeFolder
private function includeFolder($folder)
{
// controlla se il file in cache è valido
$options = array('cacheDir' => org_glizy_Paths::get('CACHE_CODE'), 'lifeTime' => org_glizy_Config::get('CACHE_CODE'), 'readControlType' => '', 'fileExtension' => '.css');
$cacheSignature = get_class($this) . $folder;
$cacheObj = org_glizy_ObjectFactory::createObject('org.glizy.cache.CacheFile', $options);
$cssFileName = $cacheObj->verify($cacheSignature);
if ($cssFileName === false) {
$cssFile = '';
if ($dir_handle = @opendir($folder)) {
while ($file_name = readdir($dir_handle)) {
if ($file_name != "." && $file_name != ".." && !is_dir("{$dir}/{$file_name}")) {
$f[] = $file_name;
}
}
sort($f);
closedir($dir_handle);
foreach ($f as $element) {
$cssCode = file_get_contents($folder . '/' . $element);
$cssFile .= $cssCode . "\n";
}
}
if (__Config::get('DEBUG') !== false) {
$cacheObj->save($cssFile, NULL, get_class($this));
} else {
$cacheObj->save($cssFile, NULL, $cacheSignature);
}
$cssFileName = $cacheObj->getFileName();
}
return $cssFileName;
}
示例11: 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
}
示例12: process
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();
}
示例13: 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();
}
示例14: start
static function start()
{
if (!org_glizy_Session::isStarted()) {
$sessionStore = org_glizy_Config::get('glizy.session.store');
$prefix = org_glizy_Config::get('SESSION_PREFIX');
$timeout = org_glizy_Config::get('SESSION_TIMEOUT');
if ($sessionStore) {
$storagePrefix = org_glizy_Config::get('glizy.session.store.prefix');
if (!$storagePrefix) {
$storagePrefix = 'PHPSESSID';
}
$store = org_glizy_ObjectFactory::createObject($sessionStore, $timeout, $storagePrefix . $prefix);
if (!$store) {
throw new Exception('Session Store don\'t exists: ' . $sessionStore);
}
session_set_save_handler($store);
}
if (!isset($_SESSION)) {
org_glizy_Session::glz_session_start();
}
if (isset($_SESSION[$prefix . 'sessionLastAction']) && time() - $_SESSION[$prefix . 'sessionLastAction'] > $timeout) {
$_SESSION = array();
}
$_SESSION[$prefix . 'sessionStarted'] = true;
$_SESSION[$prefix . 'sessionLastAction'] = time();
}
}
示例15: execute
public function execute($data)
{
// TODO: controllo acl
$templateProxy = org_glizy_ObjectFactory::createObject('org.glizycms.template.models.proxy.TemplateProxy');
$templateProxy->saveEditData($data);
return true;
}