Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

data_joins_field_value_translate_and_csv()

Description

Convert $data_joins (ie fieldX column) value to a user friendly version.

IMPORTANT: csv in this context simply means user defined separator values (relies on {@see $field_column_string_separator}).

Text value will be:-
- split by the configued separator {@see $field_column_string_separator};
- have all parts translated; (note: to correctly translate tree paths, a part will also be broken into path elements)
- glued back using the same separator

Parameters

ColumnTypeDefaultDescription
$value: ?string
$value string|null Text to be processed

Return

string|null

Location

include/resource_functions.php lines 9210 to 9225

Definition

 
function data_joins_field_value_translate_and_csv(?string $value): ?string
    
{
    if(
is_null($value))
        {
        return 
null;
        }

    
$value_parts = [];
    
$split_by_fcss explode($GLOBALS['field_column_string_separator'], $value);
    foreach(
$split_by_fcss as $el)
        {
        
$value_parts[] = implode('/'array_map('i18n_get_translated'explode('/'$el)));
        }

    return 
implode($GLOBALS['field_column_string_separator'], $value_parts);
    }

This article was last updated 27th April 2024 12:05 Europe/London time based on the source file dated 26th April 2024 11:50 Europe/London time.