function field_kaltura_textfield_process in Kaltura 5
Same name and namespace in other branches
- 6.2 plugins/field_kaltura/field_kaltura.module \field_kaltura_textfield_process()
- 6 plugins/field_kaltura/field_kaltura.module \field_kaltura_textfield_process()
Process an individual element.
Build the form element. When creating a form using FAPI #process, note that $element['#value'] is already set.
The $fields array is in $form['#field_info'][$element['#field_name']].
1 call to field_kaltura_textfield_process()
- field_kaltura_widget in plugins/
field_kaltura/ field_kaltura.module - Implementation of hook_widget().
1 string reference to 'field_kaltura_textfield_process'
- field_kaltura_elements in plugins/
field_kaltura/ field_kaltura.module - Implementation of FAPI hook_elements().
File
- plugins/
field_kaltura/ field_kaltura.module, line 469 - kaltura integration module - functions to provide kaltura as CCK field
Code
function field_kaltura_textfield_process($field, $edit, $form_state, &$form, $items) {
global $_kaltura_thumbnail_base_url;
$custom_name = 'edit-' . str_replace('_', '-', $field['field_name']) . '-0-value';
$cw_vars = kaltura_format_cw_vars(array(
'kshow_id' => 0,
'partner_data' => '',
'type' => 'entry',
'context' => 'field',
'field_id' => $custom_name,
));
$action_buttons = '<input type="button" value="Add Kaltura Media" onclick="kalturaInitModalBox(\'' . url('kaltura/contribution_wizard/' . $cw_vars) . '\', {width:680, height:380} );" />';
$field_thumbs = kaltura_get_field_thumbs($items[0]['value'], $custom_name, 'Media', $field['required']);
$form['data'] = array(
$custom_name . '_thumbs' => array(
'#type' => 'item',
'#value' => '<div id="' . $custom_name . '_thumbs_div">' . $field_thumbs . '</div>',
),
'action_buttons' => array(
'#type' => 'item',
'#value' => $action_buttons,
),
);
$form[$field['field_name']][0]['value'] = array(
'#tree' => TRUE,
'#type' => 'hidden',
'#default_value' => $items[0]['value'],
'#size' => 60,
'#attributes' => array(
'class' => 'text',
'readonly' => 'readonly',
),
'#readonly' => 'readonly',
);
}