@@ -2233,9 +2233,9 @@ public function return_form($url, $action)
2233
2233
{
2234
2234
$ form = new FormValidator ($ this ->type .'_field ' , 'post ' , $ url );
2235
2235
2236
- $ form ->addElement ( ' hidden ' , 'type ' , $ this ->type );
2236
+ $ form ->addHidden ( 'type ' , $ this ->type );
2237
2237
$ id = isset ($ _GET ['id ' ]) ? (int ) $ _GET ['id ' ] : null ;
2238
- $ form ->addElement ( ' hidden ' , 'id ' , $ id );
2238
+ $ form ->addHidden ( 'id ' , $ id );
2239
2239
2240
2240
// Setting the form elements
2241
2241
$ header = get_lang ('Add ' );
@@ -2247,7 +2247,7 @@ public function return_form($url, $action)
2247
2247
$ defaults = $ this ->get ($ id , false );
2248
2248
}
2249
2249
2250
- $ form ->addElement ( ' header ' , $ header );
2250
+ $ form ->addHeader ( $ header );
2251
2251
2252
2252
if ('edit ' === $ action ) {
2253
2253
$ translateUrl = api_get_path (WEB_CODE_PATH ).'extrafield/translate.php? '
@@ -2259,7 +2259,7 @@ public function return_form($url, $action)
2259
2259
[get_lang ('Name ' ), $ translateButton ]
2260
2260
);
2261
2261
} else {
2262
- $ form ->addElement ( ' text ' , 'display_text ' , get_lang ('Name ' ));
2262
+ $ form ->addText ( 'display_text ' , get_lang ('Name ' ));
2263
2263
}
2264
2264
2265
2265
// Field type
@@ -2272,8 +2272,8 @@ public function return_form($url, $action)
2272
2272
$ types ,
2273
2273
['id ' => 'field_type ' ]
2274
2274
);
2275
- $ form ->addElement ( ' label ' , get_lang ('Example ' ), '<div id="example">-</div> ' );
2276
- $ form ->addElement ( ' text ' , ' variable ' , get_lang ('FieldLabel ' ), [ ' class ' => ' span5 ' ] );
2275
+ $ form ->addLabel ( get_lang ('Example ' ), '<div id="example">-</div> ' );
2276
+ $ form ->addText ( ' variable ' , get_lang ('FieldLabel ' ), false );
2277
2277
$ form ->addElement (
2278
2278
'text ' ,
2279
2279
'field_options ' ,
@@ -2297,23 +2297,23 @@ public function return_form($url, $action)
2297
2297
get_lang ('EditExtraFieldOptions ' ),
2298
2298
'extra_field_options.php?type= ' .$ this ->type .'&field_id= ' .$ id
2299
2299
);
2300
- $ form ->addElement ( ' label ' , null , $ url );
2300
+ $ form ->addLabel ( null , $ url );
2301
2301
2302
2302
if (self ::FIELD_TYPE_SELECT == $ defaults ['field_type ' ]) {
2303
2303
$ urlWorkFlow = Display::url (
2304
2304
get_lang ('EditExtraFieldWorkFlow ' ),
2305
2305
'extra_field_workflow.php?type= ' .$ this ->type .'&field_id= ' .$ id
2306
2306
);
2307
- $ form ->addElement ( ' label ' , null , $ urlWorkFlow );
2307
+ $ form ->addLabel ( null , $ urlWorkFlow );
2308
2308
}
2309
2309
2310
2310
$ form ->freeze ('field_options ' );
2311
2311
}
2312
2312
}
2313
- $ form ->addElement (
2314
- 'text ' ,
2313
+ $ form ->addText (
2315
2314
'default_value ' ,
2316
2315
get_lang ('FieldDefaultValue ' ),
2316
+ false ,
2317
2317
['id ' => 'default_value ' ]
2318
2318
);
2319
2319
@@ -2344,7 +2344,7 @@ public function return_form($url, $action)
2344
2344
$form->addGroup($group, '', get_lang('FieldLoggeable'), '', false);
2345
2345
*/
2346
2346
2347
- $ form ->addElement ( ' text ' , ' field_order ' , get_lang ('FieldOrder ' ));
2347
+ $ form ->addNumeric ( ' field_order ' , get_lang ('FieldOrder ' ), [ ' step ' => 1 , ' min ' => 0 ] );
2348
2348
2349
2349
if ('edit ' == $ action ) {
2350
2350
$ option = new ExtraFieldOption ($ this ->type );
0 commit comments