diff --git a/code/FrameworktestRegressSessionAdmin.php b/code/FrameworktestRegressSessionAdmin.php index 890e990..e8719f7 100644 --- a/code/FrameworktestRegressSessionAdmin.php +++ b/code/FrameworktestRegressSessionAdmin.php @@ -22,11 +22,11 @@ class FrameworktestRegressSessionAdmin extends Controller { $isRunning = (Session::get('db')); if($isRunning) { - $actions = new FieldSet( + $actions = new FieldList( new FormAction('endsession', 'End Session') ); } else { - $actions = new FieldSet( + $actions = new FieldList( new FormAction('startsession', 'Start Session') ); } @@ -34,7 +34,7 @@ class FrameworktestRegressSessionAdmin extends Controller { $form = new Form( $this, 'Form', - new FieldSet( + new FieldList( new HeaderField('Header1', ($isRunning) ? 'Session is already running' : 'Start new regress session'), new LiteralField('Lit1', '

Use this form to set configuration prior to starting a regress.silverstripe.com test session (manual testing).

' diff --git a/code/TestFileUploadPage.php b/code/TestFileUploadPage.php index 6866765..05bcc3f 100644 --- a/code/TestFileUploadPage.php +++ b/code/TestFileUploadPage.php @@ -7,13 +7,13 @@ class TestFileUploadPage extends TestPage{ class TestFileUploadPage_Controller extends TestPage_Controller{ function Form(){ - $fields = new FieldSet( + $fields = new FieldList( new EmailField('Email', 'EmailField'), new FileField('AFile','FileField'), new SimpleImageField('AImage','SimpleImageField') ); - $actions = new FieldSet( + $actions = new FieldList( new FormAction('addMember', "Add a member with two Files uploaded") ); return new Form($this, "Form", $fields, $actions); diff --git a/code/TestPage.php b/code/TestPage.php index d1370ce..611c705 100644 --- a/code/TestPage.php +++ b/code/TestPage.php @@ -40,10 +40,11 @@ class TestPage_Controller extends Page_Controller { */ function Form() { $fields = $this->getCMSFields(); - $actions = new FieldSet( + $actions = new FieldList( new FormAction("save", "Save"), - new ImageFormAction("gohome", "Go home", "frameworktest/images/test-button.png") + $gohome = new FormAction("gohome", "Go home") ); + $gohome->setAttribute('src', 'frameworktest/images/test-button.png'); $form = new Form($this, "Form", $fields, $actions); $form->loadDataFrom($this->dataRecord); return $form; @@ -60,9 +61,9 @@ class TestPage_Controller extends Page_Controller { } function EmailForm() { - return new Form($this, "EmailForm", new FieldSet( + return new Form($this, "EmailForm", new FieldList( new TextField("Email", "Email address") - ), new FieldSet( + ), new FieldList( new FormAction("sendEmail", "Send test email to this address") )); } diff --git a/code/multiform/Page2MultiForm.php b/code/multiform/Page2MultiForm.php index b73ec36..f97f809 100644 --- a/code/multiform/Page2MultiForm.php +++ b/code/multiform/Page2MultiForm.php @@ -41,7 +41,7 @@ class Page2PersonalDetailsFormStep extends MultiFormStep { public static $next_steps = 'Page2OrganisationDetailsFormStep'; function getFields() { - return new FieldSet( + return new FieldList( new TextField('FirstName', 'First name'), new TextField('Surname', 'Surname') ); @@ -54,7 +54,7 @@ class Page2OrganisationDetailsFormStep extends MultiFormStep { public static $is_final_step = true; function getFields() { - return new FieldSet( + return new FieldList( new TextField('OrganisationName', 'Organisation Name') ); } diff --git a/code/multiform/Page3MultiForm.php b/code/multiform/Page3MultiForm.php index 5f765eb..29896e5 100644 --- a/code/multiform/Page3MultiForm.php +++ b/code/multiform/Page3MultiForm.php @@ -43,7 +43,7 @@ class Page3StartFormStep extends MultiFormStep { public static $next_steps = 'Page3PersonalDetailsFormStep'; function getFields() { - return new FieldSet( + return new FieldList( new LiteralField('Details', 'This is important

You will receiving email once you participate in this survey.
Under the new Unsolicited Electronic Messages Act 2007, we must have your consent to send emails relating to this form.
@@ -61,7 +61,7 @@ class Page3PersonalDetailsFormStep extends MultiFormStep { public static $next_steps = 'Page3OrganisationDetailsFormStep'; function getFields() { - return new FieldSet( + return new FieldList( new TextField('FirstName', 'First name'), new TextField('Surname', 'Surname') ); @@ -75,7 +75,7 @@ class Page3OrganisationDetailsFormStep extends MultiFormStep { public static $is_final_step = true; function getFields() { - return new FieldSet( + return new FieldList( new TextField('OrganisationName', 'Organisation Name') ); } diff --git a/code/multiform/TestMultiForm.php b/code/multiform/TestMultiForm.php index eefe5cd..0ce907a 100644 --- a/code/multiform/TestMultiForm.php +++ b/code/multiform/TestMultiForm.php @@ -12,7 +12,7 @@ class TestMultiForm extends MultiForm { $savedData = array_merge($savedData, $step->loadData()); } - $fields = new FieldSet(); + $fields = new FieldList(); $fields->push(new LiteralField("Heading", "

You have submitted the following information:

")); foreach($savedData as $key=>$value) { @@ -29,7 +29,7 @@ class TestMultiFormStepOne extends MultiFormStep { public static $next_steps = 'TestMultiFormStepTwo'; function getFields() { - return new FieldSet( + return new FieldList( new TextField('FirstName', 'First name'), new TextField('Surname', 'Surname') ); @@ -42,7 +42,7 @@ class TestMultiFormStepTwo extends MultiFormStep { function getFields() { - return new FieldSet( + return new FieldList( new TextField('Email', 'Email'), new TextField('Address', 'Address') ); @@ -62,7 +62,7 @@ class TestMultiFormStepThree extends MultiFormStep { $savedData = array_merge($savedData, $step->loadData()); } - $fields = new FieldSet(); + $fields = new FieldList(); $fields->push(new LiteralField("Heading", "

You have submitted the following information:

")); foreach($savedData as $key=>$value) { diff --git a/code/multiform/TestMultiFormPage.php b/code/multiform/TestMultiFormPage.php index 80fb982..ef425f3 100644 --- a/code/multiform/TestMultiFormPage.php +++ b/code/multiform/TestMultiFormPage.php @@ -6,7 +6,7 @@ class TestMultiFormPage extends Page { class TestMultiFormPage_Controller extends Page_Controller { function Form() { - $form = new TestMultiForm($this, 'Form', new FieldSet(), new FieldSet()); + $form = new TestMultiForm($this, 'Form', new FieldList(), new FieldList()); return $form; } diff --git a/code/recaptcha/RecaptchaTestPage.php b/code/recaptcha/RecaptchaTestPage.php index 83f23ca..aeaed89 100644 --- a/code/recaptcha/RecaptchaTestPage.php +++ b/code/recaptcha/RecaptchaTestPage.php @@ -6,7 +6,7 @@ class RecaptchaTestPage extends Page { class RecaptchaTestPage_Controller extends Page_Controller { function Form() { - $fields = new FieldSet( + $fields = new FieldList( new TextField('MyText') ); if(class_exists('RecaptchaField')) { @@ -19,7 +19,7 @@ class RecaptchaTestPage_Controller extends Page_Controller { $this, 'Form', $fields, - new FieldSet( + new FieldList( new FormAction('submit', 'submit') ), new RequiredFields(array('MyText'))