diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-14 11:57:53 -0400 | 
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-14 11:57:53 -0400 | 
| commit | d7a85ebc245e76038b8ccd56524f045cc92a6c13 (patch) | |
| tree | 66aa645c4d86636f0bce04a7125a7757a466b224 /phpBB/phpbb/tree/interface.php | |
| parent | fa3cdb6bf2cfdca9c26168bd258752718bc8a43f (diff) | |
| parent | f6865dc33a8cedb7d21a64401ed80d2edbac36bd (diff) | |
| download | forums-d7a85ebc245e76038b8ccd56524f045cc92a6c13.tar forums-d7a85ebc245e76038b8ccd56524f045cc92a6c13.tar.gz forums-d7a85ebc245e76038b8ccd56524f045cc92a6c13.tar.bz2 forums-d7a85ebc245e76038b8ccd56524f045cc92a6c13.tar.xz forums-d7a85ebc245e76038b8ccd56524f045cc92a6c13.zip | |
Merge remote-tracking branch 'igorw/ticket/11574' into ticket/11574
* igorw/ticket/11574: (575 commits)
  [ticket/11702] Fix forum_posts left over for link-click counts in viewforum.php
  [ticket/11696] Move file to new directory
  [ticket/11696] Rename constructor to __construct()
  [ticket/11696] Remove manual loading of db_tools in extension controller test
  [ticket/11696] Rename db_tools.php so it can be autoloaded
  [ticket/11698] Moving all autoloadable files to phpbb/
  [ticket/11694] Do not locate assets with root path
  [ticket/11692] Don't update search_type in dev migration if already appended
  [ticket/11675] Fix template loop
  [ticket/11690] Old module class names may get autoloaded by class_exists
  [ticket/9649] Display information on index for moderators on unapproved posts
  [ticket/10999] Fix assets_version in ACP
  [prep-release-3.0.12] More changelog items for the 3.0.12 release.
  [ticket/11687] Add assets_version to phpbb_config
  [ticket/11686] Not checking for phpBB Debug errors on functional tests
  [ticket/11670] Consistency with logo: Replace "phpBB(tm)" with "phpBB(R)".
  [ticket/11674] Do not include vendor folder if there are no dependencies.
  [ticket/11685] Remove logout confirmation page
  [ticket/11684] Remove useless confirmation page after login and admin login
  [ticket/9657] Define user before injecting
  ...
Diffstat (limited to 'phpBB/phpbb/tree/interface.php')
| -rw-r--r-- | phpBB/phpbb/tree/interface.php | 122 | 
1 files changed, 122 insertions, 0 deletions
| diff --git a/phpBB/phpbb/tree/interface.php b/phpBB/phpbb/tree/interface.php new file mode 100644 index 0000000000..cc8aab2115 --- /dev/null +++ b/phpBB/phpbb/tree/interface.php @@ -0,0 +1,122 @@ +<?php +/** +* +* @package tree +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ +	exit; +} + +interface phpbb_tree_interface +{ +	/** +	* Inserts an item into the database table and into the tree. +	* +	* @param array	$item	The item to be added +	* @return array Array with item data as set in the database +	*/ +	public function insert(array $additional_data); + +	/** +	* Delete an item from the tree and from the database table +	* +	* Also deletes the subtree from the tree and from the database table +	* +	* @param int	$item_id	The item to be deleted +	* @return array		Item ids that have been deleted +	*/ +	public function delete($item_id); + +	/** +	* Move an item by a given delta +	* +	* An item is only moved up/down within the same parent. If the delta is +	* larger then the number of children, the item is moved to the top/bottom +	* of the list of children within this parent. +	* +	* @param int	$item_id	The item to be moved +	* @param int	$delta		Number of steps to move this item, < 0 => down, > 0 => up +	* @return bool True if the item was moved +	*/ +	public function move($item_id, $delta); + +	/** +	* Move an item down by 1 +	* +	* @param int	$item_id	The item to be moved +	* @return bool True if the item was moved +	*/ +	public function move_down($item_id); + +	/** +	* Move an item up by 1 +	* +	* @param int	$item_id	The item to be moved +	* @return bool True if the item was moved +	*/ +	public function move_up($item_id); + +	/** +	* Moves all children of one item to another item +	* +	* If the new parent already has children, the new children are appended +	* to the list. +	* +	* @param int	$current_parent_id	The current parent item +	* @param int	$new_parent_id		The new parent item +	* @return bool True if any items where moved +	*/ +	public function move_children($current_parent_id, $new_parent_id); + +	/** +	* Change parent item +	* +	* Moves the item to the bottom of the new parent's list of children +	* +	* @param int	$item_id			The item to be moved +	* @param int	$new_parent_id		The new parent item +	* @return bool True if the parent was set successfully +	*/ +	public function change_parent($item_id, $new_parent_id); + +	/** +	* Get all items that are either ancestors or descendants of the item +	* +	* @param int		$item_id		Id of the item to retrieve the ancestors/descendants from +	* @param bool		$order_asc		Order the items ascendingly (most outer ancestor first) +	* @param bool		$include_item	Should the item matching the given item id be included in the list as well +	* @return array			Array of items (containing all columns from the item table) +	*							ID => Item data +	*/ +	public function get_path_and_subtree_data($item_id, $order_asc, $include_item); + +	/** +	* Get all of the item's ancestors +	* +	* @param int		$item_id		Id of the item to retrieve the ancestors from +	* @param bool		$order_asc		Order the items ascendingly (most outer ancestor first) +	* @param bool		$include_item	Should the item matching the given item id be included in the list as well +	* @return array			Array of items (containing all columns from the item table) +	*							ID => Item data +	*/ +	public function get_path_data($item_id, $order_asc, $include_item); + +	/** +	* Get all of the item's descendants +	* +	* @param int		$item_id		Id of the item to retrieve the descendants from +	* @param bool		$order_asc		Order the items ascendingly +	* @param bool		$include_item	Should the item matching the given item id be included in the list as well +	* @return array			Array of items (containing all columns from the item table) +	*							ID => Item data +	*/ +	public function get_subtree_data($item_id, $order_asc, $include_item); +} | 
