Archived
1
0

Image selector toggled by showMediaToolbar

And $media.manage in the templates
This commit is contained in:
onli
2014-01-23 23:33:23 +01:00
parent a6f0e97ed3
commit fa5af4a1ec
6 changed files with 11 additions and 10 deletions
+2 -1
View File
@@ -94,4 +94,5 @@ trackback-functions still use echo for messages"):
* Added option simpleFilters (meant to indicate to show less filters and poweruser-options) * Added option simpleFilters (meant to indicate to show less filters and poweruser-options)
* serendipity_admin_image_selector.php no longer used by 2k11, instead the media library (with admin/media_choose.tpl, admin/media_upload.tpl, media_pane.tpl, media_items.tpl) * serendipity_admin_image_selector.php no longer used by 2k11, instead the media library (with admin/media_choose.tpl, admin/media_upload.tpl, media_pane.tpl, media_items.tpl)
can generat the imageselector on its own. The editor calls serendipity_admin.php?serendipity[adminModule]=media isntead, with serendipity[textarea] indicating the target can generat the imageselector on its own. The editor calls serendipity_admin.php?serendipity[adminModule]=media instead, with serendipity[textarea] indicating the target, and
serendipity[showMediaToolbar] activating the imageSelector modus
+2 -1
View File
@@ -556,7 +556,8 @@ switch ($serendipity['GET']['adminAction']) {
'max_file_size' => $serendipity['maxFileSize'], 'max_file_size' => $serendipity['maxFileSize'],
'maxImgHeight' => $serendipity['maxImgHeight'], 'maxImgHeight' => $serendipity['maxImgHeight'],
'maxImgWidth' => $serendipity['maxImgWidth'], 'maxImgWidth' => $serendipity['maxImgWidth'],
'extraParems' => serendipity_generateImageSelectorParems() 'extraParems' => serendipity_generateImageSelectorParems(),
'manage' => isset($serendipity['GET']['showMediaToolbar']) ? serendipity_db_bool($serendipity['GET']['showMediaToolbar']) : true
); );
// ToDo later: merge $data and $media // ToDo later: merge $data and $media
$serendipity['smarty']->assign('media', $mediaFiles); $serendipity['smarty']->assign('media', $mediaFiles);
+2 -2
View File
@@ -1432,7 +1432,7 @@ function serendipity_calculate_aspect_size($width, $height, $size, $constraint =
* @access public * @access public
* @param int The current page number * @param int The current page number
* @param string The HTML linebreak to use after a row of images * @param string The HTML linebreak to use after a row of images
* @param boolean Should the toolbar for editing media files be shown? * @param boolean Is this the ML-Version for managing everything (true), or is it about selecting one image for the editor? (false)
* @param string The URL to use for pagination * @param string The URL to use for pagination
* @param boolean Show the "upload media item" feature? * @param boolean Show the "upload media item" feature?
* @param boolean Restrict viewing images to a specific directory * @param boolean Restrict viewing images to a specific directory
@@ -1658,7 +1658,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
function serendipity_generateImageSelectorParems() { function serendipity_generateImageSelectorParems() {
global $serendipity; global $serendipity;
$sortParams = array('perpage', 'order', 'ordermode'); $sortParams = array('perpage', 'order', 'ordermode');
$importParams = array('adminModule', 'htmltarget', 'filename_only', 'textarea', 'subpage', 'keywords', 'noBanner', 'noSidebar', 'noFooter', 'showUpload'); $importParams = array('adminModule', 'htmltarget', 'filename_only', 'textarea', 'subpage', 'keywords', 'noBanner', 'noSidebar', 'noFooter', 'showUpload','showMediaToolbar');
$extraParems = ''; $extraParems = '';
$filterParams = array('only_path', 'only_filename'); $filterParams = array('only_path', 'only_filename');
+1 -1
View File
@@ -1,5 +1,5 @@
{foreach from=$media.files item="file" name="mediafiles" key="mediakey"} {foreach from=$media.files item="file" name="mediafiles" key="mediakey"}
{if $smarty.get.serendipity.showUpload} {if NOT $media.manage}
{* ML got called for inserting media *} {* ML got called for inserting media *}
<article class="media_wrap_thumb {cycle values="odd,even"}"> <article class="media_wrap_thumb {cycle values="odd,even"}">
<div class="media_file_thumb{if $media.enclose} equal_heights{/if}"> <div class="media_file_thumb{if $media.enclose} equal_heights{/if}">
+3 -4
View File
@@ -153,7 +153,8 @@
{else} {else}
{if $smarty.get.serendipity.showUpload} {if $smarty.get.serendipity.showUpload}
<a class="button_link" href="?serendipity[adminModule]=media&serendipity[adminAction]=addSelect&{$media.extraParems}">{$CONST.ADD_MEDIA}</a> <a class="button_link" href="?serendipity[adminModule]=media&serendipity[adminAction]=addSelect&{$media.extraParems}">{$CONST.ADD_MEDIA}</a>
{else} {/if}
{if $media.manage}
<form id="formMultiDelete" name="formMultiDelete" action="?" method="post"> <form id="formMultiDelete" name="formMultiDelete" action="?" method="post">
{$media.token} {$media.token}
<input name="serendipity[action]" type="hidden" value="admin"> <input name="serendipity[action]" type="hidden" value="admin">
@@ -174,13 +175,11 @@
</nav> </nav>
{/if} {/if}
</div> </div>
{if NOT $smarty.get.serendipity.showUpload} {if $media.manage}
{if $media.manage}
<div class="form_buttons"> <div class="form_buttons">
<input class="invert_selection" name="toggle" type="button" value="{$CONST.INVERT_SELECTIONS}"> <input class="invert_selection" name="toggle" type="button" value="{$CONST.INVERT_SELECTIONS}">
<input class="state_cancel" name="toggle" type="submit" value="{$CONST.DELETE}"> <input class="state_cancel" name="toggle" type="submit" value="{$CONST.DELETE}">
</div> </div>
{/if}
</form> </form>
{/if} {/if}
{/if} {/if}
+1 -1
View File
@@ -70,7 +70,7 @@
<input id="all_authors" name="serendipity[all_authors]" type="hidden" value="true" checked="checked"> <input id="all_authors" name="serendipity[all_authors]" type="hidden" value="true" checked="checked">
<input class="check_inputs" type="submit" value="{$CONST.GO}"> <input class="check_inputs" type="submit" value="{$CONST.GO}">
{if NOT $smarty.get.serendipity.showUpload} {if $media.manage}
<input class="check_inputs" name="go_properties" type="submit" value="{$CONST.GO_ADD_PROPERTIES|@escape}"> <input class="check_inputs" name="go_properties" type="submit" value="{$CONST.GO_ADD_PROPERTIES|@escape}">
{/if} {/if}
</div> </div>