Skip to content
Code-Schnipsel Gruppen Projekte
Commit 5a1e7c10 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

Merge branch 'next-0.x' into 'main'

Next 0.x

See merge request !7
Übergeordnete d30d7d1b abdf79a6
Branches 0.x
Tags 0.8.0
2 Merge Requests!8Update 'next-1.x' with latest changes from 'main',!7Next 0.x
Pipeline-Nr. 17103 mit Warnungen bestanden
werden angezeigt mit 269 Ergänzungen und 53 Löschungen
# Ignore developer files when exporting
.gitattributes export-ignore
.gitignore export-ignore
.gitlab-ci.yml export-ignore
.phive export-ignore
captainhook.json export-ignore
phpcs.xml.dist export-ignore
phpstan-baseline.neon export-ignore
phpstan.dist.neon export-ignore
phpunit.dist.xml export-ignore
tests export-ignore
# Explicitly set file type and line endings for PHP files, improves git diff output
*.php text eol=lf diff=php
\ No newline at end of file
node_modules
tools/
phpstan.neon
.phpunit.result.cache
phpunit.xml
include:
- component: dev.quiqqer.com/quiqqer/stabilization/ci-cd-components/quiqqer-package-bundle/quiqqer-package-bundle@2
inputs:
quiqqer-major-version: 1
# Remove the entire phpunit-php8.1 block, to allow PHPUnit to run on PHP 8.1 in your pipeline
phpunit-php8.1:
rules:
- when: never
# Remove the entire phpunit-php8.2 block, to allow PHPUnit to run on PHP 8.2 in your pipeline
phpunit-php8.2:
rules:
- when: never
# Remove the entire phpunit-php8.3 block, to allow PHPUnit to run on PHP 8.3 in your pipeline
phpunit-php8.3:
rules:
- when: never
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpstan" version="1.11.8" installed="1.11.8" location="./tools/phpstan" copy="false"/>
<phar name="phpunit" version="^10.5.20" installed="10.5.20" location="./tools/phpunit" copy="false"/>
<phar name="phpcs" version="^3.10.1" installed="3.10.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.10.1" installed="3.10.1" location="./tools/phpcbf" copy="false"/>
<phar name="captainhook" version="^5.23.3" installed="5.23.3" location="./tools/captainhook" copy="false"/>
</phive>
# Contributing
This package follows the [QUIQQER contribution guidelines](https://dev.quiqqer.com/quiqqer/stabilization/documentation/-/wikis/home).
\ No newline at end of file
{
"pre-commit": {
"enabled": true,
"actions": [
{
"action": "\\CaptainHook\\App\\Hook\\PHP\\Action\\Linting"
},
{
"action": "composer test"
}
]
}
}
\ No newline at end of file
{
"name": "quiqqer\/template-tailwindcss",
"name": "quiqqer/template-tailwindcss",
"type": "quiqqer-template",
"description": "TailwindCSS template",
"license": "GPL-3.0+",
......@@ -7,30 +7,72 @@
{
"name": "Michael Danielczok",
"email": "support@pcsg.de",
"homepage": "https:\/\/www.pcsg.de",
"homepage": "https://www.pcsg.de",
"role": "Developer"
}
],
"support": {
"email": "support@pcsg.de",
"url": "http:\/\/www.pcsg.de"
"url": "http://www.pcsg.de"
},
"require": {
"php": ">=5.3",
"quiqqer\/quiqqer": "*@dev",
"quiqqer\/bricks": "*@dev",
"quiqqer\/fontawesome": "*@dev",
"quiqqer\/sitetypes": "*@dev",
"quiqqer\/menu": "2.*|dev-dev|dev-master",
"quiqqer\/unsemantic": "*@dev",
"quiqqer\/utils": ">=1.7|dev-dev",
"quiqqer\/page-transition": "^1.2",
"quiqqer\/pace": ">=1.2.0|dev-master|dev-dev",
"quiqqer\/buttons": ">=1.0.0|dev-master|dev-dev"
"quiqqer/quiqqer": "^1",
"quiqqer/bricks": "*@dev",
"quiqqer/fontawesome": "*@dev",
"quiqqer/sitetypes": "*@dev",
"quiqqer/menu": "^2|*@dev",
"quiqqer/unsemantic": "*@dev",
"quiqqer/utils": "^1.7",
"quiqqer/page-transition": "^1.2",
"quiqqer/pace": "^1.2.0",
"quiqqer/buttons": "^1.0.0"
},
"autoload": {
"psr-4": {
"QUI\\TemplateTailwindCss\\": "src\/QUI\/TemplateTailwindCss"
"QUI\\TemplateTailwindCss\\": "src/QUI/TemplateTailwindCss"
}
},
"scripts": {
"test": [
"@dev:lint",
"@dev:phpunit"
],
"dev:phpunit": "./tools/phpunit",
"dev:lint": [
"@dev:lint:phpstan",
"@dev:lint:style"
],
"dev:lint:phpstan": "./tools/phpstan",
"dev:lint:style": "./tools/phpcs",
"dev:lint:style:fix": "./tools/phpcbf",
"dev:init": [
"@dev:init:check-requirements",
"@dev:init:tools",
"@dev:init:git-hooks"
],
"dev:init:check-requirements": [
"which composer > /dev/null || (echo 'Error: composer has to be globally installed'; exit 1)",
"which phive > /dev/null || (echo 'Error: PHIVE has to be globally installed'; exit 1)"
],
"dev:init:tools": "phive install --temporary",
"dev:init:git-hooks": "./tools/captainhook install --only-enabled --force"
},
"scripts-aliases": {
"test": [
"dev:test"
]
},
"scripts-descriptions": {
"test": "Runs linting, static analysis, and unit tests.",
"dev:phpunit": "Run PHPUnit test suites",
"dev:lint": "Run PHPStan and code style check",
"dev:lint:phpstan": "Run PHPStan",
"dev:lint:style": "Run code style check (PHP_CodeSniffer)",
"dev:lint:style:fix": "Try to fix code style errors automatically",
"dev:init": "Initialize the developer tooling (tools and git hooks)",
"dev:init:check-requirements": "Check if the necessary requirements are met",
"dev:init:tools": "Install all developer tools (requires PHIVE)",
"dev:init:git-hooks": "Install all git hooks (may require tools to be installed)"
}
}
}
\ No newline at end of file
......@@ -13,7 +13,8 @@
QUI\Utils\Site::setRecursiveAttribute($Site, 'site.settings.independentMenu.id');
// Inhaltsverhalten
if ($Site->getAttribute('templateTailwindCss.showTitle') ||
if (
$Site->getAttribute('templateTailwindCss.showTitle') ||
$Site->getAttribute('templateTailwindCss.showShort')
) {
$Template->setAttribute('content-header', false);
......@@ -239,8 +240,10 @@ class="header-bar-search-link searchMobile">
'Start' => $ProductPage
];
if ($Project->getConfig('templateTailwindCSS.settings.independentMenu.enable')
&& $Project->getConfig('templateTailwindCSS.settings.independentMenu.menuId')) {
if (
$Project->getConfig('templateTailwindCSS.settings.independentMenu.enable')
&& $Project->getConfig('templateTailwindCSS.settings.independentMenu.menuId')
) {
$menuParams['menuId'] = $Project->getConfig('templateTailwindCSS.settings.independentMenu.menuId');
$menuParams['showFirstLevelIcons'] = $Project->getConfig('templateTailwindCSS.settings.independentMenu.showFirstLevelIcons');
}
......
<?xml version="1.0"?>
<ruleset>
<!-- Use PSR-12 ruleset -->
<rule ref="PSR12"/>
<!-- Only scan *.php files -->
<arg name="extensions" value="php"/>
<!-- Ignore warnings -->
<arg name="warning-severity" value="0"/>
<!-- Process 64 (or number of CPU cores) files in parallel -->
<arg name="parallel" value="64"/>
<!-- Output relative file paths, by setting the current folder as the basepath -->
<arg name="basepath" value="."/>
<!-- Show colored output -->
<arg name="colors"/>
<!-- Scan everything in the current folder -->
<file>.</file>
</ruleset>
parameters:
ignoreErrors:
-
message: "#^If condition is always true\\.$#"
count: 1
path: src/QUI/TemplateTailwindCss/Controls/Children/SiteListPreview.php
-
message: "#^PHPDoc tag @return with type mixed is not subtype of native type QUI\\\\Projects\\\\Site\\.$#"
count: 1
path: src/QUI/TemplateTailwindCss/Controls/Children/SiteListPreview.php
-
message: "#^Instanceof between array\\|float\\|int\\|string\\|false\\|null and QUI\\\\Projects\\\\Site will always evaluate to false\\.$#"
count: 1
path: src/QUI/TemplateTailwindCss/Utils.php
-
message: "#^Result of && is always false\\.$#"
count: 1
path: src/QUI/TemplateTailwindCss/Utils.php
-
message: "#^Strict comparison using \\=\\=\\= between bool and 'huhu' will always evaluate to false\\.$#"
count: 1
path: src/QUI/TemplateTailwindCss/Utils.php
-
message: "#^Variable \\$Project might not be defined\\.$#"
count: 8
path: src/QUI/TemplateTailwindCss/settings.css.php
includes:
- phpstan-baseline.neon
parameters:
level: 5
paths:
- src
bootstrapFiles:
- tests/phpstan-bootstrap.php
tipsOfTheDay: false
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="tests/phpunit-bootstrap.php">
<testsuites>
<testsuite name="Tests">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
......@@ -148,25 +148,25 @@ public function getBody(): string
case 'default':
case 'simpleOrdered':
case 'simpleUnordered':
$this->listCSSFile = \dirname(__FILE__).'/ListPreview.List.'.$this->getAttribute('listTemplate').'.css';
$this->listHTMLFile = \dirname(__FILE__).'/ListPreview.List.'.$this->getAttribute('listTemplate').'.html';
$this->listCSSFile = \dirname(__FILE__) . '/ListPreview.List.' . $this->getAttribute('listTemplate') . '.css';
$this->listHTMLFile = \dirname(__FILE__) . '/ListPreview.List.' . $this->getAttribute('listTemplate') . '.html';
break;
default:
$this->listCSSFile = \dirname(__FILE__).'/ListPreview.List.default.css';
$this->listHTMLFile = \dirname(__FILE__).'/ListPreview.List.default.html';
$this->listCSSFile = \dirname(__FILE__) . '/ListPreview.List.default.css';
$this->listHTMLFile = \dirname(__FILE__) . '/ListPreview.List.default.html';
break;
}
switch ($this->getAttribute('previewTemplate')) {
case 'circle':
$this->previewCSSFile = \dirname(__FILE__).'/ListPreview.Preview.'.$this->getAttribute('previewTemplate').'.css';
$this->previewHTMLFile = \dirname(__FILE__).'/ListPreview.Preview.'.$this->getAttribute('previewTemplate').'.html';
$this->previewCSSFile = \dirname(__FILE__) . '/ListPreview.Preview.' . $this->getAttribute('previewTemplate') . '.css';
$this->previewHTMLFile = \dirname(__FILE__) . '/ListPreview.Preview.' . $this->getAttribute('previewTemplate') . '.html';
break;
default:
$this->previewCSSFile = \dirname(__FILE__).'/ListPreview.Preview.circle.css';
$this->previewHTMLFile = \dirname(__FILE__).'/ListPreview.Preview.circle.html';
$this->previewCSSFile = \dirname(__FILE__) . '/ListPreview.Preview.circle.css';
$this->previewHTMLFile = \dirname(__FILE__) . '/ListPreview.Preview.circle.html';
break;
}
......@@ -239,10 +239,12 @@ public function getPreview($params = []): string
protected function setCustomTemplates()
{
// list template
if ($this->getAttribute('customListTemplate')
if (
$this->getAttribute('customListTemplate')
&& \file_exists($this->getAttribute('customListTemplate'))
) {
if ($this->getAttribute('customListCss')
if (
$this->getAttribute('customListCss')
&& \file_exists($this->getAttribute('customListCss'))
) {
$this->listCSSFile = $this->getAttribute('customListCss');
......@@ -252,10 +254,12 @@ protected function setCustomTemplates()
}
// preview template
if ($this->getAttribute('customPreviewTemplate')
if (
$this->getAttribute('customPreviewTemplate')
&& \file_exists($this->getAttribute('customPreviewTemplate'))
) {
if ($this->getAttribute('customPreviewCss')
if (
$this->getAttribute('customPreviewCss')
&& \file_exists($this->getAttribute('customPreviewCss'))
) {
$this->listCSSFile = $this->getAttribute('customPreviewCss');
......
......@@ -172,25 +172,25 @@ public function getBody(): string
case 'default':
case 'simpleOrdered':
case 'simpleUnordered':
$this->listCSSFile = \dirname(__FILE__).'/SiteListPreview.List.'.$this->getAttribute('listTemplate').'.css';
$this->listHTMLFile = \dirname(__FILE__).'/SiteListPreview.List.'.$this->getAttribute('listTemplate').'.html';
$this->listCSSFile = \dirname(__FILE__) . '/SiteListPreview.List.' . $this->getAttribute('listTemplate') . '.css';
$this->listHTMLFile = \dirname(__FILE__) . '/SiteListPreview.List.' . $this->getAttribute('listTemplate') . '.html';
break;
default:
$this->listCSSFile = \dirname(__FILE__).'/SiteListPreview.List.default.css';
$this->listHTMLFile = \dirname(__FILE__).'/SiteListPreview.List.default.html';
$this->listCSSFile = \dirname(__FILE__) . '/SiteListPreview.List.default.css';
$this->listHTMLFile = \dirname(__FILE__) . '/SiteListPreview.List.default.html';
break;
}
switch ($this->getAttribute('previewTemplate')) {
case 'circle':
$this->previewCSSFile = \dirname(__FILE__).'/SiteListPreview.Preview.'.$this->getAttribute('previewTemplate').'.css';
$this->previewHTMLFile = \dirname(__FILE__).'/SiteListPreview.Preview.'.$this->getAttribute('previewTemplate').'.html';
$this->previewCSSFile = \dirname(__FILE__) . '/SiteListPreview.Preview.' . $this->getAttribute('previewTemplate') . '.css';
$this->previewHTMLFile = \dirname(__FILE__) . '/SiteListPreview.Preview.' . $this->getAttribute('previewTemplate') . '.html';
break;
default:
$this->previewCSSFile = \dirname(__FILE__).'/SiteListPreview.Preview.circle.css';
$this->previewHTMLFile = \dirname(__FILE__).'/SiteListPreview.Preview.circle.html';
$this->previewCSSFile = \dirname(__FILE__) . '/SiteListPreview.Preview.circle.css';
$this->previewHTMLFile = \dirname(__FILE__) . '/SiteListPreview.Preview.circle.html';
break;
}
......@@ -279,10 +279,12 @@ protected function getSite(): QUI\Projects\Site
protected function setCustomTemplates()
{
// list template
if ($this->getAttribute('customListTemplate')
if (
$this->getAttribute('customListTemplate')
&& \file_exists($this->getAttribute('customListTemplate'))
) {
if ($this->getAttribute('customListCss')
if (
$this->getAttribute('customListCss')
&& \file_exists($this->getAttribute('customListCss'))
) {
$this->listCSSFile = $this->getAttribute('customListCss');
......@@ -292,10 +294,12 @@ protected function setCustomTemplates()
}
// preview template
if ($this->getAttribute('customPreviewTemplate')
if (
$this->getAttribute('customPreviewTemplate')
&& \file_exists($this->getAttribute('customPreviewTemplate'))
) {
if ($this->getAttribute('customPreviewCss')
if (
$this->getAttribute('customPreviewCss')
&& \file_exists($this->getAttribute('customPreviewCss'))
) {
$this->listCSSFile = $this->getAttribute('customPreviewCss');
......
......@@ -36,7 +36,7 @@ public function __construct($attributes = [])
parent::__construct($attributes);
$this->addCSSFile(
dirname(__FILE__).'/Separator.css'
dirname(__FILE__) . '/Separator.css'
);
}
......@@ -85,7 +85,7 @@ public function getBody()
'colorScheme' => $colorScheme
]);
return $Engine->fetch(dirname(__FILE__).'/Separator.html');
return $Engine->fetch(dirname(__FILE__) . '/Separator.html');
}
/**
......
<?php
/**
* This file contains \QUI\TemplateTailwindCss\EventHandler
*/
......@@ -34,10 +35,10 @@ public static function onProjectConfigSave()
public static function onSiteSave($Site)
{
$Project = $Site->getProject();
$cacheName = md5($Project->getName().$Project->getLang().$Site->getId());
$cacheName = md5($Project->getName() . $Project->getLang() . $Site->getId());
try {
QUI\Cache\Manager::clear('quiqqer/templateTailwindCss'.$cacheName);
QUI\Cache\Manager::clear('quiqqer/templateTailwindCss' . $cacheName);
} catch (QUI\Exception $Exception) {
QUI\System\Log::writeException($Exception);
}
......
......@@ -28,11 +28,11 @@ public static function getConfig($params)
$Project = $params['Project'];
$Template = $params['Template'];
$Site = $params['Site'];
$cacheName = md5($Project->getName().$Project->getLang().$Site->getId());
$cacheName = md5($Project->getName() . $Project->getLang() . $Site->getId());
try {
return QUI\Cache\Manager::get(
'quiqqer/templateTailwindCss/'.$cacheName
'quiqqer/templateTailwindCss/' . $cacheName
);
} catch (QUI\Exception $Exception) {
}
......@@ -156,13 +156,13 @@ public static function getConfig($params)
$settingsCSS = include 'settings.css.php';
$settingsCssInline = '';
$binDir = OPT_DIR.'quiqqer/template-tailwindcss/bin/css';
$binDir = OPT_DIR . 'quiqqer/template-tailwindcss/bin/css';
// todo mit mor besprechen
if (is_dir($binDir) === 'huhu') {
file_put_contents($binDir.'/settings.css', $settingsCSS);
file_put_contents($binDir . '/settings.css', $settingsCSS);
} else {
$settingsCssInline = '<style data-no-cache="1">'.$settingsCSS.'</style>';
$settingsCssInline = '<style data-no-cache="1">' . $settingsCSS . '</style>';
}
// disable title and short in site content - do not show it twice
......@@ -172,7 +172,7 @@ public static function getConfig($params)
$config += [
'quiTplType' => $Project->getConfig('templateTailwindCss.settings.standardType'),
'typeClass' => 'type-'.str_replace(['/', ':'], '-', $Site->getAttribute('type')),
'typeClass' => 'type-' . str_replace(['/', ':'], '-', $Site->getAttribute('type')),
'pageTitle' => $title,
'pageShort' => $short,
'titleAndShortPos' => $titleAndShortPos,
......@@ -184,7 +184,7 @@ public static function getConfig($params)
// set cache
QUI\Cache\Manager::set(
'quiqqer/templateTailwindCss/'.$cacheName,
'quiqqer/templateTailwindCss/' . $cacheName,
$config
);
......
<?php
if (!defined('QUIQQER_SYSTEM')) {
define('QUIQQER_SYSTEM', true);
}
if (!defined('QUIQQER_AJAX')) {
define('QUIQQER_AJAX', true);
}
putenv("QUIQQER_OTHER_AUTOLOADERS=KEEP");
require_once __DIR__ . '/../../../../bootstrap.php';
<?php
if (!defined('QUIQQER_SYSTEM')) {
define('QUIQQER_SYSTEM', true);
}
if (!defined('QUIQQER_AJAX')) {
define('QUIQQER_AJAX', true);
}
require_once __DIR__ . '/../../../../bootstrap.php';
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren