private function getMasterview($controller, $hasUser) { global $INK_User; $controllerName = $controller->GetName(); $javaScripts = new JS($controllerName); $cssfiles = new CSS($controllerName); //set master statically, we may want to change this to a user controller thing later. //May be usefull for access controll as well. $masterview = new ViewTemplate(); if ($hasUser) { $modules = $INK_User->getModules(); $customermodules = from('$module')->in($modules)->where('$module => $module->SystemStatus() == 0')->select('$module'); $systemmodules = from('$module')->in($modules)->where('$module => $module->SystemStatus() == 1')->select('$module'); $moduleList = new ModuleList($customermodules, $controllerName, array('id' => 'navigation')); $masterview->SysModules = $systemmodules; $masterview->sites = $INK_User->getRole()->getSites(); $masterview->INK_User = $INK_User; $masterview->modules = $moduleList->getList(); } $masterview->javascripts = $javaScripts->getScripts(); $masterview->cssfiles = $cssfiles->getFiles(); $masterview->hasUser = $hasUser; //show the view and return the result as a string $viewview = $this->getView(); ob_start(); try { $viewview->show($this->controller->getName(), $this->resolveAction()); } catch (Exception $e) { throw $e; } $masterview->maincontent = ob_get_clean(); return $masterview; }