You are here

function field_kaltura_widget_settings in Kaltura 5

Same name and namespace in other branches
  1. 6.2 plugins/field_kaltura/field_kaltura.module \field_kaltura_widget_settings()
  2. 6 plugins/field_kaltura/field_kaltura.module \field_kaltura_widget_settings()

Implementation of hook_widget_settings().

File

plugins/field_kaltura/field_kaltura.module, line 333
kaltura integration module - functions to provide kaltura as CCK field

Code

function field_kaltura_widget_settings($op, $widget) {
  switch ($op) {
    case 'form':
      $form = array();
      $rows = isset($widget['rows']) && is_numeric($widget['rows']) ? $widget['rows'] : 1;
      $size = isset($widget['size']) && is_numeric($widget['size']) ? $widget['size'] : 60;

      //if ($widget['type'] == 'field_kaltura_textfield' ) {
      $form['rows'] = array(
        '#type' => 'hidden',
        '#value' => $rows,
      );
      $form['size'] = array(
        '#type' => 'hidden',
        '#title' => t('Size of textfield'),
        '#default_value' => $size,
        '#element_validate' => array(
          '_field_kaltura_widget_settings_size_validate',
        ),
        '#required' => TRUE,
      );

      /*}
        else {
          $form['rows'] = array(
            '#type' => 'textfield',
            '#title' => t('Rows'),
            '#default_value' => $rows,
            '#element_validate' => array('_field_kaltura_widget_settings_row_validate'),
            '#required' => TRUE,
          );
          $form['size'] = array('#type' => 'hidden', '#value' => $size);
        }*/
      return $form;
    case 'save':
      return array(
        'rows',
        'size',
      );
  }
}