pad naar handleidingen
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||||
class Menu extends MY_Controller{
|
|
||||||
|
|
||||||
function __construct(){
|
class Menu extends MY_Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$models = array("shared/Users_model",
|
$models = array("shared/Users_model",
|
||||||
'shared/Organisaties_model',
|
'shared/Organisaties_model',
|
||||||
@@ -18,15 +21,19 @@ class Menu extends MY_Controller{
|
|||||||
};// if
|
};// if
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_menu(){
|
public function get_menu()
|
||||||
|
{
|
||||||
$user = new stdClass;
|
$user = new stdClass;
|
||||||
$organisatie = new stdClass;
|
$organisatie = new stdClass;
|
||||||
$module = $this->session->userdata['module'];
|
$module = $this->session->userdata['module'];
|
||||||
$modulenaam = '';
|
$modulenaam = '';
|
||||||
if ($module >= 0) {
|
if ($module >= 0) {
|
||||||
|
|
||||||
if (0 == $module) {$modulenaam = "Instrumenten";}
|
if (0 == $module) {
|
||||||
else {$modulenaam= $this->Modules_model->get_fieldvalue(array("sysnr" => $module), 'naamkort'); }
|
$modulenaam = "Instrumenten";
|
||||||
|
} else {
|
||||||
|
$modulenaam = $this->Modules_model->get_fieldvalue(array("sysnr" => $module), 'naamkort');
|
||||||
|
}
|
||||||
$org = $this->Organisaties_model->get_record_by_id($this->globorgid);
|
$org = $this->Organisaties_model->get_record_by_id($this->globorgid);
|
||||||
if ($org) {
|
if ($org) {
|
||||||
$menu = $this->Menus_model->getmenu($module, $this->userrole, $org->soort);
|
$menu = $this->Menus_model->getmenu($module, $this->userrole, $org->soort);
|
||||||
@@ -37,7 +44,6 @@ class Menu extends MY_Controller{
|
|||||||
}; // foreach
|
}; // foreach
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}; //if organisatie
|
}; //if organisatie
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -66,35 +72,44 @@ class Menu extends MY_Controller{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo json_encode(array('module' => $module,
|
echo json_encode(array('module' => $module,
|
||||||
'modulenaam' => $modulenaam,
|
'modulenaam' => $modulenaam,
|
||||||
'menu' => $aangepastmenu,
|
'menu' => $aangepastmenu,
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'organisatie' => $organisatie));
|
'organisatie' => $organisatie));
|
||||||
}
|
}
|
||||||
function gethandleidingen(){
|
|
||||||
|
function gethandleidingen()
|
||||||
|
{
|
||||||
$handleidingen = $this->Documenten_model->gethandleidingen($this->globorgid, $this->userrole);
|
$handleidingen = $this->Documenten_model->gethandleidingen($this->globorgid, $this->userrole);
|
||||||
echo json_encode($handleidingen);
|
echo json_encode($handleidingen);
|
||||||
}
|
}
|
||||||
function downloadhandleiding(){
|
|
||||||
|
function downloadhandleiding()
|
||||||
|
{
|
||||||
if (!$this->userid) return;
|
if (!$this->userid) return;
|
||||||
$handleidingid = $this->uri->segment(4);
|
$handleidingid = $this->uri->segment(4);
|
||||||
$handleiding = $this->Documenten_model->get_record_by_id($handleidingid);
|
$handleiding = $this->Documenten_model->get_record_by_id($handleidingid);
|
||||||
|
|
||||||
$this->load->helper('download');
|
$this->load->helper('download');
|
||||||
$data = file_get_contents($this->rootpath ."/documents/".$handleiding->documentnaam);
|
// $data = file_get_contents($this->rootpath ."/documents/".$handleiding->documentnaam);
|
||||||
// $data = file_get_contents("/home/monpas/prod/documents/".$handleiding->documentnaam);//TW: rootpath is verkeerd door symlink
|
|
||||||
|
$data = file_get_contents(MYROOTPATH . '/documents/' . $handleiding->documentnaam);
|
||||||
|
|
||||||
force_download($handleiding->documentnaam, $data);
|
force_download($handleiding->documentnaam, $data);
|
||||||
}
|
}
|
||||||
function getsubmenu(){
|
|
||||||
|
function getsubmenu()
|
||||||
|
{
|
||||||
//TODO clean input
|
//TODO clean input
|
||||||
$pageid = $this->uri->segment(4);
|
$pageid = $this->uri->segment(4);
|
||||||
$org = $this->Organisaties_model->get_record_by_id($this->globorgid);
|
$org = $this->Organisaties_model->get_record_by_id($this->globorgid);
|
||||||
$submenus = $this->Menus_model->getsubmenus($pageid, $this->userrole, $org->soort);
|
$submenus = $this->Menus_model->getsubmenus($pageid, $this->userrole, $org->soort);
|
||||||
echo json_encode($submenus);
|
echo json_encode($submenus);
|
||||||
}
|
}
|
||||||
function getmodule(){
|
|
||||||
|
function getmodule()
|
||||||
|
{
|
||||||
echo json_encode($this->module);
|
echo json_encode($this->module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ define( 'MYROOTPATH', str_replace( 'public/', '', FCPATH ) );
|
|||||||
// Name of the "system" directory
|
// Name of the "system" directory
|
||||||
define( 'SYSDIR', basename( BASEPATH ) );
|
define( 'SYSDIR', basename( BASEPATH ) );
|
||||||
|
|
||||||
|
|
||||||
// The path to the "application" directory
|
// The path to the "application" directory
|
||||||
if ( is_dir( $application_folder ) )
|
if ( is_dir( $application_folder ) )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user