16function xoopsCodeTarea($textarea_id, $cols=60, $rows=15, $suffix=
null)
18 $hiddentext = isset($suffix) ?
'xoopsHiddenText'.trim($suffix) :
'xoopsHiddenText';
20 echo
"<a name='moresmiley'></a><img src='".XOOPS_URL.
"/images/icons/url.svg' width='1em' height='1em' alt='url' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeUrl(\"$textarea_id\", \"".htmlspecialchars(_ENTERURL, ENT_QUOTES) .
'", "'
21 . htmlspecialchars(_ENTERWEBTITLE, ENT_QUOTES) .
"\");'/>
22 <img src='".XOOPS_URL.
"/images/icons/mail.svg' width='1em' height='1em' alt='email' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeEmail(\"$textarea_id\", \"".htmlspecialchars(_ENTEREMAIL, ENT_QUOTES).
"\");'>
23 <img src='".XOOPS_URL.
"/images/icons/imgsrc.svg' width='1em' height='1em' alt='imgsrc' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeImg(\"$textarea_id\", \"".htmlspecialchars(_ENTERIMGURL, ENT_QUOTES) .
'", "'
24 . htmlspecialchars(_ENTERIMGPOS, ENT_QUOTES) .
'", "'
25 . htmlspecialchars(_IMGPOSRORL, ENT_QUOTES) .
'", "'
26 . htmlspecialchars(_ERRORIMGPOS, ENT_QUOTES) .
"\");' />
27 <img src='".XOOPS_URL.
"/images/icons/image.svg' width='1em' height='1em' alt='image' onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"".XOOPS_URL .
'/imagemanager.php?target='
28 . $textarea_id .
"\",\"imgmanager\",400,430);' />
29 <img src='".XOOPS_URL.
"/images/icons/code.svg' width='1em' height='1em' alt='code' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeCode(\"$textarea_id\", \"".htmlspecialchars(_ENTERCODE, ENT_QUOTES).
"\");'>
30 <img src='".XOOPS_URL.
"/images/icons/quote.svg' width='1em' height='1em' alt='quote' onmouseover='style.cursor=\"hand\"' onclick='xoopsCodeQuote(\"$textarea_id\");'/><br>\n";
32 $sizearray = [
'xx-small',
'x-small',
'small',
'medium',
'large',
'x-large',
'xx-large'];
33 echo
"<select id='".$textarea_id.
"Size' onchange='setVisible(\"xoopsHiddenText\");setElementSize(\"".$hiddentext.
"\",this.options[this.selectedIndex].value);'>\n";
34 echo
"<option value='SIZE'>"._SIZE.
"</option>\n";
35 foreach ($sizearray as $size) {
36 echo
"<option value='$size'>$size</option>\n";
40 $fontarray = [
'Arial',
'Courier',
'Georgia',
'Helvetica',
'Impact',
'Verdana'];
41 echo
"<select id='".$textarea_id.
"Font' onchange='setVisible(\"xoopsHiddenText\");setElementFont(\"".$hiddentext.
"\",this.options[this.selectedIndex].value);'>\n";
42 echo
"<option value='FONT'>"._FONT.
"</option>\n";
43 foreach ($fontarray as $font) {
44 echo
"<option value='$font'>$font</option>\n";
48 $colorarray = [
'00',
'33',
'66',
'99',
'CC',
'FF'];
49 echo
"<select id='".$textarea_id.
"Color' onchange='setVisible(\"xoopsHiddenText\");setElementColor(\"".$hiddentext.
"\",this.options[this.selectedIndex].value);'>\n";
50 echo
"<option value='COLOR'>"._COLOR.
"</option>\n";
51 foreach ($colorarray as $color1) {
52 foreach ($colorarray as $color2) {
53 foreach ($colorarray as $color3) {
54 echo
"<option value='".$color1.$color2.$color3.
"' style='background-color:#".$color1.$color2.$color3 .
';color:#' . $color1 . $color2 . $color3 .
";'>#" . $color1 . $color2 . $color3 .
"</option>\n";
58 echo
"</select><span id='".$hiddentext.
"'>"._EXAMPLE.
"</span>\n";
62 $areacontent = $GLOBALS[$textarea_id] ??
'';
63 echo
"<img src='".XOOPS_URL.
"/images/icons/bold.svg' width='1em' height='1em' alt='bold' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"".$hiddentext .
'");makeBold("'
64 . $hiddentext .
"\");' /> <img src='" . XOOPS_URL .
"/images/icons/italic.svg' width='1em' height='1em' alt='italic' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"" . $hiddentext .
'");makeItalic("'
65 . $hiddentext .
"\");' /> <img src='" . XOOPS_URL .
"/images/icons/underline.svg' width='1em' height='1em' alt='underline' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"" . $hiddentext .
'");makeUnderline("'
66 . $hiddentext .
"\");'/> <img src='" . XOOPS_URL .
"/images/icons/linethrough.svg' width='1em' height='1em' alt='linethrough' onmouseover='style.cursor=\"hand\"' onclick='setVisible(\"" . $hiddentext .
'");makeLineThrough("'
67 . $hiddentext .
"\");' /> <input type='text' id='" . $textarea_id .
"Addtext' size='20'> <input type='button' onclick='xoopsCodeText(\"$textarea_id\", \"" . $hiddentext .
'", "'
68 . htmlspecialchars(_ENTERTEXTBOX, ENT_QUOTES) .
"\")' value='" . _ADD .
"'><br><br><textarea id='" . $textarea_id .
"' name='" . $textarea_id .
"' cols='$cols' rows='$rows'>" . $areacontent .
"</textarea><br>\n";
76function xoopsSmilies($textarea_id)
79 $smiles = $myts->getSmileys();
81 $db =& Database::getInstance();
82 if ($result = $db->query(
'SELECT * FROM '.$db->prefix(
'smiles').
' WHERE display=1')) {
83 while ($smile = $db->fetchArray($result)) {
85 echo
"<img src='".XOOPS_UPLOAD_URL .
'/' . htmlspecialchars($smile[
'smile_url']) .
"' border='0' onmouseover='style.cursor=\"hand\"' alt='' onclick='xoopsCodeSmilie(\"" . $textarea_id .
'", " ' . $smile[
'code'] .
" \");' />";
90 foreach ($smiles as $iValue) {
91 if (1 == $iValue[
'display']) {
93 echo
"<img src='".XOOPS_UPLOAD_URL .
'/' . htmlspecialchars($iValue[
'smile_url']) .
"' border='0' onmouseover='style.cursor=\"hand\"' alt='' onclick='xoopsCodeSmilie(\"" . $textarea_id .
'", " ' . $iValue[
'code'] .
" \");' />";
99 echo
" [<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' onclick='openWithSelfMain(\"".XOOPS_URL .
'/misc.php?action=showpopups&type=smilies&target=' . $textarea_id .
"\",\"smilies\",300,475);'>" . _MORE .
'</a>]';