menu_attributes.api.php 1019 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * @file
  4. * Documentation for Menu Attributes API.
  5. */
  6. /**
  7. * Alter the list of menu item attributes.
  8. *
  9. * @param $attributes
  10. * An array of attributes to be controlled by Menu Attributes, keyed by
  11. * attribute name. Each attribute record should be an array with the following
  12. * key/value pairs:
  13. * - label: The human-readable name of the attribute.
  14. * - description: The attribute description.
  15. * - form: A Form API array. Some default values for this array are provided
  16. * in menu_attributes_get_menu_attribute_info().
  17. *
  18. * @see menu_attributes_menu_attribute_info()
  19. * @see menu_attributes_get_menu_attribute_info()
  20. */
  21. function hook_menu_attribute_info(array &$attributes) {
  22. // Add a Tabindex attribute.
  23. $info['tabindex'] = array(
  24. 'label' => t('Tabindex'),
  25. 'description' => t('Specifies the tab order for the link.'),
  26. 'form' => array(
  27. '#maxlength' => 3,
  28. '#size' => 2,
  29. ),
  30. );
  31. // Remove the Access Key attribute.
  32. unset($attributes['accesskey']);
  33. }