function template_preprocess_tb_megamenu_backend in The Better Mega Menu 7
Same name and namespace in other branches
- 8 tb_megamenu.module \template_preprocess_tb_megamenu_backend()
- 2.x tb_megamenu.module \template_preprocess_tb_megamenu_backend()
1 string reference to 'template_preprocess_tb_megamenu_backend'
- tb_megamenu_theme in ./
tb_megamenu.module - Implements hook_theme().
File
- ./
tb_megamenu.themes.inc, line 366
Code
function template_preprocess_tb_megamenu_backend(&$vars) {
$menu_name = $vars['menu_name'];
$block_config = tb_megamenu_get_block_config($menu_name);
tb_megamenu_edit_block_config($block_config);
$menu_content = tb_megamenu_render_block($menu_name);
$vars['menu_content'] = $menu_content['content']['#markup'];
$vars['item_toolbox'] = theme_render_template(drupal_get_path('module', 'tb_megamenu') . "/templates/backend/tb-megamenu-item-toolbox.tpl.php", array());
$vars['submenu_toolbox'] = theme_render_template(drupal_get_path('module', 'tb_megamenu') . "/templates/backend/tb-megamenu-submenu-toolbox.tpl.php", array());
$vars['column_toolbox'] = theme_render_template(drupal_get_path('module', 'tb_megamenu') . "/templates/backend/tb-megamenu-column-toolbox.tpl.php", array(
'blocks_options' => tb_megamenu_get_blocks_options(),
));
$vars['block_config'] = $block_config;
$vars['animation_options'] = tb_megamenu_animation_options($block_config);
$vars['style_options'] = tb_megamenu_style_options($block_config);
$vars['edit_links'] = base_path() . "admin/structure/menu/manage/{$menu_name}";
$vars['edit_menu'] = base_path() . "admin/structure/menu/manage/{$menu_name}/edit";
$js_inline = 'Drupal.TBMegaMenu = Drupal.TBMegaMenu || {};
(function ($) {
Drupal.behaviors.tbMegaMenuAction = {
attach: function(context) {
$("#tb-megamenu-admin-mm-container").megamenuAdmin({menu_name: "' . $menu_name . '"});
}
}
})(jQuery);
';
drupal_add_js($js_inline, array(
'type' => 'inline',
));
}