You are here

function brightcove_player_ui::edit_form in Brightcove Video Connect 7.4

Same name and namespace in other branches
  1. 7.3 plugins/export_ui/brightcove_player_ui.class.php \brightcove_player_ui::edit_form()
  2. 7.5 plugins/export_ui/brightcove_player_ui.class.php \brightcove_player_ui::edit_form()

Edit for for Brightcove Player preset.

Overrides ctools_export_ui::edit_form

File

plugins/export_ui/brightcove_player_ui.class.php, line 57
Class brightcove_player_ui

Class

brightcove_player_ui
@file Class brightcove_player_ui

Code

function edit_form(&$form, &$form_state) {
  parent::edit_form($form, $form_state);
  unset($form['info']);
  $form['display_name'] = array(
    '#title' => t('Name'),
    '#description' => t('Example: My Player') . ' (' . t('Do not begin name with numbers.') . ')',
    '#type' => 'textfield',
    '#default_value' => !empty($form_state['item']->display_name) ? $form_state['item']->display_name : '',
    '#required' => TRUE,
  );
  $form['name'] = array(
    '#type' => 'machine_name',
    '#title' => t('Machine-readable name'),
    '#description' => t('Example: my_player') . '<br/>' . t('May only contain lowercase letters, numbers and underscores. <strong>Try to avoid conflicts with the names of existing Drupal projects.</strong>'),
    '#required' => TRUE,
    '#default_value' => !empty($form_state['item']->name) ? $form_state['item']->name : '',
    '#disabled' => !empty($form_state['item']->name) ? TRUE : FALSE,
    '#machine_name' => array(
      'exists' => 'brightcove_player_form_validate_field',
      'source' => array(
        'display_name',
      ),
    ),
  );
  $form['player_id'] = array(
    '#title' => t('Player ID'),
    '#type' => 'textfield',
    '#default_value' => isset($form_state['item']->player_id) ? $form_state['item']->player_id : '',
    '#required' => TRUE,
  );
  $form['player_key'] = array(
    '#title' => t('Player Key'),
    '#type' => 'textfield',
    '#default_value' => isset($form_state['item']->player_key) ? $form_state['item']->player_key : '',
    '#required' => FALSE,
  );
}