Skip to content

Commit 1a5ba80

Browse files
author
Ben Thomson
committed
Add additional properties for repeater widget in form builder.
- Style - Minimum Items - Title From Fixes #324.
1 parent 13307b0 commit 1a5ba80

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

classes/StandardControlsRegistry.php

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,54 @@ protected function registerRepeaterWidget()
369369
'default' => Lang::get('rainlab.builder::lang.form.property_prompt_default'),
370370
'sortOrder' => 81
371371
],
372+
'titleFrom' => [
373+
'title' => Lang::get('rainlab.builder::lang.form.property_title_from'),
374+
'description' => Lang::get('rainlab.builder::lang.form.property_title_from_description'),
375+
'type' => 'string',
376+
'ignoreIfEmpty' => true,
377+
'sortOrder' => 82
378+
],
372379
'form' => [
373380
'type' => 'control-container'
374381
],
382+
'minItems' => [
383+
'title' => Lang::get('rainlab.builder::lang.form.property_min_items'),
384+
'description' => Lang::get('rainlab.builder::lang.form.property_min_items_description'),
385+
'type' => 'string',
386+
'ignoreIfEmpty' => true,
387+
'sortOrder' => 83,
388+
'validation' => [
389+
'integer' => [
390+
'message' => Lang::get('rainlab.builder::lang.form.property_min_items_integer'),
391+
'allowNegative' => false,
392+
]
393+
],
394+
],
375395
'maxItems' => [
376396
'title' => Lang::get('rainlab.builder::lang.form.property_max_items'),
377397
'description' => Lang::get('rainlab.builder::lang.form.property_max_items_description'),
378398
'type' => 'string',
379399
'ignoreIfEmpty' => true,
380-
'sortOrder' => 82
400+
'sortOrder' => 84,
401+
'validation' => [
402+
'integer' => [
403+
'message' => Lang::get('rainlab.builder::lang.form.property_max_items_integer'),
404+
'allowNegative' => false,
405+
]
406+
],
381407
],
408+
'style' => [
409+
'title' => Lang::get('rainlab.builder::lang.form.property_style'),
410+
'description' => Lang::get('rainlab.builder::lang.form.property_style_description'),
411+
'type' => 'dropdown',
412+
'default' => 'default',
413+
'options' => [
414+
'default' => Lang::get('rainlab.builder::lang.form.style_default'),
415+
'collapsed' => Lang::get('rainlab.builder::lang.form.style_collapsed'),
416+
'accordion' => Lang::get('rainlab.builder::lang.form.style_accordion'),
417+
],
418+
'sortOrder' => 85,
419+
]
382420
];
383421

384422
$ignoreProperties = [

lang/en/lang.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,16 @@
289289
'property_empty_option_description' => 'The empty option corresponds to the empty selection, but unlike the placeholder it can be reselected.',
290290
'property_show_search' => 'Show search',
291291
'property_show_search_description' => 'Enables the search feature for this dropdown.',
292+
'property_title_from' => 'Title from',
293+
'property_title_from_description' => 'Specify a child field name to use the value of that field as the title for each repeater item.',
294+
'property_min_items' => 'Min items',
295+
'property_min_items_description' => 'Minimum number of items to allow within the repeater.',
296+
'property_min_items_integer' => 'Min items must be a positive integer.',
292297
'property_max_items' => 'Max items',
293298
'property_max_items_description' => 'Maximum number of items to allow within the repeater.',
299+
'property_max_items_integer' => 'Max items must be a positive integer.',
300+
'property_style' => 'Style',
301+
'property_style_description' => 'Defines the behaviour to apply to this repeater.',
294302
'control_group_standard' => 'Standard',
295303
'control_group_widgets' => 'Widgets',
296304
'click_to_add_control' => 'Add control',
@@ -352,6 +360,9 @@
352360
'span_right' => 'Right',
353361
'span_full' => 'Full',
354362
'span_auto' => 'Auto',
363+
'style_default' => 'Default',
364+
'style_collapsed' => 'Collapsed',
365+
'style_accordion' => 'Accordion',
355366
'empty_tab' => 'Empty tab',
356367
'confirm_close_tab' => 'The tab contains controls which will be deleted. Continue?',
357368
'tab' => 'Form tab',

0 commit comments

Comments
 (0)