PHP Classes

File: htdocs/include/xoopscodes.php

Recommend this page to a friend!
  Packages of Michael Beck   Xoops 2.5   htdocs/include/xoopscodes.php   Download  
File: htdocs/include/xoopscodes.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change: Merge pull request #1586 from mambax7/feature/Cannot_use_bool_as_array

fix for Cannot use bool as array
copyright update
language fixes
Null coalescing operator
Merge pull request #1444 from mambax7/feature/fix_Bootstrap5_Renderer

fix dropdown in XoopsFormRendererBootstrap5
Merge pull request #1239 from Andrew-Staves-Activ/notificationhandler_subscribe_success

Merge branch 'feature/php8_templates' of https://github.com/mambax7/XoopsCore25 into feature/php8_templates

# Conflicts:
# htdocs/themes/xswatch4/modules/publisher/publisher_item.tpl
Merge xswatch4
Date: 10 months ago
Size: 2,616 bytes
 

Contents

Class file image Download
<?php
/**
 * xoopsCodeTarea function
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       (c) 2000-2025 XOOPS Project (https://xoops.org)
 * @license             GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
 * @package             kernel
 * @since               2.0.0
 * @author              Kazumi Ono (AKA onokazu) http://www.myweb.ne.jp/, http://jp.xoops.org/
 * @author              Taiwen Jiang <phppp@users.sourceforge.net>
 */
if (!defined('XOOPS_ROOT_PATH')) {
    throw new \RuntimeException('Restricted access');
}

/**#@+
 * @deprecated
 */

/**
 * Displays xoopsCode buttons and target textarea to which xoopscodes are inserted
 *
 * @param string      $textarea_id a unique id of the target textarea
 * @param int         $cols
 * @param int         $rows
 * @param string|null $suffix
 */
function xoopsCodeTarea($textarea_id, $cols = 60, $rows = 15, $suffix = null)
{
    xoops_load('XoopsFormDhtmlTextArea');
    $hiddenText              = isset($suffix) ? 'xoopsHiddenText' . trim($suffix) : 'xoopsHiddenText';
    $content                 = $GLOBALS[$textarea_id] ?? '';
    $text_editor             = new XoopsFormDhtmlTextArea('', $textarea_id, $content, $rows, $cols, $hiddenText);
    $text_editor->htmlEditor = null;
    $text_editor->smilies    = false;
    echo $text_editor->render();
}

/**
 * Displays smilie image buttons used to insert smilie codes to a target textarea in a form
 *
 * @param   string $textarea_id a unique id of the target textarea
 */
function xoopsSmilies($textarea_id)
{
    $myts   = \MyTextSanitizer::getInstance();
    $smiles = $myts->getSmileys(false);
    $count  = count($smiles);
    for ($i = 0; $i < $count; ++$i) {
        echo "<img src='" . XOOPS_UPLOAD_URL . '/' . htmlspecialchars($smiles[$i]['smile_url'], ENT_QUOTES | ENT_HTML5) . "' border='0' alt='' onclick='xoopsCodeSmilie(\"{$textarea_id}\", \" " . $smiles[$i]['code'] . " \");' onmouseover='style.cursor=\"hand\"' />";
    }
    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>]';
}
/**#@-*/