Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 5618 to 5645

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 19th March 2024 02:35 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.