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

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 9327 to 9342

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 4th December 2024 08:35 Europe/London time based on the source file dated 28th November 2024 12:10 Europe/London time.