diff options
| author | Igor Wiedler <igor@wiedler.ch> | 2012-02-15 22:45:04 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:10:15 +0200 |
| commit | e73426fe267a13e2964273e31391dcd93e50ad1b (patch) | |
| tree | 1d7b89872975b53850875843ec86925b29090814 | |
| parent | 2f44850a28fa9121052b9db57370d8e20ec5a0aa (diff) | |
| download | forums-e73426fe267a13e2964273e31391dcd93e50ad1b.tar forums-e73426fe267a13e2964273e31391dcd93e50ad1b.tar.gz forums-e73426fe267a13e2964273e31391dcd93e50ad1b.tar.bz2 forums-e73426fe267a13e2964273e31391dcd93e50ad1b.tar.xz forums-e73426fe267a13e2964273e31391dcd93e50ad1b.zip | |
[feature/ajax] Handle acp_modules error cases with JSON response
PHPBB3-10270
| -rw-r--r-- | phpBB/includes/acp/acp_modules.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 9d87bbbfbb..427a3e1e71 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -36,7 +36,7 @@ class acp_modules 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; // 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 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( 'S_ERROR' => true, 'ERROR_MSG' => implode('<br />', $errors)) |
