function template_preprocess_om_maximenu_roundabout_links in OM Maximenu 8
Same name and namespace in other branches
- 6 inc/om_maximenu.render.inc \template_preprocess_om_maximenu_roundabout_links()
- 7 inc/om_maximenu.render.inc \template_preprocess_om_maximenu_roundabout_links()
Process variables for om_maximenu_roundabout_links.tpl.php
File
- inc/
om_maximenu.render.inc, line 839 - OM Maximenu Render
Code
function template_preprocess_om_maximenu_roundabout_links(&$vars) {
$content = $vars['content'];
// user roles and permissions
$vars['permission'] = om_maximenu_link_visible($vars['content']['roles']);
// php on title
if (isset($content['php_option']) && $content['php_option'] == 1) {
ob_start();
$content['link_title'] = eval($content['link_title']);
//$output = ob_get_contents();
ob_end_clean();
}
// span id
$span_id = !empty($content['id']) ? ' id="' . om_string_name($content['id']) . '"' : '';
// span title
$span_title = !empty($content['description']) && $content['description_option'] == 'hover' ? 'title="' . check_plain($content['description']) . '"' : '';
// link content
$link_option = om_maximenu_link_option($content);
// a link attributes
$attributes = om_maximenu_link_attrib($content);
// title with javascript should have div tag
$script_link = om_string_name($content['link_title'], FALSE);
// title contains some block elements
$link_tag = isset($content['php_option']) && $content['php_option'] == 1 || $script_link == 'Script Link' ? 'div' : 'span';
// useful when you just want a button for getting the content to show and not actually linking to anything
$vars['om_link'] = '<' . $link_tag . $span_id . ' class="' . $attributes['class'] . '" ' . $span_title . '>' . $link_option . '</' . $link_tag . '>';
$maximenu_name = preg_replace('/-/', '_', $vars['maximenu_name']);
$vars['theme_hook_suggestions'][] = 'om_maximenu_roundabout-links__' . $maximenu_name;
$vars['theme_hook_suggestions'][] = 'om_maximenu_roundabout-links__' . $maximenu_name . '_' . $vars['key'];
$vars['theme_hook_suggestions'][] = 'om_maximenu_roundabout-links__' . om_string_name($content['link_title']);
//dsm($vars);
}