Function __global->_render_menu_branch

Definitions

sources/menus.php

  • Render a menu branch to Tempcode.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$branch array No No required parameter N/A N/A The branch
$codename SHORT_TEXT No No required parameter N/A N/A An identifier for the menu (will be used as a unique ID by menu JavaScript code)
$source_member MEMBER No No required parameter N/A N/A The member the menu is being built as
$level integer No No required parameter N/A N/A The depth into the menu that this branch resides at
$type ID_TEXT No No required parameter N/A N/A The menu type (determines what templates get used)
$as_admin boolean No No required parameter N/A N/A Whether to generate Comcode with admin privilege
$all_branches array No No required parameter N/A N/A Array of all other branches
$apply_highlighting boolean No No required parameter N/A N/A Whether to apply current-screen highlighting
$the_level integer No No 1 N/A N/A The level

Returns

  • A pair: array of parameters of the menu branch (or null if non-renderable, or Tempcode of something to attach), and whether it is expanded
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Render a menu branch to Tempcode.
 *
 * @param  array $branch The branch
 * @param  SHORT_TEXT $codename An identifier for the menu (will be used as a unique ID by menu JavaScript code)
 * @param  MEMBER $source_member The member the menu is being built as
 * @param  integer $level The depth into the menu that this branch resides at
 * @param  ID_TEXT $type The menu type (determines what templates get used)
 * @param  boolean $as_admin Whether to generate Comcode with admin privilege
 * @param  array $all_branches Array of all other branches
 * @param  boolean $apply_highlighting Whether to apply current-screen highlighting
 * @param  integer $the_level The level
 * @return array A pair: array of parameters of the menu branch (or null if non-renderable, or Tempcode of something to attach), and whether it is expanded
 */

function _render_menu_branch(array $branch, string $codename, int $source_member, int $level, string $type, bool $as_admin, array $all_branches, bool $apply_highlighting, int $the_level = 1) : array