use new addBehaviors method
parent
82a006a2e2
commit
1d58b6cf8c
17
_admin.php
17
_admin.php
|
@ -53,9 +53,8 @@ class Admin
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
dcCore::app()->addBehavior(
|
dcCore::app()->addBehaviors([
|
||||||
'adminModulesListGetActions',
|
'adminModulesListGetActions' => function ($list, $id, $_) {
|
||||||
function ($list, $id, $_) {
|
|
||||||
return in_array($list->getList(), [
|
return in_array($list->getList(), [
|
||||||
'plugin-activate',
|
'plugin-activate',
|
||||||
'theme-activate',
|
'theme-activate',
|
||||||
|
@ -64,12 +63,8 @@ class Admin
|
||||||
basename(__DIR__),
|
basename(__DIR__),
|
||||||
html::escapeHTML($id)
|
html::escapeHTML($id)
|
||||||
) : null;
|
) : null;
|
||||||
}
|
},
|
||||||
);
|
'adminModulesListDoActions' => function ($list, $modules, $type) {
|
||||||
|
|
||||||
dcCore::app()->addBehavior(
|
|
||||||
'adminModulesListDoActions',
|
|
||||||
function ($list, $modules, $type) {
|
|
||||||
# Pack action
|
# Pack action
|
||||||
if (empty($_POST[basename(__DIR__)])
|
if (empty($_POST[basename(__DIR__)])
|
||||||
|| !is_array($_POST[basename(__DIR__)])) {
|
|| !is_array($_POST[basename(__DIR__)])) {
|
||||||
|
@ -143,8 +138,8 @@ class Admin
|
||||||
__('Task successfully executed.')
|
__('Task successfully executed.')
|
||||||
);
|
);
|
||||||
http::redirect($list->getURL());
|
http::redirect($list->getURL());
|
||||||
}
|
},
|
||||||
);
|
]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue