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_elements()

Description

This function returns an array containing list of values for a selected field, identified by $field_label, in the multidimensional array $nodes

Parameters

ColumnTypeDefaultDescription
$node_values array - list of values for a selected field in the node tree
$nodes array - node tree to parse
$field_label string - node field to retrieve value of and add to array $node_values

Return

array $node_values

Location

include/node_functions.php lines 2023 to 2035

Definition

 
function get_node_elements(array $node_values, array $nodes$field_label)
{    
    if (isset(
$nodes[0])) {
        foreach (
$nodes as $node) {
            if (isset(
$node["name"])) {
                
array_push($node_values$node[$field_label]);
            }   
            
$node_values = (isset($node["children"])) ? get_node_elements($node_values$node["children"], $field_label)  :  get_node_elements($node_values$node$field_label); 
        }
    }
    
    return 
$node_values;
}

This article was last updated 8th December 2024 20:35 Europe/London time based on the source file dated 6th December 2024 12:00 Europe/London time.