protected function renderVisibilityButton($key, $row) { $output = ''; if ($this->canView && $this->canEdit) { $output .= __Link::makeLinkWithIcon('actionsMVCToggleVisibility', __Config::get($row->isVisible() ? 'glizy.datagrid.action.showCssClass' : 'glizy.datagrid.action.hideCssClass'), array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'id' => $key, 'model' => $row->getClassName(false), 'action' => 'togglevisibility')); } return $output; }
protected function renderDeleteButton($key, $row) { $output = ''; if ($this->canView && $this->canDelete) { $output .= __Link::makeLinkWithIcon('actionsMVC', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'action' => 'deleteDictionary'), __T('GLZ_RECORD_MSG_DELETE'), array('dictionaryId' => $key)); } return $output; }
function renderCell($key, $value, $row) { $entityId = $key; $entityTypeId = str_replace('entity', '', $row->getType()); $output = __Link::makeLinkWithIcon('actionEntities', 'btn-icon icon-pencil', array('title' => __T('GLZ_RECORD_EDIT'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'edit')); $output .= __Link::makeLinkWithIcon('actionEntities', 'icon-trash btn-icon', array('title' => __T('GLZ_RECORD_DELETE'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'delete'), __T('GLZ_RECORD_MSG_DELETE')); $output .= __Link::makeLinkWithIcon('actionEntities', $row->isVisible() ? 'icon-eye-open btn-icon' : 'icon-eye-close btn-icon', array('title' => $row->isVisible() ? __T('Hide') : __T('Show'), 'entityTypeId' => $entityTypeId, 'entityId' => $entityId, 'action' => 'togglevisibility')); return $output; }
function renderCell($ar) { $localeService = $this->application->retrieveProxy('movio.modules.ontologybuilder.service.LocaleService'); $language = $this->application->getEditingLanguage(); $ar->entity_name = $localeService->getTranslation($language, $ar->entity_name); // TODO controllo acl $ar->__url__ = __Link::makeLinkWithIcon('actionsMVC', 'icon-pencil icon-white', array('action' => 'edit', 'id' => $ar->getId(), 'title' => __T('GLZ_RECORD_EDIT'))); $ar->__urlDelete__ = __Link::makeLinkWithIcon('actionsMVC', 'icon-remove icon-white', array('action' => 'delete', 'id' => $ar->getId(), 'title' => __T('GLZ_RECORD_EDIT')), __T('GLZ_RECORD_MSG_DELETE')); }
public function getGraph($entityTypeId, &$visited, &$edges, $firstNode = false) { if ($visited[$entityTypeId]) { return ''; } else { $entityTypeService = $this->_application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService'); $entityProperties = $entityTypeService->getEntityTypeProperties($entityTypeId); $graph = ''; $color = __Config::get('movio.graph.shapeColor'); $entityTypeName = $entityTypeService->getEntityTypeName($entityTypeId); if ($this->getAttribute('generateLinks')) { $entityResolver = org_glizy_objectFactory::createObject('movio.modules.ontologybuilder.EntityResolver'); $ar = $entityResolver->getMenuVisibleEntity($entityTypeId); if ($ar) { $url = 'URL="' . $this->makeUrl($ar->id, $ar->title) . '"'; } } // se è il nodo da cui inizia la ricerca ricorsiva if ($firstNode or empty($url)) { $s = $url ? $url . ', ' : ''; $graph .= '"' . $this->escape($entityTypeName) . '" [' . $s . 'label="<span>' . $this->escape($entityTypeName . ' ' . __Link::makeLinkWithIcon('actionsMVC', 'icon-pencil icon-white', array('action' => 'edit', 'id' => $entityTypeId, 'title' => __T('GLZ_RECORD_EDIT'))) . '<a href="' . __Link::makeURL('actionsMVC', array('action' => 'delete', 'id' => $entityTypeId)) . '" onclick="if (!confirm('' . __T('GLZ_RECORD_MSG_DELETE') . '')){return false}"><i class="icon-remove icon-white"></i></a>') . ' </span>"];' . PHP_EOL; } else { if ($url) { $graph .= '"' . $this->escape($entityTypeName) . '" [' . $url . '];' . PHP_EOL; } } $visited[$entityTypeId] = true; foreach ((array) $entityProperties as $entityProperty) { if ($entityProperty['entity_properties_target_FK_entity_id']) { $toEntityTypeId = $entityProperty['entity_properties_target_FK_entity_id']; $toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId); $label = __Tp('rel:' . $entityProperty['entity_properties_type']); if (!$edges[$entityTypeName][$toEntityTypeName]) { $edges[$entityTypeName][$toEntityTypeName] = true; $graph .= '"' . $this->escape($entityTypeName) . '" -> "' . $this->escape($toEntityTypeName) . '" [label="' . $this->escape($label) . '"];' . PHP_EOL; } $graph .= $this->getGraph($toEntityTypeId, $visited, $edges); } } $referenceRelations = $entityTypeService->getEntityTypeReferenceRelations($entityTypeId); foreach ((array) $referenceRelations as $referenceRelation) { if ($referenceRelation['entity_properties_target_FK_entity_id']) { $toEntityTypeId = $referenceRelation['entity_properties_FK_entity_id']; $toEntityTypeName = $entityTypeService->getEntityTypeName($toEntityTypeId); $label = __Tp('rel:' . $referenceRelation['entity_properties_type']); if (!$edges[$toEntityTypeName][$entityTypeName]) { $edges[$toEntityTypeName][$entityTypeName] = true; $graph .= '"' . $this->escape($toEntityTypeName) . '" -> "' . $this->escape($entityTypeName) . '" [label="' . $this->escape($label) . '"];' . PHP_EOL; } $graph .= $this->getGraph($toEntityTypeId, $visited, $edges); } } $visited[$entityTypeId] = true; return $graph; } }