Private
Public Access
1
0

Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace Paymenter\Extensions\Others\ForceTheme;
use App\Classes\Extension\Extension;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\View;
use Illuminate\Support\HtmlString;
class ForceTheme extends Extension
{
public function getConfig($values = [])
{
return [
[
'name' => 'mode',
'label' => 'Theme Mode',
'type' => 'select',
'options' => ['light' => 'Light', 'dark' => 'Dark'],
'default' => 'light',
'required' => true,
'validation' => 'in:light,dark',
],
[
'name' => 'local_storage_key',
'label' => 'Local Storage Key',
'type' => 'text',
'default' => '_x_darkMode',
'required' => true,
'validation' => 'string',
],
];
}
public function boot()
{
View::prependLocation(__DIR__ . '/resources/views/overrides');
Event::listen('head', function () {
$mode = $this->config('mode') ?: 'light';
$key = $this->config('local_storage_key') ?: '_x_darkMode';
$modeJs = e($mode);
$keyJs = e($key);
$script = "<script>(function(){try{var m='" . $modeJs . "';var k='" . $keyJs . "';var def='_x_darkMode';var v=(m==='dark')?'true':'false';localStorage.setItem(k, v);if(k!==def){localStorage.setItem(def, v);} }catch(e){}})();</script>";
return ['view' => new HtmlString($script)];
});
}
}

View File

@@ -0,0 +1,17 @@
Thanks for using this free Paymenter extension by Buzz Development!
If you need a great theme to use for Paymenter, we have two amazing options for you:
- https://builtbybit.com/resources/luna-premium-paymenter-theme.73392/
- https://builtbybit.com/resources/cosmos-modern-paymenter-theme.76370/
Also, if you're looking to add fully custom pages to your Paymenter site, consider using our PageBuilder extension!
- https://builtbybit.com/resources/pagebuilder-for-paymenter.77603/
For support or suggestions please join our Discord server: https://discord.gg/buzz
Enjoy!
Installation:
- Upload the extension folder unzipped to `extensions/Others`, or install it via the admin panel in Paymenter
- Configure the Extension in the Extensions tab
- All done!

View File

@@ -0,0 +1,20 @@
<?php
namespace Paymenter\Extensions\Others\ForceTheme\Support;
use App\Models\Extension as ExtensionModel;
class Config
{
public static function get(): array
{
$row = ExtensionModel::where('extension', 'ForceTheme')->where('type', 'other')->first();
$settings = $row?->settings->pluck('value', 'key')->toArray() ?? [];
return [
'mode' => $settings['mode'] ?? 'light',
'local_storage_key' => $settings['local_storage_key'] ?? '_x_darkMode',
];
}
}

View File

@@ -0,0 +1,3 @@
@php /* intentionally empty to hide toggle */ @endphp