You are here

function js_injector_menu in JS injector 7

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

Implements hook_menu(). Defines menu callbacks for JS Injector's configuration pages.

File

./js_injector.module, line 81
Allows administrators to inject JS into the page output based on configurable rules. Useful for adding simple JS tweaks without modifying a site's official theme.

Code

function js_injector_menu() {
  $items = array(
    'admin/config/development/js-injector' => array(
      'title' => 'JS injector',
      'description' => 'Add JS to the page output based on configurable rules.',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'js_injector_admin_form',
      ),
      'access arguments' => array(
        'administer js injection',
      ),
      'file' => 'js_injector.admin.inc',
    ),
    'admin/config/development/js-injector/edit' => array(
      'title' => 'Edit JS injector rule',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'js_injector_edit',
      ),
      'access arguments' => array(
        'administer js injection',
      ),
      'file' => 'js_injector.admin.inc',
      'type' => MENU_CALLBACK,
    ),
    'admin/config/development/js-injector/add' => array(
      'title' => 'Add JS injector rule',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'js_injector_edit',
      ),
      'access arguments' => array(
        'administer js injection',
      ),
      'file' => 'js_injector.admin.inc',
      'type' => MENU_CALLBACK,
    ),
    'admin/config/development/js-injector/delete' => array(
      'title' => 'Delete JS injector rule',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'js_injector_delete_confirm',
      ),
      'access arguments' => array(
        'administer js injection',
      ),
      'file' => 'js_injector.admin.inc',
      'type' => MENU_CALLBACK,
    ),
  );
  return $items;
}