You are here

function filefield_source_imce_settings in FileField Sources 6

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

Implements hook_filefield_source_settings().

File

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

Code

function filefield_source_imce_settings($op, $field) {
  $return = array();
  if ($op == 'form') {
    $return['sources_imce'] = array(
      '#title' => t('IMCE file browser settings'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#access' => module_exists('imce'),
    );
    $return['sources_imce']['filefield_source_imce_mode'] = array(
      '#type' => 'radios',
      '#title' => t('File browser mode'),
      '#options' => array(
        0 => t('Restricted: Users can only browse the field directory. No file operations are allowed.'),
        1 => t('Full: Browsable directories are defined by <a href="!imce-admin-url">IMCE configuration profiles</a>. File operations are allowed for IMCE 6.x-2.x or above.', array(
          '!imce-admin-url' => url('admin/settings/imce'),
        )),
      ),
      '#default_value' => isset($field['filefield_source_imce_mode']) ? $field['filefield_source_imce_mode'] : 0,
    );
  }
  elseif ($op == 'save') {
    $return[] = 'filefield_source_imce_mode';
  }
  return $return;
}