diff --git a/app/Common.php b/app/Common.php index 7448f1ad8394a423199ff57dd2b4f9640814d9e9..edbf59bdc2ec8ea2e19e9a59bad8b70fc2c79ac3 100644 --- a/app/Common.php +++ b/app/Common.php @@ -2,6 +2,9 @@ declare(strict_types=1); +use App\Libraries\View; +use ViewThemes\Theme; + /** * The goal of this file is to allow developers a location where they can overwrite core procedural functions and * replace them with their own. This file is loaded during the bootstrap process and is called during the frameworks @@ -12,3 +15,32 @@ declare(strict_types=1); * * @link: https://codeigniter4.github.io/CodeIgniter4/ */ + +if (! function_exists('view')) { + /** + * Grabs the current RendererInterface-compatible class and tells it to render the specified view. Simply provides a + * convenience method that can be used in Controllers, libraries, and routed closures. + * + * NOTE: Does not provide any escaping of the data, so that must all be handled manually by the developer. + * + * @param array<string, mixed> $data + * @param array<string, mixed> $options Unused - reserved for third-party extensions. + */ + function view(string $name, array $data = [], array $options = []): string + { + $path = Theme::path(); + + /** @var CodeIgniter\View\View $renderer */ + $renderer = single_service('renderer', $path); + + $saveData = config(View::class)->saveData; + + if (array_key_exists('saveData', $options)) { + $saveData = (bool) $options['saveData']; + unset($options['saveData']); + } + + return $renderer->setData($data, 'raw') + ->render($name, $options, $saveData); + } +} diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php index 8a6ff73af572d3047856bcc7bc080eb679db8b5f..6b313009d7afc6ade90473ab7bd393ea1f905564 100644 --- a/app/Config/Autoload.php +++ b/app/Config/Autoload.php @@ -51,6 +51,8 @@ class Autoload extends AutoloadConfig 'Modules\Fediverse' => ROOTPATH . 'modules/Fediverse/', 'Config' => APPPATH . 'Config/', 'ViewComponents' => APPPATH . 'Libraries/ViewComponents/', + 'ViewThemes' => APPPATH . 'Libraries/ViewThemes/', + 'Themes' => ROOTPATH . 'themes', ]; /** diff --git a/app/Config/ViewComponents.php b/app/Config/ViewComponents.php index 25afea847f7394eb97d1d29f87816e6f31f80771..ae0a31db6b5433373d999fed5f0653d02f2acc0e 100644 --- a/app/Config/ViewComponents.php +++ b/app/Config/ViewComponents.php @@ -9,14 +9,12 @@ use ViewComponents\Config\ViewComponents as ViewComponentsConfig; class ViewComponents extends ViewComponentsConfig { /** - * @var array<string, string> + * @var string[] */ - public array $lookupModules = [ - APP_NAMESPACE => APPPATH, - 'Modules\Admin' => ROOTPATH . 'modules/Admin/', - 'Modules\Auth' => ROOTPATH . 'modules/Auth/', - 'Modules\Analytics' => ROOTPATH . 'modules/Analytics/', - 'Modules\Install' => ROOTPATH . 'modules/Install/', - 'Modules\Fediverse' => ROOTPATH . 'modules/Fediverse/', + public array $lookupPaths = [ + ROOTPATH . 'themes/cp_app/', + ROOTPATH . 'themes/cp_admin/', + ROOTPATH . 'themes/cp_auth/', + ROOTPATH . 'themes/cp_install/', ]; } diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index b76cf7b2068cf94599e7569de335d0045aadbe62..2d30eb3c5602994967bd63f42de26d75cd23fb63 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -8,6 +8,7 @@ use CodeIgniter\Controller; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; +use ViewThemes\Theme; /** * Class BaseController @@ -19,14 +20,6 @@ use Psr\Log\LoggerInterface; */ class BaseController extends Controller { - /** - * An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all - * other controllers that extend BaseController. - * - * @var string[] - */ - protected $helpers = ['auth', 'svg', 'components', 'misc']; - /** * Constructor. */ @@ -35,7 +28,11 @@ class BaseController extends Controller ResponseInterface $response, LoggerInterface $logger ): void { + $this->helpers = array_merge($this->helpers, ['auth', 'svg', 'components', 'misc']); + // Do Not Edit This Line parent::initController($request, $response, $logger); + + Theme::setTheme('app'); } } diff --git a/app/Controllers/HomeController.php b/app/Controllers/HomeController.php index df1b2bb5b49877d44d6a0211622b7162cb311eae..f19eb74d1e976bd1d11b7822549184bad7e15bb2 100644 --- a/app/Controllers/HomeController.php +++ b/app/Controllers/HomeController.php @@ -38,6 +38,7 @@ class HomeController extends BaseController $data = [ 'podcasts' => $allPodcasts, ]; + return view('home', $data); } } diff --git a/app/Libraries/View.php b/app/Libraries/View.php index 38fd82f9b162e77a918b6aa8e5b897a745222475..4215dd1a41c667cfd10d2b22a16084c01dc0bcdf 100644 --- a/app/Libraries/View.php +++ b/app/Libraries/View.php @@ -110,7 +110,7 @@ class View extends CodeIgniterView } $output = service('components') - ->setCurrentView($view) + ->setCurrentView($this->renderVars['file']) ->render($output); $this->logPerformance($this->renderVars['start'], microtime(true), $this->renderVars['view']); diff --git a/app/Libraries/ViewComponents/ComponentRenderer.php b/app/Libraries/ViewComponents/ComponentRenderer.php index 38a8e9ecc43bf01bd96355edc530f96da366061c..ccac323990b45a2cd4392500110e370c89ac1efd 100644 --- a/app/Libraries/ViewComponents/ComponentRenderer.php +++ b/app/Libraries/ViewComponents/ComponentRenderer.php @@ -137,26 +137,26 @@ class ComponentRenderer private function locateView(string $name): string { // TODO: Is there a better way to locate components local to current module? - $modulesToDiscover = []; - $lookupModules = $this->config->lookupModules; - $modulesToDiscover = array_filter($lookupModules, function ($namespace): bool { - return str_starts_with($this->currentView, $namespace); - }, ARRAY_FILTER_USE_KEY); - $modulesToDiscover = array_values($modulesToDiscover); - $modulesToDiscover[] = $this->config->defaultLookupPath; + $pathsToDiscover = []; + $lookupPaths = $this->config->lookupPaths; + $pathsToDiscover = array_filter($lookupPaths, function ($path): bool { + return str_starts_with($this->currentView, $path); + }); + $pathsToDiscover = array_values($pathsToDiscover); + $pathsToDiscover[] = $this->config->defaultLookupPath; $namePath = str_replace('.', '/', $name); - foreach ($modulesToDiscover as $basePath) { + foreach ($pathsToDiscover as $basePath) { // Look for a class component first - $filePath = $basePath . $this->config->classComponentsPath . '/' . $namePath . '.php'; + $filePath = $basePath . $this->config->componentsDirectory . '/' . $namePath . '.php'; if (is_file($filePath)) { return $filePath; } - $camelCaseName = strtolower(preg_replace('~(?<!^)(?<!\/)[A-Z]~', '_$0', $namePath) ?? ''); - $filePath = $basePath . $this->config->viewFileComponentsPath . '/' . $camelCaseName . '.php'; + $snakeCaseName = strtolower(preg_replace('~(?<!^)(?<!\/)[A-Z]~', '_$0', $namePath) ?? ''); + $filePath = $basePath . $this->config->componentsDirectory . '/' . $snakeCaseName . '.php'; if (is_file($filePath)) { return $filePath; diff --git a/app/Libraries/ViewComponents/Config/ViewComponents.php b/app/Libraries/ViewComponents/Config/ViewComponents.php index 56c041fb1e5dcb41fc9c6f3ccbdc41067ea4d777..4ad7e82ed9f3bd4f49cb64caf0ef99eb44a35bec 100644 --- a/app/Libraries/ViewComponents/Config/ViewComponents.php +++ b/app/Libraries/ViewComponents/Config/ViewComponents.php @@ -8,17 +8,14 @@ use CodeIgniter\Config\BaseConfig; class ViewComponents extends BaseConfig { - public string $classComponentsPath = 'View/Components'; - - public string $viewFileComponentsPath = 'Views/components'; + public string $componentsDirectory = 'Components'; /** - * Modules to look into for local components. Associative array with the module namespace as key and the module path - * as value. + * Paths to look into for local components. Will look for the $componentsDirectory inside. * - * @var array<string, string> + * @var string[] */ - public array $lookupModules = []; + public array $lookupPaths = []; - public string $defaultLookupPath = APPPATH; + public string $defaultLookupPath = APPPATH . 'Views/'; } diff --git a/app/Libraries/ViewThemes/Config/Themes.php b/app/Libraries/ViewThemes/Config/Themes.php new file mode 100644 index 0000000000000000000000000000000000000000..c22ac27cad655b3d483d4109eee2c3d5a8633129 --- /dev/null +++ b/app/Libraries/ViewThemes/Config/Themes.php @@ -0,0 +1,24 @@ +<?php + +declare(strict_types=1); + +namespace ViewThemes\Config; + +use CodeIgniter\Config\BaseConfig; + +class Themes extends BaseConfig +{ + public string $themesDirectory = ROOTPATH . 'themes'; + + public string $manifestFilename = 'manifest.json'; + + /** + * @var array<string, string> + */ + public array $themes = [ + 'app' => 'cp_app', + 'admin' => 'cp_admin', + 'install' => 'cp_install', + 'auth' => 'cp_auth', + ]; +} diff --git a/app/Libraries/ViewThemes/Theme.php b/app/Libraries/ViewThemes/Theme.php new file mode 100644 index 0000000000000000000000000000000000000000..30020dcb77a5589ccf5f1e69ac33992ceac55c96 --- /dev/null +++ b/app/Libraries/ViewThemes/Theme.php @@ -0,0 +1,99 @@ +<?php + +declare(strict_types=1); + +namespace ViewThemes; + +use ViewThemes\Config\Themes; + +/** + * Borrowed and adapted from https://github.com/lonnieezell/Bonfire2 + */ +class Theme +{ + protected Themes $config; + + /** + * @var string + */ + protected static $defaultTheme = 'app'; + + /** + * @var string + */ + protected static $currentTheme; + + /** + * Holds theme info retrieved + * + * @var array<int, array<string, mixed>> + */ + protected static array $info = []; + + public function __construct() + { + $this->config = config('Themes'); + } + + /** + * Sets the active theme. + */ + public static function setTheme(string $theme): void + { + static::$currentTheme = $theme; + } + + /** + * Returns the path to the specified theme folder. If no theme is provided, will use the current theme. + */ + public static function path(string $theme = null): string + { + if ($theme === null) { + $theme = static::current(); + } + + // Ensure we've pulled the theme info + if (static::$info === []) { + static::$info = self::available(); + } + + foreach (static::$info as $info) { + if ($info['name'] === $theme) { + return $info['path']; + } + } + + return ''; + } + + /** + * Returns the name of the active theme. + */ + public static function current(): string + { + return static::$currentTheme !== null + ? static::$currentTheme + : static::$defaultTheme; + } + + /** + * Returns an array of all available themes and the paths to their directories. + * + * @return array<int, array<string, mixed>> + */ + public static function available(): array + { + $themes = []; + + $config = config('Themes'); + + foreach ($config->themes as $name => $folder) { + $themes[] = [ + 'name' => $name, + 'path' => $config->themesDirectory . '/' . $folder . '/', + ]; + } + + return $themes; + } +} diff --git a/app/View/Components/Button.php b/app/Views/Components/Button.php similarity index 98% rename from app/View/Components/Button.php rename to app/Views/Components/Button.php index b122395f90b27a99165055ac7e69001beb5398f0..3ba713fde4987e7d73371e5bdd3b8c8d3146f3c4 100644 --- a/app/View/Components/Button.php +++ b/app/Views/Components/Button.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components; +namespace App\Views\Components; use ViewComponents\Component; diff --git a/app/View/Components/Forms/Label.php b/app/Views/Components/Forms/Label.php similarity index 96% rename from app/View/Components/Forms/Label.php rename to app/Views/Components/Forms/Label.php index b2dfd001676af60ea0be9280a70ab72d62c5d90f..6ff709d4633e583c489dfbea737aaf93513eaa82 100644 --- a/app/View/Components/Forms/Label.php +++ b/app/Views/Components/Forms/Label.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components\Forms; +namespace App\Views\Components\Forms; use ViewComponents\Component; diff --git a/app/View/Components/Forms/MarkdownEditor.php b/app/Views/Components/Forms/MarkdownEditor.php similarity index 99% rename from app/View/Components/Forms/MarkdownEditor.php rename to app/Views/Components/Forms/MarkdownEditor.php index 6540e282ac6b951ff15a527392f4bd30a7b3487d..febf2ebe044edf1a626bd7981efde116bb7bf628 100644 --- a/app/View/Components/Forms/MarkdownEditor.php +++ b/app/Views/Components/Forms/MarkdownEditor.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components\Forms; +namespace App\Views\Components\Forms; use ViewComponents\Component; diff --git a/app/View/Components/Forms/MultiSelect.php b/app/Views/Components/Forms/MultiSelect.php similarity index 95% rename from app/View/Components/Forms/MultiSelect.php rename to app/Views/Components/Forms/MultiSelect.php index af7a24c3ced6e24dba710f5d4475e51f2ad98ca6..f9c25c072378a28d6f51c16b517ebdc01c10d3bc 100644 --- a/app/View/Components/Forms/MultiSelect.php +++ b/app/Views/Components/Forms/MultiSelect.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components\Forms; +namespace App\Views\Components\Forms; use ViewComponents\Component; diff --git a/app/View/Components/Forms/Select.php b/app/Views/Components/Forms/Select.php similarity index 94% rename from app/View/Components/Forms/Select.php rename to app/Views/Components/Forms/Select.php index ea9374b63ac851135aed6f150b64a7b161f8dbf0..050c3cf334e82101a3cf971ba225cdaf124abd12 100644 --- a/app/View/Components/Forms/Select.php +++ b/app/Views/Components/Forms/Select.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components\Forms; +namespace App\Views\Components\Forms; use ViewComponents\Component; diff --git a/app/View/Components/Forms/Toggler.php b/app/Views/Components/Forms/Toggler.php similarity index 97% rename from app/View/Components/Forms/Toggler.php rename to app/Views/Components/Forms/Toggler.php index eab1268a4e4f66dc2c39e644762b7e41d15a630f..a8ae1e8769fcd09176c2856c1c0da205ce8db1b3 100644 --- a/app/View/Components/Forms/Toggler.php +++ b/app/Views/Components/Forms/Toggler.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components\Forms; +namespace App\Views\Components\Forms; use ViewComponents\Component; diff --git a/app/View/Components/Forms/XMLEditor.php b/app/Views/Components/Forms/XMLEditor.php similarity index 93% rename from app/View/Components/Forms/XMLEditor.php rename to app/Views/Components/Forms/XMLEditor.php index ac03f3d0b6e9d29e3abce5af41b53d03fa9d6539..71e01d242ebf5ca015db9c3a283f6eff1cc334e4 100644 --- a/app/View/Components/Forms/XMLEditor.php +++ b/app/Views/Components/Forms/XMLEditor.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components\Forms; +namespace App\Views\Components\Forms; use ViewComponents\Component; diff --git a/app/View/Components/Icon.php b/app/Views/Components/Icon.php similarity index 94% rename from app/View/Components/Icon.php rename to app/Views/Components/Icon.php index 7cd44991dc91475eed1798f34b9f24fab3c40cbd..a1b75770639c1e81ecd56f731d5c47b1649362d8 100644 --- a/app/View/Components/Icon.php +++ b/app/Views/Components/Icon.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\View\Components; +namespace App\Views\Components; use Exception; use ViewComponents\Component; diff --git a/app/Views/components/.gitkeep b/app/Views/components/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/modules/Admin/Controllers/BaseController.php b/modules/Admin/Controllers/BaseController.php index 205a4f4aa2c4d2ed4126a1d083ae06c2846617a3..a38b8e845741820e41670d170c72466d0951ee0f 100644 --- a/modules/Admin/Controllers/BaseController.php +++ b/modules/Admin/Controllers/BaseController.php @@ -8,6 +8,7 @@ use CodeIgniter\Controller; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; +use ViewThemes\Theme; /** * Class BaseController @@ -20,14 +21,6 @@ use Psr\Log\LoggerInterface; class BaseController extends Controller { - /** - * An array of helpers to be loaded automatically upon class instantiation. These helpers will be available to all - * other controllers that extend BaseController. - * - * @var string[] - */ - protected $helpers = ['auth', 'breadcrumb', 'svg', 'components', 'misc']; - /** * Constructor. */ @@ -36,7 +29,11 @@ class BaseController extends Controller ResponseInterface $response, LoggerInterface $logger ): void { + $this->helpers = array_merge($this->helpers, ['auth', 'breadcrumb', 'svg', 'components', 'misc']); + // Do Not Edit This Line parent::initController($request, $response, $logger); + + Theme::setTheme('admin'); } } diff --git a/modules/Admin/Controllers/ContributorController.php b/modules/Admin/Controllers/ContributorController.php index 47a825c304e3f051fae413a6e0df052447cf5ffd..ad79f24b50a0c3246067cfc633f33e27ddfd3465 100644 --- a/modules/Admin/Controllers/ContributorController.php +++ b/modules/Admin/Controllers/ContributorController.php @@ -57,7 +57,7 @@ class ContributorController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\contributor\list', $data); + return view('contributor/list', $data); } public function view(): string @@ -70,7 +70,7 @@ class ContributorController extends BaseController 0 => $this->podcast->title, 1 => $this->user->username, ]); - return view('Modules\Admin\Views\contributor\view', $data); + return view('contributor/view', $data); } public function add(): string @@ -106,7 +106,7 @@ class ContributorController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\contributor\add', $data); + return view('contributor/add', $data); } public function attemptAdd(): RedirectResponse @@ -155,7 +155,7 @@ class ContributorController extends BaseController 0 => $this->podcast->title, 1 => $this->user->username, ]); - return view('Modules\Admin\Views\contributor\edit', $data); + return view('contributor/edit', $data); } public function attemptEdit(): RedirectResponse diff --git a/modules/Admin/Controllers/EpisodeController.php b/modules/Admin/Controllers/EpisodeController.php index 5791a7c330f47478f00ca270ebbfef3026cb876f..8716e641998d5a6b50898b245c36b55ed97be6ac 100644 --- a/modules/Admin/Controllers/EpisodeController.php +++ b/modules/Admin/Controllers/EpisodeController.php @@ -77,7 +77,7 @@ class EpisodeController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\episode\list', $data); + return view('episode/list', $data); } public function view(): string @@ -91,7 +91,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\view', $data); + return view('episode/view', $data); } public function create(): string @@ -105,7 +105,7 @@ class EpisodeController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\episode\create', $data); + return view('episode/create', $data); } public function attemptCreate(): RedirectResponse @@ -230,7 +230,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\edit', $data); + return view('episode/edit', $data); } public function attemptEdit(): RedirectResponse @@ -404,7 +404,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\publish', $data); + return view('episode/publish', $data); } return redirect()->route('episode-view', [$this->podcast->id, $this->episode->id])->with( @@ -503,7 +503,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\publish_edit', $data); + return view('episode/publish_edit', $data); } return redirect()->route('episode-view', [$this->podcast->id, $this->episode->id])->with( @@ -632,7 +632,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\unpublish', $data); + return view('episode/unpublish', $data); } return redirect()->route('episode-view', [$this->podcast->id, $this->episode->id])->with( @@ -704,7 +704,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\soundbites', $data); + return view('episode/soundbites', $data); } public function soundbitesAttemptEdit(): RedirectResponse @@ -782,7 +782,7 @@ class EpisodeController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\embeddable_player', $data); + return view('episode/embeddable_player', $data); } public function attemptCommentCreate(): RedirectResponse diff --git a/modules/Admin/Controllers/EpisodePersonController.php b/modules/Admin/Controllers/EpisodePersonController.php index 860b9ca945d4d933e6574dea36fdc4127fac0a52..1749157ef3e117b773d2955ef8923fe35ca824d6 100644 --- a/modules/Admin/Controllers/EpisodePersonController.php +++ b/modules/Admin/Controllers/EpisodePersonController.php @@ -62,7 +62,7 @@ class EpisodePersonController extends BaseController 0 => $this->podcast->title, 1 => $this->episode->title, ]); - return view('Modules\Admin\Views\episode\persons', $data); + return view('episode/persons', $data); } public function attemptAdd(): RedirectResponse diff --git a/modules/Admin/Controllers/FediverseController.php b/modules/Admin/Controllers/FediverseController.php index c1dbd41a748341857a276cb74fb21ec79a8fee36..134939edf0fb05c8f8a8159b062649f6734b2201 100644 --- a/modules/Admin/Controllers/FediverseController.php +++ b/modules/Admin/Controllers/FediverseController.php @@ -14,7 +14,7 @@ class FediverseController extends BaseController { public function dashboard(): string { - return view('Modules\Admin\Views\fediverse\dashboard'); + return view('fediverse/dashboard'); } public function blockedActors(): string @@ -24,7 +24,7 @@ class FediverseController extends BaseController $blockedActors = model('ActorModel') ->getBlockedActors(); - return view('Modules\Admin\Views\fediverse\blocked_actors', [ + return view('fediverse/blocked_actors', [ 'blockedActors' => $blockedActors, ]); } @@ -36,7 +36,7 @@ class FediverseController extends BaseController $blockedDomains = model('BlockedDomainModel') ->getBlockedDomains(); - return view('Modules\Admin\Views\fediverse\blocked_domains', [ + return view('fediverse/blocked_domains', [ 'blockedDomains' => $blockedDomains, ]); } diff --git a/modules/Admin/Controllers/MyAccountController.php b/modules/Admin/Controllers/MyAccountController.php index 89fa6d4111ac8716e4b54221c12b0de5b879f106..9314724970c7a235abfc8dc9714921ac808ffe19 100644 --- a/modules/Admin/Controllers/MyAccountController.php +++ b/modules/Admin/Controllers/MyAccountController.php @@ -18,14 +18,14 @@ class MyAccountController extends BaseController { public function index(): string { - return view('Modules\Admin\Views\my_account\view'); + return view('my_account\view'); } public function changePassword(): string { helper('form'); - return view('Modules\Admin\Views\my_account\change_password'); + return view('my_account\change_password'); } public function attemptChange(): RedirectResponse diff --git a/modules/Admin/Controllers/PageController.php b/modules/Admin/Controllers/PageController.php index 4071f4080dba6940decd9c2bba5c843df09ae75d..7458719ee10e0f50d5787205f50241478a135179 100644 --- a/modules/Admin/Controllers/PageController.php +++ b/modules/Admin/Controllers/PageController.php @@ -38,12 +38,12 @@ class PageController extends BaseController 'pages' => (new PageModel())->findAll(), ]; - return view('Modules\Admin\Views\page\list', $data); + return view('page/list', $data); } public function view(): string { - return view('Modules\Admin\Views\page\view', [ + return view('page/view', [ 'page' => $this->page, ]); } @@ -52,7 +52,7 @@ class PageController extends BaseController { helper('form'); - return view('Modules\Admin\Views\page\create'); + return view('page/create'); } public function attemptCreate(): RedirectResponse @@ -86,7 +86,7 @@ class PageController extends BaseController replace_breadcrumb_params([ 0 => $this->page->title, ]); - return view('Modules\Admin\Views\page\edit', [ + return view('page/edit', [ 'page' => $this->page, ]); } diff --git a/modules/Admin/Controllers/PersonController.php b/modules/Admin/Controllers/PersonController.php index 1aa8cb46b4766c455852afa5c5880b11fabe028c..3d75828c52bcac3edb32914c1e3cb2112e6ef48b 100644 --- a/modules/Admin/Controllers/PersonController.php +++ b/modules/Admin/Controllers/PersonController.php @@ -41,7 +41,7 @@ class PersonController extends BaseController 'persons' => (new PersonModel())->findAll(), ]; - return view('Modules\Admin\Views\person\list', $data); + return view('person/list', $data); } public function view(): string @@ -53,14 +53,14 @@ class PersonController extends BaseController replace_breadcrumb_params([ 0 => $this->person->full_name, ]); - return view('Modules\Admin\Views\person\view', $data); + return view('person/view', $data); } public function create(): string { helper(['form']); - return view('Modules\Admin\Views\person\create'); + return view('person/create'); } public function attemptCreate(): RedirectResponse @@ -113,7 +113,7 @@ class PersonController extends BaseController replace_breadcrumb_params([ 0 => $this->person->full_name, ]); - return view('Modules\Admin\Views\person\edit', $data); + return view('person/edit', $data); } public function attemptEdit(): RedirectResponse diff --git a/modules/Admin/Controllers/PodcastController.php b/modules/Admin/Controllers/PodcastController.php index 34c76228bcd5003a6131e8866928e789fc4b61e4..6999c7efbec65889d940f53da74331e6b83e3c84 100644 --- a/modules/Admin/Controllers/PodcastController.php +++ b/modules/Admin/Controllers/PodcastController.php @@ -53,7 +53,7 @@ class PodcastController extends BaseController ]; } - return view('Modules\Admin\Views\podcast\list', $data); + return view('podcast/list', $data); } public function view(): string @@ -65,7 +65,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\view', $data); + return view('podcast/view', $data); } public function viewAnalytics(): string @@ -77,7 +77,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\index', $data); + return view('podcast/analytics/index', $data); } public function viewAnalyticsWebpages(): string @@ -89,7 +89,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\webpages', $data); + return view('podcast/analytics/webpages', $data); } public function viewAnalyticsLocations(): string @@ -101,7 +101,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\locations', $data); + return view('podcast/analytics/locations', $data); } public function viewAnalyticsUniqueListeners(): string @@ -113,7 +113,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\unique_listeners', $data); + return view('podcast/analytics/unique_listeners', $data); } public function viewAnalyticsListeningTime(): string @@ -125,7 +125,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\listening_time', $data); + return view('podcast/analytics/listening_time', $data); } public function viewAnalyticsTimePeriods(): string @@ -137,7 +137,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\time_periods', $data); + return view('podcast/analytics/time_periods', $data); } public function viewAnalyticsPlayers(): string @@ -149,7 +149,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\analytics\players', $data); + return view('podcast/analytics/players', $data); } public function create(): string @@ -165,7 +165,7 @@ class PodcastController extends BaseController 'browserLang' => get_browser_language($this->request->getServer('HTTP_ACCEPT_LANGUAGE')), ]; - return view('Modules\Admin\Views\podcast\create', $data); + return view('podcast/create', $data); } public function attemptCreate(): RedirectResponse @@ -274,7 +274,7 @@ class PodcastController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\edit', $data); + return view('podcast/edit', $data); } public function attemptEdit(): RedirectResponse @@ -357,15 +357,16 @@ class PodcastController extends BaseController return redirect()->route('podcast-view', [$this->podcast->id]); } - public function latestEpisodes(int $limit, int $podcast_id): string + public function latestEpisodes(int $limit, int $podcastId): string { $episodes = (new EpisodeModel()) - ->where('podcast_id', $podcast_id) + ->where('podcast_id', $podcastId) ->orderBy('created_at', 'desc') ->findAll($limit); - return view('Modules\Admin\Views\podcast\latest_episodes', [ + return view('podcast/latest_episodes', [ 'episodes' => $episodes, + 'podcast' => (new PodcastModel())->getPodcastById($podcastId), ]); } diff --git a/modules/Admin/Controllers/PodcastImportController.php b/modules/Admin/Controllers/PodcastImportController.php index 0d84686134c7a27e9bf57def172cb43e22c9d8f8..4d750c4477df368a7a83c6c4d4ead86e49b452e2 100644 --- a/modules/Admin/Controllers/PodcastImportController.php +++ b/modules/Admin/Controllers/PodcastImportController.php @@ -58,7 +58,7 @@ class PodcastImportController extends BaseController 'browserLang' => get_browser_language($this->request->getServer('HTTP_ACCEPT_LANGUAGE')), ]; - return view('Modules\Admin\Views\podcast\import', $data); + return view('podcast/import', $data); } public function attemptImport(): RedirectResponse diff --git a/modules/Admin/Controllers/PodcastPersonController.php b/modules/Admin/Controllers/PodcastPersonController.php index 2704018eb5ef4ea3ef89eb375bc52a04ee3f632b..371c624625c1215943cb2af7aefb799187e65c16 100644 --- a/modules/Admin/Controllers/PodcastPersonController.php +++ b/modules/Admin/Controllers/PodcastPersonController.php @@ -49,7 +49,7 @@ class PodcastPersonController extends BaseController replace_breadcrumb_params([ 0 => $this->podcast->title, ]); - return view('Modules\Admin\Views\podcast\persons', $data); + return view('podcast/persons', $data); } public function attemptAdd(): RedirectResponse diff --git a/modules/Admin/Controllers/PodcastPlatformController.php b/modules/Admin/Controllers/PodcastPlatformController.php index 379a11abfebe6681d20c9bc142d66f1b87e37150..bc49bc374eb73d80258bd025f4a2755173307a28 100644 --- a/modules/Admin/Controllers/PodcastPlatformController.php +++ b/modules/Admin/Controllers/PodcastPlatformController.php @@ -39,7 +39,7 @@ class PodcastPlatformController extends BaseController public function index(): string { - return view('Modules\Admin\Views\podcast\platforms\dashboard'); + return view('podcast/platforms\dashboard'); } public function platforms(string $platformType): string @@ -56,9 +56,7 @@ class PodcastPlatformController extends BaseController 0 => $this->podcast->title, ]); - $view = view('Modules\Admin\Views\podcast\platforms', $data); - - return $view; + return view('podcast/platforms', $data); } public function attemptPlatformsUpdate(string $platformType): RedirectResponse diff --git a/modules/Admin/Controllers/UserController.php b/modules/Admin/Controllers/UserController.php index 5ce0d32754dbe4a06dc37395e28a03c3a908df52..15f2c661d556b11531d810d485f816fc896621b3 100644 --- a/modules/Admin/Controllers/UserController.php +++ b/modules/Admin/Controllers/UserController.php @@ -40,7 +40,7 @@ class UserController extends BaseController 'users' => (new UserModel())->findAll(), ]; - return view('Modules\Admin\Views\user\list', $data); + return view('user/list', $data); } public function view(): string @@ -52,7 +52,7 @@ class UserController extends BaseController replace_breadcrumb_params([ 0 => $this->user->username, ]); - return view('Modules\Admin\Views\user\view', $data); + return view('user/view', $data); } public function create(): string @@ -63,7 +63,7 @@ class UserController extends BaseController 'roles' => (new GroupModel())->getUserRoles(), ]; - return view('Modules\Admin\Views\user\create', $data); + return view('user/create', $data); } public function attemptCreate(): RedirectResponse @@ -135,7 +135,7 @@ class UserController extends BaseController replace_breadcrumb_params([ 0 => $this->user->username, ]); - return view('Modules\Admin\Views\user\edit', $data); + return view('user/edit', $data); } public function attemptEdit(): RedirectResponse diff --git a/modules/Auth/Config/Auth.php b/modules/Auth/Config/Auth.php index 98be59e61cb4a3e7e9c6d6b245fdaf504e61bb2a..1794d8f86100ccf0f09c9e1cb132ee9fa3b1ed83 100644 --- a/modules/Auth/Config/Auth.php +++ b/modules/Auth/Config/Auth.php @@ -16,12 +16,12 @@ class Auth extends MythAuthConfig * @var array<string, string> */ public $views = [ - 'login' => 'Modules\Auth\Views\login', - 'register' => 'Modules\Auth\Views\register', - 'forgot' => 'Modules\Auth\Views\forgot', - 'reset' => 'Modules\Auth\Views\reset', - 'emailForgot' => 'Modules\Auth\Views\emails\forgot', - 'emailActivation' => 'Modules\Auth\Views\emails\activation', + 'login' => 'login', + 'register' => 'register', + 'forgot' => 'forgot', + 'reset' => 'reset', + 'emailForgot' => 'emails/forgot', + 'emailActivation' => 'emails/activation', ]; /** @@ -31,7 +31,7 @@ class Auth extends MythAuthConfig * * @var string */ - public $viewLayout = 'Modules\Auth\Views\_layout'; + public $viewLayout = '_layout'; /** * -------------------------------------------------------------------------- diff --git a/modules/Auth/Controllers/AuthController.php b/modules/Auth/Controllers/AuthController.php index 6163e0b444f1f06c0d8c2063480643d4ba35afe9..10c23d7a25c15d701445e037b7f383aee94b1c19 100644 --- a/modules/Auth/Controllers/AuthController.php +++ b/modules/Auth/Controllers/AuthController.php @@ -13,6 +13,7 @@ namespace Modules\Auth\Controllers; use CodeIgniter\HTTP\RedirectResponse; use Modules\Auth\Entities\User; use Myth\Auth\Controllers\AuthController as MythAuthController; +use ViewThemes\Theme; class AuthController extends MythAuthController { @@ -23,6 +24,13 @@ class AuthController extends MythAuthController */ protected $helpers = ['components']; + public function __construct() + { + parent::__construct(); + + Theme::setTheme('auth'); + } + /** * Attempt to register a new user. */ diff --git a/modules/Install/Controllers/InstallController.php b/modules/Install/Controllers/InstallController.php index 1b0e8cada1e7246721b3c52954a4bb21ed5cd33f..63260eebb9c01d060a662cde266e4fa07d8b402f 100644 --- a/modules/Install/Controllers/InstallController.php +++ b/modules/Install/Controllers/InstallController.php @@ -24,6 +24,7 @@ use Dotenv\Exception\ValidationException; use Modules\Auth\Entities\User; use Psr\Log\LoggerInterface; use Throwable; +use ViewThemes\Theme; class InstallController extends Controller { @@ -42,6 +43,8 @@ class InstallController extends Controller ): void { // Do Not Edit This Line parent::initController($request, $response, $logger); + + Theme::setTheme('install'); } /** @@ -58,7 +61,7 @@ class InstallController extends Controller fclose($envFile); } catch (Throwable) { // Could not create the .env file, redirect to a view with instructions on how to add it manually - return view('Modules\Install\Views\manual_config'); + return view('manual_config'); } } @@ -106,7 +109,7 @@ class InstallController extends Controller 'cache.handler', ]); } catch (ValidationException) { - return view('Modules\Install\Views\manual_config'); + return view('manual_config'); } } @@ -127,7 +130,7 @@ class InstallController extends Controller session() ->setFlashdata('error', lang('Install.messages.databaseConnectError')); - return view('Modules\Install\Views\database_config'); + return view('database_config'); } // migrate if no user has been created @@ -141,7 +144,7 @@ class InstallController extends Controller public function instanceConfig(): string { - return view('Modules\Install\Views\instance_config'); + return view('instance_config'); } public function attemptInstanceConfig(): RedirectResponse @@ -178,7 +181,7 @@ class InstallController extends Controller public function databaseConfig(): string { - return view('Modules\Install\Views\database_config'); + return view('database_config'); } public function attemptDatabaseConfig(): RedirectResponse @@ -210,7 +213,7 @@ class InstallController extends Controller public function cacheConfig(): string { - return view('Modules\Install\Views\cache_config'); + return view('cache_config'); } public function attemptCacheConfig(): RedirectResponse @@ -268,7 +271,7 @@ class InstallController extends Controller */ public function createSuperAdmin(): string { - return view('Modules\Install\Views\create_superadmin'); + return view('create_superadmin'); } /** diff --git a/phpstan.neon b/phpstan.neon index 43e45fc77335aced123e2d55da274ed9e660b2ab..8db6aaed65e126eda28e9608a3cf8f54a5c66c27 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -16,6 +16,7 @@ parameters: - app/Libraries/Router.php - app/Views/* - modules/*/Views/* + - themes/* ignoreErrors: - '#This property type might be inlined to PHP. Do you have confidence it is correct\? Put it here#' - '#^Cognitive complexity for#' @@ -31,3 +32,4 @@ parameters: message: '#Function "function_exists\(\)" cannot be used/left in the code#' paths: - app/Helpers + - app/Common.php diff --git a/tailwind.config.js b/tailwind.config.js index 922fe549fc498e93714c7d5f9f97b85121680137..ce028e812bdb543beff8ac99f7913023b604c84b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -6,6 +6,7 @@ module.exports = { "./app/Views/**/*.php", "./app/View/Components/**/*.php", "./modules/**/Views/**/*.php", + "./themes/**/*.php", "./app/Helpers/*.php", "./app/Resources/**/*.ts", ], diff --git a/modules/Admin/Views/_layout.php b/themes/cp_admin/_layout.php similarity index 93% rename from modules/Admin/Views/_layout.php rename to themes/cp_admin/_layout.php index 1232eb903e18e7970d89dccac376d382a2e66d50..9ecdaa3f5787876ec780c7d277721b9ee35f5105 100644 --- a/modules/Admin/Views/_layout.php +++ b/themes/cp_admin/_layout.php @@ -17,9 +17,9 @@ <div id="sidebar-backdrop" role="button" tabIndex="0" aria-label="Close" class="fixed z-50 hidden w-full h-full bg-gray-900 bg-opacity-50 md:hidden"></div> <aside id="admin-sidebar" class="sticky top-0 z-50 flex flex-col max-h-screen transition duration-200 ease-in-out transform -translate-x-full bg-white border-r w-80 holy-grail-sidebar md:translate-x-0"> <?php if (isset($podcast)): ?> - <?= $this->include('Modules\Admin\Views\podcast\_sidebar') ?> + <?= $this->include('podcast/_sidebar') ?> <?php else: ?> - <?= $this->include('Modules\Admin\Views\_sidebar') ?> + <?= $this->include('_sidebar') ?> <?php endif; ?> </aside> <main class="holy-grail-main"> @@ -40,7 +40,7 @@ </div> </header> <div class="container px-2 py-8 mx-auto md:px-12"> - <?= view('_message_block') ?> + <!-- view('App\Views\_message_block') --> <?= $this->renderSection('content') ?> </div> </main> diff --git a/modules/Admin/Views/_partials/_user_info.php b/themes/cp_admin/_partials/_user_info.php similarity index 100% rename from modules/Admin/Views/_partials/_user_info.php rename to themes/cp_admin/_partials/_user_info.php diff --git a/modules/Admin/Views/_sidebar.php b/themes/cp_admin/_sidebar.php similarity index 100% rename from modules/Admin/Views/_sidebar.php rename to themes/cp_admin/_sidebar.php diff --git a/modules/Admin/Views/contributor/add.php b/themes/cp_admin/contributor/add.php similarity index 95% rename from modules/Admin/Views/contributor/add.php rename to themes/cp_admin/contributor/add.php index 4fbbf7c2f7e1e04859019e650d13faadce1786d3..9accb73b0e5eaa578d272fd9c9c05df9aa91060b 100644 --- a/modules/Admin/Views/contributor/add.php +++ b/themes/cp_admin/contributor/add.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Contributor.add_contributor', [$podcast->title]) ?> diff --git a/modules/Admin/Views/contributor/edit.php b/themes/cp_admin/contributor/edit.php similarity index 94% rename from modules/Admin/Views/contributor/edit.php rename to themes/cp_admin/contributor/edit.php index b49818e07984a2f62c4725414a090769c7b6d689..dd93510e5f229508855ce8b71e38ddd301e513db 100644 --- a/modules/Admin/Views/contributor/edit.php +++ b/themes/cp_admin/contributor/edit.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Contributor.edit_role', [$user->username]) ?> diff --git a/modules/Admin/Views/contributor/list.php b/themes/cp_admin/contributor/list.php similarity index 97% rename from modules/Admin/Views/contributor/list.php rename to themes/cp_admin/contributor/list.php index 60d1c18a1104329cee58386c730f501d250ee012..49b440f5803afaaafb02ffa4a32593b7195d94b1 100644 --- a/modules/Admin/Views/contributor/list.php +++ b/themes/cp_admin/contributor/list.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Contributor.podcast_contributors') ?> diff --git a/modules/Admin/Views/contributor/view.php b/themes/cp_admin/contributor/view.php similarity index 94% rename from modules/Admin/Views/contributor/view.php rename to themes/cp_admin/contributor/view.php index 98bcb1960188590dcdd1ef63d723c0f24e52179c..7476b15e6231551cfa6acc278dd6fae36be3b8cc 100644 --- a/modules/Admin/Views/contributor/view.php +++ b/themes/cp_admin/contributor/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Contributor.view', [ diff --git a/modules/Admin/Views/dashboard.php b/themes/cp_admin/dashboard.php similarity index 85% rename from modules/Admin/Views/dashboard.php rename to themes/cp_admin/dashboard.php index 3db6af697fefd0faa8060cc616b9944213ecf335..7dce6c0d1d728f7be6cfc85216ba1da5fb511abc 100644 --- a/modules/Admin/Views/dashboard.php +++ b/themes/cp_admin/dashboard.php @@ -1,5 +1,5 @@ <?= helper('components') ?> -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Admin.dashboard') ?> diff --git a/modules/Admin/Views/episode/create.php b/themes/cp_admin/episode/create.php similarity index 99% rename from modules/Admin/Views/episode/create.php rename to themes/cp_admin/episode/create.php index b6bae04860def57f23dc3fc3360213f2661f09c5..86810d0f45bbade4eba8320f6c9147f3744564e1 100644 --- a/modules/Admin/Views/episode/create.php +++ b/themes/cp_admin/episode/create.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.create') ?> diff --git a/modules/Admin/Views/episode/edit.php b/themes/cp_admin/episode/edit.php similarity index 99% rename from modules/Admin/Views/episode/edit.php rename to themes/cp_admin/episode/edit.php index 051968d2242ba58f12c0426617991b8e43112095..be1470944f9867224fb124f09feffd73da6d8e58 100644 --- a/modules/Admin/Views/episode/edit.php +++ b/themes/cp_admin/episode/edit.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.edit') ?> diff --git a/modules/Admin/Views/episode/embeddable_player.php b/themes/cp_admin/episode/embeddable_player.php similarity index 97% rename from modules/Admin/Views/episode/embeddable_player.php rename to themes/cp_admin/episode/embeddable_player.php index 7738c1f3429539eb82124a249bb4ffca9bc96c80..207b172be4dff35cebf8badca8c7e2c98904b84d 100644 --- a/modules/Admin/Views/episode/embeddable_player.php +++ b/themes/cp_admin/episode/embeddable_player.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.embeddable_player.title') ?> diff --git a/modules/Admin/Views/episode/list.php b/themes/cp_admin/episode/list.php similarity index 99% rename from modules/Admin/Views/episode/list.php rename to themes/cp_admin/episode/list.php index b67f42ebb5335a93d72d9a809b56c0369290fa31..6e033f3983ea3fa8dd5e73661f4be7c414a26e5f 100644 --- a/modules/Admin/Views/episode/list.php +++ b/themes/cp_admin/episode/list.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.all_podcast_episodes') ?> diff --git a/modules/Admin/Views/episode/persons.php b/themes/cp_admin/episode/persons.php similarity index 98% rename from modules/Admin/Views/episode/persons.php rename to themes/cp_admin/episode/persons.php index aca39770c065a1a036df6beb9adaba389c21cdc8..dca30225d4f79581c9466a74a4bf2fe44c88b7bc 100644 --- a/modules/Admin/Views/episode/persons.php +++ b/themes/cp_admin/episode/persons.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Person.episode_form.title') ?> diff --git a/modules/Admin/Views/episode/publish.php b/themes/cp_admin/episode/publish.php similarity index 99% rename from modules/Admin/Views/episode/publish.php rename to themes/cp_admin/episode/publish.php index 9804b2cd42b2f532d3dc389f0d7ea84b421a15d1..1e80bc75413a810385e116b4cbc8c78294ea8116 100644 --- a/modules/Admin/Views/episode/publish.php +++ b/themes/cp_admin/episode/publish.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.publish') ?> diff --git a/modules/Admin/Views/episode/publish_edit.php b/themes/cp_admin/episode/publish_edit.php similarity index 99% rename from modules/Admin/Views/episode/publish_edit.php rename to themes/cp_admin/episode/publish_edit.php index 08cdb94dd9244bd732b6d3d31341fef1a596f610..bfa93ed97f98f326eba15c266a7e578c8bf8215b 100644 --- a/modules/Admin/Views/episode/publish_edit.php +++ b/themes/cp_admin/episode/publish_edit.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.publish_edit') ?> diff --git a/modules/Admin/Views/episode/soundbites.php b/themes/cp_admin/episode/soundbites.php similarity index 99% rename from modules/Admin/Views/episode/soundbites.php rename to themes/cp_admin/episode/soundbites.php index dd97aecb441446c25ac3ca7b6f7a8949aac959e3..08248097e45f6fde9bb20f007b07fe66cbff92a3 100644 --- a/modules/Admin/Views/episode/soundbites.php +++ b/themes/cp_admin/episode/soundbites.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.soundbites_form.title') ?> diff --git a/modules/Admin/Views/episode/unpublish.php b/themes/cp_admin/episode/unpublish.php similarity index 96% rename from modules/Admin/Views/episode/unpublish.php rename to themes/cp_admin/episode/unpublish.php index 3deeb58331e8636f51d1c0c01b3d25b52c23782a..17fe5db35dc359d8de55e4bccf15ae0ac2849968 100644 --- a/modules/Admin/Views/episode/unpublish.php +++ b/themes/cp_admin/episode/unpublish.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Episode.unpublish') ?> diff --git a/modules/Admin/Views/episode/view.php b/themes/cp_admin/episode/view.php similarity index 98% rename from modules/Admin/Views/episode/view.php rename to themes/cp_admin/episode/view.php index a4f207c8079c3eb05875a911a3b16dccd7dfc887..54ce4b1519e1b80f5b1349365af4e28d23f7a833 100644 --- a/modules/Admin/Views/episode/view.php +++ b/themes/cp_admin/episode/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $episode->title ?> diff --git a/modules/Admin/Views/fediverse/blocked_actors.php b/themes/cp_admin/fediverse/blocked_actors.php similarity index 97% rename from modules/Admin/Views/fediverse/blocked_actors.php rename to themes/cp_admin/fediverse/blocked_actors.php index 5d4438e166745590843c849c9abe072a8f40384a..af2bab9ea8532f583589272ee4a22929672bab33 100644 --- a/modules/Admin/Views/fediverse/blocked_actors.php +++ b/themes/cp_admin/fediverse/blocked_actors.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Fediverse.blocked_actors') ?> diff --git a/modules/Admin/Views/fediverse/blocked_domains.php b/themes/cp_admin/fediverse/blocked_domains.php similarity index 97% rename from modules/Admin/Views/fediverse/blocked_domains.php rename to themes/cp_admin/fediverse/blocked_domains.php index cdf9df4f5d74c5055a4aee41a6c4842f1fede482..77ef604edc5277806199006470990f7b0d3b10d6 100644 --- a/modules/Admin/Views/fediverse/blocked_domains.php +++ b/themes/cp_admin/fediverse/blocked_domains.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Fediverse.blocked_domains') ?> diff --git a/themes/cp_admin/manifest.json b/themes/cp_admin/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..6509e6a0a27c7cd4899308a55a47e81aee2ae5ee --- /dev/null +++ b/themes/cp_admin/manifest.json @@ -0,0 +1,4 @@ +{ + "name": "Castopod Admin", + "description": "Castopod's default theme for admin" +} diff --git a/modules/Admin/Views/my_account/change_password.php b/themes/cp_admin/my_account/change_password.php similarity index 95% rename from modules/Admin/Views/my_account/change_password.php rename to themes/cp_admin/my_account/change_password.php index 7cf61b6f564982474a876d017da59188707985b2..0cbbe9be801e5378e925731b884e5a1fb7fe69cc 100644 --- a/modules/Admin/Views/my_account/change_password.php +++ b/themes/cp_admin/my_account/change_password.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('MyAccount.changePassword') ?> diff --git a/modules/Admin/Views/my_account/view.php b/themes/cp_admin/my_account/view.php similarity index 65% rename from modules/Admin/Views/my_account/view.php rename to themes/cp_admin/my_account/view.php index f497adacfd5dd3bc2d7b754b0439ad869e203119..fc866674ace33b567522ca847a44cb38282231cc 100644 --- a/modules/Admin/Views/my_account/view.php +++ b/themes/cp_admin/my_account/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('MyAccount.info') ?> @@ -11,6 +11,6 @@ <?= $this->section('content') ?> -<?= view('Modules\Admin\Views\_partials/_user_info.php', ['user' => user()]) ?> +<?= view('_partials/_user_info.php', ['user' => user()]) ?> <?= $this->endSection() ?> diff --git a/modules/Admin/Views/page/create.php b/themes/cp_admin/page/create.php similarity index 96% rename from modules/Admin/Views/page/create.php rename to themes/cp_admin/page/create.php index 0fccd6b44b58daf3d82b4b9c658b37f6edf8800d..4e22306ca2d9360130c6c3b07cfa9376448585d4 100644 --- a/modules/Admin/Views/page/create.php +++ b/themes/cp_admin/page/create.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Page.create') ?> diff --git a/modules/Admin/Views/page/edit.php b/themes/cp_admin/page/edit.php similarity index 96% rename from modules/Admin/Views/page/edit.php rename to themes/cp_admin/page/edit.php index d5ae383ae5b85546adba9ce9ab7140609fe38347..b23f2e756ce295a76e93d0e2343dda6906fb4df2 100644 --- a/modules/Admin/Views/page/edit.php +++ b/themes/cp_admin/page/edit.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Page.edit') ?> diff --git a/modules/Admin/Views/page/list.php b/themes/cp_admin/page/list.php similarity index 97% rename from modules/Admin/Views/page/list.php rename to themes/cp_admin/page/list.php index c3faf20cc0d9bff6f5882bba4dd850df6903410c..a780e0421028f48f19a8848aba08c0a55e939015 100644 --- a/modules/Admin/Views/page/list.php +++ b/themes/cp_admin/page/list.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Page.all_pages') ?> diff --git a/modules/Admin/Views/page/view.php b/themes/cp_admin/page/view.php similarity index 90% rename from modules/Admin/Views/page/view.php rename to themes/cp_admin/page/view.php index 4d7a59d959375c40955225ca4b2cab3b8c530ddd..db28d587e87daf6e150bd1555deb6e4fb21d8cbe 100644 --- a/modules/Admin/Views/page/view.php +++ b/themes/cp_admin/page/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $page->title ?> diff --git a/modules/Admin/Views/person/create.php b/themes/cp_admin/person/create.php similarity index 97% rename from modules/Admin/Views/person/create.php rename to themes/cp_admin/person/create.php index 3458cf739b253b4a4396be8063b76faac9701a17..4eee7be1357bb7660713e09c6785b3dd3ef6d97a 100644 --- a/modules/Admin/Views/person/create.php +++ b/themes/cp_admin/person/create.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Person.create') ?> diff --git a/modules/Admin/Views/person/edit.php b/themes/cp_admin/person/edit.php similarity index 97% rename from modules/Admin/Views/person/edit.php rename to themes/cp_admin/person/edit.php index bbca43db0c50aee3aec2ee0fd95c257d8d948670..e7bd273aa4179e5be3ad819ee399fef913418de1 100644 --- a/modules/Admin/Views/person/edit.php +++ b/themes/cp_admin/person/edit.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Person.edit') ?> diff --git a/modules/Admin/Views/person/list.php b/themes/cp_admin/person/list.php similarity index 97% rename from modules/Admin/Views/person/list.php rename to themes/cp_admin/person/list.php index ef2a72995557ce08b602c51798350e096abd16dd..0da3d289e8c9a60172708f0f82367bfde761491d 100644 --- a/modules/Admin/Views/person/list.php +++ b/themes/cp_admin/person/list.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Person.all_persons') ?> diff --git a/modules/Admin/Views/person/view.php b/themes/cp_admin/person/view.php similarity index 94% rename from modules/Admin/Views/person/view.php rename to themes/cp_admin/person/view.php index 19a277ded88510ef323971d6be74e716ba63a7b1..94d7c9b7d12aca2e0062dda4d88e3f4108077951 100644 --- a/modules/Admin/Views/person/view.php +++ b/themes/cp_admin/person/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $person->full_name ?> diff --git a/modules/Admin/Views/podcast/_sidebar.php b/themes/cp_admin/podcast/_sidebar.php similarity index 100% rename from modules/Admin/Views/podcast/_sidebar.php rename to themes/cp_admin/podcast/_sidebar.php diff --git a/modules/Admin/Views/podcast/analytics/index.php b/themes/cp_admin/podcast/analytics/index.php similarity index 95% rename from modules/Admin/Views/podcast/analytics/index.php rename to themes/cp_admin/podcast/analytics/index.php index c80e79670ac9feb40530ceb1695eb23ff6a398a1..028deac2e5d7cf9aade9bb41e4b053bddd578cb1 100644 --- a/modules/Admin/Views/podcast/analytics/index.php +++ b/themes/cp_admin/podcast/analytics/index.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/analytics/listening_time.php b/themes/cp_admin/podcast/analytics/listening_time.php similarity index 94% rename from modules/Admin/Views/podcast/analytics/listening_time.php rename to themes/cp_admin/podcast/analytics/listening_time.php index 23a7f9896b17e3f0edc8a7f8753c9f8258d3715e..0a1c7b296096080e697edf09a97d33f2ede50321 100644 --- a/modules/Admin/Views/podcast/analytics/listening_time.php +++ b/themes/cp_admin/podcast/analytics/listening_time.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/analytics/locations.php b/themes/cp_admin/podcast/analytics/locations.php similarity index 96% rename from modules/Admin/Views/podcast/analytics/locations.php rename to themes/cp_admin/podcast/analytics/locations.php index cb4c5e9709e0f9b814abfac568f8385a1300494e..05cb4fd8a4c21cda52bca1cdaf50182a9f575246 100644 --- a/modules/Admin/Views/podcast/analytics/locations.php +++ b/themes/cp_admin/podcast/analytics/locations.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/analytics/players.php b/themes/cp_admin/podcast/analytics/players.php similarity index 97% rename from modules/Admin/Views/podcast/analytics/players.php rename to themes/cp_admin/podcast/analytics/players.php index 6688d499cc771713ccdf1de4553af54618789c09..e76c9e3ac7bac0292f37a11ef7365c1c60a996d0 100644 --- a/modules/Admin/Views/podcast/analytics/players.php +++ b/themes/cp_admin/podcast/analytics/players.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/analytics/time_periods.php b/themes/cp_admin/podcast/analytics/time_periods.php similarity index 95% rename from modules/Admin/Views/podcast/analytics/time_periods.php rename to themes/cp_admin/podcast/analytics/time_periods.php index aad964d0c8d9d1a9ff251c081096df7002d60023..7c8bef9180aee2923e313d1a0c734232f21c8d85 100644 --- a/modules/Admin/Views/podcast/analytics/time_periods.php +++ b/themes/cp_admin/podcast/analytics/time_periods.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/analytics/unique_listeners.php b/themes/cp_admin/podcast/analytics/unique_listeners.php similarity index 94% rename from modules/Admin/Views/podcast/analytics/unique_listeners.php rename to themes/cp_admin/podcast/analytics/unique_listeners.php index 9a2c01db96c95f698b673e3158c10a1b159d64fd..5b6c4c255593a563245a20f453a4bbc4026cbe2f 100644 --- a/modules/Admin/Views/podcast/analytics/unique_listeners.php +++ b/themes/cp_admin/podcast/analytics/unique_listeners.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/analytics/webpages.php b/themes/cp_admin/podcast/analytics/webpages.php similarity index 97% rename from modules/Admin/Views/podcast/analytics/webpages.php rename to themes/cp_admin/podcast/analytics/webpages.php index befddd72175ae26101d2695fb118c8efb3223c37..58b2178f10a05e2a0c1d4dc54e07e0c125b9ea93 100644 --- a/modules/Admin/Views/podcast/analytics/webpages.php +++ b/themes/cp_admin/podcast/analytics/webpages.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> diff --git a/modules/Admin/Views/podcast/create.php b/themes/cp_admin/podcast/create.php similarity index 99% rename from modules/Admin/Views/podcast/create.php rename to themes/cp_admin/podcast/create.php index ca5ec8f862fb57b45af310626718ba55033b5b90..fbc893102f134d74cce6fef33c018fdd63bacc23 100644 --- a/modules/Admin/Views/podcast/create.php +++ b/themes/cp_admin/podcast/create.php @@ -1,7 +1,7 @@ <?php ?> -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Podcast.create') ?> diff --git a/modules/Admin/Views/podcast/edit.php b/themes/cp_admin/podcast/edit.php similarity index 98% rename from modules/Admin/Views/podcast/edit.php rename to themes/cp_admin/podcast/edit.php index bf21b9352b5b1e26b784f28e073633702fb8ae22..618b6c47e59ba9f8f71c8f660479ce488af5e622 100644 --- a/modules/Admin/Views/podcast/edit.php +++ b/themes/cp_admin/podcast/edit.php @@ -1,7 +1,7 @@ <?php ?> -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Podcast.edit') ?> @@ -363,7 +363,7 @@ lang('Podcast.form.classification_section_subtitle'), <?= form_section_close() ?> -<Button variant="primary" type="submit" class="self-end" iconLeft="heart"> +<Button variant="primary" type="submit" class="self-end"> <?= lang('Podcast.form.submit_edit') ?> </Button> diff --git a/modules/Admin/Views/podcast/import.php b/themes/cp_admin/podcast/import.php similarity index 99% rename from modules/Admin/Views/podcast/import.php rename to themes/cp_admin/podcast/import.php index f8740b7a3d5e79fbd36b6edab7b1c380e930a744..7d279a930487faa0ccbd0a1b51738c2302b0e636 100644 --- a/modules/Admin/Views/podcast/import.php +++ b/themes/cp_admin/podcast/import.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Podcast.import') ?> diff --git a/modules/Admin/Views/podcast/latest_episodes.php b/themes/cp_admin/podcast/latest_episodes.php similarity index 100% rename from modules/Admin/Views/podcast/latest_episodes.php rename to themes/cp_admin/podcast/latest_episodes.php diff --git a/modules/Admin/Views/podcast/list.php b/themes/cp_admin/podcast/list.php similarity index 97% rename from modules/Admin/Views/podcast/list.php rename to themes/cp_admin/podcast/list.php index f9ddce561d33150d14e8a71d93fd923889b30ec6..728eca1cc20d768fdd4ecfedcfa867e223d8d3b5 100644 --- a/modules/Admin/Views/podcast/list.php +++ b/themes/cp_admin/podcast/list.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Podcast.all_podcasts') ?> diff --git a/modules/Admin/Views/podcast/persons.php b/themes/cp_admin/podcast/persons.php similarity index 98% rename from modules/Admin/Views/podcast/persons.php rename to themes/cp_admin/podcast/persons.php index 1f79dfdd3c9f7eb2f167621018137bb2ec7b491a..719e60200b97a950306c937a92ee7f0c87ef3fa3 100644 --- a/modules/Admin/Views/podcast/persons.php +++ b/themes/cp_admin/podcast/persons.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Person.podcast_form.title') ?> diff --git a/modules/Admin/Views/podcast/platforms.php b/themes/cp_admin/podcast/platforms.php similarity index 98% rename from modules/Admin/Views/podcast/platforms.php rename to themes/cp_admin/podcast/platforms.php index 8d1ecf35c1401df882d9ab7d73645fc945b4d895..a63767851f997bf4bad82df98173da9a7efd588e 100644 --- a/modules/Admin/Views/podcast/platforms.php +++ b/themes/cp_admin/podcast/platforms.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Platforms.title') ?> diff --git a/modules/Admin/Views/podcast/settings/dashboard.php b/themes/cp_admin/podcast/settings/dashboard.php similarity index 84% rename from modules/Admin/Views/podcast/settings/dashboard.php rename to themes/cp_admin/podcast/settings/dashboard.php index ac35812f4ac743a2fea18eddc9c6e635f5d368ef..87150c4f6d5b10d98b659a9437a58de0633cdb0d 100644 --- a/modules/Admin/Views/podcast/settings/dashboard.php +++ b/themes/cp_admin/podcast/settings/dashboard.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('Podcast.platforms.title') ?> diff --git a/modules/Admin/Views/podcast/view.php b/themes/cp_admin/podcast/view.php similarity index 90% rename from modules/Admin/Views/podcast/view.php rename to themes/cp_admin/podcast/view.php index dc3634c785eea92e8847f33445485b4e8a892799..c8d9da56cabafa464d121a48a46a2780c5438da7 100644 --- a/modules/Admin/Views/podcast/view.php +++ b/themes/cp_admin/podcast/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= $podcast->title ?> @@ -29,7 +29,7 @@ <?= view_cell('Modules\Admin\Controllers\PodcastController::latestEpisodes', [ 'limit' => 5, - 'podcast_id' => $podcast->id, + 'podcastId' => $podcast->id, ]) ?> <?= $this->endSection() ?> diff --git a/modules/Admin/Views/user/create.php b/themes/cp_admin/user/create.php similarity index 95% rename from modules/Admin/Views/user/create.php rename to themes/cp_admin/user/create.php index 7175b4330ee350f6fa198b1122e08c8597de1f8d..47967cc831804269e707aa959dc5de7f39352d82 100644 --- a/modules/Admin/Views/user/create.php +++ b/themes/cp_admin/user/create.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('User.create') ?> diff --git a/modules/Admin/Views/user/edit.php b/themes/cp_admin/user/edit.php similarity index 94% rename from modules/Admin/Views/user/edit.php rename to themes/cp_admin/user/edit.php index 77a5d6a2f6c7289a521d1a60fb2329e47ffb0d1c..0db5f0e47420fee9b154306bc75ad0818aa079c9 100644 --- a/modules/Admin/Views/user/edit.php +++ b/themes/cp_admin/user/edit.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('User.edit_roles', ['username' => $user->username]) ?> diff --git a/modules/Admin/Views/user/list.php b/themes/cp_admin/user/list.php similarity index 98% rename from modules/Admin/Views/user/list.php rename to themes/cp_admin/user/list.php index 2771199f77e795c4210e2edc5cadb253b8269c57..3ae8e41ca91b73c987ff2882591ed487c45fc78c 100644 --- a/modules/Admin/Views/user/list.php +++ b/themes/cp_admin/user/list.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('User.all_users') ?> diff --git a/modules/Admin/Views/user/view.php b/themes/cp_admin/user/view.php similarity index 58% rename from modules/Admin/Views/user/view.php rename to themes/cp_admin/user/view.php index 462519ffd779ff0f923f16e830636a952b566c62..020bd587f9240092c00d5237ceb1c34d171ab1fa 100644 --- a/modules/Admin/Views/user/view.php +++ b/themes/cp_admin/user/view.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Admin\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('title') ?> <?= lang('User.view', ['username' => $user->username]) ?> @@ -7,6 +7,6 @@ <?= $this->section('content') ?> -<?= view('Modules\Admin\Views\_partials/_user_info.php', ['user' => $user]) ?> +<?= view('_partials/_user_info.php', ['user' => $user]) ?> <?= $this->endSection() ?> diff --git a/app/Views/_layout.php b/themes/cp_app/_layout.php similarity index 100% rename from app/Views/_layout.php rename to themes/cp_app/_layout.php diff --git a/app/Views/credits.php b/themes/cp_app/credits.php similarity index 100% rename from app/Views/credits.php rename to themes/cp_app/credits.php diff --git a/app/Views/embeddable_player.php b/themes/cp_app/embeddable_player.php similarity index 100% rename from app/Views/embeddable_player.php rename to themes/cp_app/embeddable_player.php diff --git a/app/Views/home.php b/themes/cp_app/home.php similarity index 100% rename from app/Views/home.php rename to themes/cp_app/home.php diff --git a/themes/cp_app/manifest.json b/themes/cp_app/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..19282addb42ec71c40a96711003e1a96ad15c130 --- /dev/null +++ b/themes/cp_app/manifest.json @@ -0,0 +1,4 @@ +{ + "name": "Castopod App", + "description": "Castopod's default theme for app" +} diff --git a/app/Views/page.php b/themes/cp_app/page.php similarity index 100% rename from app/Views/page.php rename to themes/cp_app/page.php diff --git a/app/Views/podcast/_layout.php b/themes/cp_app/podcast/_layout.php similarity index 100% rename from app/Views/podcast/_layout.php rename to themes/cp_app/podcast/_layout.php diff --git a/app/Views/podcast/_layout_authenticated.php b/themes/cp_app/podcast/_layout_authenticated.php similarity index 100% rename from app/Views/podcast/_layout_authenticated.php rename to themes/cp_app/podcast/_layout_authenticated.php diff --git a/app/Views/podcast/_partials/comment.php b/themes/cp_app/podcast/_partials/comment.php similarity index 100% rename from app/Views/podcast/_partials/comment.php rename to themes/cp_app/podcast/_partials/comment.php diff --git a/app/Views/podcast/_partials/comment_actions.php b/themes/cp_app/podcast/_partials/comment_actions.php similarity index 100% rename from app/Views/podcast/_partials/comment_actions.php rename to themes/cp_app/podcast/_partials/comment_actions.php diff --git a/app/Views/podcast/_partials/comment_actions_authenticated.php b/themes/cp_app/podcast/_partials/comment_actions_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_actions_authenticated.php rename to themes/cp_app/podcast/_partials/comment_actions_authenticated.php diff --git a/app/Views/podcast/_partials/comment_actions_from_post.php b/themes/cp_app/podcast/_partials/comment_actions_from_post.php similarity index 100% rename from app/Views/podcast/_partials/comment_actions_from_post.php rename to themes/cp_app/podcast/_partials/comment_actions_from_post.php diff --git a/app/Views/podcast/_partials/comment_actions_from_post_authenticated.php b/themes/cp_app/podcast/_partials/comment_actions_from_post_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_actions_from_post_authenticated.php rename to themes/cp_app/podcast/_partials/comment_actions_from_post_authenticated.php diff --git a/app/Views/podcast/_partials/comment_authenticated.php b/themes/cp_app/podcast/_partials/comment_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_authenticated.php rename to themes/cp_app/podcast/_partials/comment_authenticated.php diff --git a/app/Views/podcast/_partials/comment_card.php b/themes/cp_app/podcast/_partials/comment_card.php similarity index 100% rename from app/Views/podcast/_partials/comment_card.php rename to themes/cp_app/podcast/_partials/comment_card.php diff --git a/app/Views/podcast/_partials/comment_card_authenticated.php b/themes/cp_app/podcast/_partials/comment_card_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_card_authenticated.php rename to themes/cp_app/podcast/_partials/comment_card_authenticated.php diff --git a/app/Views/podcast/_partials/comment_reply.php b/themes/cp_app/podcast/_partials/comment_reply.php similarity index 100% rename from app/Views/podcast/_partials/comment_reply.php rename to themes/cp_app/podcast/_partials/comment_reply.php diff --git a/app/Views/podcast/_partials/comment_reply_actions.php b/themes/cp_app/podcast/_partials/comment_reply_actions.php similarity index 100% rename from app/Views/podcast/_partials/comment_reply_actions.php rename to themes/cp_app/podcast/_partials/comment_reply_actions.php diff --git a/app/Views/podcast/_partials/comment_reply_actions_authenticated.php b/themes/cp_app/podcast/_partials/comment_reply_actions_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_reply_actions_authenticated.php rename to themes/cp_app/podcast/_partials/comment_reply_actions_authenticated.php diff --git a/app/Views/podcast/_partials/comment_reply_authenticated.php b/themes/cp_app/podcast/_partials/comment_reply_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_reply_authenticated.php rename to themes/cp_app/podcast/_partials/comment_reply_authenticated.php diff --git a/app/Views/podcast/_partials/comment_with_replies.php b/themes/cp_app/podcast/_partials/comment_with_replies.php similarity index 100% rename from app/Views/podcast/_partials/comment_with_replies.php rename to themes/cp_app/podcast/_partials/comment_with_replies.php diff --git a/app/Views/podcast/_partials/comment_with_replies_authenticated.php b/themes/cp_app/podcast/_partials/comment_with_replies_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/comment_with_replies_authenticated.php rename to themes/cp_app/podcast/_partials/comment_with_replies_authenticated.php diff --git a/app/Views/podcast/_partials/episode_card.php b/themes/cp_app/podcast/_partials/episode_card.php similarity index 100% rename from app/Views/podcast/_partials/episode_card.php rename to themes/cp_app/podcast/_partials/episode_card.php diff --git a/app/Views/podcast/_partials/episode_preview_card.php b/themes/cp_app/podcast/_partials/episode_preview_card.php similarity index 100% rename from app/Views/podcast/_partials/episode_preview_card.php rename to themes/cp_app/podcast/_partials/episode_preview_card.php diff --git a/app/Views/podcast/_partials/header.php b/themes/cp_app/podcast/_partials/header.php similarity index 100% rename from app/Views/podcast/_partials/header.php rename to themes/cp_app/podcast/_partials/header.php diff --git a/app/Views/podcast/_partials/post.php b/themes/cp_app/podcast/_partials/post.php similarity index 100% rename from app/Views/podcast/_partials/post.php rename to themes/cp_app/podcast/_partials/post.php diff --git a/app/Views/podcast/_partials/post_actions.php b/themes/cp_app/podcast/_partials/post_actions.php similarity index 100% rename from app/Views/podcast/_partials/post_actions.php rename to themes/cp_app/podcast/_partials/post_actions.php diff --git a/app/Views/podcast/_partials/post_actions_authenticated.php b/themes/cp_app/podcast/_partials/post_actions_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/post_actions_authenticated.php rename to themes/cp_app/podcast/_partials/post_actions_authenticated.php diff --git a/app/Views/podcast/_partials/post_authenticated.php b/themes/cp_app/podcast/_partials/post_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/post_authenticated.php rename to themes/cp_app/podcast/_partials/post_authenticated.php diff --git a/app/Views/podcast/_partials/post_with_replies.php b/themes/cp_app/podcast/_partials/post_with_replies.php similarity index 100% rename from app/Views/podcast/_partials/post_with_replies.php rename to themes/cp_app/podcast/_partials/post_with_replies.php diff --git a/app/Views/podcast/_partials/post_with_replies_authenticated.php b/themes/cp_app/podcast/_partials/post_with_replies_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/post_with_replies_authenticated.php rename to themes/cp_app/podcast/_partials/post_with_replies_authenticated.php diff --git a/app/Views/podcast/_partials/preview_card.php b/themes/cp_app/podcast/_partials/preview_card.php similarity index 100% rename from app/Views/podcast/_partials/preview_card.php rename to themes/cp_app/podcast/_partials/preview_card.php diff --git a/app/Views/podcast/_partials/reblog.php b/themes/cp_app/podcast/_partials/reblog.php similarity index 100% rename from app/Views/podcast/_partials/reblog.php rename to themes/cp_app/podcast/_partials/reblog.php diff --git a/app/Views/podcast/_partials/reblog_authenticated.php b/themes/cp_app/podcast/_partials/reblog_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/reblog_authenticated.php rename to themes/cp_app/podcast/_partials/reblog_authenticated.php diff --git a/app/Views/podcast/_partials/reply.php b/themes/cp_app/podcast/_partials/reply.php similarity index 100% rename from app/Views/podcast/_partials/reply.php rename to themes/cp_app/podcast/_partials/reply.php diff --git a/app/Views/podcast/_partials/reply_actions.php b/themes/cp_app/podcast/_partials/reply_actions.php similarity index 100% rename from app/Views/podcast/_partials/reply_actions.php rename to themes/cp_app/podcast/_partials/reply_actions.php diff --git a/app/Views/podcast/_partials/reply_actions_authenticated.php b/themes/cp_app/podcast/_partials/reply_actions_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/reply_actions_authenticated.php rename to themes/cp_app/podcast/_partials/reply_actions_authenticated.php diff --git a/app/Views/podcast/_partials/reply_authenticated.php b/themes/cp_app/podcast/_partials/reply_authenticated.php similarity index 100% rename from app/Views/podcast/_partials/reply_authenticated.php rename to themes/cp_app/podcast/_partials/reply_authenticated.php diff --git a/app/Views/podcast/_partials/sidebar.php b/themes/cp_app/podcast/_partials/sidebar.php similarity index 100% rename from app/Views/podcast/_partials/sidebar.php rename to themes/cp_app/podcast/_partials/sidebar.php diff --git a/app/Views/podcast/activity.php b/themes/cp_app/podcast/activity.php similarity index 100% rename from app/Views/podcast/activity.php rename to themes/cp_app/podcast/activity.php diff --git a/app/Views/podcast/activity_authenticated.php b/themes/cp_app/podcast/activity_authenticated.php similarity index 100% rename from app/Views/podcast/activity_authenticated.php rename to themes/cp_app/podcast/activity_authenticated.php diff --git a/app/Views/podcast/comment.php b/themes/cp_app/podcast/comment.php similarity index 100% rename from app/Views/podcast/comment.php rename to themes/cp_app/podcast/comment.php diff --git a/app/Views/podcast/comment_authenticated.php b/themes/cp_app/podcast/comment_authenticated.php similarity index 100% rename from app/Views/podcast/comment_authenticated.php rename to themes/cp_app/podcast/comment_authenticated.php diff --git a/app/Views/podcast/episode.php b/themes/cp_app/podcast/episode.php similarity index 100% rename from app/Views/podcast/episode.php rename to themes/cp_app/podcast/episode.php diff --git a/app/Views/podcast/episode_authenticated.php b/themes/cp_app/podcast/episode_authenticated.php similarity index 100% rename from app/Views/podcast/episode_authenticated.php rename to themes/cp_app/podcast/episode_authenticated.php diff --git a/app/Views/podcast/episodes.php b/themes/cp_app/podcast/episodes.php similarity index 99% rename from app/Views/podcast/episodes.php rename to themes/cp_app/podcast/episodes.php index ca97759f67678f8a9c330ea4b53e829f44207c75..1cc3d7beccab4ecfe775f77f6dcdf5648b6ebb65 100644 --- a/app/Views/podcast/episodes.php +++ b/themes/cp_app/podcast/episodes.php @@ -83,6 +83,7 @@ <?php foreach ($episodes as $episode): ?> <?= view('podcast/_partials/episode_card', [ 'episode' => $episode, + 'podcast' => $podcast ]) ?> <?php endforeach; ?> <?php else: ?> diff --git a/app/Views/podcast/episodes_authenticated.php b/themes/cp_app/podcast/episodes_authenticated.php similarity index 99% rename from app/Views/podcast/episodes_authenticated.php rename to themes/cp_app/podcast/episodes_authenticated.php index 09b38ede83ea66d507246c4846a82cf05d1fe9f9..ade11b0eeb3add75b0b2329774605957dbdca46c 100644 --- a/app/Views/podcast/episodes_authenticated.php +++ b/themes/cp_app/podcast/episodes_authenticated.php @@ -83,6 +83,7 @@ <?php foreach ($episodes as $episode) : ?> <?= view('podcast/_partials/episode_card', [ 'episode' => $episode, + 'podcast' => $podcast ]) ?> <?php endforeach; ?> <?php else : ?> diff --git a/app/Views/podcast/follow.php b/themes/cp_app/podcast/follow.php similarity index 100% rename from app/Views/podcast/follow.php rename to themes/cp_app/podcast/follow.php diff --git a/app/Views/podcast/post.php b/themes/cp_app/podcast/post.php similarity index 100% rename from app/Views/podcast/post.php rename to themes/cp_app/podcast/post.php diff --git a/app/Views/podcast/post_authenticated.php b/themes/cp_app/podcast/post_authenticated.php similarity index 100% rename from app/Views/podcast/post_authenticated.php rename to themes/cp_app/podcast/post_authenticated.php diff --git a/app/Views/podcast/post_remote_action.php b/themes/cp_app/podcast/post_remote_action.php similarity index 100% rename from app/Views/podcast/post_remote_action.php rename to themes/cp_app/podcast/post_remote_action.php diff --git a/modules/Auth/Views/_layout.php b/themes/cp_auth/_layout.php similarity index 97% rename from modules/Auth/Views/_layout.php rename to themes/cp_auth/_layout.php index f16abcea6e481f2ec31276bbb09d6d7522494a4c..0fe7835bed31cede3f50b3e8d4fc3dfa6426d93c 100644 --- a/modules/Auth/Views/_layout.php +++ b/themes/cp_auth/_layout.php @@ -23,7 +23,7 @@ <h1 class="mb-6 text-2xl font-bold text-center font-display"><?= $this->renderSection( 'title', ) ?></h1> - <?= view('_message_block') ?> + <!-- view('_message_block') --> <?= $this->renderSection('content') ?> </main> <footer class="flex flex-col text-sm"> diff --git a/modules/Auth/Views/emails/activation.php b/themes/cp_auth/emails/activation.php similarity index 100% rename from modules/Auth/Views/emails/activation.php rename to themes/cp_auth/emails/activation.php diff --git a/modules/Auth/Views/emails/forgot.php b/themes/cp_auth/emails/forgot.php similarity index 100% rename from modules/Auth/Views/emails/forgot.php rename to themes/cp_auth/emails/forgot.php diff --git a/modules/Auth/Views/forgot.php b/themes/cp_auth/forgot.php similarity index 100% rename from modules/Auth/Views/forgot.php rename to themes/cp_auth/forgot.php diff --git a/modules/Auth/Views/login.php b/themes/cp_auth/login.php similarity index 100% rename from modules/Auth/Views/login.php rename to themes/cp_auth/login.php diff --git a/themes/cp_auth/manifest.json b/themes/cp_auth/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..917784f990f432af4b77d97ca114b78628c87e8e --- /dev/null +++ b/themes/cp_auth/manifest.json @@ -0,0 +1,4 @@ +{ + "name": "Castopod Auth", + "description": "Castopod's default theme for authentication" +} diff --git a/modules/Auth/Views/register.php b/themes/cp_auth/register.php similarity index 100% rename from modules/Auth/Views/register.php rename to themes/cp_auth/register.php diff --git a/modules/Auth/Views/reset.php b/themes/cp_auth/reset.php similarity index 100% rename from modules/Auth/Views/reset.php rename to themes/cp_auth/reset.php diff --git a/modules/Install/Views/_layout.php b/themes/cp_install/_layout.php similarity index 96% rename from modules/Install/Views/_layout.php rename to themes/cp_install/_layout.php index 91920f08dc754a1438ddcce32cadf53bd053fdd6..65fbd75d837d036c4e04fcb926386feb0d85cc03 100644 --- a/modules/Install/Views/_layout.php +++ b/themes/cp_install/_layout.php @@ -18,7 +18,7 @@ </div> </header> <main class="container flex flex-col items-center justify-center flex-1 px-4 py-10 mx-auto"> - <?= view('_message_block') ?> + <!-- view('_message_block') --> <?= $this->renderSection('content') ?> </main> <footer class="container px-2 py-4 mx-auto text-sm text-right border-t"> diff --git a/modules/Install/Views/cache_config.php b/themes/cp_install/cache_config.php similarity index 95% rename from modules/Install/Views/cache_config.php rename to themes/cp_install/cache_config.php index 4c15821579dd51edf16e153b2934f7369cf81b9d..dd936031f70187f7f898608aea727cda9936ac02 100644 --- a/modules/Install/Views/cache_config.php +++ b/themes/cp_install/cache_config.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Install\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('content') ?> diff --git a/modules/Install/Views/create_superadmin.php b/themes/cp_install/create_superadmin.php similarity index 96% rename from modules/Install/Views/create_superadmin.php rename to themes/cp_install/create_superadmin.php index 3af6084cdc95c96c77be59c9c603c77c4c5e0343..22e44ccc769546552a2844a0a99a2db5b94109a3 100644 --- a/modules/Install/Views/create_superadmin.php +++ b/themes/cp_install/create_superadmin.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Install\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('content') ?> diff --git a/modules/Install/Views/database_config.php b/themes/cp_install/database_config.php similarity index 97% rename from modules/Install/Views/database_config.php rename to themes/cp_install/database_config.php index 9dbb0839410110f5d763e39ccd5d97bbc755759d..ab70b75958b7bb43617e63be2ac4220eeead08ee 100644 --- a/modules/Install/Views/database_config.php +++ b/themes/cp_install/database_config.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Install\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('content') ?> diff --git a/modules/Install/Views/instance_config.php b/themes/cp_install/instance_config.php similarity index 97% rename from modules/Install/Views/instance_config.php rename to themes/cp_install/instance_config.php index d8a000327d95eec2cc40cc807ee21d7b75a3540f..ad5ec4cc1b31491be24844249889f821acc98547 100644 --- a/modules/Install/Views/instance_config.php +++ b/themes/cp_install/instance_config.php @@ -1,7 +1,7 @@ -<?= $this->extend('Modules\Install\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('content') ?> - +adz <form action="<?= '/' . config('Install')->gateway . '/instance-config' ?>" class="flex flex-col w-full max-w-sm" method="post" accept-charset="utf-8"> diff --git a/themes/cp_install/manifest.json b/themes/cp_install/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..fb454c1787480b72aea5e5ee4da9d01d6dfc0219 --- /dev/null +++ b/themes/cp_install/manifest.json @@ -0,0 +1,4 @@ +{ + "name": "Castopod Install", + "description": "Castopod's default theme for install wizard" +} diff --git a/modules/Install/Views/manual_config.php b/themes/cp_install/manual_config.php similarity index 89% rename from modules/Install/Views/manual_config.php rename to themes/cp_install/manual_config.php index 3ed77c74e626b89f21473cae527a652a34dca67e..ff5468e4b0a7f7d40d8a960132815705894e1fb8 100644 --- a/modules/Install/Views/manual_config.php +++ b/themes/cp_install/manual_config.php @@ -1,4 +1,4 @@ -<?= $this->extend('Modules\Install\Views\_layout') ?> +<?= $this->extend('_layout') ?> <?= $this->section('content') ?>