From bd67313d348f91ecff1cecec57809379aed9a082 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Mon, 14 Aug 2023 12:37:21 +0200 Subject: [PATCH] finish this functionnality --- htdocs/modulebuilder/index.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 77a620e9256..0ce99f75a19 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -2777,15 +2777,21 @@ if ($dirins && $action == "update_props_module" && !empty(GETPOST('keydescriptio if (isset($propertyToUpdate) && !empty(GETPOST('propsmodule'))) { $newValue = GETPOST('propsmodule'); - $lineToReplace = "\$this->$propertyToUpdate = '".$moduleobj->$propertyToUpdate."';"; - $newLine = "\$this->$propertyToUpdate = '$newValue';"; + $lineToReplace = "\t\t\$this->$propertyToUpdate = "; + $newLine = "\t\t\$this->$propertyToUpdate = '$newValue';\n"; //for change version in log file if ($propertyToUpdate === 'version') { dolReplaceInFile($modulelogfile, array("## ".$moduleobj->$propertyToUpdate => $newValue)); } - dolReplaceInFile($moduledescriptorfile, array($lineToReplace => $newLine)); + $fileLines = file($moduledescriptorfile); + foreach ($fileLines as &$line) { + if (strpos($line, $lineToReplace) === 0) { + dolReplaceInFile($moduledescriptorfile, array($line => $newLine)); + break; + } + } clearstatcache(true); if (function_exists('opcache_invalidate')) { @@ -3297,7 +3303,7 @@ if ($module == 'initmodule') { print $langs->trans("Description"); print ''; if ($action == 'edit_moduledescription' && GETPOST('keydescription', 'alpha') === 'desc') { - print ''; + print ''; print ''; print ''; } else { @@ -3339,8 +3345,11 @@ if ($module == 'initmodule') { 'base' => 'ModuleFamilyBase', 'other' => 'ModuleFamilyOther' ); + print ''; foreach ($arrayoffamilies as $key => $value) { - print ''; + if ($key != $moduleobj->family) { + print ''; + } } print ''; print '';