From 63469ced2fac2a0f306b0ef68c0c9f61b15d3717 Mon Sep 17 00:00:00 2001 From: Stig Lindqvist Date: Mon, 7 May 2012 17:10:27 +1200 Subject: [PATCH] MINOR Some code cleanup --- code/formfields/FieldEditor.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/code/formfields/FieldEditor.php b/code/formfields/FieldEditor.php index d916db0..826e176 100755 --- a/code/formfields/FieldEditor.php +++ b/code/formfields/FieldEditor.php @@ -76,11 +76,9 @@ class FieldEditor extends FormField { if($fields) { foreach($fields as $field) { - if(!$this->canEdit()) { - if(is_a($field, 'FormField')) { - $fields->remove($field); - $fields->push($field->performReadonlyTransformation()); - } + if(!$this->canEdit() && is_a($field, 'FormField')) { + $fields->remove($field); + $fields->push($field->performReadonlyTransformation()); } } } @@ -173,8 +171,7 @@ class FieldEditor extends FormField { } /** - * Add a field to the field editor. Called via a ajax get request - * from the userdefinedform javascript + * Add a field to the field editor. Called via a ajax get request from the userdefinedform javascript * * @return bool|html */