You are here

function kaltura_mix_settings_form in Kaltura 6.2

Same name and namespace in other branches
  1. 5 plugins/node_kaltura_mix/node_kaltura_mix.module \kaltura_mix_settings_form()
  2. 6 plugins/node_kaltura_mix/node_kaltura_mix.module \kaltura_mix_settings_form()
1 string reference to 'kaltura_mix_settings_form'
node_kaltura_mix_menu in plugins/node_kaltura_mix/node_kaltura_mix.module
Implementation of hook_menu().

File

plugins/node_kaltura_mix/node_kaltura_mix.module, line 72

Code

function kaltura_mix_settings_form() {
  $form['entry_wizards'] = array(
    '#type' => 'fieldset',
    '#title' => t('Wizards'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => 0,
  );
  list($regular, $custom) = kaltura_choose_cw('kaltura_mix_roughcut_cw_type', 'kaltura_mix_roughcut_cw_custom');
  $form['entry_wizards']['kaltura_mix_roughcut_cw_type'] = $regular;
  $form['entry_wizards']['kaltura_mix_roughcut_cw_custom'] = $custom;

  /* Editor section */
  $default_editor = variable_get('kaltura_mix_roughcut_editor_type', KalturaSettings_AE_UICONF_ID);
  $form['entry_wizards']['kaltura_mix_roughcut_editor_type'] = array(
    '#type' => 'select',
    '#title' => t('Editor Type'),
    '#options' => array(
      KalturaSettings_SE_UICONF_ID => 'Simple',
      KalturaSettings_AE_UICONF_ID => 'Advanced',
      '1' => 'Custom - Simple',
      '2' => 'Custom - Advanced',
    ),
    '#attributes' => array(
      'onChange' => 'change_editor(this.options[this.selectedIndex].value)',
    ),
    '#default_value' => $default_editor,
  );
  $pre_edit_custom = '<script type="text/javascript">
        function change_editor(val)
        {
          div = document.getElementById("editor_custom");
          if (val == 1  || val == 2) div.style.display="block";
          else  div.style.display="none";
        }</script>';
  $custom_editor_display = $default_editor != '1' && $default_editor != '2' ? 'style="display:none"' : '';
  $form['entry_wizards']['kaltura_mix_roughcut_editor_custom'] = array(
    '#type' => 'textfield',
    '#size' => 10,
    '#title' => t('Custom Editor'),
    '#description' => t('Please insert ui_conf_id only'),
    '#prefix' => $pre_edit_custom . '<div id="editor_custom" ' . $custom_editor_display . '>',
    '#suffix' => '</div>',
    '#default_value' => variable_get('kaltura_mix_roughcut_editor_custom', ''),
  );
  $taxonomy_array = taxonomy_get_vocabularies($type = 'kaltura_mix');
  $options[] = '';
  foreach ($taxonomy_array as $voc) {
    if ($voc->tags == 1) {
      $options[$voc->vid] = $voc->name;
    }
  }
  $form['mix_taxonomy'] = array(
    '#type' => 'fieldset',
    '#title' => 'Taxonomy',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => -1,
  );
  $form['mix_taxonomy']['kaltura_mix_tags_voc'] = array(
    '#title' => 'Taxonomy Vocabulary for Tags',
    '#description' => 'must be a \'free tagging\' vocabulary that is enabled for kaltura mix content type<br />only vocabularies that meets these requirements will apear in the list',
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => variable_get('kaltura_mix_tags_voc', ''),
    '#required' => FALSE,
  );
  $form['mix_taxonomy']['kaltura_mix_admin_tags_voc'] = array(
    '#title' => 'Taxonomy Vocabulary for Admin Tags',
    '#description' => 'must be a \'free tagging\' vocabulary that is enabled for kaltura mix content type<br />only vocabularies that meets these requirements will apear in the list',
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => variable_get('kaltura_mix_admin_tags_voc', ''),
    '#required' => FALSE,
  );
  $form['kaltura_mix_display'] = array(
    '#type' => 'fieldset',
    '#title' => t('Display settings'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => -2,
  );
  $saved_player = variable_get('kaltura_roughcut_mix_widget', KalturaSettings_DEFAULT_RC_PLAYER_UICONF);
  $players = kaltura_choose_player(0, 'roughcut', 'mix', FALSE, $saved_player);
  $form['kaltura_mix_display']['kaltura_roughcut_mix_widget'] = $players['default_widget'];
  $form['kaltura_mix_display']['kaltura_roughcut_mix_widget']['#default_value'] = $saved_player;
  $form['kaltura_mix_display']['clear_block_item'] = array(
    '#type' => 'item',
    '#value' => '<div class="clear-block"></div>',
  );
  $form['kaltura_mix_display']['kaltura_roughcut_mix_delivery_type'] = array(
    '#type' => 'select',
    '#title' => t('Delivery Type'),
    '#options' => array(
      'HTTP' => 'Progressive Download (HTTP)',
      'RTMP' => 'Adaptive Streaming (RTMP)',
    ),
    '#default_value' => variable_get('kaltura_roughcut_mix_delivery_type', 'HTTP'),
  );
  $form['kaltura_mix_display']['kaltura_mix_width'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Player Width (in pixels)'),
    '#default_value' => variable_get('kaltura_mix_width', '410'),
  );
  $form['kaltura_mix_display']['kaltura_mix_height'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Player Height (in pixels)'),
    '#default_value' => variable_get('kaltura_mix_height', '364'),
  );
  $form['kaltura_mix_display']['kaltura_mix_thumb_width'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Thumbnail Width'),
    '#default_value' => variable_get('kaltura_mix_thumb_width', '120'),
  );
  $form['kaltura_mix_display']['kaltura_mix_thumb_height'] = array(
    '#type' => 'textfield',
    '#size' => 5,
    '#title' => t('Thumbnail Height'),
    '#default_value' => variable_get('kaltura_mix_thumb_height', '90'),
  );
  $form['kaltura_mix_display']['kaltura_display_mix_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_mix_teaser_with_player', '0'),
  );
  return system_settings_form($form);
}