function ctools_export_ui::list_form
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.
2 calls to ctools_export_ui::list_form()
- ctools_custom_content_ui::list_form in ctools_custom_content/
plugins/ export_ui/ ctools_custom_content_ui.class.php - Create the filter/sort form at the top of a list of exports.
- stylizer_ui::list_form in stylizer/
plugins/ export_ui/ stylizer_ui.class.php - Create the filter/sort form at the top of a list of exports.
2 methods override ctools_export_ui::list_form()
- ctools_custom_content_ui::list_form in ctools_custom_content/
plugins/ export_ui/ ctools_custom_content_ui.class.php - Create the filter/sort form at the top of a list of exports.
- stylizer_ui::list_form in stylizer/
plugins/ export_ui/ stylizer_ui.class.php - Create the filter/sort form at the top of a list of exports.
File
-
plugins/
export_ui/ ctools_export_ui.class.php, line 233
Class
- ctools_export_ui
- Base class for export UI.
Code
public function list_form(&$form, &$form_state) {
// This forces the form to *always* treat as submitted which is
// necessary to make it work.
$form['#token'] = FALSE;
if (empty($form_state['input'])) {
$form["#post"] = TRUE;
}
// Add the 'q' in if we are not using clean URLs or it can get lost when
// using this kind of form.
if (!variable_get('clean_url', FALSE)) {
$form['q'] = array(
'#type' => 'hidden',
'#value' => $_GET['q'],
);
}
$all = array(
'all' => t('- All -'),
);
$form['top row'] = array(
'#prefix' => '<div class="ctools-export-ui-row ctools-export-ui-top-row clearfix">',
'#suffix' => '</div>',
);
$form['bottom row'] = array(
'#prefix' => '<div class="ctools-export-ui-row ctools-export-ui-bottom-row clearfix">',
'#suffix' => '</div>',
);
$form['top row']['storage'] = array(
'#type' => 'select',
'#title' => t('Storage'),
'#options' => $all + array(
t('Normal') => t('Normal'),
t('Default') => t('Default'),
t('Overridden') => t('Overridden'),
),
'#default_value' => 'all',
);
$form['top row']['disabled'] = array(
'#type' => 'select',
'#title' => t('Enabled'),
'#options' => $all + array(
'0' => t('Enabled'),
'1' => t('Disabled'),
),
'#default_value' => 'all',
);
$form['top row']['search'] = array(
'#type' => 'textfield',
'#title' => t('Search'),
);
$form['bottom row']['order'] = array(
'#type' => 'select',
'#title' => t('Sort by'),
'#options' => $this->list_sort_options(),
'#default_value' => 'disabled',
);
$form['bottom row']['sort'] = array(
'#type' => 'select',
'#title' => t('Order'),
'#options' => array(
'asc' => t('Up'),
'desc' => t('Down'),
),
'#default_value' => 'asc',
);
$form['bottom row']['submit'] = array(
'#type' => 'submit',
'#id' => 'ctools-export-ui-list-items-apply',
'#value' => t('Apply'),
'#attributes' => array(
'class' => array(
'use-ajax-submit ctools-auto-submit-click',
),
),
);
$form['bottom row']['reset'] = array(
'#type' => 'submit',
'#id' => 'ctools-export-ui-list-items-reset',
'#value' => t('Reset'),
'#attributes' => array(
'class' => array(
'use-ajax-submit',
),
),
);
$form['#prefix'] = '<div class="clearfix">';
$form['#suffix'] = '</div>';
$form['#attached']['js'] = array(
ctools_attach_js('auto-submit'),
);
$form['#attached']['library'][] = array(
'system',
'drupal.ajax',
);
$form['#attached']['library'][] = array(
'system',
'jquery.form',
);
$form['#attributes'] = array(
'class' => array(
'ctools-auto-submit-full-form',
),
);
}