function brightcove_admin_player_publish_form_submit in Brightcove Video Connect 7.7
Same name and namespace in other branches
- 7.6 brightcove.player.inc \brightcove_admin_player_publish_form_submit()
Submit handler for brightcove_admin_player_publish_form().
_state
Parameters
array $form:
File
- ./
brightcove.player.inc, line 354
Code
function brightcove_admin_player_publish_form_submit(array $form, array &$form_state) {
$bcid = $form_state['values']['bcid'];
$player_id = $form_state['values']['player_id'];
$comment = $form_state['values']['comment'];
$client = brightcove_client_load($bcid);
/** @var \Brightcove\API\PM $pm */
list(, , $pm) = brightcove_create_classes($client);
$form_state['redirect'] = 'admin/config/media/brightcove/players';
brightcove_try(function () use ($pm, $player_id, $comment) {
$pm
->publishPlayer($player_id, $comment);
drupal_set_message(t('Player published.'));
}, function () {
drupal_set_message(t('Failed to publish player.'), 'error');
});
}