You are here

function theme_search_api_admin_item_order in Search API 7

Returns HTML for a processor/callback order form.

Parameters

array $variables: An associative array containing:

  • element: A render element representing the form.
1 theme call to theme_search_api_admin_item_order()
search_api_admin_index_workflow in ./search_api.admin.inc

File

./search_api.admin.inc, line 1676
Administration page callbacks for the Search API module.

Code

function theme_search_api_admin_item_order(array $variables) {
  $element = $variables['element'];
  $rows = array();
  foreach (element_children($element, TRUE) as $name) {
    $element[$name]['weight']['#attributes']['class'][] = 'search-api-order-weight';
    $rows[] = array(
      'data' => array(
        drupal_render($element[$name]['item']),
        drupal_render($element[$name]['weight']),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = drupal_render_children($element);
  $output .= theme('table', array(
    'rows' => $rows,
    'attributes' => array(
      'id' => $element['#table_id'],
    ),
  ));
  drupal_add_tabledrag($element['#table_id'], 'order', 'sibling', 'search-api-order-weight', NULL, NULL, TRUE);
  return $output;
}