Skip to content

Commit 7a802d2

Browse files
committed
closed trippo#230 since RFM 9.12.0
closed trippo#272 since RFM 9.12.0 closed trippo#279 since RFM 9.12.0 fixed trippo#532 optimized code formatting
1 parent 9200cff commit 7a802d2

File tree

2 files changed

+107
-102
lines changed

2 files changed

+107
-102
lines changed

filemanager/dialog.php

Lines changed: 105 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
if (isset($_POST['submit'])) {
2222
include 'upload.php';
2323
} else {
24-
$config['default_language'] = $config['default_language'];
2524
$available_languages = include 'lang/languages.php';
2625

2726
list($preferred_language) = array_values(array_filter(array(
@@ -252,6 +251,7 @@
252251
}
253252
if ($extensions) {
254253
$ext = $ext_tmp;
254+
$config['ext'] = $ext_tmp;
255255
$config['show_filter_buttons'] = false;
256256
}
257257
}
@@ -287,16 +287,16 @@
287287
}
288288

289289
$get_params = array(
290-
'editor' => $editor,
291-
'type' => $type_param,
292-
'lang' => $lang,
293-
'popup' => $popup,
294-
'crossdomain' => $crossdomain,
295-
'extensions' => ($extensions) ? urlencode(json_encode($extensions)) : null ,
296-
'field_id' => $field_id,
297-
'multiple' => $multiple,
298-
'relative_url' => $return_relative_url,
299-
'akey' => (isset($_GET['akey']) && $_GET['akey'] != '' ? $_GET['akey'] : 'key')
290+
'editor' => $editor,
291+
'type' => $type_param,
292+
'lang' => $lang,
293+
'popup' => $popup,
294+
'crossdomain' => $crossdomain,
295+
'extensions' => ($extensions) ? urlencode(json_encode($extensions)) : null ,
296+
'field_id' => $field_id,
297+
'multiple' => $multiple,
298+
'relative_url' => $return_relative_url,
299+
'akey' => (isset($_GET['akey']) && $_GET['akey'] != '' ? $_GET['akey'] : 'key')
300300
);
301301
if (isset($_GET['CKEditorFuncNum'])) {
302302
$get_params['CKEditorFuncNum'] = $_GET['CKEditorFuncNum'];
@@ -323,100 +323,105 @@
323323
<noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
324324
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jplayer/2.2.0/skin/blue.monday/jplayer.blue.monday.min.css" />
325325
<link href="css/style.css?v=<?php echo $version; ?>" rel="stylesheet" type="text/css" />
326-
<!--[if lt IE 8]><style>
327-
.img-container span, .img-container-mini span {
328-
display: inline-block;
329-
height: 100%;
330-
}
331-
</style><![endif]-->
332-
333-
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
334-
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js" type="text/javascript"></script>
335-
<script src="js/plugins.js?v=<?php echo $version; ?>"></script>
336-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.min.js"></script>
337-
<script src="js/modernizr.custom.js"></script>
338-
339-
<?php
340-
if ($config['aviary_active']) {
341-
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
342-
<script src="https://dme0ih8comzn4.cloudfront.net/imaging/v3/editor.js"></script>
343-
<?php } else { ?>
344-
<script src="http://feather.aviary.com/imaging/v3/editor.js"></script>
345-
<?php }
346-
}
347-
?>
326+
<!--[if lt IE 8]>
327+
<style>
328+
.img-container span, .img-container-mini span {
329+
display: inline-block;
330+
height: 100%;
331+
}
332+
</style>
333+
<![endif]-->
348334

349-
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
350-
<!--[if lt IE 9]>
351-
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
352-
<![endif]-->
335+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
336+
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
337+
<script src="js/plugins.js?v=<?php echo $version; ?>"></script>
338+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jplayer/2.9.2/jplayer/jquery.jplayer.min.js"></script>
339+
<script src="js/modernizr.custom.js"></script>
353340

354-
<script>
355-
var ext_img=new Array('<?php echo implode("','", $config['ext_img'])?>');
356-
var image_editor=<?php echo $config['aviary_active']?"true":"false";?>;
357-
if (image_editor) {
358-
var featherEditor = new Aviary.Feather({
359341
<?php
360-
foreach ($config['aviary_defaults_config'] as $aopt_key => $aopt_val) {
361-
echo $aopt_key.": ".json_encode($aopt_val).",";
362-
} ?>
363-
onReady: function() {
364-
hide_animation();
365-
},
366-
onSave: function(imageID, newURL) {
367-
show_animation();
368-
var img = document.getElementById(imageID);
369-
img.src = newURL;
370-
$.ajax({
371-
type: "POST",
372-
url: "ajax_calls.php?action=save_img",
373-
data: { url: newURL, path:$('#sub_folder').val()+$('#fldr_value').val(), name:$('#aviary_img').attr('data-name') }
374-
}).done(function( msg ) {
375-
featherEditor.close();
376-
d = new Date();
377-
$("figure[data-name='"+$('#aviary_img').attr('data-name')+"']").find('img').each(function(){
378-
$(this).attr('src',$(this).attr('src')+"?"+d.getTime());
379-
});
380-
$("figure[data-name='"+$('#aviary_img').attr('data-name')+"']").find('figcaption a.preview').each(function(){
381-
$(this).attr('data-url',$(this).data('url')+"?"+d.getTime());
382-
});
383-
hide_animation();
342+
if ($config['aviary_active']) {
343+
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { ?>
344+
<script src="https://dme0ih8comzn4.cloudfront.net/imaging/v3/editor.js"></script>
345+
<?php } else { ?>
346+
<script src="http://feather.aviary.com/imaging/v3/editor.js"></script>
347+
<?php }
348+
}
349+
?>
350+
351+
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
352+
<!--[if lt IE 9]>
353+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
354+
<![endif]-->
355+
356+
<script>
357+
var ext_img = new Array('<?php echo implode("','", $config['ext_img'])?>');
358+
var image_editor =<?php echo $config['aviary_active'] ? "true" : "false";?>;
359+
if (image_editor) {
360+
var featherEditor = new Aviary.Feather({
361+
<?php
362+
foreach ($config['aviary_defaults_config'] as $aopt_key => $aopt_val) {
363+
echo $aopt_key . ": " . json_encode($aopt_val) . ",";
364+
} ?>
365+
onReady: function () {
366+
hide_animation();
367+
},
368+
onSave: function (imageID, newURL) {
369+
show_animation();
370+
var img = document.getElementById(imageID);
371+
img.src = newURL;
372+
$.ajax({
373+
type: "POST",
374+
url: "ajax_calls.php?action=save_img",
375+
data: {
376+
url: newURL,
377+
path: $('#sub_folder').val() + $('#fldr_value').val(),
378+
name: $('#aviary_img').attr('data-name')
379+
}
380+
}).done(function (msg) {
381+
featherEditor.close();
382+
d = new Date();
383+
$("figure[data-name='" + $('#aviary_img').attr('data-name') + "']").find('img').each(function () {
384+
$(this).attr('src', $(this).attr('src') + "?" + d.getTime());
385+
});
386+
$("figure[data-name='" + $('#aviary_img').attr('data-name') + "']").find('figcaption a.preview').each(function () {
387+
$(this).attr('data-url', $(this).data('url') + "?" + d.getTime());
388+
});
389+
hide_animation();
390+
});
391+
return false;
392+
},
393+
onError: function (errorObj) {
394+
bootbox.alert(errorObj.message);
395+
hide_animation();
396+
}
384397
});
385-
return false;
386-
},
387-
onError: function(errorObj) {
388-
bootbox.alert(errorObj.message);
389-
hide_animation();
390398
}
391-
392-
});
393-
}
394-
</script>
395-
<script src="js/include.js?v=<?php echo $version; ?>"></script>
399+
</script>
400+
<script src="js/include.js?v=<?php echo $version; ?>"></script>
396401
</head>
397402
<body>
398-
<!-- The Templates plugin is included to render the upload/download listings -->
399-
<script src="//blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
400-
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
401-
<script src="//blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
402-
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
403-
<script src="//blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
404-
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
405-
<script src="js/jquery.iframe-transport.js"></script>
406-
<!-- The basic File Upload plugin -->
407-
<script src="js/jquery.fileupload.js"></script>
408-
<!-- The File Upload processing plugin -->
409-
<script src="js/jquery.fileupload-process.js"></script>
410-
<!-- The File Upload image preview & resize plugin -->
411-
<script src="js/jquery.fileupload-image.js"></script>
412-
<!-- The File Upload audio preview plugin -->
413-
<script src="js/jquery.fileupload-audio.js"></script>
414-
<!-- The File Upload video preview plugin -->
415-
<script src="js/jquery.fileupload-video.js"></script>
416-
<!-- The File Upload validation plugin -->
417-
<script src="js/jquery.fileupload-validate.js"></script>
418-
<!-- The File Upload user interface plugin -->
419-
<script src="js/jquery.fileupload-ui.js"></script>
403+
<!-- The Templates plugin is included to render the upload/download listings -->
404+
<script src="//blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
405+
<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
406+
<script src="//blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
407+
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
408+
<script src="//blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
409+
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
410+
<script src="js/jquery.iframe-transport.js"></script>
411+
<!-- The basic File Upload plugin -->
412+
<script src="js/jquery.fileupload.js"></script>
413+
<!-- The File Upload processing plugin -->
414+
<script src="js/jquery.fileupload-process.js"></script>
415+
<!-- The File Upload image preview & resize plugin -->
416+
<script src="js/jquery.fileupload-image.js"></script>
417+
<!-- The File Upload audio preview plugin -->
418+
<script src="js/jquery.fileupload-audio.js"></script>
419+
<!-- The File Upload video preview plugin -->
420+
<script src="js/jquery.fileupload-video.js"></script>
421+
<!-- The File Upload validation plugin -->
422+
<script src="js/jquery.fileupload-validate.js"></script>
423+
<!-- The File Upload user interface plugin -->
424+
<script src="js/jquery.fileupload-ui.js"></script>
420425

421426
<input type="hidden" id="ftp" value="<?php echo !!$ftp; ?>" />
422427
<input type="hidden" id="popup" value="<?php echo $popup;?>" />
@@ -1278,7 +1283,7 @@ function extensionSort($x, $y)
12781283
<!-- lightbox div start -->
12791284
<div id="previewLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
12801285
<div class="lightbox-content">
1281-
<img id="full-img" src="">
1286+
<img id="full-img" src="" alt="">
12821287
</div>
12831288
</div>
12841289
<!-- lightbox div end -->
@@ -1303,7 +1308,7 @@ function extensionSort($x, $y)
13031308
</div>
13041309

13051310
<!-- player div end -->
1306-
<img id='aviary_img' src='' class="hide"/>
1311+
<img class="hide" id="aviary_img" src="" alt="">
13071312
<script>
13081313
var ua = navigator.userAgent.toLowerCase();
13091314
var isAndroid = ua.indexOf("android") > -1; //&& ua.indexOf("mobile");

filemanager/include/utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,11 @@ function check_file_extension($extension, $config)
615615
{
616616
$check = false;
617617
if (!$config['ext_blacklist']) {
618-
if (in_array(mb_strtolower($extension), $conf['ext'])) {
618+
if (in_array(mb_strtolower($extension), $config['ext'])) {
619619
$check = true;
620620
}
621621
} else {
622-
if (!in_array(mb_strtolower($extension), $conf['ext_blacklist'])) {
622+
if (!in_array(mb_strtolower($extension), $config['ext_blacklist'])) {
623623
$check = true;
624624
}
625625
}

0 commit comments

Comments
 (0)