You are here

public function elFinderProfileForm::volumeForm in elFinder file manager 8.2

1 call to elFinderProfileForm::volumeForm()
elFinderProfileForm::form in src/Form/elFinderProfileForm.php
Gets the actual form array to be built.

File

src/Form/elFinderProfileForm.php, line 288
Contains \Drupal\elfinder\Form\elFinderProfileForm.

Class

elFinderProfileForm
Base form for elFinder Profile entities.

Namespace

Drupal\elfinder\Form

Code

public function volumeForm($delta, array $values = array()) {
  $values += array(
    'path' => '',
    'label' => '',
    'url' => '',
  );
  $form = array(
    '#type' => 'fieldset',
    '#attributes' => array(
      'class' => array(
        'folder-container',
      ),
    ),
    '#title' => $this
      ->t('Volume @n (@p)', array(
      '@n' => $delta + 1,
      '@p' => $values['path'],
    )),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['path'] = array(
    '#type' => 'textfield',
    '#title' => $this
      ->t('Path'),
    '#default_value' => isset($values['path']) ? $values['path'] : '',
    '#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
    '#suffix' => '</div>',
    '#size' => 40,
  );
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => $this
      ->t('Label'),
    '#size' => 15,
    '#default_value' => isset($values['label']) ? $values['label'] : '',
    '#description' => $this
      ->t('Root directory label in directory tree'),
  );
  $form['url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#default_value' => isset($values['url']) ? $values['url'] : '',
    '#prefix' => '<div class="elfinder-field-wrapper-volume-path">',
    '#suffix' => '</div>',
    '#description' => $this
      ->t('Custom URL prefix (default %def)', array(
      '%def' => $defaulturl,
    )),
    '#size' => 40,
  );
  return $form;
}