1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-18 06:21:19 +02:00

[ticket/10411] Add return value to move functions

PHPBB3-10411
This commit is contained in:
Joas Schilling
2013-02-25 20:58:12 +01:00
parent b0dc5925b9
commit 1d7b082a6f
5 changed files with 413 additions and 253 deletions

View File

@@ -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;
}
/**