NEW: ADD admin page for modulebuilder
ADD custom README ADD choice to generate about page and documentation folder
This commit is contained in:
parent
7c57b360a3
commit
78b3067de3
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourcefore.net>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
*
|
||||
* 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
|
||||
//-------------
|
||||
|
||||
@ -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
|
||||
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
|
||||
@ -73,7 +73,7 @@ if (preg_match('/del_(.*)/', $action, $reg)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user