add visibility
This commit is contained in:
parent
8b4e920d5e
commit
d608921f1e
@ -82,7 +82,7 @@ class Fiscalyear extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct(DoliDB $db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -98,7 +98,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param User $user User making creation
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user)
|
||||
public function create($user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -159,7 +159,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param User $user User making update
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user)
|
||||
public function update($user)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -203,7 +203,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $id Id of record to load
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id)
|
||||
public function fetch($id)
|
||||
{
|
||||
$sql = "SELECT rowid, label, date_start, date_end, statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear";
|
||||
@ -237,7 +237,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $id Id of record to delete
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($id)
|
||||
public function delete($id)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
@ -264,12 +264,12 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibStatut($mode = 0)
|
||||
public function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->statut, $mode);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Give a label from a status
|
||||
*
|
||||
@ -277,7 +277,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($statut, $mode = 0)
|
||||
public function LibStatut($statut, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
@ -318,7 +318,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $id Id of record
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
public function info($id)
|
||||
{
|
||||
$sql = 'SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,';
|
||||
$sql.= ' fy.tms';
|
||||
@ -364,7 +364,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $dateend Date end to scan
|
||||
* @return string Number of entries
|
||||
*/
|
||||
function getAccountancyEntriesByFiscalYear($datestart, $dateend)
|
||||
public function getAccountancyEntriesByFiscalYear($datestart, $dateend)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -390,7 +390,7 @@ class Fiscalyear extends CommonObject
|
||||
* @param int $dateend Date end to scan
|
||||
* @return string Number of movements
|
||||
*/
|
||||
function getAccountancyMovementsByFiscalYear($datestart, $dateend)
|
||||
public function getAccountancyMovementsByFiscalYear($datestart, $dateend)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -26,63 +26,63 @@
|
||||
*/
|
||||
class GoogleAPI
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
public $key;
|
||||
public $key;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $key Google key
|
||||
*/
|
||||
function __construct($db, $key)
|
||||
{
|
||||
$this->db=$db;
|
||||
$this->key=$key;
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param string $key Google key
|
||||
*/
|
||||
public function __construct($db, $key)
|
||||
{
|
||||
$this->db=$db;
|
||||
$this->key=$key;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return geo coordinates of an address
|
||||
*
|
||||
* @param string $address Address
|
||||
* Example: 68 Grande rue Charles de Gaulle,+94130,+Nogent sur Marne,+France
|
||||
* Example: 188, rue de Fontenay,+94300,+Vincennes,+France
|
||||
* @return string Coordinates
|
||||
*/
|
||||
function getGeoCoordinatesOfAddress($address)
|
||||
{
|
||||
global $conf;
|
||||
/**
|
||||
* Return geo coordinates of an address
|
||||
*
|
||||
* @param string $address Address
|
||||
* Example: 68 Grande rue Charles de Gaulle,+94130,+Nogent sur Marne,+France
|
||||
* Example: 188, rue de Fontenay,+94300,+Vincennes,+France
|
||||
* @return string Coordinates
|
||||
*/
|
||||
public function getGeoCoordinatesOfAddress($address)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$i=0;
|
||||
$i=0;
|
||||
|
||||
// Desired address
|
||||
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key;
|
||||
// Desired address
|
||||
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key;
|
||||
|
||||
// Retrieve the URL contents
|
||||
$page = file_get_contents($urladdress);
|
||||
// Retrieve the URL contents
|
||||
$page = file_get_contents($urladdress);
|
||||
|
||||
$code = strstr($page, '<coordinates>');
|
||||
$code = strstr($code, '>');
|
||||
$val=strpos($code, "<");
|
||||
$code = substr($code, 1, $val-1);
|
||||
//print $code;
|
||||
//print "<br>";
|
||||
$latitude = substr($code, 0, strpos($code, ","));
|
||||
$longitude = substr($code, strpos($code, ",")+1, dol_strlen(strpos($code, ","))-3);
|
||||
$code = strstr($page, '<coordinates>');
|
||||
$code = strstr($code, '>');
|
||||
$val=strpos($code, "<");
|
||||
$code = substr($code, 1, $val-1);
|
||||
//print $code;
|
||||
//print "<br>";
|
||||
$latitude = substr($code, 0, strpos($code, ","));
|
||||
$longitude = substr($code, strpos($code, ",")+1, dol_strlen(strpos($code, ","))-3);
|
||||
|
||||
// Output the coordinates
|
||||
//echo "Longitude: $longitude ',' Latitude: $latitude";
|
||||
// Output the coordinates
|
||||
//echo "Longitude: $longitude ',' Latitude: $latitude";
|
||||
|
||||
$i++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,24 +45,24 @@ class HookManager
|
||||
public $errors = array();
|
||||
|
||||
// Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...)
|
||||
var $contextarray=array();
|
||||
public $contextarray=array();
|
||||
|
||||
// Array with instantiated classes
|
||||
var $hooks=array();
|
||||
public $hooks=array();
|
||||
|
||||
// Array result
|
||||
var $resArray=array();
|
||||
public $resArray=array();
|
||||
// Printable result
|
||||
var $resPrint='';
|
||||
public $resPrint='';
|
||||
// Nb of qualified hook ran
|
||||
var $resNbOfHooks=0;
|
||||
public $resNbOfHooks=0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
@ -79,7 +79,7 @@ class HookManager
|
||||
* @param string[] $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ...
|
||||
* @return int Always 1
|
||||
*/
|
||||
function initHooks($arraycontext)
|
||||
public function initHooks($arraycontext)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -125,18 +125,18 @@ class HookManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute hooks (if they were initialized) for the given method
|
||||
* Execute hooks (if they were initialized) for the given method
|
||||
*
|
||||
* @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...)
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $object Object to use hooks on
|
||||
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
||||
* @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
|
||||
* $this->error or this->errors are also defined by class called by this function if error.
|
||||
* @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...)
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $object Object to use hooks on
|
||||
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
|
||||
* @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
|
||||
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
|
||||
* $this->error or this->errors are also defined by class called by this function if error.
|
||||
*/
|
||||
function executeHooks($method, $parameters = array(), &$object = '', &$action = '')
|
||||
public function executeHooks($method, $parameters = array(), &$object = '', &$action = '')
|
||||
{
|
||||
if (! is_array($this->hooks) || empty($this->hooks)) return '';
|
||||
|
||||
@ -145,7 +145,7 @@ class HookManager
|
||||
|
||||
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
|
||||
$hooktype='output';
|
||||
if (in_array(
|
||||
if (in_array(
|
||||
$method,
|
||||
array(
|
||||
'addCalendarChoice',
|
||||
@ -204,10 +204,9 @@ if (in_array(
|
||||
)
|
||||
)) $hooktype='addreplace';
|
||||
|
||||
if ($method == 'insertExtraFields')
|
||||
{
|
||||
$hooktype='returnvalue'; // @deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
|
||||
dol_syslog("Warning: The hook 'insertExtraFields' is deprecated and must not be used. Use instead trigger on CRUD event (ask it to dev team if not implemented)", LOG_WARNING);
|
||||
if ($method == 'insertExtraFields') {
|
||||
$hooktype='returnvalue'; // @deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
|
||||
dol_syslog("Warning: The hook 'insertExtraFields' is deprecated and must not be used. Use instead trigger on CRUD event (ask it to dev team if not implemented)", LOG_WARNING);
|
||||
}
|
||||
|
||||
// Init return properties
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -76,7 +76,7 @@ class FormSms
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
@ -92,7 +92,7 @@ class FormSms
|
||||
$this->withbodyreadonly=0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Show the form to input an sms.
|
||||
*
|
||||
@ -100,7 +100,7 @@ class FormSms
|
||||
* @param int $showform Show form tags and submit button (recommanded is to use with value 0)
|
||||
* @return void
|
||||
*/
|
||||
function show_form($morecss = 'titlefield', $showform = 1)
|
||||
public function show_form($morecss = 'titlefield', $showform = 1)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $user, $form;
|
||||
|
||||
@ -27,15 +27,15 @@
|
||||
*/
|
||||
class InfoBox
|
||||
{
|
||||
/**
|
||||
* Name of positions 0=Home, 1=...
|
||||
*
|
||||
* @return string[] Array with list of zones
|
||||
*/
|
||||
static function getListOfPagesForBoxes()
|
||||
{
|
||||
return array(0=>'Home');
|
||||
}
|
||||
/**
|
||||
* Name of positions 0=Home, 1=...
|
||||
*
|
||||
* @return string[] Array with list of zones
|
||||
*/
|
||||
public static function getListOfPagesForBoxes()
|
||||
{
|
||||
return array(0=>'Home');
|
||||
}
|
||||
|
||||
/**
|
||||
* Return array of boxes qualified for area and user
|
||||
@ -48,7 +48,7 @@ class InfoBox
|
||||
* @param int $includehidden Include also hidden boxes
|
||||
* @return array Array of boxes
|
||||
*/
|
||||
static function listBoxes($db, $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1)
|
||||
public static function listBoxes($db, $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -68,10 +68,10 @@ class InfoBox
|
||||
$sql.= " ORDER BY b.box_order";
|
||||
}
|
||||
else // available
|
||||
{
|
||||
{
|
||||
$sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d";
|
||||
$sql.= " WHERE d.entity IN (0,".$conf->entity.")";
|
||||
$sql.= " WHERE d.entity IN (0,".$conf->entity.")";
|
||||
}
|
||||
|
||||
dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')."", LOG_DEBUG);
|
||||
@ -97,17 +97,17 @@ class InfoBox
|
||||
{
|
||||
$boxname=preg_replace('/\.php$/i', '', $obj->file);
|
||||
$relsourcefile = "/core/boxes/".$boxname.".php";
|
||||
}
|
||||
}
|
||||
|
||||
//print $obj->box_id.'-'.$boxname.'-'.$relsourcefile.'<br>';
|
||||
//print $obj->box_id.'-'.$boxname.'-'.$relsourcefile.'<br>';
|
||||
|
||||
// TODO PERF Do not make "dol_include_once" here, nor "new" later. This means, we must store a 'depends' field to store modules list, then
|
||||
// TODO PERF Do not make "dol_include_once" here, nor "new" later. This means, we must store a 'depends' field to store modules list, then
|
||||
// the "enabled" condition for modules forbidden for external users and the depends condition can be done.
|
||||
// Goal is to avoid making a "new" done for each boxes returned by select.
|
||||
dol_include_once($relsourcefile);
|
||||
if (class_exists($boxname))
|
||||
{
|
||||
$box=new $boxname($db, $obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params.
|
||||
$box=new $boxname($db, $obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params.
|
||||
//$box=new stdClass();
|
||||
|
||||
// box properties
|
||||
@ -117,9 +117,9 @@ class InfoBox
|
||||
$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
|
||||
$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
|
||||
$box->sourcefile= $relsourcefile;
|
||||
$box->class = $boxname;
|
||||
$box->class = $boxname;
|
||||
|
||||
if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database
|
||||
if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database
|
||||
{
|
||||
if (is_numeric($box->box_order))
|
||||
{
|
||||
@ -138,19 +138,19 @@ class InfoBox
|
||||
{
|
||||
foreach($box->depends as $moduleelem)
|
||||
{
|
||||
$arrayelem=explode('|', $moduleelem);
|
||||
$tmpenabled=0; // $tmpenabled is used for the '|' test (OR)
|
||||
foreach($arrayelem as $module)
|
||||
{
|
||||
$tmpmodule=preg_replace('/@[^@]+/', '', $module);
|
||||
if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1;
|
||||
//print $boxname.'-'.$module.'-module enabled='.(empty($conf->$tmpmodule->enabled)?0:1).'<br>';
|
||||
}
|
||||
if (empty($tmpenabled)) // We found at least one module required that is disabled
|
||||
{
|
||||
$enabled=0;
|
||||
break;
|
||||
}
|
||||
$arrayelem=explode('|', $moduleelem);
|
||||
$tmpenabled=0; // $tmpenabled is used for the '|' test (OR)
|
||||
foreach($arrayelem as $module)
|
||||
{
|
||||
$tmpmodule=preg_replace('/@[^@]+/', '', $module);
|
||||
if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1;
|
||||
//print $boxname.'-'.$module.'-module enabled='.(empty($conf->$tmpmodule->enabled)?0:1).'<br>';
|
||||
}
|
||||
if (empty($tmpenabled)) // We found at least one module required that is disabled
|
||||
{
|
||||
$enabled=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//print '=>'.$boxname.'-enabled='.$enabled.'<br>';
|
||||
@ -160,16 +160,16 @@ class InfoBox
|
||||
else unset($box);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("Failed to load box '".$boxname."' into file '".$relsourcefile."'", LOG_WARNING);
|
||||
}
|
||||
{
|
||||
dol_syslog("Failed to load box '".$boxname."' into file '".$relsourcefile."'", LOG_WARNING);
|
||||
}
|
||||
}
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog($db->lasterror(), LOG_ERR);
|
||||
{
|
||||
dol_syslog($db->lasterror(), LOG_ERR);
|
||||
return array('error'=>$db->lasterror());
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ class InfoBox
|
||||
* @param int $userid Id of user
|
||||
* @return int <0 if KO, 0=Nothing done, > 0 if OK
|
||||
*/
|
||||
static function saveboxorder($db, $zone, $boxorder, $userid = 0)
|
||||
public static function saveboxorder($db, $zone, $boxorder, $userid = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -36,24 +36,24 @@ class Interfaces
|
||||
*/
|
||||
public $db;
|
||||
|
||||
var $dir; // Directory with all core and external triggers files
|
||||
public $dir; // Directory with all core and external triggers files
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
public function __construct($db)
|
||||
{
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Function called when a Dolibarr business event occurs
|
||||
* This function call all qualified triggers.
|
||||
@ -65,15 +65,15 @@ class Interfaces
|
||||
* @param Conf $conf Objet conf
|
||||
* @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.
|
||||
*/
|
||||
function run_triggers($action, $object, $user, $langs, $conf)
|
||||
public function run_triggers($action, $object, $user, $langs, $conf)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Check parameters
|
||||
if (! is_object($object) || ! is_object($conf)) // Error
|
||||
{
|
||||
$this->error='function run_triggers called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf);
|
||||
$this->error='function run_triggers called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf);
|
||||
dol_syslog(get_class($this).'::run_triggers '.$this->error, LOG_ERR);
|
||||
$this->errors[]=$this->error;
|
||||
$this->errors[]=$this->error;
|
||||
return -1;
|
||||
}
|
||||
if (! is_object($langs)) // Warning
|
||||
@ -93,10 +93,10 @@ class Interfaces
|
||||
$files = array();
|
||||
$modules = array();
|
||||
$orders = array();
|
||||
$i=0;
|
||||
$i=0;
|
||||
|
||||
|
||||
$dirtriggers=array_merge(array('/core/triggers'), $conf->modules_parts['triggers']);
|
||||
$dirtriggers=array_merge(array('/core/triggers'), $conf->modules_parts['triggers']);
|
||||
foreach($dirtriggers as $reldir)
|
||||
{
|
||||
$dir=dol_buildpath($reldir, 0);
|
||||
@ -113,9 +113,9 @@ class Interfaces
|
||||
{
|
||||
if (is_readable($newdir."/".$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php$/i', $file, $reg))
|
||||
{
|
||||
$part1=$reg[1];
|
||||
$part2=$reg[2];
|
||||
$part3=$reg[3];
|
||||
$part1=$reg[1];
|
||||
$part2=$reg[2];
|
||||
$part3=$reg[3];
|
||||
|
||||
$nbfile++;
|
||||
|
||||
@ -177,22 +177,22 @@ class Interfaces
|
||||
$objMod = new $modName($this->db);
|
||||
if ($objMod)
|
||||
{
|
||||
$result=0;
|
||||
$result=0;
|
||||
|
||||
if (method_exists($objMod, 'runTrigger')) // New method to implement
|
||||
{
|
||||
//dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG);
|
||||
$result=$objMod->runTrigger($action, $object, $user, $langs, $conf);
|
||||
}
|
||||
elseif (method_exists($objMod, 'run_trigger')) // Deprecated method
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING);
|
||||
$result=$objMod->run_trigger($action, $object, $user, $langs, $conf);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR);
|
||||
}
|
||||
if (method_exists($objMod, 'runTrigger')) // New method to implement
|
||||
{
|
||||
//dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG);
|
||||
$result=$objMod->runTrigger($action, $object, $user, $langs, $conf);
|
||||
}
|
||||
elseif (method_exists($objMod, 'run_trigger')) // Deprecated method
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING);
|
||||
$result=$objMod->run_trigger($action, $object, $user, $langs, $conf);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR);
|
||||
}
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
@ -217,7 +217,7 @@ class Interfaces
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR);
|
||||
}
|
||||
}
|
||||
@ -238,10 +238,10 @@ class Interfaces
|
||||
* Return list of triggers. Function used by admin page htdoc/admin/triggers.
|
||||
* List is sorted by trigger filename so by priority to run.
|
||||
*
|
||||
* @param array $forcedirtriggers null=All default directories. This parameter is used by modulebuilder module only.
|
||||
* @param array $forcedirtriggers null=All default directories. This parameter is used by modulebuilder module only.
|
||||
* @return array Array list of triggers
|
||||
*/
|
||||
function getTriggersList($forcedirtriggers = null)
|
||||
public function getTriggersList($forcedirtriggers = null)
|
||||
{
|
||||
global $conf, $langs, $db;
|
||||
|
||||
@ -256,7 +256,7 @@ class Interfaces
|
||||
$dirtriggers=array_merge(array('/core/triggers/'), $conf->modules_parts['triggers']);
|
||||
if (is_array($forcedirtriggers))
|
||||
{
|
||||
$dirtriggers=$forcedirtriggers;
|
||||
$dirtriggers=$forcedirtriggers;
|
||||
}
|
||||
|
||||
foreach($dirtriggers as $reldir)
|
||||
@ -276,9 +276,9 @@ class Interfaces
|
||||
{
|
||||
if (preg_match('/\.back$/', $file)) continue;
|
||||
|
||||
$part1=$reg[1];
|
||||
$part2=$reg[2];
|
||||
$part3=$reg[3];
|
||||
$part1=$reg[1];
|
||||
$part2=$reg[2];
|
||||
$part3=$reg[3];
|
||||
|
||||
$modName = 'Interface'.ucfirst($reg[3]);
|
||||
//print "file=$file"; print "modName=$modName"; exit;
|
||||
@ -319,8 +319,8 @@ class Interfaces
|
||||
|
||||
if (! class_exists($modName))
|
||||
{
|
||||
print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."<br>\n";
|
||||
continue;
|
||||
print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."<br>\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
$objMod = new $modName($db);
|
||||
@ -342,7 +342,7 @@ class Interfaces
|
||||
$triggers[$j]['module']=strtolower($module);
|
||||
}
|
||||
|
||||
// We set info of modules
|
||||
// We set info of modules
|
||||
$triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto):img_object('', 'generic');
|
||||
$triggers[$j]['file'] = $files[$key];
|
||||
$triggers[$j]['fullpath'] = $fullpath[$key];
|
||||
|
||||
@ -42,78 +42,78 @@ class Ldap
|
||||
/**
|
||||
* Tableau des serveurs (IP addresses ou nom d'hotes)
|
||||
*/
|
||||
var $server=array();
|
||||
public $server=array();
|
||||
|
||||
/**
|
||||
* Base DN (e.g. "dc=foo,dc=com")
|
||||
*/
|
||||
var $dn;
|
||||
public $dn;
|
||||
/**
|
||||
* type de serveur, actuellement OpenLdap et Active Directory
|
||||
*/
|
||||
var $serverType;
|
||||
public $serverType;
|
||||
/**
|
||||
* Version du protocole ldap
|
||||
*/
|
||||
var $domain;
|
||||
public $domain;
|
||||
/**
|
||||
* User administrateur Ldap
|
||||
* Active Directory ne supporte pas les connexions anonymes
|
||||
*/
|
||||
var $searchUser;
|
||||
public $searchUser;
|
||||
/**
|
||||
* Mot de passe de l'administrateur
|
||||
* Active Directory ne supporte pas les connexions anonymes
|
||||
*/
|
||||
var $searchPassword;
|
||||
public $searchPassword;
|
||||
/**
|
||||
* DN des utilisateurs
|
||||
*/
|
||||
var $people;
|
||||
public $people;
|
||||
/**
|
||||
* DN des groupes
|
||||
*/
|
||||
var $groups;
|
||||
public $groups;
|
||||
/**
|
||||
* Code erreur retourne par le serveur Ldap
|
||||
*/
|
||||
var $ldapErrorCode;
|
||||
public $ldapErrorCode;
|
||||
/**
|
||||
* Message texte de l'erreur
|
||||
*/
|
||||
var $ldapErrorText;
|
||||
public $ldapErrorText;
|
||||
|
||||
|
||||
//Fetch user
|
||||
var $name;
|
||||
var $firstname;
|
||||
var $login;
|
||||
var $phone;
|
||||
var $skype;
|
||||
var $fax;
|
||||
var $mail;
|
||||
var $mobile;
|
||||
public $name;
|
||||
public $firstname;
|
||||
public $login;
|
||||
public $phone;
|
||||
public $skype;
|
||||
public $fax;
|
||||
public $mail;
|
||||
public $mobile;
|
||||
|
||||
var $uacf;
|
||||
var $pwdlastset;
|
||||
public $uacf;
|
||||
public $pwdlastset;
|
||||
|
||||
var $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded
|
||||
public $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded
|
||||
|
||||
|
||||
/**
|
||||
* The internal LDAP connection handle
|
||||
*/
|
||||
var $connection;
|
||||
public $connection;
|
||||
/**
|
||||
* Result of any connections etc.
|
||||
*/
|
||||
var $result;
|
||||
public $result;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -149,7 +149,7 @@ class Ldap
|
||||
|
||||
// Connection handling methods -------------------------------------------
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Connect and bind
|
||||
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
|
||||
@ -157,7 +157,7 @@ class Ldap
|
||||
*
|
||||
* @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
|
||||
*/
|
||||
function connect_bind()
|
||||
public function connect_bind()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs, $conf;
|
||||
@ -290,7 +290,7 @@ class Ldap
|
||||
*
|
||||
* @return boolean true or false
|
||||
*/
|
||||
function close()
|
||||
public function close()
|
||||
{
|
||||
if ($this->connection && ! @ldap_close($this->connection))
|
||||
{
|
||||
@ -308,7 +308,7 @@ class Ldap
|
||||
*
|
||||
* @return boolean true or false
|
||||
*/
|
||||
function bind()
|
||||
public function bind()
|
||||
{
|
||||
if (! $this->result=@ldap_bind($this->connection))
|
||||
{
|
||||
@ -333,7 +333,7 @@ class Ldap
|
||||
* @param string $pass Password
|
||||
* @return boolean true or false
|
||||
*/
|
||||
function bindauth($bindDn, $pass)
|
||||
public function bindauth($bindDn, $pass)
|
||||
{
|
||||
if (! $this->result = @ldap_bind($this->connection, $bindDn, $pass))
|
||||
{
|
||||
@ -353,7 +353,7 @@ class Ldap
|
||||
*
|
||||
* @return boolean true or false
|
||||
*/
|
||||
function unbind()
|
||||
public function unbind()
|
||||
{
|
||||
if (!$this->result=@ldap_unbind($this->connection))
|
||||
{
|
||||
@ -369,7 +369,7 @@ class Ldap
|
||||
*
|
||||
* @return string version
|
||||
*/
|
||||
function getVersion()
|
||||
public function getVersion()
|
||||
{
|
||||
$version = 0;
|
||||
$version = @ldap_get_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $version);
|
||||
@ -410,7 +410,7 @@ class Ldap
|
||||
* @param User $user Objet user that create
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function add($dn, $info, $user)
|
||||
public function add($dn, $info, $user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -464,7 +464,7 @@ class Ldap
|
||||
* @param User $user Objet user that modify
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function modify($dn, $info, $user)
|
||||
public function modify($dn, $info, $user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -518,7 +518,7 @@ class Ldap
|
||||
* @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
||||
public function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -569,7 +569,7 @@ class Ldap
|
||||
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) (for ldap_rename)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($dn, $info, $user, $olddn, $newrdn = false, $newparent = false)
|
||||
public function update($dn, $info, $user, $olddn, $newrdn = false, $newparent = false)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -629,7 +629,7 @@ class Ldap
|
||||
* @param string $dn DN entry key
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($dn)
|
||||
public function delete($dn)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -656,7 +656,7 @@ class Ldap
|
||||
return -1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Build a LDAP message
|
||||
*
|
||||
@ -664,7 +664,7 @@ class Ldap
|
||||
* @param array $info Attributes array
|
||||
* @return string Content of file
|
||||
*/
|
||||
function dump_content($dn, $info)
|
||||
public function dump_content($dn, $info)
|
||||
{
|
||||
// phpcs:enable
|
||||
$content='';
|
||||
@ -707,7 +707,7 @@ class Ldap
|
||||
* @param array $info Attributes array
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function dump($dn, $info)
|
||||
public function dump($dn, $info)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -741,7 +741,7 @@ class Ldap
|
||||
* @param int $timeout Timeout in second (default 1s)
|
||||
* @return boolean true or false
|
||||
*/
|
||||
function serverPing($host, $port = 389, $timeout = 1)
|
||||
public function serverPing($host, $port = 389, $timeout = 1)
|
||||
{
|
||||
// Replace ldaps:// by ssl://
|
||||
if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/', $host, $regs)) {
|
||||
@ -771,7 +771,7 @@ class Ldap
|
||||
* @param User $user Objet user that create
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function addAttribute($dn, $info, $user)
|
||||
public function addAttribute($dn, $info, $user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -823,7 +823,7 @@ class Ldap
|
||||
* @param User $user Objet user that create
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function updateAttribute($dn, $info, $user)
|
||||
public function updateAttribute($dn, $info, $user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -875,7 +875,7 @@ class Ldap
|
||||
* @param User $user Objet user that create
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function deleteAttribute($dn, $info, $user)
|
||||
public function deleteAttribute($dn, $info, $user)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -925,7 +925,7 @@ class Ldap
|
||||
* @param string $filter Filter
|
||||
* @return int|array <0 or false if KO, array if OK
|
||||
*/
|
||||
function getAttribute($dn, $filter)
|
||||
public function getAttribute($dn, $filter)
|
||||
{
|
||||
// Check parameters
|
||||
if (! $this->connection)
|
||||
@ -970,7 +970,7 @@ class Ldap
|
||||
* @param string $attribute Attributes
|
||||
* @return void
|
||||
*/
|
||||
function getAttributeValues($filterrecord, $attribute)
|
||||
public function getAttributeValues($filterrecord, $attribute)
|
||||
{
|
||||
$attributes=array();
|
||||
$attributes[0] = $attribute;
|
||||
@ -1015,7 +1015,7 @@ class Ldap
|
||||
* @param array $attributeAsArray Array of fields wanted as an array not a string
|
||||
* @return array Array of [id_record][ldap_field]=value
|
||||
*/
|
||||
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter = 0, $attributeAsArray = array())
|
||||
public function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter = 0, $attributeAsArray = array())
|
||||
{
|
||||
$fulllist=array();
|
||||
|
||||
@ -1123,7 +1123,7 @@ class Ldap
|
||||
* @param string $hex Hex value
|
||||
* @return string Little endian
|
||||
*/
|
||||
function littleEndian($hex)
|
||||
public function littleEndian($hex)
|
||||
{
|
||||
for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) {
|
||||
$result .= substr($hex, $x, 2);
|
||||
@ -1139,7 +1139,7 @@ class Ldap
|
||||
* @param string $ldapUser Login de l'utilisateur
|
||||
* @return string Sid
|
||||
*/
|
||||
function getObjectSid($ldapUser)
|
||||
public function getObjectSid($ldapUser)
|
||||
{
|
||||
$criteria = '('.$this->getUserIdentifier().'='.$ldapUser.')';
|
||||
$justthese = array("objectsid");
|
||||
@ -1198,7 +1198,7 @@ class Ldap
|
||||
* @param string $binsid Binary SID
|
||||
* @return string Textual SID
|
||||
*/
|
||||
function binSIDtoText($binsid)
|
||||
public function binSIDtoText($binsid)
|
||||
{
|
||||
$hex_sid=bin2hex($binsid);
|
||||
$rev = hexdec(substr($hex_sid, 0, 2)); // Get revision-part of SID
|
||||
@ -1224,7 +1224,7 @@ class Ldap
|
||||
* @param string $filter Search filter (ex: (sn=nom_personne) )
|
||||
* @return array|int Array with answers (key lowercased - value)
|
||||
*/
|
||||
function search($checkDn, $filter)
|
||||
public function search($checkDn, $filter)
|
||||
{
|
||||
dol_syslog(get_class($this)."::search checkDn=".$checkDn." filter=".$filter);
|
||||
|
||||
@ -1260,7 +1260,7 @@ class Ldap
|
||||
* Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com)
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
function fetch($user, $filter)
|
||||
public function fetch($user, $filter)
|
||||
{
|
||||
// Perform the search and get the entry handles
|
||||
|
||||
@ -1353,7 +1353,7 @@ class Ldap
|
||||
*
|
||||
* @return string Login
|
||||
*/
|
||||
function getUserIdentifier()
|
||||
public function getUserIdentifier()
|
||||
{
|
||||
if ($this->serverType == "activedirectory") {
|
||||
return $this->attr_sambalogin;
|
||||
@ -1368,7 +1368,7 @@ class Ldap
|
||||
* @param string $uacf UACF
|
||||
* @return void
|
||||
*/
|
||||
function parseUACF($uacf)
|
||||
public function parseUACF($uacf)
|
||||
{
|
||||
//All flags array
|
||||
$flags = array(
|
||||
@ -1414,7 +1414,7 @@ class Ldap
|
||||
* @param string $samtype SamType
|
||||
* @return string Sam string
|
||||
*/
|
||||
function parseSAT($samtype)
|
||||
public function parseSAT($samtype)
|
||||
{
|
||||
$stypes = array(
|
||||
805306368 => "NORMAL_ACCOUNT",
|
||||
@ -1438,14 +1438,14 @@ class Ldap
|
||||
return($retval);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Convertit le temps ActiveDirectory en Unix timestamp
|
||||
*
|
||||
* @param string $value AD time to convert
|
||||
* @return integer Unix timestamp
|
||||
*/
|
||||
function convert_time($value)
|
||||
public function convert_time($value)
|
||||
{
|
||||
// phpcs:enable
|
||||
$dateLargeInt=$value; // nano secondes depuis 1601 !!!!
|
||||
@ -1478,7 +1478,7 @@ class Ldap
|
||||
* @param string $pagecodeto Page code for result string
|
||||
* @return string Converted string
|
||||
*/
|
||||
function convFromOutputCharset($str, $pagecodeto = 'UTF-8')
|
||||
public function convFromOutputCharset($str, $pagecodeto = 'UTF-8')
|
||||
{
|
||||
global $conf;
|
||||
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);
|
||||
@ -1493,7 +1493,7 @@ class Ldap
|
||||
* @param string $keygroup Key of group
|
||||
* @return int gid number
|
||||
*/
|
||||
function getNextGroupGid($keygroup = 'LDAP_KEY_GROUPS')
|
||||
public function getNextGroupGid($keygroup = 'LDAP_KEY_GROUPS')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -150,11 +150,11 @@ class Link extends CommonObject
|
||||
}
|
||||
|
||||
/**
|
||||
* Update parameters of third party
|
||||
* Update parameters of third party
|
||||
*
|
||||
* @param User $user User executing update
|
||||
* @param int $call_trigger 0=no, 1=yes
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
* @param User $user User executing update
|
||||
* @param int $call_trigger 0=no, 1=yes
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function update($user = '', $call_trigger = 1)
|
||||
{
|
||||
|
||||
@ -28,14 +28,14 @@
|
||||
*/
|
||||
class Menu
|
||||
{
|
||||
var $liste;
|
||||
public $liste;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor
|
||||
*/
|
||||
function __construct()
|
||||
public function __construct()
|
||||
{
|
||||
$this->liste = array();
|
||||
$this->liste = array();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -43,7 +43,7 @@ class Menu
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function clear()
|
||||
public function clear()
|
||||
{
|
||||
$this->liste = array();
|
||||
}
|
||||
@ -65,15 +65,15 @@ class Menu
|
||||
* @param string $prefix Prefix to title (image or picto)
|
||||
* @return void
|
||||
*/
|
||||
function add($url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '')
|
||||
public function add($url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '')
|
||||
{
|
||||
$this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix);
|
||||
$this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a menu entry into this->liste
|
||||
*
|
||||
* @param int $idafter Array key after which inserting new entry
|
||||
* @param int $idafter Array key after which inserting new entry
|
||||
* @param string $url Url to follow on click
|
||||
* @param string $titre Label of menu to add
|
||||
* @param integer $level Level of menu to add
|
||||
@ -88,7 +88,7 @@ class Menu
|
||||
* @param string $prefix Prefix to title (image or picto)
|
||||
* @return void
|
||||
*/
|
||||
function insert($idafter, $url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '')
|
||||
public function insert($idafter, $url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '')
|
||||
{
|
||||
$array_start = array_slice($this->liste, 0, ($idafter+1));
|
||||
$array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix));
|
||||
@ -96,13 +96,13 @@ class Menu
|
||||
$this->liste=array_merge($array_start, $array_new, $array_end);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Remove a menu entry from this->liste
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function remove_last()
|
||||
public function remove_last()
|
||||
{
|
||||
// phpcs:enable
|
||||
if (count($this->liste) > 1) {
|
||||
@ -115,7 +115,7 @@ class Menu
|
||||
*
|
||||
* @return int Number of visible (gray or not) menu entries
|
||||
*/
|
||||
function getNbOfVisibleMenuEntries()
|
||||
public function getNbOfVisibleMenuEntries()
|
||||
{
|
||||
$nb=0;
|
||||
foreach($this->liste as $val)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user