本文整理汇总了PHP中org_glizy_ObjectFactory::createComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP org_glizy_ObjectFactory::createComponent方法的具体用法?PHP org_glizy_ObjectFactory::createComponent怎么用?PHP org_glizy_ObjectFactory::createComponent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org_glizy_ObjectFactory
的用法示例。
在下文中一共展示了org_glizy_ObjectFactory::createComponent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: 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);
}
}
示例3: 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();
}
}
}
示例4: createChildComponents
function createChildComponents()
{
$entityTypeId = $this->_content['entityTypeId'];
$entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$skinAttributes = unserialize($entityTypeService->getEntityTypeAttribute($entityTypeId, 'entity_skin_attributes'));
if (!$skinAttributes) {
return;
}
$language = $this->_application->getLanguage();
$localeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.LocaleService');
foreach ($skinAttributes->properties as $i => $property) {
$skinAttributes->properties[$i]['label'] = $localeService->getTranslation($language, $property['label']);
}
foreach ($skinAttributes->body as $i => $body) {
$skinAttributes->body[$i]['label'] = $localeService->getTranslation($language, $body['label']);
}
$groupBoxRel =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Groupbox', $this->_application, $this, 'glz:Groupbox', 'relations');
$this->addChild($groupBoxRel);
$skinsName = array('Entity_relationImage.html', 'Entity_relationLink.html', 'Entity_relationImageLink.html');
$groupBox =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Groupbox', $this->_application, $this, 'glz:Groupbox', 'detail');
$groupBox->setAttribute('skin', 'Entity_entry.html');
$this->addChild($groupBox);
$this->_content['attributes'] = $skinAttributes;
$this->_content['relations'] = new StdClass();
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', 'attributes', 'attributes');
$groupBox->addChild($c);
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', 'relations', 'relations');
$groupBox->addChild($c);
if (isset($this->_content['subtitle']) && $this->_content['subtitle']) {
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.PageTitle', $this->_application, $this, 'glz:Text', 'subtitle', 'subtitle');
$c->setAttributes(array('tag' => 'h2', 'editableRegion' => 'pageTitle', 'value' => $this->_content['subtitle']));
$this->addChild($c);
}
// TODO usare EntityTypeService per ottenere le proprietà in cache
$it = org_glizy_objectFactory::createModelIterator('movio.modules.ontologybuilder.models.EntityProperties');
$it->load('entityPropertiesFromId', array('entityId' => $entityTypeId));
foreach ($it as $ar) {
$attribute = $entityTypeService->getAttributeIdByAr($ar);
switch ($ar->entity_properties_type) {
case 'attribute.text':
case 'attribute.int':
case 'attribute.date':
case 'attribute.openlist':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.longtext':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LongText', $this->_application, $this, 'glz:LongText', $attribute, $attribute);
$c->setAttribute('forceP', true);
$groupBox->addChild($c);
break;
case 'attribute.descriptivetext':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LongText', $this->_application, $this, 'glz:LongText', $attribute, $attribute);
$c->setAttribute('adm:htmlEditor', true);
$groupBox->addChild($c);
break;
case 'attribute.externallink':
case 'attribute.internallink':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LinkTo', $this->_application, $this, 'glz:LinkTo', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.externalimage':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.ImageExternal', $this->_application, $this, 'glz:ImageExternal', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.image':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Image', $this->_application, $this, 'glz:Image', $attribute, $attribute);
$c->setAttribute('width', __Config::get('IMG_WIDTH'));
$c->setAttribute('height', __Config::get('IMG_HEIGHT'));
$c->setAttribute('zoom', true);
$c->setAttribute('superZoom', true);
$groupBox->addChild($c);
break;
case 'attribute.media':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Media', $this->_application, $this, 'glz:Media', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.imagelist':
if ($this->_content[$attribute]) {
$c =& org_glizy_ObjectFactory::createComponent('movio.modules.ontologybuilder.views.components.Repeater', $this->_application, $this, 'cmp:Repeater', $attribute, $attribute);
$subchild =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Image', $this->_application, $c, 'glz:Image', 'attaches', 'attaches');
$subchild->setAttribute('width', __Config::get('THUMB_WIDTH'));
$subchild->setAttribute('height', __Config::get('THUMB_HEIGHT'));
$subchild->setAttribute('zoom', true);
$c->addChild($subchild);
$groupBox->addChild($c);
}
break;
case 'attribute.medialist':
if ($this->_content[$attribute]) {
$c =& org_glizy_ObjectFactory::createComponent('movio.modules.ontologybuilder.views.components.Repeater', $this->_application, $this, 'cmp:Repeater', $attribute, $attribute);
$subchild =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Media', $this->_application, $c, 'glz:Media', 'attaches', 'attaches');
$c->addChild($subchild);
$groupBox->addChild($c);
}
break;
case 'attribute.photogallery':
$c =& org_glizy_ObjectFactory::createComponent('movio.views.components.PhotogalleryCategory', $this->_application, $this, 'm:PhotogalleryCategory', $attribute, $attribute);
$c->setAttribute('label', $localeService->getTranslation($language, $ar->entity_properties_label_key));
$c->setAttribute('editableRegion', 'photogallery');
//.........这里部分代码省略.........
示例5: createChildComponents
function createChildComponents()
{
$entityTypeId = $this->_content['entityTypeId'];
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'title', 'title');
$this->addChild($c);
$this->_content['url'] = __Routing::makeUrl('showEntityDetail', array('entityTypeId' => $entityTypeId, 'document_id' => $this->_content['document_id']));
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', 'url', 'url');
$this->addChild($c);
$entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$it = org_glizy_objectFactory::createModelIterator('movio.modules.ontologybuilder.models.EntityProperties');
$it->load('entityPropertiesFromId', array('entityId' => $entityTypeId));
foreach ($it as $ar) {
$attribute = $entityTypeService->getAttributeIdByAr($ar);
switch ($ar->entity_properties_type) {
case 'attribute.image':
if (is_null($this->_content['__image']) && $this->_content[$attribute]) {
$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);
$this->_content['__image'] = $this->_content[$attribute];
}
break;
}
if (is_null($this->_content['__description']) && $ar->entity_properties_dublic_core == 'DC.Description' && $this->_content[$attribute]) {
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LongText', $this->_application, $this, 'glz:LongText', '__description', '__description');
$c->setAttribute('adm:htmlEditor', true);
$this->addChild($c);
$this->_content['__description'] = glz_strtrim(strip_tags($this->_content[$attribute]));
}
}
// controlla se esiste una lista media/immagini e ne prende la prima
if (is_null($this->_content['__image'])) {
foreach ($it as $ar) {
$attribute = $entityTypeService->getAttributeIdByAr($ar);
switch ($ar->entity_properties_type) {
case 'attribute.imagelist':
if (is_null($this->_content['__image']) && $this->_content[$attribute]) {
$objectVars = get_object_vars($this->_content[$attribute]);
$content = array_shift($objectVars);
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Image', $this->_application, $this, 'glz:Image', '__image', '__image');
$c->setAttribute('width', __Config::get('THUMB_SMALL_WIDTH'));
$c->setAttribute('height', __Config::get('THUMB_SMALL_HEIGHT'));
$c->setAttribute('crop', true);
$this->addChild($c);
$this->_content['__image'] = $content[0];
}
break;
}
}
}
// inserisce un'immagine di default
if (is_null($this->_content['__image'])) {
$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);
}
if (is_null($this->_content['__description'])) {
foreach ($it as $ar) {
$attribute = $entityTypeService->getAttributeIdByAr($ar);
if (is_null($ar->entity_properties_target_FK_entity_id) && preg_match('/text$/', $ar->entity_properties_type) && $this->_content[$attribute]) {
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LongText', $this->_application, $this, 'glz:LongText', '__description', '__description');
$c->setAttribute('adm:htmlEditor', true);
$this->addChild($c);
$this->_content['__description'] = glz_strtrim(strip_tags($this->_content[$attribute]));
}
}
}
}
示例6: createChildsFromModel
/**
* @param $className
*/
function createChildsFromModel($className)
{
// crea i figli
/** @var org_glizy_components_Component $newComponent */
$newComponent =& org_glizy_ObjectFactory::createComponent($className, $this->_application, $this, '', $this->getId());
for ($i = 0; $i < count($newComponent->childComponents); $i++) {
$newComponent->childComponents[$i]->remapAttributes($this->getId() . '-');
$this->addChild($newComponent->childComponents[$i]);
$newComponent->childComponents[$i]->_parent =& $this;
}
$this->initChilds();
// TODO
// problema da risolvere in modo più elengante
// quando si crea un componente figlio come in questo caso
// l'id del component nella mappa degli ID viene sovrascritto
// con il componente nuovo perché al memoneto della creazione gli viene passato lo stesso ID
$this->setAttribute('id', $this->getId());
}
示例7: __construct
function __construct(&$application, &$parent, $tagName = '', $id = '', $originalId = '')
{
parent::__construct($application, $parent, $tagName, $id, $originalId);
if (!__Request::get('entityTypeId')) {
return;
}
$entityTypeId = __Request::get('entityTypeId');
$entityModel = org_glizy_objectFactory::createModel('movio.modules.ontologybuilder.models.Entity');
$entityModel->load($entityTypeId);
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', '__type', '__type');
$c->setAttribute('label', 'Tipo');
$c->setAttribute('value', __Tp($entityModel->entity_name));
$c->setAttribute('disabled', true);
$this->addChild($c);
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Input', $entityTypeId, $entityTypeId);
$c->setAttribute('name', 'entityTypeId');
$c->setAttribute('value', $entityTypeId);
$this->addChild($c);
$entityId = __Request::get('entityId');
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Input', $entityId, $entityId);
$c->setAttribute('name', 'entityId');
$c->setAttribute('value', $entityId);
$this->addChild($c);
$id = '__isVisible';
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Checkbox', $this->_application, $this, 'glz:Checkbox', $id, $id);
$c->setAttribute('label', __Tp('Visible'));
$c->setAttribute('data', 'type=checkbox');
$this->addChild($c);
$id = 'title';
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $id, $id);
$c->setAttribute('label', __Tp('Title'));
$c->setAttribute('required', true);
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
$this->addChild($c);
$id = 'subtitle';
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $id, $id);
$c->setAttribute('label', __Tp('Subtitle'));
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
$this->addChild($c);
$id = 'url';
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $id, $id);
$c->setAttribute('label', __Tp('URL'));
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
$this->addChild($c);
$id = 'profile';
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $id, $id);
$c->setAttribute('label', __Tp('Profile'));
$c->setAttribute('data', 'type=selectfrom;multiple=true;model=org.glizycms.groupManager.models.UserGroup;field=usergroup_name');
$c->setAttribute('value', '');
$this->addChild($c);
$entityTypeService = $application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$it = org_glizy_objectFactory::createModelIterator('movio.modules.ontologybuilder.models.EntityProperties');
$it->load('entityPropertiesFromId', array('entityId' => $entityTypeId));
foreach ($it as $ar) {
$attribute = $entityTypeService->getAttributeIdByAr($ar);
switch ($ar->entity_properties_type) {
case 'attribute.text':
case 'attribute.externalimage':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $attribute, $attribute);
$c->setAttribute('label', __Tp($ar->entity_properties_label_key));
$c->setAttribute('required', $ar->entity_properties_required == 1);
$c->setAttribute('type', 'text');
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
$this->addChild($c);
break;
case 'attribute.int':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $attribute, $attribute);
$c->setAttribute('label', __Tp($ar->entity_properties_label_key));
$c->setAttribute('required', $ar->entity_properties_required == 1);
$c->setAttribute('type', 'number');
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
$this->addChild($c);
break;
case 'attribute.longtext':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $attribute, $attribute);
$c->setAttribute('label', __Tp($ar->entity_properties_label_key));
$c->setAttribute('required', $ar->entity_properties_required == 1);
$c->setAttribute('type', 'multiline');
$c->setAttribute('rows', '10');
$c->setAttribute('cols', '90');
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
$this->addChild($c);
break;
case 'attribute.descriptivetext':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $attribute, $attribute);
$c->setAttribute('label', __Tp($ar->entity_properties_label_key));
$c->setAttribute('required', $ar->entity_properties_required == 1);
$c->setAttribute('type', 'multiline');
$c->setAttribute('rows', '10');
$c->setAttribute('cols', '90');
$c->setAttribute('htmlEditor', true);
$c->setAttribute('data', 'type=tinymce');
$c->setAttribute('cssClass', __Config::get('glizy.formElement.admCssClass'));
$c->setAttribute('value', '');
//.........这里部分代码省略.........
示例8: createChildComponents
function createChildComponents()
{
$entityTypeId = $this->_content['entityTypeId'];
$entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService');
$skinAttributes = unserialize($entityTypeService->getEntityTypeAttribute($entityTypeId, 'entity_skin_attributes'));
if (!$skinAttributes) {
return;
}
$language = $this->_application->getLanguage();
$localeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.LocaleService');
foreach ($skinAttributes->properties as $i => $property) {
$skinAttributes->properties[$i]['label'] = $localeService->getTranslation($language, $property['label']);
}
foreach ($skinAttributes->body as $i => $body) {
$skinAttributes->body[$i]['label'] = $localeService->getTranslation($language, $body['label']);
}
$groupBoxRel =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Groupbox', $this->_application, $this, 'glz:Groupbox', 'relations');
$this->addChild($groupBoxRel);
$skinsName = array('Entity_relationImage.html', 'Entity_relationLink.html', 'Entity_relationImageLink.html');
$groupBox =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Groupbox', $this->_application, $this, 'glz:Groupbox', 'detail');
$groupBox->setAttribute('skin', 'Entity_entry.html');
$this->addChild($groupBox);
$this->_content['attributes'] = $skinAttributes;
$this->_content['relations'] = new StdClass();
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', 'attributes', 'attributes');
$groupBox->addChild($c);
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', 'relations', 'relations');
$groupBox->addChild($c);
if (isset($this->_content['subtitle']) && $this->_content['subtitle']) {
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.PageTitle', $this->_application, $this, 'glz:Text', 'subtitle', 'subtitle');
$c->setAttributes(array('tag' => 'h2', 'editableRegion' => 'pageTitle', 'value' => $this->_content['subtitle']));
$this->addChild($c);
}
// TODO usare EntityTypeService per ottenere le proprietà in cache
$it = org_glizy_objectFactory::createModelIterator('movio.modules.ontologybuilder.models.EntityProperties');
$it->load('entityPropertiesFromId', array('entityId' => $entityTypeId));
$jsonRelations = array();
foreach ($it as $ar) {
$attribute = $entityTypeService->getAttributeIdByAr($ar);
switch ($ar->entity_properties_type) {
case 'attribute.text':
case 'attribute.int':
case 'attribute.date':
case 'attribute.openlist':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.Text', $this->_application, $this, 'glz:Text', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.longtext':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LongText', $this->_application, $this, 'glz:LongText', $attribute, $attribute);
$c->setAttribute('forceP', true);
$c->setAttribute('parseInternalLinks', false);
$groupBox->addChild($c);
break;
case 'attribute.descriptivetext':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LongText', $this->_application, $this, 'glz:LongText', $attribute, $attribute);
$c->setAttribute('adm:htmlEditor', true);
$c->setAttribute('parseInternalLinks', false);
$groupBox->addChild($c);
break;
case 'attribute.externallink':
case 'attribute.internallink':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.LinkTo', $this->_application, $this, 'glz:LinkTo', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.externalimage':
$c =& org_glizy_ObjectFactory::createComponent('org.glizy.components.ImageExternal', $this->_application, $this, 'glz:ImageExternal', $attribute, $attribute);
$groupBox->addChild($c);
break;
case 'attribute.image':
$this->addMedia('images', $this->_content[$attribute]);
break;
case 'attribute.media':
$this->addMedia('medias', $this->_content[$attribute]);
break;
case 'attribute.imagelist':
if ($this->_content[$attribute]) {
foreach ($this->_content[$attribute]->attaches as $attach) {
$this->addMedia('imageList', $attach);
}
}
break;
case 'attribute.medialist':
if ($this->_content[$attribute]) {
foreach ($this->_content[$attribute]->attaches as $attach) {
$this->addMedia('mediaList', $attach);
}
}
break;
case 'attribute.photogallery':
if ($this->_content[$attribute . '-images']) {
foreach ($this->_content[$attribute . '-images'] as $category) {
$it = org_glizy_ObjectFactory::createModelIterator('org.glizycms.models.Media');
$it->where('media_category', '%' . $category . '%', 'LIKE')->orderBy('media_title');
foreach ($it as $ar) {
$media = array('id' => $ar->media_id, 'title' => $ar->media_title, 'fileName' => $ar->media_fileName);
$this->addMedia('photogallery', json_encode($media));
}
}
}
break;
//.........这里部分代码省略.........
示例9: addDefaultComponents
private function addDefaultComponents($menu)
{
$id = '__id';
$c = org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', $id, $id);
$this->addChild($c);
$c->init();
$id = '__indexFields';
$childs[$id] = org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', $id, $id);
$c =& $childs[$id];
$this->addChild($c);
$c->init();
$id = '__title';
$childs[$id] = org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $id, $id);
$c =& $childs[$id];
$c->setAttribute('label', __T('Title'));
$c->setAttribute('required', true);
$c->setAttribute('size', '90');
$c->setAttribute('cssClass', $this->getAttribute('adm:cssClass'));
$this->addChild($c);
$c->init();
$id = '__url';
if ($this->getAttribute('editUrl')) {
$childs[$id] = org_glizy_ObjectFactory::createComponent('org.glizy.components.Input', $this->_application, $this, 'glz:Input', $id, $id);
} else {
$childs[$id] = org_glizy_ObjectFactory::createComponent('org.glizy.components.Hidden', $this->_application, $this, 'glz:Hidden', $id, $id);
}
$c =& $childs[$id];
$c->setAttribute('label', __T('URL'));
$c->setAttribute('required', false);
$c->setAttribute('size', '90');
$c->setAttribute('cssClass', $this->getAttribute('adm:cssClass'));
$this->addChild($c);
$c->init();
}
示例10: onProcessStart
/**
* Listeners
*/
public function onProcessStart($evt)
{
$application = org_glizy_ObjectValues::get('org.glizy', 'application');
$rootComponent = $application->getRootComponent();
$c = org_glizy_ObjectFactory::createComponent('org.glizy.debug.views.components.DebugBar', $application, $rootComponent, 'debugBar', 'debugBar');
$c->init();
$rootComponent->addChild($c);
$this->debugBar['time']->addMeasure('Booting', $this->startTime, microtime(true));
$this->debugBar['time']->startMeasure('application.process', 'Process');
}