You are here

function date_menu in Date 5.2

Same name and namespace in other branches
  1. 5 date.module \date_menu()
  2. 6.2 date/date.module \date_menu()
  3. 7 date.module \date_menu()

Implementation of hook_menu().

File

date/date.module, line 11
Defines date/time field types for the Content Construction Kit (CCK).

Code

function date_menu($may_cache) {
  if (!$may_cache) {
    require_once './' . drupal_get_path('module', 'date') . '/date.theme';
    if (module_exists('views')) {
      require_once './' . drupal_get_path('module', 'date') . '/date_views.inc';
    }
  }
  $items = array();
  if (!module_exists('date_repeat')) {
    return $items;
  }
  elseif (!$may_cache) {

    // Repeat dates tab on node
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if ($node && date_repeat_type($node->type)) {
        $items[] = array(
          'path' => 'node/' . arg(1) . '/repeats',
          'title' => t('Repeats'),
          'callback' => 'date_repeat_page',
          'callback arguments' => array(
            arg(1),
          ),
          'type' => MENU_LOCAL_TASK,
        );
      }
    }
  }
  return $items;
}