You are here

function filebrowser_form_actions in Filebrowser 8

Same name and namespace in other branches
  1. 6.2 filebrowser.form.actions.inc \filebrowser_form_actions()
  2. 7.4 filebrowser.module \filebrowser_form_actions()
  3. 7.2 filebrowser.module \filebrowser_form_actions()
  4. 7.3 filebrowser.module \filebrowser_form_actions()
1 string reference to 'filebrowser_form_actions'
theme_dir_listing_list_view in ./filebrowser.theme.inc
Theming function for list view.

File

./filebrowser.module, line 654
Validates file path input on node form

Code

function filebrowser_form_actions($form, &$form_state, $header, $options, $actions, $node) {
  $form = array();
  $form['#node'] = $node;
  $form['table'] = array(
    '#type' => 'tableselect',
    '#header' => $header,
    '#options' => $options,
    '#multiple' => TRUE,
  );

  // Normally the checkboxes are created by form_process_tableselect(). They are created manually here
  // to have the checkboxes behave the way we want it for filebrowser.

  /*  foreach ($options as $key => $data) {
      $form['table'][$key] = array(
        '#type' => 'checkbox',
        '#title' => $data['fid'],
        //'#title_display' => 'invisible',
        //'#return_value' =>  'foop',
        '#default_value' => 0,
        // disable the checkbox and hide it if this item has no fid (is not a selectable item)
        '#disabled' => empty($data['fid']) ? TRUE : FALSE,
        '#attributes' => empty($data['fid']) ? array('style' => 'display:none;') : '',
        );
    }*/
  $fb_options = array(
    '' => t('choose an action'),
  );
  foreach ($actions as $action) {
    $fb_options[$action['operation']] = $action['title'];
  }
  $form['action'] = array(
    '#prefix' => '<br/><div class="container-inline">',
    '#title' => t('actions'),
    '#type' => 'select',
    '#options' => $fb_options,
  );
  $form['submit'] = array(
    '#value' => t('Process'),
    '#type' => 'submit',
    '#suffix' => '</div><br/>',
  );
  return $form;
}