You are here

function editor_admin_overview in Editor 7

Returns HTML for the text format administration overview form.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form.
1 string reference to 'editor_admin_overview'
editor_theme_registry_alter in ./editor.module
Implements hook_theme_registry_alter().

File

includes/editor.theme.inc, line 17
Theme functions for Editor module.

Code

function editor_admin_overview($variables) {
  $form = $variables['form'];
  $rows = array();
  foreach (element_children($form['formats']) as $id) {
    $form['formats'][$id]['weight']['#attributes']['class'] = array(
      'text-format-order-weight',
    );
    $rows[] = array(
      'data' => array(
        drupal_render($form['formats'][$id]['name']),
        drupal_render($form['formats'][$id]['editor']),
        drupal_render($form['formats'][$id]['roles']),
        drupal_render($form['formats'][$id]['weight']),
        drupal_render($form['formats'][$id]['configure']),
        drupal_render($form['formats'][$id]['disable']),
      ),
      'class' => array(
        'draggable',
      ),
    );
  }
  $header = array(
    t('Name'),
    t('Editor'),
    t('Roles'),
    t('Weight'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $output = theme('table', array(
    'header' => $header,
    'rows' => $rows,
    'attributes' => array(
      'id' => 'text-format-order',
    ),
  ));
  $output .= drupal_render_children($form);
  drupal_add_tabledrag('text-format-order', 'order', 'sibling', 'text-format-order-weight');
  return $output;
}