1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: use Xoops\Core\PreloadItem;
13: use Xoops\Core\Request;
14:
15: 16: 17: 18: 19: 20: 21:
22: class ImagesPreload extends PreloadItem
23: {
24: public static function eventCoreIncludeCommonEnd($args)
25: {
26: $path = dirname(__DIR__);
27: XoopsLoad::addMap(array(
28: 'images' => $path . '/class/helper.php',
29: ));
30: }
31:
32: public static function eventCoreClassXoopsformFormdhtmltextareaCodeicon($args)
33: {
34:
35: $dhtml = $args[1];
36: $args[0] .= "<img src='" . \XoopsBaseConfig::get('url') . "/images/image.gif' alt='" . XoopsLocale::INSIDE_IMAGE . "' title='" . XoopsLocale::INSIDE_IMAGE . "' onclick='openWithSelfMain(\"" . \XoopsBaseConfig::get('url') . "/modules/images/imagemanager.php?target={$dhtml->getName()}\",\"imgmanager\",400,430);' onmouseover='style.cursor=\"hand\"'/> ";
37: }
38:
39: public static function eventCoreImage($args)
40: {
41: $uri = '';
42: foreach (Request::get() as $k => $v) {
43: $uri .= urlencode($k) . '=' . urlencode($v) . '&';
44: }
45: Xoops::getInstance()->redirect("modules/images/image.php?{$uri}", 0);
46: }
47:
48: public static function eventCoreImagemanager($args)
49: {
50: $uri = '';
51: foreach (Request::get() as $k => $v) {
52: $uri .= urlencode($k) . '=' . urlencode($v) . '&';
53: }
54: Xoops::getInstance()->redirect("modules/images/imagemanager.php?{$uri}", 0);
55: }
56: }
57: