Guest User

Untitled

a guest
May 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. $form['content_link'] = [
  2. '#type' => 'container',
  3. '#parents' => ['content_link_wrapper'],
  4. '#weight' => -3,
  5. 'widget' => [
  6. '#title' => t('Content Link'),
  7. '#description' => t('The content to be linked in the menu.'),
  8. '#field_name' => 'content_link',
  9. '#field_parents' => [],
  10. '#required' => TRUE,
  11. '#parents' => ['content_link'],
  12. '#tree' => TRUE,
  13. '#id' => 'edit-content-link',
  14. '#type' => 'details',
  15. '#open' => TRUE,
  16. 'target_id' => [
  17. '#type' => 'hidden',
  18. '#id' => 'edit-content-link-target-id',
  19. '#attributes' => [
  20. 'id' => 'edit-content-link-target-id',
  21. ],
  22. '#default_value' => "",
  23. '#ajax' => [
  24. 'callback' => [
  25. 'Drupalentity_browserPluginFieldFieldWidgetEntityReferenceBrowserWidget',
  26. 'updateWidgetCallback',
  27. ],
  28. 'wrapper' => 'edit-content-link',
  29. 'event' => 'entity_browser_value_updated',
  30. ],
  31. ],
  32. 'entity_browser' => [
  33. '#type' => 'entity_browser',
  34. '#entity_browser' => 'image_browser_dropzonejs',
  35. '#cardinality' => 1,
  36. '#selection_mode' => 'selection_append',
  37. '#default_value' => [],
  38. '#custom_hidden_id' => 'edit-content-link-target-id',
  39. '#process' => [
  40. [
  41. 'Drupalentity_browserElementEntityBrowserElement','processEntityBrowser'
  42. ],
  43. ],
  44. ],
  45. 'current' => [
  46. '#theme_wrappers' => ['container'],
  47. '#attributes' => [
  48. 'class' => 'entities-list',
  49. ],
  50. 'items' => [],
  51. ],
  52. '#attached' => [
  53. 'library' => [
  54. 'entity_browser/entity_reference',
  55. ],
  56. ],
  57. ],
  58. ];
Add Comment
Please, Sign In to add comment