Add a warning to avoid headache

This commit is contained in:
Laurent Destailleur 2019-08-30 02:21:34 +02:00
parent 3abe83b83d
commit 3b96271bd7
2 changed files with 4 additions and 1 deletions

View File

@ -105,6 +105,7 @@ InitStructureFromExistingTable=Build the structure array string of an existing t
UseAboutPage=Disable the about page
UseDocFolder=Disable the documentation folder
UseSpecificReadme=Use a specific ReadMe
ContentOfREADMECustomized=Note: The content of the README.md file has been replaced with the specific value defined into setup of ModuleBuilder.
RealPathOfModule=Real path of module
ContentCantBeEmpty=Content of file can't be empty
WidgetDesc=You can generate and edit here the widgets that will be embedded with your module.

View File

@ -203,6 +203,7 @@ if ($dirins && $action == 'initmodule' && $modulename)
}
$result=dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
//var_dump($result);
if ($result < 0)
{
@ -212,6 +213,7 @@ if ($dirins && $action == 'initmodule' && $modulename)
if (!empty($conf->global->MODULEBUILDER_SPECIFIC_README))
{
setEventMessages($langs->trans("ContentOfREADMECustomized"), null, 'warnings');
dol_delete_file($destdir.'/README.md');
file_put_contents($destdir.'/README.md', $conf->global->MODULEBUILDER_SPECIFIC_README);
}
@ -1412,7 +1414,7 @@ if ($module == 'initmodule')
print '<input type="hidden" name="action" value="initmodule">';
print '<input type="hidden" name="module" value="initmodule">';
print $langs->trans("ModuleBuilderDesc2", 'conf/conf.php', $newdircustom).'<br>';
//print '<span class="opacitymedium">'.$langs->trans("ModuleBuilderDesc2", 'conf/conf.php', $newdircustom).'</span><br>';
print $langs->trans("EnterNameOfModuleDesc").'<br>';
print '<br>';