You are here

function js_injector_menu in JS injector 6

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

Implementation of hook_menu(). Defines menu callbacks for js Injector's configuration pages.

File

./js_injector.module, line 45
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/settings/js_injector' => array(
      'title' => 'js injector',
      'description' => 'Add js (JavaScript Files) 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/settings/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/settings/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/settings/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;
}