Function __global->get_gallery_tree

Definitions

sources/galleries.php

  • Get a list of maps containing all the subcategories, and path information, of 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
$gallery ?ID_TEXT No No root N/A N/A The gallery we are getting the tree starting from (null: root)
$breadcrumbs string No No Blank (empty string) N/A N/A The parent breadcrumbs at this point of the recursion
$gallery_info ?array No No Null N/A N/A The database row for the $gallery gallery (null: get it from the DB)
$do_stats boolean No No False N/A N/A Whether to include video/image statistics in the returned tree
$filter ?string No No Null N/A N/A A function name to filter galleries with OR a Selectcode string (null: no filter)
$must_accept_images boolean No No False N/A N/A Whether displayed galleries must support images
$must_accept_videos boolean No No False N/A N/A Whether displayed galleries must support videos
$purity boolean No No False N/A N/A Whether to NOT show member galleries that do not exist yet
$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
$levels ?integer No No Null N/A N/A The number of recursive levels to search (null: all)
$member_id ?MEMBER No No Null N/A N/A Member we are filtering for (null: not needed)
$addable_filter boolean No No False N/A N/A Whether to only show for what may be added to by the current member
$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 subcategories, contains more details if stats were requested
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get a list of maps containing all the subcategories, and path information, of the specified gallery - and those beneath it, recursively.
 *
 * @param  ?ID_TEXT $gallery The gallery we are getting the tree starting from (null: root)
 * @param  string $breadcrumbs The parent breadcrumbs at this point of the recursion
 * @param  ?array $gallery_info The database row for the $gallery gallery (null: get it from the DB)
 * @param  boolean $do_stats Whether to include video/image statistics in the returned tree
 * @param  ?string $filter A function name to filter galleries with OR a Selectcode string (null: no filter)
 * @param  boolean $must_accept_images Whether displayed galleries must support images
 * @param  boolean $must_accept_videos Whether displayed galleries must support videos
 * @param  boolean $purity Whether to NOT show member galleries that do not exist yet
 * @param  boolean $use_compound_list Whether to get a list of child galleries (not just direct ones, recursively), instead of just IDs
 * @param  ?integer $levels The number of recursive levels to search (null: all)
 * @param  ?MEMBER $member_id Member we are filtering for (null: not needed)
 * @param  boolean $addable_filter Whether to only show for what may be added to by the current member
 * @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 subcategories, contains more details if stats were requested
 */

function get_gallery_tree(?string $gallery = 'root', string $breadcrumbs = '', ?array $gallery_info = null, bool $do_stats = false, ?string $filter = null, bool $must_accept_images = false, bool $must_accept_videos = false, bool $purity = false, bool $use_compound_list = false, ?int $levels = null, ?int $member_id = null, bool $addable_filter = false, bool $editable_filter = false) : array