function menu_attributes_menu_attribute_info in Menu Attributes 7
Same name and namespace in other branches
- 8 menu_attributes.module \menu_attributes_menu_attribute_info()
- 6.2 menu_attributes.module \menu_attributes_menu_attribute_info()
- 6 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 46 - 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,
),
'scope' => array(
MENU_ATTRIBUTES_LINK,
),
);
$info['id'] = array(
'label' => t('ID'),
'description' => t('Specifies a unique ID for the link.'),
'item_description' => t('Specifies a unique ID to be added to the item.'),
'scope' => array(
MENU_ATTRIBUTES_LINK,
MENU_ATTRIBUTES_ITEM,
),
);
$info['name'] = array(
'label' => t('Name'),
'scope' => array(
MENU_ATTRIBUTES_LINK,
),
);
$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."),
'scope' => array(
MENU_ATTRIBUTES_LINK,
),
);
$info['class'] = array(
'label' => t('Classes'),
'description' => t('Enter additional classes to be added to the link.'),
'item_description' => t('Enter additional CSS class names to be added to the item.'),
'scope' => array(
MENU_ATTRIBUTES_LINK,
MENU_ATTRIBUTES_ITEM,
),
);
$info['style'] = array(
'label' => t('Style'),
'description' => t('Enter additional styles to be applied to the link.'),
'item_description' => t('Enter additional styles attribute to be applied to the item.'),
'scope' => array(
MENU_ATTRIBUTES_LINK,
MENU_ATTRIBUTES_ITEM,
),
);
$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(
'' => t('None (i.e. same window)'),
'_blank' => t('New window (_blank)'),
'_top' => t('Top window (_top)'),
'_self' => t('Same window (_self)'),
'_parent' => t('Parent window (_parent)'),
),
),
'scope' => array(
MENU_ATTRIBUTES_LINK,
),
);
$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,
),
'scope' => array(
MENU_ATTRIBUTES_LINK,
),
);
return $info;
}