function brightcove_admin_embed_edit_form in Brightcove Video Connect 7.6
Same name and namespace in other branches
- 7.7 brightcove.player.inc \brightcove_admin_embed_edit_form()
Form callback for 'admin/config/media/brightcove/players/%/%/{%/edit,add-embed}'.
_state
Parameters
array $form:
string $bcid:
string $player_id:
string|null $embed_id:
Return value
array
1 string reference to 'brightcove_admin_embed_edit_form'
- brightcove_menu in ./
brightcove.module - Implements hook_menu().
File
- ./
brightcove.player.inc, line 464
Code
function brightcove_admin_embed_edit_form(array $form, array &$form_state, $origin, $bcid, $player_id, $embed_id = NULL) {
/** @var \Brightcove\Object\Player\Branch\Configuration\Configuration $configuration */
$configuration = NULL;
/** @var \Brightcove\Object\Player\Embed $embed */
$embed = NULL;
$client = brightcove_client_load($bcid);
/** @var \Brightcove\API\PM $pm */
list(, , $pm) = brightcove_create_classes($client);
if ($embed_id) {
$embed = $pm
->getEmbed($player_id, $embed_id);
$configuration = $embed
->getBranches()
->getPreview()
->getConfiguration();
}
else {
$player = $pm
->getPlayer($player_id);
$configuration = $player
->getBranches()
->getMaster()
->getConfiguration();
}
$form['bcid'] = [
'#type' => 'value',
'#value' => $bcid,
];
$form['player_id'] = [
'#type' => 'value',
'#value' => $player_id,
];
$form['embed_id'] = [
'#type' => 'value',
'#value' => $embed_id,
];
$form['origin'] = [
'#type' => 'value',
'#value' => $origin,
];
$form['embed_name'] = [
'#type' => 'textfield',
'#title' => t('Name'),
'#default_value' => $embed ? $embed
->getBranches()
->getMaster()
->getConfiguration()
->getEmbedName() : '',
'#required' => TRUE,
];
$form = _brightcove_admin_player_configuration_form($form, $configuration ?: new \Brightcove\Object\Player\Branch\Configuration\Configuration());
$form['submit'] = [
'#type' => 'submit',
'#value' => t('Save'),
];
return $form;
}