include/SugarDependentDropdown/SugarDependentDropdown.php
\SugarDependentDropdown
Package:
Properties
$alwaysMerge= 'array(
'force_render',
)'
Fields that will be merged down into individual elements and handlers
Default value
array(
'force_render',
)
Details- Type
- n/a
$defaults= 'array(
'name' => '',
'id' => '',
'type' => 'none', // form element, valid "select", "input", "checkbox", "none"
'label_pos' => 'left', // valid: 'left', 'right', 'top', 'bottom', 'none' (none)
'hidden' => array(), // metadata to create hidden fields with values you choose
)'
Default value
array(
'name' => '',
'id' => '',
'type' => 'none', // form element, valid "select", "input", "checkbox", "none"
'label_pos' => 'left', // valid: 'left', 'right', 'top', 'bottom', 'none' (none)
'hidden' => array(), // metadata to create hidden fields with values you choose
)
Details- Type
- n/a
$elementRequired= 'array(
'name',
'id',
//'values',
//'onchange',
//'force_render',
)'
Default value
array(
'name',
'id',
//'values',
//'onchange',
//'force_render',
)
Details- Type
- n/a
$validTypes= 'array(
"select", // select dropdown
"input", // text input field
"checkbox", // checkbox (radio buttons will not be supported)
"none", // blank
"multiple" // custom functionality
)'
Default value
array(
"select", // select dropdown
"input", // text input field
"checkbox", // checkbox (radio buttons will not be supported)
"none", // blank
"multiple" // custom functionality
)
Details- Type
- n/a
Methods
SugarDependentDropdown(
string $metadata
=
''
)
:
void
Sole constructor
Parameters
Name | Type | Description |
---|---|---|
$metadata | string | Path to metadata file to consume |
debugOutput(
$v
)
:
void
Prints debug messages to the screen
Parameters
Name | Type | Description |
---|---|---|
$v | mixed |
init(
string $metadata
)
:
void
Prepares an instance of SDD for use with a given set
Parameters
Name | Type | Description |
---|---|---|
$metadata | string | Path to metadata file to consume |
initElement(
array $element, $alwaysMerge
)
:
array
Initializes an element for processing
Parameters
Returns
Name | Type | Description |
---|---|---|
$element | array | Element metadata |
$alwaysMerge |
Type | Description |
---|---|
array |
isValidElement(
$element
)
:
void
Verifies that an element is valid and has all the required info.
Parameters
Name | Type | Description |
---|---|---|
$element |