public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('gpspicker', '$_gpspicker = $_form[%node.word]; $_gpspickerControl = $_gpspicker->getControl(TRUE); echo $_gpspickerControl->addAttributes(%node.array)->startTag()', 'echo $_gpspickerControl->endTag(); unset($_gpspicker, $_gpspickerControl)');
     $me->addMacro('gpspicker:input', array($me, 'macroInput'));
     $me->addMacro('gpspicker:label', array($me, 'macroLabel'), '?></label><?php');
 }
 /**
  * Register template macro into the latte compiler
  *
  * @param Compiler $compiler
  * @return TemplateMacroSet Provides fluent interface
  */
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('template', array($me, 'macroTemplate'));
     $me->addMacro('_', array($me, 'macroTranslate'), array($me, 'macroTranslate'));
     return $me;
 }
Exemplo n.º 3
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     IfAllowedHrefMacro::install($compiler);
     $me->addMacro('ifAllowedLink', array(get_called_class(), 'macroIfAllowedLink'), array(get_called_class(), 'macroIfAllowedLinkEnd'));
     $me->addMacro('ifAllowed', array(get_called_class(), 'macroIfAllowed'), array(get_called_class(), 'macroIfAllowedEnd'));
 }
Exemplo n.º 4
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('input', [$me, 'macroInput']);
     $me->addMacro('label', [$me, 'macroLabel'], [$me, 'macroLabelEnd']);
     return $me;
 }
Exemplo n.º 5
0
 /**
  * @param \Latte\Compiler $compiler
  * @return UIMacros
  */
 public static function install(\Latte\Compiler $compiler)
 {
     $set = new static($compiler);
     $set->addMacro('css', [$set, 'macroCss']);
     $set->addMacro('js', [$set, 'macroJs']);
     return $set;
 }
Exemplo n.º 6
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('snippetId', 'echo %escape($_control->getSnippetId(%node.word))');
     $me->addMacro('param', 'echo %escape($_control->getParameterId(%node.word))');
     $me->addMacro('dynamic', null, null, 'echo Nette\\Utils\\Html::el()->setClass("nittro-snippet-container")->data("dynamic-mask", $_control->getSnippetId(%node.word))->attributes()');
 }
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('ifEnabled', array($me, 'macroIfEnabled'), array($me, 'macroEndIfEnabled'));
     $me->addMacro('ifNotEnabled', array($me, 'macroIfNotEnabled'), array($me, 'macroEndIfEnabled'));
     return $me;
 }
Exemplo n.º 8
0
 public static function install(\Latte\Compiler $compiler)
 {
     $set = new static($compiler);
     $set->addMacro('row', [$set, 'macroRow'], [$set, 'macroRowEnd']);
     $set->addMacro('col', [$set, 'macroCol'], [$set, 'macroCoLEnd']);
     $set->addMacro('rowCol', [$set, 'macroRowCol'], [$set, 'macroRowCoLEnd']);
 }
Exemplo n.º 9
0
 public static function install(Latte\Parser $parser)
 {
     $me = new static($parser);
     $me->addMacro('form', '$form = $control[%node.word]; echo $form->getElementPrototype()->addAttributes(%node.array)->startTag()', 'echo $form->getElementPrototype()->endTag()');
     $me->addMacro('label', array($me, 'macroLabel'), '?></label><?php');
     $me->addMacro('input', 'echo $form[%node.word]->getControl()->addAttributes(%node.array)');
 }
Exemplo n.º 10
0
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('input', array($me, 'macroInput'));
     $me->addMacro('label', array($me, 'macroLabel'), array($me, 'macroLabelEnd'));
     return $me;
 }
 public static function install(Latte\Compiler $parser)
 {
     $me = new static($parser);
     $me->addMacro('inputlist', array($me, 'macroStartList'), array($me, 'macroEndList'));
     $me->addMacro('input', array($me, 'macroInput'));
     $me->addMacro('label', array($me, 'macroLabel'), '?></label><?php');
 }
Exemplo n.º 12
0
 /**
  * @param \Latte\Compiler $compiler
  */
 public static function install(\Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('linkThumbnail', 'echo $_presenter->getContext()->getByType("Arachne\\Resources\\Thumbnailer")->getLinkThumbnail(%node.array)');
     $me->addMacro('thumbnail', 'echo $_presenter->getContext()->getByType("Arachne\\Resources\\Thumbnailer")->getThumbnail(%node.array)');
     $me->addMacro('thumbnailUrl', 'echo $_presenter->getContext()->getByType("Arachne\\Resources\\Thumbnailer")->getThumbnailUrl(%node.array)');
 }
