public function gdpr_fields_ui::list_form in General Data Protection Regulation 7
Create the filter/sort form at the top of a list of exports.
This handles the very default conditions, and most lists are expected to override this and call through to parent::list_form() in order to get the base form and then modify it as necessary to add search gadgets for custom fields.
Overrides ctools_export_ui::list_form
File
- modules/
gdpr_fields/ plugins/ export_ui/ gdpr_fields_ui.class.php, line 287 - Contains the CTools Export UI integration code.
Class
- gdpr_fields_ui
- CTools Export UI class handler for GDPR Fields UI.
Code
public function list_form(&$form, &$form_state) {
parent::list_form($form, $form_state);
// Remove storage filter.
unset($form['top row']['storage']);
// Shrink search field slightly.
$form['top row']['search']['#size'] = 30;
$entities = array();
foreach (entity_get_info() as $key => $entity_info) {
$entities[$key] = $entity_info['label'];
}
$form['top row']['gdpr_entity'] = array(
'#type' => 'select',
'#title' => t('Entity'),
'#options' => $entities,
'#multiple' => TRUE,
'#default_value' => array(),
);
$form['top row']['rta'] = array(
'#type' => 'select',
'#title' => t('Right to access'),
'#options' => $this
->rtaOptions(),
'#multiple' => TRUE,
'#default_value' => array(),
);
$form['top row']['rtf'] = array(
'#type' => 'select',
'#title' => t('Right to be forgotten'),
'#options' => $this
->rtfOptions(),
'#multiple' => TRUE,
'#default_value' => array(),
);
$form['top row']['empty'] = array(
'#type' => 'checkbox',
'#title' => t('Filter out Entities where all fields are not configured'),
'#default_value' => TRUE,
);
$form['bottom row']['submit']['#attributes']['class'] = array();
$form['bottom row']['reset']['#attributes']['class'] = array();
$form['#attached']['library'][] = array(
'system',
'drupal.collapse',
);
}