You are here

function conditional_fields_menu in Conditional Fields 5

Same name and namespace in other branches
  1. 6.2 conditional_fields.module \conditional_fields_menu()
  2. 6 conditional_fields.module \conditional_fields_menu()
  3. 7.3 conditional_fields.module \conditional_fields_menu()

Implementation of hook_menu().

File

./conditional_fields.module, line 21

Code

function conditional_fields_menu($may_cache) {
  $items = array();
  $access = user_access('administer conditional fields');
  if (!$may_cache) {
    if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'types' && arg(3)) {
      $content_type = content_types(arg(3));
      if (arg(3) == $content_type['url_str']) {
        $items[] = array(
          'path' => 'admin/content/types/' . $content_type['url_str'] . '/conditional',
          'title' => t('Conditional fields'),
          'callback' => 'drupal_get_form',
          'callback arguments' => array(
            '_conditional_fields_admin',
            $content_type['type'],
          ),
          'access' => $access,
          'type' => MENU_LOCAL_TASK,
          'weight' => 5,
        );
      }
    }
  }
  return $items;
}