You are here

function theme_site_map_order in Site map 7

Same name and namespace in other branches
  1. 8 site_map.theme.inc \theme_site_map_order()

Returns HTML for the site map order form.

Copied from the core theme_filter_admin_format_filter_order() function.

@codingStandardsIgnoreStart

Parameters

array $variables: An associative array containing:

  • element: A render element representing the form.
1 theme call to theme_site_map_order()
site_map_admin_settings_form in includes/site_map.admin.inc
Menu callback; presents the sitemap settings page.

File

includes/site_map.theme.inc, line 274
site_map.theme.inc

Code

function theme_site_map_order($variables) {

  // @codingStandardsIgnoreEnd
  $element = $variables['element'];

  // Site map order (tabledrag).
  $rows = array();
  foreach (element_children($element, TRUE) as $name) {
    $element[$name]['weight']['#attributes']['class'][] = 'site-map-order-weight';
    $rows[] = array(
      'data' => array(
        drupal_render($element[$name]['content']),
        drupal_render($element[$name]['weight']),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  $output = drupal_render_children($element);
  $output .= theme('table', array(
    'rows' => $rows,
    'attributes' => array(
      'id' => 'site-map-order',
    ),
  ));
  drupal_add_tabledrag('site-map-order', 'order', 'sibling', 'site-map-order-weight', NULL, NULL, TRUE);
  return $output;
}