function _sliderfield_element_info_sliderfield in SliderField 7.2
Implements hook_element_info().
1 call to _sliderfield_element_info_sliderfield()
- sliderfield_element_info in ./
sliderfield.module - Implements hook_element_info().
File
- ./
sliderfield_element_sliderfield.inc, line 17
Code
function _sliderfield_element_info_sliderfield() {
$types['slider'] = array(
'#input' => TRUE,
'#process' => array(
'_sliderfield_sliderfield_process',
),
//'#value_callback' => 'sliderfield_sliderfield_value_callback',
'#element_validate' => array(
'sliderfield_sliderfield_validate',
),
'#theme' => array(
'sliderfield_sliderfield',
),
'#theme_wrappers' => array(
'form_element',
),
'#title' => NULL,
'#title2' => NULL,
'#input_title' => t('Min'),
'#input2_title' => t('Max'),
/**
* Make the min value adjustable dynamically via another element
* Type of the value is CSS selector
* like .myfield, #element_id
*/
'#adjust_field_min' => NULL,
/**
* Make the max value adjustable dynamically via another element
* Type of the value is CSS selector
* like .myfield, #element_id
*/
'#adjust_field_max' => NULL,
/**
* Boolean: When set to true, the handle will animate with the default duration.
* String: The name of a speed, such as "fast" or "slow".
* Number: The duration of the animation, in milliseconds.
*/
'#animate' => 'fast',
/**
* Disables the slider if set to true.
*/
'#disabled' => FALSE,
/**
* The maximum value of the slider.
*/
'#max' => 100,
/**
* The minimum value of the slider.
*/
'#min' => 0,
/**
* Determines whether the slider handles move horizontally (min on left, max on right)
* or vertically (min on bottom, max on top). Possible values: "horizontal", "vertical".
*/
'#orientation' => 'horizontal',
/**
* Whether the slider represents a range.
* Multiple types supported:
* Boolean: If set to true, the slider will detect if you have two handles and create a stylable range element between these two.
* String: Either "min" or "max". A min range goes from the slider min to one handle. A max range goes from one handle to the slider max.
*/
'#range' => FALSE,
/**
* Determines the size or amount of each interval or step the slider takes between the min and max.
* The full specified value range of the slider (max - min) should be evenly divisible by the step.
*/
'#step' => 1,
/**
* Determines the value of the slider, if there's only one handle.
* If there is more than one handle, determines the value of the first handle.
* Or an array of values can be passed array('value'=>1 , 'value2'=> 2) ,
* the order of values is important
*/
//'#value' => 0,
'#default_value' => NULL,
/**
* Some default color styles for ease of use
* red, green, blue
*/
'#slider_style' => NULL,
/**
* Default size for input values
*/
'#size' => 3,
/**
* If set to FALSE will display inputs only when javascript is disabled
*/
'#display_inputs' => TRUE,
/**
* If enabled display the current values of slider
* as simple text
*/
'#display_values' => FALSE,
/**
* Format of the displayed values
* The usage is mostly for showing $,% or other signs near the value
*/
'#display_values_format' => '%{value}%',
/**
* Display a hint/bubble near each slider handle showing the value of that handle
*/
'#display_bubble' => FALSE,
/**
* Format of the displayed values in bubble/hint, The usage is mostly for showing $,% or other signs near the value. Use %{value}% as slider value
* For range slider it can have two values separated by || like "$%{value}%MIN||$%{value}%MAX"
*/
'#display_bubble_format' => '%{value}%',
/**
* Acceptable types are the same as css with and height and it will be used as width
* or height depending on #orientation
*/
'#slider_length' => NULL,
/**
* Display the element inside a fieldset
*/
'#display_inside_fieldset' => FALSE,
/**
* Sliders with the same group will be linked
* The behavior of linked sliders depends on group_type parameter
* group name can only contain letters, numbers and underscore
*/
'#group' => NULL,
/**
* same : All sliders in the same group will have the same value.
* lock : All sliders in the same group will move with the exact same amount
* total : The total value of all sliders will be between min/max , increasing value of
* one slider decreases the rest of the sliders in the same group
*/
'#group_type' => 'same',
/**
* When set to TRUE, other sliders in the same
* group will change only if this slider changes
* values : TRUE , FALSE
*/
'#group_master' => FALSE,
/**
* Disable buildin range validation
* useful when element is used as widget
* for fields, since integer fields have range validation
* values : TRUE , FALSE
*/
'#validate_range' => TRUE,
/**
* In case there are other fields that should be sync dynamically when
* the slider changes
* value : .my_field_css_class
*/
'#fields_to_sync_css_selector' => NULL,
/**
* When field is not required, and display_inputs option is inactive
* a checkbox will be shown allowing user to ignore the field
* and enter no value
* values : TRUE , FALSE
*/
'#display_ignore_button' => FALSE,
/**
* When the slider does not have any value by enabling this option it won't show the
* slider handle unless user clicks on the slider to select a value
* values : TRUE , FALSE
*/
'#hide_slider_handle_when_no_value' => FALSE,
/**
* When hide_slider_handle_when_no_value is enabled, hide the no_value_text text
* When user clicks on the slider for the first time
* values : TRUE , FALSE
*/
'#no_value_text_auto_hide' => FALSE,
/**
* When hide_slider_handle_when_no_value is enabled, hide the no_value_text text
* When user clicks on the slider for the first time
* values : TRUE , FALSE, slow, fast
*/
'#no_value_first_select_slider_effect' => TRUE,
/**
* The text that will be displayed when hide_slider_handle_when_no_value
* is enabled
* values : STRING
*/
'#no_value_text' => 'Please click on any part of the slider to select a value.',
);
$types['jslider'] = $types['slider'];
return $types;
}