diff options
author | Callum Macrae <callum@lynxphp.com> | 2011-08-24 16:06:06 +0100 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:15 +0200 |
commit | 4ae74cd4b450ae4cca956f6f3e2371429f67deec (patch) | |
tree | cef3051d4e47ea1a427c27cb70ac8fa06cd651a1 | |
parent | 1cb3b595ec70730429a9c8654b248fc6d50cf1b3 (diff) | |
download | forums-4ae74cd4b450ae4cca956f6f3e2371429f67deec.tar forums-4ae74cd4b450ae4cca956f6f3e2371429f67deec.tar.gz forums-4ae74cd4b450ae4cca956f6f3e2371429f67deec.tar.bz2 forums-4ae74cd4b450ae4cca956f6f3e2371429f67deec.tar.xz forums-4ae74cd4b450ae4cca956f6f3e2371429f67deec.zip |
[ticket/10271] AJAXified buttons on acp_main.
PHPBB3-10271
-rw-r--r-- | phpBB/adm/style/acp_main.html | 14 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 38 | ||||
-rw-r--r-- | phpBB/language/en/acp/common.php | 7 |
3 files changed, 50 insertions, 9 deletions
diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index 63ca3a1c79..d9f833d878 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -152,35 +152,35 @@ <fieldset> <legend>{L_STATISTIC_RESYNC_OPTIONS}</legend> - <form id="action_online_form" method="post" action="{U_ACTION}"> + <form id="action_online_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_online">{L_RESET_ONLINE}</label><br /><span> </span></dt> <dd><input type="hidden" name="action" value="online" /><input class="button2" type="submit" id="action_online" name="action_online" value="{L_RUN}" /></dd> </dl> </form> - <form id="action_date_form" method="post" action="{U_ACTION}"> + <form id="action_date_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_date">{L_RESET_DATE}</label><br /><span> </span></dt> <dd><input type="hidden" name="action" value="date" /><input class="button2" type="submit" id="action_date" name="action_date" value="{L_RUN}" /></dd> </dl> </form> - <form id="action_stats_form" method="post" action="{U_ACTION}"> + <form id="action_stats_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_stats">{L_RESYNC_STATS}</label><br /><span>{L_RESYNC_STATS_EXPLAIN}</span></dt> <dd><input type="hidden" name="action" value="stats" /><input class="button2" type="submit" id="action_stats" name="action_stats" value="{L_RUN}" /></dd> </dl> </form> - <form id="action_user_form" method="post" action="{U_ACTION}"> + <form id="action_user_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_user">{L_RESYNC_POSTCOUNTS}</label><br /><span>{L_RESYNC_POSTCOUNTS_EXPLAIN}</span></dt> <dd><input type="hidden" name="action" value="user" /><input class="button2" type="submit" id="action_user" name="action_user" value="{L_RUN}" /></dd> </dl> </form> - <form id="action_db_track_form" method="post" action="{U_ACTION}"> + <form id="action_db_track_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_db_track">{L_RESYNC_POST_MARKING}</label><br /><span>{L_RESYNC_POST_MARKING_EXPLAIN}</span></dt> <dd><input type="hidden" name="action" value="db_track" /><input class="button2" type="submit" id="action_db_track" name="action_db_track" value="{L_RUN}" /></dd> @@ -188,7 +188,7 @@ </form> <!-- IF S_FOUNDER --> - <form id="action_purge_sessions_form" method="post" action="{U_ACTION}"> + <form id="action_purge_sessions_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_purge_sessions">{L_PURGE_SESSIONS}</label><br /><span>{L_PURGE_SESSIONS_EXPLAIN}</span></dt> <dd><input type="hidden" name="action" value="purge_sessions" /><input class="button2" type="submit" id="action_purge_sessions" name="action_purge_sessions" value="{L_RUN}" /></dd> @@ -196,7 +196,7 @@ </form> <!-- ENDIF --> - <form id="action_purge_cache_form" method="post" action="{U_ACTION}"> + <form id="action_purge_cache_form" method="post" action="{U_ACTION}" data-ajax="true"> <dl> <dt><label for="action_purge_cache">{L_PURGE_CACHE}</label><br /><span>{L_PURGE_CACHE_EXPLAIN}</span></dt> <dd><input type="hidden" name="action" value="purge_cache" /><input class="button2" type="submit" id="action_purge_cache" name="action_purge_cache" value="{L_RUN}" /></dd> diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 4c9ee85982..144b225766 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -24,7 +24,7 @@ class acp_main function main($id, $mode) { - global $config, $db, $user, $auth, $template; + global $config, $db, $user, $auth, $template, $request; global $phpbb_root_path, $phpbb_admin_path, $phpEx; // Show restore permissions notice @@ -129,6 +129,11 @@ class acp_main set_config('record_online_users', 1, true); set_config('record_online_date', time(), true); add_log('admin', 'LOG_RESET_ONLINE'); + + if ($request->is_ajax()) + { + trigger_error('RESET_ONLINE_SUCCESS'); + } break; case 'stats': @@ -179,6 +184,11 @@ class acp_main update_last_username(); add_log('admin', 'LOG_RESYNC_STATS'); + + if ($request->is_ajax()) + { + trigger_error('RESYNC_STATS_SUCCESS'); + } break; case 'user': @@ -241,7 +251,11 @@ class acp_main } add_log('admin', 'LOG_RESYNC_POSTCOUNTS'); - + + if ($request->is_ajax()) + { + trigger_error('RESYNC_POSTCOUNTS_SUCCESS'); + } break; case 'date': @@ -252,6 +266,11 @@ class acp_main set_config('board_startdate', time() - 1); add_log('admin', 'LOG_RESET_DATE'); + + if ($request->is_ajax()) + { + trigger_error('RESET_DATE_SUCCESS'); + } break; case 'db_track': @@ -327,6 +346,11 @@ class acp_main } add_log('admin', 'LOG_RESYNC_POST_MARKING'); + + if ($request->is_ajax()) + { + trigger_error('RESYNC_POST_MARKING_SUCCESS'); + } break; case 'purge_cache': @@ -338,6 +362,11 @@ class acp_main cache_moderators(); add_log('admin', 'LOG_PURGE_CACHE'); + + if ($request->is_ajax()) + { + trigger_error('PURGE_CACHE_SUCCESS'); + } break; case 'purge_sessions': @@ -384,6 +413,11 @@ class acp_main $db->sql_query($sql); add_log('admin', 'LOG_PURGE_SESSIONS'); + + if ($request->is_ajax()) + { + trigger_error('PURGE_SESSIONS_SUCCESS'); + } break; } } diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 242329a041..f96947b580 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -368,25 +368,32 @@ $lang = array_merge($lang, array( 'PURGE_CACHE' => 'Purge the cache', 'PURGE_CACHE_CONFIRM' => 'Are you sure you wish to purge the cache?', 'PURGE_CACHE_EXPLAIN' => 'Purge all cache related items, this includes any cached template files or queries.', + 'PURGE_CACHE_SUCCESS' => 'Cache successfully purged.', 'PURGE_SESSIONS' => 'Purge all sessions', 'PURGE_SESSIONS_CONFIRM' => 'Are you sure you wish to purge all sessions? This will log out all users.', 'PURGE_SESSIONS_EXPLAIN' => 'Purge all sessions. This will log out all users by truncating the session table.', + 'PURGE_SESSIONS_SUCCESS' => 'Sessions successfully purged.', 'RESET_DATE' => 'Reset board’s start date', 'RESET_DATE_CONFIRM' => 'Are you sure you wish to reset the board’s start date?', + 'RESET_DATE_SUCCESS' => 'Board’s start date reset', 'RESET_ONLINE' => 'Reset most users ever online', 'RESET_ONLINE_CONFIRM' => 'Are you sure you wish to reset the most users ever online counter?', + 'RESET_ONLINE_SUCCESS' => 'Most users ever online reset', 'RESYNC_FILES_STATS_CONFIRM' => 'Are you sure you wish to resynchronise files statistics?', 'RESYNC_POSTCOUNTS' => 'Resynchronise post counts', 'RESYNC_POSTCOUNTS_EXPLAIN' => 'Only existing posts will be taken into consideration. Pruned posts will not be counted.', 'RESYNC_POSTCOUNTS_CONFIRM' => 'Are you sure you wish to resynchronise post counts?', + 'RESYNC_POSTCOUNTS_SUCCESS' => 'Resynchronised post counts', 'RESYNC_POST_MARKING' => 'Resynchronise dotted topics', 'RESYNC_POST_MARKING_CONFIRM' => 'Are you sure you wish to resynchronise dotted topics?', 'RESYNC_POST_MARKING_EXPLAIN' => 'First unmarks all topics and then correctly marks topics that have seen any activity during the past six months.', + 'RESYNC_POST_MARKING_SUCCESS' => 'Resynchronised dotted topics', 'RESYNC_STATS' => 'Resynchronise statistics', 'RESYNC_STATS_CONFIRM' => 'Are you sure you wish to resynchronise statistics?', 'RESYNC_STATS_EXPLAIN' => 'Recalculates the total number of posts, topics, users and files.', + 'RESYNC_STATS_SUCCESS' => 'Resynchronised statistics', 'RUN' => 'Run now', 'STATISTIC' => 'Statistic', |