From b18effe57ee3e86d4ad6428c46ae66e9966d5c7f Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 2 Jun 2015 20:29:52 +0200 Subject: [PATCH] add lightbox option to imagesidebar --- serendipity_plugin_imagesidebar/ChangeLog | 1 + .../UTF-8/lang_de.inc.php | 29 +++++++---- .../lang_de.inc.php | 7 +-- .../lang_en.inc.php | 6 ++- .../media_sidebar.php | 52 +++++++++++++------ .../serendipity_plugin_imagesidebar.php | 7 +-- 6 files changed, 70 insertions(+), 32 deletions(-) create mode 100644 serendipity_plugin_imagesidebar/ChangeLog diff --git a/serendipity_plugin_imagesidebar/ChangeLog b/serendipity_plugin_imagesidebar/ChangeLog new file mode 100644 index 00000000..e2b713de --- /dev/null +++ b/serendipity_plugin_imagesidebar/ChangeLog @@ -0,0 +1 @@ +0.98 - add lightbox option for media_sidebar "In Page" only \ No newline at end of file diff --git a/serendipity_plugin_imagesidebar/UTF-8/lang_de.inc.php b/serendipity_plugin_imagesidebar/UTF-8/lang_de.inc.php index d85adda9..50cb6da7 100644 --- a/serendipity_plugin_imagesidebar/UTF-8/lang_de.inc.php +++ b/serendipity_plugin_imagesidebar/UTF-8/lang_de.inc.php @@ -1,10 +1,21 @@ - (without <>) for lightbox usage. This will be appended to the image anchor. This works for select option "Behavior of image link" -> "In Page" only. Use with care.'); + + ?> \ No newline at end of file diff --git a/serendipity_plugin_imagesidebar/media_sidebar.php b/serendipity_plugin_imagesidebar/media_sidebar.php index 4a993d81..25eaa4f2 100644 --- a/serendipity_plugin_imagesidebar/media_sidebar.php +++ b/serendipity_plugin_imagesidebar/media_sidebar.php @@ -1,10 +1,24 @@ -get_config('media_hotlinks_only','no')== 'no') { + if ($this->get_config('media_hotlinks_only','no') == 'no') { $select['gallery'] = ALL_DIRECTORIES; $paths = serendipity_traversePath($serendipity['serendipityPath'] . $serendipity['uploadPath']); foreach ( $paths as $folder ) { @@ -61,13 +75,20 @@ class media_sidebar extends subplug_sidebar { if (class_exists('serendipity_event_usergallery')){ $select["gallery"] = PLUGIN_SIDEBAR_MEDIASIDEBAR_LINKBEHAVIOR_GALLERY; } - $propbag->add('type', 'select'); - $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_LINKBEHAVIOR_NAME); - $propbag->add('description', PLUGIN_SIDEBAR_MEDIASIDEBAR_LINKBEHAVIOR_DESC); + $propbag->add('type', 'select'); + $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_LINKBEHAVIOR_NAME); + $propbag->add('description', PLUGIN_SIDEBAR_MEDIASIDEBAR_LINKBEHAVIOR_DESC); $propbag->add('select_values', $select); - $propbag->add('default', 'inpage'); + $propbag->add('default', 'inpage'); break; + case 'media_lightbox': + $propbag->add('type', 'string'); + $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_LIGHTBOX_NAME); + $propbag->add('description', PLUGIN_SIDEBAR_MEDIASIDEBAR_LIGHTBOX_DESC); + $propbag->add('default', ''); + break; + case 'media_fixed_width': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_WIDTH_NAME); @@ -75,7 +96,6 @@ class media_sidebar extends subplug_sidebar { $propbag->add('default', '162'); break; - case 'media_url': if ($this->get_config('media_linkbehavior') == 'url') { $propbag->add('type', 'string'); @@ -112,19 +132,19 @@ class media_sidebar extends subplug_sidebar { break; case 'media_hotlinks_only': - $propbag->add('type', 'radio'); - $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_HOTLINKS_NAME); - $propbag->add('description', PLUGIN_SIDEBAR_MEDIASIDEBAR_HOTLINKS_DESC); + $propbag->add('type', 'radio'); + $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_HOTLINKS_NAME); + $propbag->add('description', PLUGIN_SIDEBAR_MEDIASIDEBAR_HOTLINKS_DESC); $propbag->add('radio', array( 'value' => array('yes','no'), 'desc' => array(YES,NO) )); - $propbag->add('radio_per_row', '2'); - $propbag->add('default', 'no'); + $propbag->add('radio_per_row', '2'); + $propbag->add('default', 'no'); break; case 'media_hotlink_base': - if ($this->get_config('media_hotlinks_only','no')== 'yes') { + if ($this->get_config('media_hotlinks_only','no') == 'yes') { $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_SIDEBAR_MEDIASIDEBAR_HOTLINKBASE_NAME); $propbag->add('description', PLUGIN_SIDEBAR_MEDIASIDEBAR_HOTLINKBASE_DESC); @@ -219,7 +239,7 @@ class media_sidebar extends subplug_sidebar { $thumb_path = $serendipity['serendipityHTTPPath'].$serendipity['uploadPath'].$image['path'].$image['name'].'.'.$image['thumbnail_name'].'.'.$image['extension']; if (!serendipity_isImage($image)) { $thumb_path = serendipity_getTemplateFile('admin/img/mime_unknown.png'); - $width_str =''; + $width_str = ''; } } @@ -251,7 +271,7 @@ class media_sidebar extends subplug_sidebar { break; case 'inpage': default: - $output_str .= ''; + $output_str .= 'get_config('media_lightbox', '') . ' href="'.$image_path.'">'; break; } $output_str .= ''; diff --git a/serendipity_plugin_imagesidebar/serendipity_plugin_imagesidebar.php b/serendipity_plugin_imagesidebar/serendipity_plugin_imagesidebar.php index 2d237b73..bbea876f 100644 --- a/serendipity_plugin_imagesidebar/serendipity_plugin_imagesidebar.php +++ b/serendipity_plugin_imagesidebar/serendipity_plugin_imagesidebar.php @@ -1,4 +1,4 @@ -add('description', PLUGIN_SIDEBAR_IMAGESIDEBAR_DESC); $propbag->add('stackable', true); $propbag->add('author', 'Andrew Brown (Menalto code), Matthew Groeninger (Unified/Media Lib. Code), Stefan Lange-Hegermann (Zooomr Code), Matthew Maude (Coppermine code)'); - $propbag->add('version', '0.97.1'); + $propbag->add('version', '0.98'); $propbag->add('license', 'BSD'); $propbag->add('requirements', array( 'serendipity' => '0.8', @@ -133,11 +133,12 @@ class serendipity_plugin_imagesidebar extends serendipity_plugin { $propbag->add('select_values', $select); $propbag->add('default', 'none'); break; + } //normal until here... here we add the sub_plugins config array to the main plugin. if (is_object($this->object_extend)) { - $this->object_extend->introspect_config_item_custom($name, $propbag); + $this->object_extend->introspect_config_item_custom($name, $propbag); } return true; }