From 1bce7ec7ec2822e07a4240c459085c9ed1468e0c Mon Sep 17 00:00:00 2001 From: onli Date: Thu, 29 May 2014 21:54:26 +0200 Subject: [PATCH] Make ML available after upload and filter-change (#138) --- include/admin/images.inc.php | 11 ++++++++--- templates/2k11/admin/images.inc.tpl | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index 8bdfa4b5..ff282f84 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -161,7 +161,7 @@ switch ($serendipity['GET']['adminAction']) { $properties = serendipity_parsePropertyForm(); $image_id = $properties['image_id']; $created_thumbnail = true; - $data['showML_add'] = showMediaLibrary($messages, true); + $data['showML'] = showMediaLibrary($messages, true); break; } @@ -359,7 +359,7 @@ switch ($serendipity['GET']['adminAction']) { foreach($new_media AS $nm) { serendipity_insertMediaProperty('base_hidden', '', $nm['image_id'], $hidden); } - $data['showML_add'] = showMediaLibrary(null, true); + $data['showML'] = showMediaLibrary(null, true); } $data['messages'] = $messages; break; @@ -675,7 +675,7 @@ switch ($serendipity['GET']['adminAction']) { default: $data['case_default'] = true; - $data['showML_def'] = showMediaLibrary(); + $data['showML'] = showMediaLibrary(); break; } @@ -716,6 +716,11 @@ function showMediaLibrary($messages=false, $addvar_check = false, $smarty_vars = return $output; } +if (! isset($data['showML'])) { + // alaways having the ML available is useful when switchting the filter after adding an image, thus being i nthe add-case + $data['showML'] = showMediaLibrary(); +} + $data['get']['fid'] = $serendipity['GET']['fid']; // don't trust {$smarty.get.vars} if not proofed, as we often change GET vars via serendipty['GET'] by runtime $data['get']['only_path'] = $serendipity['GET']['only_path']; // we dont need other GET vars in images.inc.tpl diff --git a/templates/2k11/admin/images.inc.tpl b/templates/2k11/admin/images.inc.tpl index 8bac2dc2..8b45894d 100644 --- a/templates/2k11/admin/images.inc.tpl +++ b/templates/2k11/admin/images.inc.tpl @@ -61,7 +61,7 @@ {else} - {$showML_add} + {$showML} {/if} {/if} {if $case_directoryDoDelete} @@ -290,5 +290,5 @@ {/if} {if $case_default} - {if $showML_def}{$showML_def}{/if} + {if $showML}{$showML}{/if} {/if}