You are here

function site_verify_menu in Site verification 7.2

Same name and namespace in other branches
  1. 6 site_verify.module \site_verify_menu()
  2. 7 site_verify.module \site_verify_menu()

Implements hook_menu().

File

./site_verify.module, line 13
Site Verify provides a tool for verification codes (meta tags or custom pages) to be added to the site, for verification with external search engines.

Code

function site_verify_menu() {

  // List all verification records.
  $items['admin/config/search/verifications'] = array(
    'title' => 'Verifications',
    'description' => 'Add, change or remove verifications for your site.',
    'page callback' => 'site_verify_list',
    'access arguments' => array(
      'administer site verify',
    ),
    'file' => 'site_verify.admin.inc',
  );

  // Add a verification record.
  $items['admin/config/search/verifications/add'] = array(
    'title' => 'Add verification',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'site_verify_edit_form',
    ),
    'access arguments' => array(
      'administer site verify',
    ),
    'file' => 'site_verify.admin.inc',
    'type' => MENU_LOCAL_ACTION,
  );
  $items['admin/config/search/verifications/add/%site_verify_engine'] = array(
    'title' => 'Add',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'site_verify_edit_form',
      array(),
      5,
    ),
    'access arguments' => array(
      'administer site verify',
    ),
    'file' => 'site_verify.admin.inc',
  );
  $items['admin/config/search/verifications/%site_verify/edit'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'site_verify_edit_form',
      4,
    ),
    'access arguments' => array(
      'administer site verify',
    ),
    'file' => 'site_verify.admin.inc',
  );
  $items['admin/config/search/verifications/%site_verify/delete'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'site_verify_delete_form',
      4,
    ),
    'access arguments' => array(
      'administer site verify',
    ),
    'file' => 'site_verify.admin.inc',
  );

  // Add the verification paths.
  $verifications = db_query("SELECT svid, file FROM {site_verify} WHERE file <> ''")
    ->fetchAll();
  foreach ($verifications as $verification) {
    $items[$verification->file] = array(
      'page callback' => 'site_verify_output',
      'page arguments' => array(
        (string) $verification->svid,
      ),
      'access callback' => TRUE,
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}