Files
MoniqueandClaude Opus 5.5 172fcf566c CodeIgniter 3.1.11 -> 3.4.5 (pocketarc fork) en PHP 8.3-fixes
- system/ vervangen door CodeIgniter 3.4.5 (pocketarc/codeigniter, PHP 8.2-8.5 compatibel)
- config.php, mimes.php, user_agents.php en error-views bijgewerkt naar 3.4.5
- composer.json: php-constraint "^7.4 || ^8.0" zodat composer install op 8.3 werkt
- PHP 8-fatals opgelost: count()/array-functies op FALSE/null, rekenen met lege
  strings, delen door nul, property zetten op FALSE, curly-brace string offsets,
  ongedefinieerde constanten, foute curl_setopt in Phantom_model::create_img
- dynamic properties gedeclareerd in libraries, optionele parameters voor verplichte opgelost
- vergelijkingen waar '' == 0 in PHP 8 anders uitvalt gecast naar (int)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 09:34:46 +02:00

97 lines
2.9 KiB
PHP

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Functies extends MY_Controller
{
function __construct()
{
parent::__construct();
$models = array("shared/Functies_model",
"shared/Functies_modules_model",
"monpas/Modules_model");
$this->load->model($models);
$this->load->helper('string');
if (!$this->check_online_status()) {
echo json_encode(array('offline' => TRUE));
die;
};// if
}
function getModules()
{
$modules = $this->Modules_model->getallmodules();
if ($modules) {
echo json_encode($modules);
} else {
echo false;
}
}
function getFuncties()
{
$moduleid = $this->uri->segment(4);
$functies = $this->Functies_model->getFuncties();
$functiesmodule = $this->Functies_model->getFunctiesBijModule($moduleid);
if ($functies) {
foreach ($functies as $functie) {
$functie->doelgroep = 'F';
if ($functiesmodule) {
foreach ($functiesmodule as $gekoppeld) {
if ($functie->functie_id == $gekoppeld->functie_id) {//vergelijkt de functie_ids van de functies met de functies die bij de module hooren
$functie->doelgroep = 'T'; //indien hetzelfde: doelgroep = true
}
}
}
}
if ($functies) {
$test = (array)$functies;
usort($test, array($this, 'opDoelgroep'));
}
echo json_encode($test);
} else {
echo json_encode(false);
}
}
function newModuleFunctieKoppeling(){
$moduleid = $this->clean_input("moduleid");
$functieid = $this->clean_input("functieid");
if($moduleid && $functieid) {
$data = array(
'module_id' => $moduleid,
'functie_id' => $functieid
);
$this->Functies_modules_model->save_record($data, false);
echo json_encode('ok');
}
else{
echo json_encode(false);
}
}
function deleteModuleFunctieKoppeling(){
$moduleid = $this->clean_input("moduleid");
$functieid = $this->clean_input("functieid");
if($moduleid && $functieid) {
$where = array(
'module_id' => $moduleid,
'functie_id' => $functieid
);
$this->Functies_modules_model->delete_record_where($where);
echo json_encode('ok');
}
else{
echo json_encode(false);
}
}
private function opDoelgroep($a, $b)
{
return strcmp($b->doelgroep, $a->doelgroep);
}
}