public function __invoke($element, $content, $attr = null) { $factory = new HtmlElements(new FactoryElement()); $factory->setContentTag($element); $factory->setHtmlContent($content); if (is_array($attr) && !empty($attr)) { foreach ($attr as $name => $value) { $factory->setTagAttributtes($name, $value, 0); } } return $factory->display(); }
public function __invoke($content, $groupIdent, $template, $contentstyles, array $specified = null) { $this->setTemplate($template); $row = $this->getTemplateProperty('row', 'element'); $factory = new HtmlElements(new FactoryElement()); $factory->setEncloseTag($row); $factory->setAttributes(false, $this->getTemplateProperty('row', 'attr')); $grid = $this->getTemplateProperty('grid', 'element'); $attr = $this->getTemplateProperty('grid', 'attr'); $i = 0; foreach ($content as $row) { if ($groupIdent === $row->webContentgroup) { $factory->setContentTag($grid); $factory->setTagAttributtes(false, $attr, $i); if (null === $this->inner) { $factory->setHtmlContent($this->view->contribution($row->webContent, $contentstyles)); } else { $inner = $this->getTemplateProperty('inner', 'element'); $innerAttr = $this->getTemplateProperty('inner', 'attr'); $factory->setHtmlContent($this->view->contentelement($inner, $this->view->contribution($row->webContent, $contentstyles), $innerAttr)); } $i++; } } $this->unsetProperties(); return $factory->display(); }
/** * * @param array $content * @param unknown $medias * @param array $template * @return Ambigous <string, multitype:> */ public function __invoke($entry, $template, $media) { $this->assignTemplate($entry, $template); $html = ''; $brand = ''; $factory = false; $row = $this->getTemplateProperty('row', 'element'); $grid = $this->getTemplateProperty('grid', 'element'); $list = $this->getTemplateProperty('list', 'element'); if ($list) { $factory = new HtmlList(new FactoryList()); $factory->setListTag($list); $attr = $this->getTemplateProperty('list', 'attr'); if ($attr) { $factory->setAttributes(false, $attr); } $i = 0; $brand = $this->getTemplateProperty('listelements', '0'); $factory->setContentTag($brand['element']); if (isset($entry['modulDisplay']) && strlen($entry['modulDisplay']) > 0) { $label = $entry['modulDisplay']; if ($this->brand) { $label = str_replace('%s1', $label, $this->brand); } if (isset($entry['modulLink'])) { if ($this->brand) { $label = str_replace('#', $entry['modulLink'], $label); } } $factory->setHtmlContent($label); $factory->setTagAttributtes(false, $brand['attr'], $i); $i++; } else { $factory->setHtmlContent(''); $factory->setTagAttributtes(false, $brand['attr'], $i); $i++; } $mLabel = $this->getTemplateProperty('listelements', '1'); $factory->setContentTag($mLabel['element']); if ($this->mobilemenue) { $mobilemenue = str_replace('%s1', 'Menu', $this->mobilemenue); } else { $mobilemenue = ''; } $factory->setHtmlContent($this->mobilemenue); $factory->setTagAttributtes(false, $mLabel['attr'], $i); $brand = $factory->display(); $factory = false; } $container = new \Zend\Navigation\Navigation($entry['modulContent']); $topbar = $this->view->navigationcontentinum($container)->setAcl($this->view->acl)->setRole($this->view->role)->setUlClass($this->direction); if ($grid) { $factory = new HtmlElements(new FactoryElement()); $factory->setContentTag($grid); $attr = $this->getTemplateProperty('grid', 'attr'); $factory->setTagAttributtes(false, $attr, 0); $factory->setHtmlContent($topbar); $topbar = $factory->display(); $factory = false; } if ($row) { $factory = new HtmlElements(new FactoryElement()); $factory->setContentTag($row); $attr = $this->getTemplateProperty('row', 'attr'); $factory->setTagAttributtes(false, $attr, 0); $factory->setHtmlContent($brand . $topbar); $html = $factory->display(); $factory = false; } $this->unsetProperties(); return $html; }
public function __invoke($content, $groupIdent, $template, $contentstyles, array $specified = null) { $this->setTemplate($template); if (null !== $specified) { $this->setSpecified($specified); } $str = ''; $i = 0; $filter = new Prepare(); $grid = $this->getTemplateProperty('body', 'grid', 'element'); foreach ($content as $entry) { if ($groupIdent == $entry->webContentgroup) { $attr = $this->getTemplateProperty('body', 'grid', 'attr'); $panelId = $filter->filter($entry->webContent->title); if (0 === $i) { $this->headercontent[] = '<a href="#' . $panelId . '" role="tab" tabindex="0" aria-selected="true" controls="' . $panelId . '">' . $entry->webContent->title . '</a>'; } else { $this->headercontent[] = '<a href="#' . $panelId . '" role="tab" tabindex="0" aria-selected="false" controls="' . $panelId . '">' . $entry->webContent->title . '</a>'; } $str .= '<' . $grid; if (0 === $i) { $attr['class'] .= ' ' . $this->active; $attr['aria-hidden'] = 'false'; } else { $attr['aria-hidden'] = 'true'; } $attr['id'] = $panelId; $str .= HtmlAttribute::attributeArray($attr) . '>'; $str .= $this->view->contribution($entry->webContent, $contentstyles); $str .= '</' . $grid . '>'; $i++; } } $attr = false; $factory = new HtmlElements(new FactoryElement()); $row = $this->getTemplateProperty('body', 'row', 'element'); if ($row) { $factory->setContentTag($row); $attr = $this->getTemplateProperty('body', 'row', 'attr'); if (false !== $attr) { $factory->setTagAttributtes(false, $attr, 0); $attr = false; } } $factory->setHtmlContent($str); $str = ''; $tabBody = $factory->display(); $factory = new HtmlElements(new FactoryElement()); $row = $this->getTemplateProperty('header', 'row', 'element'); if ($row) { $factory->setContentTag($row); $attr = $this->getTemplateProperty('header', 'row', 'attr'); if (false !== $attr) { $factory->setTagAttributtes(false, $attr, 0); $attr = false; } } $grid = $this->getTemplateProperty('header', 'grid', 'element'); $i = 0; foreach ($this->headercontent as $headerentry) { $attr = $this->getTemplateProperty('header', 'grid', 'attr'); $str .= '<' . $grid; if (0 === $i) { $attr['class'] .= ' ' . $this->active; } $str .= HtmlAttribute::attributeArray($attr); $str .= '>'; $str .= $headerentry; $str .= '</' . $grid . '>'; $i++; } $factory->setHtmlContent($str); $tabHeader = $factory->display(); return $tabHeader . $tabBody; }
/** * * @param array $content * @param array $template * @param unknown $medias * @param unknown $widgets * @param array $specified * @return Ambigous <string, multitype:> */ public function __invoke($content, $groupIdent, $template, $contentstyles, array $specified = null) { $this->setTemplate($template); /* $html = ''; foreach ($content as $row) { if ($groupIdent === $row->webContentgroup) { $html .= $row->webContentgroup; $html .= $row->webContent->content; } } return $html;*/ $number = $this->grids / $this->countArrayById($content, $groupIdent); $i = 0; $factory = new HtmlElements(new FactoryElement()); $factory->setEncloseTag($this->row); $factory->setAttributes(false, $this->attribute); foreach ($content as $row) { if ($groupIdent === $row->webContentgroup) { if (isset($row->groupElement) && strlen($row->groupElement) > 0) { $element = $row->groupElement; if (isset($row->groupElementAttribute) && strlen($row->groupElementAttribute) > 0) { $this->auto = true; $attribute = $row->groupElementAttribute; } else { $attribute = $this->getReplaceStdAttribute($i, $number); } } else { if (isset($this->grid[$i])) { $element = $this->grid[$i]; } else { $element = $this->grid[0]; } $attribute = $this->getReplaceStdAttribute($i, $number); } $factory->setContentTag($element); $factory->setTagAttributtes(false, $attribute, $i); $contribution = $this->view->contribution($row->webContent, $contentstyles); if (!empty($this->inner)) { $contribution = $this->deployRow($this->inner, $contribution); } $factory->setHtmlContent($contribution); $i++; } } $this->unsetProperties(); return $factory->display(); }