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

Parameters

ColumnTypeDefaultDescription
$internal false
$restricted false

Location

include/resource_functions.php lines 8163 to 8182

Definition

 
function get_all_image_sizes($internal=false,$restricted=false)
    {
        
# Returns all image sizes available.
        # Standard image sizes are translated using $lang.  Custom image sizes are i18n translated.

        
$condition=($internal)?"":"WHERE internal!=1";
        if(
$restricted){$condition .= ($condition!=""?" AND ":" WHERE ") . " allow_restricted=1";}

        
# Executes query.
        
$r ps_query("SELECT " columns_in("preview_size") . " FROM preview_size " $condition " ORDER BY width ASC",[],"schema"); // $condition does not contain any user entered params and is safe for inclusion

        # Translates image sizes in the newly created array.
        
$return = array();
        for (
$n 0;$n<count($r);$n++) {
            
$r[$n]["name"] = lang_or_i18n_get_translated($r[$n]["name"], "imagesize-");
            
$return[] = $r[$n];
        }
        return 
$return;

    }

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.