function theme_views_showcase_checkbox_table in Views Showcase 6.2
Same name and namespace in other branches
- 7 views_showcase.module \theme_views_showcase_checkbox_table()
Theming the style options form to render the table with the checkboxes used to choose where to display each field
1 theme call to theme_views_showcase_checkbox_table()
File
- ./
views_showcase.module, line 178 - The implementation of Views Showcase module.
Code
function theme_views_showcase_checkbox_table($element) {
//Build the header of the table to be rendered
$header = array(
t('Field ID'),
t('Big Box'),
t('Navigation Box'),
t('Link to Anchor'),
);
//Build the content of the table
foreach ($element['navigation_box_field']['#options'] as $field_name => $field) {
$row = array();
//First Column the name of the field
$row[] = $field;
//Emptying the labels so that they aren't rendered for each checkbox in the table
$element['big_box_field'][$field_name]['#title'] = '';
$element['navigation_box_field'][$field_name]['#title'] = '';
$element['link_anchor_field'][$field_name]['#title'] = '';
//Now using the rendered HTML of each field and add it to the table
$row[] = drupal_render($element['big_box_field'][$field_name]);
$row[] = drupal_render($element['navigation_box_field'][$field_name]);
$row[] = drupal_render($element['link_anchor_field'][$field_name]);
//Stack all rows in one array
$rows[] = $row;
}
//Render as an HTML table and return
return theme('table', $header, $rows);
}