/** * Constructs the Module Manager. * @return * @param $user Object */ public function __construct(User $user, $regionSpecific = -1, $module = '', $assignable = 1) { $this->user =& $user; if (!($this->theMenu = $user->ModuleAuth($regionSpecific, $module, $assignable))) { $this->message = 'No enabled modules.'; return false; } // Set some information about this menu $this->current = 0; $this->numberItems = count($this->theMenu); // We dont want to do 0 items if ($this->numberItems == 0) { $this->numberItems = -1; } $this->message = $this->numberItems . ' modules loaded'; return true; }