mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-24 18:00:40 +00:00
add SetFolderIcon for CreateFolder on mobile device, change SetFolderIcon payload
This commit is contained in:
@@ -42,6 +42,8 @@ class Demo
|
||||
'unique_id' => random_int(1000, 9999),
|
||||
'user_scope' => $user_scope,
|
||||
'items' => '0',
|
||||
'icon_color' => isset($request->icon['color']) ? $request->icon['color'] : null,
|
||||
'icon_emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
|
||||
'updated_at' => Carbon::now()->format('j M Y \a\t H:i'),
|
||||
'created_at' => Carbon::now()->format('j M Y \a\t H:i'),
|
||||
];
|
||||
@@ -72,8 +74,8 @@ class Demo
|
||||
|
||||
if ($item) {
|
||||
$item->name = $request->name;
|
||||
$item->icon_emoji = $request->folder_icon['emoji'] ?? null;
|
||||
$item->icon_color = $request->folder_icon['color'] ?? null;
|
||||
$item->icon_emoji = $request->icon['emoji'] ?? null;
|
||||
$item->icon_color = $request->icon['color'] ?? null;
|
||||
|
||||
return $item;
|
||||
|
||||
|
||||
@@ -29,11 +29,11 @@ class Editor
|
||||
/**
|
||||
* Store folder icon
|
||||
*
|
||||
* @param $folder_icon
|
||||
* @param $icon
|
||||
* @param $unique_id
|
||||
* @param $shared
|
||||
*/
|
||||
public static function set_folder_icon($folder_icon, $unique_id, $shared = null)
|
||||
public static function set_folder_icon($icon, $unique_id, $shared = null)
|
||||
{
|
||||
$user_id = is_null($shared) ? Auth::id() : $shared->user_id;
|
||||
|
||||
@@ -43,21 +43,21 @@ class Editor
|
||||
->first();
|
||||
|
||||
// Set default folder icon
|
||||
if ($folder_icon === 'default') {
|
||||
if ($icon === 'default') {
|
||||
$folder->icon_emoji = null;
|
||||
$folder->icon_color = null;
|
||||
}
|
||||
|
||||
// If request have emoji set folder icon emoji
|
||||
if (isset($folder_icon['emoji'])) {
|
||||
$folder->icon_emoji = $folder_icon['emoji'];
|
||||
if (isset($icon['emoji'])) {
|
||||
$folder->icon_emoji = $icon['emoji'];
|
||||
$folder->icon_color = null;
|
||||
}
|
||||
|
||||
// If request have color set folder icon color
|
||||
if (isset($folder_icon['color'])) {
|
||||
if (isset($icon['color'])) {
|
||||
$folder->icon_emoji = null;
|
||||
$folder->icon_color = $folder_icon['color'];
|
||||
$folder->icon_color = $icon['color'];
|
||||
}
|
||||
|
||||
// Save changes
|
||||
@@ -235,6 +235,8 @@ class Editor
|
||||
'user_id' => $user_id,
|
||||
'type' => 'folder',
|
||||
'name' => $name,
|
||||
'icon_color' => isset($request->icon['color']) ? $request->icon['color'] : null,
|
||||
'icon_emoji' => isset($request->icon['emoji']) ? $request->icon['emoji'] : null,
|
||||
]);
|
||||
|
||||
// Return new folder
|
||||
|
||||
Reference in New Issue
Block a user