mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/ajax] Handle acp_modules error cases with JSON response
PHPBB3-10270
This commit is contained in:
parent
2f44850a28
commit
e73426fe26
1 changed files with 9 additions and 1 deletions
|
@ -36,7 +36,7 @@ class acp_modules
|
||||||
|
|
||||||
function main($id, $mode)
|
function main($id, $mode)
|
||||||
{
|
{
|
||||||
global $db, $user, $auth, $template, $module;
|
global $db, $user, $auth, $template, $module, $request;
|
||||||
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
|
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
|
||||||
|
@ -373,6 +373,14 @@ class acp_modules
|
||||||
// Default management page
|
// Default management page
|
||||||
if (sizeof($errors))
|
if (sizeof($errors))
|
||||||
{
|
{
|
||||||
|
if ($request->is_ajax())
|
||||||
|
{
|
||||||
|
phpbb_json_response::send(array(
|
||||||
|
'MESSAGE_TITLE' => $user->lang('ERROR'),
|
||||||
|
'MESSAGE_TEXT' => implode('<br />', $errors),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template->assign_vars(array(
|
||||||
'S_ERROR' => true,
|
'S_ERROR' => true,
|
||||||
'ERROR_MSG' => implode('<br />', $errors))
|
'ERROR_MSG' => implode('<br />', $errors))
|
||||||
|
|
Loading…
Add table
Reference in a new issue