You are here

function hs_taxonomy_views_menu in Hierarchical Select 5.3

Same name and namespace in other branches
  1. 6.3 modules/hs_taxonomy_views.module \hs_taxonomy_views_menu()

Implementation of hook_menu().

File

modules/hs_taxonomy_views.module, line 16
Implementation of the Hierarchical Select API for the Taxonomy module's Views exposed filters.

Code

function hs_taxonomy_views_menu($may_cache) {
  $items = array();
  if (!$may_cache && arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'views' && is_string(arg(3)) && arg(4) == 'hs_config' && is_numeric(arg(5))) {
    $view_name = arg(3);
    $vid = arg(5);

    // Vocabulary ID, not View ID!
    $items[] = array(
      'path' => "admin/build/views/{$view_name}/hs_config/{$vid}",
      'title' => t('Hierarchical Select configuration for !view', array(
        '!view' => $view_name,
      )),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'hs_taxonomy_views_config_form',
        $view_name,
        $vid,
      ),
      'access' => user_access('administer views'),
      'type' => MENU_NORMAL_ITEM,
    );
  }
  return $items;
}