Allow bulk image MOVE in ML
and give a path information note to the image info layer References #357
This commit is contained in:
parent
a3c567e864
commit
300bdd6f5f
@ -1,6 +1,8 @@
|
|||||||
Version 2.1 ()
|
Version 2.1 ()
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
* Added new bulk image move ability to MediaLibrary
|
||||||
|
|
||||||
* Fix importers to use the new mysqli API extension with PHP 5+
|
* Fix importers to use the new mysqli API extension with PHP 5+
|
||||||
|
|
||||||
* WIP: Added an internal cache to speedup s9y's site generation. Can
|
* WIP: Added an internal cache to speedup s9y's site generation. Can
|
||||||
|
@ -112,6 +112,32 @@ switch ($serendipity['GET']['adminAction']) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// case bulk multimove (leave the fake oldDir being send as an empty dir)
|
||||||
|
if (isset($serendipity['POST']['oldDir']) && !empty($serendipity['POST']['newDir'])) {
|
||||||
|
$messages = array();
|
||||||
|
$multiMoveImages = $serendipity['POST']['multiDelete'];
|
||||||
|
unset($serendipity['POST']['multiDelete']);
|
||||||
|
$oDir = ''; // oldDir is relative to Uploads/, since we can not specify a directory of a ML bulk move
|
||||||
|
$nDir = (string)serendipity_specialchars($serendipity['POST']['newDir']);
|
||||||
|
if ($oDir != $nDir) {
|
||||||
|
foreach($multiMoveImages AS $mkey => $move_id) {
|
||||||
|
$file = serendipity_fetchImageFromDatabase((int)$move_id);
|
||||||
|
$oDir = $file['path']; // this now is the exact oldDir path of this ID
|
||||||
|
if (serendipity_moveMediaDirectory($oDir, $nDir, 'file', (int)$move_id, $file)) {
|
||||||
|
$messages[] = sprintf('<span class="msg_success"><span class="icon-ok-circled"></span> ' . MEDIA_DIRECTORY_MOVED . '</span>', $nDir);
|
||||||
|
} else {
|
||||||
|
$messages[] = sprintf('<span class="msg_error"><span class="icon-attention-circled"></span> ' . MEDIA_DIRECTORY_MOVE_ERROR . '</span>', $nDir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$data['messages'] = $messages;
|
||||||
|
// fall back
|
||||||
|
$data['case_default'] = true;
|
||||||
|
$data['showML'] = showMediaLibrary();
|
||||||
|
unset($messages);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
$ids = '';
|
$ids = '';
|
||||||
$data['rip_image'] = array();
|
$data['rip_image'] = array();
|
||||||
$data['case_multidelete'] = true;
|
$data['case_multidelete'] = true;
|
||||||
|
@ -87,6 +87,7 @@
|
|||||||
<li><b>{$CONST.THUMBNAIL_SHORT}:</b> {$file.dim.0}x{$file.dim.1}</li>
|
<li><b>{$CONST.THUMBNAIL_SHORT}:</b> {$file.dim.0}x{$file.dim.1}</li>
|
||||||
{/if}
|
{/if}
|
||||||
<li><b>{$CONST.IMAGE_SIZE}:</b> {$file.nice_size} KB</li>
|
<li><b>{$CONST.IMAGE_SIZE}:</b> {$file.nice_size} KB</li>
|
||||||
|
<li><b>{$CONST.INSTALL_RELUPLOADPATH}:</b> "{$file.path}"</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -178,6 +178,17 @@
|
|||||||
<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 class="form_select">
|
||||||
|
<label for="newDir">{$CONST.FILTER_DIRECTORY}</label>
|
||||||
|
<input type="hidden" name="serendipity[oldDir]" value="">
|
||||||
|
<select id="newDir" name="serendipity[newDir]">
|
||||||
|
<option value=""></option>
|
||||||
|
{foreach from=$media.paths item="folder"}
|
||||||
|
<option{if ($media.only_path == $media.limit_path|cat:$folder.relpath)} selected{/if} value="{$folder.relpath}">{' '|str_repeat:($folder.depth*2)}{$folder.name}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
<input class="state_submit" name="toggle" type="submit" value="{$CONST.MOVE}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user