You are here

function media_menu in D7 Media 7

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

Implement of hook_menu().

File

./media.module, line 98
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',
    ),
    'file' => 'includes/media.admin.inc',
  );

  // For managing different types of media and the fields associated with them.
  $items['admin/config/media/rebuild_types'] = array(
    'title' => 'Rebuild type information for media',
    'description' => 'In case there are files in file_managed w/o a type, this function rebuilds them',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_admin_rebuild_types_form',
    ),
    'access arguments' => array(
      'administer media',
    ),
    'file' => 'includes/media.admin.inc',
  );

  // Settings used for determining the type of media a file is.
  // @todo Find a new home for this that integrates with the file_entity module.
  //  $items['admin/config/media/types/manage/%media_type'] = array(
  //    'title' => 'Manage media',
  //    'title callback' => 'media_type_page_title',
  //    'title arguments' => array(5),
  //    'description' => 'Manage files used on your site.',
  //    'page callback' => 'drupal_get_form',
  //    'page arguments' => array('media_admin_type_manage_form', 5),
  //    'access arguments' => array('administer media'),
  //    'file' => 'includes/media.admin.inc',
  //  );
  //  $items['admin/config/media/types/manage/%media_type/settings'] = array(
  //    'title' => 'Settings',
  //    'type' => MENU_DEFAULT_LOCAL_TASK,
  //    'weight' => -1,
  //  );
  // Administrative screens for managing media.
  $items['admin/content/media'] = array(
    'title' => 'Media',
    'description' => 'Manage files used on your site.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_admin',
    ),
    'access arguments' => array(
      'administer media',
    ),
    'type' => MENU_LOCAL_TASK | MENU_NORMAL_ITEM,
    'file' => 'includes/media.admin.inc',
  );

  // Used to import files from a local filesystem into Drupal.
  $items['admin/content/media/import'] = array(
    'title' => 'Import media',
    'description' => 'Import files into your media library.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_import',
    ),
    'access arguments' => array(
      'import media',
    ),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'includes/media.admin.inc',
  );
  $items['media/browser'] = array(
    'title' => 'Media browser',
    'description' => 'Media Browser for picking media and uploading new media',
    'page callback' => 'media_browser',
    'access callback' => 'media_access',
    'access arguments' => array(
      'view',
    ),
    '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 media',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/media.browser.inc',
  );

  /**
   * Browser callbacks
   * @var unknown_type
   */
  $items['media/browser/list'] = array(
    'title' => 'Media browser list',
    'description' => 'Ajax Callback for getting media',
    'page callback' => 'media_browser_list',
    'access callback' => 'media_access',
    'access arguments' => array(
      'view',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/media.browser.inc',
  );
  $items['media/browser/library'] = array(
    'title' => 'Media browser library',
    'description' => 'Media Browser for picking media and uploading new media',
    'page callback' => 'media_browser_library',
    'access callback' => 'media_access',
    'access arguments' => array(
      'view',
    ),
    'type' => MENU_CALLBACK,
    'file' => 'includes/media.browser.inc',
  );
  $items['media/%file/format-form'] = array(
    'title' => 'Style selector',
    'description' => 'Choose a format for a piece of media',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'media_format_form',
      1,
    ),
    'access callback' => 'media_access',
    'access arguments' => array(
      'view',
    ),
    'weight' => 0,
    'file' => 'includes/media.filter.inc',
    'theme callback' => 'media_dialog_get_theme_name',
  );
  $items['media/%file'] = array(
    'page callback' => 'media_view_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'media_access',
    'access arguments' => array(
      'view',
    ),
    'file' => 'includes/media.pages.inc',
  );
  $items['media/%file/view'] = array(
    'title' => 'View',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['media/%file/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'media_page_edit',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'media_access',
    'access arguments' => array(
      'edit',
    ),
    'weight' => 0,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'file' => 'includes/media.pages.inc',
  );
  $items['media/%media_multi/multiedit'] = array(
    'title' => 'Multi Edit',
    'page callback' => 'media_page_multiedit',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'media_access',
    'access arguments' => array(
      'edit',
    ),
    'weight' => 0,
    'file' => 'includes/media.pages.inc',
  );
  $items['media/%file/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'media_page_delete',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'media_access',
    'access arguments' => array(
      'edit',
    ),
    'weight' => 1,
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    'file' => 'includes/media.pages.inc',
  );
  return $items;
}