Exemplo n.º 13
0
 /**
  * @param \Nette\Latte\Compiler $compiler
  * @return \Nette\Latte\Macros\MacroSet|void
  */
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('scripts', array($me, 'macroScripts'));
     $me->addMacro('styles', array($me, 'macroStyles'));
     $me->addMacro('script', array($me, 'macroScript'));
     $me->addMacro('style', array($me, 'macroStyle'));
 }
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('loop', array($me, 'macroLoop'), array($me, 'macroLoopEnd'));
     $me->addMacro('each', '', array($me, 'macroEachEnd'));
     $me->addMacro('repeat', array($me, 'macroRepeat'), array($me, 'macroRepeatEnd'));
     $me->addMacro('set', array($me, 'macroSet'));
 }
Exemplo n.º 15
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('head', array($me, 'headBegin'), array($me, 'headEnd'));
     $me->addMacro('body', array($me, 'bodyBegin'), array($me, 'bodyEnd'));
     $me->addMacro('content', array($me, 'contentBegin'));
     $me->addMacro('extensions', array($me, 'extensionsBegin'));
 }
Exemplo n.º 16
0
 public static function install(Compiler $compiler)
 {
     $set = new static($compiler);
     //		$set->addMacro('form', array($set, 'macroFormBegin'), array($set, 'macroFormEnd'));
     $set->addMacro('pair', array($set, 'macroPair'));
     $set->addMacro('label', array($set, 'macroLabel'), array($set, 'macroLabelEnd'));
     //		$set->addMacro('container', array($set, 'macroContainer'));
 }
Exemplo n.º 17
0
 /**
  * @param \Nette\Latte\Compiler $compiler
  *
  * @return Latte|\Nette\Latte\Macros\MacroSet
  */
 public static function install(Compiler $compiler)
 {
     /** @var $me Latte */
     $me = new static($compiler);
     $me->addMacro('datagrid', array($me, 'macroDatagrid'), array($me, 'macroDatagridEnd'));
     $me->addMacro('template', array($me, 'macroTemplate'), array($me, 'macroTemplateEnd'));
     return $me;
 }
Exemplo n.º 18
0
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('form', 'Nette\\Latte\\Macros\\FormMacros::renderFormBegin($form = $_form = $_control[%node.word], %node.array)', 'Nette\\Latte\\Macros\\FormMacros::renderFormEnd($_form)');
     $me->addMacro('label', array($me, 'macroLabel'), '?></label><?php');
     $me->addMacro('input', 'echo $_form[%node.word]->getControl()->addAttributes(%node.array)', NULL, array($me, 'macroAttrInput'));
     $me->addMacro('formContainer', '$_formStack[] = $_form; $formContainer = $_form = $_form[%node.word]', '$_form = array_pop($_formStack)');
 }
Exemplo n.º 19
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     /** @var TranslateMacros $me */
     $me->addMacro('_', array($me, 'macroTranslate'), array($me, 'macroTranslate'));
     $me->addMacro('translator', array($me, 'macroDomain'), array($me, 'macroDomainEnd'));
     return $me;
 }
Exemplo n.º 20
0
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('link', [$me, 'macroLink']);
     $me->addMacro('plink', [$me, 'macroLink']);
     $me->addMacro('href', NULL, NULL, function (MacroNode $node, PhpWriter $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
 }
Exemplo n.º 21
0
 /**
  * @param Compiler $compiler
  * @return self
  */
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('_', array($me, 'unknown'));
     foreach (self::$functions as $prefix => $_n) {
         $me->addMacro($prefix . '_', array($me, self::GETTEXT));
     }
     return $me;
 }
Exemplo n.º 22
0
 /**
  * @param \Nette\Latte\Compiler $compiler
  * @return \Nette\Latte\Macros\MacroSet|void
  */
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('form', array($me, 'macroFormBegin'), array($me, 'macroFormEnd'));
     $me->addMacro('pair', array($me, 'macroPair'));
     $me->addMacro('group', array($me, 'macroGroup'));
     $me->addMacro('container', array($me, 'macroContainer'));
     return $me;
 }
Exemplo n.º 23
0
 public static function install(Latte\Compiler $compiler)
 {
     $set = new static($compiler);
     $set->addMacro('img', [$set, 'tagImg'], NULL, [$set, 'attrImg']);
     $set->addMacro('imgAbs', [$set, 'tagImgAbs'], NULL, [$set, 'attrImgAbs']);
     $set->addMacro('imgLink', [$set, 'linkImg']);
     $set->addMacro('imgLinkAbs', [$set, 'linkImgAbs']);
     return $set;
 }
