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

Description

Returns an array of available PDF template names

Parameters

ColumnTypeDefaultDescription
$template_namespace string The name by which multiple templates are grouped together e.g. contact_sheet

Return

array()

Location

include/pdf_functions.php lines 406 to 433

Definition

 
function get_pdf_templates($template_namespace)
    {
    global 
$storagedir;

    
$templates = array();
    
$remove_directory_listings = array('.''..');

    
// Directories that may contain these files
    
$default_tpl_dir   __DIR__ "/../templates/{$template_namespace}";
    
$filestore_tpl_dir "{$storagedir}/system/templates/{$template_namespace}";

    if(!
file_exists($default_tpl_dir))
        {
        
trigger_error("ResourceSpace could not find templates folder '{$template_namespace}'");
        }

    
// Get default path
    
$templates array_diff(scandir($default_tpl_dir), $remove_directory_listings);

    
// Get custom template (if any)
    
if(file_exists($filestore_tpl_dir))
        {
        
$filestore_templates array_diff(scandir($filestore_tpl_dir), $remove_directory_listings);
        
$templates array_merge($templates,$filestore_templates);
        }
    
$templates array_map(function($e){return pathinfo($ePATHINFO_FILENAME);}, $templates);
    return 
$templates;
    }

This article was last updated 13th December 2024 20:35 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.