You are here

function menu_attributes_menu_attribute_info in Menu Attributes 6

Same name and namespace in other branches
  1. 8 menu_attributes.module \menu_attributes_menu_attribute_info()
  2. 6.2 menu_attributes.module \menu_attributes_menu_attribute_info()
  3. 7 menu_attributes.module \menu_attributes_menu_attribute_info()

Implements hook_menu_attribute_info().

1 call to menu_attributes_menu_attribute_info()
menu_attributes_uninstall in ./menu_attributes.install
Implements hook_uninstall().

File

./menu_attributes.module, line 37
Alters the menu item form to allow the administrator to specify additional attributes for the menu link

Code

function menu_attributes_menu_attribute_info() {
  $info['title'] = array(
    'label' => t('Title'),
    'description' => t('The description displayed when hovering over the link.'),
    'form' => array(
      '#type' => 'textarea',
      '#rows' => 2,
    ),
  );
  $info['id'] = array(
    'label' => t('ID'),
    'description' => t('Specifies a unique ID for the link.'),
  );
  $info['name'] = array(
    'label' => t('Name'),
  );
  $info['rel'] = array(
    'label' => t('Relationship'),
    'description' => t("Specifies the relationship between the current page and the link. Enter 'nofollow' here to nofollow this link."),
  );
  $info['class'] = array(
    'label' => t('Classes'),
    'description' => t('Enter additional classes to be added to the link.'),
  );
  $info['style'] = array(
    'label' => t('Style'),
    'description' => t('Enter additional styles to be applied to the link.'),
  );
  $info['target'] = array(
    'label' => t('Target'),
    'description' => t('Specifies where to open the link. Using this attribute breaks XHTML validation.'),
    'form' => array(
      '#type' => 'select',
      '#options' => array(
        '' => 'None (i.e. same window)',
        '_blank' => 'New window (_blank)',
        '_top' => 'Top window (_top)',
        '_self' => 'Same window (_self)',
        '_parent' => 'Parent window (_parent)',
      ),
    ),
  );
  $info['accesskey'] = array(
    'label' => t('Access Key'),
    'description' => t('Specifies a <a href="@accesskey">keyboard shortcut</a> to access this link.', array(
      '@accesskey' => url('http://en.wikipedia.org/wiki/Access_keys'),
    )),
    'form' => array(
      '#maxlength' => 1,
      '#size' => 1,
    ),
  );
  return $info;
}