diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php index 2c7b917d6d2..d5c333c4ade 100644 --- a/htdocs/core/modules/modModuleBuilder.class.php +++ b/htdocs/core/modules/modModuleBuilder.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +60,7 @@ class modModuleBuilder extends DolibarrModules // Config pages //------------- - $this->config_page_url = array(); + $this->config_page_url = array('setup@modulebuilder'); // Dependancies //------------- diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 6638e1fa674..ed3a872d3c6 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -94,4 +94,7 @@ YouCanUseTranslationKey=You can use here a key that is the translation key found DropTableIfEmpty=(Delete table if empty) TableDoesNotExists=The table %s does not exists TableDropped=Table %s deleted -InitStructureFromExistingTable=Build the structure array string of an existing table \ No newline at end of file +InitStructureFromExistingTable=Build the structure array string of an existing table +UseAboutPage=Disallow the about page +UseDocFolder=Disallow the documentation folder +UseSpecificReadme=Use a specific ReadMe \ No newline at end of file diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index f84bf8989ad..5bc1fb7c206 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -73,7 +73,7 @@ if (preg_match('/del_(.*)/', $action, $reg)) { } } - + /* * View */ diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index e844793b601..1d0c7960fda 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -120,6 +120,13 @@ if ($dirins && $action == 'initmodule' && $modulename) setEventMessages($langs->trans("AllFilesDidAlreadyExist", $srcdir, $destdir), null, 'warnings'); } } + + if(!empty($conf->global->MODULEBUILDER_USE_ABOUT)){ + dol_delete_file($destdir.'/admin/about.php'); + } + if(!empty($conf->global->MODULEBUILDER_USE_DOCFOLDER)){ + dol_delete_dir($destdir.'/doc/'); + } // Delete some files dol_delete_file($destdir.'/myobject_card.php'); @@ -165,6 +172,11 @@ if ($dirins && $action == 'initmodule' && $modulename) setEventMessages($langs->trans("ErrorFailToMakeReplacementInto", $phpfileval['fullname']), null, 'errors'); } } + + if(!empty($conf->global->MODULEBUILDER_SPECIFIC_README)){ + dol_delete_file($destdir.'/README.md'); + file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README); + } } if (! $error)