Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_node_strings()

Description

This function returns an array of strings that represent the full paths to each tree node passed

Parameters

ColumnTypeDefaultDescription
$resource_nodes array - node tree to parse
$allnodes bool false - include paths to all nodes -if false will just include the paths to the end leaf nodes
$translate bool - translate strings?

Return

array $nodestrings - array of strings for all nodes passed in correct hierarchical order

Location

include/node_functions.php lines 2262 to 2279

Definition

 
function get_node_strings($resource_nodes,$allnodes false,$translate true): array
    {
    
// Arrange all passed nodes with parents first so that unnecessary paths can be removed
    
$orderednodes order_tree_nodes($resource_nodes);
    
// Create an array of all branch nodes for each node
    
$nodestrings = array();
    foreach(
$orderednodes as $resource_node)
        {
        
$path $translate $resource_node["translated_path"] : $resource_node["path"];
        if(!
$allnodes && isset($nodestrings[$resource_node["parent"]]))
            {
            unset(
$nodestrings[$resource_node["parent"]]);
            }
        
        
$nodestrings[$resource_node["ref"]] = $path;
        }
    return 
$nodestrings;
    }

This article was last updated 17th November 2024 15:05 Europe/London time based on the source file dated 28th October 2024 11:15 Europe/London time.