Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b2243cd06d | ||
|
|
8f09b67d86 | ||
|
|
fe459aec80 |
@@ -106,6 +106,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
||||
'str' => $str,
|
||||
'id' => '',
|
||||
'target' => '',
|
||||
'target_style' => '',
|
||||
'highlight' => [],
|
||||
],
|
||||
$em->getLastErrorMsg()
|
||||
@@ -139,6 +140,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
||||
'level' => 'info',
|
||||
'str' => 'INFO MESSAGE',
|
||||
'target' => '',
|
||||
'target_style' => '',
|
||||
'highlight' => [],
|
||||
],
|
||||
$em->getLastErrorMsg()
|
||||
@@ -154,6 +156,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
||||
'level' => 'info',
|
||||
'str' => 'INFO MESSAGE',
|
||||
'target' => '',
|
||||
'target_style' => '',
|
||||
'highlight' => [],
|
||||
]
|
||||
],
|
||||
@@ -171,6 +174,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
||||
'level' => 'error',
|
||||
'str' => 'ERROR MESSAGE',
|
||||
'target' => '',
|
||||
'target_style' => '',
|
||||
'highlight' => [],
|
||||
],
|
||||
$em->getLastErrorMsg()
|
||||
@@ -186,6 +190,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
||||
'level' => 'info',
|
||||
'str' => 'INFO MESSAGE',
|
||||
'target' => '',
|
||||
'target_style' => '',
|
||||
'highlight' => [],
|
||||
],
|
||||
[
|
||||
@@ -193,6 +198,7 @@ final class CoreLibsLoggingErrorMessagesTest extends TestCase
|
||||
'level' => 'error',
|
||||
'str' => 'ERROR MESSAGE',
|
||||
'target' => '',
|
||||
'target_style' => '',
|
||||
'highlight' => [],
|
||||
]
|
||||
],
|
||||
|
||||
10
composer.lock
generated
10
composer.lock
generated
@@ -1180,16 +1180,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.10.33",
|
||||
"version": "1.10.34",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1"
|
||||
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1238,7 +1238,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-09-04T12:20:53+00:00"
|
||||
"time": "2023-09-13T09:49:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan-deprecation-rules",
|
||||
|
||||
12
vendor/composer/installed.json
vendored
12
vendor/composer/installed.json
vendored
@@ -1179,17 +1179,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.10.33",
|
||||
"version_normalized": "1.10.33.0",
|
||||
"version": "1.10.34",
|
||||
"version_normalized": "1.10.34.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1"
|
||||
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
||||
"reference": "03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||
"reference": "7f806b6f1403e6914c778140e2ba07c293cb4901",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1198,7 +1198,7 @@
|
||||
"conflict": {
|
||||
"phpstan/phpstan-shim": "*"
|
||||
},
|
||||
"time": "2023-09-04T12:20:53+00:00",
|
||||
"time": "2023-09-13T09:49:47+00:00",
|
||||
"bin": [
|
||||
"phpstan",
|
||||
"phpstan.phar"
|
||||
|
||||
6
vendor/composer/installed.php
vendored
6
vendor/composer/installed.php
vendored
@@ -191,9 +191,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'phpstan/phpstan' => array(
|
||||
'pretty_version' => '1.10.33',
|
||||
'version' => '1.10.33.0',
|
||||
'reference' => '03b1cf9f814ba0863c4e9affea49a4d1ed9a2ed1',
|
||||
'pretty_version' => '1.10.34',
|
||||
'version' => '1.10.34.0',
|
||||
'reference' => '7f806b6f1403e6914c778140e2ba07c293cb4901',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpstan/phpstan',
|
||||
'aliases' => array(),
|
||||
|
||||
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
BIN
vendor/phpstan/phpstan/phpstan.phar
vendored
Binary file not shown.
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
26
vendor/phpstan/phpstan/phpstan.phar.asc
vendored
@@ -1,16 +1,16 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmT1y40ACgkQUcZzBf/C
|
||||
5cDm6Q//VupQizxW3TICxhwzMDz05+nI8d72mn5vd94Niat90L1wPVHSZ9eBQSs3
|
||||
xMGVKJufB/3tQp6rviYk0aFnTFsKYkgwQYSDk1P9D7VrcJdpB461P3FT4MGsRk8E
|
||||
SSo55EuMGpiVvgoKbiPXeYV76yEp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LYlInBSu
|
||||
r0LtQQ8+/llQ/bP0XS6cC6247J1fxO9xYMMmKVBfJrul3Wi6ETRI5WIdEQTSc2Z+
|
||||
rE00JY2X/vxJijUyGZ88+QDX3z7vGyaQJZiXq1XyjmBYw6w8UlxhGZcGGDIbTsb7
|
||||
lACLR/t4hgtE69QXW+L4P2ngU0agk5XXojg/+r+CnCWD/TdKcvs1WTn4TyuMZOLa
|
||||
2XF3h9/H0XMfE5LPlNJmb4YRjYjcNvPQwmGI4dmUMCJuTpjHUnpFXfswu4xgsaYV
|
||||
xq756DVfrRyG9PyXFfJZ66P7jt5+wisrVsWh/X3nX69P0ruwwss=
|
||||
=aOCq
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
@@ -40,6 +40,7 @@ print "NU: " . ml::fromValue(100)->name . "<br>";
|
||||
print "NU: " . ml::fromValue(1000)->name . "<br>";
|
||||
|
||||
$em->setErrorMsg('123', 'error', 'msg this is bad, not logged');
|
||||
$em->setErrorMsg('123', 'error', 'msg this is bad, not logged', 'target-id', 'other-style');
|
||||
$em->setErrorMsg('123', 'error', 'msg this is bad, logged', log_error:true);
|
||||
$em->setErrorMsg('1000', 'info', 'This is good');
|
||||
$em->setErrorMsg('9999', 'abort', 'BAD: This is critical (abort)');
|
||||
|
||||
@@ -35,6 +35,8 @@ class EditBase
|
||||
private \CoreLibs\Output\Form\Generate $form;
|
||||
/** @var \CoreLibs\Logging\Logging */
|
||||
public \CoreLibs\Logging\Logging $log;
|
||||
/** @var \CoreLibs\Language\L10n */
|
||||
public \CoreLibs\Language\L10n $l;
|
||||
/** @var \CoreLibs\ACL\Login */
|
||||
public \CoreLibs\ACL\Login $login;
|
||||
|
||||
@@ -57,6 +59,7 @@ class EditBase
|
||||
) {
|
||||
$this->log = $log;
|
||||
$this->login = $login;
|
||||
$this->l = $l10n;
|
||||
// smarty template engine (extended Translation version)
|
||||
$this->smarty = new \CoreLibs\Template\SmartyExtend(
|
||||
$l10n,
|
||||
@@ -77,7 +80,7 @@ class EditBase
|
||||
echo "I am sorry, but this page cannot be viewed by a mobile phone";
|
||||
exit;
|
||||
}
|
||||
// $this->form->log->debug('POST', $this->form->log->prAr($_POST));
|
||||
// $this->log->debug('POST', $this->log->prAr($_POST));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -179,7 +182,7 @@ class EditBase
|
||||
} // while read data ...
|
||||
|
||||
// html title
|
||||
$this->HEADER['HTML_TITLE'] = $this->form->l->__('Edit Order');
|
||||
$this->HEADER['HTML_TITLE'] = $this->l->__('Edit Order');
|
||||
|
||||
$messages = [];
|
||||
$error = $_POST['error'] ?? 0;
|
||||
@@ -632,7 +635,7 @@ class EditBase
|
||||
'editAdmin_' . $this->smarty->lang
|
||||
);
|
||||
|
||||
$this->form->log->debug('DEBUGEND', '==================================== [Form END]');
|
||||
$this->log->debug('DEBUGEND', '==================================== [Form END]');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ use CoreLibs\Logging\Logger\MessageLevel;
|
||||
|
||||
class ErrorMessage
|
||||
{
|
||||
/** @var array<int,array{id:string,level:string,str:string,target:string,highlight:string[]}> */
|
||||
/** @var array<int,array{id:string,level:string,str:string,target:string,target_style:string,highlight:string[]}> */
|
||||
private array $error_str = [];
|
||||
/** @var \CoreLibs\Logging\Logging $log */
|
||||
public \CoreLibs\Logging\Logging $log;
|
||||
@@ -52,23 +52,28 @@ class ErrorMessage
|
||||
* not set: unkown, will be logged as "emergency"
|
||||
* target/highlight: id target name for frontend where to attach this message
|
||||
* highlight is a list of other target points to highlight
|
||||
* for highlight targets css names are $level without a prefix and should be
|
||||
* nested in the target element "input .error { ... }"
|
||||
* target_style: if not set uses 'error-' $level as css style. applies to targets or main only
|
||||
*
|
||||
* @param string $error_id Any internal error ID for this error
|
||||
* @param string $level Error level in ok/info/warn/error
|
||||
* @param string $str Error message (out)
|
||||
* @param string $target alternate attachment point for this error message
|
||||
* @param array<string> $highlight Any additional error data as error OR
|
||||
* highlight points for field highlights
|
||||
* @param string|null $message If abort/crash, non localized $str
|
||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||
* else set for this call only
|
||||
* @param string $error_id Any internal error ID for this error
|
||||
* @param string $level Error level in ok/info/warn/error
|
||||
* @param string $str Error message (out)
|
||||
* @param string $target alternate attachment point for this error message
|
||||
* @param string $target_style Alternate color style for the error message
|
||||
* @param array<string> $highlight Any additional error data as error OR
|
||||
* highlight points for field highlights
|
||||
* @param string|null $message If abort/crash, non localized $str
|
||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||
* else set for this call only
|
||||
*/
|
||||
public function setErrorMsg(
|
||||
string $error_id,
|
||||
string $level,
|
||||
string $str,
|
||||
string $target = '',
|
||||
string $target_style = '',
|
||||
array $highlight = [],
|
||||
?string $message = null,
|
||||
array $context = [],
|
||||
@@ -88,6 +93,7 @@ class ErrorMessage
|
||||
'level' => $level,
|
||||
'str' => $str,
|
||||
'target' => $target,
|
||||
'target_style' => $target_style,
|
||||
'highlight' => $highlight,
|
||||
];
|
||||
// write to log for abort/crash
|
||||
@@ -126,28 +132,40 @@ class ErrorMessage
|
||||
* Note, the parameter order is different and does not need an error id
|
||||
* This is for backend alerts
|
||||
*
|
||||
* @param string $level error level (ok/warn/info/error)
|
||||
* @param string $str error string
|
||||
* @param string|null $error_id optional error id for precise error lookup
|
||||
* @param string $target Alternate id name for output target on frontend
|
||||
* @param array<string> $highlight Any additional error data as error OR
|
||||
* highlight points for field highlights
|
||||
* @param string|null $message If abort/crash, non localized $str
|
||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||
* else set for this call only
|
||||
* @param string $level error level (ok/warn/info/error)
|
||||
* @param string $str error string
|
||||
* @param string|null $error_id optional error id for precise error lookup
|
||||
* @param string $target Alternate id name for output target on frontend
|
||||
* @param string $target_style Alternate color style for the error message
|
||||
* @param array<string> $highlight Any additional error data as error OR
|
||||
* highlight points for field highlights
|
||||
* @param string|null $message If abort/crash, non localized $str
|
||||
* @param array<mixed> $context Additionl info for abort/crash messages
|
||||
* @param bool|null $log_error [=null] log level 'error' to error, if null use global,
|
||||
* else set for this call only
|
||||
*/
|
||||
public function setMessage(
|
||||
string $level,
|
||||
string $str,
|
||||
?string $error_id = null,
|
||||
string $target = '',
|
||||
string $target_style = '',
|
||||
array $highlight = [],
|
||||
?string $message = null,
|
||||
array $context = [],
|
||||
?bool $log_error = null,
|
||||
): void {
|
||||
$this->setErrorMsg($error_id ?? '', $level, $str, $target, $highlight, $message, $context, $log_error);
|
||||
$this->setErrorMsg(
|
||||
$error_id ?? '',
|
||||
$level,
|
||||
$str,
|
||||
$target,
|
||||
$target_style,
|
||||
$highlight,
|
||||
$message,
|
||||
$context,
|
||||
$log_error
|
||||
);
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
@@ -178,7 +196,7 @@ class ErrorMessage
|
||||
* Gets the LAST entry in the array list.
|
||||
* If nothing found returns empty array set
|
||||
*
|
||||
* @return array{id:string,level:string,str:string,target:string,highlight:string[]} Error block
|
||||
* @return array{id:string,level:string,str:string,target:string,target:string,highlight:string[]} Error block
|
||||
*/
|
||||
public function getLastErrorMsg(): array
|
||||
{
|
||||
@@ -187,6 +205,7 @@ class ErrorMessage
|
||||
'str' => '',
|
||||
'id' => '',
|
||||
'target' => '',
|
||||
'target_string' => '',
|
||||
'highlight' => [],
|
||||
];
|
||||
}
|
||||
|
||||
40
www/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php
Normal file
40
www/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace CoreLibs\Output\Form\TableArrays;
|
||||
|
||||
class EditOrder implements Interface\TableArraysInterface
|
||||
{
|
||||
/** @var \CoreLibs\Output\Form\Generate */
|
||||
private \CoreLibs\Output\Form\Generate $form;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
* @param \CoreLibs\Output\Form\Generate $form base form class
|
||||
*/
|
||||
public function __construct(\CoreLibs\Output\Form\Generate $form)
|
||||
{
|
||||
$this->form = $form;
|
||||
$this->form->log->debug('CLASS LOAD', __NAMESPACE__ . __CLASS__);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: this is a dummy array to just init the Form\Generate class and is not used for anything else
|
||||
*
|
||||
* @return array<mixed>
|
||||
*/
|
||||
public function setTableArray(): array
|
||||
{
|
||||
return [
|
||||
'table_array' => [
|
||||
'-'
|
||||
],
|
||||
'table_name' => '-',
|
||||
'load_query' => '',
|
||||
'show_fields' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// __END__
|
||||
1
www/vendor/composer/autoload_classmap.php
vendored
1
www/vendor/composer/autoload_classmap.php
vendored
@@ -68,6 +68,7 @@ return array(
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditOrder' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => $baseDir . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
||||
|
||||
1
www/vendor/composer/autoload_static.php
vendored
1
www/vendor/composer/autoload_static.php
vendored
@@ -119,6 +119,7 @@ class ComposerStaticInit10fe8fe2ec4017b8644d2b64bcf398b9
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditGroups' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditGroups.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditLanguages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditLanguages.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditMenuGroup' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditMenuGroup.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditOrder' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditOrder.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditPages' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditPages.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditSchemas' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditSchemas.php',
|
||||
'CoreLibs\\Output\\Form\\TableArrays\\EditUsers' => __DIR__ . '/../..' . '/lib/CoreLibs/Output/Form/TableArrays/EditUsers.php',
|
||||
|
||||
Reference in New Issue
Block a user