--- zen/zen/template.block-editing.inc	2009-04-26 21:28:49.000000000 -0400
+++ zen/zen/template.block-editing.inc	2009-04-28 10:47:59.000000000 -0400
@@ -16,77 +16,91 @@
  */
 function zen_preprocess_block_editing(&$vars, $hook) {
   $block = $vars['block'];
+  $edit_links = array();
+
+  // Merge pre-existing links with zen's default links.
+  $vars['edit_links_array'] = array_merge_recursive((array) $vars['edit_links_array'], _zen_preprocess_block_editing_links($block));
+
+  foreach($vars['edit_links_array'] as $edit_link) {
+    $edit_link['options']['query'] = drupal_get_destination();
+    $edit_link['options']['html'] = TRUE;
+    $edit_links[] = l('<span>'. $edit_link['title'] .'</span>', $edit_link['href'], $edit_link['options']);
+  }
+
+  $vars['edit_links'] .= '<div class="edit">'. implode(' ', $edit_links) .'</div>';
+}
+
+/**
+ * Helper function to build default edit links.
+ */
+function _zen_preprocess_block_editing_links($block) {
+  $edit_links = array();
 
   // Display 'edit block' for custom blocks.
   if ($block->module == 'block') {
-    $vars['edit_links_array'][] = l('<span>' . t('edit block') . '</span>', 'admin/build/block/configure/' . $block->module . '/' . $block->delta,
-      array(
-        'attributes' => array(
-          'title' => t('edit the content of this block'),
-          'class' => 'block-edit',
-        ),
-        'query' => drupal_get_destination(),
-        'html' => TRUE,
-      )
+    $edit_link['title'] = t('edit block');
+    $edit_link['href'] = 'admin/build/block/configure/'. $block->module .'/'. $block->delta;
+    $edit_link['options'] = array(
+      'attributes' => array(
+        'title' => t('edit the content of this block'),
+        'class' => 'block-edit',
+      ),
     );
+    $edit_links[$edit_link['href']] = $edit_link;
   }
   // Display 'configure' for other blocks.
   else {
-    $vars['edit_links_array'][] = l('<span>' . t('configure') . '</span>', 'admin/build/block/configure/' . $block->module . '/' . $block->delta,
-      array(
-        'attributes' => array(
-          'title' => t('configure this block'),
-          'class' => 'block-config',
-        ),
-        'query' => drupal_get_destination(),
-        'html' => TRUE,
-      )
+    $edit_link['title'] = t('configure');
+    $edit_link['href'] = 'admin/build/block/configure/'. $block->module .'/'. $block->delta;
+    $edit_link['options'] = array(
+      'attributes' => array(
+        'title' => t('configure this block'),
+        'class' => 'block-config',
+      ),
     );
+    $edit_links[$edit_link['href']] = $edit_link;
   }
 
   // Display 'edit view' for Views blocks.
   if ($block->module == 'views' && user_access('administer views')) {
     list($view_name, $view_block) = explode('-block', $block->delta);
-    $vars['edit_links_array'][] = l('<span>' . t('edit view') . '</span>', 'admin/build/views/edit/' . $view_name,
-      array(
-        'attributes' => array(
-          'title' => t('edit the view that defines this block'),
-          'class' => 'block-edit-view',
-        ),
-        'query' => drupal_get_destination(),
-        'fragment' => 'views-tab-block' . $view_block,
-        'html' => TRUE,
-      )
+    $edit_link['title'] = t('edit view');
+    $edit_link['href'] = 'admin/build/views/edit/'. $view_name;
+    $edit_link['options'] = array(
+      'attributes' => array(
+        'title' => t('edit the view that defines this block'),
+        'class' => 'block-edit-view',
+      ),
+      'fragment' => 'views-tab-block'. $view_block,
     );
+    $edit_links[$edit_link['href']] = $edit_link;
   }
   // Display 'edit menu' for Menu blocks.
   elseif (($block->module == 'menu' || ($block->module == 'user' && $block->delta == 1)) && user_access('administer menu')) {
     $menu_name = ($block->module == 'user') ? 'navigation' : $block->delta;
-    $vars['edit_links_array'][] = l('<span>' . t('edit menu') . '</span>', 'admin/build/menu-customize/' . $menu_name,
-      array(
-        'attributes' => array(
-          'title' => t('edit the menu that defines this block'),
-          'class' => 'block-edit-menu',
-        ),
-        'query' => drupal_get_destination(),
-        'html' => TRUE,
-      )
+    $edit_link['title'] = t('edit menu');
+    $edit_link['href'] = 'admin/build/menu-customize/'. $menu_name;
+    $edit_link['options'] = array(
+      'attributes' => array(
+        'title' => t('edit the menu that defines this block'),
+        'class' => 'block-edit-menu',
+      ),
     );
+    $edit_links[$edit_link['href']] = $edit_link;
   }
   // Display 'edit menu' for Menu block blocks.
   elseif ($block->module == 'menu_block' && user_access('administer menu')) {
     list($menu_name, ) = split(':', variable_get("menu_block_{$block->delta}_parent", 'navigation:0'));
-    $vars['edit_links_array'][] = l('<span>' . t('edit menu') . '</span>', 'admin/build/menu-customize/' . $menu_name,
-      array(
-        'attributes' => array(
-          'title' => t('edit the menu that defines this block'),
-          'class' => 'block-edit-menu',
-        ),
-        'query' => drupal_get_destination(),
-        'html' => TRUE,
-      )
+    $edit_link['title'] = t('edit menu');
+    $edit_link['href'] = 'admin/build/menu-customize/'. $menu_name;
+    $edit_link['options'] = array(
+      'attributes' => array(
+        'title' => t('edit the menu that defines this block'),
+        'class' => 'block-edit-menu',
+      ),
     );
+    $edit_links[$edit_link['href']] = $edit_link;
   }
 
-  $vars['edit_links'] = '<div class="edit">' . implode(' ', $vars['edit_links_array']) . '</div>';
+  return $edit_links;
 }

