function theme_wysiwyg_admin_button_table in Wysiwyg 5
Same name and namespace in other branches
- 5.2 wysiwyg.admin.inc \theme_wysiwyg_admin_button_table()
- 6.2 wysiwyg.admin.inc \theme_wysiwyg_admin_button_table()
- 6 wysiwyg.admin.inc \theme_wysiwyg_admin_button_table()
- 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 - Return an HTML form for profile configuration.
File
- ./
wysiwyg.admin.inc, line 350 - 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;
}