Commit 16eac3be authored by webchick's avatar webchick

Issue #1480854 by tim.plunkett, Noyz, Bojhan, yoroy, kika: Convert operation...

Issue #1480854 by tim.plunkett, Noyz, Bojhan, yoroy, kika: Convert operation links to '#type' => 'operations'.
parent 47c093fb
......@@ -29,7 +29,7 @@ function action_admin_manage() {
$header = array(
array('data' => t('Action type'), 'field' => 'type'),
array('data' => t('Label'), 'field' => 'label'),
array('data' => $instances_present ? t('Operations') : '', 'colspan' => '2')
$instances_present ? t('Operations') : '',
);
$query = db_select('actions')
->extend('Drupal\Core\Database\Query\PagerSelectExtender')
......@@ -41,21 +41,37 @@ function action_admin_manage() {
->execute();
foreach ($result as $action) {
$row = array();
$row[] = $action->type;
$row[] = check_plain($action->label);
$links = array();
if ($action->parameters) {
$links['configure'] = array(
'title' => t('configure'),
'href' => "admin/config/system/actions/configure/$action->aid",
);
$links['delete'] = array(
'title' => t('delete'),
'href' => "admin/config/system/actions/delete/$action->aid",
);
}
$row[] = array(
array('data' => $action->type),
array('data' => check_plain($action->label)),
array('data' => $action->parameters ? l(t('configure'), "admin/config/system/actions/configure/$action->aid") : ''),
array('data' => $action->parameters ? l(t('delete'), "admin/config/system/actions/delete/$action->aid") : '')
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
if ($row) {
if ($rows) {
$pager = theme('pager');
if (!empty($pager)) {
$row[] = array(array('data' => $pager, 'colspan' => '3'));
$rows[] = array(array('data' => $pager, 'colspan' => '3'));
}
$build['action_header'] = array('#markup' => '<h3>' . t('Available actions:') . '</h3>');
$build['action_table'] = array('#markup' => theme('table', array('header' => $header, 'rows' => $row)));
$build['action_table'] = array('#markup' => theme('table', array('header' => $header, 'rows' => $rows)));
}
if ($actions_map) {
......
......@@ -28,18 +28,35 @@ function aggregator_view() {
$output = '<h3>' . t('Feed overview') . '</h3>';
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3'));
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), t('Operations'));
$rows = array();
foreach ($result as $feed) {
$rows[] = array(
l($feed->title, "aggregator/sources/$feed->fid"),
format_plural($feed->items, '1 item', '@count items'),
($feed->checked ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $feed->checked))) : t('never')),
($feed->checked && $feed->refresh ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - REQUEST_TIME))) : t('never')),
l(t('edit'), "admin/config/services/aggregator/edit/feed/$feed->fid"),
l(t('remove items'), "admin/config/services/aggregator/remove/$feed->fid"),
l(t('update items'), "admin/config/services/aggregator/update/$feed->fid", array('query' => array('token' => drupal_get_token("aggregator/update/$feed->fid")))),
$row = array();
$row[] = l($feed->title, "aggregator/sources/$feed->fid");
$row[] = format_plural($feed->items, '1 item', '@count items');
$row[] = ($feed->checked ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $feed->checked))) : t('never'));
$row[] = ($feed->checked && $feed->refresh ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - REQUEST_TIME))) : t('never'));
$links = array();
$links['edit'] = array(
'title' => t('edit'),
'href' => "admin/config/services/aggregator/edit/feed/$feed->fid",
);
$links['remove'] = array(
'title' => t('remove items'),
'href' => "admin/config/services/aggregator/remove/$feed->fid",
);
$links['update'] = array(
'title' => t('update items'),
'href' => "admin/config/services/aggregator/update/$feed->fid",
'query' => array('token' => drupal_get_token("aggregator/update/$feed->fid")),
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
$output .= theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No feeds available. <a href="@link">Add feed</a>.', array('@link' => url('admin/config/services/aggregator/add/feed')))));
......@@ -50,7 +67,21 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Operations'));
$rows = array();
foreach ($result as $category) {
$rows[] = array(l($category->title, "aggregator/categories/$category->cid"), format_plural($category->items, '1 item', '@count items'), l(t('edit'), "admin/config/services/aggregator/edit/category/$category->cid"));
$row = array();
$row[] = l($category->title, "aggregator/categories/$category->cid");
$row[] = format_plural($category->items, '1 item', '@count items');
$links = array();
$links['edit'] = array(
'title' => t('edit'),
'href' => "admin/config/services/aggregator/edit/category/$category->cid",
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
$output .= theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No categories available. <a href="@link">Add category</a>.', array('@link' => url('admin/config/services/aggregator/add/category')))));
......
......@@ -17,10 +17,20 @@ function ban_admin_page($default_ip = '') {
$header = array(t('banned IP addresses'), t('Operations'));
$result = db_query('SELECT * FROM {ban_ip}');
foreach ($result as $ip) {
$rows[] = array(
$ip->ip,
l(t('delete'), "admin/config/people/ban/delete/$ip->iid"),
$row = array();
$row[] = $ip->ip;
$links = array();
$links['delete'] = array(
'title' => t('delete'),
'href' => "admin/config/people/ban/delete/$ip->iid",
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
$build['ban_ip_form'] = drupal_get_form('ban_ip_form', $default_ip);
......
......@@ -146,18 +146,20 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme, $block_r
'#title' => t('Region for @block block', array('@block' => $block['info'])),
'#options' => $block_regions,
);
$form['blocks'][$key]['configure'] = array(
'#type' => 'link',
'#title' => t('configure'),
'#href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure',
$links['configure'] = array(
'title' => t('configure'),
'href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure',
);
if ($block['module'] == 'block') {
$form['blocks'][$key]['delete'] = array(
'#type' => 'link',
'#title' => t('delete'),
'#href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/delete',
$links['delete'] = array(
'title' => t('delete'),
'href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/delete',
);
}
$form['blocks'][$key]['operations'] = array(
'#type' => 'operations',
'#links' => $links,
);
}
// Do not allow disabling the main system content block when it is present.
if (isset($form['blocks']['system_main']['region'])) {
......@@ -806,8 +808,7 @@ function template_preprocess_block_admin_display_form(&$variables) {
$variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']);
$variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']);
$variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']);
$variables['block_listing'][$region][$i]->configure_link = drupal_render($block['configure']);
$variables['block_listing'][$region][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : '';
$variables['block_listing'][$region][$i]->operations = drupal_render($block['operations']);
$variables['block_listing'][$region][$i]->printed = FALSE;
}
......
......@@ -16,8 +16,7 @@
* - $data->block_title: Block title.
* - $data->region_select: Drop-down menu for assigning a region.
* - $data->weight_select: Drop-down menu for setting weights.
* - $data->configure_link: Block configuration link.
* - $data->delete_link: For deleting user added blocks.
* - $data->operations: Block operations.
*
* @see template_preprocess_block_admin_display_form()
* @see theme_block_admin_display()
......@@ -31,7 +30,7 @@
<th><?php print t('Block'); ?></th>
<th><?php print t('Region'); ?></th>
<th><?php print t('Weight'); ?></th>
<th colspan="2"><?php print t('Operations'); ?></th>
<th><?php print t('Operations'); ?></th>
</tr>
</thead>
<tbody>
......@@ -48,8 +47,7 @@
<td class="block"><?php print $data->block_title; ?></td>
<td><?php print $data->region_select; ?></td>
<td><?php print $data->weight_select; ?></td>
<td><?php print $data->configure_link; ?></td>
<td><?php print $data->delete_link; ?></td>
<td><?php print $data->operations; ?></td>
</tr>
<?php $row++; ?>
<?php endforeach; ?>
......
......@@ -19,7 +19,21 @@ function book_admin_overview() {
// Add any recognized books to the table list.
foreach (book_get_books() as $book) {
$rows[] = array(l($book['title'], $book['href'], $book['options']), l(t('edit order and titles'), 'admin/content/book/' . $book['nid']));
$row = array(
l($book['title'], $book['href'], $book['options']),
);
$links = array();
$links['edit'] = array(
'title' => t('edit order and titles'),
'href' => 'admin/content/book/' . $book['nid'],
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
return theme('table', array('header' => $headers, 'rows' => $rows, 'empty' => t('No books available.')));
......@@ -265,7 +279,7 @@ function theme_book_admin_table($variables) {
drupal_add_tabledrag('book-outline', 'match', 'parent', 'book-plid', 'book-plid', 'book-mlid', TRUE, MENU_MAX_DEPTH - 2);
drupal_add_tabledrag('book-outline', 'order', 'sibling', 'book-weight');
$header = array(t('Title'), t('Weight'), t('Parent'), array('data' => t('Operations'), 'colspan' => '3'));
$header = array(t('Title'), t('Weight'), t('Parent'), t('Operations'));
$rows = array();
$destination = drupal_get_destination();
......@@ -283,9 +297,29 @@ function theme_book_admin_table($variables) {
theme('indentation', array('size' => $form[$key]['depth']['#value'] - 2)) . drupal_render($form[$key]['title']),
drupal_render($form[$key]['weight']),
drupal_render($form[$key]['plid']) . drupal_render($form[$key]['mlid']),
l(t('view'), $href),
$access ? l(t('edit'), 'node/' . $nid . '/edit', array('query' => $destination)) : '&nbsp;',
$access ? l(t('delete'), 'node/' . $nid . '/delete', array('query' => $destination) ) : '&nbsp;',
);
$links = array();
$links['view'] = array(
'title' => t('view'),
'href' => $href,
);
if ($access) {
$links['edit'] = array(
'title' => t('edit'),
'href' => "node/$nid/edit",
'query' => $destination,
);
$links['delete'] = array(
'title' => t('delete'),
'href' => "node/$nid/delete",
'query' => $destination,
);
}
$data[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$row = array('data' => $data);
if (isset($form[$key]['#attributes'])) {
......
......@@ -76,7 +76,7 @@ function comment_admin_overview($form, &$form_state, $arg) {
'author' => array('data' => t('Author'), 'field' => 'name', 'class' => array(RESPONSIVE_PRIORITY_MEDIUM)),
'posted_in' => array('data' => t('Posted in'), 'field' => 'node_title', 'class' => array(RESPONSIVE_PRIORITY_LOW)),
'changed' => array('data' => t('Updated'), 'field' => 'c.changed', 'sort' => 'desc', 'class' => array(RESPONSIVE_PRIORITY_LOW)),
'operations' => array('data' => t('Operations')),
'operations' => t('Operations'),
);
$query = db_select('comment', 'c')
......@@ -129,14 +129,16 @@ function comment_admin_overview($form, &$form_state, $arg) {
),
),
'changed' => format_date($comment->changed, 'short'),
'operations' => array(
'data' => array(
'#type' => 'link',
'#title' => t('edit'),
'#href' => 'comment/' . $comment->cid . '/edit',
'#options' => array('query' => $destination),
),
),
);
$links = array();
$links['edit'] = array(
'title' => t('edit'),
'href' => 'comment/' . $comment->cid . '/edit',
'query' => $destination,
);
$options[$comment->cid]['operations']['data'] = array(
'#type' => 'operations',
'#links' => $links,
);
}
......
......@@ -15,7 +15,7 @@ function contact_category_list() {
t('Category'),
t('Recipients'),
t('Selected'),
array('data' => t('Operations'), 'colspan' => 2),
t('Operations'),
);
$rows = array();
......@@ -30,13 +30,26 @@ function contact_category_list() {
// Loop through the categories and add them to the table.
foreach ($categories as $category) {
$rows[] = array(
check_plain($category->category),
check_plain($category->recipients),
($category->selected ? t('Yes') : t('No')),
l(t('Edit'), 'admin/structure/contact/edit/' . $category->cid),
l(t('Delete'), 'admin/structure/contact/delete/' . $category->cid),
$row = array();
$row[] = check_plain($category->category);
$row[] = check_plain($category->recipients);
$row[] = ($category->selected ? t('Yes') : t('No'));
$links = array();
$links['edit'] = array(
'title' => t('Edit'),
'href' => 'admin/structure/contact/edit/' . $category->cid,
);
$links['delete'] = array(
'title' => t('Delete'),
'href' => 'admin/structure/contact/delete/' . $category->cid,
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
if (!$rows) {
......
......@@ -333,7 +333,7 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle
t('Machine name'),
t('Field type'),
t('Widget'),
array('data' => t('Operations'), 'colspan' => 2),
t('Operations'),
),
'#parent_options' => array(),
'#regions' => array(
......@@ -398,23 +398,25 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle
'#href' => $admin_field_path . '/widget-type',
'#options' => array('attributes' => array('title' => t('Change widget type.'))),
),
'edit' => array(
'#type' => 'link',
'#title' => t('edit'),
'#href' => $admin_field_path,
'#options' => array('attributes' => array('title' => t('Edit instance settings.'))),
),
'delete' => array(
'#type' => 'link',
'#title' => t('delete'),
'#href' => $admin_field_path . '/delete',
'#options' => array('attributes' => array('title' => t('Delete instance.'))),
),
);
$links = array();
$links['edit'] = array(
'title' => t('edit'),
'href' => $admin_field_path,
'attributes' => array('title' => t('Edit instance settings.')),
);
$links['delete'] = array(
'title' => t('delete'),
'href' => "$admin_field_path/delete",
'attributes' => array('title' => t('Delete instance.')),
);
$table[$name]['operations']['data'] = array(
'#type' => 'operations',
'#links' => $links,
);
if (!empty($instance['locked'])) {
$table[$name]['edit'] = array('#value' => t('Locked'));
$table[$name]['delete'] = array();
$table[$name]['operations'] = array('#value' => t('Locked'));
$table[$name]['#attributes']['class'][] = 'menu-disabled';
}
}
......@@ -459,11 +461,8 @@ function field_ui_field_overview_form($form, &$form_state, $entity_type, $bundle
'#markup' => isset($extra_field['description']) ? $extra_field['description'] : '',
'#cell_attributes' => array('colspan' => 2),
),
'edit' => array(
'#markup' => isset($extra_field['edit']) ? $extra_field['edit'] : '',
),
'delete' => array(
'#markup' => isset($extra_field['delete']) ? $extra_field['delete'] : '',
'operations' => array(
'#markup' => '',
),
);
}
......
......@@ -19,6 +19,11 @@ function filter_admin_overview($form) {
$form['#tree'] = TRUE;
foreach ($formats as $id => $format) {
$links = array();
$links['configure'] = array(
'title' => t('configure'),
'href' => "admin/config/content/formats/$id",
);
// Check whether this is the fallback text format. This format is available
// to all roles and cannot be disabled via the admin interface.
$form['formats'][$id]['#is_fallback'] = ($id == $fallback_format);
......@@ -30,10 +35,16 @@ function filter_admin_overview($form) {
$form['formats'][$id]['name'] = array('#markup' => check_plain($format->name));
$roles = array_map('check_plain', filter_get_roles_by_format($format));
$roles_markup = $roles ? implode(', ', $roles) : t('No roles may use this format');
$links['disable'] = array(
'title' => t('disable'),
'href' => "admin/config/content/formats/$id/disable",
);
}
$form['formats'][$id]['roles'] = array('#markup' => $roles_markup);
$form['formats'][$id]['configure'] = array('#type' => 'link', '#title' => t('configure'), '#href' => 'admin/config/content/formats/' . $id);
$form['formats'][$id]['disable'] = array('#type' => 'link', '#title' => t('disable'), '#href' => 'admin/config/content/formats/' . $id . '/disable', '#access' => !$form['formats'][$id]['#is_fallback']);
$form['formats'][$id]['operations'] = array(
'#type' => 'operations',
'#links' => $links,
);
$form['formats'][$id]['weight'] = array(
'#type' => 'weight',
'#title' => t('Weight for @title', array('@title' => $format->name)),
......@@ -78,18 +89,18 @@ function theme_filter_admin_overview($variables) {
$rows = array();
foreach (element_children($form['formats']) as $id) {
$form['formats'][$id]['weight']['#attributes']['class'] = array('text-format-order-weight');
$rows[] = array(
$row = array(
'data' => array(
drupal_render($form['formats'][$id]['name']),
drupal_render($form['formats'][$id]['roles']),
drupal_render($form['formats'][$id]['weight']),
drupal_render($form['formats'][$id]['configure']),
drupal_render($form['formats'][$id]['disable']),
drupal_render($form['formats'][$id]['operations']),
),
'class' => array('draggable'),
);
$rows[] = $row;
}
$header = array(t('Name'), t('Roles'), t('Weight'), array('data' => t('Operations'), 'colspan' => 2));
$header = array(t('Name'), t('Roles'), t('Weight'), t('Operations'));
$output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'text-format-order')));
$output .= drupal_render_children($form);
......
......@@ -84,6 +84,21 @@ function image_style_form($form, &$form_state, $style) {
'#default_value' => $effect['weight'],
);
$links = array();
if (isset($effect['form callback'])) {
$links['edit'] = array(
'title' => t('edit'),
'href' => 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $key,
);
}
$links['delete'] = array(
'title' => t('delete'),
'href' => 'admin/config/media/image-styles/edit/' . $style['name'] . '/effects/' . $key . '/delete',
);
$form['effects'][$key]['operations'] = array(
'#type' => 'operations',
'#links' => $links,
);
$form['effects'][$key]['configure'] = array(
'#type' => 'link',
'#title' => t('edit'),
......@@ -583,19 +598,28 @@ function image_rotate_form($data) {
function theme_image_style_list($variables) {
$styles = $variables['styles'];
$header = array(t('Style name'), array('data' => t('Operations'), 'colspan' => 3));
$header = array(t('Style name'), t('Operations'));
$rows = array();
$link_attributes = array(
'attributes' => array(
'class' => array('image-style-link'),
),
);
foreach ($styles as $style) {
$row = array();
$row[] = l($style['label'], 'admin/config/media/image-styles/edit/' . $style['name']);
$row[] = l(t('edit'), 'admin/config/media/image-styles/edit/' . $style['name'], $link_attributes);
$row[] = l(t('delete'), 'admin/config/media/image-styles/delete/' . $style['name'], $link_attributes);
$links = array();
$links['edit'] = array(
'title' => t('edit'),
'href' => 'admin/config/media/image-styles/edit/' . $style['name'],
'class' => array('image-style-link'),
);
$links['delete'] = array(
'title' => t('delete'),
'href' => 'admin/config/media/image-styles/delete/' . $style['name'],
'class' => array('image-style-link'),
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
......@@ -629,14 +653,13 @@ function theme_image_style_effects($variables) {
$summary = drupal_render($form[$key]['summary']);
$row[] = drupal_render($form[$key]['label']) . (empty($summary) ? '' : ' ' . $summary);
$row[] = drupal_render($form[$key]['weight']);
$row[] = drupal_render($form[$key]['configure']);
$row[] = drupal_render($form[$key]['remove']);
$row[] = array('data' => $form[$key]['operations']);
}
else {
// Add the row for adding a new image effect.
$row[] = '<div class="image-style-new">' . drupal_render($form['new']['new']) . drupal_render($form['new']['add']) . '</div>';
$row[] = drupal_render($form['new']['weight']);
$row[] = array('data' => '', 'colspan' => 2);
$row[] = '';
}
$rows[] = array(
......@@ -648,7 +671,7 @@ function theme_image_style_effects($variables) {
$header = array(
t('Effect'),
t('Weight'),
array('data' => t('Operations'), 'colspan' => 2),
t('Operations'),
);
if (count($rows) == 1 && (!isset($form['new']['#access']) || $form['new']['#access'])) {
......
......@@ -69,26 +69,27 @@ function language_admin_overview_form($form, &$form_state) {
),
'#delta' => 30,
);
$form['languages'][$langcode]['operations'] = array(
'#theme_wrappers' => array('language_admin_operations'),
'#weight' => 100,
);
$links = array();
if (empty($language->locked)) {
$form['languages'][$langcode]['operations']['edit'] = array(
'#type' => 'link',
'#title' => t('edit'),
'#href' => 'admin/config/regional/language/edit/' . $langcode,
);
$form['languages'][$langcode]['operations']['delete'] = array(
'#type' => 'link',
'#title' => t('delete'),
'#href' => 'admin/config/regional/language/delete/' . $langcode,
'#access' => $langcode != $default->langcode,
$links['edit'] = array(
'title' => t('edit'),
'href' => 'admin/config/regional/language/edit/' . $langcode,
);
if ($langcode != $default->langcode) {
$links['delete'] = array(
'title' => t('delete'),
'href' => 'admin/config/regional/language/delete/' . $langcode,
);
}
}
else {
$form['languages'][$langcode]['default']['#attributes']['disabled'] = 'disabled';
}
$form['languages'][$langcode]['operations'] = array(
'#type' => 'operations',
'#links' => $links,
'#weight' => 100,
);
}
$form['actions'] = array('#type' => 'actions');
......@@ -100,30 +101,6 @@ function language_admin_overview_form($form, &$form_state) {
return $form;
}
/**
* Returns HTML for operation links in language_admin_overview_form() table.
*
* @todo Introduce #type '[table_]operations' or just simply #type 'links'.
*/
function theme_language_admin_operations($variables) {
$links = array();
foreach (element_children($variables['elements']) as $key) {
// Children are only rendered if the current user has access.
if (isset($variables['elements'][$key]['#children'])) {
$links[$key] = $variables['elements'][$key]['#children'];
}
}
// If there are links, render a link list.
if (!empty($links)) {
return theme('item_list__operations', array(
'items' => $links,
'attributes' => array('class' => array('links', 'inline')),
));
}
// Otherwise, ensure to produce no output.
return '';
}
/**
* Returns HTML for the language overview form.
*
......@@ -539,11 +516,17 @@ function language_negotiation_configure_form_table(&$form, $type) {
$config_op = array();
if (isset($method['config'])) {
$config_op = array('#type' => 'link', '#title' => t('Configure'), '#href' => $method['config']);
$config_op['configure'] = array(
'title' => t('Configure'),
'href' => $method['config'],
);
// If there is at least one operation enabled show the operation column.
$table_form['#show_operations'] = TRUE;
}
$table_form['operation'][$method_id] = $config_op;
$table_form['operation'][$method_id] = array(
'#type' => 'operations',
'#links' => $config_op,
);
}
}
......@@ -931,20 +914,26 @@ function language_negotiation_configure_browser_form($form, &$form_state) {
function theme_language_negotiation_configure_browser_form_table($variables) {
$form = $variables['form'];
$rows = array();
$link_attributes = array(
'attributes' => array(
'class' => array('image-style-link'),
),
);
foreach (element_children($form, TRUE) as $key) {
$row = array();
$row[] = drupal_render($form[$key]['browser_langcode']);
$row[] = drupal_render($form[$key]['drupal_langcode']);
$row[] = l(t('Delete'), 'admin/config/regional/language/detection/browser/delete/' . $key, $link_attributes);
$rows[] = array(
'data' => $row,
$links = array();
$links['delete'] = array(
'title' => t('Delete'),
'href' => "admin/config/regional/language/detection/browser/delete/$key",
'attributes' => array(
'class' => array('image-style-link'),
),
);
$row[] = array(
'data' => array(
'#type' => 'operations',
'#links' => $links,
),
);
$rows[] = $row;
}
$header = array(
......