$templates.shared.doctype {= include "templates.shared.util.get_licensing_features"; string licensing_features = get_licensing_features(); string left_navigation_structure = "templates.admin.left_navigation_structure"; if (licensing_features eq "lite") then ( left_navigation_structure .= "_lite"; ); subroutine(generate_buttons_javascript(string itemsnode), ( string item; foreach item itemsnode ( # If this is a "leaf", just add a leaf button if ($(item . ".type") eq "view") then ( "buttons['" . node_name(item) . "'] = new Button('lea');\n"; ) # If it's a branch, add information for this branch else ( # Generate the group button line "buttons['" . node_name(item) . "'] = new Button('bra', 'col', ["; bool first = true; string subitem; foreach subitem (item . ".items") ( if (!first) then ", "; "'" . node_name(subitem) . "'"; first = false; ); "]);\n"; # Recursively generate the sub-buttons generate_buttons_javascript(item . ".items"); ); # if branch ); # foreach item )); # generate_buttons_javascript =}