You are here

function kaltura_entry_settings_form in Kaltura 5

Same name and namespace in other branches
  1. 6.2 plugins/node_kaltura_entry/node_kaltura_entry.module \kaltura_entry_settings_form()
  2. 6 plugins/node_kaltura_entry/node_kaltura_entry.module \kaltura_entry_settings_form()
1 string reference to 'kaltura_entry_settings_form'
node_kaltura_entry_menu in plugins/node_kaltura_entry/node_kaltura_entry.module
Implementation of hook_menu().

File

plugins/node_kaltura_entry/node_kaltura_entry.module, line 58

Code

function kaltura_entry_settings_form() {
  $taxonomy_array = taxonomy_get_vocabularies($type = 'kaltura_entry');
  $options[] = '';
  foreach ($taxonomy_array as $voc) {
    if ($voc->tags == 1) {
      $options[$voc->vid] = $voc->name;
    }
  }
  $form['entry_taxonomy'] = array(
    '#type' => 'fieldset',
    '#title' => 'Taxonomy',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => 0,
  );
  $form['entry_taxonomy']['kaltura_entry_tags_voc'] = array(
    '#title' => 'Taxonomy Vocabulary for Tags',
    '#description' => 'must be a \'free tagging\' vocabulary that is enabled for kaltura entry content type<br />' . 'only vocabularies that meets these requirements will apear in the list',
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => variable_get('kaltura_entry_tags_voc', ''),
    '#required' => FALSE,
  );
  $form['entry_taxonomy']['kaltura_entry_admin_tags_voc'] = array(
    '#title' => 'Taxonomy Vocabulary for Admin Tags',
    '#description' => 'must be a \'free tagging\' vocabulary that is enabled for kaltura entry content type<br />' . 'only vocabularies that meets these requirements will apear in the list',
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => variable_get('kaltura_entry_admin_tags_voc', ''),
    '#required' => FALSE,
  );
  $form['kaltura_entry_video_display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Video Display'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => -3,
  );
  $players = kaltura_choose_player(0, 'video', 'entry');
  $saved_player = variable_get('kaltura_video_entry_widget', KalturaSettings_DEFAULT_VIDEO_PLAYER_UICONF);
  $form['kaltura_entry_video_display']['kaltura_video_entry_widget'] = $players['default_widget'];
  $form['kaltura_entry_video_display']['kaltura_video_entry_widget']['#default_value'] = $saved_player;
  $form['kaltura_entry_video_display']['clear_block_item'] = array(
    '#type' => 'item',
    '#value' => '<div class="clear-block"></div>',
  );
  $form['kaltura_entry_video_display']['kaltura_video_entry_player_ratio'] = array(
    '#type' => 'select',
    '#title' => t('If media aspect ratio is different then player aspect ratio'),
    '#options' => array(
      1 => 'Keep original media ratio',
      0 => 'strech media to fit player',
    ),
    '#description' => t('Note - you might want to change the player width and height to fit the selected ratio'),
    '#default_value' => variable_get('kaltura_video_entry_player_ratio', 0),
  );
  $form['kaltura_entry_video_display']['kaltura_video_entry_width'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Player Width'),
    '#default_value' => variable_get('kaltura_video_entry_width', '410'),
  );
  $form['kaltura_entry_video_display']['kaltura_video_entry_height'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Player Height'),
    '#default_value' => variable_get('kaltura_video_entry_height', '364'),
  );
  $form['kaltura_entry_video_display']['kaltura_video_entry_thumb_width'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Thumbnail Width'),
    '#default_value' => variable_get('kaltura_video_entry_thumb_width', '120'),
  );
  $form['kaltura_entry_video_display']['kaltura_video_entry_thumb_height'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Thumbnail Height'),
    '#default_value' => variable_get('kaltura_video_entry_thumb_height', '90'),
  );
  $form['kaltura_entry_video_display']['kaltura_entry_rotate_thumb'] = array(
    '#type' => 'radios',
    '#title' => t('Rotate Thumbnails for Video Items'),
    '#options' => array(
      0 => 'no',
      1 => 'yes',
    ),
    '#default_value' => variable_get('kaltura_entry_rotate_thumb', 1),
  );
  if (variable_get('kaltura_notification_type', 0) == 1) {
    $form['kaltura_entry_video_display']['display_entry_not_ready'] = array(
      '#type' => 'radios',
      '#title' => 'How would you like to display entry which is not ready ?',
      '#options' => array(
        0 => 'Display in player even if not ready',
        1 => 'Display textual warning',
      ),
      '#default_value' => variable_get('display_entry_not_ready', 0),
    );
    if (variable_get('display_entry_not_ready', 0) != 0) {
      $form['kaltura_entry_video_display']['entry_not_ready_text'] = array(
        '#type' => 'textfield',
        '#title' => t('Entry Not Ready Text'),
        '#maxlength' => 128,
        '#description' => t('what text to display if entry not ready ?'),
        '#default_value' => variable_get('entry_not_ready_text', 'This Kaltura Item is still rendering.'),
      );
    }
  }
  $form['kaltura_entry_video_display']['kaltura_display_entry_video_teaser_with_player'] = array(
    '#type' => 'radios',
    '#title' => t('In Teaser Mode - Display Only Thumbnail'),
    '#options' => array(
      '0' => 'Only thumbnail',
      '1' => 'Thumbnail and player',
    ),
    '#default_value' => variable_get('kaltura_display_entry_video_teaser_with_player', '0'),
  );
  $form['kaltura_entry_image_display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Image Display'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => -2,
  );
  $form['kaltura_entry_image_display'][''] = array(
    '#type' => 'item',
    '#title' => t('Image width/height'),
    '#description' => t('0x0 dimensions will display the image in its original size'),
  );
  $form['kaltura_entry_image_display']['kaltura_image_entry_width'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Image Width'),
    '#default_value' => variable_get('kaltura_image_entry_width', '410'),
  );
  $form['kaltura_entry_image_display']['kaltura_image_entry_height'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Image Height'),
    '#default_value' => variable_get('kaltura_image_entry_height', '364'),
  );
  $form['kaltura_entry_image_display']['kaltura_image_entry_thumb_width'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Thumbnail Width'),
    '#default_value' => variable_get('kaltura_image_entry_thumb_width', '120'),
  );
  $form['kaltura_entry_image_display']['kaltura_image_entry_thumb_height'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Thumbnail Height'),
    '#default_value' => variable_get('kaltura_image_entry_thumb_height', '90'),
  );
  $form['kaltura_entry_audio_display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Audio Display'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => -1,
  );
  $players = kaltura_choose_player(0, 'audio', 'entry');
  $saved_player = variable_get('kaltura_audio_entry_widget', KalturaSettings_DEFAULT_AUDIO_PLAYER_UICONF);
  $form['kaltura_entry_audio_display']['kaltura_audio_entry_widget'] = $players['default_widget'];
  $form['kaltura_entry_audio_display']['kaltura_audio_entry_widget']['#default_value'] = $saved_player;
  $form['kaltura_entry_audio_display']['clear_block_item'] = array(
    '#type' => 'item',
    '#value' => '<div class="clear-block"></div>',
  );
  return system_settings_form($form);
}