1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: namespace Xoops\Core\Text\Sanitizer\Extensions;
13:
14: use Xoops\Core\Text\Sanitizer;
15: use Xoops\Core\Text\Sanitizer\ExtensionAbstract;
16:
17: /**
18: * TextSanitizer extension
19: *
20: * @category Sanitizer
21: * @package Xoops\Core\Text
22: * @author Wishcraft <simon@xoops.org>
23: * @copyright 2000-2015 XOOPS Project (http://xoops.org)
24: * @license GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
25: * @link http://xoops.org
26: */
27: class UnorderedList extends ExtensionAbstract
28: {
29: /**
30: * @var array default configuration values
31: */
32: protected static $defaultConfiguration = ['enabled' => true];
33:
34: /**
35: * Register extension with the supplied sanitizer instance
36: *
37: * @return void
38: */
39: public function registerExtensionProcessing()
40: {
41: $shortcodes = $this->shortcodes;
42:
43: $shortcodes->addShortcode(
44: 'ul',
45: function ($attributes, $content, $tagName) use ($shortcodes) {
46: $newcontent = '<ul>' . $shortcodes->process($content) . '</ul>';
47: return $newcontent;
48: }
49: );
50:
51: $shortcodes->addShortcode(
52: 'li',
53: function ($attributes, $content, $tagName) use ($shortcodes) {
54: $newcontent = '<li>' . $shortcodes->process($content) . '</li>';
55: return $newcontent;
56: }
57: );
58: }
59: }
60: