20 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
22 include_once
$GLOBALS['xoops']->path('language/' . $xoopsConfig['language'] . '/misc.php');
30 $config = $this->loadConfig(dirname(__FILE__));
31 $ts->patterns[] =
"/\[img align=(['\"]?)(left|center|right)\\1 width=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
32 $ts->patterns[] =
"/\[img align=(['\"]?)(left|center|right)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
33 $ts->patterns[] =
"/\[img width=(['\"]?)([0-9]*)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
34 $ts->patterns[] =
"/\[img]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
36 $ts->patterns[] =
"/\[img align=(['\"]?)(left|center|right)\\1 id=(['\"]?)([0-9]*)\\3]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
37 $ts->patterns[] =
"/\[img id=(['\"]?)([0-9]*)\\1]([^\"\(\)\?\&'<>]*)\[\/img\]/sU";
39 if (empty($ts->config[
'allowimage'])) {
40 $ts->replacements[] =
'<a href="\\5" rel="external">\\5</a>';
41 $ts->replacements[] =
'<a href="\\3" rel="external">\\3</a>';
42 $ts->replacements[] =
'<a href="\\3" rel="external">\\3</a>';
43 $ts->replacements[] =
'<a href="\\1" rel="external">\\1</a>';
45 $ts->replacements[] =
'<a href="' . XOOPS_URL .
'/image.php?id=\\4" rel="external" title="\\5">\\5</a>';
46 $ts->replacements[] =
'<a href="' . XOOPS_URL .
'/image.php?id=\\2" rel="external" title="\\3">\\3</a>';
52 $GLOBALS[
'xoTheme']->addScript(
'/class/textsanitizer/image/image.js', array(
53 'type' =>
'text/javascript'));
55 $ts->replacements[] =
"<img src='\\5' class='\\2' alt='"._MSC_RESIZED_IMAGE .
"' border='0' onload=\"JavaScript:if(this.width>\\4)this.width=\\4\" />";
56 $ts->replacements[] =
"<img src='\\3' class='\\2' alt='"._MSC_RESIZED_IMAGE .
"' border='0'" . (
$config[
'resize'] ?
"onload=\"javascript:imageResize(this, " .
$config[
'max_width'] .
")\"" :
"") .
"/>";
57 $ts->replacements[] =
"<img src='\\3' alt='"._MSC_RESIZED_IMAGE .
"' border='0' onload=\"JavaScript:if(this.width>\\2)this.width=\\2\" /><br />";
58 $ts->replacements[] =
"<img src='\\1' alt='"._MSC_RESIZED_IMAGE .
"' border='0'" . (
$config[
'resize'] ?
" onload=\"javascript:imageResize(this, " .
$config[
'max_width'] .
")\"" :
"") .
"/>";
65 $GLOBALS[
'xoTheme']->addScript(
'/class/textsanitizer/image/image.js', array(
66 'type' =>
'text/javascript'));
68 $ts->replacements[] =
"<a href='javascript:CaricaFoto(\"\\5\");'><img src='\\5' class='\\2' alt='"._MSC_CLICK_TO_OPEN_IMAGE .
"' border='0' onload=\"JavaScript:if(this.width>\\4)this.width=\\4\" /></a>";
69 $ts->replacements[] =
"<a href='javascript:CaricaFoto(\"\\3\");'><img src='\\3' class='\\2' alt='"._MSC_CLICK_TO_OPEN_IMAGE .
"' border='0' " . (
$config[
'resize'] ?
"onload=\"javascript:imageResize(this, " .
$config[
'max_width'] .
")\"" :
"") .
"/></a>";
70 $ts->replacements[] =
"<a href='javascript:CaricaFoto(\"\\3\");'><img src='\\3' alt='"._MSC_CLICK_TO_OPEN_IMAGE .
"' border='0' onload=\"JavaScript:if(this.width>\\2)this.width=\\2\" /></a><br />";
71 $ts->replacements[] =
"<a href='javascript:CaricaFoto(\"\\1\");'><img src='\\1' alt='"._MSC_CLICK_TO_OPEN_IMAGE .
"' border='0' title='"._MSC_CLICK_TO_OPEN_IMAGE .
"'" . (
$config[
'resize'] ?
" onload=\"javascript:imageResize(this, " .
$config[
'max_width'] .
")\"" :
"") .
"/></a>";}
74 $ts->replacements[] =
"<img src='\\5' class='\\2' border='0' alt='"._MSC_ORIGINAL_IMAGE .
"' onload=\"JavaScript:if(this.width>\\4) this.width=\\4\" />";
75 $ts->replacements[] =
"<img src='\\3' class='\\2' border='0' alt='"._MSC_ORIGINAL_IMAGE .
"' " . (
$config[
'resize'] ?
"onload=\"javascript:imageResize(this, " .
$config[
'max_width'] .
")\"" :
"") .
"/>";
76 $ts->replacements[] =
"<img src='\\3' border='0' alt='"._MSC_ORIGINAL_IMAGE .
"' onload=\"JavaScript:if(this.width>\\2) this.width=\\2\" />";
77 $ts->replacements[] =
"<img src='\\1' border='0' alt='"._MSC_ORIGINAL_IMAGE .
"' " . (
$config[
'resize'] ?
" onload=\"javascript:imageResize(this, " .
$config[
'max_width'] .
")\"" :
"") .
"/>";
79 $ts->replacements[] =
'<img src="' . XOOPS_URL .
'/image.php?id=\\4" class="\\2" title="\\5" />';
80 $ts->replacements[] =
'<img src="' . XOOPS_URL .
'/image.php?id=\\2" title="\\3" />';