Exemplo n.º 24
0
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('form', 'Nette\\Latte\\Macros\\FormMacros::renderFormBegin($form = $_form = (is_object(%node.word) ? %node.word : $_control[%node.word]), %node.array)', 'Nette\\Latte\\Macros\\FormMacros::renderFormEnd($_form)');
     $me->addMacro('label', array($me, 'macroLabel'), 'if ($_label) echo $_label->endTag()');
     $me->addMacro('input', '$_input = (is_object(%node.word) ? %node.word : $_form[%node.word]); echo $_input->getControl()->addAttributes(%node.array)', NULL, array($me, 'macroAttrName'));
     $me->addMacro('formContainer', '$_formStack[] = $_form; $formContainer = $_form = (is_object(%node.word) ? %node.word : $_form[%node.word])', '$_form = array_pop($_formStack)');
     $me->addMacro('name', NULL, NULL, array($me, 'macroAttrName'));
 }
Exemplo n.º 25
0
 /**
  * Add gettext macros
  *
  * @param Template
  * @param ITranslator
  */
 public static function install(Compiler $parser)
 {
     $me = new static($parser);
     $callback = array($me, 'macroGettext');
     $me->addMacro('_', $callback);
     $me->addMacro('_n', $callback);
     $me->addMacro('_p', $callback);
     $me->addMacro('_np', $callback);
 }
Exemplo n.º 26
0
 public static function install(Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('form', array($me, 'macroForm'), 'Nette\\Latte\\Macros\\FormMacros::renderFormEnd($_form)');
     $me->addMacro('formContainer', array($me, 'macroFormContainer'), '$_form = array_pop($_formStack)');
     $me->addMacro('label', array($me, 'macroLabel'), array($me, 'macroLabelEnd'));
     $me->addMacro('input', array($me, 'macroInput'), NULL, array($me, 'macroInputAttr'));
     $me->addMacro('name', array($me, 'macroName'), array($me, 'macroNameEnd'), array($me, 'macroNameAttr'));
 }
Exemplo n.º 27
0
 /**
  * @param \Latte\Compiler $compiler
  * @return \Venne\Packages\Latte\Macros\UIMacros
  */
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('includeblock', array($me, 'macroIncludeBlock'));
     $me->addMacro('extends', array($me, 'macroExtends'));
     $me->addMacro('layout', array($me, 'macroExtends'));
     $me->addMacro('path', array($me, 'macroPath'));
     return $me;
 }
Exemplo n.º 28
0
 /**
  * Installs redactions macros to parser
  *
  * @param Nette\Latte\Parser $parser
  * @return RedactionMacros
  */
 static function install(Nette\Latte\Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('addCss', array($me, 'macroWebFile'));
     $me->addMacro('addJs', array($me, 'macroWebFile'));
     $me->addMacro('meta', array($me, 'macroMeta'));
     $me->addMacro('iftest', array($me, 'macroTest'), array($me, 'macroEndTest'));
     $me->addMacro('ifTest', array($me, 'macroTest'), array($me, 'macroEndTest'));
     return $me;
 }
Exemplo n.º 29
0
 /**
  * @param \Latte\Compiler $compiler
  * @return \Latte\Macros\MacroSet
  */
 public static function install(Compiler $compiler)
 {
     $me = new static($compiler);
     $me->addMacro('href', NULL, NULL, function (\Latte\MacroNode $node, \Latte\PhpWriter $writer) use($me) {
         return ' ?> href="<?php ' . $me->macroLink($node, $writer) . ' ?>"<?php ';
     });
     $me->addMacro('plink', [$me, 'macroLink']);
     $me->addMacro('link', [$me, 'macroLink']);
     $me->addMacro('ifAllowed', [$me, 'macroIfAllowed'], '}');
     return $me;
 }
Exemplo n.º 30
0
    public static function install(Latte\Parser $parser)
    {
        $me = new static($parser);
        $me->addMacro('form', '$form = $control[%node.word]; echo $form->getElementPrototype()->addAttributes(%node.array)->startTag()', '?><div><?php
foreach ($form->getComponents(TRUE, \'Nette\\Forms\\Controls\\HiddenField\') as $_tmp) echo $_tmp->getControl();
if (iterator_count($form->getComponents(TRUE, \'Nette\\Forms\\Controls\\TextInput\')) < 2) echo "<!--[if IE]><input type=IEbug disabled style=\\"display:none\\"><![endif]-->";
?></div>
<?php echo $form->getElementPrototype()->endTag()');
        $me->addMacro('label', array($me, 'macroLabel'), '?></label><?php');
        $me->addMacro('input', 'echo $form[%node.word]->getControl()->addAttributes(%node.array)');
    }