diff options
author | Callum Macrae <callum@lynxphp.com> | 2011-08-24 16:39:25 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:15 +0200 |
commit | e7e09f8da26abf0d4e625653d14d68774050a244 (patch) | |
tree | 94bfa8d1ebffab7be6599488805d8e5a4417c3df | |
parent | fc7cb6a70b9e0422bf5658bb9f49de831be08718 (diff) | |
download | forums-e7e09f8da26abf0d4e625653d14d68774050a244.tar forums-e7e09f8da26abf0d4e625653d14d68774050a244.tar.gz forums-e7e09f8da26abf0d4e625653d14d68774050a244.tar.bz2 forums-e7e09f8da26abf0d4e625653d14d68774050a244.tar.xz forums-e7e09f8da26abf0d4e625653d14d68774050a244.zip |
[ticket/10272] AJAXified the bots page in the ACP.
PHPBB3-10272
-rw-r--r-- | phpBB/adm/style/acp_bots.html | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_bots.php | 10 | ||||
-rw-r--r-- | phpBB/styles/script.js | 8 |
3 files changed, 19 insertions, 3 deletions
diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 886005caa3..e0e9588364 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -76,9 +76,9 @@ <!-- IF bots.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td style="width: 50%;">{bots.BOT_NAME}</td> <td style="width: 15%; white-space: nowrap;" align="center"> {bots.LAST_VISIT} </td> - <td style="text-align: center;"> <a href="{bots.U_ACTIVATE_DEACTIVATE}">{bots.L_ACTIVATE_DEACTIVATE}</a> </td> + <td style="text-align: center;"> <a href="{bots.U_ACTIVATE_DEACTIVATE}" data-ajax="style_act_deact">{bots.L_ACTIVATE_DEACTIVATE}</a> </td> <td style="text-align: center;"> <a href="{bots.U_EDIT}">{L_EDIT}</a> </td> - <td style="text-align: center;"> <a href="{bots.U_DELETE}">{L_DELETE}</a> </td> + <td style="text-align: center;"> <a href="{bots.U_DELETE}" data-ajax="row_delete">{L_DELETE}</a> </td> <td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{bots.BOT_ID}" /></td> </tr> <!-- END bots --> diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index f080b3c9fb..b9dd6664f4 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -24,7 +24,7 @@ class acp_bots function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache; + global $config, $db, $user, $auth, $template, $cache, $request; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; $action = request_var('action', ''); @@ -352,6 +352,14 @@ class acp_bots break; } + + if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate')) + { + $json_response = new phpbb_json_response; + $json_response->send(array( + 'text' => $user->lang['BOT_' . (($action == 'activate') ? 'DE' : '') . 'ACTIVATE'], + )); + } $s_options = ''; $_options = array('activate' => 'BOT_ACTIVATE', 'deactivate' => 'BOT_DEACTIVATE', 'delete' => 'DELETE'); diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js index 16d64319d9..59fe7cf8e2 100644 --- a/phpBB/styles/script.js +++ b/phpBB/styles/script.js @@ -228,6 +228,10 @@ phpbb.ajaxify = function(options, refresh, callback) { { var alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); } + else + { + dark.fadeOut(); + } if (typeof phpbb.ajax_callbacks[callback] === 'function') { @@ -249,6 +253,10 @@ phpbb.ajaxify = function(options, refresh, callback) { { var alert = phpbb.alert(res.MESSAGE_TITLE, res.MESSAGE_TEXT); } + else + { + dark.fadeOut(); + } if (typeof phpbb.ajax_callbacks[callback] === 'function') { |