Revision [5649]
This is an old revision of EnhancedImageAction made by ChristianBarthelemy on 2005-02-05 14:21:12.
Enhances Image Action
See also:
Documentation: EnhancedImageActionInfo.The code here below is just a quick modification to the offical image action code. Only works from release 1.1.6.0!
<?php
/*
"image" action
Parameters:
url - URL of image to be embedded
link - target link for image (optional). Supports URL, WikiName links, InterWiki links etc.
title - title text displayed when mouse hovers above image
class - a class for the image
alt - an alt text
width - optional width
heigth - optional heigth
openfull - if different from nothing it will link to open the full size image in a new window
*/
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
if ($param == 'src' and $vars['url'] == '') {$vars['url']=$value;}
if ($param == 'title') {$title=$this->htmlspecialchars_ent($vars['title']);}
if ($param == 'class') {$class=$this->htmlspecialchars_ent($vars['class']);}
if ($param == 'alt') {$alt=$this->htmlspecialchars_ent($vars['alt']);}
if ($param == 'width') {$width=$this->htmlspecialchars_ent($vars['width']);}
if ($param == 'heigth') {$heigth=$this->htmlspecialchars_ent($vars['heigth']);}
}
}
$url = $this->cleanUrl(trim($vars['url']));
$output="";
if ($openfull) {$output.="<a href=\"".$url."\" target=\"_blank\" >";}
$output.="<img ";
if ($class) {$output.="class=\"".$class."\" ";}
$output.="src=\"".$url."\" ";
if ($alt) {$output.="alt=\"".$alt."\" ";}
if ($title) {$output.="title=\"".$title."\" ";}
if ($width) {$output.="width=\"".$width."\" ";}
if ($heigth) {$output.="heigth=\"".$heigth."\" ";}
$output.=" />";
if ($openfull) {$output.="<a>";}
// link?
if ($link = $vars['link'])
{
$output = $this->Link($link, "", $output, 1, 0, 0);
}
$output = $this->ReturnSafeHTML($output);
print($output);
?>
/*
"image" action
Parameters:
url - URL of image to be embedded
link - target link for image (optional). Supports URL, WikiName links, InterWiki links etc.
title - title text displayed when mouse hovers above image
class - a class for the image
alt - an alt text
width - optional width
heigth - optional heigth
openfull - if different from nothing it will link to open the full size image in a new window
*/
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
if ($param == 'src' and $vars['url'] == '') {$vars['url']=$value;}
if ($param == 'title') {$title=$this->htmlspecialchars_ent($vars['title']);}
if ($param == 'class') {$class=$this->htmlspecialchars_ent($vars['class']);}
if ($param == 'alt') {$alt=$this->htmlspecialchars_ent($vars['alt']);}
if ($param == 'width') {$width=$this->htmlspecialchars_ent($vars['width']);}
if ($param == 'heigth') {$heigth=$this->htmlspecialchars_ent($vars['heigth']);}
}
}
$url = $this->cleanUrl(trim($vars['url']));
$output="";
if ($openfull) {$output.="<a href=\"".$url."\" target=\"_blank\" >";}
$output.="<img ";
if ($class) {$output.="class=\"".$class."\" ";}
$output.="src=\"".$url."\" ";
if ($alt) {$output.="alt=\"".$alt."\" ";}
if ($title) {$output.="title=\"".$title."\" ";}
if ($width) {$output.="width=\"".$width."\" ";}
if ($heigth) {$output.="heigth=\"".$heigth."\" ";}
$output.=" />";
if ($openfull) {$output.="<a>";}
// link?
if ($link = $vars['link'])
{
$output = $this->Link($link, "", $output, 1, 0, 0);
}
$output = $this->ReturnSafeHTML($output);
print($output);
?>
CategoryDevelopment