You are here

function om_maximenu_init in OM Maximenu 8

Same name and namespace in other branches
  1. 6 inc/om_maximenu.render.inc \om_maximenu_init()
  2. 7 inc/om_maximenu.render.inc \om_maximenu_init()

Implementation of hook_init().

File

inc/om_maximenu.render.inc, line 16
OM Maximenu Render

Code

function om_maximenu_init() {
  global $_om_maximenu_variable;
  global $_om_maximenu_block_classes;
  global $_om_maximenu_visible_blocks;
  $_om_maximenu_visible_blocks = om_maximenu_blocks_visibility();

  // add om tools custom block classes
  if (module_exists('om_tools')) {
    $om_tools_values = variable_get('om_tools', '');
    $om_blocks = isset($om_tools_values['block']) ? $om_tools_values['block'] : array();
    if (!empty($om_blocks) && $om_blocks['block_classes_switch'] == 1) {
      $_om_maximenu_block_classes = array();
      foreach ($om_blocks as $block_key => $block_class) {
        $block = explode('___', $block_key);
        if (isset($block[1])) {

          // filters switch/reset
          $module = $block[1];
          $delta = $block[2];
          $_om_maximenu_block_classes[$module][$delta] = $block_class;
        }
      }
    }
  }
  $_om_maximenu_variable = variable_get('om_maximenu', array());
}