'gallery', 'title' => 'Fisheye Gallery', 'description' => KernelTools::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= }', 'plugin_type' => DATA_PLUGIN, // display icon in quicktags bar 'booticon' => '{biticon ipackage="icons" iname="image-x-generic" iexplain="Image"}', 'taginsert' => '{gallery id= size= nolink=}', // functions 'help_function' => 'data_gallery_help', 'load_function' => 'data_gallery', ]; $gLibertySystem->registerPlugin( PLUGIN_GUID_DATAGALLERY, $pluginParams ); $gLibertySystem->registerDataTag( $pluginParams['tag'], PLUGIN_GUID_DATAGALLERY ); function data_gallery( $pData, $pParams ) { global $gBitSystem, $gBitSmarty; $ret = ' '; $imgStyle = ''; $wrapper = \Bitweaver\Liberty\liberty_plugins_wrapper_style( $pParams ); $description = !isset( $wrapper['description'] ) ? $wrapper['description'] : null; foreach( $pParams as $key => $value ) { if( !empty( $value ) ) { switch( $key ) { // rename a couple of parameters case 'width': case 'height': if( preg_match( "/^\d+(em|px|%|pt)$/", trim( $value ) ) ) { $imgStyle .= $key.':'.$value.';'; } elseif( preg_match( "/^\d+$/", $value ) ) { $imgStyle .= $key.':'.$value.'px;'; } // remove values from the hash that they don't get used in the div as well $pParams[$key] = null; break; } } } $wrapper = \Bitweaver\Liberty\liberty_plugins_wrapper_style( $pParams ); if( !empty( $pParams['src'] ) ) { $thumbUrl = $pParams['src']; } elseif( BitBase::verifyId( $pParams['id'] ) && $gBitSystem->isPackageActive( 'fisheye' )) { require_once FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php'; $gallery = new FisheyeImage(); $listHash = $pParams; $listHash['size'] = 'small'; $listHash['gallery_id'] = $pParams['id']; $listHash['max_records'] = 3; $listHash['sort_mode'] = 'random'; $images = $gallery->getList( $listHash ); $out = '
| ' . KernelTools::tra( "Key" ) . ' | ' .'' . KernelTools::tra( "Type" ) . ' | ' .'' . KernelTools::tra( "Comments" ) . ' | ' .'
|---|---|---|
| id | ' .'' . KernelTools::tra( "numeric") . ' ' . KernelTools::tra("(required)") . ' | '
.'' . KernelTools::tra( "gallery id number of Images to display inline.") . KernelTools::tra( "You can use either content_id or id." ).' | ' .'
| size | ' .'' . KernelTools::tra( "key-words") . ' ' . KernelTools::tra("(optional)") . ' | '
.'' . KernelTools::tra( "If the File is an image, you can specify the size of the thumbnail displayed. Possible values are:") . ' avatar, small, medium, large, original ' . KernelTools::tra( "(Default = " ) . 'medium) | ' .'
| nolink | ' .'' . KernelTools::tra( "key-words") . ' ' . KernelTools::tra("(optional)") . ' | '
.'' . KernelTools::tra( "Remove hotlink from element. Used to display fixed copies of an image item.") . ' | ' .'
| num | ' .'' . KernelTools::tra( "key-words") . ' ' . KernelTools::tra("(optional)") . ' | '
.'' . KernelTools::tra( "Number of images to display from the gallery") . KernelTools::tra( "(Default = " ) . '3) | ' .'