You are here

function faq_ask_menu in FAQ_Ask 7

Same name and namespace in other branches
  1. 6.2 faq_ask.module \faq_ask_menu()
  2. 6 faq_ask.module \faq_ask_menu()

Implements hook_menu().

Return value

array Menu structure for the various menus defined for the faq_ask module

File

./faq_ask.module, line 117
This module is an add-on to the FAQ module that allows users with the 'ask question' permission to create a question which will be queued for an 'expert' to answer.

Code

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

  // Issue #1348430: taecelle: Can't see the settings tab
  // Changed the path to the correct location
  $items['admin/config/content/faq/ask'] = array(
    'title' => 'Experts',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'faq_ask_settings_form',
    ),
    'access arguments' => array(
      'administer faq',
    ),
    'description' => 'Allows the user to configure the Ask_FAQ module.',
    'type' => MENU_LOCAL_TASK,
    'weight' => -7,
  );

  /*
    $items['admin/config/content/faq/ask/test'] = array(
      'title' => 'Experts',
      'page callback' => 'drupal_get_form',
      'page arguments' => array('faq_ask_test_form'),
      'access arguments' => array('administer faq'),
      'description' => 'Just for testing purpouses.',
      'type' => MENU_LOCAL_TASK,
      'weight' => -7,
      );
  */
  $items['faq_ask'] = array(
    'title' => 'Ask a question',
    'page callback' => 'faq_ask_page',
    'access callback' => 'user_access',
    'access arguments' => array(
      'ask question',
    ),
    'weight' => 1,
  );
  $items['faq_ask/%'] = array(
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'ask question',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['faq_ask/answer/%node'] = array(
    'title' => 'Answer a question',
    'page callback' => 'faq_ask_answer',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['faq_ask/edit/%node'] = array(
    'title' => 'Edit a question',
    'page callback' => 'faq_ask_edit',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['faq_ask/unanswered'] = array(
    'title' => 'List more unanswered questions',
    'page callback' => 'faq_ask_list_more',
    'access callback' => 'faq_ask_user_access_or',
    'access arguments' => array(
      'answer question',
      'ask question',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}