1: <?php
2: /*
3: * Smarty plugin
4: * ------------------------------------------------------------
5: * Type: block
6: * Name: noshortcode
7: * Purpose: XOOPS smarty plugin to disable theme level ShortCode processing for a section of a template.
8: * ShortCodes are surrounded by square brackets ([]). The outputfilter.shortcodes.php
9: * plugin is called to process shortcodes anywhere in the entire output, however, there
10: * are times when it might be desired to disable that processing for a section of a
11: * template. This is accomplished by converting any brackets ([]) to visually equivalent
12: * HTML entities ([]) so they will be ignored by the outputfilter.
13: * Author: Richard Griffith <richard@geekwright.com>
14: * Version: 1.0
15: *
16: * Parameters: none
17: *
18: * Example:
19: * {noshortcodes}[skip]{/noshortcodes}
20: *
21: * Example output:
22: * [skip]
23: * ------------------------------------------------------------
24: */
25:
26: function smarty_block_noshortcodes($params, $content, $template, &$repeat)
27: {
28: // only output on the closing tag
29: if(!$repeat){
30: if (isset($content)) {
31: $ts = \Xoops\Core\Text\Sanitizer::getInstance();
32: return $ts->escapeShortCodes($content);
33: }
34: }
35: }
36: