PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.4
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.4
1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk 1.2.0 All 47 releases
fluent-cart / app / Modules / StorageDrivers / Local / Local.php

Local.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.4, at app/Modules/StorageDrivers/Local/Local.php

82 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Modules\StorageDrivers\Local;
4
5 use FluentCart\App\Services\FileSystem\Drivers\Local\LocalDriver;
6 use FluentCart\App\Vite;
7 use FluentCart\App\Modules\StorageDrivers\BaseStorageDriver;
8
9 class Local extends BaseStorageDriver
10 {
11 /**
12 * title, slug, brandColor
13 */
14 public function __construct()
15 {
16 parent::__construct(
17 __('Local', 'fluent-cart'),
18 'local',
19 '#136196'
20 );
21 }
22
23 public function registerHooks()
24 {
25 //
26 }
27
28 public function getLogo(): string
29 {
30 return Vite::getAssetUrl("images/storage-drivers/local.svg");
31 }
32
33
34 public function getDescription(): string
35 {
36 return esc_html__('Local allows to upload file in local file storage', 'fluent-cart');
37 }
38
39 public function isEnabled(): bool
40 {
41 return (new LocalSettings())->isActive();
42 }
43
44 public function getSettings()
45 {
46 return (new LocalSettings())->get();
47 }
48
49 public function fields(): array
50 {
51 return [
52 'view' => [
53 'title' => __('Local Settings', 'fluent-cart'),
54 'type' => 'section',
55 'disable_nesting' => true,
56 'columns' => [
57 'default' => 1,
58 'md' => 1,
59 'lg' => 1
60 ],
61 'schema' => [
62 'is_active' => [
63 'value' => '',
64 'label' => __('Enable local driver', 'fluent-cart'),
65 'type' => 'checkbox'
66 ]
67 ]
68 ]
69 ];
70 }
71
72 public function getDriverClass(): string
73 {
74 return LocalDriver::class;
75 }
76
77 public function hiddenSettingKeys(): array
78 {
79 return [];
80 }
81 }
82