Show rescale in ML-popup when toolbar is active (#281)
This commit is contained in:
parent
5985577fbe
commit
9032f24f4b
@ -626,7 +626,7 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
(int)$serendipity['GET']['width'],
|
||||
(int)$serendipity['GET']['height']
|
||||
);
|
||||
|
||||
$data['extraParems'] = serendipity_generateImageSelectorParems();
|
||||
$data['print_serendipity_scaleImg'] = serendipity_scaleImg($serendipity['GET']['fid'], $serendipity['GET']['width'], $serendipity['GET']['height']);
|
||||
break;
|
||||
|
||||
@ -636,7 +636,8 @@ switch ($serendipity['GET']['adminAction']) {
|
||||
if (!is_array($file) || !serendipity_checkPermission('adminImagesDelete') || (!serendipity_checkPermission('adminImagesMaintainOthers') && $file['authorid'] != '0' && $file['authorid'] != $serendipity['authorid'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$data['extraParems'] = serendipity_generateImageSelectorParems("form");
|
||||
$data['case_scaleSelect'] = true;
|
||||
$s = getimagesize($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file['path'] . $file['name'] . ($file['extension'] ? '.'. $file['extension'] : ""));
|
||||
$data['img_width'] = $s[0];
|
||||
@ -727,8 +728,7 @@ if (! isset($data['showML'])) {
|
||||
}
|
||||
|
||||
$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
|
||||
|
||||
$data['get']['only_path'] = $serendipity['GET']['only_path'];
|
||||
|
||||
echo serendipity_smarty_show('admin/images.inc.tpl', $data);
|
||||
|
||||
|
@ -1672,7 +1672,7 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
|
||||
* Generate the url-parameters needed when generating the ML to select an image to add to the editor, to store the relevant options (like which textarea to add it to)
|
||||
*
|
||||
*/
|
||||
function serendipity_generateImageSelectorParems() {
|
||||
function serendipity_generateImageSelectorParems($format="url") {
|
||||
global $serendipity;
|
||||
|
||||
$sortParams = array('perpage', 'order', 'ordermode');
|
||||
@ -1681,22 +1681,23 @@ function serendipity_generateImageSelectorParems() {
|
||||
$filterParams = $serendipity['GET']['filter'] ?: array(); // ?: elvis operator, see http://en.wikipedia.org/wiki/Elvis_operator and upcoming PHP 7 ?? (isset) operator
|
||||
|
||||
$standaloneFilterParams = array('only_path', 'only_filename');
|
||||
$parems = array();
|
||||
|
||||
foreach($importParams AS $importParam) {
|
||||
if (isset($serendipity['GET'][$importParam])) {
|
||||
$extraParems .= 'serendipity[' . $importParam . ']='. serendipity_specialchars($serendipity['GET'][$importParam]) .'&';
|
||||
$parems['serendipity[' . $importParam . ']'] = $serendipity['GET'][$importParam];
|
||||
}
|
||||
}
|
||||
|
||||
foreach($sortParams AS $sortParam) {
|
||||
serendipity_restoreVar($serendipity['COOKIE']['sortorder_' . $sortParam], $serendipity['GET']['sortorder'][$sortParam]);
|
||||
$extraParems .= 'serendipity[sortorder]['. $sortParam .']='. serendipity_specialchars($serendipity['GET']['sortorder'][$sortParam]) .'&';
|
||||
$parems['serendipity[sortorder]['. $sortParam .']'] = $serendipity['GET']['sortorder'][$sortParam];
|
||||
}
|
||||
|
||||
foreach($standaloneFilterParams AS $filterParam) {
|
||||
serendipity_restoreVar($serendipity['COOKIE'][$filterParam], $serendipity['GET'][$filterParam]);
|
||||
if (!empty($serendipity['GET'][$filterParam]) && $serendipity['GET'][$filterParam] != "undefined") {
|
||||
$extraParems .= 'serendipity[' . $filterParam . ']='. serendipity_specialchars($serendipity['GET'][$filterParam]) .'&';
|
||||
$parems['serendipity[' . $filterParam . ']'] = $serendipity['GET'][$filterParam];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1705,13 +1706,20 @@ function serendipity_generateImageSelectorParems() {
|
||||
if (!empty($serendipity['GET']['filter'][$filterParam]) && $serendipity['GET']['filter'][$filterParam] != "undefined") {
|
||||
if (is_array($filterValue)) {
|
||||
foreach($filterValue as $key => $value) {
|
||||
$extraParems .= 'serendipity[filter][' . $filterParam . '][' . $key . ']='. serendipity_specialchars($value) .'&';
|
||||
$parems['serendipity[filter][' . $filterParam . '][' . $key . ']'] = $value;
|
||||
}
|
||||
} else {
|
||||
$extraParems .= 'serendipity[filter][' . $filterParam . ']='. serendipity_specialchars($filterValue) .'&';
|
||||
$parems['serendipity[filter][' . $filterParam . ']'] = $filterValue;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
foreach ($parems as $param => $value) {
|
||||
if ($format == "form") {
|
||||
$extraParems .= '<input type="hidden" name="'. $param .'" value="'. serendipity_specialchars($value) .'" />';
|
||||
} else {
|
||||
$extraParems .= $param.'='. serendipity_specialchars($value) .'&';
|
||||
}
|
||||
}
|
||||
|
||||
return $extraParems;
|
||||
|
@ -245,8 +245,7 @@
|
||||
{if $print_SCALING_IMAGE}<span class="msg_notice"><span class="icon-info-circled"></span> {$print_SCALING_IMAGE}</span>{/if}
|
||||
{if $print_serendipity_scaleImg}<span class="msg_notice"><span class="icon-info-circled"></span> {$print_serendipity_scaleImg}</span>{/if}
|
||||
<span class="msg_notice"><span class="icon-info-circled"></span> {$CONST.DONE}</span>
|
||||
<script>location.href="?serendipity[adminModule]=images&serendipity[adminAction]=default";</script>
|
||||
<noscript><a class="button_link icon_link standalone" href="?serendipity[adminModule]=images&serendipity[adminAction]=default">{$CONST.DONE}</a></noscript>
|
||||
{if $showML}{$showML}{/if}
|
||||
{/if}
|
||||
{if $case_scaleSelect}
|
||||
{if $print_RESIZE_BLAHBLAH}<h2>{$print_RESIZE_BLAHBLAH}</h2>{/if}
|
||||
@ -260,6 +259,7 @@
|
||||
<input name="serendipity[adminModule]" type="hidden" value="images">
|
||||
<input name="serendipity[adminAction]" type="hidden" value="scale">
|
||||
<input name="serendipity[fid]" type="hidden" value="{$get.fid}">
|
||||
{$extraParems}
|
||||
|
||||
<fieldset>
|
||||
<span class="wrap_legend"><legend>{$CONST.NEWSIZE}</legend></span>
|
||||
|
@ -97,8 +97,8 @@
|
||||
<li><a class="media_show_info button_link" href="#media_file_meta_{$file.id}" title="{$CONST.SHOW_METADATA}"><span class="icon-info-circled"></span><span class="visuallyhidden"> {$CONST.SHOW_METADATA}</span></a></li>
|
||||
{if $file.is_editable}
|
||||
<li><button class="media_rename button_link" type="button" title="{$CONST.MEDIA_RENAME}" data-fileid="{$file.id}" data-filename="{$file.name|escape:javascript}"><span class="icon-edit"></span><span class="visuallyhidden"> {$CONST.MEDIA_RENAME}</span></button></li>
|
||||
{if $file.is_image AND NOT $file.hotlink AND $media.manage}
|
||||
<li><a class="media_resize button_link" href="?serendipity[adminModule]=images&serendipity[adminAction]=scaleSelect&serendipity[fname]={$file.name|truncate:30:"…"}&serendipity[fid]={$file.id}'" title="{$CONST.IMAGE_RESIZE}"><span class="icon-resize-full"></span><span class="visuallyhidden"> {$CONST.IMAGE_RESIZE}</span></a></li>
|
||||
{if $file.is_image AND NOT $file.hotlink}
|
||||
<li><a class="media_resize button_link" href="?serendipity[adminModule]=images&serendipity[adminAction]=scaleSelect&serendipity[fname]={$file.name|truncate:30:"…"}&serendipity[fid]={$file.id}{$media.extraParems}" title="{$CONST.IMAGE_RESIZE}"><span class="icon-resize-full"></span><span class="visuallyhidden"> {$CONST.IMAGE_RESIZE}</span></a></li>
|
||||
{/if}
|
||||
{if $file.is_image AND NOT $file.hotlink}
|
||||
<li><a class="media_rotate_left button_link" href="?serendipity[adminModule]=images&serendipity[adminAction]=rotateCCW&serendipity[fid]={$file.id}" title="{$CONST.IMAGE_ROTATE_LEFT}"><span class="icon-ccw"></span><span class="visuallyhidden"> {$CONST.IMAGE_ROTATE_LEFT}</span></a></li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user