/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $result = ''; if (!isset($parser->types['WikiLingo\\Expression\\BlockType\\Header'])) { $rendered = parent::render($plugin, $result, $renderer, $parser); return $rendered; } /** * @var WikiLingo\Expression\BlockType\Header[] */ $headers = $parser->types['WikiLingo\\Expression\\BlockType\\Header']; $orderedString = $plugin->parameter('ordered'); $ordered = $orderedString == "true"; /** * @var WikiLingo\Expression\BlockType\ListContainer */ $container = null; foreach ($headers as &$header) { $header->pointer = true; $block = $header->block; if ($container === null) { $container = new BlockType\ListContainer($block, $ordered); } else { $container->add(new BlockType\ListItem($container, $block)); } } $result = $container->render($renderer, $parser); foreach ($headers as &$header) { $header->pointer = false; } $rendered = parent::render($plugin, $result, $renderer, $parser); return $rendered; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { if (!$parser->wysiwyg) { $body = $parser->events->triggerTranslate($body, 'WikiLingo\\Plugin\\T'); } return parent::render($plugin, $body, $renderer, $parser); }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $header = $renderer->helper('h3'); $header->staticChildren[] = $plugin->parameter('title'); $accordion = parent::render($plugin, $body, $renderer, $parser); return $header->render() . $accordion; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body = '', &$renderer, &$parser) { $plugin->allowLineAfter = false; $id = $plugin->id(); $parser->scripts->addScript(<<<JS \$(function() { \tvar tabs = \$('#{$id}'); \ttabs.tabs(); }); JS ); if (!empty($plugin->privateAttributes['titles'])) { $ul = $renderer->helper('ul'); foreach ($plugin->privateAttributes['titles'] as $tabId => $title) { $a = $renderer->helper('a'); $a->attributes['href'] = '#' . $tabId; $a->staticChildren[] = $title; $li = $renderer->helper('li'); $li->children[] = $a; $ul->children[] = $li; } $body = $ul->render() . $body; } $tabs = parent::render($plugin, $body, $renderer, $parser); return $tabs; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $plugin->attributes['src'] = $plugin->parameter('location'); $plugin->attributes['title'] = $plugin->parameter('title'); $picture = parent::render($plugin, $body, $renderer, $parser); return $picture; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $id = $plugin->id(); $seconds = $plugin->parameter('seconds'); $slideAnimation = ''; $i = 0; if (!$parser->wysiwyg) { $children = $plugin->children('Plugin'); $childrenCount = count($children); foreach ($children as $child) { switch ($child->type) { case 'Slider': $sliderId = $child->id(); $thisSlideSeconds = $seconds * ($childrenCount - $i - 1); $i++; $slideAnimation .= <<<CSS CSS; break; } } $totalSlideSeconds = $i * $seconds; $parser->scripts->addCss(<<<CSS CSS ); } $sliders = parent::render($plugin, $body, $renderer, $parser); return $sliders; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { if (!isset($plugin->parent->privateAttributes['titles'])) { $plugin->parent->privateAttributes['titles'] = array(); } $plugin->parent->privateAttributes['titles'][$plugin->id()] = $plugin->parameter('title'); return parent::render($plugin, $body, $renderer, $parser); }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { if ($plugin->parsed->expressionPermissible || $parser->wysiwyg) { $result = parent::render($plugin, $body, $renderer, $parser); return $result; } else { return ''; } }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { if ($parser->wysiwyg) { return parent::render($plugin, $body, $renderer, $parser); } if ($plugin->iterations > 0) { return $body; } else { return ''; } }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { if (!isset($plugin->parent->privateAttributes['titles'])) { $plugin->parent->privateAttributes['titles'] = array(); } $parser->scripts->addScript(<<<JS \$(".section:first").addClass("active"); JS ); $id = $plugin->id(); //$plugin->attributes['data-anchor'] = $id; $plugin->parent->privateAttributes['titles'][$id] = $plugin->parameter('title'); return parent::render($plugin, $body, $renderer, $parser); }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body = '', &$renderer, &$parser) { $id = $plugin->id(); $parser->scripts->addScript(<<<JS \$(function() { \t \$( '#{$id}' ).accordion({ \t header: 'h3' \t }); }); JS ); $accordions = parent::render($plugin, $body, $renderer, $parser); return $accordions; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $plugin->attributes['title'] = $plugin->parameter('title'); $allow = $plugin->parameter('allow'); if ($parser->wysiwyg && empty($allow)) { $this->htmlTagType = 'img'; $plugin->attributes['src'] = 'img/emblem-multimedia.png'; $flash = parent::render($plugin, $body, $renderer, $parser); $this->htmlTagType = 'embed'; } else { $plugin->attributes['src'] = $plugin->parameter('movie'); $flash = parent::render($plugin, $body, $renderer, $parser); } return $flash; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body = '', &$renderer, &$parser) { $plugin->allowLineAfter = false; $id = $plugin->id(); $anchors = array(); if (!$parser->wysiwyg) { if (!empty($plugin->privateAttributes['titles'])) { //menu $ul = Type::Helper($renderer->helper('ul')); $ul->attributes['id'] = $id . '-menu'; $i = 1; //anchors for sections foreach ($plugin->privateAttributes['titles'] as $sectionId => $title) { $link = Type::Helper($renderer->helper('span')); $link->attributes['href'] = $sectionId; $link->attributes['onclick'] = <<<JS \$.fn.fullpage.moveTo({$i}); return false; JS; $i++; //$anchors[] = $a->attributes['data-index'] = $i++; //$a->attributes['id'] = $sectionId . '-anchor'; $link->staticChildren[] = $title; $li = Type::Helper($renderer->helper('li')); $li->children[] = $link; $ul->children[] = $li; } $body .= $ul->render(); $anchorsJson = json_encode($anchors); Type::Scripts($parser->scripts)->addScriptLocation('~/bower_components/fullPage.js/jquery.fullPage.js')->addCssLocation('~/bower_components/fullPage.js/jquery.fullPage.css')->addScript(<<<JS \$(function() { \$.fn.fullpage({ anchors: {$anchorsJson}, easing: 'easeInOutQuad', scrollSpeed: 1100, menu: '#{$id}-menu' }); }); JS )->addCss(<<<CSS #{$id}-menu { height: 40px; left: 0; margin: 0; padding: 0; position: fixed; top: 0; width: 100%; list-style: none outside none; } #{$id}-menu li { background-color: rgba(255, 255, 255, 0.5); color: #000000; border-radius: 10px; display: inline-block; margin: 10px; } #{$id}-menu li.active { background-color: rgba(0, 0, 0, 0.5); color: #FFFFFF; } #{$id}-menu li span { display: block; padding: 9px 18px; text-decoration: none; color: inherit; cursor: pointer; } CSS ); } } $tabs = parent::render($plugin, $body, $renderer, $parser); return $tabs; }
/** * */ public function variables() { return $this->class->variables($this); }
public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $plugin->renderedChildren = "This is a custom injected plugin"; return parent::render($plugin, $body, $renderer, $parser); }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { if (!$parser->wysiwyg) { $plugin->attributes['data-active'] = 'true'; $foreColor = $plugin->parameter("fore-color"); $accentColor = $plugin->parameter("accent-color"); $backgroundColor = $plugin->parameter("background-color"); $backgroundColorHighlighted = $plugin->parameter("background-color-highlighted"); $parser->scripts->addCss(<<<CSS /* Menu Start */ .Menu[data-active] { \tbackground: {$backgroundColor}; /* Old browsers */ \tcolor: {$foreColor}; \tbox-shadow: inset {$backgroundColor} 1px 1px 0, inset {$backgroundColor} -1px -1px 0; \t-moz-box-shadow: inset {$backgroundColor} 1px 1px 0, inset {$backgroundColor} -1px -1px 0; \tposition: relative; } .Menu[data-active] ul, .Menu[data-active] li { \tlist-style:none; \tpadding:0; \tmargin:0; \tdisplay:inline; \tbackground-color: inherit; } .Menu[data-active] ul li{ \tfloat:left; \tposition:relative; \tbackground-color: inherit; } .Menu[data-active] ul li li{ width: 100%; } .Menu[data-active] ul li a{ \tdisplay:block; \tpadding:8px 12px 8px 12px; \tmargin: 0; \tfont-size:18px; \twhite-space:nowrap; \t-webkit-transition: background .3s ease-in-out; \t-moz-transition: background .3s ease-in-out; \t-o-transition: background .3s ease-in-out; \tcolor: {$foreColor}; \ttext-decoration: none; } .Menu[data-active] ul li a:hover{ \tbackground:{$backgroundColorHighlighted}; } .Menu[data-active] ul ul{ \tposition:absolute; \ttop:-99999px; \tleft:0; \topacity: 0; /* Hide sub level */ \t-webkit-transition: opacity .5s ease-in-out; \t-moz-transition: opacity .5s ease-in-out; \t-o-transition: opacity .5s ease-in-out; \tborder-top:none; \tbox-shadow:{$accentColor} 0 3px 4px; } .Menu[data-active] ul ul ul { \tposition:absolute; \ttop:-99999px; \tleft:100%; \topacity: 0; \t-webkit-transition: opacity .5s ease-in-out; /* Hide sub levels */ \t-moz-transition: opacity .5s ease-in-out; \t-o-transition: opacity .5s ease-in-out; } .Menu[data-active] ul li:hover>ul{ \topacity: 1; \tposition:absolute; \ttop:99%; \tleft:0; } .Menu[data-active] ul ul li:hover>ul{ \tposition:absolute; \ttop:0; \tleft:100%; \topacity: 1; \tbackground:{$accentColor}; } /* Menu End */ CSS ); } $menu = parent::render($plugin, $body, $renderer, $parser); return $menu; }
/** * @param WikiLingo\Expression\Plugin $plugin * @param string $body * @param WikiLingo\Renderer $renderer * @param WikiLingo\Parser $parser * @return string */ public function render(WikiLingo\Expression\Plugin &$plugin, &$body, &$renderer, &$parser) { $plugin->attributes['title'] = htmlspecialchars($plugin->parameter('title')); $slider = parent::render($plugin, $body, $renderer, $parser); return $slider; }