You are here

function hs_content_taxonomy_views_menu in Hierarchical Select 5.3

Implementation of hook_menu().

File

modules/hs_content_taxonomy_views.module, line 16
Implementation of the Hierarchical Select API for the Content Taxonomy Views module.

Code

function hs_content_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_string(arg(5))) {
    $view_name = arg(3);
    $field_name = arg(5);
    $widget_type = db_result(db_query("SELECT widget_type FROM {node_field_instance} WHERE field_name = '%s'", $field_name));
    if ($widget_type == 'content_taxonomy_hs') {
      $items[] = array(
        'path' => "admin/build/views/{$view_name}/hs_config/{$field_name}",
        'title' => t('Hierarchical Select configuration for !view', array(
          '!view' => $view_name,
        )),
        'callback' => 'drupal_get_form',
        'callback arguments' => array(
          'hs_content_taxonomy_views_config_form',
          $view_name,
          $field_name,
        ),
        'access' => user_access('administer views'),
        'type' => MENU_NORMAL_ITEM,
      );
    }
  }
  return $items;
}