Developer's Manual  Blocks  Property types  list

list

Creates a list box or drop-down list.

The list type has the following additional parameters: values, size, show and hide.

values

Required. Defines items of the list.

size

Optional. Specifies the list type.

Value Description
1 Creates drop-down list.
>1 Creates list box. The number speifies the amount of rows in the list box.

If size is omitted 1 is assumed.

show

Optional. Defines names of properties to show when a specific list item selected.

hide

Optional. Defines names of properties to hide when a specific list item selected.

Example

<?
$properties
= Array(
  
'showHeader' => Array(
    
'type'     => 'list',
    
'value'    => 0,
    
'label'    => 'Show header',
    
'values'   => Array('No', 'Yes'),                  // creates drop-down list (size is omitted)
                                                       // return values are 0 (No) and 1 (Yes)
    
'show'     => Array(1 => Array('header', 'link'))  // show header and link properties  
                                                       // when showHeader values is 1 (Yes)
  
),
  
'color' => Array(
    
'type'     => 'list',
    
'value'    => 'Red',
    
'label'    => 'Color',
    
'size'     => 3,                                   // creates list box
    
'values'   => Array(
      
'White' => '#FFFFFF',                            // return values are hex color codes
      
'Red'   => '#FF0000',
      
'Black' => '#000000'
    
)
  ),
  
'header' => Array(
    
'type'     => 'string',
    
'value'    => 'Header',
    
'label'    => 'Header',
  ),
  
'link' => Array(
    
'type'     => 'link',
    
'value'    => 1,
    
'label'    => 'Link',
  ),
);
?>
Please login to add comments.