| Versionen | |
|---|---|
| drupal6 – drupal7 | filter_admin_order(&$form_state, $format = NULL) |
Build the form for ordering filters for a format.
modules/
<?php
function filter_admin_order(&$form_state, $format = NULL) {
// Get list (with forced refresh).
$filters = filter_list_format($format->format);
$form['weights'] = array('#tree' => TRUE);
foreach ($filters as $id => $filter) {
$form['names'][$id] = array('#markup' => $filter->name);
$form['weights'][$id] = array('#type' => 'weight', '#default_value' => $filter->weight);
}
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
$form['submit'] = array('#type' => 'submit', '#value' => t('Save configuration'));
return $form;
}
?>
Kommentare
Kommentar hinzufügen