@@ -131,6 +131,9 @@ function loadFormDef($file,$module = '') {
131131 $ wb = array ();
132132
133133 include_once (ISPC_ROOT_PATH .'/lib/lang/ ' .$ _SESSION ['s ' ]['language ' ].'.lng ' );
134+
135+ if (is_array ($ wb )) $ wb_global = $ wb ;
136+
134137 if ($ module == '' ) {
135138 $ lng_file = "lib/lang/ " .$ _SESSION ["s " ]["language " ]."_ " .$ this ->formDef ["name " ].".lng " ;
136139 if (!file_exists ($ lng_file )) $ lng_file = "lib/lang/en_ " .$ this ->formDef ["name " ].".lng " ;
@@ -140,6 +143,12 @@ function loadFormDef($file,$module = '') {
140143 if (!file_exists ($ lng_file )) $ lng_file = "../ $ module/lib/lang/en_ " .$ this ->formDef ["name " ].".lng " ;
141144 include ($ lng_file );
142145 }
146+
147+ if (is_array ($ wb_global )) {
148+ $ wb = array_merge ($ wb_global ,$ wb );
149+ }
150+ if (isset ($ wb_global )) unset($ wb_global );
151+
143152 $ this ->wordbook = $ wb ;
144153
145154 return true ;
@@ -965,15 +974,17 @@ function showForm() {
965974 foreach ( $ this ->formDef ["tabs " ] as $ key => $ tab ) {
966975
967976 $ tab ['name ' ] = $ key ;
977+ // Translate the title of the tab
978+ $ tab ['title ' ] = $ this ->lng ($ tab ['title ' ]);
979+
968980 if ($ tab ['name ' ] == $ active_tab ) {
969981
970982 // If module is set, then set the template path relative to the module..
971983 if ($ this ->module != '' ) $ tab ["template " ] = "../ " .$ this ->module ."/ " .$ tab ["template " ];
972984
973985 // Generate the template if it does not exist yet.
974986
975- // Translate the title of the tab
976- $ tab ['title ' ] = $ this ->lng ($ tab ['title ' ]);
987+
977988
978989 if (!is_file ($ tab ["template " ])) {
979990 $ app ->uses ('tform_tpl_generator ' );
0 commit comments