mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
imageselector/preview shortcodes small improvements (full rewrite is coming when media manager is ready)
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
|
|
||||||
// $Id: imagepreview.sc,v 1.3 2009-11-18 09:32:31 secretr Exp $
|
// $Id: imagepreview.sc,v 1.4 2009-11-28 15:31:08 secretr Exp $
|
||||||
global $e107;
|
|
||||||
|
|
||||||
list($name, $width, $height) = explode("|",$parm, 3);
|
list($name, $width, $height) = explode("|",$parm, 3);
|
||||||
|
|
||||||
$name = varset($name);//avoid warnings
|
$name = varset($name);//avoid warnings
|
||||||
@@ -9,10 +7,18 @@ if(varset($width))
|
|||||||
{
|
{
|
||||||
$width = " width: {$width};";
|
$width = " width: {$width};";
|
||||||
}
|
}
|
||||||
|
else $width = '';
|
||||||
if(varset($height))
|
if(varset($height))
|
||||||
{
|
{
|
||||||
$height = " height: {$height};";
|
$height = " height: {$height};";
|
||||||
}
|
}
|
||||||
|
else $height = '';
|
||||||
|
$path = (varset($_POST[$name]) && defsettrue('e_AJAX_REQUEST')) ? e107::getParser()->replaceConstants($_POST[$name], 'full') : '';
|
||||||
|
$hide = '';
|
||||||
|
|
||||||
$path = (varset($_POST[$name]) && defsettrue('e_AJAX_REQUEST')) ? $e107->tp->replaceConstants($_POST[$name], 'full') : e_IMAGE_ABS."generic/blank.gif";
|
if(!$path)
|
||||||
return "<a href='{$path}' rel='external' class='e-image-preview'><img src='{$path}' alt=\"\" class='image-selector' style='{$width}{$height}' /></a>";
|
{
|
||||||
|
$path = e_IMAGE_ABS."generic/blank.gif";
|
||||||
|
$hide = 'display: none;';
|
||||||
|
}
|
||||||
|
return "<a href='{$path}' rel='external' class='e-image-preview'><img src='{$path}' alt=\"\" class='image-selector' style='{$width}{$height}{$hide}' /></a>";
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
// $Id: imageselector.sc,v 1.10 2009-11-18 09:32:31 secretr Exp $
|
// $Id: imageselector.sc,v 1.11 2009-11-28 15:31:08 secretr Exp $
|
||||||
//FIXME - full rewrite, backward compatible
|
//FIXME - full rewrite, backward compatible
|
||||||
global $sql,$parm,$tp;
|
global $sql,$parm,$tp;
|
||||||
|
|
||||||
@@ -87,9 +87,11 @@ if($scaction == 'select' || $scaction == 'all')
|
|||||||
if($scaction == 'select') return $text;
|
if($scaction == 'select') return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hide = '';
|
||||||
if(!$pvw_default)
|
if(!$pvw_default)
|
||||||
{
|
{
|
||||||
$pvw_default = ($default) ? $path.$default : e_IMAGE_ABS."generic/blank.gif";
|
$pvw_default = ($default) ? $path.$default : e_IMAGE_ABS."generic/blank.gif";
|
||||||
|
$hide = 'display: none;';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -104,9 +106,9 @@ else
|
|||||||
{
|
{
|
||||||
$text .= "<a href='{$pvw_default}' rel='external' class='e-image-preview'>";
|
$text .= "<a href='{$pvw_default}' rel='external' class='e-image-preview'>";
|
||||||
}
|
}
|
||||||
if(vartrue($height)) $height = "height:{$height}";
|
if(vartrue($height)) $height = "height:{$height};";
|
||||||
if(vartrue($width)) $width = "width:{$width}; ";
|
if(vartrue($width)) $width = "width:{$width}; ";
|
||||||
$text .= "<img src='{$pvw_default}' alt='' style='{$width}{$height}' /></a>";
|
$text .= "<img src='{$pvw_default}' alt='' style='{$width}{$height}{$hide}' /></a>";
|
||||||
|
|
||||||
$text .= "</div>\n";
|
$text .= "</div>\n";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user