You are here

function faq_menu in Frequently Asked Questions 7.2

Same name and namespace in other branches
  1. 5.2 faq.module \faq_menu()
  2. 5 faq.module \faq_menu()
  3. 6 faq.module \faq_menu()
  4. 7 faq.module \faq_menu()

Implements hook_menu().

File

./faq.module, line 79
The FAQ module allows users to create a FAQ page, with questions and answers displayed in different styles, according to the settings.

Code

function faq_menu() {
  $items = array();

  // @todo 7.x-2.x move this to views display
  $items['faq-page'] = array(
    'title' => 'Frequently Asked Questions',
    'page callback' => 'faq_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'view faq page',
    ),
    'weight' => 1,
    'type' => MENU_SUGGESTED_ITEM,
  );

  // @todo 7.x-2.x move this to views display
  $items['faq-page/list'] = array(
    'title' => 'List',
    'page callback' => 'faq_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'view faq page',
    ),
    'weight' => -10,
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );

  // @todo 7.x-2.x move this to views display
  $items['faq-page/order'] = array(
    'title' => 'Order',
    'description' => 'Allows the user to configure the order of questions and answers on a FAQ page.',
    'file' => 'faq.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'faq_order_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer faq order',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -8,
  );

  // @todo 7.x-2.x move this to views display
  $items['faq-page/%'] = array(
    'title' => 'Frequently Asked Questions',
    'page callback' => 'faq_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'view faq page',
    ),
    'type' => MENU_CALLBACK,
  );

  // @todo 7.x-2.x move this to views display
  $items['faq-page/%/list'] = array(
    'title' => 'List',
    'page callback' => 'faq_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'view faq page',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );

  // @todo 7.x-2.x move this to views display
  $items['faq-page/%/order'] = array(
    'title' => 'Order',
    'description' => 'Allows the user to configure the order of questions and answers on a FAQ page.',
    'file' => 'faq.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'faq_order_settings_form',
      1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer faq order',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -8,
  );

  // @todo 7.x-2.x move this to views display
  $items['admin/config/content/faq'] = array(
    'title' => 'Frequently Asked Questions',
    'description' => 'Allows the user to configure the layout of questions and answers on a FAQ page.',
    'file' => 'faq.admin.inc',
    'page callback' => 'faq_settings_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer faq',
    ),
  );
  $items['admin/config/content/faq/general'] = array(
    'title' => 'General',
    'description' => 'Allows the user to configure the header and descriptive text for the FAQ page.',
    'file' => 'faq.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'faq_general_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer faq',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/config/content/faq/questions'] = array(
    'title' => 'Questions',
    'description' => 'Allows the user to configure the layout of questions and answers on a FAQ page.',
    'file' => 'faq.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'faq_questions_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer faq',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -9,
  );
  $items['admin/config/content/faq/categories'] = array(
    'title' => 'Categories',
    'description' => 'Allows the user to configure the layout of questions and answers using categories on a FAQ page.',
    'file' => 'faq.admin.inc',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'faq_categories_settings_form',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer faq',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => -8,
  );
  return $items;
}