You are here

function filefield_source_imce_page in FileField Sources 7

Same name and namespace in other branches
  1. 6 sources/imce.inc \filefield_source_imce_page()

Outputs the IMCE browser for FileField.

1 string reference to 'filefield_source_imce_page'
filefield_source_imce_menu in sources/imce.inc
Implements hook_menu().

File

sources/imce.inc, line 197
A FileField extension to allow referencing of files from IMCE.

Code

function filefield_source_imce_page($entity_type, $bundle_name, $field_name) {
  global $conf;

  // Check access.
  if (!module_exists('imce') || !imce_access() || !($instance = field_info_instance($entity_type, $field_name, $bundle_name))) {
    return drupal_access_denied();
  }
  $field = field_info_field($field_name);

  // Full mode
  if (!empty($instance['widget']['settings']['filefield_sources']['source_imce']['imce_mode'])) {
    $conf['imce_custom_scan'] = 'filefield_source_imce_custom_scan_full';
  }
  else {
    $conf['imce_custom_scan'] = 'filefield_source_imce_custom_scan_restricted';
    $conf['imce_custom_field'] = $field + array(
      '_uri' => file_field_widget_uri($field, $instance),
    );
  }

  // Disable absolute URLs.
  $conf['imce_settings_absurls'] = 0;
  module_load_include('inc', 'imce', 'inc/imce.page');
  return imce($field['settings']['uri_scheme']);
}