aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/groupposition/legend.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2013-02-25 20:58:12 +0100
committerJoas Schilling <nickvergessen@gmx.de>2013-02-25 20:58:12 +0100
commit1d7b082a6fa05d5760ef15ef8bf78cd3a1d204cf (patch)
treef8885b5742649b1eb6204bbce200608b04283b7d /phpBB/includes/groupposition/legend.php
parentb0dc5925b91cb0447046e8a7f089c6675e4be95c (diff)
downloadforums-1d7b082a6fa05d5760ef15ef8bf78cd3a1d204cf.tar
forums-1d7b082a6fa05d5760ef15ef8bf78cd3a1d204cf.tar.gz
forums-1d7b082a6fa05d5760ef15ef8bf78cd3a1d204cf.tar.bz2
forums-1d7b082a6fa05d5760ef15ef8bf78cd3a1d204cf.tar.xz
forums-1d7b082a6fa05d5760ef15ef8bf78cd3a1d204cf.zip
[ticket/10411] Add return value to move functions
PHPBB3-10411
Diffstat (limited to 'phpBB/includes/groupposition/legend.php')
-rw-r--r--phpBB/includes/groupposition/legend.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/phpBB/includes/groupposition/legend.php b/phpBB/includes/groupposition/legend.php
index 51f2510e85..9b69f9d2b3 100644
--- a/phpBB/includes/groupposition/legend.php
+++ b/phpBB/includes/groupposition/legend.php
@@ -168,7 +168,7 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
*/
public function move_up($group_id)
{
- $this->move($group_id, 1);
+ return $this->move($group_id, 1);
}
/**
@@ -178,7 +178,7 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
*/
public function move_down($group_id)
{
- $this->move($group_id, -1);
+ return $this->move($group_id, -1);
}
/**
@@ -188,9 +188,10 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
*/
public function move($group_id, $delta)
{
- if (!is_int($delta) || !$delta)
+ $delta = (int) $delta;
+ if (!$delta)
{
- return;
+ return false;
}
$move_up = ($delta > 0) ? true : false;
@@ -221,10 +222,16 @@ class phpbb_groupposition_legend implements phpbb_groupposition_interface
SET group_legend = group_legend ' . (($move_up) ? ' - ' : ' + ') . $delta . '
WHERE group_id = ' . (int) $group_id;
$this->db->sql_query($sql);
+
+ $this->db->sql_transaction('commit');
+
+ return true;
}
$this->db->sql_transaction('commit');
}
+
+ return false;
}
/**