Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.382 diff -u -p -r1.382 form.inc --- includes/form.inc 10 Oct 2009 16:48:37 -0000 1.382 +++ includes/form.inc 13 Oct 2009 03:08:18 -0000 @@ -2277,6 +2277,36 @@ function form_process_tableselect($eleme } /** + * Expand table row operation links into multiple sub-elements. + * + * @param $element + * An associative array forming a table row. If the key '#operations' exists, + * its value is expected to be an associative array, whose keys are the + * element keys to create, and whose values are each an associative array that + * forms the arguments to l() by using the keys: + * - text: The link text to pass as argument to l(). + * - path: The path to pass as argument to l(). + * - options: (optional) An associative array of options to pass to l(). + * See l() for more information on these arguments. + * + * @return + * The processed $element. + */ +function form_process_operations($element) { + if (isset($element['#operations']) && is_array($element['#operations'])) { + foreach ($element['#operations'] as $key => $link) { + if (!isset($element[$key]) && isset($link['text']) && isset($link['path'])) { + $link += array('options' => array()); + $element[$key] = array( + '#markup' => l($link['text'], $link['path'], $link['options']), + ); + } + } + } + return $element; +} + +/** * Adds fieldsets to the specified group or adds group members to this * fieldset. * Index: modules/filter/filter.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v retrieving revision 1.48 diff -u -p -r1.48 filter.admin.inc --- modules/filter/filter.admin.inc 9 Oct 2009 00:59:58 -0000 1.48 +++ modules/filter/filter.admin.inc 13 Oct 2009 03:02:34 -0000 @@ -32,9 +32,14 @@ function filter_admin_overview($form) { $roles_markup = $roles ? implode(', ', $roles) : t('No roles may use this format'); } $form['formats'][$id]['roles'] = array('#markup' => $roles_markup); - $form['formats'][$id]['configure'] = array('#markup' => l(t('configure'), 'admin/config/content/formats/' . $id)); - $form['formats'][$id]['delete'] = array('#markup' => $form['formats'][$id]['#is_fallback'] ? '' : l(t('delete'), 'admin/config/content/formats/' . $id . '/delete')); $form['formats'][$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight); + $form['formats'][$id]['#process'] = array('form_process_operations'); + $form['formats'][$id]['#operations'] = array( + 'configure' => array('text' => t('configure'), 'path' => 'admin/config/content/formats/' . $id), + ); + if (!$form['formats'][$id]['#is_fallback']) { + $form['formats'][$id]['#operations']['delete'] = array('text' => t('delete'), 'path' => 'admin/config/content/formats/' . $id . '/delete'); + } } $form['submit'] = array('#type' => 'submit', '#value' => t('Save changes')); return $form;