Collections functions
General functions
Render functions
Theme permission functions
Resource functions

radio_get_layout()

Description

Get required rows and columns for use when displaying radio buttons in a table

Parameters

ColumnTypeDefaultDescription
$options array Array of text options

Return

array (Number of rows, number of columns)

Location

include/render_functions.php lines 5517 to 5544

Definition

 
function radio_get_layout($options)
    {
    
$l average_length($options);
    
    
$cols 10;
    if(
$l 5
        {
        
$cols 6;
        }

    if(
$l 10)
        {
        
$cols 4;
        }

    if(
$l 15)
        {
        
$cols 3;
        }

    if(
$l 25)
        {
        
$cols 2;
        }

    
$rows ceil(count($options) / $cols);
    return array(
$rows$cols);
    }

This article was last updated 26th September 2022 13:05 Europe/London time based on the source file dated 22nd September 2022 16:20 Europe/London time.