function bricks_process_entity in Bricks 7.5
Same name and namespace in other branches
- 7.4 bricks.module \bricks_process_entity()
Processes variables for entity.tpl.php.
File
- ./
bricks.module, line 89
Code
function bricks_process_entity(&$vars) {
$element =& $vars['elements'];
if ($element['#entity_type'] == 'brick') {
$vars['prefix'] = '<div class="' . $vars['classes'] . '"' . $vars['attributes'] . '>' . drupal_render($vars['title_prefix']) . drupal_render($vars['title_suffix']);
$vars['suffix'] = '</div>';
$vars['heading'] = !empty($vars['title']) ? '<h' . $element['#heading_level'] . '>' . $vars['title'] . '</h' . $element['#heading_level'] . '>' : '';
$vars['placeholder'] = '<div class="er-placeholder">' . $element['#bundle'] . '</div>';
if (isset($vars['content']['bricks'])) {
foreach ($vars['content']['bricks'] as &$brick) {
$brick['#base_heading_level'] = $element['#heading_level'];
}
}
}
}