You are here

function brightcove_player_editor_form in Brightcove Video Connect 7.2

1 string reference to 'brightcove_player_editor_form'
brightcove_menu in ./brightcove.module
Implements hook_menu().

File

./brightcove.admin.inc, line 297
Admin settings for Brightcove module.

Code

function brightcove_player_editor_form($form, &$form_state, $player = NULL) {
  if (!$player) {
    $player = new stdClass();
  }
  $titles = array(
    'name' => 'Name',
    'player_id' => 'Player ID',
    'player_key' => 'Player Key',
  );
  $required = array(
    'name' => TRUE,
    'player_id' => TRUE,
    'player_key' => FALSE,
  );
  foreach (array(
    'name',
    'player_id',
    'player_key',
  ) as $item) {
    $form[$item] = array(
      '#title' => t($titles[$item]),
      '#type' => 'textfield',
      '#default_value' => isset($player->{$item}) ? $player->{$item} : NULL,
      '#required' => $required[$item],
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
  );
  return $form;
}