You are here

function media_menu in D7 Media 7.4

Same name and namespace in other branches
  1. 6 media.module \media_menu()
  2. 7 media.module \media_menu()
  3. 7.2 media.module \media_menu()
  4. 7.3 media.module \media_menu()

Implements hook_menu().

File

./media.module, line 79
Media API

Code

function media_menu() {

  // For managing different types of media and the fields associated with them.
  $items['admin/config/media/browser'] = array(
    'title' => 'Media browser settings',
    'description' => 'Configure the behavior and display of the media browser.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_admin_config_browser',
    ),
    'access arguments' => array(
      'administer media browser',
    ),
    'file' => 'includes/media.admin.inc',
  );

  // Administrative screens for managing media.
  $items['admin/content/file/thumbnails'] = array(
    'title' => 'Thumbnails',
    'description' => 'Manage files used on your site.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'file_entity_admin_file',
    ),
    'access arguments' => array(
      'administer files',
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'file_entity.admin.inc',
    'file path' => drupal_get_path('module', 'file_entity'),
    'weight' => 10,
  );
  $items['media/ajax'] = array(
    'page callback' => 'media_ajax_upload',
    'delivery callback' => 'ajax_deliver',
    'access arguments' => array(
      'access content',
    ),
    'theme callback' => 'ajax_base_page_theme',
    'type' => MENU_CALLBACK,
  );
  $items['media/browser'] = array(
    'title' => 'Media browser',
    'description' => 'Media Browser for picking media and uploading new media',
    'page callback' => 'media_browser',
    'access arguments' => array(
      'access media browser',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/media.browser.inc',
    'theme callback' => 'media_dialog_get_theme_name',
  );

  // A testbed to try out the media browser with different launch commands.
  $items['media/browser/testbed'] = array(
    'title' => 'Media Browser test',
    'description' => 'Make it easier to test media browser',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_browser_testbed',
    ),
    'access arguments' => array(
      'administer files',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/media.browser.inc',
  );

  // We could re-use the file/%file/edit path for the modal callback, but
  // it is just easier to use our own namespace here.
  $items['media/%file/edit/%ctools_js'] = array(
    'title' => 'Edit',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_file_edit_modal',
      1,
      3,
    ),
    'access callback' => 'file_entity_access',
    'access arguments' => array(
      'update',
      1,
    ),
    'theme callback' => 'ajax_base_page_theme',
    'file' => 'includes/media.pages.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}