Source for file data.gallery.php
Documentation is available at data.gallery.php
* @subpackage plugins_storage
define( 'PLUGIN_GUID_DATAGALLERY', 'datagallery' );
'title' => 'Fisheye Gallery',
'description' => tra( "Display a list of images in other content. This plugin only works with files that have been uploaded using fisheye." ),
'help_page' => 'DataPluginGallery',
'auto_activate' => FALSE,
'requires_pair' => FALSE,
'syntax' => '{gallery id= }',
// display icon in quicktags bar
'booticon' => '{booticon iname="icon-picture" iexplain="Image"}',
'taginsert' => '{gallery id= size= nolink=}',
'help_function' => 'data_gallery_help',
'load_function' => 'data_gallery',
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' );
$listHash['size'] = 'small';
$listHash['gallery_id'] = $pParams['id'];
$listHash['max_records'] = 3;
$listHash['sort_mode'] = 'random';
$images = $gallery->getList( $listHash );
foreach( $images as $image ) {
// insert source url if we need the original file
if( !empty( $pParams['size'] ) && $pParams['size'] == 'original' ) {
$thumbUrl = $image['source_url'];
} elseif( $image['thumbnail_url'] ) {
$thumbUrl = $image['thumbnail_url'];
if( empty( $image['$description'] ) ) {
$description = !isset ( $wrapper['description'] ) ? $wrapper['description'] : $image['title'];
// check if we have a valid thumbnail
if( !empty( $thumbUrl )) {
$ret = '<img class="img-responsive"'.
' alt="'. $description. '"'.
' title="'. $description. '"'.
' style="float:left; '. $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 ( $image['source_url'] ) {
$ret = '<a href="'. trim( $image['source_url'] ). '">'. $ret. '</a>';
if( !empty( $wrapper['style'] ) || !empty( $class ) || !empty( $wrapper['description'] ) ) {
$ret = '<'. $wrapper['wrapper']. ' class="'. ( !empty( $wrapper['class'] ) ? $wrapper['class'] : "img-responsive" ). '" style="'. $wrapper['style']. '">'. $ret. ( !empty( $wrapper['description'] ) ? '<br />'. $wrapper['description'] : '' ). '</'. $wrapper['wrapper']. '>';
$ret = tra( "Unknown Gallery" );
'<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( "gallery id number of Images 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>'
. '<td>' . tra( "key-words") . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Number of images to display from the gallery")
. tra( "(Default = " ) . '<strong>3</strong>)</td>'
. tra( "Example: ") . "{gallery id='13' size='small'}";
|