function media_acquiadam_menu in Media: Acquia DAM 7
Implements hook_menu().
File
- ./
media_acquiadam.module, line 14
Code
function media_acquiadam_menu() {
$items = [];
$items['admin/config/media/acquiadam'] = [
'title' => 'Media: Acquia DAM settings',
'description' => 'Configure the API settings for Acquia DAM.',
'page callback' => 'drupal_get_form',
'page arguments' => [
'media_acquiadam_config_settings',
],
'access arguments' => [
'administer media acquiadam',
],
'file path' => drupal_get_path('module', 'media_acquiadam') . '/includes',
'file' => 'media_acquiadam.admin.inc',
];
$items['acquiadam/asset/%media_acquiadam_asset'] = [
'title' => 'Acquia DAM Asset',
'description' => 'Redirect to an available asset download link.',
'page callback' => 'media_acquiadam_download_redirect_page',
'page arguments' => [
2,
],
'access callback' => 'media_acquiadam_asset_access',
'access arguments' => [
'view',
2,
],
'file path' => drupal_get_path('module', 'media_acquiadam') . '/includes',
'file' => 'media_acquiadam.pages.inc',
'type' => MENU_CALLBACK,
];
$directory_path = file_stream_wrapper_get_instance_by_scheme(file_default_scheme())
->getDirectoryPath();
$pos = count(explode('/', $directory_path)) + 1;
$items[$directory_path . '/styles/%/acquiadam/%/%media_acquiadam_asset'] = [
'title' => 'Acquia DAM Asset derivative',
'page callback' => 'media_acquiadam_image_style_deliver',
'page arguments' => [
$pos,
$pos + 3,
],
'load arguments' => [
$pos + 2,
],
'access callback' => 'media_acquiadam_asset_access',
'access arguments' => [
'view',
$pos + 3,
],
'file path' => drupal_get_path('module', 'media_acquiadam') . '/includes',
'file' => 'media_acquiadam.image.inc',
'type' => MENU_CALLBACK,
];
$items['file/%file/dam-refresh'] = [
'title' => 'Force refresh from Acquia DAM',
'description' => 'Updates the Acquia DAM asset from the remote DAM source.',
'page callback' => 'media_acquiadam_dam_refresh_page',
'page arguments' => [
1,
],
'access callback' => 'file_entity_access',
'access arguments' => [
'refresh',
1,
],
'file path' => drupal_get_path('module', 'media_acquiadam') . '/includes',
'file' => 'media_acquiadam.pages.inc',
'type' => MENU_LOCAL_ACTION,
];
$items['file/%file/dam-view'] = [
'title' => 'View in Acquia DAM',
'description' => 'Directs the user to the asset inside Acquia DAM.',
'page callback' => 'media_acquiadam_dam_view_page',
'page arguments' => [
1,
],
'access callback' => 'file_entity_access',
'access arguments' => [
'view',
1,
],
'file path' => drupal_get_path('module', 'media_acquiadam') . '/includes',
'file' => 'media_acquiadam.pages.inc',
'type' => MENU_LOCAL_ACTION,
];
$items['user/%user/acquiadam/deauth'] = [
'title' => 'Clear DAM access token',
'description' => 'Removes the current users DAM OAuth2 access token.',
'page callback' => 'media_acquiadam_deauth_page',
'access arguments' => [
'view acquiadam assets',
],
'file' => 'includes/media_acquiadam.pages.inc',
'type' => MENU_LOCAL_ACTION,
];
return $items;
}