diff --git a/menu_attributes.module b/menu_attributes.module index fb13f15..8c9e0fc 100644 --- a/menu_attributes.module +++ b/menu_attributes.module @@ -7,6 +7,41 @@ */ /** + * Implements hook_menu(). + */ +function menu_attributes_menu() { + $items = array(); + $items['admin/config/user-interface/menu_attributes'] = array( + 'title' => t('Menu attributes'), + 'description' => 'Show or hide different menu attributes.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('menu_attributes_admin'), + 'access arguments' => array('access administration pages'), + 'type' => MENU_NORMAL_ITEM, + ); + return $items; +} + +/** + * Menu attributes configuration page. + */ +function menu_attributes_admin() { + $form = array(); + + $attributes = menu_attributes_get_menu_attribute_info(); + foreach ($attributes as $attribute => $info) { + $form["menu_attributes_{$attribute}_enable"] = array( + '#type' => 'checkbox', + '#title' => $attribute, + '#default_value' => variable_get("menu_attributes_{$attribute}_enable", 1), + '#description' => t("Show @attr attribute.", array('@attr' => $attribute)), + ); + } + + return system_settings_form($form); +} + +/** * Implements hook_menu_link_alter(). */ function menu_attributes_menu_link_alter(&$item, $menu) {