You are here

function wikitools_menu in Wikitools 7

Same name and namespace in other branches
  1. 5 wikitools.module \wikitools_menu()
  2. 6.2 wikitools.module \wikitools_menu()
  3. 6 wikitools.module \wikitools_menu()

Implements hook_menu().

File

./wikitools.module, line 32
A non-intrusive module to have some wiki-like behaviour.

Code

function wikitools_menu() {
  $items = array();
  $items['admin/config/wikitools'] = array(
    'title' => t('Wikitools'),
    'description' => t('Settings for wiki-like behaviour.'),
    'access arguments' => array(
      'administer site configuration',
    ),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'wikitools_admin_settings',
    ),
    'file' => 'wikitools.admin.inc',
    'type' => MENU_NORMAL_ITEM,
  );
  if (wikitools_enforce_unique_titles()) {
    $items['admin/config/content/wikitools'] = array(
      'title' => t('Duplicate titles'),
      'description' => t('List nodes which have duplicate titles'),
      'page callback' => 'wikitools_page_duplicates',
      'access arguments' => array(
        'administer nodes',
      ),
      'file' => 'wikitools.admin.inc',
      'type' => MENU_NORMAL_ITEM,
    );
  }
  if ($wiki_path = wikitools_wiki_path()) {
    $items[$wiki_path] = array(
      'page callback' => 'wikitools_handle_request',
      'access arguments' => array(
        'access content',
      ),
      'file' => 'wikitools.pages.inc',
      'type' => MENU_CALLBACK,
    );
  }
  if (module_exists('freelinking') && wikitools_hijack_freelinking()) {

    // Add a new path under the freelinking path.
    $callbacks['freelinking/%'] = array(
      'page callback' => 'wikitools_handle_request',
      'access arguments' => array(
        'access content',
      ),
      'file' => 'wikitools.pages.inc',
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}