You are here

function theme_wysiwyg_admin_button_table in Wysiwyg 5.2

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

Layout for the buttons in the Wysiwyg Editor profile form.

1 theme call to theme_wysiwyg_admin_button_table()
wysiwyg_profile_form in ./wysiwyg.admin.inc
Form builder for Wysiwyg profile form.

File

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

Code

function theme_wysiwyg_admin_button_table($form) {
  $buttons = array();

  // Flatten forms array.
  foreach (element_children($form) as $name) {
    foreach (element_children($form[$name]) as $button) {
      $buttons[] = drupal_render($form[$name][$button]);
    }
  }

  // Split checkboxes into rows with 3 columns.
  $total = count($buttons);
  $rows = array();
  for ($i = 0; $i < $total; $i++) {
    $row = array();
    $row[] = array(
      'data' => $buttons[$i],
    );
    if (isset($buttons[++$i])) {
      $row[] = array(
        'data' => $buttons[$i],
      );
    }
    if (isset($buttons[++$i])) {
      $row[] = array(
        'data' => $buttons[$i],
      );
    }
    $rows[] = $row;
  }
  $output = theme('table', array(), $rows, array(
    'width' => '100%',
  ));
  return $output;
}