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:38:58 -0000
@@ -2651,6 +2651,28 @@ function form_process_weight($element) {
 }
 
 /**
+ * Add markup elements with rendered links from the structured data in #links.
+ * This is used where it's not desired for the links to be themed using
+ * #theme = 'links' or a custom theme function, but it's still desired for
+ * modules to alter the link information prior to the l() call. In this case,
+ * modules would alter within hook_form_alter() or some other function that runs
+ * prior to the element's #process functions.
+ *
+ * The most common use case for this is for handling the "operations" links on
+ * administrative pages where using #theme would incur too much performance
+ * overhead and be difficult to achieve the desired layout within a table.
+ */
+function form_process_links($element) {
+  if (!empty($element['#links'])) {
+    foreach ($element['#links'] as $key => $link) {
+      // @see theme_links() for documentation about the keys within $link.
+      $element[$key]['#markup'] = isset($link['title']) ? l($link['title'], $link['href'], $link) : '';
+    }
+  }
+  return $element;
+}
+
+/**
  * Theme a file upload form element.
  *
  * @param $variables
Index: modules/block/block.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.admin.inc,v
retrieving revision 1.58
diff -u -p -r1.58 block.admin.inc
--- modules/block/block.admin.inc	30 Sep 2009 13:09:29 -0000	1.58
+++ modules/block/block.admin.inc	13 Oct 2009 03:38:59 -0000
@@ -63,16 +63,17 @@ function block_admin_display_form($form,
       '#default_value' => $block['region'],
       '#options' => $block_regions,
     );
-    $form[$key]['configure'] = array(
-      '#markup' => l(t('configure'),
-      'admin/structure/block/configure/' . $block['module'] . '/' . $block['delta']),
+    $form[$key]['#links']['configure'] = array(
+      'title' => t('configure'),
+      'href' => 'admin/structure/block/configure/' . $block['module'] . '/' . $block['delta'],
     );
     if ($block['module'] == 'block') {
-      $form[$key]['delete'] = array(
-        '#markup' => l(t('delete'),
-        'admin/structure/block/delete/' . $block['delta']),
+      $form[$key]['#links']['delete'] = array(
+        'title' => t('delete'),
+        'href' => 'admin/structure/block/delete/' . $block['delta'],
       );
     }
+    $form[$key]['#process'][] = 'form_process_links';
   }
   // Do not allow disabling the main system content block.
   unset($form['system_main']['region']['#options'][BLOCK_REGION_NONE]);
Index: modules/field_ui/field_ui.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/field_ui/field_ui.admin.inc,v
retrieving revision 1.22
diff -u -p -r1.22 field_ui.admin.inc
--- modules/field_ui/field_ui.admin.inc	9 Oct 2009 00:59:57 -0000	1.22
+++ modules/field_ui/field_ui.admin.inc	13 Oct 2009 03:38:59 -0000
@@ -106,18 +106,29 @@ function field_ui_field_overview_form($f
       'field_name' => array(
         '#markup' => $instance['field_name'],
       ),
-      'type' => array(
-        '#markup' => l(t($field_types[$field['type']]['label']), $admin_field_path . '/field-settings', array('attributes' => array('title' => t('Edit field settings.')))),
-      ),
-      'widget_type' => array(
-        '#markup' => l(t($widget_types[$instance['widget']['type']]['label']), $admin_field_path . '/widget-type', array('attributes' => array('title' => t('Change widget type.')))),
-      ),
-      'edit' => array(
-        '#markup' => l(t('edit'), $admin_field_path, array('attributes' => array('title' => t('Edit instance settings.')))),
+      '#links' => array(
+        'type' => array(
+          'title' => t($field_types[$field['type']]['label']),
+          'href' => $admin_field_path . '/field-settings',
+          'attributes' => array('title' => t('Edit field settings.')),
+        ),
+        'widget_type' => array(
+          'title' => t($widget_types[$instance['widget']['type']]['label']),
+          'href' => $admin_field_path . '/widget-type',
+          'attributes' => array('title' => t('Change widget type.')),
+        ),
+        'edit' => array(
+          'title' => t('edit'),
+          'href' => $admin_field_path,
+          'attributes' => array('title' => t('Edit instance settings.')),
+        ),
+        'delete' => array(
+          'title' => t('delete'),
+          'href' => $admin_field_path . '/delete',
+          'attributes' => array('title' => t('Delete instance.')),
+        ),
       ),
-      'delete' => array(
-        '#markup' => l(t('delete'), $admin_field_path . '/delete', array('attributes' => array('title' => t('Delete instance.')))),
-       ),
+      '#process' => array('form_process_links'),
       'weight' => array(
         '#type' => 'textfield',
         '#default_value' => $weight,
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:38:59 -0000
@@ -32,8 +32,9 @@ 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]['#links']['configure'] = array('title' => t('configure'), 'href' => 'admin/config/content/formats/' . $id);
+    $form['formats'][$id]['#links']['delete'] = $form['formats'][$id]['#is_fallback'] ? array() : array('title' => t('delete'), 'href' => 'admin/config/content/formats/' . $id . '/delete');
+    $form['formats'][$id]['#process'][] = 'form_process_links';
     $form['formats'][$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
   }
   $form['submit'] = array('#type' => 'submit', '#value' => t('Save changes'));
