Function __global->get_gallery_content_tree
Definitions
sources/galleries.php
- Get a list of maps containing all the gallery entries, and path information, under the specified gallery - and those beneath it, recursively.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $table | ID_TEXT | No | No | required parameter | images videos | N/A | The table we are working with |
| $submitter | ?AUTO_LINK | No | No | Null | N/A | N/A | Only show images/videos submitted by this member (null: no filter) |
| $gallery | ?ID_TEXT | No | No | Null | N/A | N/A | The gallery being at the root of our recursion (null: true root) |
| $breadcrumbs | ?string | No | No | Null | N/A | N/A | The breadcrumbs up to this point in the recursion (null: blank, as we are starting the recursion) |
| $title | ?ID_TEXT | No | No | Null | N/A | N/A | The name of the $gallery we are currently going through (null: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the child's title |
| $levels | ?integer | No | No | Null | N/A | N/A | The number of recursive levels to search (null: all) |
| $use_compound_list | boolean | No | No | False | N/A | N/A | Whether to get a list of child galleries (not just direct ones, recursively), instead of just IDs |
| $editable_filter | boolean | No | No | False | N/A | N/A | Whether to only show for what may be edited by the current member |
Returns
- A list of maps for all galleries. Each map entry containing the fields 'id' (gallery ID) and 'breadcrumbs' (path to the category, including the categories own title), and more. Or if $use_compound_list, the tree structure built with pairs containing the compound list in addition to the child branches
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Get a list of maps containing all the gallery entries, and path information, under the specified gallery - and those beneath it, recursively.
*
* @param ID_TEXT $table The table we are working with
* @set images videos
* @param ?AUTO_LINK $submitter Only show images/videos submitted by this member (null: no filter)
* @param ?ID_TEXT $gallery The gallery being at the root of our recursion (null: true root)
* @param ?string $breadcrumbs The breadcrumbs up to this point in the recursion (null: blank, as we are starting the recursion)
* @param ?ID_TEXT $title The name of the $gallery we are currently going through (null: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the child's title
* @param ?integer $levels The number of recursive levels to search (null: all)
* @param boolean $use_compound_list Whether to get a list of child galleries (not just direct ones, recursively), instead of just IDs
* @param boolean $editable_filter Whether to only show for what may be edited by the current member
* @return array A list of maps for all galleries. Each map entry containing the fields 'id' (gallery ID) and 'breadcrumbs' (path to the category, including the categories own title), and more. Or if $use_compound_list, the tree structure built with pairs containing the compound list in addition to the child branches
*/
function get_gallery_content_tree(string $table, ?int $submitter = null, ?string $gallery = null, ?string $breadcrumbs = null, ?string $title = null, ?int $levels = null, bool $use_compound_list = false, bool $editable_filter = false) : array
* Get a list of maps containing all the gallery entries, and path information, under the specified gallery - and those beneath it, recursively.
*
* @param ID_TEXT $table The table we are working with
* @set images videos
* @param ?AUTO_LINK $submitter Only show images/videos submitted by this member (null: no filter)
* @param ?ID_TEXT $gallery The gallery being at the root of our recursion (null: true root)
* @param ?string $breadcrumbs The breadcrumbs up to this point in the recursion (null: blank, as we are starting the recursion)
* @param ?ID_TEXT $title The name of the $gallery we are currently going through (null: look it up). This is here for efficiency reasons, as finding children IDs to recurse to also reveals the child's title
* @param ?integer $levels The number of recursive levels to search (null: all)
* @param boolean $use_compound_list Whether to get a list of child galleries (not just direct ones, recursively), instead of just IDs
* @param boolean $editable_filter Whether to only show for what may be edited by the current member
* @return array A list of maps for all galleries. Each map entry containing the fields 'id' (gallery ID) and 'breadcrumbs' (path to the category, including the categories own title), and more. Or if $use_compound_list, the tree structure built with pairs containing the compound list in addition to the child branches
*/
function get_gallery_content_tree(string $table, ?int $submitter = null, ?string $gallery = null, ?string $breadcrumbs = null, ?string $title = null, ?int $levels = null, bool $use_compound_list = false, bool $editable_filter = false) : array

