+ function check_application_access($waapp)
+ {
+ if (!$this->hide_inaccessible_menu_items())
+ {
+ return true;
+ }
+
+ foreach ($waapp->modules as $module)
+ {
+ if ($this->check_module_access($module))
+ {
+ return true;
+ }
+ }
+
+ return false;
+
+ }
+
+ function check_module_access($module)
+ {
+
+ if (!$this->hide_inaccessible_menu_items())
+ {
+ return true;
+ }
+
+ if (sizeof($module->lappfunctions) > 0)
+ {
+ foreach ($module->lappfunctions as $appfunction)
+ {
+ if ($appfunction->label != "" && $this->can_access_page($appfunction->access))
+ {
+ return true;
+ }
+ }
+ }
+
+ if (sizeof($module->rappfunctions) > 0)
+ {
+ foreach ($module->rappfunctions as $appfunction)
+ {
+ if ($appfunction->label != "" && $this->can_access_page($appfunction->access))
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
+
+ }
+
+ function hide_inaccessible_menu_items()
+ {
+ global $SysPrefs;
+
+ if (!isset($SysPrefs->hide_inaccessible_menu_items) || $SysPrefs->hide_inaccessible_menu_items == 0)
+ {
+ return false;
+ }
+
+ else
+ {
+ return true;
+ }
+ }
+