You are here

function imagecrop_menu in Image javascript crop 5

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

Implementation of hook_menu().

File

./imagecrop.module, line 21
Provides a javascript toolbox through an imagecache action.

Code

function imagecrop_menu($may_cache) {
  $items = array();
  $access_crop = user_access('crop images with toolbox');
  $access_settings = user_access('administer imagecrop');
  if ($may_cache) {
    $items[] = array(
      'title' => t('Imagecache javascript crop'),
      'path' => 'admin/settings/imagecrop',
      'callback' => 'drupal_get_form',
      'callback arguments' => 'imagecrop_settings',
      'access' => $access_settings,
    );
    $items[] = array(
      'path' => 'imagecrop/showcrop',
      'callback' => 'imagecrop_showcrop',
      'type' => MENU_CALLBACK,
      'access' => $access_crop,
    );
    $items[] = array(
      'path' => 'imagecrop/docrop',
      'callback' => 'imagecrop_docrop',
      'type' => MENU_CALLBACK,
      'access' => $access_crop,
    );
  }
  return $items;
}