Commit a79917dc authored by Tino Goratsch's avatar Tino Goratsch

rework the acp3 installer theme to act like a normal theme

parent 5bf882ee
Pipeline #93320308 passed with stages
in 2 minutes and 56 seconds
......@@ -68,6 +68,8 @@ splits:
target: "git@gitlab.com:ACP3/test.git"
- prefix: "designs/acp3"
target: "git@gitlab.com:ACP3/theme-default.git"
- prefix: "designs/acp3-installer"
target: "git@gitlab.com:ACP3/theme-installer.git"
# List of references to split (defined as regexp)
origins:
......
......@@ -95,7 +95,7 @@ abstract class AbstractFrontendAction extends Core\Controller\AbstractWidgetActi
/**
* @return string
*/
protected function fetchLayoutViaInheritance()
protected function fetchLayoutViaInheritance(): string
{
if ($this->request->isXmlHttpRequest()) {
$paths = $this->fetchLayoutPaths('layout.ajax', 'System/layout.ajax.tpl');
......@@ -114,7 +114,7 @@ abstract class AbstractFrontendAction extends Core\Controller\AbstractWidgetActi
*
* @return array
*/
private function fetchLayoutPaths(string $layoutFileName, string $defaultLayoutName)
private function fetchLayoutPaths(string $layoutFileName, string $defaultLayoutName): array
{
return [
$this->request->getModule() . '/' . $this->request->getArea() . '/' . $layoutFileName . '.' . $this->request->getController() . '.' . $this->request->getAction() . '.tpl',
......@@ -128,7 +128,7 @@ abstract class AbstractFrontendAction extends Core\Controller\AbstractWidgetActi
/**
* @param string[] $paths
*/
private function iterateOverLayoutPaths(array $paths)
private function iterateOverLayoutPaths(array $paths): void
{
if ($this->getLayout() !== 'layout.tpl') {
return;
......
......@@ -34,22 +34,7 @@ class Theme implements ThemePathInterface
* @var array
*/
private $sortedThemeDependencies = [];
/**
* @var string
*/
protected $designPathInternal;
/**
* @var string
*/
protected $designPathWeb;
/**
* Design constructor.
*
* @param \ACP3\Core\Environment\ApplicationPath $appPath
* @param \ACP3\Core\Settings\SettingsInterface $settings
* @param \ACP3\Core\XML $xml
*/
public function __construct(
ApplicationPath $appPath,
SettingsInterface $settings,
......@@ -152,11 +137,7 @@ class Theme implements ThemePathInterface
*/
public function getDesignPathInternal(): string
{
if ($this->designPathInternal === null) {
$this->designPathInternal = $this->appPath->getDesignRootPathInternal() . $this->getCurrentTheme() . '/';
}
return $this->designPathInternal;
return $this->appPath->getDesignRootPathInternal() . $this->getCurrentTheme() . '/';
}
/**
......@@ -164,10 +145,6 @@ class Theme implements ThemePathInterface
*/
public function getDesignPathWeb(): string
{
if ($this->designPathWeb === null) {
$this->designPathWeb = $this->appPath->getWebRoot() . 'designs/' . $this->getCurrentTheme() . '/';
}
return $this->designPathWeb;
return $this->appPath->getWebRoot() . 'designs/' . $this->getCurrentTheme() . '/';
}
}
......@@ -17,11 +17,6 @@ services:
- '@core.breadcrumb'
- '@core.event_dispatcher'
core.environment.theme:
class: ACP3\Modules\ACP3\Installer\Core\Environment\Theme
arguments:
- '@core.environment.application_path'
core.http.request:
class: ACP3\Modules\ACP3\Installer\Core\Http\Request
public: true
......
......@@ -19,7 +19,8 @@
"acp3/composer-installer": "^1.0",
"acp3/core": "^4.46.0",
"acp3/module-system": "^4.46.0",
"acp3/module-users": "^4.46.0"
"acp3/module-users": "^4.46.0",
"acp3/theme-installer": "^4.47.0"
},
"autoload": {
"psr-4": {
......
......@@ -25,7 +25,6 @@ class ApplicationPath extends \ACP3\Core\Environment\ApplicationPath
$this->installerWebRoot = $this->webRoot;
$this->webRoot = \substr($this->webRoot !== '/' ? $this->webRoot . '/' : '/', 0, -14);
$this->designRootPathInternal = ACP3_ROOT_DIR . '/installation/design/';
}
/**
......
<?php
/**
* Copyright (c) by the ACP3 Developers.
* See the LICENSE file at the top-level module directory for licensing details.
*/
namespace ACP3\Modules\ACP3\Installer\Core\Environment;
use ACP3\Core\Environment\ThemePathInterface;
class Theme implements ThemePathInterface
{
/**
* @var \ACP3\Modules\ACP3\Installer\Core\Environment\ApplicationPath
*/
private $appPath;
public function __construct(ApplicationPath $appPath)
{
$this->appPath = $appPath;
}
public function getCurrentTheme(): string
{
return '';
}
public function getDesignPathInternal(): string
{
return $this->appPath->getDesignRootPathInternal();
}
public function getDesignPathWeb(): string
{
return $this->appPath->getInstallerWebRoot() . 'design/';
}
public function getThemeDependencies(string $themeName): array
{
return [];
}
public function getCurrentThemeDependencies(): array
{
return [];
}
}
......@@ -28,6 +28,11 @@ class SettingsRepository implements SettingsAwareRepositoryInterface
public function getAllSettings()
{
return [
[
'module_name' => 'system',
'name' => 'design',
'value' => 'acp3-installer',
],
[
'module_name' => 'system',
'name' => 'lang',
......@@ -48,11 +53,6 @@ class SettingsRepository implements SettingsAwareRepositoryInterface
'name' => 'homepage',
'value' => $this->getHomepage(),
],
[
'module_name' => 'system',
'name' => 'design',
'value' => 'installer',
],
[
'module_name' => 'system',
'name' => 'date_format_long',
......
......@@ -16,10 +16,7 @@ module.exports = (gulp, plugins) => {
[
'./designs/*/*/Assets/js/{admin,frontend,partials,widget}/*.js',
'./designs/*/Assets/js/*.js',
'./installation/design/Assets/js/*.js',
// Exclude already minified files
'!./designs/**/Assets/js/**/*.min.js',
'!./installation/design/Assets/js/*.min.js',
]
),
{base: './'}
......
......@@ -16,7 +16,6 @@ module.exports = (gulp, plugins) => {
'./designs/*/*/Assets/less/style.less',
'./designs/*/*/Assets/less/append.less',
'./designs/*/Assets/less/*.less',
'./installation/design/Assets/less/*.less',
]),
{base: './'}
)
......
......@@ -17,7 +17,6 @@ module.exports = (gulp, plugins) => {
componentPaths.scss.process.concat([
'./designs/*/*/Assets/scss/*.scss',
'./designs/*/Assets/scss/*.scss',
'./installation/design/Assets/scss/*.scss',
],
),
{base: './'}
......
......@@ -13,7 +13,6 @@ module.exports = (gulp) => {
componentPaths.less.watch.concat([
'designs/*/**/Assets/less/*.less',
'designs/*/**/Assets/less/**/*.less',
'installation/design/Assets/less/*.less',
]),
{cwd: './'},
gulp.task('less')
......@@ -22,7 +21,6 @@ module.exports = (gulp) => {
componentPaths.scss.watch.concat([
'designs/*/**/Assets/scss/*.scss',
'designs/*/**/Assets/scss/**/*.scss',
'installation/design/Assets/scss/*.scss',
]),
{cwd: './'},
gulp.task('scss')
......@@ -31,10 +29,7 @@ module.exports = (gulp) => {
componentPaths.js.concat(
[
'./designs/**/Assets/js/**/*.js',
'./installation/design/Assets/js/*.js',
// Exclude already minified files
'!./designs/**/Assets/js/**/*.min.js',
'!./installation/design/Assets/js/*.min.js',
]
),
{cwd: './'},
......
......@@ -130,7 +130,9 @@
"acp3/module-system": "self.version",
"acp3/module-users": "self.version",
"acp3/module-wysiwyg-ckeditor": "self.version",
"acp3/module-wysiwyg-tinymce": "self.version"
"acp3/module-wysiwyg-tinymce": "self.version",
"acp3/theme-default": "self.version",
"acp3/theme-installer": "self.version"
},
"scripts": {
"test": "./vendor/bin/phpunit -c ./tests/phpunit.dist.xml",
......
# Auto detect text files and perform LF normalization
* text=auto
/.gitattributes export-ignore
/.gitignore export-ignore
......@@ -8,7 +8,7 @@ jQuery(document).ready(($) => {
$languages = $('#languages');
$doc.data('has-changes', false);
$('#content').find(':input').change(function () {
$('#content').find(':input').change(() => {
$doc.data('has-changes', true);
});
......
This diff is collapsed.
# ACP3/theme-installer
Repository of the installer theme of the ACP3 CMS.
## Attention
Please do not make pull requests to this repository, as it is just a read only repository.
Please make pull requests to the [ACP3/cms](https://gitlab.com/ACP3/cms.git) repository.
{
"name": "acp3/theme-installer",
"description": "This is the theme of the ACP3 CMS installer.",
"type": "acp3-theme",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Tino Goratsch",
"email": "mail@acp3-cms.net"
}
],
"support": {
"email": "mail@acp3-cms.net",
"issues": "https://gitlab.com/ACP3/cms/issues"
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"acp3/composer-installer": "^1.0",
"acp3/core": "^4.46.0"
},
"extra": {
"installer-name": "acp3-installer"
}
}
# Auto detect text files and perform LF normalization
* text=auto
/Test export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
......@@ -16,7 +16,8 @@
"require": {
"acp3/composer-installer": "^1.0",
"acp3/core": "^4.46.0",
"acp3/module-installer": "^4.47.0"
"acp3/module-installer": "^4.47.0",
"acp3/theme-installer": "^4.47.0"
},
"extra": {
"installer-name": "installation"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment