Compare commits

...

4 Commits
v1.8.1 ... main

Author SHA1 Message Date
slawkens
a6032093b2 Better look for myaac-table 2025-09-14 19:35:12 +02:00
slawkens
4eab805d26 Fix when config.local.php cannot be saved 2025-09-09 17:49:05 +02:00
slawkens
3f24f961b1 Possibility to override routes with plugins pages, like characters.php
No need to define routes in plugin.json anymore
2025-09-09 15:17:06 +02:00
slawkens
0b86459940 Start v1.8.2-dev 2025-09-07 09:33:18 +02:00
4 changed files with 52 additions and 39 deletions

View File

@@ -26,7 +26,7 @@
if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.'); if (version_compare(phpversion(), '8.1', '<')) die('PHP version 8.1 or higher is required.');
const MYAAC = true; const MYAAC = true;
const MYAAC_VERSION = '1.8.1'; const MYAAC_VERSION = '1.8.2-dev';
const DATABASE_VERSION = 45; const DATABASE_VERSION = 45;
const TABLE_PREFIX = 'myaac_'; const TABLE_PREFIX = 'myaac_';
define('START_TIME', microtime(true)); define('START_TIME', microtime(true));

View File

@@ -42,10 +42,9 @@ if(!$error) {
$configToSave['cache_prefix'] = 'myaac_' . generateRandomString(8, true, false, true); $configToSave['cache_prefix'] = 'myaac_' . generateRandomString(8, true, false, true);
$configToSave['database_auto_migrate'] = true; $configToSave['database_auto_migrate'] = true;
if(!$error) {
$content = ''; $content = '';
$saved = Settings::saveConfig($configToSave, BASE . 'config.local.php', $content); $saved = Settings::saveConfig($configToSave, BASE . 'config.local.php', $content);
if ($saved) { if ($saved || file_exists(BASE . 'config.local.php')) {
success($locale['step_database_config_saved']); success($locale['step_database_config_saved']);
$_SESSION['saved'] = true; $_SESSION['saved'] = true;
@@ -74,14 +73,14 @@ if(!$error) {
} }
} }
} else { } else {
$error = true;
$_SESSION['config_content'] = $content; $_SESSION['config_content'] = $content;
unset($_SESSION['saved']); unset($_SESSION['saved']);
$locale['step_database_error_file'] = str_replace('$FILE$', '<b>' . BASE . 'config.php</b>', $locale['step_database_error_file']); $locale['step_database_error_file'] = str_replace('$FILE$', '<b>' . BASE . 'config.local.php</b>', $locale['step_database_error_file']);
error($locale['step_database_error_file'] . '<br/> error($locale['step_database_error_file'] . '<br/>
<textarea cols="70" rows="10">' . $content . '</textarea>'); <textarea cols="70" rows="10">' . $content . '</textarea>');
} }
}
} }
?> ?>

View File

@@ -94,19 +94,30 @@ $dispatcher = FastRoute\cachedDispatcher(function (FastRoute\RouteCollector $r)
$routesFinal[] = ['*', $page, '__database__/' . $page, 100]; $routesFinal[] = ['*', $page, '__database__/' . $page, 100];
} }
$routes = require SYSTEM . 'routes.php';
Plugins::clearWarnings(); Plugins::clearWarnings();
foreach (Plugins::getRoutes() as $route) {
$routesFinal[] = [$route[0], $route[1], $route[2], $route[3] ?? 1000]; foreach (Plugins::getRoutes() as $pluginRoute) {
$routesFinal[] = [$pluginRoute[0], $pluginRoute[1], $pluginRoute[2], $pluginRoute[3] ?? 1000];
// Possibility to override routes with plugins pages, like characters.php
foreach ($routes as &$route) {
if (str_contains($pluginRoute[2], 'pages/' . $route[2])) {
$route[2] = $pluginRoute[2];
}
}
/* /*
echo '<pre>'; echo '<pre>';
var_dump($route[1], $route[3], $route[2]); var_dump($pluginRoute[1], $pluginRoute[3], $pluginRoute[2]);
echo '/<pre>'; echo '/<pre>';
*/ */
} }
$routes = require SYSTEM . 'routes.php';
foreach ($routes as $route) { foreach ($routes as $route) {
if (!str_contains($route[2], '__redirect__') && !str_contains($route[2], '__database__')) { if (!str_contains($route[2], '__redirect__') && !str_contains($route[2], '__database__')
&& !str_contains($route[2], 'plugins/')
) {
if (!is_file(BASE . 'system/pages/' . $route[2])) { if (!is_file(BASE . 'system/pages/' . $route[2])) {
continue; continue;
} }

View File

@@ -1,6 +1,9 @@
<style> <style>
.myaac-table {border-spacing: 1px;}
.myaac-table tbody tr:nth-child(even) {background: {{ config.lightborder }}} .myaac-table tbody tr:nth-child(even) {background: {{ config.lightborder }}}
.myaac-table tbody tr:nth-child(odd) {background: {{ config.darkborder }}} .myaac-table tbody tr:nth-child(odd) {background: {{ config.darkborder }}}
.myaac-table thead td {background: {{ config.vdarkborder }}; color: #ffffff !important;} .myaac-table tbody td {padding: 4px; }
.myaac-table tfoot td {background: {{ config.vdarkborder }}; color: #ffffff !important;} .myaac-table thead td {padding: 4px; background: {{ config.vdarkborder }}; color: #ffffff !important;}
.myaac-table thead th {padding: 4px; background: {{ config.vdarkborder }}; color: #ffffff !important;}
.myaac-table tfoot td {padding: 4px; background: {{ config.vdarkborder }}; color: #ffffff !important;}
</style> </style>