Skip to content

Commit 34e72ea

Browse files
authored
Merge branch 'master' into contextmenu-fix
2 parents 59d0db2 + 38e1dbc commit 34e72ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1403
-253
lines changed

filemanager/UploadHandler.php

Lines changed: 121 additions & 78 deletions
Large diffs are not rendered by default.

filemanager/ajax_calls.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,25 @@
8080
break;
8181
case 'save_img':
8282
$info = pathinfo($_POST['name']);
83+
$image_data = $_POST['url'];
8384

84-
if ((strpos($_POST['url'], 'http://s3.amazonaws.com/feather') !== 0 && strpos($_POST['url'], 'https://s3.amazonaws.com/feather') !== 0)
85-
|| $_POST['name'] != fix_filename($_POST['name'], $config)
86-
|| ! in_array(strtolower($info['extension']), array( 'jpg', 'jpeg', 'png' ))
87-
) {
88-
response(trans('wrong data').AddErrorLocation())->send();
85+
if (preg_match('/^data:image\/(\w+);base64,/', $image_data, $type)) {
86+
$image_data = substr($image_data, strpos($image_data, ',') + 1);
87+
$type = strtolower($type[1]); // jpg, png, gif
88+
89+
$image_data = base64_decode($image_data);
90+
91+
if ($image_data === false) {
92+
response(trans('TUI_Decode_Failed').AddErrorLocation())->send();
93+
exit;
94+
}
95+
} else {
96+
response(trans('').AddErrorLocation())->send();
8997
exit;
9098
}
91-
$image_data = get_file_by_url($_POST['url']);
99+
92100
if ($image_data === false) {
93-
response(trans('Aviary_No_Save').AddErrorLocation())->send();
101+
response(trans('').AddErrorLocation())->send();
94102
exit;
95103
}
96104

filemanager/config/config.php

Lines changed: 121 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,78 @@
398398
'files_without_extension' => false,
399399

400400
/******************
401-
* AVIARY config
401+
* TUI Image Editor config
402402
*******************/
403-
'aviary_active' => true,
404-
'aviary_apiKey' => "2444282ef4344e3dacdedc7a78f8877d",
405-
'aviary_language' => "en",
406-
'aviary_theme' => "light",
407-
'aviary_tools' => "all",
408-
'aviary_maxSize' => "1400",
409-
// Add or modify the Aviary options below as needed - they will be json encoded when added to the configuration so arrays can be utilized as needed
403+
// Add or modify the options below as needed - they will be json encoded when added to the configuration so arrays can be utilized as needed
404+
'tui_active' => true,
405+
'tui_position' => 'bottom',
406+
// 'common.bi.image' => "../assets/images/logo.png",
407+
// 'common.bisize.width' => '70px',
408+
// 'common.bisize.height' => '25px',
409+
'common.backgroundImage' => 'none',
410+
'common.backgroundColor' => '#ececec',
411+
'common.border' => '1px solid #E6E7E8',
412+
413+
// header
414+
'header.backgroundImage' => 'none',
415+
'header.backgroundColor' => '#ececec',
416+
'header.border' => '0px',
417+
418+
// main icons
419+
'menu.normalIcon.path' => 'svg/icon-d.svg',
420+
'menu.normalIcon.name' => 'icon-d',
421+
'menu.activeIcon.path' => 'svg/icon-b.svg',
422+
'menu.activeIcon.name' => 'icon-b',
423+
'menu.disabledIcon.path' => 'svg/icon-a.svg',
424+
'menu.disabledIcon.name' => 'icon-a',
425+
'menu.hoverIcon.path' => 'svg/icon-c.svg',
426+
'menu.hoverIcon.name' => 'icon-c',
427+
'menu.iconSize.width' => '24px',
428+
'menu.iconSize.height' => '24px',
429+
430+
// submenu primary color
431+
'submenu.backgroundColor' => '#ececec',
432+
'submenu.partition.color' => '#000000',
433+
434+
// submenu icons
435+
'submenu.normalIcon.path' => 'svg/icon-d.svg',
436+
'submenu.normalIcon.name' => 'icon-d',
437+
'submenu.activeIcon.path' => 'svg/icon-b.svg',
438+
'submenu.activeIcon.name' => 'icon-b',
439+
'submenu.iconSize.width' => '32px',
440+
'submenu.iconSize.height' => '32px',
441+
442+
// submenu labels
443+
'submenu.normalLabel.color' => '#000',
444+
'submenu.normalLabel.fontWeight' => 'normal',
445+
'submenu.activeLabel.color' => '#000',
446+
'submenu.activeLabel.fontWeight' => 'normal',
447+
448+
// checkbox style
449+
'checkbox.border' => '1px solid #E6E7E8',
450+
'checkbox.backgroundColor' => '#000',
451+
452+
// rango style
453+
'range.pointer.color' => '#333',
454+
'range.bar.color' => '#ccc',
455+
'range.subbar.color' => '#606060',
456+
457+
'range.disabledPointer.color' => '#d3d3d3',
458+
'range.disabledBar.color' => 'rgba(85,85,85,0.06)',
459+
'range.disabledSubbar.color' => 'rgba(51,51,51,0.2)',
460+
461+
'range.value.color' => '#000',
462+
'range.value.fontWeight' => 'normal',
463+
'range.value.fontSize' => '11px',
464+
'range.value.border' => '0',
465+
'range.value.backgroundColor' => '#f5f5f5',
466+
'range.title.color' => '#000',
467+
'range.title.fontWeight' => 'lighter',
468+
469+
// colorpicker style
470+
'colorpicker.button.border' => '0px',
471+
'colorpicker.title.color' => '#000',
472+
410473

411474
//The filter and sorter are managed through both javascript and php scripts because if you have a lot of
412475
//file in a folder the javascript script can't sort all or filter all, so the filemanager switch to php script.
@@ -491,13 +554,55 @@
491554
$config['ext_video'],
492555
$config['ext_music']
493556
),
494-
// For a list of options see: https://developers.aviary.com/docs/web/setup-guide#constructor-config
495-
'aviary_defaults_config' => array(
496-
'apiKey' => $config['aviary_apiKey'],
497-
'language' => $config['aviary_language'],
498-
'theme' => $config['aviary_theme'],
499-
'tools' => $config['aviary_tools'],
500-
'maxSize' => $config['aviary_maxSize']
557+
'tui_defaults_config' => array(
558+
'common.bi.image' => $config['common.bi.image'],
559+
'common.bisize.width' => $config['common.bisize.width'],
560+
'common.bisize.height' => $config['common.bisize.height'],
561+
'common.backgroundImage' => $config['common.backgroundImage'],
562+
'common.backgroundColor' => $config['common.backgroundColor'],
563+
'common.border' => $config['common.border'],
564+
'header.backgroundImage' => $config['header.backgroundImage'],
565+
'header.backgroundColor' => $config['header.backgroundColor'],
566+
'header.border' => $config['header.border'],
567+
'menu.normalIcon.path' => $config['menu.normalIcon.path'],
568+
'menu.normalIcon.name' => $config['menu.normalIcon.name'],
569+
'menu.activeIcon.path' => $config['menu.activeIcon.path'],
570+
'menu.activeIcon.name' => $config['menu.activeIcon.name'],
571+
'menu.disabledIcon.path' => $config['menu.disabledIcon.path'],
572+
'menu.disabledIcon.name' => $config['menu.disabledIcon.name'],
573+
'menu.hoverIcon.path' => $config['menu.hoverIcon.path'],
574+
'menu.hoverIcon.name' => $config['menu.hoverIcon.name'],
575+
'menu.iconSize.width' => $config['menu.iconSize.width'],
576+
'menu.iconSize.height' => $config['menu.iconSize.height'],
577+
'submenu.backgroundColor' => $config['submenu.backgroundColor'],
578+
'submenu.partition.color' => $config['submenu.partition.color'],
579+
'submenu.normalIcon.path' => $config['submenu.normalIcon.path'],
580+
'submenu.normalIcon.name' => $config['submenu.normalIcon.name'],
581+
'submenu.activeIcon.path' => $config['submenu.activeIcon.path'],
582+
'submenu.activeIcon.name' => $config['submenu.activeIcon.name'],
583+
'submenu.iconSize.width' => $config['submenu.iconSize.width'],
584+
'submenu.iconSize.height' => $config['submenu.iconSize.height'],
585+
'submenu.normalLabel.color' => $config['submenu.normalLabel.color'],
586+
'submenu.normalLabel.fontWeight' => $config['submenu.normalLabel.fontWeight'],
587+
'submenu.activeLabel.color' => $config['submenu.activeLabel.color'],
588+
'submenu.activeLabel.fontWeight' => $config['submenu.activeLabel.fontWeightcommon.bi.image'],
589+
'checkbox.border' => $config['checkbox.border'],
590+
'checkbox.backgroundColor' => $config['checkbox.backgroundColor'],
591+
'range.pointer.color' => $config['range.pointer.color'],
592+
'range.bar.color' => $config['range.bar.color'],
593+
'range.subbar.color' => $config['range.subbar.color'],
594+
'range.disabledPointer.color' => $config['range.disabledPointer.color'],
595+
'range.disabledBar.color' => $config['range.disabledBar.color'],
596+
'range.disabledSubbar.color' => $config['range.disabledSubbar.color'],
597+
'range.value.color' => $config['range.value.color'],
598+
'range.value.fontWeight' => $config['range.value.fontWeight'],
599+
'range.value.fontSize' => $config['range.value.fontSize'],
600+
'range.value.border' => $config['range.value.border'],
601+
'range.value.backgroundColor' => $config['range.value.backgroundColor'],
602+
'range.title.color' => $config['range.title.color'],
603+
'range.title.fontWeight' => $config['range.title.fontWeight'],
604+
'colorpicker.button.border' => $config['colorpicker.button.border'],
605+
'colorpicker.title.color' => $config['colorpicker.title.color']
501606
),
502607
)
503-
);
608+
);

0 commit comments

Comments
 (0)