You are here

function node_expire_menu in Node expire 5

Same name and namespace in other branches
  1. 8 node_expire.module \node_expire_menu()
  2. 6 node_expire.module \node_expire_menu()
  3. 7.2 node_expire.module \node_expire_menu()
  4. 7 node_expire.module \node_expire_menu()

Implementation of hook_menu().

File

./node_expire.module, line 18
Alerts administrators of possibly outdated materials and optionally unpublishes them.

Code

function node_expire_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/node_expire',
      'title' => t('Node Expire'),
      'description' => t('Configure Node Expire'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'node_expire_settings_form',
      ),
      'access' => user_access('administer node_expire'),
    );
    $items[] = array(
      'path' => 'admin/settings/node_expire/settings',
      'title' => t('Settings'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'node_expire_settings_form',
      ),
      'access' => user_access('administer node_expire'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/node_expire/defaults',
      'title' => t('Defaults'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'node_expire_default_settings_form',
      ),
      'access' => user_access('administer node_expire'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 1,
    );

    // If pages are set to expire instantly, this page is of absolutely no use. Let's just hide it.
    $items[] = array(
      'path' => 'admin/content/node/outdated',
      'title' => t('Outdated Documents'),
      'callback' => 'node_expire_outdated_nodes',
      'access' => variable_get('node-expire-unpublishtime', 0) != 1 && user_access('administer nodes'),
      'type' => MENU_LOCAL_TASK,
      'weight' => 10,
    );
  }
  return $items;
}