mirror of
https://github.com/typemill/typemill.git
synced 2025-08-04 13:17:29 +02:00
Fix deprection errors php 8.2 and other bugs
This commit is contained in:
@@ -9,7 +9,10 @@
|
||||
"vendor-dir": "system/vendor",
|
||||
"allow-plugins": {
|
||||
"composer/installers": true
|
||||
}
|
||||
},
|
||||
"platform": {
|
||||
"php": "8.0.0"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
@@ -21,8 +24,8 @@
|
||||
"slim/flash": "^0.4.0",
|
||||
"slim/csrf": "^1.2",
|
||||
"vlucas/valitron": "^1.4",
|
||||
"symfony/yaml": "^6.0",
|
||||
"symfony/event-dispatcher": "^6.0",
|
||||
"symfony/yaml": "^5.4",
|
||||
"symfony/event-dispatcher": "^5.4",
|
||||
"erusev/parsedown": "^1.8.0-beta-4",
|
||||
"erusev/parsedown-extra": "dev-master",
|
||||
"jbroadway/urlify": "1.1.3",
|
||||
|
145
composer.lock
generated
145
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "841b98a23a247d8faad15d86df8cbeba",
|
||||
"content-hash": "c3d172c51dcde3725ee22925a93865a5",
|
||||
"packages": [
|
||||
{
|
||||
"name": "akrabat/proxy-detection-middleware",
|
||||
@@ -342,20 +342,20 @@
|
||||
},
|
||||
{
|
||||
"name": "laminas/laminas-permissions-acl",
|
||||
"version": "2.16.0",
|
||||
"version": "2.14.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laminas/laminas-permissions-acl.git",
|
||||
"reference": "9f85ee3b1940cd5a1c4151ca16fdb738c162480b"
|
||||
"reference": "86cecb540cf8f2e088d70d8acef1fc9203ed5023"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/9f85ee3b1940cd5a1c4151ca16fdb738c162480b",
|
||||
"reference": "9f85ee3b1940cd5a1c4151ca16fdb738c162480b",
|
||||
"url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/86cecb540cf8f2e088d70d8acef1fc9203ed5023",
|
||||
"reference": "86cecb540cf8f2e088d70d8acef1fc9203ed5023",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
|
||||
"php": "~8.0.0 || ~8.1.0 || ~8.2.0"
|
||||
},
|
||||
"conflict": {
|
||||
"laminas/laminas-servicemanager": "<3.0",
|
||||
@@ -363,11 +363,11 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"laminas/laminas-coding-standard": "~2.5.0",
|
||||
"laminas/laminas-servicemanager": "^3.21",
|
||||
"phpbench/phpbench": "^1.2.10",
|
||||
"phpunit/phpunit": "^10.1.3",
|
||||
"psalm/plugin-phpunit": "^0.18.4",
|
||||
"vimeo/psalm": "^5.12"
|
||||
"laminas/laminas-servicemanager": "^3.19",
|
||||
"phpbench/phpbench": "^1.2",
|
||||
"phpunit/phpunit": "^9.5.26",
|
||||
"psalm/plugin-phpunit": "^0.18.0",
|
||||
"vimeo/psalm": "^5.0"
|
||||
},
|
||||
"suggest": {
|
||||
"laminas/laminas-servicemanager": "To support Laminas\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage"
|
||||
@@ -402,7 +402,7 @@
|
||||
"type": "community_bridge"
|
||||
}
|
||||
],
|
||||
"time": "2023-10-18T07:50:34+00:00"
|
||||
"time": "2023-02-01T16:19:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/serializable-closure",
|
||||
@@ -1515,25 +1515,25 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v2.5.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf"
|
||||
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||
"reference": "7c3aff79d10325257a001fcf92d991f24fc967cf",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
"php": ">=7.1"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.4-dev"
|
||||
"dev-main": "2.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
@@ -1562,7 +1562,7 @@
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1578,43 +1578,48 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-23T14:45:45+00:00"
|
||||
"time": "2022-01-02T09:53:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v6.3.2",
|
||||
"version": "v5.4.26",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e"
|
||||
"reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/adb01fe097a4ee930db9258a3cc906b5beb5cf2e",
|
||||
"reference": "adb01fe097a4ee930db9258a3cc906b5beb5cf2e",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac",
|
||||
"reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"symfony/event-dispatcher-contracts": "^2.5|^3"
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/event-dispatcher-contracts": "^2|^3",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/dependency-injection": "<5.4",
|
||||
"symfony/service-contracts": "<2.5"
|
||||
"symfony/dependency-injection": "<4.4"
|
||||
},
|
||||
"provide": {
|
||||
"psr/event-dispatcher-implementation": "1.0",
|
||||
"symfony/event-dispatcher-implementation": "2.0|3.0"
|
||||
"symfony/event-dispatcher-implementation": "2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/config": "^5.4|^6.0",
|
||||
"symfony/dependency-injection": "^5.4|^6.0",
|
||||
"symfony/error-handler": "^5.4|^6.0",
|
||||
"symfony/expression-language": "^5.4|^6.0",
|
||||
"symfony/http-foundation": "^5.4|^6.0",
|
||||
"symfony/service-contracts": "^2.5|^3",
|
||||
"symfony/stopwatch": "^5.4|^6.0"
|
||||
"symfony/config": "^4.4|^5.0|^6.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
|
||||
"symfony/error-handler": "^4.4|^5.0|^6.0",
|
||||
"symfony/expression-language": "^4.4|^5.0|^6.0",
|
||||
"symfony/http-foundation": "^4.4|^5.0|^6.0",
|
||||
"symfony/service-contracts": "^1.1|^2|^3",
|
||||
"symfony/stopwatch": "^4.4|^5.0|^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
"symfony/http-kernel": ""
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -1642,7 +1647,7 @@
|
||||
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v6.3.2"
|
||||
"source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1658,30 +1663,33 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-07-06T06:56:43+00:00"
|
||||
"time": "2023-07-06T06:34:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher-contracts",
|
||||
"version": "v3.3.0",
|
||||
"version": "v2.5.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher-contracts.git",
|
||||
"reference": "a76aed96a42d2b521153fb382d418e30d18b59df"
|
||||
"reference": "f98b54df6ad059855739db6fcbc2d36995283fe1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df",
|
||||
"reference": "a76aed96a42d2b521153fb382d418e30d18b59df",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1",
|
||||
"reference": "f98b54df6ad059855739db6fcbc2d36995283fe1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"php": ">=7.2.5",
|
||||
"psr/event-dispatcher": "^1"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/event-dispatcher-implementation": ""
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.4-dev"
|
||||
"dev-main": "2.5-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
@@ -1718,7 +1726,7 @@
|
||||
"standards"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0"
|
||||
"source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1734,27 +1742,26 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-05-23T14:45:45+00:00"
|
||||
"time": "2022-01-02T09:53:40+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v6.3.5",
|
||||
"version": "v5.4.27",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "a1b31d88c0e998168ca7792f222cbecee47428c4"
|
||||
"reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/a1b31d88c0e998168ca7792f222cbecee47428c4",
|
||||
"reference": "a1b31d88c0e998168ca7792f222cbecee47428c4",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d",
|
||||
"reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/filesystem": "^6.0"
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/polyfill-php80": "^1.16"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
@@ -1782,7 +1789,7 @@
|
||||
"description": "Finds files and directories via an intuitive fluent interface",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/finder/tree/v6.3.5"
|
||||
"source": "https://github.com/symfony/finder/tree/v5.4.27"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1798,7 +1805,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-09-26T12:56:25+00:00"
|
||||
"time": "2023-07-31T08:02:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
@@ -2129,28 +2136,31 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v6.3.7",
|
||||
"version": "v5.4.30",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "9758b6c69d179936435d0ffb577c3708d57e38a8"
|
||||
"reference": "c6980e82a6656f6ebfabfd82f7585794cb122554"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/9758b6c69d179936435d0ffb577c3708d57e38a8",
|
||||
"reference": "9758b6c69d179936435d0ffb577c3708d57e38a8",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/c6980e82a6656f6ebfabfd82f7585794cb122554",
|
||||
"reference": "c6980e82a6656f6ebfabfd82f7585794cb122554",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.1",
|
||||
"symfony/deprecation-contracts": "^2.5|^3",
|
||||
"php": ">=7.2.5",
|
||||
"symfony/deprecation-contracts": "^2.1|^3",
|
||||
"symfony/polyfill-ctype": "^1.8"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/console": "<5.4"
|
||||
"symfony/console": "<5.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/console": "^5.4|^6.0"
|
||||
"symfony/console": "^5.3|^6.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/console": "For validating YAML files using the lint command"
|
||||
},
|
||||
"bin": [
|
||||
"Resources/bin/yaml-lint"
|
||||
@@ -2181,7 +2191,7 @@
|
||||
"description": "Loads and dumps YAML files",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/yaml/tree/v6.3.7"
|
||||
"source": "https://github.com/symfony/yaml/tree/v5.4.30"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2197,7 +2207,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-10-28T23:31:00+00:00"
|
||||
"time": "2023-10-27T18:36:14+00:00"
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
@@ -2342,5 +2352,8 @@
|
||||
"php": "^8.0"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"platform-overrides": {
|
||||
"php": "8.0.0"
|
||||
},
|
||||
"plugin-api-version": "2.3.0"
|
||||
}
|
||||
|
1
content/00-welcome/05-todos.txt
Normal file
1
content/00-welcome/05-todos.txt
Normal file
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@ meta:
|
||||
navtitle: 'To Dos'
|
||||
title: 'A list of open tasks'
|
||||
description: ' Visual Editor with more stuff'
|
||||
heroimage: media/live/screenshot-2023-08-03-at-15-23-44-setup-3.png
|
||||
heroimage: ''
|
||||
heroimagealt: ''
|
||||
owner: 'Sebastian, testauthor'
|
||||
author: ''
|
||||
|
File diff suppressed because one or more lines are too long
@@ -38,7 +38,7 @@
|
||||
navtitle: 'To Dos'
|
||||
hide: false
|
||||
noindex: false
|
||||
path: /00-welcome/05-todos.md
|
||||
path: /00-welcome/05-todos.txtmd
|
||||
keyPath: '0.5'
|
||||
/cyanine-theme:
|
||||
navtitle: 'cyanine theme'
|
||||
|
@@ -10,7 +10,29 @@ use Typemill\Models\StorageWrapper;
|
||||
class Assets
|
||||
{
|
||||
public $baseUrl;
|
||||
|
||||
|
||||
public $JS;
|
||||
|
||||
public $CSS;
|
||||
|
||||
public $inlineJS;
|
||||
|
||||
public $inlineCSS;
|
||||
|
||||
public $editorJS;
|
||||
|
||||
public $editorCSS;
|
||||
|
||||
public $editorInlineJS;
|
||||
|
||||
public $svgSymbols;
|
||||
|
||||
public $meta;
|
||||
|
||||
public $imageUrl;
|
||||
|
||||
public $imageFolder;
|
||||
|
||||
public function __construct($baseUrl)
|
||||
{
|
||||
$this->baseUrl = $baseUrl;
|
||||
@@ -69,7 +91,7 @@ class Assets
|
||||
|
||||
public function activateVue()
|
||||
{
|
||||
$vueUrl = '<script src="' . $this->baseUrl . '/system/author/js/vue.min.js"></script>';
|
||||
$vueUrl = '<script src="' . $this->baseUrl . '/system/author/js/vue.js"></script>';
|
||||
if(!in_array($vueUrl, $this->JS))
|
||||
{
|
||||
$this->JS[] = $vueUrl;
|
||||
@@ -90,6 +112,7 @@ class Assets
|
||||
|
||||
public function activateTachyons()
|
||||
{
|
||||
die('Hi from asset class, Tachyons not available in Typemill v2');
|
||||
$tachyonsUrl = '<link rel="stylesheet" href="' . $this->baseUrl . '/system/author/css/tachyons.min.css" />';
|
||||
if(!in_array($tachyonsUrl, $this->CSS))
|
||||
{
|
||||
|
@@ -99,12 +99,16 @@ class ControllerApiAuthorArticle extends Controller
|
||||
'item' => $item,
|
||||
'metadata' => $metadata
|
||||
];
|
||||
$this->c->get('dispatcher')->dispatch(new OnPagePublished($data), 'onPagePublished');
|
||||
|
||||
$message = $this->c->get('dispatcher')->dispatch(new OnPagePublished($data), 'onPagePublished')->getData();
|
||||
|
||||
# validate message
|
||||
|
||||
$response->getBody()->write(json_encode([
|
||||
'navigation' => $draftNavigation,
|
||||
'item' => $item,
|
||||
'metadata' => $metadata
|
||||
'metadata' => $metadata,
|
||||
'message' => $message
|
||||
]));
|
||||
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
|
@@ -30,19 +30,11 @@ class ControllerApiSystemExtensions extends Controller
|
||||
return $response->withHeader('Content-Type', 'application/json')->withStatus(400);
|
||||
}
|
||||
|
||||
if(!isset($this->settings[$params['type']][$params['name']]))
|
||||
{
|
||||
$response->getBody()->write(json_encode([
|
||||
'message' => Translations::translate('The plugin or themes was not found.'),
|
||||
]));
|
||||
|
||||
return $response->withHeader('Content-Type', 'application/json')->withStatus(404);
|
||||
}
|
||||
|
||||
if($params['checked'] == true)
|
||||
{
|
||||
$extension = new Extension();
|
||||
|
||||
$definitions = false;
|
||||
if($params['type'] == 'plugins')
|
||||
{
|
||||
$definitions = $extension->getPluginDefinition($params['name']);
|
||||
@@ -51,6 +43,14 @@ class ControllerApiSystemExtensions extends Controller
|
||||
{
|
||||
$definitions = $extension->getThemeDefinition($params['name']);
|
||||
}
|
||||
if(!$definitions)
|
||||
{
|
||||
$response->getBody()->write(json_encode([
|
||||
'message' => Translations::translate('The plugin or themes was not found.'),
|
||||
]));
|
||||
|
||||
return $response->withHeader('Content-Type', 'application/json')->withStatus(404);
|
||||
}
|
||||
|
||||
if(isset($definitions['license']) && in_array($definitions['license'], ['MAKER', 'BUSINESS']))
|
||||
{
|
||||
|
@@ -72,7 +72,7 @@ class ControllerWebSystem extends Controller
|
||||
);
|
||||
|
||||
$extension = new Extension();
|
||||
$themeDefinitions = $extension->getThemeDetails();
|
||||
$themeDefinitions = $extension->getThemeDetails($this->settings['theme']);
|
||||
|
||||
# add userroles and other datasets
|
||||
foreach($themeDefinitions as $name => $definitions)
|
||||
@@ -126,7 +126,7 @@ class ControllerWebSystem extends Controller
|
||||
);
|
||||
|
||||
$extension = new Extension();
|
||||
$pluginDefinitions = $extension->getPluginDetails();
|
||||
$pluginDefinitions = $extension->getPluginDetails($this->settings['plugins']);
|
||||
|
||||
# add userroles and other datasets
|
||||
foreach($pluginDefinitions as $name => $definitions)
|
||||
@@ -137,7 +137,8 @@ class ControllerWebSystem extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$pluginSettings = $extension->getPluginSettings($this->settings['plugins']);
|
||||
# $pluginSettings = $extension->getPluginSettings($this->settings['plugins']);
|
||||
$pluginSettings = $this->settings['plugins'];
|
||||
|
||||
$license = [];
|
||||
if(is_array($this->settings['license']))
|
||||
@@ -150,7 +151,7 @@ class ControllerWebSystem extends Controller
|
||||
'darkmode' => $request->getAttribute('c_darkmode'),
|
||||
'mainnavi' => $mainNavigation,
|
||||
'jsdata' => [
|
||||
'systemnavi' => $systemNavigation,
|
||||
'systemnavi' => $systemNavigation,
|
||||
'settings' => $pluginSettings,
|
||||
'definitions' => $pluginDefinitions,
|
||||
'license' => $license,
|
||||
|
@@ -7,6 +7,17 @@ use Typemill\Events\OnShortcodeFound;
|
||||
|
||||
class ParsedownExtension extends \ParsedownExtra
|
||||
{
|
||||
|
||||
private $settings;
|
||||
|
||||
private $dispatcher;
|
||||
|
||||
private $showAnchor;
|
||||
|
||||
private $visualMode;
|
||||
|
||||
private $baseUrl;
|
||||
|
||||
function __construct($baseUrl = '', $settings = NULL, $dispatcher = NULL)
|
||||
{
|
||||
parent::__construct();
|
||||
|
@@ -11,6 +11,13 @@ use Typemill\Static\Translations;
|
||||
|
||||
class ApiAuthorization implements MiddlewareInterface
|
||||
{
|
||||
|
||||
private $acl;
|
||||
|
||||
private $resource;
|
||||
|
||||
private $action;
|
||||
|
||||
public function __construct($acl, string $resource = NULL, string $action = NULL)
|
||||
{
|
||||
$this->acl = $acl;
|
||||
|
@@ -7,7 +7,9 @@ use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||
use Slim\Flash\Messages;
|
||||
|
||||
class FlashMessages
|
||||
{
|
||||
{
|
||||
private $container;
|
||||
|
||||
public function __construct($container)
|
||||
{
|
||||
$this->container = $container;
|
||||
|
@@ -10,6 +10,15 @@ use Slim\Psr7\Response;
|
||||
|
||||
class WebAuthorization implements MiddlewareInterface
|
||||
{
|
||||
|
||||
private $router;
|
||||
|
||||
private $acl;
|
||||
|
||||
private $resource;
|
||||
|
||||
private $action;
|
||||
|
||||
public function __construct(RouteParser $router, $acl, string $resource = NULL, string $action = NULL)
|
||||
{
|
||||
$this->router = $router;
|
||||
|
@@ -9,7 +9,11 @@ use Psr\Http\Server\RequestHandlerInterface as RequestHandler;
|
||||
use Slim\Psr7\Response;
|
||||
|
||||
class WebRedirectIfAuthenticated implements MiddlewareInterface
|
||||
{
|
||||
{
|
||||
private $router;
|
||||
|
||||
private $settings;
|
||||
|
||||
public function __construct(RouteParser $router, $settings)
|
||||
{
|
||||
$this->router = $router;
|
||||
|
@@ -11,6 +11,8 @@ use Typemill\Models\User;
|
||||
|
||||
class WebRedirectIfUnauthenticated implements MiddlewareInterface
|
||||
{
|
||||
private $router;
|
||||
|
||||
public function __construct(RouteParser $router)
|
||||
{
|
||||
$this->router = $router;
|
||||
|
@@ -9,6 +9,8 @@ class Content
|
||||
{
|
||||
private $storage;
|
||||
|
||||
private $parsedown;
|
||||
|
||||
public function __construct($baseurl = NULL, $settings = NULL, $dispatcher = NULL)
|
||||
{
|
||||
$this->storage = new StorageWrapper('\Typemill\Models\Storage');
|
||||
|
@@ -14,25 +14,46 @@ class Extension
|
||||
$this->storage = new StorageWrapper('\Typemill\Models\Storage');
|
||||
}
|
||||
|
||||
public function getThemeDetails()
|
||||
public function getThemeDetails($activeThemeName = NULL)
|
||||
{
|
||||
$themes = $this->getThemes();
|
||||
|
||||
$themeDetails = [];
|
||||
foreach($themes as $themeName)
|
||||
{
|
||||
$themeDetails[$themeName] = $this->getThemeDefinition($themeName);
|
||||
$details = $this->getThemeDefinition($themeName);
|
||||
if($details && isset($details['name']))
|
||||
{
|
||||
# add to first position if active
|
||||
if($activeThemeName && ($activeThemeName == $themeName))
|
||||
{
|
||||
$themeDetails = array_merge(array($themeName => $details), $themeDetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
$themeDetails[$themeName] = $details;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $themeDetails;
|
||||
}
|
||||
|
||||
public function getThemeSettings($themes)
|
||||
public function getThemeSettings($themesInSettings)
|
||||
{
|
||||
# WHAT ABOUT DEFAULT-SETTINGS FROM THEME YAMLs?
|
||||
|
||||
$themes = $this->getThemes();
|
||||
|
||||
$themeSettings = [];
|
||||
foreach($themes as $themename => $themeinputs)
|
||||
foreach($themes as $themename)
|
||||
{
|
||||
if(!is_array($themeinputs)){ $themeinputs = []; }
|
||||
$themeinputs = [];
|
||||
if(isset($themesInSettings[$themename]))
|
||||
{
|
||||
$themeinputs = $themesInSettings[$themename];
|
||||
}
|
||||
|
||||
$themeSettings[$themename] = $themeinputs;
|
||||
$themeSettings[$themename]['customcss'] = $this->storage->getFile('cacheFolder', '', $themename . '-custom.css');
|
||||
}
|
||||
@@ -40,6 +61,7 @@ class Extension
|
||||
return $themeSettings;
|
||||
}
|
||||
|
||||
|
||||
public function getThemes()
|
||||
{
|
||||
$themeFolder = $this->storage->getFolderPath('themesFolder');
|
||||
@@ -71,36 +93,39 @@ class Extension
|
||||
'description' => Translations::translate('You can overwrite the theme-css with your own css here.')
|
||||
];
|
||||
|
||||
# add image preview file
|
||||
$themeSettings['preview'] = '/themes/' . $themeName . '/' . $themeName . '.png';
|
||||
|
||||
return $themeSettings;
|
||||
}
|
||||
|
||||
public function getPluginDetails()
|
||||
public function getPluginDetails($userSettings = NULL)
|
||||
{
|
||||
$plugins = $this->getPlugins();
|
||||
|
||||
$pluginDetails = [];
|
||||
foreach($plugins as $pluginName)
|
||||
{
|
||||
$pluginDetails[$pluginName] = $this->getPluginDefinition($pluginName);
|
||||
$details = $this->getPluginDefinition($pluginName);
|
||||
if($details && $details['name'])
|
||||
{
|
||||
# add active plugins first
|
||||
if(
|
||||
$userSettings
|
||||
&& isset($userSettings[$pluginName])
|
||||
&& ($userSettings[$pluginName]['active'] == true)
|
||||
)
|
||||
{
|
||||
$pluginDetails = array_merge(array($pluginName => $details), $pluginDetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pluginDetails[$pluginName] = $details;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $pluginDetails;
|
||||
}
|
||||
|
||||
public function getPluginSettings($plugins)
|
||||
{
|
||||
$pluginSettings = [];
|
||||
foreach($plugins as $pluginname => $plugininputs)
|
||||
{
|
||||
$pluginSettings[$pluginname] = $plugininputs;
|
||||
}
|
||||
|
||||
return $pluginSettings;
|
||||
}
|
||||
|
||||
public function getPlugins()
|
||||
{
|
||||
$pluginFolder = $this->storage->getFolderPath('pluginsFolder');
|
||||
|
@@ -41,7 +41,7 @@ class Storage
|
||||
|
||||
protected $isReadable = [];
|
||||
|
||||
protected $isWrtiable = [];
|
||||
protected $isWritable = [];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
@@ -9,6 +9,8 @@ class User
|
||||
{
|
||||
private $userDir;
|
||||
|
||||
private $storage;
|
||||
|
||||
private $yaml;
|
||||
|
||||
private $user = false;
|
||||
|
@@ -16,6 +16,8 @@ abstract class Plugin implements EventSubscriberInterface
|
||||
|
||||
protected $route;
|
||||
|
||||
protected $urlinfo;
|
||||
|
||||
protected $adminroute = false;
|
||||
|
||||
protected $editorroute = false;
|
||||
@@ -26,7 +28,11 @@ abstract class Plugin implements EventSubscriberInterface
|
||||
$this->container = $container;
|
||||
$this->urlinfo = $this->container->get('urlinfo');
|
||||
$this->route = $this->urlinfo['route'];
|
||||
$this->route = ltrim($this->route, '/');
|
||||
|
||||
if($this->route != '/')
|
||||
{
|
||||
$this->route = ltrim($this->route, '/');
|
||||
}
|
||||
|
||||
if(str_starts_with($this->route, 'tm/'))
|
||||
{
|
||||
|
@@ -241,7 +241,7 @@ $container->set('translations', $translations);
|
||||
$container->set('dispatcher', function() use ($dispatcher){ return $dispatcher; });
|
||||
|
||||
# asset function for plugins
|
||||
$assets = new \Typemill\Assets($urlinfo['basepath']);
|
||||
$assets = new \Typemill\Assets($urlinfo['baseurl']);
|
||||
$container->set('assets', function() use ($assets){ return $assets; });
|
||||
|
||||
/****************************
|
||||
@@ -286,6 +286,16 @@ $container->set('view', function() use ($settings, $urlinfo, $translations) {
|
||||
* MIDDLEWARE *
|
||||
****************************/
|
||||
|
||||
foreach($middleware as $pluginMiddleware)
|
||||
{
|
||||
$middlewareClass = $pluginMiddleware['classname'];
|
||||
$middlewareParams = $pluginMiddleware['params'];
|
||||
if(class_exists($middlewareClass))
|
||||
{
|
||||
$app->add(new $middlewareClass($middlewareParams));
|
||||
}
|
||||
}
|
||||
|
||||
$app->add(new AssetMiddleware($assets, $container->get('view')));
|
||||
|
||||
$app->add(new ValidationErrorsMiddleware($container->get('view')));
|
||||
|
@@ -215,7 +215,7 @@
|
||||
|
||||
{% block javascripts %}
|
||||
|
||||
<script src="{{ base_url }}/system/author/js/typemillutils.js?20220108"></script>
|
||||
<script src="{{ base_url }}/system/typemill/author/js/typemillutils.js?20220108"></script>
|
||||
<script>typemillUtilities.start();</script>
|
||||
|
||||
{% if settings.themes.cyanine.collapseNav %}
|
||||
|
Reference in New Issue
Block a user