2012-11-13 11:22:30 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
*
|
2014-05-27 20:18:06 +02:00
|
|
|
* This file is part of the phpBB Forum Software package.
|
|
|
|
*
|
|
|
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
|
|
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
|
|
|
*
|
|
|
|
* For full copyright and license information, please see
|
|
|
|
* the docs/CREDITS.txt file.
|
2012-11-13 11:22:30 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-09-10 14:01:09 +02:00
|
|
|
namespace phpbb\groupposition;
|
|
|
|
|
2012-11-13 11:22:30 +01:00
|
|
|
/**
|
|
|
|
* Interface to manage group positions in various places of phpbb
|
|
|
|
*
|
|
|
|
* The interface provides simple methods to add, delete and move a group
|
|
|
|
*/
|
2013-09-10 14:01:09 +02:00
|
|
|
interface groupposition_interface
|
2012-11-13 11:22:30 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Returns the value for a given group, if the group exists.
|
|
|
|
* @param int $group_id group_id of the group to be selected
|
|
|
|
* @return int position of the group
|
|
|
|
*/
|
|
|
|
public function get_group_value($group_id);
|
|
|
|
|
|
|
|
/**
|
2013-07-14 12:25:28 -04:00
|
|
|
* Get number of groups displayed
|
2012-11-13 11:22:30 +01:00
|
|
|
*
|
|
|
|
* @return int value of the last item displayed
|
|
|
|
*/
|
|
|
|
public function get_group_count();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Addes a group by group_id
|
|
|
|
*
|
|
|
|
* @param int $group_id group_id of the group to be added
|
2013-02-25 21:24:52 +01:00
|
|
|
* @return bool True if the group was added successfully
|
2012-11-13 11:22:30 +01:00
|
|
|
*/
|
|
|
|
public function add_group($group_id);
|
|
|
|
|
|
|
|
/**
|
2012-11-13 15:29:54 +01:00
|
|
|
* Deletes a group by group_id
|
2012-11-13 11:22:30 +01:00
|
|
|
*
|
|
|
|
* @param int $group_id group_id of the group to be deleted
|
2012-11-13 15:29:54 +01:00
|
|
|
* @param bool $skip_group Skip setting the value for this group, to save the query, when you need to update it anyway.
|
2013-02-25 21:24:52 +01:00
|
|
|
* @return bool True if the group was deleted successfully
|
2012-11-13 11:22:30 +01:00
|
|
|
*/
|
|
|
|
public function delete_group($group_id, $skip_group = false);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves a group up by group_id
|
|
|
|
*
|
|
|
|
* @param int $group_id group_id of the group to be moved
|
2013-02-25 20:58:12 +01:00
|
|
|
* @return bool True if the group was moved successfully
|
2012-11-13 11:22:30 +01:00
|
|
|
*/
|
|
|
|
public function move_up($group_id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves a group down by group_id
|
|
|
|
*
|
|
|
|
* @param int $group_id group_id of the group to be moved
|
2013-02-25 20:58:12 +01:00
|
|
|
* @return bool True if the group was moved successfully
|
2012-11-13 11:22:30 +01:00
|
|
|
*/
|
|
|
|
public function move_down($group_id);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moves a group up/down
|
|
|
|
*
|
|
|
|
* @param int $group_id group_id of the group to be moved
|
|
|
|
* @param int $delta number of steps:
|
|
|
|
* - positive = move up
|
|
|
|
* - negative = move down
|
2013-02-25 20:58:12 +01:00
|
|
|
* @return bool True if the group was moved successfully
|
2012-11-13 11:22:30 +01:00
|
|
|
*/
|
|
|
|
public function move($group_id, $delta);
|
|
|
|
}
|