You are here

function om_maximenu_preprocess_page in OM Maximenu 6

Same name and namespace in other branches
  1. 8 om_maximenu.module \om_maximenu_preprocess_page()
  2. 7 om_maximenu.module \om_maximenu_preprocess_page()

Override or insert om variables into the templates.

As Main Menu As Floating Menus

  • Configurable positions

File

./om_maximenu.module, line 184
OM Maximenu.

Code

function om_maximenu_preprocess_page(&$vars) {

  // rendered om maximenu variable
  $maximenu = om_maximenu_load();
  if (!empty($maximenu)) {
    $modal_windows = '';
    foreach ($maximenu as $menu_key => $menu_content) {

      // OM Base Theme
      if ($menu_content['output'] == 'main_menu') {
        $vars['main_menu_tree'] = $menu_content['content'];
      }

      // OM Maximenu Floating menu
      if ($menu_content['output'] == 'float') {
        $vars['closure'] .= $menu_content['content'];
      }

      // OM Maximenu Modal Content
      if (isset($menu_content['modal_windows'])) {
        $modal_windows .= $menu_content['modal_windows'];
      }
    }
    $vars['closure'] .= !empty($modal_windows) ? '<div id="om-maximenu-mask"></div><div id="om-maximenu-modal-widows">' . $modal_windows . '</div>' : '';
  }
}