collapseCategories

Description

Collapses or expands one or more categories for one or more members.

Syntax

void collapseCategories (array $categories, string $new_status[, mixed $members[, bool $check_collapsable]])



Parameter $categories

Expected type: Array of Integers
Description: The ID(s) of the category/categories to be collapsed or expanded



Parameter $new_status

Expected type: Enumerated String
Description: Action performed on the category

Possible string values
Allowed values Description
'collapse' Collapse the selected categories
'expand' Expand the selected categories
'toggle' Toggle the current state for each category - if it's collapsed, expand it, and if it's expanded, collapse it.



Parameter $members

Expected type: Mixed
Description: The ID(s) of the member(s) to apply this action for

Allowed types for $members
Allowed values Description
Null Collapse/Expand/Toggle the categories for all members
Array of Integers Collapse/Expand/Toggle the categories for the specified members (array of member IDs)



Parameter $check_collapsable

Expected type: Boolean
Description: Whether or not to enforce the "is_collapsable" setting for these categories. If true, only those categories which can be collapsed will be affected. Otherwise, all categories will be affected. Default: true


Notes

  • Can be called from outside SMF to collapse/expand categories
Advertisement: