' .
@@ -167,7 +162,7 @@ class Manage extends Process
'' .
(new Number(['a[' . $k . '][alias_position]']))->min(1)->max(count($aliases))->default((int) $v['alias_position'])->class('position')->title(sprintf(__('position of %s'), Html::escapeHTML($v['alias_url'])))->render() . ' | ' .
'' .
- (new Checkbox(['a[' . $k . '][alias_redirect]'], (bool) $v['alias_redirect']))->title(sprintf(__('visible redirection to %s'), Html::escapeHTML(dcCore::app()->blog->url . $v['alias_destination'])))->render() . ' | ' .
+ (new Checkbox(['a[' . $k . '][alias_redirect]'], (bool) $v['alias_redirect']))->title(sprintf(__('visible redirection to %s'), Html::escapeHTML(App::blog()->url() . $v['alias_destination'])))->render() . '' .
'';
}
diff --git a/src/My.php b/src/My.php
index 63d4385..ef38aa7 100644
--- a/src/My.php
+++ b/src/My.php
@@ -1,36 +1,31 @@
auth->check(dcCore::app()->auth->makePermissions([
- dcCore::app()->auth::PERMISSION_ADMIN,
- ]), dcCore::app()->blog->id);
+ return match ($context) {
+ My::BACKEND, My::MANAGE, My::MENU => App::task()->checkContext('BACKEND')
+ && App::auth()->check(App::auth()->makePermissions([
+ App::auth()::PERMISSION_ADMIN,
+ ]), App::blog()->id()),
+
+ default => null,
+ };
}
}
diff --git a/src/Prepend.php b/src/Prepend.php
index e4f535e..805c1bf 100644
--- a/src/Prepend.php
+++ b/src/Prepend.php
@@ -1,24 +1,22 @@
addBehavior('urlHandlerGetArgsDocument', function (dcUrlHandlers $handler): void {
+ App::behavior()->addBehavior('urlHandlerGetArgsDocument', function (Url $handler): void {
$found = $redir = false;
$type = '';
$part = $args = $_SERVER['URL_REQUEST_PART'];
@@ -63,19 +61,20 @@ class Prepend extends Process
// Use visible redirection
if ($redir) {
- Http::redirect(dcCore::app()->blog->url . $part);
+ Http::redirect(App::blog()->url() . $part);
}
// regain URL type
$_SERVER['URL_REQUEST_PART'] = $part;
- dcCore::app()->url->getArgs($part, $type, $args);
+ $handler->getArgs($part, $type, $args);
// call real handler
if (!$type) {
- dcCore::app()->url->callDefaultHandler($args);
+ $handler->callDefaultHandler($args);
} else {
- dcCore::app()->url->callHandler($type, $args);
+ $handler->callHandler($type, $args);
}
+ exit;
});
return true;
diff --git a/src/Uninstall.php b/src/Uninstall.php
index 7fd2a23..bcb1f73 100644
--- a/src/Uninstall.php
+++ b/src/Uninstall.php
@@ -1,23 +1,20 @@
plugins->moduleExists('Uninstaller')) {
+ if (!self::status()) {
return false;
}
@@ -35,7 +32,7 @@ class Uninstall extends Process
->addUserAction(
'tables',
'delete',
- My::ALIAS_TABLE_NAME
+ Alias::ALIAS_TABLE_NAME
)
->addUserAction(
'plugins',
@@ -51,7 +48,7 @@ class Uninstall extends Process
->addDirectAction(
'tables',
'delete',
- My::ALIAS_TABLE_NAME
+ Alias::ALIAS_TABLE_NAME
)
->addDirectAction(
'plugins',