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

dash_tile_featured_collection_get_resources()

Description

Build list of resources that can be shown on a dash tile as a background image. Helper function.

Parameters

ColumnTypeDefaultDescription
$c array|integer Collection ref -or- collection data as returned by {@see get_collection()}
$ctx array Contextual data

Return

array

Location

include/dash_functions.php lines 1921 to 1949

Definition

 
function dash_tile_featured_collection_get_resources($c, array $ctx)
    {
    
$collection = (is_int($c) ? get_collection($c) : $c);
    
$collection = (is_array($collection) && !empty($collection) ? $collection false);
    if(
$collection === false)
        {
        return array();
        }

    global 
$view_title_field;

    
$collection_resources get_collection_resources($collection["ref"]);
    
$collection["has_resources"] = (is_array($collection_resources) && !empty($collection_resources) ? 0);

    
$featured_collection_resources get_featured_collection_resources($collection$ctx);
    
$featured_collection_resources_data get_resource_data_batch($featured_collection_resources);

    
$resources = array();
    foreach(
$featured_collection_resources_data as $resource_data)
        {
        
$resources[] = array(
            
"ref" => $resource_data['ref'],
            
"field{$view_title_field}=> get_data_by_field($resource_data['ref'], $view_title_field),
            
"resource_type" => $resource_data['resource_type'],
            
"file_extension" => $resource_data['file_extension']);
        }

    return 
$resources;
    }

This article was last updated 17th November 2024 15:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.