You are here

function photos_menu in Album Photos 7.3

Same name and namespace in other branches
  1. 6.2 photos.module \photos_menu()

Implements hook_menu().

File

./photos.module, line 11
Implementation of photos.module.

Code

function photos_menu() {
  $items['photos/image/%'] = array(
    'page callback' => 'photos_image_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageView',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.image.inc',
  );
  $items['photos/image/%/vote/%'] = array(
    'page callback' => 'photos_image_vote',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageView',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.image.inc',
  );
  $items['photos/image/update'] = array(
    'page callback' => 'photos_edit_update',
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
    'access arguments' => array(
      'create photo',
    ),
  );
  $items['photos/image/update/load'] = array(
    'page callback' => 'photos_edit_update_load',
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
    'access arguments' => array(
      'create photo',
    ),
  );
  $items['photos/image/%/to_sub'] = array(
    'title' => 'Add to sub-album',
    'page callback' => 'photos_edit_to_sub',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageEdit',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
  );
  $items['photos/image/%/delete'] = array(
    'page callback' => 'photos_edit_delete',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageDelete',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
  );
  $items['photos/image/%/edit'] = array(
    'page callback' => '_photos_edit_page_single_image',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageEdit',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
  );
  if (variable_get('photos_access_photos', 1)) {
    $items['photos/get/%/%'] = array(
      'page callback' => 'photos_image_get',
      'page arguments' => array(
        2,
        3,
      ),
      'access callback' => '_photos_access',
      'access arguments' => array(
        'imageView',
        2,
      ),
      'type' => MENU_CALLBACK,
      'file' => 'inc/photos.image.inc',
    );
  }
  $items['photos/album/%node'] = array(
    'page callback' => 'photos_album_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'album',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.album.inc',
  );
  $items['photos/sub_album/%node'] = array(
    'page callback' => 'photos_sub_album_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'subAlbum',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.album.inc',
  );
  $items['photos/album/%node/share'] = array(
    'title' => 'Share code',
    'page callback' => 'photos_album_share',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'album',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.album.inc',
  );
  $items['photos/sub_album/%node/share'] = array(
    'title' => 'Share code',
    'page callback' => 'photos_album_share',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'subAlbum',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.album.inc',
  );
  $items['node/%node/photos'] = array(
    'title' => 'Images Management',
    'page callback' => 'photos_edit_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'editAlbum',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'inc/photos.edit.inc',
  );
  $items['node/%node/photos-sort'] = array(
    'title' => 'Re-arrange',
    'page callback' => 'photos_edit_sort_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'editAlbum',
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'inc/photos.edit.inc',
  );
  $items['node/%node/photos/cover/%'] = array(
    'page callback' => 'photos_edit_cover',
    'page arguments' => array(
      1,
      4,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
  );
  $items['photos/zoom/%'] = array(
    'page callback' => 'photos_down_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageView',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.down.inc',
  );
  $items['photos/zoom/%/original'] = array(
    'page callback' => 'photos_down_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'imageOrig',
      2,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.down.inc',
  );
  $items['admin/config/media/photos'] = array(
    'title' => 'Album photos',
    'description' => 'Configure global album photos settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'photos_admin_settings',
    ),
    'access arguments' => array(
      'administer nodes',
    ),
    'file' => 'photos.admin.inc',
    'file path' => drupal_get_path('module', 'photos') . '/inc',
  );
  $items['admin/config/media/photos/settings'] = array(
    'title' => 'Photos',
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['photos/data/user/%user'] = array(
    'page callback' => 'photos_data_user_slide',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'view photo',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.data.inc',
  );
  $items['photos/data/sub_album/%node/block_new'] = array(
    'page callback' => 'photos_data_sub_block_slide',
    'page arguments' => array(
      3,
      4,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'view',
      3,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.data.inc',
  );
  $items['photos/data/sub_album/%node'] = array(
    'page callback' => 'photos_data_album',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'view',
      3,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.data.inc',
  );
  $items['photos/data/album/%node'] = array(
    'page callback' => 'photos_data_album',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'view',
      3,
    ),
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.data.inc',
  );
  $items['photos'] = array(
    'title' => 'Album photos',
    'page callback' => 'photos_page_default',
    'access arguments' => array(
      'view photo',
    ),
    'file' => 'inc/photos.page.inc',
  );
  $items['photos/image'] = array(
    'title' => 'Recent images',
    'page callback' => 'photos_page_image',
    'access arguments' => array(
      'view photo',
    ),
    'file' => 'inc/photos.page.inc',
  );
  $items['photos/album'] = array(
    'title' => 'Recent albums',
    'page callback' => 'photos_page_album',
    'access arguments' => array(
      'view photo',
    ),
    'file' => 'inc/photos.page.inc',
  );
  $items['photos/user/%user_uid_optional/image'] = array(
    'title' => 'My images',
    'title callback' => 'photos_page_title',
    'title arguments' => array(
      2,
      t('images'),
    ),
    'page callback' => 'photos_page_image',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'viewUser',
      2,
    ),
    'file' => 'inc/photos.page.inc',
  );
  $items['photos/user/%user_uid_optional/album'] = array(
    'title' => 'My albums',
    'title callback' => 'photos_page_title',
    'title arguments' => array(
      2,
      t('albums'),
    ),
    'page callback' => 'photos_page_album',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'viewUser',
      2,
    ),
    'file' => 'inc/photos.page.inc',
  );
  $items['photos/user/%user_uid_optional/album-sort'] = array(
    'title' => 'Re-arrange My Albums',
    'page callback' => 'photos_edit_sort_album_page',
    'page arguments' => array(
      2,
    ),
    'access callback' => '_photos_access',
    'access arguments' => array(
      'viewUser',
      2,
    ),
    // @todo update argument
    'type' => MENU_CALLBACK,
    'file' => 'inc/photos.edit.inc',
  );
  if (variable_get('photos_slide', 0) && module_exists('dfgallery')) {
    $items['photos/user/%user_uid_optional/slide'] = array(
      'title' => 'My slide',
      'title callback' => 'photos_page_title',
      'title arguments' => array(
        2,
        t('slide'),
      ),
      'page callback' => 'photos_page_slide',
      'page arguments' => array(
        2,
      ),
      'access callback' => '_photos_access',
      'access arguments' => array(
        'viewUser',
        2,
      ),
      'file' => 'inc/photos.data.inc',
    );
    $items['photos/album/%node/slide'] = array(
      'page callback' => 'photos_album_slide',
      'page arguments' => array(
        2,
      ),
      'access callback' => '_photos_access',
      'access arguments' => array(
        'album',
        2,
      ),
      'type' => MENU_CALLBACK,
      'file' => 'inc/photos.album.inc',
    );
    $items['photos/sub_album/%node/slide'] = array(
      'page callback' => 'photos_album_slide',
      'page arguments' => array(
        2,
      ),
      'access callback' => '_photos_access',
      'access arguments' => array(
        'subAlbum',
        2,
      ),
      'type' => MENU_CALLBACK,
      'file' => 'inc/photos.album.inc',
    );
  }
  $items['photos/share'] = array(
    'title' => 'Share code',
    'page callback' => 'photos_share',
    'access arguments' => array(
      'create photo',
    ),
    'file' => 'inc/photos.page.inc',
  );
  $items['photos/upload'] = array(
    'title' => 'Image upload',
    'page callback' => 'photos_edit_upload',
    'access arguments' => array(
      'create photo',
    ),
    'file' => 'inc/photos.edit.inc',
    'weight' => 9,
  );
  if (variable_get('photos_upzip', 0)) {
    $items['photos/import'] = array(
      'title' => 'Import ZIP',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'photos_admin_import',
      ),
      'access arguments' => array(
        'administer nodes',
      ),
      'weight' => 10,
      'file' => 'inc/photos.admin.inc',
    );
  }
  $items['photos/ajax'] = array(
    'title' => 'Photos ajax helper',
    'page callback' => '_photos_ajax_helper',
    'access arguments' => array(
      'create photo',
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}