summaryrefslogtreecommitdiff
path: root/liberty_plugins/data.gallery.php
diff options
context:
space:
mode:
Diffstat (limited to 'liberty_plugins/data.gallery.php')
-rwxr-xr-x[-rw-r--r--]liberty_plugins/data.gallery.php68
1 files changed, 38 insertions, 30 deletions
diff --git a/liberty_plugins/data.gallery.php b/liberty_plugins/data.gallery.php
index 92b270c..5560a5e 100644..100755
--- a/liberty_plugins/data.gallery.php
+++ b/liberty_plugins/data.gallery.php
@@ -7,29 +7,39 @@
*/
/**
+ * required setup
+ */
+namespace Bitweaver\Liberty;
+use Bitweaver\Fisheye\FisheyeImage;
+use Bitweaver\BitBase;
+use Bitweaver\KernelTools;
+
+/**
* definitions
*/
define( 'PLUGIN_GUID_DATAGALLERY', 'datagallery' );
+
global $gLibertySystem;
-$pluginParams = array (
+
+$pluginParams = [
'tag' => 'gallery',
'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." ),
+ '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,
+ 'auto_activate' => false,
+ 'requires_pair' => false,
'syntax' => '{gallery id= }',
'plugin_type' => DATA_PLUGIN,
// display icon in quicktags bar
- 'booticon' => '{booticon iname="fa-image-landscape" iexplain="Image"}',
+ 'booticon' => '{booticon iname="icon-picture" 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 );
@@ -40,9 +50,9 @@ function data_gallery( $pData, $pParams ) {
$imgStyle = '';
- $wrapper = liberty_plugins_wrapper_style( $pParams );
+ $wrapper = \Bitweaver\Liberty\liberty_plugins_wrapper_style( $pParams );
- $description = !isset( $wrapper['description'] ) ? $wrapper['description'] : NULL;
+ $description = !isset( $wrapper['description'] ) ? $wrapper['description'] : null;
foreach( $pParams as $key => $value ) {
if( !empty( $value ) ) {
switch( $key ) {
@@ -55,19 +65,18 @@ function data_gallery( $pData, $pParams ) {
$imgStyle .= $key.':'.$value.'px;';
}
// remove values from the hash that they don't get used in the div as well
- $pParams[$key] = NULL;
+ $pParams[$key] = null;
break;
}
}
}
- $wrapper = liberty_plugins_wrapper_style( $pParams );
+ $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' );
- $gBitSmarty->loadPlugin( 'smarty_modifier_display_bytes' );
+ } elseif( BitBase::verifyId( $pParams['id'] ) && $gBitSystem->isPackageActive( 'fisheye' )) {
+ require_once FISHEYE_PKG_CLASS_PATH.'FisheyeImage.php';
$gallery = new FisheyeImage();
$listHash = $pParams;
@@ -113,7 +122,7 @@ $out = '<div>';
$ret = '<'.$wrapper['wrapper'].' class="'.( !empty( $wrapper['class'] ) ? $wrapper['class'] : "img-responsive" ).'" style="'.$wrapper['style'].'">'.$ret.( !empty( $wrapper['description'] ) ? '<br />'.$wrapper['description'] : '' ).'</'.$wrapper['wrapper'].'>';
}
} else {
- $ret = tra( "Unknown Gallery" );
+ $ret = KernelTools::tra( "Unknown Gallery" );
}
$out .= $ret;
}
@@ -126,34 +135,33 @@ function data_gallery_help() {
$help =
'<table class="data help">'
.'<tr>'
- .'<th>' . tra( "Key" ) . '</th>'
- .'<th>' . tra( "Type" ) . '</th>'
- .'<th>' . tra( "Comments" ) . '</th>'
+ .'<th>' . KernelTools::tra( "Key" ) . '</th>'
+ .'<th>' . KernelTools::tra( "Type" ) . '</th>'
+ .'<th>' . KernelTools::tra( "Comments" ) . '</th>'
.'</tr>'
.'<tr class="odd">'
.'<td>id</td>'
- .'<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>' . KernelTools::tra( "numeric") . '<br />' . KernelTools::tra("(required)") . '</td>'
+ .'<td>' . KernelTools::tra( "gallery id number of Images to display inline.") . KernelTools::tra( "You can use either content_id or id." ).'</td>'
.'</tr>'
.'<tr class="even">'
.'<td>size</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>' . KernelTools::tra( "key-words") . '<br />' . KernelTools::tra("(optional)") . '</td>'
+ .'<td>' . KernelTools::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> '
+ . KernelTools::tra( "(Default = " ) . '<strong>medium</strong>)</td>'
.'</tr>'
.'<tr class="odd">'
.'<td>nolink</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>' . KernelTools::tra( "key-words") . '<br />' . KernelTools::tra("(optional)") . '</td>'
+ .'<td>' . KernelTools::tra( "Remove hotlink from element. Used to display fixed copies of an image item.") . '</td>'
.'</tr>'
.'<tr class="even">'
.'<td>num</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>'
+ .'<td>' . KernelTools::tra( "key-words") . '<br />' . KernelTools::tra("(optional)") . '</td>'
+ .'<td>' . KernelTools::tra( "Number of images to display from the gallery")
+ . KernelTools::tra( "(Default = " ) . '<strong>3</strong>)</td>'
.'</tr>'
.'</table>'
- . tra( "Example: ") . "{gallery id='13' size='small'}";
+ . KernelTools::tra( "Example: ") . "{gallery id='13' size='small'}";
return $help;
-}
-?>
+} \ No newline at end of file