You are here

function auto_expire_menu in Auto Expire 5

Same name and namespace in other branches
  1. 7 auto_expire.module \auto_expire_menu()

File

./auto_expire.module, line 21

Code

function auto_expire_menu($may_cache) {
  $items = array();
  if ($may_cache) {
  }
  else {
    $items[] = array(
      'path' => 'admin/settings/auto_expire',
      'title' => t('Auto Expire'),
      'description' => t('Set node types that auto expire.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => '_auto_expire_admin_settings',
      'access' => user_access(ADMINISTER_AUTO_EXPIRE),
      'type' => MENU_NORMAL_ITEM,
    );
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if (_auto_expire_is_expiring_node($node)) {
        $items[] = array(
          'path' => 'node/' . $node->nid . '/expiry',
          'title' => t('Extend'),
          'description' => t('See and extend the expiry period.'),
          'callback' => 'drupal_get_form',
          'callback arguments' => array(
            '_auto_expire_expiry',
            $node->nid,
          ),
          'access' => _auto_expire_can_user_extend($node),
          'type' => MENU_LOCAL_TASK,
          'weight' => 10,
        );
      }
    }
  }
  return $items;
}