From: <var...@us...> - 2016-07-07 15:04:26
|
Revision: 9861 http://sourceforge.net/p/phpwiki/code/9861 Author: vargenau Date: 2016-07-07 15:04:23 +0000 (Thu, 07 Jul 2016) Log Message: ----------- Allow Wikicreole syntax for plugins in theme templates Modified Paths: -------------- trunk/lib/Template.php trunk/themes/Crao/templates/editpage.tmpl trunk/themes/MonoBook/templates/tags.tmpl trunk/themes/Portland/templates/editpage.tmpl trunk/themes/Sidebar/templates/tags.tmpl trunk/themes/Wordpress/templates/editpage.tmpl trunk/themes/blog/templates/top.tmpl trunk/themes/default/templates/blogform.tmpl trunk/themes/default/templates/editpage.tmpl trunk/themes/fusionforge/templates/blogform.tmpl trunk/themes/fusionforge/templates/browse.tmpl trunk/themes/fusionforge/templates/editpage.tmpl trunk/themes/wikilens/templates/body.tmpl Modified: trunk/lib/Template.php =================================================================== --- trunk/lib/Template.php 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/lib/Template.php 2016-07-07 15:04:23 UTC (rev 9861) @@ -60,6 +60,10 @@ $orig[] = '/<\?plugin.*?\?>/se'; $repl[] = "\$this->_mungePlugin('\\0')"; + // Convert <<expr>> to < ?php $this->_printPluginPI("expr"); ? > + $orig[] = '/<<.*?>>/se'; + $repl[] = "\$this->_mungePlugin('\\0')"; + // Convert < ?= expr ? > to < ?php $this->_print(expr); ? > $orig[] = '/<\?=(.*?)\?>/s'; $repl[] = '<?php $this->_print(\1);?>'; @@ -74,6 +78,9 @@ private function _mungePlugin($pi) { + $pi = preg_replace('/^<</', '<?plugin ', $pi); + $pi = preg_replace('/>>$/', ' ?>', $pi); + // HACK ALERT: PHP's preg_replace, with the /e option seems to // escape both single and double quotes with backslashes. // So we need to unescape the double quotes here... Modified: trunk/themes/Crao/templates/editpage.tmpl =================================================================== --- trunk/themes/Crao/templates/editpage.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/Crao/templates/editpage.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -57,7 +57,7 @@ <div class="wiki-edithelp"> <?php // FIXME: do we need this at all? If so, it could probably be moved to TextFormattingRules ?> <p><?php echo fmt("See %s tips for editing.", WikiLink(_("Help")."/"._("GoodStyle"))) ?></p> -<?plugin IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1?> +<<IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1>> </div> <?php echo $HIDDEN_INPUTS?> </form> Modified: trunk/themes/MonoBook/templates/tags.tmpl =================================================================== --- trunk/themes/MonoBook/templates/tags.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/MonoBook/templates/tags.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -3,7 +3,7 @@ <div class="portlet" id="p-tags"> <h2><?php echo _("Favorite Categories") ?></h2> <div class="pBody"> - <?plugin PopularTags ?> + <<PopularTags>> </div> </div> </nav> Modified: trunk/themes/Portland/templates/editpage.tmpl =================================================================== --- trunk/themes/Portland/templates/editpage.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/Portland/templates/editpage.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -39,7 +39,7 @@ <div class="wiki-edithelp"> <?php // FIXME: do we need this at all? If so, it could probably be moved to TextFormattingRules ?> <p><?php echo fmt("See %s tips for editing.", WikiLink(_("Help")."/"._("GoodStyle"))) ?></p> -<?plugin IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1?> +<<IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1>> </div> <?php echo $HIDDEN_INPUTS?> </form> Modified: trunk/themes/Sidebar/templates/tags.tmpl =================================================================== --- trunk/themes/Sidebar/templates/tags.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/Sidebar/templates/tags.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -3,7 +3,7 @@ <div class="portlet" id="p-tags"> <h2><?php echo _("Favorite Categories") ?> <?php echo $WikiTheme->folderArrow('p-tags', 'Open') ?></h2> <div class="pBody" id="p-tags-body"> - <?plugin PopularTags ?> + << PopularTags >> </div> </div> </nav> Modified: trunk/themes/Wordpress/templates/editpage.tmpl =================================================================== --- trunk/themes/Wordpress/templates/editpage.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/Wordpress/templates/editpage.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -55,7 +55,7 @@ <div class="wiki-edithelp"> <?php // FIXME: do we need this at all? If so, it could probably be moved to TextFormattingRules ?> <p><?php echo fmt("See %s tips for editing.", WikiLink(_("Help")."/"._("GoodStyle"))) ?></p> -<?plugin IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1?> +<<IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1>> </div> <?php echo $HIDDEN_INPUTS?> </form> Modified: trunk/themes/blog/templates/top.tmpl =================================================================== --- trunk/themes/blog/templates/top.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/blog/templates/top.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -12,6 +12,6 @@ <div id="actionbar"> <?php echo Template('actionbar') ?> </div> -<div id="pagetrail"><?php echo _("Page Trail")?>: <?plugin PageTrail numberlinks=7 ?></div> +<div id="pagetrail"><?php echo _("Page Trail")?>: <<PageTrail numberlinks=7 >></div> <?php } ?> Modified: trunk/themes/default/templates/blogform.tmpl =================================================================== --- trunk/themes/default/templates/blogform.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/default/templates/blogform.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -22,7 +22,7 @@ <hr /> <div class="wiki-edithelp"> <p><?php echo fmt("See %s tips for editing.", WikiLink(_("Help")."/"._("GoodStyle"))) ?></p> - <?plugin IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1?> + <<IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1>> </div> <?php echo $HIDDEN_INPUTS?> </form> Modified: trunk/themes/default/templates/editpage.tmpl =================================================================== --- trunk/themes/default/templates/editpage.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/default/templates/editpage.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -75,5 +75,5 @@ <div class="wiki-edithelp"> <?php // FIXME: do we need this at all? If so, it could probably be moved to TextFormattingRules ?> <p><?php echo fmt("See %s tips for editing.", WikiLink(_("Help")."/"._("GoodStyle"))) ?></p> -<?plugin IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1?> +<<IncludePage page=_("Help/TextFormattingRules") section=_("Synopsis") quiet=1>> </div> Modified: trunk/themes/fusionforge/templates/blogform.tmpl =================================================================== --- trunk/themes/fusionforge/templates/blogform.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/fusionforge/templates/blogform.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -21,7 +21,7 @@ <hr /> <div class="wiki-edithelp"> - <?plugin IncludePage page="TextFormattingRules" section="Synopsis" quiet=1?> + <<IncludePage page="TextFormattingRules" section="Synopsis" quiet=1>> </div> <?php echo $HIDDEN_INPUTS?> </form> Modified: trunk/themes/fusionforge/templates/browse.tmpl =================================================================== --- trunk/themes/fusionforge/templates/browse.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/fusionforge/templates/browse.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -30,7 +30,7 @@ <?php } ?> <?php if ($curuserprefs->get('pageTrail')) { ?> -<?plugin PageTrail ?> +<<PageTrail>> <?php } ?> <?php echo $CONTENT?> Modified: trunk/themes/fusionforge/templates/editpage.tmpl =================================================================== --- trunk/themes/fusionforge/templates/editpage.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/fusionforge/templates/editpage.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -103,8 +103,8 @@ <hr /> <div class="wiki-edithelp"> <?php if (WIKI_NAME == "help") { ?> -<?plugin IncludePage page="Help/TextFormattingRules" section="Synopsis" quiet=1?> +<<IncludePage page="Help/TextFormattingRules" section="Synopsis" quiet=1>> <?php } else { ?> -<?plugin IncludePage page="TextFormattingRules" section="Synopsis" quiet=1?> +<<IncludePage page="TextFormattingRules" section="Synopsis" quiet=1>> <?php } ?> </div> Modified: trunk/themes/wikilens/templates/body.tmpl =================================================================== --- trunk/themes/wikilens/templates/body.tmpl 2016-07-07 14:55:58 UTC (rev 9860) +++ trunk/themes/wikilens/templates/body.tmpl 2016-07-07 15:04:23 UTC (rev 9861) @@ -17,7 +17,7 @@ <?php echo Template('navbar') ?> </div> <hr /> -<?plugin IncludePage page="LeftbarContent" quiet="true" ?> +<<IncludePage page="LeftbarContent" quiet="true" >> </nav> </td> <td class="content"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |