aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/style/acp_forums.html18
-rw-r--r--phpBB/adm/style/overall_footer.html4
-rw-r--r--phpBB/includes/acp/acp_forums.php6
-rw-r--r--phpBB/styles/script.js30
4 files changed, 49 insertions, 9 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index 447c0ce466..b2b3ad6d40 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -443,7 +443,7 @@
<col class="row1" /><col class="row1" /><col class="row2" />
<tbody>
<!-- BEGIN forums -->
- <tr>
+ <tr data-down="{forums.U_MOVE_DOWN}" data-up="{forums.U_MOVE_UP}">
<td style="width: 5%; text-align: center;">{forums.FOLDER_IMAGE}</td>
<td>
<!-- IF forums.FORUM_IMAGE --><div style="float: {S_CONTENT_FLOW_BEGIN}; margin-right: 5px;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
@@ -453,17 +453,17 @@
</td>
<td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
<!-- IF forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
- {ICON_MOVE_UP_DISABLED}
- <a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
+ <span class="up">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="forum_down">{ICON_MOVE_DOWN}</a></span>
<!-- ELSEIF not forums.S_FIRST_ROW && not forums.S_LAST_ROW -->
- <a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- <a href="{forums.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
+ <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="forum_up">{ICON_MOVE_UP}</a></span>
+ <span class="down"><a href="{forums.U_MOVE_DOWN}" data-ajax="forum_down">{ICON_MOVE_DOWN}</a></span>
<!-- ELSEIF forums.S_LAST_ROW && not forums.S_FIRST_ROW -->
- <a href="{forums.U_MOVE_UP}">{ICON_MOVE_UP}</a>
- {ICON_MOVE_DOWN_DISABLED}
+ <span class="up"><a href="{forums.U_MOVE_UP}" data-ajax="forum_up">{ICON_MOVE_UP}</a></span>
+ <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
<!-- ELSE -->
- {ICON_MOVE_UP_DISABLED}
- {ICON_MOVE_DOWN_DISABLED}
+ <span class="up">{ICON_MOVE_UP_DISABLED}</span>
+ <span class="down">{ICON_MOVE_DOWN_DISABLED}</span>
<!-- ENDIF -->
<a href="{forums.U_EDIT}">{ICON_EDIT}</a>
<!-- IF not forums.S_FORUM_LINK -->
diff --git a/phpBB/adm/style/overall_footer.html b/phpBB/adm/style/overall_footer.html
index f05e9c56c5..3740122d9b 100644
--- a/phpBB/adm/style/overall_footer.html
+++ b/phpBB/adm/style/overall_footer.html
@@ -17,6 +17,10 @@
<!-- IF S_COPYRIGHT_HTML --><br /><!-- ENDIF -->
{DEBUG_OUTPUT}
<!-- ENDIF -->
+
+ <!-- tmp -->
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
+ <script src="../styles/script.js"></script>
</div>
</div>
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index fad22fc285..d3e2dbd904 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -255,6 +255,12 @@ class acp_forums
add_log('admin', 'LOG_FORUM_' . strtoupper($action), $row['forum_name'], $move_forum_name);
$cache->destroy('sql', FORUMS_TABLE);
}
+
+ if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
+ {
+ echo json_encode(array('success' => ($move_forum_name !== false)));
+ exit;
+ }
break;
diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js
index 72e3c59e75..35c99464bd 100644
--- a/phpBB/styles/script.js
+++ b/phpBB/styles/script.js
@@ -316,6 +316,36 @@ phpbb.add_ajax_callback('post_delete', function(el) {
$(el).parents('form').fadeOut(function() {
$(this).remove();
});
+}).add_ajax_callback('forum_down', function(el) {
+ var tr = $(el).parents('tr');
+ if (tr.is(':first-child'))
+ {
+ $(el).parents('span').siblings('.up').html('<a href="' + tr.data('up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
+ tr.next().find('.up').html('<img src="./images/icon_up_disabled.gif" alt="Move up" title="Move up" />');
+ phpbb.ajaxify({selector: $(el).parents('span').siblings('.up').children('a')}, false, 'forum_up');
+ }
+ tr.insertAfter(tr.next());
+ if (tr.is(':last-child'))
+ {
+ $(el).html('<img src="./images/icon_down_disabled.gif" alt="Move down" title="Move down" />');
+ tr.prev().find('.down').html('<a href="' + tr.data('down') + '"><img src="./images/icon_down.gif" alt="Move down" title="Move down" /></a>');
+ phpbb.ajaxify({selector: tr.prev().find('.down').children('a')}, false, 'forum_down');
+ }
+}).add_ajax_callback('forum_up', function(el) {
+ var tr = $(el).parents('tr');
+ if (tr.is(':last-child'))
+ {
+ $(el).parents('span').siblings('.down').html('<a href="' + tr.data('down') + '"><img src="./images/icon_down.gif" alt="Move down" title="Move down" /></a>');
+ tr.prev().find('.down').html('<img src="./images/icon_down_disabled.gif" alt="Move down" title="Move down" />');
+ phpbb.ajaxify({selector: $(el).parents('span').siblings('.down').children('a')}, false, 'forum_down');
+ }
+ tr.insertBefore(tr.prev());
+ if (tr.is(':first-child'))
+ {
+ $(el).html('<img src="./images/icon_up_disabled.gif" alt="Move up" title="Move up" />');
+ tr.next().find('.up').html('<a href="' + tr.data('up') + '"><img src="./images/icon_up.gif" alt="Move up" title="Move up" /></a>');
+ phpbb.ajaxify({selector: tr.next().find('.up').children('a')}, false, 'forum_up');
+ }
});