Source for file data.image.php
Documentation is available at data.image.php
* @subpackage plugins_storage
define( 'PLUGIN_GUID_DATAIMAGE', 'dataimage' );
'title' => 'Fisheye Image',
'description' => tra( "Display an image in other content. This plugin only works with files that have been uploaded using fisheye." ),
'help_page' => 'DataPluginImage',
'auto_activate' => FALSE,
'requires_pair' => FALSE,
'syntax' => '{image id= }',
// display icon in quicktags bar
'booticon' => '{booticon iname="icon-picture" iexplain="Image"}',
'taginsert' => '{image id= size= nolink=}',
'help_function' => 'data_image_help',
'load_function' => 'data_image',
global $gBitSystem, $gBitSmarty;
$description = !isset ( $wrapper['description'] ) ? $wrapper['description'] : NULL;
foreach( $pParams as $key => $value ) {
// rename a couple of parameters
$imgStyle .= $key. ':'. $value. ';';
$imgStyle .= $key. ':'. $value. 'px;';
// remove values from the hash that they don't get used in the div as well
if( !empty( $pParams['src'] ) ) {
$thumbUrl = $pParams['src'];
} elseif( @BitBase::verifyId( $pParams['id'] ) && $gBitSystem->isPackageActive( 'fisheye' )) {
require_once( FISHEYE_PKG_PATH. 'FisheyeImage.php' );
$gBitSmarty->loadPlugin( 'smarty_modifier_display_bytes' );
// insert source url if we need the original file
if( !empty( $pParams['size'] ) && $pParams['size'] == 'original' ) {
} elseif( $item->mInfo['thumbnail_url'] ) {
$thumbUrl = ( !empty( $pParams['size'] ) && !empty( $item->mInfo['thumbnail_url'][$pParams['size']] ) ? $item->mInfo['thumbnail_url'][$pParams['size']] : $item->mInfo['thumbnail_url']['medium'] );
if( empty( $description ) ) {
$description = !isset ( $wrapper['description'] ) ? $wrapper['description'] : $item->getField( 'title', tra( 'Image' ) );
// check if we have a valid thumbnail
if( !empty( $thumbUrl )) {
' alt="'. $description. '"'.
' title="'. $description. '"'.
' style="'. $imgStyle. '"'.
if( !empty( $pParams['nolink'] ) ) {
} elseif( !empty( $wrapper['link'] ) ) {
// if this image is linking to something, wrap the image with the <a>
$ret = '<a href="'. trim( $wrapper['link'] ). '">'. $ret. '</a>';
} elseif ( empty( $pParams['size'] ) || $pParams['size'] != 'original' ) {
if ( $gBitSystem->isFeatureActive( 'site_fancy_zoom' ) and !empty( $item->mInfo['source_url'] ) ) {
$ret = '<a href="'. trim( str_replace(' ', '%20', $item->mInfo['source_url'] ) ). '">'. $ret. '</a>';
} else if ( !empty( $item->mInfo['media_url'] ) ) {
$ret = '<a href="'. trim( $item->mInfo['media_url'] ). '">'. $ret. '</a>';
if( !empty( $wrapper['style'] ) || !empty( $class ) || !empty( $wrapper['description'] ) ) {
$ret = '<'. $wrapper['wrapper']. ' class="'. ( !empty( $wrapper['class'] ) ? $wrapper['class'] : "img-plugin" ). '" style="'. $wrapper['style']. '">'. $ret. ( !empty( $wrapper['description'] ) ? '<br />'. $wrapper['description'] : '' ). '</'. $wrapper['wrapper']. '>';
$ret = tra( "Unknown Image" );
'<table class="data help">'
. '<th>' . tra( "Key" ) . '</th>'
. '<th>' . tra( "Type" ) . '</th>'
. '<th>' . tra( "Comments" ) . '</th>'
. '<td>' . tra( "numeric") . '<br />' . tra("(required)") . '</td>'
. '<td>' . tra( "Image id number of Image to display inline.") . tra( "You can use either content_id or id." ). '</td>'
. '<td>' . tra( "key-words") . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "If the File is an image, you can specify the size of the thumbnail displayed. Possible values are:") . ' <strong>avatar, small, medium, large, original</strong> '
. tra( "(Default = " ) . '<strong>medium</strong>)</td>'
. '<td>' . tra( "key-words") . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Remove hotlink from element. Used to display fixed copies of an image item.") . '</td>'
. tra( "Example: ") . "{image id='13' size='small'}";
|