Fix option to not generate doc in modulebuilder.
This commit is contained in:
parent
71910b2181
commit
f7b6895dc6
@ -219,6 +219,7 @@ if ($action == 'presend')
|
|||||||
|
|
||||||
if (!empty($origin) && !empty($origin_id)) {
|
if (!empty($origin) && !empty($origin_id)) {
|
||||||
$element = $subelement = $origin;
|
$element = $subelement = $origin;
|
||||||
|
$regs = array();
|
||||||
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) {
|
||||||
$element = $regs[1];
|
$element = $regs[1];
|
||||||
$subelement = $regs[2];
|
$subelement = $regs[2];
|
||||||
|
|||||||
@ -887,8 +887,10 @@ if ($dirins && $action == 'initobject' && $module && $objectname)
|
|||||||
|
|
||||||
// Edit the setup file and the card page
|
// Edit the setup file and the card page
|
||||||
if (GETPOST('includedocgeneration', 'aZ09')) {
|
if (GETPOST('includedocgeneration', 'aZ09')) {
|
||||||
// TODO
|
// Replace '$includedocgeneration = 0;' into '$includedocgeneration = 1;' into files
|
||||||
// dolReplaceInFile();
|
$arrayreplacement = array('$includedocgeneration = 0;', '$includedocgeneration = 1;');
|
||||||
|
dolReplaceInFile($destdir.'/class/'.strtolower($objectname).'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Scan for object class files
|
// Scan for object class files
|
||||||
|
|||||||
@ -982,6 +982,9 @@ class MyObject extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
|
$result = 0;
|
||||||
|
$includedocgeneration = 0;
|
||||||
|
|
||||||
$langs->load("mymodule@mymodule");
|
$langs->load("mymodule@mymodule");
|
||||||
|
|
||||||
if (!dol_strlen($modele)) {
|
if (!dol_strlen($modele)) {
|
||||||
@ -996,7 +999,11 @@ class MyObject extends CommonObject
|
|||||||
|
|
||||||
$modelpath = "core/modules/mymodule/doc/";
|
$modelpath = "core/modules/mymodule/doc/";
|
||||||
|
|
||||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
if ($includedocgeneration) {
|
||||||
|
$result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user