You are here

function field_kaltura_remix_textfield_process in Kaltura 5

Same name and namespace in other branches
  1. 6.2 plugins/field_kaltura/field_kaltura.module \field_kaltura_remix_textfield_process()
  2. 6 plugins/field_kaltura/field_kaltura.module \field_kaltura_remix_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_remix_textfield_process()
field_kaltura_widget in plugins/field_kaltura/field_kaltura.module
Implementation of hook_widget().
1 string reference to 'field_kaltura_remix_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 525
kaltura integration module - functions to provide kaltura as CCK field

Code

function field_kaltura_remix_textfield_process($field, $edit, $form_state, &$form, $items, $delta = 0, $no_content = FALSE) {
  global $_kaltura_thumbnail_base_url;
  $custom_name = 'edit-' . str_replace('_', '-', $field['field_name']) . '-' . $delta . '-value';
  $cw_vars = kaltura_format_cw_vars(array(
    'kshow_id' => 0,
    'partner_data' => '',
    'type' => 'entry',
    'context' => 'field_mix',
    'field_id' => $custom_name,
    'add_filter' => 6,
  ));
  $action_buttons = '<input type="button" value="Add Kaltura Remix" onclick="kalturaInitModalBox(\'' . url('kaltura/contribution_wizard/' . $cw_vars) . '/\'+ get_title(), {width:680, height:380});" /><input type="button" value="Clear" onclick="remove_items_from_field(\'' . $custom_name . '\');" />';
  $action_buttons .= '<input type="button" value="Edit Mix" onclick="if(document.getElementById(\'' . $custom_name . '\').value) { kalturaInitModalBox(\'' . url('kaltura/simple_editor/') . '\' + document.getElementById(\'' . $custom_name . '\').value +\'/entry/empty_partner_data/no_refresh\', { width: 890, height: 546 }); }" />';
  $field_thumbs = kaltura_get_field_thumbs($items[$delta]['value'], $custom_name, 'Remix', $field['required']);
  $form['mixdata'][$custom_name . '_thumbs'] = array(
    '#type' => 'item',
    '#value' => '<div id="' . $custom_name . '_thumbs_div">' . $field_thumbs . '</div>',
  );
  $form['mixdata']['add_video_' . $delta] = array(
    '#type' => 'item',
    '#value' => $action_buttons,
  );
  $form[$field['field_name']][$delta]['value'] = array(
    '#type' => 'hidden',
    '#default_value' => !$no_content ? $items[$delta]['value'] : '',
    '#size' => 60,
    '#attributes' => array(
      'class' => 'text',
      'readonly' => 'readonly',
    ),
    '#readonly' => 'readonly',
  );

  // Used so that hook_field('validate') knows where to flag an error.
}