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:
|
SilverLeague\IDEAnnotator\DataObjectAnnotator:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
SilverStripe\UserForms\Form\UserForm:
|
||||||
|
show_labels: false
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace A2nt\CMSNiceties\Extensions;
|
namespace A2nt\CMSNiceties\Extensions;
|
||||||
|
|
||||||
|
use SilverStripe\Core\Config\Config;
|
||||||
use SilverStripe\Core\Extension;
|
use SilverStripe\Core\Extension;
|
||||||
use SilverStripe\Forms\CompositeField;
|
use SilverStripe\Forms\CompositeField;
|
||||||
use SilverStripe\Forms\FieldList;
|
use SilverStripe\Forms\FieldList;
|
||||||
@ -31,7 +32,14 @@ class PlaceholderFormExtension extends Extension
|
|||||||
'placeholder',
|
'placeholder',
|
||||||
$placeholder
|
$placeholder
|
||||||
);
|
);
|
||||||
$field->setTitle('');
|
|
||||||
|
/*
|
||||||
|
* SilverStripe\UserForms\Form\UserForm:
|
||||||
|
* show_labels: false
|
||||||
|
*/
|
||||||
|
if (!Config::inst()->get(\get_class($this->owner), 'show_labels')) {
|
||||||
|
$field->setTitle('');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user