Qual: More POO.
Qual: Doxygen
This commit is contained in:
parent
e11ca0f95a
commit
70521b63ee
@ -59,8 +59,8 @@ class Menubase
|
|||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $DB Database handler
|
* @param DoliDB $DB Database handler
|
||||||
* @param string $menu_handler Menu handler
|
* @param string $menu_handler
|
||||||
* @param string $type Type
|
* @param string $type
|
||||||
*/
|
*/
|
||||||
function Menubase($DB,$menu_handler='',$type='')
|
function Menubase($DB,$menu_handler='',$type='')
|
||||||
{
|
{
|
||||||
@ -167,10 +167,9 @@ class Menubase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update menu entry into database.
|
* Update menu entry into database
|
||||||
*
|
* @param user User that modify
|
||||||
* @param User $user User that modify
|
* @param notrigger 0=no, 1=yes (no update trigger)
|
||||||
* @param int $notrigger 0=no, 1=yes (no update trigger)
|
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($user=0, $notrigger=0)
|
function update($user=0, $notrigger=0)
|
||||||
@ -303,11 +302,10 @@ class Menubase
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/*
|
||||||
* Delete object in database
|
* \brief Delete object in database
|
||||||
*
|
* \param user User that delete
|
||||||
* @param User $user User that delete
|
* \return int <0 if KO, >0 if OK
|
||||||
* @return int <0 if KO, >0 if OK
|
|
||||||
*/
|
*/
|
||||||
function delete($user)
|
function delete($user)
|
||||||
{
|
{
|
||||||
@ -362,11 +360,10 @@ class Menubase
|
|||||||
/**
|
/**
|
||||||
* Complete this->newmenu with menu entry found in $tab
|
* Complete this->newmenu with menu entry found in $tab
|
||||||
*
|
*
|
||||||
* @param array $tab Tab array
|
* @param $tab
|
||||||
* @param int $pere Id of parent
|
* @param $pere
|
||||||
* @param int $rang Rang
|
* @param $rang
|
||||||
* @param string $myleftmenu Value for left that defined leftmenu
|
* @param $myleftmenu Value for left that defined leftmenu
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
function recur($tab, $pere, $rang, $myleftmenu)
|
function recur($tab, $pere, $rang, $myleftmenu)
|
||||||
{
|
{
|
||||||
@ -404,12 +401,10 @@ class Menubase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Load tabMenu array
|
* Load tabMenu array
|
||||||
*
|
* @param type_user 0=Internal,1=External,2=All
|
||||||
* @param string $mainmenu Value for mainmenu that defined top menu
|
* @param mainmenu Value for mainmenu that defined top menu
|
||||||
* @param string $myleftmenu Left menu name
|
* @param menu_handler Name of menu_handler used (auguria, eldy...)
|
||||||
* @param int $type_user 0=Internal,1=External,2=All
|
* @param tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||||
* @param string $menu_handler Name of menu_handler used (auguria, eldy...)
|
|
||||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
|
||||||
* @return array Return array with menu entries for top menu
|
* @return array Return array with menu entries for top menu
|
||||||
*/
|
*/
|
||||||
function menuTopCharger($mainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu=null)
|
function menuTopCharger($mainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu=null)
|
||||||
@ -454,14 +449,13 @@ class Menubase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load entries found in database in a menu array.
|
* Load entries found in database in a menu array
|
||||||
*
|
* @param $newmenu Menu array to complete
|
||||||
* @param array $newmenu Menu array to complete
|
* @param $mainmenu Value for mainmenu that defined top menu of left menu
|
||||||
* @param string $mainmenu Value for mainmenu that defined top menu of left menu
|
* @param $myleftmenu Value that defined leftmenu
|
||||||
* @param string $myleftmenu Value that defined leftmenu
|
* @param $type_user 0=Internal,1=External,2=All
|
||||||
* @param int $type_user 0=Internal,1=External,2=All
|
* @param $menu_handler Name of menu_handler used (auguria, eldy...)
|
||||||
* @param string $menu_handler Name of menu_handler used (auguria, eldy...)
|
* @param $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
||||||
* @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
|
|
||||||
* @return array Menu array for particular mainmenu value or full tabArray
|
* @return array Menu array for particular mainmenu value or full tabArray
|
||||||
*/
|
*/
|
||||||
function menuLeftCharger($newmenu, $mainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu=null)
|
function menuLeftCharger($newmenu, $mainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu=null)
|
||||||
@ -502,12 +496,11 @@ class Menubase
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load entries found in database in a menu array.
|
* Load entries found in database in a menu array
|
||||||
*
|
* @param $myleftmenu Value for left that defined leftmenu
|
||||||
* @param string $myleftmenu Value for left that defined leftmenu
|
* @param $type_user 0=Internal,1=External,2=All
|
||||||
* @param int $type_user 0=Internal,1=External,2=All
|
* @param $menu_handler Name of menu_handler used (auguria, eldy...)
|
||||||
* @param string $menu_handler Name of menu_handler used (auguria, eldy...)
|
* @param $tabMenu If array with menu entries already load, we put this array here (in most cases, it's empty)
|
||||||
* @param array &$tabMenu If array with menu entries already load, we put this array here (in most cases, it's empty)
|
|
||||||
* @return int >0 if OK, <0 if KO
|
* @return int >0 if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function menuLoad($myleftmenu, $type_user, $menu_handler, &$tabMenu=array())
|
function menuLoad($myleftmenu, $type_user, $menu_handler, &$tabMenu=array())
|
||||||
|
|||||||
@ -73,14 +73,14 @@ class Import
|
|||||||
$dir = $dirroot.'/includes/modules';
|
$dir = $dirroot.'/includes/modules';
|
||||||
|
|
||||||
// Search available exports
|
// Search available exports
|
||||||
$handle=@opendir(dol_osencode($dir));
|
$handle=@opendir($dir);
|
||||||
if (! is_resource($handle)) continue;
|
if (is_resource($handle))
|
||||||
|
{
|
||||||
// Search module files
|
// Search module files
|
||||||
while (($file = readdir($handle))!==false)
|
while (($file = readdir($handle))!==false)
|
||||||
{
|
{
|
||||||
if (! preg_match("/^(mod.*)\.class\.php/i",$file,$reg)) continue;
|
if (preg_match("/^(mod.*)\.class\.php/i",$file,$reg))
|
||||||
|
{
|
||||||
$modulename=$reg[1];
|
$modulename=$reg[1];
|
||||||
|
|
||||||
// Defined if module is enabled
|
// Defined if module is enabled
|
||||||
@ -88,9 +88,9 @@ class Import
|
|||||||
$part=strtolower(preg_replace('/^mod/i','',$modulename));
|
$part=strtolower(preg_replace('/^mod/i','',$modulename));
|
||||||
if (empty($conf->$part->enabled)) $enabled=false;
|
if (empty($conf->$part->enabled)) $enabled=false;
|
||||||
|
|
||||||
if (empty($enabled)) continue;
|
if ($enabled)
|
||||||
|
{
|
||||||
// Init load class
|
// Chargement de la classe
|
||||||
$file = $dir."/".$modulename.".class.php";
|
$file = $dir."/".$modulename.".class.php";
|
||||||
$classname = $modulename;
|
$classname = $modulename;
|
||||||
require_once($file);
|
require_once($file);
|
||||||
@ -117,7 +117,10 @@ class Import
|
|||||||
//print $bool." $perm[0]"."<br>";
|
//print $bool." $perm[0]"."<br>";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Load lang file
|
// Permissions ok
|
||||||
|
// if ($bool)
|
||||||
|
// {
|
||||||
|
// Charge fichier lang en rapport
|
||||||
$langtoload=$module->getLangFilesArray();
|
$langtoload=$module->getLangFilesArray();
|
||||||
if (is_array($langtoload))
|
if (is_array($langtoload))
|
||||||
{
|
{
|
||||||
@ -154,11 +157,15 @@ class Import
|
|||||||
|
|
||||||
dol_syslog("Import loaded for module ".$modulename." with index ".$i.", dataset=".$module->import_code[$r].", nb of fields=".count($module->import_fields_code[$r]));
|
dol_syslog("Import loaded for module ".$modulename." with index ".$i.", dataset=".$module->import_code[$r].", nb of fields=".count($module->import_fields_code[$r]));
|
||||||
$i++;
|
$i++;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user