You are here

function mmenu_display_access in Mobile sliding menu 8

Same name and namespace in other branches
  1. 7.3 mmenu.module \mmenu_display_access()
  2. 7.2 mmenu.module \mmenu_display_access()

To check if enables the mmenu.

First to check the value of enabled variable.

Second to check the enabled_callback only if the enabled is set to TRUE.

Parameters

array $mmenu: An associative array of the mmenu.

Return value

bool A boolean to determine to show or hide the mmenu.

1 call to mmenu_display_access()
mmenu_page_bottom in ./mmenu.module
Implements hook_page_bottom().

File

./mmenu.module, line 1020
Primarily Drupal hooks and global API functions to manipulate mmenus.

Code

function mmenu_display_access(array $mmenu) {
  $flag = FALSE;
  if (isset($mmenu['enabled'])) {

    // The enabled flag will be higher priority then the enabled_callback flag.
    if (!$mmenu['enabled']) {
      return FALSE;
    }
    else {
      if (isset($mmenu['enabled_callback'])) {
        return mmenu_check_enabled_callback($mmenu['enabled_callback']);
      }
      else {
        $flag = TRUE;
      }
    }
  }
  return $flag;
}