';
- print '
'.$langs->trans("PageForList").' :
'.(dol_is_file($realpathtolist) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolist).(dol_is_file($realpathtolist) ? '' : '').'';
+ print '
'.$langs->trans("PageForList").' :
'.(dol_is_file($realpathtolist) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtolist).(dol_is_file($realpathtolist) ? '' : '').'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
- print '
'.$langs->trans("PageForCreateEditView").' :
'.(dol_is_file($realpathtocard) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocard).(dol_is_file($realpathtocard) ? '' : '').'?action=create';
+ print '
'.$langs->trans("PageForCreateEditView").' :
'.(dol_is_file($realpathtocard) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocard).(dol_is_file($realpathtocard) ? '' : '').'?action=create';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
// Page contact
- print '
'.$langs->trans("PageForContactTab").' :
'.(dol_is_file($realpathtocontact) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocontact).(dol_is_file($realpathtocontact) ? '' : '').'';
+ print '
'.$langs->trans("PageForContactTab").' :
'.(dol_is_file($realpathtocontact) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtocontact).(dol_is_file($realpathtocontact) ? '' : '').'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
if (dol_is_file($realpathtocontact)) {
print ' ';
@@ -2764,7 +2656,7 @@ if ($module == 'initmodule') {
}
print '
';
// Page document
- print '
'.$langs->trans("PageForDocumentTab").' :
'.(dol_is_file($realpathtodocument) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtodocument).(dol_is_file($realpathtodocument) ? '' : '').'';
+ print '
'.$langs->trans("PageForDocumentTab").' :
'.(dol_is_file($realpathtodocument) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtodocument).(dol_is_file($realpathtodocument) ? '' : '').'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
if (dol_is_file($realpathtodocument)) {
print ' ';
@@ -2774,7 +2666,7 @@ if ($module == 'initmodule') {
}
print '
';
// Page notes
- print '
'.$langs->trans("PageForNoteTab").' :
'.(dol_is_file($realpathtonote) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtonote).(dol_is_file($realpathtonote) ? '' : '').'';
+ print '
'.$langs->trans("PageForNoteTab").' :
'.(dol_is_file($realpathtonote) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtonote).(dol_is_file($realpathtonote) ? '' : '').'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
if (dol_is_file($realpathtonote)) {
print ' ';
@@ -2784,7 +2676,7 @@ if ($module == 'initmodule') {
}
print '
';
// Page agenda
- print '
'.$langs->trans("PageForAgendaTab").' :
'.(dol_is_file($realpathtoagenda) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoagenda).(dol_is_file($realpathtoagenda) ? '' : '').'';
+ print '
'.$langs->trans("PageForAgendaTab").' :
'.(dol_is_file($realpathtoagenda) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoagenda).(dol_is_file($realpathtoagenda) ? '' : '').'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
if (dol_is_file($realpathtoagenda)) {
print ' ';
@@ -3109,7 +3001,7 @@ if ($module == 'initmodule') {
if (preg_match('/\.md$/i', $spec['name'])) {
$format = 'markdown';
}
- print '
'.$langs->trans("SpecificationFile").' :
'.$pathtofile.'';
+ print '
'.$langs->trans("SpecificationFile").' :
'.$pathtofile.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
}
@@ -3188,6 +3080,231 @@ if ($module == 'initmodule') {
print dol_get_fiche_end(); // Level 3
}
+ if ($tab == 'dictionaries') {
+ print ''."\n";
+ $pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
+
+ $dicts = $moduleobj->dictionaries;
+
+ if ($action != 'editfile' || empty($file)) {
+ print '
';
+ $htmlhelp = $langs->trans("DictionariesDefDescTooltip", '{s1}');
+ $htmlhelp = str_replace('{s1}', ''.$langs->trans('Setup').' - '.$langs->trans('Dictionaries').'', $htmlhelp);
+ print $form->textwithpicto($langs->trans("DictionariesDefDesc"), $htmlhelp, 1, 'help', '', 0, 2, 'helpondesc').'
';
+ print '';
+ print '
';
+
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
+ print '
'.img_picto($langs->trans("Edit"), 'edit').'';
+ print '
';
+ if (is_array($dicts) && !empty($dicts)) {
+ print '
'.$langs->trans("LanguageFile").' : ';
+ print '
'.$dicts['langs'].'';
+ print '
';
+ }
+
+ print ''."\n";
+ $head3 = array();
+ $h = 0;
+
+ // Dir for module
+ //$dir = $dirread.'/'.$modulelowercase.'/class';
+
+ $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic=newdictionary';
+ $head3[$h][1] = '
'.$langs->trans("NewDictionary").'';
+ $head3[$h][2] = 'newdictionary';
+ $h++;
+
+ // Scan for object class files
+ //$listofobject = dol_dir_list($dir, 'files', 0, '\.class\.php$');
+
+ $firstdicname = '';
+ foreach ($dicts['tabname'] as $key => $dic) {
+ $dicname = $dic;
+ $diclabel = $dicts['tablib'][$key];
+
+ if (empty($firstdicname)) {
+ $firstdicname = $dicname;
+ }
+
+ $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic='.$dicname;
+ $head3[$h][1] = $diclabel;
+ $head3[$h][2] = $dicname;
+ $h++;
+ }
+
+ if ($h > 1) {
+ $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=dictionaries&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabdic=deletedictionary';
+ $head3[$h][1] = $langs->trans("DangerZone");
+ $head3[$h][2] = 'deletedictionary';
+ $h++;
+ }
+
+ // If tabobj was not defined, then we check if there is one obj. If yes, we force on it, if no, we will show tab to create new objects.
+ if ($tabdic == 'newdicifnodic') {
+ if ($firstdicname) {
+ $tabdic = $firstdicname;
+ } else {
+ $tabdic = 'newdictionary';
+ }
+ }
+
+ print load_fiche_titre($langs->trans("ListOfDictionariesEntries"), '', '');
+
+ print '
';
+
+ print dol_get_fiche_head($head3, $tabdic, '', -1, ''); // Level 3
+
+ if ($tabdic == 'newdictionary') {
+ // New dic tab
+ print '
';
+ } elseif ($tabdic == 'deletedictionary') {
+ // Delete dic tab
+ print '
';
+ } else {
+ print $langs->trans("FeatureNotYetAvailable");
+ }
+
+ print dol_get_fiche_end();
+ } else {
+ $fullpathoffile = dol_buildpath($file, 0);
+
+ $content = file_get_contents($fullpathoffile);
+
+ // New module
+ print '
';
+ }
+ }
+
if ($tab == 'menus') {
print ''."\n";
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
@@ -3202,7 +3319,7 @@ if ($module == 'initmodule') {
print '';
print '
';
- print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
@@ -3344,7 +3461,7 @@ if ($module == 'initmodule') {
print '';
print '
';
- print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
@@ -3434,7 +3551,7 @@ if ($module == 'initmodule') {
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
print '
| ';
- print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.'';
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.'';
print ' | ';
print ''.img_picto($langs->trans("Edit"), 'edit').'';
print ' |
';
@@ -3443,7 +3560,7 @@ if ($module == 'initmodule') {
$pathtohook = strtolower($module).'/class/actions_'.strtolower($module).'.class.php';
print '
'.$langs->trans("HooksFile").' : ';
if (dol_is_file($dirins.'/'.$pathtohook)) {
- print '
'.$pathtohook.'';
+ print '
'.$pathtohook.'';
print '';
print '
'.img_picto($langs->trans("Edit"), 'edit').' ';
print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
@@ -3494,7 +3611,7 @@ if ($module == 'initmodule') {
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
print '
| ';
- print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.'';
+ print ' '.$langs->trans("DescriptorFile").' : '.$pathtofile.'';
print ' | ';
print ''.img_picto($langs->trans("Edit"), 'edit').'';
print ' |
';
@@ -3504,7 +3621,7 @@ if ($module == 'initmodule') {
$pathtofile = $trigger['relpath'];
print '
| ';
- print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.'';
+ print ' '.$langs->trans("TriggersFile").' : '.$pathtofile.'';
print ' | '.img_picto($langs->trans("Edit"), 'edit').' | ';
print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
print '
';
@@ -3557,7 +3674,7 @@ if ($module == 'initmodule') {
$pathtohook = strtolower($module).'/css/'.strtolower($module).'.css.php';
print '
'.$langs->trans("CSSFile").' : ';
if (dol_is_file($dirins.'/'.$pathtohook)) {
- print '
'.$pathtohook.'';
+ print '
'.$pathtohook.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').' | ';
print '
'.img_picto($langs->trans("Delete"), 'delete').' | ';
} else {
@@ -3603,7 +3720,7 @@ if ($module == 'initmodule') {
$pathtohook = strtolower($module).'/js/'.strtolower($module).'.js.php';
print '
'.$langs->trans("JSFile").' : ';
if (dol_is_file($dirins.'/'.$pathtohook)) {
- print '
'.$pathtohook.'';
+ print '
'.$pathtohook.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').' | ';
print '
'.img_picto($langs->trans("Delete"), 'delete').' | ';
} else {
@@ -3652,7 +3769,7 @@ if ($module == 'initmodule') {
foreach ($widgets as $widget) {
$pathtofile = $widget['relpath'];
- print '
| '.$langs->trans("WidgetFile").' : '.$pathtofile.'';
+ print ' |
| '.$langs->trans("WidgetFile").' : '.$pathtofile.'';
print ' | '.img_picto($langs->trans("Edit"), 'edit').'';
print ' | '.img_picto($langs->trans("Delete"), 'delete').' | ';
print '
';
@@ -3700,7 +3817,7 @@ if ($module == 'initmodule') {
print '
'.$langs->transnoentities('ImportExportProfiles').'';
print '
';
- print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
} else {
@@ -3771,7 +3888,7 @@ if ($module == 'initmodule') {
foreach ($clifiles as $clifile) {
$pathtofile = $clifile['relpath'];
- print '
| '.$langs->trans("CLIFile").' : '.$pathtofile.'';
+ print ' |
| '.$langs->trans("CLIFile").' : '.$pathtofile.'';
print ' | '.img_picto($langs->trans("Edit"), 'edit').' | ';
print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
print '
';
@@ -3818,7 +3935,7 @@ if ($module == 'initmodule') {
print '
'.str_replace('{s1}', ''.$langs->transnoentities('CronList').'', $langs->trans("CronJobDefDesc", '{s1}')).'';
print '
';
- print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
+ print '
'.$langs->trans("DescriptorFile").' :
'.$pathtofile.'';
print '
'.img_picto($langs->trans("Edit"), 'edit').'';
print '
';
@@ -3947,7 +4064,7 @@ if ($module == 'initmodule') {
$format = 'markdown';
}
print '
| ';
- print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.'';
+ print ' '.$langs->trans("SpecificationFile").' : '.$pathtofile.'';
print ' | '.img_picto($langs->trans("Edit"), 'edit').' | ';
print ''.img_picto($langs->trans("Delete"), 'delete').' | ';
print '
';