Add Office Menu

This commit is contained in:
Steve Ireland
2017-09-02 13:31:33 -04:00
committed by FrancescoUK
parent 5a9aa96b7e
commit de91510beb
18 changed files with 342 additions and 107 deletions

View File

@@ -6,7 +6,7 @@ class Secure_Controller extends CI_Controller
* Controllers that are considered secure extend Secure_Controller, optionally a $module_id can
* be set to also check if a user can access a particular module in the system.
*/
public function __construct($module_id = NULL, $submodule_id = NULL)
public function __construct($module_id = NULL, $submodule_id = NULL, $menu_group = NULL)
{
parent::__construct();
@@ -28,7 +28,24 @@ class Secure_Controller extends CI_Controller
}
// load up global data visible to all the loaded views
$data['allowed_modules'] = $this->Module->get_allowed_modules($logged_in_employee_info->person_id);
$this->load->library('session');
if($menu_group == NULL)
{
$menu_group = $this->session->userdata('menu_group');
}
else
{
$this->session->set_userdata('menu_group', $menu_group);
}
if($menu_group == 'home')
{
$data['allowed_modules'] = $this->Module->get_allowed_home_modules($logged_in_employee_info->person_id);
}
else
{
$data['allowed_modules'] = $this->Module->get_allowed_office_modules($logged_in_employee_info->person_id);
}
$data['user_info'] = $logged_in_employee_info;
$data['controller_name'] = $module_id;