function userreference_widget_info in Content Construction Kit (CCK) 6.3
Same name and namespace in other branches
- 5 userreference.module \userreference_widget_info()
- 6 modules/userreference/userreference.module \userreference_widget_info()
- 6.2 modules/userreference/userreference.module \userreference_widget_info()
Implementation of hook_widget_info().
We need custom handling of multiple values for the userreference_select widget because we need to combine them into a options list rather than display multiple elements.
We will use the content module's default handling for default value.
Callbacks can be omitted if default handing is used. They're included here just so this module can be used as an example for custom modules that might do things differently.
File
- modules/
userreference/ userreference.module, line 285 - Defines a field type for referencing a user from a node.
Code
function userreference_widget_info() {
return array(
'userreference_select' => array(
'label' => t('Select list'),
'field types' => array(
'userreference',
),
'multiple values' => CONTENT_HANDLE_MODULE,
'callbacks' => array(
'default value' => CONTENT_CALLBACK_DEFAULT,
),
),
'userreference_buttons' => array(
'label' => t('Check boxes/radio buttons'),
'field types' => array(
'userreference',
),
'multiple values' => CONTENT_HANDLE_MODULE,
'callbacks' => array(
'default value' => CONTENT_CALLBACK_DEFAULT,
),
),
'userreference_autocomplete' => array(
'label' => t('Autocomplete text field'),
'field types' => array(
'userreference',
),
'multiple values' => CONTENT_HANDLE_CORE,
'callbacks' => array(
'default value' => CONTENT_CALLBACK_DEFAULT,
),
),
);
}