mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
IMPR: Allow to show field labels
This commit is contained in:
parent
6d82e2826f
commit
f37d4b2e92
@ -26,3 +26,6 @@ SilverStripe\Forms\HTMLEditor\TinyMCEConfig:
|
||||
|
||||
SilverLeague\IDEAnnotator\DataObjectAnnotator:
|
||||
enabled: true
|
||||
|
||||
SilverStripe\UserForms\Form\UserForm:
|
||||
show_labels: false
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace A2nt\CMSNiceties\Extensions;
|
||||
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Core\Extension;
|
||||
use SilverStripe\Forms\CompositeField;
|
||||
use SilverStripe\Forms\FieldList;
|
||||
@ -31,9 +32,16 @@ class PlaceholderFormExtension extends Extension
|
||||
'placeholder',
|
||||
$placeholder
|
||||
);
|
||||
|
||||
/*
|
||||
* SilverStripe\UserForms\Form\UserForm:
|
||||
* show_labels: false
|
||||
*/
|
||||
if (!Config::inst()->get(\get_class($this->owner), 'show_labels')) {
|
||||
$field->setTitle('');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (is_a($field, CompositeField::class)) {
|
||||
$children = $field->getChildren();
|
||||
|
Loading…
Reference in New Issue
Block a user