function _simpleads_theme_preprocess_helper in SimpleAds 7.2
Preprocess helper.
3 calls to _simpleads_theme_preprocess_helper()
- simpleads_type_flash_preprocess in includes/
theme.inc - Preprocess for simpleads-type-flash.tpl.php.
- simpleads_type_graphic_preprocess in includes/
theme.inc - Preprocess for simpleads-type-graphic.tpl.php.
- simpleads_type_text_preprocess in includes/
theme.inc - Preprocess for simpleads-type-text.tpl.php.
File
- includes/
helper.inc, line 288 - Helper functions.
Code
function _simpleads_theme_preprocess_helper(&$vars) {
$vars['attributes_array'] = array();
$vars['title_attributes_array'] = array();
$vars['content_attributes_array'] = array();
$vars['classes_array'] = array(
'',
);
$entity = $vars['entity'];
$tids = array();
if ($entity->field_ad_category[LANGUAGE_NONE]) {
$terms = array_values($entity->field_ad_category[LANGUAGE_NONE]);
foreach ($terms as $row) {
$tids[] = $row['tid'];
}
}
if (count($tids)) {
$vars['theme_hook_suggestions'][] = 'simpleads_type_' . $vars['type'] . '__' . join('_', $tids);
foreach ($tids as $tid) {
$vars['theme_hook_suggestions'][] = 'simpleads_type_' . $vars['type'] . '__' . $tid;
}
}
}