function bynder_form_alter in Bynder 8
Same name and namespace in other branches
- 8.3 bynder.module \bynder_form_alter()
- 8.2 bynder.module \bynder_form_alter()
- 4.0.x bynder.module \bynder_form_alter()
Implements hook_form_alter().
File
- ./
bynder.module, line 57 - Provides bynder integration.
Code
function bynder_form_alter(&$form, FormStateInterface $form_state, $form_id) {
if ('media_bynder_edit_form' == $form_id) {
/** @var \Drupal\media_entity\Entity\Media $entity */
$entity = $form_state
->getBuildInfo()['callback_object']
->getEntity();
if ($entity
->getType() instanceof Bynder) {
$form['edit_on_bynder'] = [
'#type' => 'inline_template',
'#template' => 'It is strongly advised to <a href="{{ uri }}" target="_blank"><i>edit asset\'s metadata on Bynder.</i></a> Please note that the changes won\'t be automatically updated here.',
'#context' => [
'uri' => get_uri_to_bynder($entity),
],
];
}
}
}