You are here

function kaltura_choose_player in Kaltura 6

Same name and namespace in other branches
  1. 5 kaltura.module \kaltura_choose_player()
  2. 6.2 kaltura.module \kaltura_choose_player()
  3. 7.3 plugins/field_kaltura/field_kaltura.module \kaltura_choose_player()
  4. 7.2 plugins/field_kaltura/field_kaltura.module \kaltura_choose_player()
4 calls to kaltura_choose_player()
kaltura_entry_settings_form in plugins/node_kaltura_entry/node_kaltura_entry.module
kaltura_mix_settings_form in plugins/node_kaltura_mix/node_kaltura_mix.module
kaltura_playlist_settings_form in plugins/kaltura_playlist/kaltura_playlist.module
kaltura_vc_settings_form in plugins/kaltura_comments/kaltura_comments.module

File

./kaltura.module, line 488
kaltura integration module - core functions

Code

function kaltura_choose_player($as_single_form, $type, $node_type, $return_widget_html = FALSE) {
  global $base_path;
  if (variable_get('kaltura_partner_id', '') == '') {
    drupal_set_message(t('You must configure partner\'s details first.'), 'error');
    return $form;
  }
  if ($as_single_form) {
    $form['kaltura_widgets_information'] = array(
      '#value' => t('Select which player you want to use in default view for kaltura items'),
    );
  }
  $widgets = new KalturaSettings();
  $pid = variable_get('kaltura_partner_id', '');
  foreach ($widgets->kdp_widgets[$type] as $skins => $confs) {
    if ($return_widget_html) {
      $embbed = katura_fetch_widget_html('_' . $pid . '_' . $confs['remix_uiconf']);
    }
    $options[$skins] = $skins . ': ' . ($return_widget_html ? $embbed : '<br /><img src="' . $base_path . drupal_get_path('module', 'kaltura') . '/images/' . $confs['preview_image'] . '" />');
  }
  $default = kaltura_default_uiconf_by_type($type);
  $form['default_widget'] = array(
    '#title' => t('available widgets'),
    '#type' => 'radios',
    '#options' => $options,
    '#attributes' => array(
      "class" => "player-preview-option",
    ),
    '#default_value' => variable_get('kaltura_' . $type . '_' . $node_type . '_widget', $default),
  );
  if ($as_single_form) {
    return system_settings_form($form);
  }
  else {
    return $form;
  }
}