1: <?php
2: /**
3: * xoopsCodeTarea function
4: *
5: * You may not change or alter any portion of this comment or credits
6: * of supporting developers from this source code or any supporting source code
7: * which is considered copyrighted (c) material of the original comment or credit authors.
8: * This program is distributed in the hope that it will be useful,
9: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
13: * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
14: * @package kernel
15: * @since 2.0.0
16: * @author Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
17: * @author Taiwen Jiang <phppp@users.sourceforge.net>
18: */
19: defined('XOOPS_ROOT_PATH') || exit('Restricted access');
20:
21: /**#@+
22: * @deprecated
23: */
24:
25: /**
26: * Displayes xoopsCode buttons and target textarea to which xoopscodes are inserted
27: *
28: * @param string $textarea_id a unique id of the target textarea
29: * @param int $cols
30: * @param int $rows
31: * @param null $suffix
32: */
33: function xoopsCodeTarea($textarea_id, $cols = 60, $rows = 15, $suffix = null)
34: {
35: xoops_load('XoopsFormDhtmlTextArea');
36: $hiddenText = isset($suffix) ? 'xoopsHiddenText' . trim($suffix) : 'xoopsHiddenText';
37: $content = isset($GLOBALS[$textarea_id]) ? $GLOBALS[$textarea_id] : '';
38: $text_editor = new XoopsFormDhtmlTextArea('', $textarea_id, $content, $rows, $cols, $hiddenText);
39: $text_editor->htmlEditor = null;
40: $text_editor->smilies = false;
41: echo $text_editor->render();
42: }
43:
44: /**
45: * Displays smilie image buttons used to insert smilie codes to a target textarea in a form
46: *
47: * @param string $textarea_id a unique id of the target textarea
48: */
49: function xoopsSmilies($textarea_id)
50: {
51: $myts = \MyTextSanitizer::getInstance();
52: $smiles = $myts->getSmileys(false);
53: $count = count($smiles);
54: for ($i = 0; $i < $count; ++$i) {
55: echo "<img src='" . XOOPS_UPLOAD_URL . '/' . htmlspecialchars($smiles[$i]['smile_url'], ENT_QUOTES) . "' border='0' alt='' onclick='xoopsCodeSmilie(\"{$textarea_id}\", \" " . $smiles[$i]['code'] . " \");' onmouseover='style.cursor=\"hand\"' />";
56: }
57: echo "&nbsp;[<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt='' onclick='openWithSelfMain(\"" . XOOPS_URL . "/misc.php?action=showpopups&amp;type=smilies&amp;target={$textarea_id}\",\"smilies\",300,475);'>" . _MORE . '</a>]';
58: }
59: /**#@-*/
60: