diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 6d6856ff36be8c0113238f04162b3f4847907f50..b8b194e5be60eacaadba61eb589d8ef1ed7a3df4 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1552,12 +1552,14 @@ class DolibarrModules // Can not be abstract, because we need to insta /** * Adds menu entries * - * @return int Error count (0 if OK) + * @return int Error count (0 if OK) */ function insert_menus() { global $user; + if (! is_array($this->menu) || empty($this->menu)) return 0; + require_once DOL_DOCUMENT_ROOT . '/core/class/menubase.class.php'; $err=0; diff --git a/htdocs/core/modules/modFTP.class.php b/htdocs/core/modules/modFTP.class.php index 2c50d3daaf11e6ae28595aa395e1e2fe4d86a85f..f22d402b9795d601ff125483ac04e1776b5bca6a 100644 --- a/htdocs/core/modules/modFTP.class.php +++ b/htdocs/core/modules/modFTP.class.php @@ -110,10 +110,6 @@ class modFTP extends DolibarrModules // Menus //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. - - - // Top menu $this->menu[$r]=array('fk_menu'=>0, 'type'=>'top', 'titre'=>'FTP', diff --git a/htdocs/core/modules/modOpenSurvey.class.php b/htdocs/core/modules/modOpenSurvey.class.php index 7cbfeb1e268903cf97a089a6b125137a85d36dbd..ea10750ad7ccc043a6bf86adabaeccb908658bdc 100644 --- a/htdocs/core/modules/modOpenSurvey.class.php +++ b/htdocs/core/modules/modOpenSurvey.class.php @@ -121,21 +121,7 @@ class modOpenSurvey extends DolibarrModules // Menus //------- - $this->menu = 1; // This module add menu entries. They are coded into menu manager. - /* - $this->menu[$r]=array( 'fk_menu'=>0, // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'top', - 'titre'=>'Surveys', - 'mainmenu'=>'opensurvey', - 'url'=>'/opensurvey/index.php', - 'langs'=>'opensurvey', - 'position'=>200, - 'enabled'=>'$conf->opensurvey->enabled', // Define condition to show or hide menu entry. Use '$conf->NewsSubmitter->enabled' if entry must be visible if module is enabled. - 'perms'=>'$user->rights->opensurvey->read', - 'target'=>'', - 'user'=>0); - $r++;*/ - + $r=0; $this->menu[$r]=array( 'fk_menu'=>'fk_mainmenu=tools', // Use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode 'type'=>'left', 'titre'=>'Survey',