You are here

function theme_wysiwyg_profile_overview in Wysiwyg 7.2

Same name and namespace in other branches
  1. 5.2 wysiwyg.admin.inc \theme_wysiwyg_profile_overview()
  2. 5 wysiwyg.admin.inc \theme_wysiwyg_profile_overview()
  3. 6.2 wysiwyg.admin.inc \theme_wysiwyg_profile_overview()
  4. 6 wysiwyg.admin.inc \theme_wysiwyg_profile_overview()

Return HTML for the Wysiwyg profile overview form.

File

./wysiwyg.admin.inc, line 711
Integrate Wysiwyg editors into Drupal.

Code

function theme_wysiwyg_profile_overview($variables) {
  $form = $variables['form'];
  if (!isset($form['formats'])) {
    return;
  }
  $output = '';
  $header = array(
    t('Text format'),
    t('Editor'),
    array(
      'data' => t('Operations'),
      'colspan' => 2,
    ),
  );
  $table_rows = array();
  foreach (element_children($form['formats']) as $form_row_name) {
    $form_row =& $form['formats'][$form_row_name];
    $editor_column_output = drupal_render($form_row['editor']);
    $table_row = array(
      'data' => array(
        drupal_render($form_row['name']),
        $editor_column_output,
      ),
    );
    if ($form_row_name == '_new_profile') {

      // This is the "create profile" row.
      $table_row['data'][] = array(
        'data' => drupal_render($form_row['submit']),
        'colspan' => 2,
      );
    }
    else {
      $table_row['data'][] = isset($form_row['edit']) ? drupal_render($form_row['edit']) : '';
      $table_row['data'][] = isset($form_row['delete']) ? drupal_render($form_row['delete']) : '';
    }
    $table_rows[] = $table_row;
  }
  $form['formats']['table']['#markup'] = theme('table', array(
    'header' => $header,
    'rows' => $table_rows,
    'caption' => t('Wysiwyg profiles'),
  ));
  $output .= drupal_render_children($form);
  return $output;
}