Skip to content

Commit

Permalink
1.x (#26)
Browse files Browse the repository at this point in the history
* Add readonly form option (#25)
  • Loading branch information
chrode authored Dec 3, 2024
1 parent 8ccbf72 commit 1c88329
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Classes/ViewHelpers/Condition/IsReadonlyFieldViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public function render() {
// get field configuration
$config = \Slub\SlubForms\Helper\ArrayHelper::configToArray($field->getConfiguration());

if (!empty($config['readonly'])) {
if((trim($config['readonly']) === 'TRUE')||(trim($config['readonly']) === 'true') || (trim($config['readonly']) === '1')) {
return 'readonly';
}
}

if (!empty($config['prefill'])) {
// values may be comma separated:
// e.g. prefill = fe_users:username, fe_users:email, news:news
Expand Down

0 comments on commit 1c88329

Please sign in to comment.