public function newLink($id, $index) { $switchLink = new MarkupContainer($id); $switchLink->add(new AttributeModifier('href', new BasicModel(sprintf('javascript:;', $this->indexes[$index])))); $switchLink->add(new AttributeModifier('onClick', new BasicModel(sprintf('$(\'#\'+currentTab).hide(); $(\'#%s\').show();currentTab = \'%s\'; $(\'li.selected\', $(this).parents(\'ul\').first()).removeClass(\'selected\'); $(this).parents(\'li\').first().addClass(\'selected\');', $this->indexes[$index], $this->indexes[$index])))); return $switchLink; }
public function resolve(MarkupContainer $container, ComponentTag &$tag) { if ($tag instanceof PiconTag && ($tag->getName() == 'picon:extend' || $tag->getName() == 'picon:child')) { return new TransparentMarkupContainer($tag->getName() . $container->getPage()->getAutoIndex()); } return null; }
public function resolve(MarkupContainer $container, ComponentTag &$tag) { if ($tag instanceof PiconTag && $tag->getName() == 'picon:panel') { $id = 'panel' . $container->getPage()->getAutoIndex(); $tag->setComponentTagId($id); return new TransparentMarkupContainer($id); } return null; }
public function __construct($id, Pageable $pageable) { parent::__construct($id); $this->pageable = $pageable; $pageLinks = new RepeatingView('page'); $this->add($pageLinks); for ($i = 0; $i < $this->pageable->getPageCount(); $i++) { $linkBlock = new MarkupContainer($pageLinks->getNextChildId()); $link = new NavigationLink('pageLink', $pageable, $i + 1); $linkBlock->add($link); $link->add(new Label('pageNumber', new BasicModel($i + 1))); $pageLinks->add($linkBlock); } }
public function beforePageRender() { parent::beforePageRender(); if (!$this->isInitialized()) { $this->internalInitialize(); } }
public function getMarkup(MarkupContainer $container, Component $child) { $markup = $container->getMarkup(); if ($markup == null) { throw new \MarkupNotFoundException(sprintf("Markup for %s could not be found.", $child->getId())); } if ($child == null) { return $markup; } $m = MarkupUtils::findComponentTag($markup, $child->getId(), $container); if ($m == null) { foreach ($container->getChildren() as $ch) { if ($ch != $child && $ch instanceof MarkupContainer && $ch instanceof ComponentResolver) { $m = $ch->getMarkupForChild($child); if ($m != null) { return $m; } } } } return $m; }
public function resolve(MarkupContainer $container, ComponentTag &$tag) { if ($tag instanceof PiconTag && $tag->getName() == 'head') { return new HeaderContainer(self::HEADER_ID); } else { if ($tag instanceof PiconTag && $tag->isHeaderTag()) { if ($container instanceof WebPage) { //@todo this block is UNTESTED $header = new HeaderContainer('header' . $container->getPage()->getAutoIndex()); $inner = new TransparentMarkupContainer('picon_header'); $inner->setRenderBodyOnly(true); $header->add($inner); return $header; } elseif ($container instanceof HeaderContainer) { $header = new TransparentMarkupContainer('picon_header'); $header->setRenderBodyOnly(true); return $header; } throw new \RuntimeException('<picon:head> tag was in an invalid location. It must be outside of <picon:extend> and <picon:panel>'); } } return null; }
public function getMarkup(MarkupContainer $container, Component $child) { $markup = $container->loadAssociatedMarkup(); $root = $this->getRootTag($markup); return MarkupUtils::findComponentTag($root, $child->getId(), $container); }
public function __construct($id, Model $model, $index) { parent::__construct($id, $model); $this->index = $index; }
public function __construct($id, MarkupElement $markup) { parent::__construct($id); $this->setMarkup($markup); $this->setRenderBodyOnly(true); }
public function beforePageRender() { parent::beforePageRender(); $this->populate(); }
public function beforeComponentRender() { parent::beforeComponentRender(); $multipart = false; $callback = function (&$component) use(&$multipart) { if ($component->isMultiPart()) { $multipart = true; } return Component::VISITOR_CONTINUE_TRAVERSAL; }; $this->visitChildren(FormComponent::getIdentifier(), $callback); if ($multipart) { $this->add(new AttributeModifier('enctype', new BasicModel('multipart/form-data'))); } }
protected function onComponentTag(ComponentTag $tag) { parent::onComponentTag($tag); $tag->setTagType(new XmlTagType(XmlTagType::OPEN)); }