You are here

function elfinder_menu in elFinder file manager 7

Same name and namespace in other branches
  1. 6.2 elfinder.module \elfinder_menu()
  2. 6 elfinder.module \elfinder_menu()
  3. 7.3 elfinder.module \elfinder_menu()
  4. 7.2 elfinder.module \elfinder_menu()

Implements hook_menu().

File

./elfinder.module, line 10

Code

function elfinder_menu() {
  $items = array();
  $access = array(
    'use file manager',
  );
  $items['admin/content/files'] = array(
    'title' => 'Files',
    'page callback' => 'elfinder_file_browser',
    'page arguments' => array(
      'backend',
    ),
    'description' => 'Manage media files.',
    'access arguments' => $access,
  );
  $items['admin/content/files']['type'] = MENU_LOCAL_TASK;
  $items['elfinder'] = array(
    'title' => 'File browser',
    'page callback' => 'elfinder_file_browser',
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $items['elfinder/connector'] = array(
    'title' => 'File browser',
    'page callback' => 'elfinder_filesystemconnector',
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );

  // Forced connector relative url mode. For filefield_sources support.
  $items['elfinder/connector/relative'] = array(
    'title' => 'File browser',
    'page callback' => 'elfinder_filesystemconnector',
    'page arguments' => array(
      'relative',
    ),
    'access arguments' => $access,
    'type' => MENU_CALLBACK,
  );
  $settings_page = array(
    'title' => 'elFinder',
    'description' => 'elFinder file manager settings',
    'page callback' => 'elfinder_admin',
    'access arguments' => array(
      'administer file manager',
    ),
    'file' => 'inc/elfinder.admin.inc',
  );
  $items['admin/config/elfinder'] = $items['admin/config/media/elfinder'] = $settings_page;
  $items['admin/config/elfinder']['type'] = MENU_CALLBACK;

  /* Getting updated menu items from hook_elfinder_menu */
  $newitems = module_invoke_all('elfinder_menu', $items);
  return $newitems ? $newitems : $items;
}