You are here

function elfinder_admin_dir_form in elFinder file manager 6.2

Same name and namespace in other branches
  1. 7.3 inc/elfinder.admin.profiles.inc \elfinder_admin_dir_form()
  2. 7.2 inc/elfinder.admin.profiles.inc \elfinder_admin_dir_form()
1 call to elfinder_admin_dir_form()
elfinder_admin_profiles_form in inc/elfinder.admin.profiles.inc
Settings form definition

File

inc/elfinder.admin.profiles.inc, line 50
file manager admin profile settings page

Code

function elfinder_admin_dir_form($delta, $values = array(), $votes = 0) {
  $form = array(
    '#tree' => TRUE,
  );
  $defaultUrl = "";
  $form['volume_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Volume @n settings', array(
      '@n' => $delta + 1,
    )),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );

  // We'll manually set the #parents property of these fields so that
  // their values appear in the $form_state['values']['volume'] array.
  $form['volume_settings']['path'] = array(
    '#type' => 'textfield',
    '#title' => t('Path'),
    '#default_value' => $values['path'],
    '#attributes' => array(
      'class' => 'elfinder-field-volume-path',
    ),
    '#parents' => array(
      'volume',
      $delta,
      'path',
    ),
    '#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
    '#suffix' => '</div>',
    '#size' => 40,
  );
  $form['volume_settings']['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Label'),
    '#size' => 15,
    '#default_value' => $values['label'],
    '#description' => t('Root directory label in directory tree'),
    '#parents' => array(
      'volume',
      $delta,
      'label',
    ),
  );
  $form['volume_settings']['url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#default_value' => isset($values['url']) ? $values['url'] : '',
    '#parents' => array(
      'volume',
      $delta,
      'url',
    ),
    '#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
    '#suffix' => '</div>',
    '#description' => t('Custom URL prefix (default %def)', array(
      '%def' => $defaultUrl,
    )),
    '#size' => 40,
  );
  $form['volume_settings']['delete'] = array(
    '#type' => 'submit',
    '#value' => t('Delete'),
    '#name' => 'rmfield',
    '#ahah' => array(
      'path' => 'elfinder/ahah/rmdir/' . $delta,
      'wrapper' => 'profile-volumes',
      'method' => 'replace',
      'effect' => 'fade',
    ),
  );
  return $form;
}