addlink_toolbar.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Plugin addlink_toolbar.
  4. * Adds the addlink input on the linklist page.
  5. */
  6. /**
  7. * When linklist is displayed, add play videos to header's toolbar.
  8. *
  9. * @param array $data - header data.
  10. *
  11. * @return mixed - header data with addlink toolbar item.
  12. */
  13. function hook_addlink_toolbar_render_header($data)
  14. {
  15. if ($data['_PAGE_'] == Router::$PAGE_LINKLIST && $data['_LOGGEDIN_'] === true) {
  16. $form = array(
  17. 'attr' => array(
  18. 'method' => 'GET',
  19. 'action' => '',
  20. 'name' => 'addform',
  21. 'class' => 'addform',
  22. ),
  23. 'inputs' => array(
  24. array(
  25. 'type' => 'text',
  26. 'name' => 'post',
  27. 'placeholder' => 'URI',
  28. ),
  29. array(
  30. 'type' => 'submit',
  31. 'value' => 'Add link',
  32. 'class' => 'bigbutton',
  33. ),
  34. ),
  35. );
  36. $data['fields_toolbar'][] = $form;
  37. }
  38. return $data;
  39. }