Full ELMS Learning Network documentation
function theme_field_ui_table
×
Error message
User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).cis7 field_ui.admin.inc | theme_field_ui_table($variables) |
cle7 field_ui.admin.inc | theme_field_ui_table($variables) |
elmsmedia7 field_ui.admin.inc | theme_field_ui_table($variables) |
icor7 field_ui.admin.inc | theme_field_ui_table($variables) |
meedjum_blog7 field_ui.admin.inc | theme_field_ui_table($variables) |
mooc7 field_ui.admin.inc | theme_field_ui_table($variables) |
Returns HTML for Field UI overview tables.
Parameters
$variables: An associative array containing:
- elements: An associative array containing a Form API structure to be rendered as a table.
Related topics
4 string references to the theme hook from theme_field_ui_table()
Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.
- field_ui_display_overview_form in modules/
field_ui/ field_ui.admin.inc - Form constructor for the field display settings for a given view mode.
- field_ui_element_info in modules/
field_ui/ field_ui.module - Implements hook_element_info().
- field_ui_field_overview_form in modules/
field_ui/ field_ui.admin.inc - Form constructor for the 'Manage fields' form of a bundle.
- field_ui_theme in modules/
field_ui/ field_ui.module - Implements hook_theme().
File
- modules/
field_ui/ field_ui.admin.inc, line 207 - Administrative interface for custom field type creation.
Code
function theme_field_ui_table($variables) {
$elements = $variables['elements'];
$table = array();
$js_settings = array();
// Add table headers and attributes.
foreach (array('header', 'attributes') as $key) {
if (isset($elements["#$key"])) {
$table[$key] = $elements["#$key"];
}
}
// Determine the colspan to use for region rows, by checking the number of
// columns in the headers.
$columns_count = 0;
foreach ($table['header'] as $header) {
$columns_count += (is_array($header) && isset($header['colspan']) ? $header['colspan'] : 1);
}
// Render rows, region by region.
foreach ($elements['#regions'] as $region_name => $region) {
$region_name_class = drupal_html_class($region_name);
// Add region rows.
if (isset($region['title'])) {
$table['rows'][] = array(
'class' => array('region-title', 'region-' . $region_name_class . '-title'),
'no_striping' => TRUE,
'data' => array(
array(
'data' => $region['title'],
'colspan' => $columns_count,
),
),
);
}
if (isset($region['message'])) {
$class = (empty($region['rows_order']) ? 'region-empty' : 'region-populated');
$table['rows'][] = array(
'class' => array('region-message', 'region-' . $region_name_class . '-message', $class),
'no_striping' => TRUE,
'data' => array(
array(
'data' => $region['message'],
'colspan' => $columns_count,
),
),
);
}
// Add form rows, in the order determined at pre-render time.
foreach ($region['rows_order'] as $name) {
$element = $elements[$name];
$row = array('data' => array());
if (isset($element['#attributes'])) {
$row += $element['#attributes'];
}
// Render children as table cells.
foreach (element_children($element) as $cell_key) {
$child = &$element[$cell_key];
// Do not render a cell for children of #type 'value'.
if (!(isset($child['#type']) && $child['#type'] == 'value')) {
$cell = array('data' => drupal_render($child));
if (isset($child['#cell_attributes'])) {
$cell += $child['#cell_attributes'];
}
$row['data'][] = $cell;
}
}
$table['rows'][] = $row;
}
}
return theme('table', $table);
}