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

Description

Returns the path (relative to the gfx folder) of a suitable folder to represent
a resource with the given resource type or extension
Extension matches are tried first, followed by resource type matches
Finally, if there are no matches then the 'type1' image will be used.
set contactsheet to true to cd up one more level.

Parameters

ColumnTypeDefaultDescription
$resource_type integer
$extension string
$col_size boolean

Return

string

Location

include/resource_functions.php lines 8095 to 8129

Definition

 
function get_nopreview_icon($resource_type$extension$col_size)
    {
    global 
$language;

    
$col=($col_size?"_col":"");
    
$folder=dirname(dirname(__FILE__)) . "/gfx/";
    
$extension=strtolower((string) $extension);

    
# Metadata template? Always use icon for 'mdtr', although typically no file will be attached.
    
global $metadata_template_resource_type;
    if (isset(
$metadata_template_resource_type) && $metadata_template_resource_type==$resource_type) {$extension="mdtr";}

    
# Try a plugin
    
$try=hook('plugin_nopreview_icon','',array($resource_type,$col$extension));
    if (
false !== $try && file_exists($folder $try))
        {
        return 
$try;
        }

    
# Try extension (language specific)
    
$try="no_preview/" $extension $col "_" $language ".png";
    if (
file_exists($folder $try))
        {
        return 
$try;
        }
    
# Try extension (default)
    
$try="no_preview/" $extension $col ".png";
    if (
file_exists($folder $try))
        {
        return 
$try;
        }

    
# Fall back to a default
    
return "no_preview/default" $col ".png";
    }

This article was last updated 27th September 2024 12:05 Europe/London time based on the source file dated 24th September 2024 16:25 Europe/London time.