Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss

This commit is contained in:
Dany De Bontridder 2018-12-27 20:11:54 +01:00
commit 6b2b579bab
30 changed files with 4763 additions and 2080 deletions

View file

@ -1103,10 +1103,18 @@ function show_menu($module)
}
// if file is not a plugin, include the file, otherwise
// include the plugin launcher
if ( $file[0]['me_type'] != 'PL')
if ( $file[0]['me_type'] != 'PL') {
if (file_exists ($file[0]['me_file']) )
{
require_once $file[0]['me_file'];
else
} elseif ( file_exists(NOALYSS_INCLUDE.'/'.$file[0]['me_file'])) {
require_once NOALYSS_INCLUDE.'/'.$file[0]['me_file'];
}else {
echo echo_warning(_("Fichier non trouvé"));
}
} else {
require 'extension_get.inc.php';
}
exit();
}

View file

@ -80,7 +80,9 @@ class HttpInput
throw new Exception(_("Type invalide")."[ $p_name ] = {$this->array[$p_name]}"
, EXC_PARAM_TYPE);
}
$this->array[$p_name]=h($this->array[$p_name]);
if (is_string($this->array )) {
$this->array[$p_name]=h($this->array[$p_name]);
}
}else {
throw new Exception(_("Unknown type"));
}

View file

@ -29,16 +29,21 @@
require_once NOALYSS_INCLUDE.'/lib/html_input.class.php';
class ISelect extends HtmlInput
{
/**
* Constructor , $p_value is supposed to be an array
* @param string $p_name name of the element
* @param array $p_value
* @param DOMID $p_id
*/
function __construct($p_name="", $p_value="", $p_id="")
{
parent::__construct($p_name,$p_value,$p_id);
$this->name=$p_name;
if ( $p_value == "" || ! is_array($p_value)) {
$this->value=array();
} else {
$this->value=$p_value;
}
$this->id=$p_id;
parent::__construct($p_name, $p_value, $p_id);
if ( $p_value =="" )
{
$this->value=[];
} else {
$this->value=$p_value;
}
}
/*!\brief show the html input of the widget*/
public function input($p_name=null,$p_value=null)

View file

@ -810,27 +810,24 @@ function check()
* we translate the code from the database into a hardcoded label
*/
$idx=$p_row[$v];
if ( ! isset($this->a_select[$v][$idx])) {
/*
* Check if index exists
*/
$array_to_search=$this->a_select[$v];
$value=$p_row[$v];
$nb_search=count($array_to_search);
$found=FALSE;
for ( $e=0;$e< $nb_search;$e++) {
if (isset ($array_to_search[$e]['value']) && $array_to_search[$e]['value']==$value ) {
$found=TRUE;
echo td($array_to_search[$e]['label']);
}
/*
* Check if index exists
*/
$array_to_search=$this->a_select[$v];
$value=$p_row[$v];
$nb_search=(is_array($array_to_search))?count($array_to_search):0;
$found=FALSE;
for ( $e=0;$e< $nb_search;$e++) {
if (isset ($array_to_search[$e]['value']) && $array_to_search[$e]['value']==$value ) {
$found=TRUE;
echo td($array_to_search[$e]['label']);
}
}
if ( ! $found) {
echo td("--");
if ( ! $found) {
echo td("--");
}
} else {
echo td($this->a_select[$v][$idx]["label"]);
}
}else {