first commit
This commit is contained in:
commit
405df0a122
3083 changed files with 69203 additions and 0 deletions
117
app/Helpers/ThemeHelper.php
Normal file
117
app/Helpers/ThemeHelper.php
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
class ThemeHelper
|
||||
{
|
||||
/**
|
||||
* Get the logo path based on the current theme
|
||||
*/
|
||||
public static function getLogoPath(string $type = 'positive'): string
|
||||
{
|
||||
$theme = config('app.theme', 'pr-copilot');
|
||||
|
||||
$logoMap = [
|
||||
'portal' => [
|
||||
'positive' => 'img/logos/portal-logo-positive.svg',
|
||||
'negative' => 'img/logos/portal-logo-negative.svg'
|
||||
],
|
||||
'presseecho' => [
|
||||
'positive' => 'img/logos/presseecho-logo-positiv.svg',
|
||||
'negative' => 'img/logos/presseecho-logo-negativ.svg'
|
||||
],
|
||||
'businessportal24' => [
|
||||
'positive' => 'img/logos/businessportal24-logo-positiv.svg',
|
||||
'negative' => 'img/logos/businessportal24-logo-negativ.svg'
|
||||
]
|
||||
];
|
||||
|
||||
return $logoMap[$theme][$type] ?? $logoMap['pr-copilot'][$type];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the favicon path based on the current theme
|
||||
*/
|
||||
public static function getFaviconPath(): string
|
||||
{
|
||||
$theme = config('app.theme', 'portal');
|
||||
return "img/favicons/{$theme}-favicon.ico";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the CSS theme file based on the current theme
|
||||
*/
|
||||
public static function getThemeCssPath(): string
|
||||
{
|
||||
$theme = config('app.theme', 'portal');
|
||||
return "resources/css/web/theme-{$theme}.css";
|
||||
}
|
||||
|
||||
/**
|
||||
* Get domain-specific configuration
|
||||
*/
|
||||
public static function getDomainConfig(): array
|
||||
{
|
||||
$theme = config('app.theme', 'portal');
|
||||
return config("domains.domains.{$theme}", []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get primary color for the current theme
|
||||
*/
|
||||
public static function getPrimaryColor(): string
|
||||
{
|
||||
$config = self::getDomainConfig();
|
||||
return $config['color_scheme']['primary'] ?? '#526266';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get secondary color for the current theme
|
||||
*/
|
||||
public static function getSecondaryColor(): string
|
||||
{
|
||||
$config = self::getDomainConfig();
|
||||
return $config['color_scheme']['secondary'] ?? '#82a0a7';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get primary font family for the current theme
|
||||
*/
|
||||
public static function getFont(): string
|
||||
{
|
||||
$config = self::getDomainConfig();
|
||||
return $config['font'] ?? 'Montserrat';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get domain name for the current theme
|
||||
*/
|
||||
public static function getDomainName(): string
|
||||
{
|
||||
$config = self::getDomainConfig();
|
||||
return $config['domain_name'] ?? 'pr-copilot.test';
|
||||
}
|
||||
|
||||
public static function getDomainUrl(): string
|
||||
{
|
||||
$config = self::getDomainConfig();
|
||||
return $config['url'] ?? config('app.url');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the asset URL (Vite dev server) for the current theme
|
||||
*/
|
||||
public static function getAssetUrl(): string
|
||||
{
|
||||
$theme = config('app.theme', 'portal');
|
||||
|
||||
$assetUrlMap = [
|
||||
'portal' => 'https://assets.pr-copilot.test',
|
||||
'presseecho' => 'https://assets.presseecho.test',
|
||||
'businessportal24' => 'https://assets.businessportal24.test',
|
||||
];
|
||||
|
||||
return $assetUrlMap[$theme] ?? 'https://assets.pr-copilot.test';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue