Skip to content

Commit 97e403e

Browse files
authored
feat: Add a small module for links (#3521)
1 parent 2079b40 commit 97e403e

File tree

27 files changed

+233
-1
lines changed

27 files changed

+233
-1
lines changed

app/Http/Resources/GalleryConfigs/InitConfig.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class InitConfig extends Data
4646
public bool $is_exif_disabled;
4747
public bool $is_favourite_enabled;
4848
public SmallLargeType $photo_previous_next_size;
49+
public bool $is_details_links_enabled;
4950

5051
// Thumbs configuration
5152
public ThumbOverlayVisibilityType $display_thumb_album_overlay;
@@ -123,6 +124,10 @@ public function __construct()
123124
$this->is_exif_disabled = Configs::getValueAsBool('exif_disabled_for_all');
124125
$this->is_favourite_enabled = Configs::getValueAsBool('client_side_favourite_enabled');
125126
$this->photo_previous_next_size = Configs::getValueAsEnum('photo_previous_next_size', SmallLargeType::class);
127+
$this->is_details_links_enabled = false;
128+
if (Configs::getValueAsBool('details_links_enabled')) {
129+
$this->is_details_links_enabled = !Auth::guest() || Configs::getValueAsBool('details_links_public');
130+
}
126131

127132
// Thumbs configuration
128133
$this->display_thumb_album_overlay = Configs::getValueAsEnum('display_thumb_album_overlay', ThumbOverlayVisibilityType::class);
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
/**
4+
* SPDX-License-Identifier: MIT
5+
* Copyright (c) 2017-2018 Tobias Reich
6+
* Copyright (c) 2018-2025 LycheeOrg.
7+
*/
8+
9+
use App\Models\Extensions\BaseConfigMigration;
10+
11+
return new class() extends BaseConfigMigration {
12+
public function getConfigs(): array
13+
{
14+
return [
15+
[
16+
'key' => 'details_links_enabled',
17+
'value' => '0',
18+
'cat' => 'Gallery',
19+
'type_range' => self::BOOL,
20+
'description' => 'Enable image links in photo details',
21+
'details' => 'Add a small module to allow easy copying of the photo urls in the details panel.',
22+
'is_secret' => false,
23+
'level' => 0,
24+
'order' => 20,
25+
'not_on_docker' => false,
26+
'is_expert' => false,
27+
],
28+
[
29+
'key' => 'details_links_public',
30+
'value' => '0',
31+
'cat' => 'Gallery',
32+
'type_range' => self::BOOL,
33+
'description' => 'Allow anonymous users to acces image links in photo details',
34+
'details' => '',
35+
'is_secret' => false,
36+
'level' => 0,
37+
'order' => 21,
38+
'not_on_docker' => false,
39+
'is_expert' => false,
40+
],
41+
];
42+
}
43+
};

lang/ar/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@
175175
'number_of_shares' => 'عدد المشاركات',
176176
'number_of_favourites' => 'عدد المفضلات',
177177
],
178+
'links' => [
179+
'header' => 'Links',
180+
'copy' => 'Copy',
181+
'copy_success' => 'Link copied to clipboard.',
182+
],
178183
],
179184

180185
'edit' => [

lang/cz/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@
175175
'number_of_shares' => 'Number of shares',
176176
'number_of_favourites' => 'Number of favourites',
177177
],
178+
'links' => [
179+
'header' => 'Links',
180+
'copy' => 'Copy',
181+
'copy_success' => 'Link copied to clipboard.',
182+
],
178183
],
179184

180185
'edit' => [

lang/de/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@
158158
'number_of_shares' => 'Wie oft geteilt',
159159
'number_of_favourites' => 'Anzahl der Favoriten',
160160
],
161+
'links' => [
162+
'header' => 'Links',
163+
'copy' => 'Copy',
164+
'copy_success' => 'Link copied to clipboard.',
165+
],
161166
],
162167
'edit' => [
163168
'set_title' => 'Titel festlegen',

lang/el/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@
175175
'number_of_shares' => 'Number of shares',
176176
'number_of_favourites' => 'Number of favourites',
177177
],
178+
'links' => [
179+
'header' => 'Links',
180+
'copy' => 'Copy',
181+
'copy_success' => 'Link copied to clipboard.',
182+
],
178183
],
179184

180185
'edit' => [

lang/en/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@
175175
'number_of_shares' => 'Number of shares',
176176
'number_of_favourites' => 'Number of favourites',
177177
],
178+
'links' => [
179+
'header' => 'Links',
180+
'copy' => 'Copy',
181+
'copy_success' => 'Link copied to clipboard.',
182+
],
178183
],
179184

180185
'edit' => [

lang/es/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@
175175
'number_of_shares' => 'Number of shares',
176176
'number_of_favourites' => 'Number of favourites',
177177
],
178+
'links' => [
179+
'header' => 'Links',
180+
'copy' => 'Copy',
181+
'copy_success' => 'Link copied to clipboard.',
182+
],
178183
],
179184

180185
'edit' => [

lang/fa/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@
175175
'number_of_shares' => 'تعداد اشتراک‌گذاری‌ها',
176176
'number_of_favourites' => 'تعداد علاقه‌مندی‌ها',
177177
],
178+
'links' => [
179+
'header' => 'Links',
180+
'copy' => 'Copy',
181+
'copy_success' => 'Link copied to clipboard.',
182+
],
178183
],
179184

180185
'edit' => [

lang/fr/gallery.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@
159159
'number_of_shares' => 'Nombre de partages',
160160
'number_of_favourites' => 'Nombre de favorites',
161161
],
162+
'links' => [
163+
'header' => 'Liens',
164+
'copy' => 'Copier',
165+
'copy_success' => 'Liens copié dans le presse-papier.',
166+
],
162167
],
163168
'edit' => [
164169
'set_title' => 'Définir le titre',

0 commit comments

Comments
 (0)