You are here

function taxonomy_menu_taxonomy_menu_options in Taxonomy menu 7

Same name and namespace in other branches
  1. 6.3 taxonomy_menu.module \taxonomy_menu_taxonomy_menu_options()
  2. 6.2 taxonomy_menu.module \taxonomy_menu_taxonomy_menu_options()

Implements hook_taxonomy_menu_options().

File

./taxonomy_menu.module, line 1123
Adds links to taxonomy terms into a menu.

Code

function taxonomy_menu_taxonomy_menu_options() {
  $options['sync'] = array(
    '#title' => t('Synchronise changes to this vocabulary'),
    '#description' => t('Every time a term is added/deleted/modified, the corresponding menu link will be altered too.'),
    'default' => TRUE,
  );
  $options['max_depth'] = array(
    '#type' => 'select',
    '#title' => t('Max depth'),
    '#description' => t('Limit how many levels of the taxonomy tree to process. Useful if you have a very large tree of taxonomy terms, and only want to provide a menu for the first several levels.'),
    '#options' => array(
      0 => t('All'),
      1 => 1,
      2 => 2,
      3 => 3,
      4 => 4,
      5 => 5,
      6 => 6,
      7 => 7,
      8 => 8,
      9 => 9,
    ),
    'default' => 0,
  );
  $options['display_num'] = array(
    '#title' => t('Display the number of items in each taxonomy term.'),
    'default' => FALSE,
  );
  $options['display_num_incl_children'] = array(
    '#title' => t('Include items belonging to child terms in number counts'),
    '#description' => t('Items belonging to the child terms will be counted when performing item count calculations.'),
    '#states' => array(
      'visible' => array(
        ':input[name="taxonomy_menu[options][display_num]"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
    'default' => TRUE,
  );
  $options['hide_empty_terms'] = array(
    '#title' => t('Do not add a menu link for taxonomy terms with no items.'),
    'default' => FALSE,
  );
  $options['voc_item'] = array(
    '#title' => t('Include the vocabulary name as the top level menu item of the taxonomy menu.'),
    'default' => FALSE,
    '#disabled' => TRUE,
  );
  $options['voc_item_description'] = array(
    '#title' => t('Add the vocabulary description to the vocabulary menu item.'),
    'default' => FALSE,
    '#access' => FALSE,
  );
  $options['term_item_description'] = array(
    '#title' => t('Add the taxonomy term description to the term menu item.'),
    'default' => FALSE,
  );
  $options['expanded'] = array(
    '#title' => t('Automatically show all menu items as expanded.'),
    'default' => TRUE,
  );
  $options['flat'] = array(
    '#title' => t('Add all menu items to the same level rather than retaining term hierarchy.'),
    'default' => FALSE,
  );
  $options['voc_name'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom name for vocabulary item'),
    '#description' => t('Changes the name of the vocabulary item (if enabled above). Leave blank to use the name of the vocabulary.'),
    'default' => '',
    '#disabled' => TRUE,
  );
  $options['display_descendants'] = array(
    '#title' => t('Display descendants: change the path to taxonomy/term/tid+tid+tid for all terms thave have child terms.'),
    'default' => FALSE,
  );
  $options['end_all'] = array(
    '#title' => t("Use 'all' at the end of URL"),
    'default' => FALSE,
    '#description' => t('This changes tid+tid+tid to "All" in term when <em>Display descendants</em> has been selected.<br />Only used if <em>Menu path type</em> is "Default path".<br />Works with default taxonomy page.'),
    '#disabled' => TRUE,
  );
  return $options;
}