You are here

function filefield_source_imce_page in FileField Sources 6

Same name and namespace in other branches
  1. 7 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 185
A FileField extension to allow referencing of files from IMCE.

Code

function filefield_source_imce_page($content_type, $field_name) {
  global $conf;

  // Check access.
  if (!module_exists('imce') || !imce_access() || !($field = content_fields($field_name, $content_type))) {
    return drupal_access_denied();
  }

  // Full mode
  if (!empty($field['widget']['filefield_source_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;
  }

  // Disable absolute URLs.
  $conf['imce_settings_absurls'] = 0;

  // IMCE 6.x-2.x.
  if (module_hook('imce', 'file_references')) {
    module_load_include('inc', 'imce', 'inc/imce.page');
    return imce();
  }
  else {
    module_load_include('inc', 'imce', 'inc/page');
    return imce_page();
  }
}