Make ML available after upload and filter-change (#138)

This commit is contained in:
onli 2014-05-29 21:54:26 +02:00
parent 39d5ceaa03
commit 1bce7ec7ec
2 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -61,7 +61,7 @@
<script>location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";</script>
<noscript><a class="button_link icon_link standalone" href="?serendipity[adminModule]=images&amp;serendipity[adminAction]=default">{$CONST.DONE}</a></noscript>
{else}
{$showML_add}
{$showML}
{/if}
{/if}
{if $case_directoryDoDelete}
@ -290,5 +290,5 @@
</div>
{/if}
{if $case_default}
{if $showML_def}{$showML_def}{/if}
{if $showML}{$showML}{/if}
{/if}