XOOPS  2.6.0
core.php
Go to the documentation of this file.
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 
20 {
21  static function eventCoreIncludeCommonEnd($args)
22  {
23  $path = dirname(__DIR__);
24  XoopsLoad::addMap(array(
25  'smilies' => $path . '/class/helper.php',
26  ));
27  }
28 
30  {
31  /* @var $dhtml Xoops\Form\DhtmlTextArea */
32  $dhtml = $args[1];
33  $args[0] .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/smiley.gif' alt='" . XoopsLocale::SMILIES . "' title='" . XoopsLocale::SMILIES . "' onclick='openWithSelfMain(\"" . \XoopsBaseConfig::get('url') . "/modules/smilies/popup.php?target={$dhtml->getName()}\",\"smilies\",300,650);' onmouseover='style.cursor=\"hand\"'/>&nbsp;";
34  }
35 
37  {
38  $smileys = MyTextSanitizer::getInstance()->getSmileys();
39  $message =& $args[0];
40  foreach ($smileys as $smile) {
41  $message = str_replace($smile['smiley_code'], '<img class="imgsmile" src="' . \XoopsBaseConfig::get('uploads-url') . '/' . htmlspecialchars($smile['smiley_url']) . '" alt="' . $smile['smiley_emotion'] . '" />', $message);
42  }
43  }
44 
46  {
47  $isAll = $args[0];
48  $smileys =& $args[1];
49  $myts =& $args[2];
50 
51  if (count($myts->smileys) == 0) {
52  $myts->smileys = Smilies::getInstance()->getHandlerSmilies()->getSmilies(0, 0, false);
53  }
54  if ($isAll) {
55  $smileys = $myts->smileys;
56  return true;
57  }
58 
59  foreach ($myts->smileys as $smile) {
60  if (empty($smile['smiley_display'])) {
61  continue;
62  }
63  $smileys[] = $smile;
64  }
65  return true;
66  }
67 }
$path
Definition: execute.php:31
static getInstance()
Definition: helper.php:34
static eventCoreIncludeCommonEnd($args)
Definition: core.php:21
static eventCoreClassXoopsformFormdhtmltextareaCodeicon($args)
Definition: core.php:29
static eventCoreClassModuleTextsanitizerGetSmileys($args)
Definition: core.php:45
static get($name)
static eventCoreClassModuleTextsanitizerSmiley($args)
Definition: core.php:36
$myts
Definition: edituser.php:38
static addMap(array $map)
Definition: xoopsload.php:40