public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['cssClass'] = $node->getAttribute('cssClass'); return org_glizy_helpers_Html::renderTag('glz:Panel', $attributes); }
public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['data'] = ''; $attributes['noChild'] = 'true'; return org_glizy_helpers_Html::renderTag('glz:Checkbox', $attributes); }
public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['required'] = $node->getAttribute('required'); $attributes['xmlns:cms'] = "org.glizycms.views.components.*"; return org_glizy_helpers_Html::renderTag('cms:SelectPage', $attributes); }
public static function translateForMode_edit($node) { $min = $node->hasAttribute('adm:min') ? $node->getAttribute('adm:min') : '0'; $max = $node->hasAttribute('adm:max') ? $node->getAttribute('adm:max') : '100'; $collapsable = $node->hasAttribute('adm:collapsable') && $node->getAttribute('adm:collapsable') == 'true' ? 'true' : 'false'; $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['data'] = 'type=repeat;repeatMin=' . $min . ';repeatMax=' . $max . ';collapsable=' . $collapsable; if ($node->hasAttribute('adm:data')) { $attributes['data'] .= ';' . $node->getAttribute('adm:data'); } return org_glizy_helpers_Html::renderTag('glz:Fieldset', $attributes); }
public static function getResizedImageById($id, $direct = false, $width, $height, $crop = false, $cssClass = '', $style = '', $onclick = '') { $media =& org_glizycms_mediaArchive_MediaManager::getMediaById($id); if (is_null($media)) { return ''; } if ($direct) { $thumb = $media->getThumbnail($width, $height, $crop); } $attributes = array(); $attributes['alt'] = $media->title; $attributes['title'] = $media->title; $attributes['class'] = $cssClass; $attributes['style'] = $style; $attributes['onclick'] = $onclick; $attributes['src'] = $direct ? $thumb['fileName'] : org_glizycms_Glizycms::getMediaArchiveBridge()->getImageByIdAndResize($id, $width, $height, $crop); return org_glizy_helpers_Html::renderTag('img', $attributes); }
function run(&$parent, $params) { $application = org_glizy_ObjectValues::get('org.glizy', 'application'); $languageId = $application->getLanguageId(); $language = $application->getLanguage(); $it = org_glizy_objectFactory::createModelIterator('movio.search.models.Content'); $it->load('getVisibleEntities', array(':words' => $params, ':language' => $languageId)); foreach ($it as $ar) { //$ar->dump(); $result = $parent->getResultStructure(); $result['title'] = $ar->title; $result['description'] = $ar->description; if ($ar->keyInDataExists('url') && $ar->url) { $url = org_glizy_helpers_Html::renderTag('a', array('href' => $language . '/' . $ar->url), true, $ar->title); } else { $url = __Link::makeLink('link', array('pageId' => $ar->pageId, 'title' => $ar->title)); } $result['__url__'] = $url; $parent->addResult($result); } }
function run(&$parent, $params) { $application = org_glizy_ObjectValues::get('org.glizy', 'application'); $languageId = $application->getLanguageId(); $language = $application->getLanguage(); $it = org_glizy_objectFactory::createModelIterator('movio.search.models.Entity'); $it->load('getVisibleEntities', array(':words' => $params, ':language' => $languageId)); foreach ($it as $ar) { //$ar->dump(); $application = org_glizy_ObjectValues::get('org.glizy', 'application'); $entityTypeService = $application->retrieveProxy('movio.modules.ontologybuilder.service.EntityTypeService'); $descriptionAttribute = $entityTypeService->getDescriptionAttribute($ar->entityTypeId); $result = $parent->getResultStructure(); $result['title'] = $ar->title; $result['description'] = $descriptionAttribute && $ar->keyInDataExists($descriptionAttribute) ? $ar->{$descriptionAttribute} : ''; if ($ar->keyInDataExists('url') && $ar->url) { $url = org_glizy_helpers_Html::renderTag('a', array('href' => $language . '/' . $ar->url), true, $ar->title); } else { $url = __Link::makeLink('showEntityDetail', $ar->getValuesAsArray()); } $result['__url__'] = $url; $parent->addResult($result); } }
function _render_html(&$menu, &$output) { $attributes = array(); $attributes['class'] = $this->getAttribute('cssClass'); if (empty($output)) { if (!$this->getAttribute('omitId')) { $attributes['id'] = $this->getId(); } $attributes['title'] = $this->getAttributeString('title'); $output .= org_glizy_helpers_Html::renderTag('ul', $attributes, false); } else { $attributes['class'] = $this->getAttribute('nestedCssClass') ? $attributes['class'] : ''; $output .= org_glizy_helpers_Html::renderTag('ul', $attributes, false); } for ($i = 0; $i < count($menu); $i++) { if (is_array($menu[$i]['node'])) { $this->_render_html($menu[$i]['node'], $output); $output .= '</li>'; } else { $cssClass = $menu[$i]['cssClass']; $selected = $menu[$i]['selected']; if ($cssClass) { if (strpos($selected, 'class="') !== false) { $selected = str_replace('class="', 'class="' . $cssClass . ' ', $selected); $cssClass = ''; } else { $cssClass = 'class="' . $cssClass . '"'; } } $attributes = trim($cssClass . ' ' . $selected); $output .= '<li' . ($attributes ? ' ' . $attributes : '') . '>' . $menu[$i]['node'] . ($i + 1 < count($menu) && is_array($menu[$i + 1]['node']) ? '' : '</li>'); } } $output .= '</ul>'; }
public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['data'] = ''; if (count($node->attributes)) { foreach ($node->attributes as $index => $attr) { if ($attr->prefix == "adm") { $attributes[$attr->name] = $attr->value; } } } if (!isset($attributes['cssClass'])) { $attributes['cssClass'] = '{config:glizy.formElement.admCssClass}'; } return org_glizy_helpers_Html::renderTag('glz:Input', $attributes); }
public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); if (count($node->attributes)) { foreach ($node->attributes as $index => $attr) { if ($attr->prefix == "adm") { $attributes[$attr->name] = $attr->value; } } } return org_glizy_helpers_Html::renderTag('glz:Input', $attributes); }
public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['noChild'] = 'true'; $attributes['data'] = ''; if ($node->hasAttribute('adm:data')) { $attributes['data'] .= ';' . $node->getAttribute('adm:data'); } return org_glizy_helpers_Html::renderTag('glz:Input', $attributes); }
public static function translateForMode_edit($node) { $mediaType = $node->getAttribute('adm:mediaType'); $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['data'] = $node->getAttribute('data') . ';type=mediapicker;mediatype=' . $mediaType . ';preview=true'; if (count($node->attributes)) { foreach ($node->attributes as $index => $attr) { if ($attr->prefix == "adm") { $attributes[$attr->name] = $attr->value; } } } return org_glizy_helpers_Html::renderTag('glz:Input', $attributes); }
public static function translateForMode_edit($node) { if ($node->hasAttribute('adm:showControl') && $node->getAttribute('adm:showControl') == 'true') { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['size'] = 10; return org_glizy_helpers_Html::renderTag('glz:Input', $attributes); } }
function _render_html() { if (!empty($this->mediaUrl)) { $attributes = $this->_content; if (is_string($this->mediaUrl) && (!is_null($this->getAttribute('width')) || !is_null($this->getAttribute('height')))) { if (strpos($this->mediaUrl, 'http://') === 0) { $extension = pathinfo(parse_url($this->mediaUrl, PHP_URL_PATH), PATHINFO_EXTENSION); $cacheFileName = 'external_' . md5($this->mediaUrl) . '.' . $extension; $cacheFilePath = __Paths::get('CACHE') . $cacheFileName; // scarica il file e lo mette in cache if (!file_exists($cacheFilePath)) { @file_put_contents($cacheFilePath, @file_get_contents($this->mediaUrl)); } $params = array('media_id' => 0, 'media_fileName' => $cacheFilePath); $this->media = __ObjectFactory::createObject('org.glizycms.mediaArchive.media.Image', $params); } $this->media->allowDownload = true; $thumbnail = $this->media->getResizeImage($this->getAttribute('width'), $this->getAttribute('height'), $this->getAttribute('crop'), $this->getAttribute('cropOffset'), false, false); $attributes['src'] = $thumbnail['fileName']; $attributes['width'] = $thumbnail['width']; $attributes['height'] = $thumbnail['height']; $this->_content['src'] = $thumbnail['fileName']; $this->_content['width'] = $thumbnail['width']; $this->_content['height'] = $thumbnail['height']; } unset($attributes['mediaUrl']); unset($attributes['zoom']); unset($attributes['size']); unset($attributes['mediaType']); $this->_content['__html__'] = '<img ' . $this->_renderAttributes($attributes) . '/>'; if ($this->getAttribute('zoom') || $useZoom) { $this->_application->addLightboxJsCode(); $attributes = array(); $attributes['title'] = $this->_content['title']; $thumbnail = $this->media->getResizeImage(__Config::get('IMG_WIDTH_ZOOM'), __Config::get('IMG_HEIGHT_ZOOM')); $attributes['href'] = $thumbnail['fileName']; $attributes['rel'] = 'milkbox' . ($this->getAttribute('group') != '' ? '[' . $this->getAttribute('group') . ']' : ''); $attributes['class'] = $zoomCssClass; $this->_content['__html__'] = org_glizy_helpers_Html::renderTag('a', $attributes, true, $this->_content['__html__']); } } else { $this->_content['__html__'] = ''; } }
public static function translateForMode_edit($node) { $attributes = array(); $attributes['id'] = $node->getAttribute('id'); $attributes['label'] = $node->getAttribute('label'); $attributes['data'] = 'type=imageHotspot'; return org_glizy_helpers_Html::renderTag('glz:Input', $attributes); }