From 0a3e0f15de55835ad0340faa4eb3733cc650b3c1 Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Fri, 28 Oct 2011 14:37:27 +1300 Subject: [PATCH] MINOR: Replace references to FieldSet (now deprecated) with references to FieldList --- admin/code/CMSBatchAction.php | 2 +- admin/code/LeftAndMain.php | 2 +- admin/code/SecurityAdmin.php | 2 +- dev/BulkLoader.php | 2 +- docs/en/howto/csv-import.md | 4 +- docs/en/reference/complextablefield.md | 10 ++--- docs/en/reference/dataextension.md | 2 +- docs/en/reference/dataobject.md | 4 +- docs/en/reference/form-field-types.md | 2 +- docs/en/reference/leftandmain.md | 4 +- docs/en/reference/member.md | 8 ++-- docs/en/reference/searchcontext.md | 4 +- docs/en/reference/siteconfig.md | 2 +- docs/en/topics/form-validation.md | 4 +- docs/en/topics/forms.md | 30 +++++++------- docs/en/topics/page-types.md | 6 +-- docs/en/topics/widgets.md | 8 ++-- docs/en/tutorials/2-extending-a-basic-site.md | 2 +- docs/en/tutorials/3-forms.md | 16 ++++---- docs/en/tutorials/4-site-search.md | 4 +- .../5-dataobject-relationship-management.md | 6 +-- filesystem/File.php | 2 +- filesystem/Folder.php | 4 +- forms/ComplexTableField.php | 6 +-- forms/FieldGroup.php | 2 +- forms/FieldList.php | 40 +++++++++---------- forms/Form.php | 20 +++++----- forms/FormField.php | 10 ++--- forms/FormScaffolder.php | 2 +- forms/OptionsetField.php | 2 +- forms/TabSet.php | 2 +- forms/TableField.php | 6 +-- model/DataExtension.php | 8 ++-- model/DataObject.php | 10 ++--- search/SearchContext.php | 8 ++-- security/ChangePasswordForm.php | 8 ++-- security/Group.php | 2 +- security/Member.php | 6 +-- security/MemberLoginForm.php | 8 ++-- 39 files changed, 135 insertions(+), 135 deletions(-) mode change 100755 => 100644 forms/FieldList.php diff --git a/admin/code/CMSBatchAction.php b/admin/code/CMSBatchAction.php index 436002108..46370b6a0 100644 --- a/admin/code/CMSBatchAction.php +++ b/admin/code/CMSBatchAction.php @@ -135,7 +135,7 @@ abstract class CMSBatchAction extends Object { } - // if your batchaction has parameters, return a fieldset here + // if your batchaction has parameters, return a FieldList here function getParameterFields() { return false; } diff --git a/admin/code/LeftAndMain.php b/admin/code/LeftAndMain.php index 25f1a3686..8a7cc0dea 100644 --- a/admin/code/LeftAndMain.php +++ b/admin/code/LeftAndMain.php @@ -786,7 +786,7 @@ class LeftAndMain extends Controller { $fields = ($fields) ? $fields : $record->getCMSFields(); if ($fields == null) { user_error( - "getCMSFields() returned null - it should return a FieldSet object. + "getCMSFields() returned null - it should return a FieldList object. Perhaps you forgot to put a return statement at the end of your method?", E_USER_ERROR ); diff --git a/admin/code/SecurityAdmin.php b/admin/code/SecurityAdmin.php index f1ac5815a..d87831cb9 100644 --- a/admin/code/SecurityAdmin.php +++ b/admin/code/SecurityAdmin.php @@ -100,7 +100,7 @@ class SecurityAdmin extends LeftAndMain implements PermissionProvider { } /** - * @return FieldSet + * @return FieldList */ function RootForm() { $memberList = new MemberTableField( diff --git a/dev/BulkLoader.php b/dev/BulkLoader.php index f89ccbf91..e63771120 100644 --- a/dev/BulkLoader.php +++ b/dev/BulkLoader.php @@ -182,7 +182,7 @@ abstract class BulkLoader extends ViewableData { abstract protected function processRecord($record, $columnMap, &$result, $preview = false); /** - * Return a FieldSet containing all the options for this form; this + * Return a FieldList containing all the options for this form; this * doesn't include the actual upload field itself */ public function getOptionFields() {} diff --git a/docs/en/howto/csv-import.md b/docs/en/howto/csv-import.md index b5a96c66a..07fdf0d0a 100644 --- a/docs/en/howto/csv-import.md +++ b/docs/en/howto/csv-import.md @@ -78,10 +78,10 @@ You can have more customized logic and interface feedback through a custom contr $form = new Form( $this, 'Form', - new FieldSet( + new FieldList( new FileField('CsvFile', false) ), - new FieldSet( + new FieldList( new FormAction('doUpload', 'Upload') ), new RequiredFields() diff --git a/docs/en/reference/complextablefield.md b/docs/en/reference/complextablefield.md index e28052e7b..fdf98d93b 100644 --- a/docs/en/reference/complextablefield.md +++ b/docs/en/reference/complextablefield.md @@ -43,7 +43,7 @@ You can override this behaviour in various ways: 'MyName', 'Product', array('Price','Code'), - new FieldSet( + new FieldList( new TextField('Price') ) ) @@ -75,11 +75,11 @@ popup as there is more real-estate for you to play with. `[api:ComplexTableField]` gives you several options to do this. You can either -* Pass a FieldSet in the constructor. +* Pass a FieldList in the constructor. * Pass a String in the constructor. -The first will simply add the fieldset to the form, and populate it with the source class. -The second will call the String as a method on the source class (Which should return a FieldSet) of fields for the +The first will simply add the fieldlist to the form, and populate it with the source class. +The second will call the String as a method on the source class (Which should return a FieldList) of fields for the Popup. You can also customise Javascript which is loaded for the Lightbox. As Requirements::clear() is called when the popup is @@ -108,7 +108,7 @@ You'll have to do something like this in your form: $tableField->setParentClass(false); - $fields = new FieldSet( + $fields = new FieldList( new HiddenField('ID', ''), $tableField ); diff --git a/docs/en/reference/dataextension.md b/docs/en/reference/dataextension.md index a23bd6e8c..584c4bf39 100644 --- a/docs/en/reference/dataextension.md +++ b/docs/en/reference/dataextension.md @@ -88,7 +88,7 @@ extension: The $fields parameter is passed by reference, as it is an object. :::php - public function updateCMSFields(FieldSet $fields) { + public function updateCMSFields(FieldList $fields) { $fields->push(new TextField('Position', 'Position Title')); $fields->push(new ImageField('Image', 'Profile Image')); } diff --git a/docs/en/reference/dataobject.md b/docs/en/reference/dataobject.md index 66f2481db..d5f1269bc 100644 --- a/docs/en/reference/dataobject.md +++ b/docs/en/reference/dataobject.md @@ -13,7 +13,7 @@ A single database record & abstract class for the data-access-model. ## Basics The call to `DataObject->getCMSFields()` is the centerpiece of every data administration interface in SilverStripe, -which returns a `[api:FieldSet]`''. +which returns a `[api:FieldList]`''. :::php class MyPage extends Page { @@ -27,7 +27,7 @@ which returns a `[api:FieldSet]`''. ## Scaffolding Formfields -These calls retrieve a `[api:FieldSet]` for the area where you intend to work with the scaffolded form. +These calls retrieve a `[api:FieldList]` for the area where you intend to work with the scaffolded form. ### For the CMS diff --git a/docs/en/reference/form-field-types.md b/docs/en/reference/form-field-types.md index f4a939b54..9a7914ad0 100644 --- a/docs/en/reference/form-field-types.md +++ b/docs/en/reference/form-field-types.md @@ -30,7 +30,7 @@ given set of fields in a given set of tables * `[CompositeField](api:CompositeField)`: Base class for all fields that contain other fields. Uses `
` in template, but doesn't necessarily have any visible styling. * `[FieldGroup](api:FieldGroup)`: Same as CompositeField, but has default styling (indentation) attached in CMS-context. -* `[api:FieldSet]`: Basic container for sequential fields, or nested fields through CompositeField. Does NOT render a +* `[api:FieldList]`: Basic container for sequential fields, or nested fields through CompositeField. Does NOT render a ``. * `[TabSet](api:TabSet)` * `[Tab](api:Tab)` diff --git a/docs/en/reference/leftandmain.md b/docs/en/reference/leftandmain.md index 97c019507..b131d9f87 100644 --- a/docs/en/reference/leftandmain.md +++ b/docs/en/reference/leftandmain.md @@ -51,10 +51,10 @@ The PHP file defining your new subclass is the first step in the process. This */ public function getEditForm($id = null) { return new Form($this, "EditForm", - new FieldSet( + new FieldList( new ReadonlyField('id #',$id) ), - new FieldSet( + new FieldList( new FormAction('go') ) ); diff --git a/docs/en/reference/member.md b/docs/en/reference/member.md index f4e696884..c0bc0f97e 100644 --- a/docs/en/reference/member.md +++ b/docs/en/reference/member.md @@ -64,8 +64,8 @@ Note that if you want to look this class-name up, you can call Object::getCustom ## Overloading getCMSFields() If you overload the built-in function getCMSFields(), then you can change the form that is used to view & edit member -details in the newsletter system. This function returns a `[api:FieldSet]` object. You should generally start by calling -parent::getCMSFields() and manipulate the `[api:FieldSet]` from there. +details in the newsletter system. This function returns a `[api:FieldList]` object. You should generally start by calling +parent::getCMSFields() and manipulate the `[api:FieldList]` from there. :::php function getCMSFields() { @@ -106,10 +106,10 @@ things, you should add appropriate `[api:Permission::checkMember()]` calls to th * Modify the field set to be displayed in the CMS detail pop-up */ - function updateCMSFields(FieldSet $currentFields) { + function updateCMSFields(FieldList $currentFields) { // Only show the additional fields on an appropriate kind of use if(Permission::checkMember($this->owner->ID, "VIEW_FORUM")) { - // Edit the fieldset passed, adding or removing fields as necessary + // Edit the FieldList passed, adding or removing fields as necessary } } diff --git a/docs/en/reference/searchcontext.md b/docs/en/reference/searchcontext.md index e005a68ed..53abd480f 100644 --- a/docs/en/reference/searchcontext.md +++ b/docs/en/reference/searchcontext.md @@ -9,7 +9,7 @@ it just receives a set of search parameters and an object class it acts on. The default output of a `[api:SearchContext]` is either a `[api:SQLQuery]` object for further refinement, or a `[api:DataObject]` instance. -In case you need multiple contexts, consider namespacing your request parameters by using `FieldSet->namespace()` on +In case you need multiple contexts, consider namespacing your request parameters by using `FieldList->namespace()` on the $fields constructor parameter. `[api:SearchContext]` is mainly used by `[api:ModelAdmin]`, our generic data administration interface. Another @@ -71,7 +71,7 @@ method, we're building our own `getCustomSearchContext()` variant. $fields = $context->getSearchFields(); $form = new Form($this, "SearchForm", $fields, - new FieldSet( + new FieldList( new FormAction('doSearch') ) ); diff --git a/docs/en/reference/siteconfig.md b/docs/en/reference/siteconfig.md index b2e83f51e..47df15958 100644 --- a/docs/en/reference/siteconfig.md +++ b/docs/en/reference/siteconfig.md @@ -47,7 +47,7 @@ Create a mysite/code/CustomSiteConfig.php file. ); } - public function updateCMSFields(FieldSet $fields) { + public function updateCMSFields(FieldList $fields) { $fields->addFieldToTab("Root.Main", new HTMLEditorField("FooterContent", "Footer Content")); } } diff --git a/docs/en/topics/form-validation.md b/docs/en/topics/form-validation.md index a93fc5632..f68a61ee2 100644 --- a/docs/en/topics/form-validation.md +++ b/docs/en/topics/form-validation.md @@ -14,11 +14,11 @@ class. :::php function Form() { $form = new Form($this, 'Form', - new FieldSet( + new FieldList( new TextField('MyRequiredField'), new TextField('MyOptionalField') ), - new FieldSet( + new FieldList( new FormAction('submit', 'Submit') ), new RequiredFields(array('MyRequiredField')) diff --git a/docs/en/topics/forms.md b/docs/en/topics/forms.md index 4c303f00f..a0499fe88 100644 --- a/docs/en/topics/forms.md +++ b/docs/en/topics/forms.md @@ -14,19 +14,19 @@ constructor takes the following arguments: * `$name`: This must be the name of the method on that controller that is called to return the form. The first two fields allow the form object to be re-created after submission. **It's vital that they are properly set - if you ever have problems with form action handler not working, check that these values are correct.** -* `$fields`: A `[api:FieldSet]` containing `[api:FormField]` instances make up fields in the form. -* `$actions`: A `[api:FieldSet]` containing the `[api:FormAction]` objects - the buttons at the bottom. +* `$fields`: A `[api:FieldList]` containing `[api:FormField]` instances make up fields in the form. +* `$actions`: A `[api:FieldList]` containing the `[api:FormAction]` objects - the buttons at the bottom. * `$validator`: An optional `[api:Validator]` for more information. Example: :::php function MyCustomForm() { - $fields = new FieldSet( + $fields = new FieldList( new EmailField("Email"), new EncryptField("Password") ); - $actions = new FieldSet(new FormAction("login", "Log in")); + $actions = new FieldList(new FormAction("login", "Log in")); return new Form($this, "MyCustomForm", $fields, $actions); } @@ -44,11 +44,11 @@ $name must be passed - their values depend on where the form is instantiated. :::php class MyForm extends Form { function __construct($controller, $name) { - $fields = new FieldSet( + $fields = new FieldList( new EmailField("Email"), new EncryptedField("Password") ); - $actions = new FieldSet(new FormAction("login", "Log in")); + $actions = new FieldList(new FormAction("login", "Log in")); parent::__construct($controller, $name, $fields, $actions); } @@ -77,13 +77,13 @@ Full overview at [form-field-types](/reference/form-field-types) ### Using Form Fields To get these fields automatically rendered into a form element, all you need to do is create a new instance of the -class, and add it to the fieldset of the form. +class, and add it to the fieldlist of the form. :::php $form = new Form( $controller = $this, $name = "SignupForm", - $fields = new FieldSet( + $fields = new FieldList( new TextField( $name = "FirstName", $title = "First name" @@ -91,7 +91,7 @@ class, and add it to the fieldset of the form. new TextField("Surname"), new EmailField("Email", "Email address"), ), - $actions = new FieldSet( + $actions = new FieldList( // List the action buttons here new FormAction("signup", "Sign up") ), @@ -109,7 +109,7 @@ Implementing the more complex fields requires extra arguments. $form = new Form( $controller = $this, $name = "SignupForm", - $fields = new FieldSet( + $fields = new FieldList( // List the your fields here new TextField( $name = "FirstName", @@ -123,7 +123,7 @@ Implementing the more complex fields requires extra arguments. $source = Geoip::getCountryDropDown(), $value = Geoip::visitor_country() ) - ), new FieldSet( + ), new FieldList( // List the action buttons here new FormAction("signup", "Sign up") @@ -141,7 +141,7 @@ Readonly on a Form $myForm->makeReadonly(); -Readonly on a FieldSet +Readonly on a FieldList :::php $myFieldSet->makeReadonly(); @@ -170,12 +170,12 @@ First of all, you need to create your form on it's own class, that way you can d class MyForm extends Form { function __construct($controller, $name) { - $fields = new FieldSet( + $fields = new FieldList( new TextField('FirstName', 'First name'), new EmailField('Email', 'Email address') ); - $actions = new FieldSet( + $actions = new FieldList( new FormAction('submit', 'Submit') ); @@ -280,5 +280,5 @@ Adds a new text field called FavouriteColour next to the Content field in the CM * `[api:Form]` * `[api:FormField]` -* `[api:FieldSet]` +* `[api:FieldList]` * `[api:FormAction]` \ No newline at end of file diff --git a/docs/en/topics/page-types.md b/docs/en/topics/page-types.md index 83b377283..6b5f0c492 100644 --- a/docs/en/topics/page-types.md +++ b/docs/en/topics/page-types.md @@ -78,7 +78,7 @@ See [form](/topics/forms) and [tutorial:2-extending-a-basic-site](/tutorials/2-e ### removeFieldFromTab() -Overloading `getCMSFields()` you can call `removeFieldFromTab()` on a `[api:FieldSet]` object. For example, if you don't +Overloading `getCMSFields()` you can call `removeFieldFromTab()` on a `[api:FieldList]` object. For example, if you don't want the MenuTitle field to show on your page, which is inherited from `[api:SiteTree]`. :::php @@ -105,7 +105,7 @@ required on a certain page-type. class MyForm extends Form { function __construct($controller, $name) { - // add a default FieldSet of form fields + // add a default FieldList of form fields $member = singleton('Member'); $fields = $member->formFields(); @@ -113,7 +113,7 @@ required on a certain page-type. // We don't want the Country field from our default set of fields, so we remove it. $fields->removeByName('Country'); - $actions = new FieldSet( + $actions = new FieldList( new FormAction('submit', 'Submit') ); diff --git a/docs/en/topics/widgets.md b/docs/en/topics/widgets.md index 0f18c5c7a..2bed3d007 100644 --- a/docs/en/topics/widgets.md +++ b/docs/en/topics/widgets.md @@ -85,7 +85,7 @@ Photos), and $description, a short description that will appear in the cms edito Flickr). The class may also specify functions to be used in the template like a page type can. If a Widget has configurable options, then it can specify a number of database fields to store these options in via the -static $db array, and also specify a getCMSFields function that returns a !FieldSet, much the same way as a page type +static $db array, and also specify a getCMSFields function that returns a !FieldList, much the same way as a page type does. An example widget is below: @@ -139,7 +139,7 @@ An example widget is below: } function getCMSFields() { - return new FieldSet( + return new FieldList( new TextField("User", "User"), new TextField("PhotoSet", "Photo Set"), new TextField("Tags", "Tags"), @@ -246,10 +246,10 @@ sure that your controller follows the usual naming conventions, and it will be a return new Form( $this, 'MyFormName', - new FieldSet( + new FieldList( new TextField('TestValue') ), - new FieldSet( + new FieldList( new FormAction('doAction') ) ); diff --git a/docs/en/tutorials/2-extending-a-basic-site.md b/docs/en/tutorials/2-extending-a-basic-site.md index 4c4a712c5..8b3672f88 100644 --- a/docs/en/tutorials/2-extending-a-basic-site.md +++ b/docs/en/tutorials/2-extending-a-basic-site.md @@ -192,7 +192,7 @@ Let's walk through this method. Firstly, we get the fields from the parent class; we want to add fields, not replace them. The *$fields* variable -returned is a `[api:FieldSet]` object. +returned is a `[api:FieldList]` object. :::php $fields->addFieldToTab('Root.Content', new DateField('Date'), 'Content'); diff --git a/docs/en/tutorials/3-forms.md b/docs/en/tutorials/3-forms.md index 59da9fc12..e53718e2f 100644 --- a/docs/en/tutorials/3-forms.md +++ b/docs/en/tutorials/3-forms.md @@ -33,7 +33,7 @@ the form in a method on *HomePage_Controller*. function BrowserPollForm() { // Create fields - $fields = new FieldSet( + $fields = new FieldList( new TextField('Name'), new OptionsetField('Browser', 'Your Favourite Browser', array( 'Firefox' => 'Firefox', @@ -46,7 +46,7 @@ the form in a method on *HomePage_Controller*. ); // Create actions - $actions = new FieldSet( + $actions = new FieldList( new FormAction('doBrowserPoll', 'Submit') ); @@ -63,7 +63,7 @@ Let's step through this code. :::php // Create fields - $fields = new FieldSet( + $fields = new FieldList( new TextField('Name'), new OptionsetField('Browser', 'Your Favourite Browser', array( 'Firefox' => 'Firefox', @@ -78,7 +78,7 @@ Let's step through this code. First we create our form fields. -We do this by creating a `[api:FieldSet]` and passing our fields as arguments. The first field is a new +We do this by creating a `[api:FieldList]` and passing our fields as arguments. The first field is a new `[api:TextField]` with the name 'Name'. There is a second argument when creating a field which specifies the text on the label of the field. If no second @@ -88,7 +88,7 @@ The second field we create is an `[api:OptionsetField]`. This is a dropdown, and array mapping the values to the options listed in the dropdown. :::php - $actions = new FieldSet( + $actions = new FieldList( new FormAction('doBrowserPoll', 'Submit'); ); @@ -100,7 +100,7 @@ button. Here we create a 'Submit' button which calls the 'doBrowserPoll' method, which we will create later. -All the form actions (in this case only one) are collected into a `[api:FieldSet]` object the same way we did with +All the form actions (in this case only one) are collected into a `[api:FieldList]` object the same way we did with the fields. :::php @@ -111,7 +111,7 @@ Finally we create the `[api:Form]` object and return it. The first argument is the controller that contains the form, in most cases '$this'. The second is the name of the method that returns the form, which is 'BrowserPollForm' in our case. The third and fourth arguments are the -FieldSets containing the fields and form actions respectively. +FieldLists containing the fields and form actions respectively. After creating the form function, we need to add the form to our home page template. @@ -139,7 +139,7 @@ Add the following code to the form style sheet: margin: 20px 10px 0 0; width: 20%; } - form fieldset { + form FieldList { border:0; } #BrowserPoll .message { diff --git a/docs/en/tutorials/4-site-search.md b/docs/en/tutorials/4-site-search.md index e706ad2c6..f24244528 100644 --- a/docs/en/tutorials/4-site-search.md +++ b/docs/en/tutorials/4-site-search.md @@ -54,11 +54,11 @@ search on your site is to create a form for the user to type their query. Create function SearchForm() { $searchText = isset($this->Query) ? $this->Query : 'Search'; - $fields = new FieldSet( + $fields = new FieldList( new TextField("Search", "", $searchText) ); - $actions = new FieldSet( + $actions = new FieldList( new FormAction('results', 'Go') ); diff --git a/docs/en/tutorials/5-dataobject-relationship-management.md b/docs/en/tutorials/5-dataobject-relationship-management.md index 5d0966057..963da07e4 100644 --- a/docs/en/tutorials/5-dataobject-relationship-management.md +++ b/docs/en/tutorials/5-dataobject-relationship-management.md @@ -83,7 +83,7 @@ The first step is to create the student and project objects. ); function getCMSFields_forPopup() { - $fields = new FieldSet(); + $fields = new FieldList(); $fields->push( new TextField( 'FirstName', 'First Name' ) ); $fields->push( new TextField( 'Lastname' ) ); @@ -153,7 +153,7 @@ Let’s walk through the parameters of the *HasOneComplexTableField* constructor You can also directly replace the last parameter by this code : :::php - new FieldSet( + new FieldList( new TextField( 'FirstName', 'First Name' ), new TextField( 'Lastname' ), new TextField( 'Nationality' ) @@ -381,7 +381,7 @@ The first step is to create the module object and set the relation with the *Pro ); function getCMSFields_forPopup() { - $fields = new FieldSet(); + $fields = new FieldList(); $fields->push( new TextField( 'Name' ) ); return $fields; } diff --git a/filesystem/File.php b/filesystem/File.php index 8ee575584..36a36c311 100644 --- a/filesystem/File.php +++ b/filesystem/File.php @@ -775,7 +775,7 @@ class File extends DataObject { * * Needs to be enabled through {@link AssetAdmin::$metadata_upload_enabled} * - * @return FieldSet + * @return FieldList */ function uploadMetadataFields() { $fields = new FieldList(); diff --git a/filesystem/Folder.php b/filesystem/Folder.php index 3e074893f..949e5ecef 100644 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -379,8 +379,8 @@ class Folder extends File { } /** - * Return the FieldSet used to edit this folder in the CMS. - * You can modify this fieldset by subclassing folder, or by creating a {@link DataExtension} + * Return the FieldList used to edit this folder in the CMS. + * You can modify this FieldList by subclassing folder, or by creating a {@link DataExtension} * and implemeting updateCMSFields(FieldList $fields) on that extension. */ function getCMSFields() { diff --git a/forms/ComplexTableField.php b/forms/ComplexTableField.php index 4bebb9319..5294e4bb1 100644 --- a/forms/ComplexTableField.php +++ b/forms/ComplexTableField.php @@ -32,7 +32,7 @@ class ComplexTableField extends TableListField { /** * Determines the fields of the detail pop-up form. It can take many forms: - * - A FieldSet object: Use that field set directly. + * - A FieldList object: Use that field set directly. * - A method name, eg, 'getCMSFields': Call that method on the child object to get the fields. */ protected $addTitle; @@ -330,7 +330,7 @@ JS; /** * @return FieldList */ - function createFieldSet() { + function createFieldList() { $fieldset = new FieldList(); foreach($this->fieldTypes as $key => $fieldType){ $fieldset->push(new $fieldType($key)); @@ -352,7 +352,7 @@ JS; * Return the object-specific fields for the given record, to be shown in the detail pop-up * * This won't include all the CTF-specific 'plumbing; this method is called by self::getFieldsFor() - * and the result is then processed further to get the actual FieldSet for the form. + * and the result is then processed further to get the actual FieldList for the form. * * The default implementation of this processes the value of $this->detailFormFields; consequently, if you want to * set the value of the fields to something that $this->detailFormFields doesn't allow, you can do so by overloading diff --git a/forms/FieldGroup.php b/forms/FieldGroup.php index ff6f21f3d..283455ecc 100644 --- a/forms/FieldGroup.php +++ b/forms/FieldGroup.php @@ -52,7 +52,7 @@ class FieldGroup extends CompositeField { if(is_array($arg1) || is_a($arg1, 'FieldSet')) { $fields = $arg1; - } else if(is_array($arg2) || is_a($arg2, 'FieldSet')) { + } else if(is_array($arg2) || is_a($arg2, 'FieldList')) { $this->title = $arg1; $fields = $arg2; diff --git a/forms/FieldList.php b/forms/FieldList.php old mode 100755 new mode 100644 index 1fa85b4fa..1c93b9609 --- a/forms/FieldList.php +++ b/forms/FieldList.php @@ -80,7 +80,7 @@ class FieldList extends ArrayList { } /** - * Add an extra field to a tab within this fieldset. + * Add an extra field to a tab within this FieldList. * This is most commonly used when overloading getCMSFields() * * @param string $tabName The name of the tab or tabset. Subtabs can be referred to as TabSet.Tab or TabSet.Tab.Subtab. @@ -101,7 +101,7 @@ class FieldList extends ArrayList { } /** - * Add a number of extra fields to a tab within this fieldset. + * Add a number of extra fields to a tab within this FieldList. * This is most commonly used when overloading getCMSFields() * * @param string $tabName The name of the tab or tabset. Subtabs can be referred to as TabSet.Tab or TabSet.Tab.Subtab. @@ -143,7 +143,7 @@ class FieldList extends ArrayList { } /** - * Removes a number of fields from a Tab/TabSet within this FieldSet. + * Removes a number of fields from a Tab/TabSet within this FieldList. * * @param string $tabName The name of the Tab or TabSet field * @param array $fields A list of fields, e.g. array('Name', 'Email') @@ -159,7 +159,7 @@ class FieldList extends ArrayList { } /** - * Remove a field from this FieldSet by Name. + * Remove a field from this FieldList by Name. * The field could also be inside a CompositeField. * * @param string $fieldName The name of the field or tab @@ -169,7 +169,7 @@ class FieldList extends ArrayList { */ public function removeByName($fieldName, $dataFieldOnly = false) { if(!$fieldName) { - user_error('FieldSet::removeByName() was called with a blank field name.', E_USER_WARNING); + user_error('FieldList::removeByName() was called with a blank field name.', E_USER_WARNING); } $this->flushFieldsCache(); @@ -257,7 +257,7 @@ class FieldList extends ArrayList { public function findOrMakeTab($tabName, $title = null) { $parts = explode('.',$tabName); - // We could have made this recursive, but I've chosen to keep all the logic code within FieldSet rather than add it to TabSet and Tab too. + // We could have made this recursive, but I've chosen to keep all the logic code within FieldList rather than add it to TabSet and Tab too. $currentPointer = $this; foreach($parts as $k => $part) { $parentPointer = $currentPointer; @@ -274,7 +274,7 @@ class FieldList extends ArrayList { $parentPointer->push($currentPointer); } else { $withName = ($parentPointer->hasMethod('Name')) ? " named '{$parentPointer->Name()}'" : null; - user_error("FieldSet::addFieldToTab() Tried to add a tab to object '{$parentPointer->class}'{$withName} - '$part' didn't exist.", E_USER_ERROR); + user_error("FieldList::addFieldToTab() Tried to add a tab to object '{$parentPointer->class}'{$withName} - '$part' didn't exist.", E_USER_ERROR); } } } @@ -324,7 +324,7 @@ class FieldList extends ArrayList { } /** - * Inserts a field before a particular field in a FieldSet. + * Inserts a field before a particular field in a FieldList. * * @param FormField $item The form field to insert * @param string $name Name of the field to insert before @@ -349,7 +349,7 @@ class FieldList extends ArrayList { } /** - * Inserts a field after a particular field in a FieldSet. + * Inserts a field after a particular field in a FieldList. * * @param FormField $item The form field to insert * @param string $name Name of the field to insert after @@ -374,7 +374,7 @@ class FieldList extends ArrayList { } /** - * Push a single field into this FieldSet instance. + * Push a single field into this FieldList instance. * * @param FormField $item The FormField to add * @param string $key An option array key (field name) @@ -386,7 +386,7 @@ class FieldList extends ArrayList { } /** - * Handler method called before the FieldSet is going to be manipulated. + * Handler method called before the FieldList is going to be manipulated. */ protected function onBeforeInsert($item) { $this->flushFieldsCache(); @@ -395,9 +395,9 @@ class FieldList extends ArrayList { /** - * Set the Form instance for this FieldSet. + * Set the Form instance for this FieldList. * - * @param Form $form The form to set this FieldSet to + * @param Form $form The form to set this FieldList to */ public function setForm($form) { foreach($this as $field) $field->setForm($form); @@ -406,7 +406,7 @@ class FieldList extends ArrayList { /** * Load the given data into this form. * - * @param data An map of data to load into the FieldSet + * @param data An map of data to load into the FieldList */ public function setValues($data) { foreach($this->dataFields() as $field) { @@ -420,7 +420,7 @@ class FieldList extends ArrayList { * in a form - including fields nested in {@link CompositeFields}. * Useful when doing custom field layouts. * - * @return FieldSet + * @return FieldList */ function HiddenFields() { $hiddenFields = new HiddenFieldSet(); @@ -434,10 +434,10 @@ class FieldList extends ArrayList { } /** - * Transform this FieldSet with a given tranform method, + * Transform this FieldList with a given tranform method, * e.g. $this->transform(new ReadonlyTransformation()) * - * @return FieldSet + * @return FieldList */ function transform($trans) { $this->flushFieldsCache(); @@ -461,9 +461,9 @@ class FieldList extends ArrayList { } /** - * Transforms this FieldSet instance to readonly. + * Transforms this FieldList instance to readonly. * - * @return FieldSet + * @return FieldList */ function makeReadonly() { return $this->transform(new ReadonlyTransformation()); @@ -481,7 +481,7 @@ class FieldList extends ArrayList { } /** - * Change the order of fields in this FieldSet by specifying an ordered list of field names. + * Change the order of fields in this FieldList by specifying an ordered list of field names. * This works well in conjunction with SilverStripe's scaffolding functions: take the scaffold, and * shuffle the fields around to the order that you want. * diff --git a/forms/Form.php b/forms/Form.php index d44218e4a..15f2641ff 100644 --- a/forms/Form.php +++ b/forms/Form.php @@ -142,8 +142,8 @@ class Form extends RequestHandler { * * @param Controller $controller The parent controller, necessary to create the appropriate form action tag. * @param String $name The method on the controller that will return this form object. - * @param FieldList $fields All of the fields in the form - a {@link FieldSet} of {@link FormField} objects. - * @param FieldList $actions All of the action buttons in the form - a {@link FieldSet} of {@link FormAction} objects + * @param FieldList $fields All of the fields in the form - a {@link FieldList} of {@link FormField} objects. + * @param FieldList $actions All of the action buttons in the form - a {@link FieldLis} of {@link FormAction} objects * @param Validator $validator Override the default validator instance (Default: {@link RequiredFields}) */ function __construct($controller, $name, FieldList $fields, FieldList $actions, $validator = null) { @@ -338,7 +338,7 @@ class Form extends RequestHandler { /** * Handle a field request. * Uses {@link Form->dataFieldByName()} to find a matching field, - * and falls back to {@link FieldSet->fieldByName()} to look + * and falls back to {@link FieldList->fieldByName()} to look * for tabs instead. This means that if you have a tab and a * formfield with the same name, this method gives priority * to the formfield. @@ -460,7 +460,7 @@ class Form extends RequestHandler { /** * Generate extra special fields - namely the security token field (if required). * - * @return FieldSet + * @return FieldList */ public function getExtraFields() { $extraFields = new FieldList(); @@ -483,7 +483,7 @@ class Form extends RequestHandler { /** * Return the form's fields - used by the templates * - * @return FieldSet The form fields + * @return FieldList The form fields */ function Fields() { foreach($this->getExtraFields() as $field) { @@ -498,7 +498,7 @@ class Form extends RequestHandler { * in a form - including fields nested in {@link CompositeFields}. * Useful when doing custom field layouts. * - * @return FieldSet + * @return FieldList */ function HiddenFields() { return $this->fields->HiddenFields(); @@ -531,7 +531,7 @@ class Form extends RequestHandler { /** * Return the form's action buttons - used by the templates * - * @return FieldSet The action list + * @return FieldList The action list */ function Actions() { return $this->actions; @@ -916,7 +916,7 @@ class Form extends RequestHandler { * It will call $object->MyField to get the value of MyField. * If you passed an array, it will call $object[MyField]. * Doesn't save into dataless FormFields ({@link DatalessField}), - * as determined by {@link FieldSet->dataFields()}. + * as determined by {@link FieldList->dataFields()}. * * By default, if a field isn't set (as determined by isset()), * its value will not be saved to the field, retaining @@ -925,7 +925,7 @@ class Form extends RequestHandler { * Passed data should not be escaped, and is saved to the FormField instances unescaped. * Escaping happens automatically on saving the data through {@link saveInto()}. * - * @uses FieldSet->dataFields() + * @uses FieldList->dataFields() * @uses FormField->setValue() * * @param array|DataObject $data @@ -1022,7 +1022,7 @@ class Form extends RequestHandler { /** * Get the submitted data from this form through - * {@link FieldSet->dataFields()}, which filters out + * {@link FieldList->dataFields()}, which filters out * any form-specific data like form-actions. * Calls {@link FormField->dataValue()} on each field, * which returns a value suitable for insertion into a DataObject diff --git a/forms/FormField.php b/forms/FormField.php index e409c2105..fb16ce2cb 100644 --- a/forms/FormField.php +++ b/forms/FormField.php @@ -2,7 +2,7 @@ /** * Represents a field in a form. * - * A FieldSet contains a number of FormField objects which make up the whole of a form. + * A FieldList contains a number of FormField objects which make up the whole of a form. * In addition to single fields, FormField objects can be "composite", for example, the {@link TabSet} * field. Composite fields let us define complex forms without having to resort to custom HTML. * @@ -53,8 +53,8 @@ class FormField extends RequestHandler { protected $tabIndex; /** - * Stores a reference to the FieldSet that contains this object. - * @var FieldSet + * Stores a reference to the FieldList that contains this object. + * @var FieldList */ protected $containerFieldSet; @@ -480,7 +480,7 @@ HTML; * make sense for data-focused methods to look at them. By overloading hasData() to return false, * you can prevent any data-focused methods from looking at it. * - * @see FieldSet::collateDataFields() + * @see FieldList::collateDataFields() */ function hasData() { return true; } @@ -654,7 +654,7 @@ HTML; } /** - * Set the fieldset that contains this field. + * Set the FieldList that contains this field. * * @param FieldList $containerFieldSet */ diff --git a/forms/FormScaffolder.php b/forms/FormScaffolder.php index 1215e1d88..65f9d64cb 100644 --- a/forms/FormScaffolder.php +++ b/forms/FormScaffolder.php @@ -62,7 +62,7 @@ class FormScaffolder extends Object { * Depending on those parameters, the fields can be used in ajax-context, * contain {@link TabSet}s etc. * - * @return FieldSet + * @return FieldList */ public function getFieldSet() { $fields = new FieldList(); diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index fbf5c40e4..31746a4f5 100644 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -34,7 +34,7 @@ * $map = $myDoSet->toDropDownMap(); * * // Instantiate the OptionsetField - * $fieldset = new FieldList( + * $FieldList = new FieldList( * new OptionsetField( * $name = "Foobar", * $title = "FooBar's optionset", diff --git a/forms/TabSet.php b/forms/TabSet.php index 460fda0dc..e7495863a 100644 --- a/forms/TabSet.php +++ b/forms/TabSet.php @@ -133,7 +133,7 @@ class TabSet extends CompositeField { } /** - * Inserts a field before a particular field in a FieldSet. + * Inserts a field before a particular field in a FieldList. * * @param FormField $item The form field to insert * @param string $name Name of the field to insert before diff --git a/forms/TableField.php b/forms/TableField.php index 462f28969..b30d702bf 100644 --- a/forms/TableField.php +++ b/forms/TableField.php @@ -20,7 +20,7 @@ * @param $sourceSort string * @param $sourceJoin string * - * @todo We should refactor this to support a single FieldSet instead of evaluated Strings for building FormFields + * @todo We should refactor this to support a single FieldList instead of evaluated Strings for building FormFields * * @package forms * @subpackage fields-relational @@ -43,7 +43,7 @@ class TableField extends TableListField { protected $filterValue = null; /** - * @var $fieldTypes FieldSet + * @var $fieldTypes FieldList * Caution: Use {@setExtraData()} instead of manually adding HiddenFields if you want to * preset relations or other default data. */ @@ -206,7 +206,7 @@ class TableField extends TableListField { /** * Generates a new {@link TableField} instance - * by loading a fieldset for this row into a temporary form. + * by loading a FieldList for this row into a temporary form. * * @param DataObject $dataObj * @return TableField_Item diff --git a/model/DataExtension.php b/model/DataExtension.php index da25a6ef0..2a3692b80 100644 --- a/model/DataExtension.php +++ b/model/DataExtension.php @@ -172,7 +172,7 @@ abstract class DataExtension extends Extension { * * Caution: Use {@link FieldList->addFieldToTab()} to add fields. * - * @param FieldList $fields FieldSet with a contained TabSet + * @param FieldList $fields FieldList with a contained TabSet */ function updateCMSFields(FieldList $fields) { } @@ -181,9 +181,9 @@ abstract class DataExtension extends Extension { * This function is used to provide modifications to the form used * for front end forms. {@link DataObject->getFrontEndFields()} * - * Caution: Use {@link FieldSet->push()} to add fields. + * Caution: Use {@link FieldList->push()} to add fields. * - * @param FieldList $fields FieldSet without TabSet nesting + * @param FieldList $fields FieldList without TabSet nesting */ function updateFrontEndFields(FieldList $fields) { } @@ -192,7 +192,7 @@ abstract class DataExtension extends Extension { * This is used to provide modifications to the form actions * used in the CMS. {@link DataObject->getCMSActions()}. * - * @param FieldList $actions FieldSet + * @param FieldList $actions FieldList */ function updateCMSActions(FieldList $actions) { } diff --git a/model/DataObject.php b/model/DataObject.php index 943942a71..7e6d976a2 100644 --- a/model/DataObject.php +++ b/model/DataObject.php @@ -1764,7 +1764,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * @param array $_params * 'fieldClasses': Associative array of field names as keys and FormField classes as values * 'restrictFields': Numeric array of a field name whitelist - * @return FieldSet + * @return FieldList */ public function scaffoldSearchFields($_params = null) { $params = array_merge( @@ -1821,7 +1821,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * @uses FormScaffolder * * @param array $_params Associative array passing through properties to {@link FormScaffolder}. - * @return FieldSet + * @return FieldList */ public function scaffoldFormFields($_params = null) { $params = array_merge( @@ -1867,7 +1867,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * @see Good example of complex FormField building: SiteTree::getCMSFields() * * @param array $params See {@link scaffoldFormFields()} - * @return FieldSet Returns a TabSet for usage within the CMS - don't use for frontend forms. + * @return FieldList Returns a TabSet for usage within the CMS - don't use for frontend forms. */ public function getCMSFields($params = null) { $tabbedFields = $this->scaffoldFormFields(array_merge( @@ -1888,7 +1888,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * need to be overload by solid dataobject, so that the customised actions of that dataobject, * including that dataobject's extensions customised actions could be added to the EditForm. * - * @return an Empty FieldSet(); need to be overload by solid subclass + * @return an Empty FieldList(); need to be overload by solid subclass */ public function getCMSActions() { $actions = new FieldList(); @@ -1906,7 +1906,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity * @todo Decide on naming for "website|frontend|site|page" and stick with it in the API * * @param array $params See {@link scaffoldFormFields()} - * @return FieldSet Always returns a simple field collection without TabSet. + * @return FieldList Always returns a simple field collection without TabSet. */ public function getFrontEndFields($params = null) { $untabbedFields = $this->scaffoldFormFields($params); diff --git a/search/SearchContext.php b/search/SearchContext.php index 1a5406f1d..e05db8e2d 100644 --- a/search/SearchContext.php +++ b/search/SearchContext.php @@ -10,7 +10,7 @@ * search results, e.g. in a {@link TableListField} instance. * * In case you need multiple contexts, consider namespacing your request parameters -* by using {@link FieldSet->namespace()} on the $fields constructor parameter. +* by using {@link FieldList->namespace()} on the $fields constructor parameter. * * Each DataObject subclass can have multiple search contexts for different cases, * e.g. for a limited frontend search and a fully featured backend search. @@ -37,7 +37,7 @@ class SearchContext extends Object { * FormFields mapping to {@link DataObject::$db} properties * which are supposed to be searchable. * - * @var FieldSet + * @var FieldList */ protected $fields; @@ -79,7 +79,7 @@ class SearchContext extends Object { /** * Returns scaffolded search fields for UI. * - * @return FieldSet + * @return FieldList */ public function getSearchFields() { return ($this->fields) ? $this->fields : singleton($this->modelClass)->scaffoldSearchFields(); @@ -232,7 +232,7 @@ class SearchContext extends Object { /** * Get the list of searchable fields in the current search context. * - * @return FieldSet + * @return FieldList */ public function getFields() { return $this->fields; diff --git a/security/ChangePasswordForm.php b/security/ChangePasswordForm.php index 7e933b6d9..36261ad42 100644 --- a/security/ChangePasswordForm.php +++ b/security/ChangePasswordForm.php @@ -13,11 +13,11 @@ class ChangePasswordForm extends Form { * create the appropriate form action tag. * @param string $name The method on the controller that will return this * form object. - * @param FieldSet|FormField $fields All of the fields in the form - a - * {@link FieldSet} of {@link FormField} + * @param FieldList|FormField $fields All of the fields in the form - a + * {@link FieldList} of {@link FormField} * objects. - * @param FieldSet|FormAction $actions All of the action buttons in the - * form - a {@link FieldSet} of + * @param FieldList|FormAction $actions All of the action buttons in the + * form - a {@link FieldList} of */ function __construct($controller, $name, $fields = null, $actions = null) { if(isset($_REQUEST['BackURL'])) { diff --git a/security/Group.php b/security/Group.php index ebc5581cb..054586436 100644 --- a/security/Group.php +++ b/security/Group.php @@ -57,7 +57,7 @@ class Group extends DataObject { /** * Caution: Only call on instances, not through a singleton. * - * @return FieldSet + * @return FieldList */ public function getCMSFields() { Requirements::javascript(SAPPHIRE_DIR . '/javascript/PermissionCheckboxSetField.js'); diff --git a/security/Member.php b/security/Member.php index 373d34462..3cc516cc1 100644 --- a/security/Member.php +++ b/security/Member.php @@ -504,7 +504,7 @@ class Member extends DataObject { * Returns the fields for the member form - used in the registration/profile module. * It should return fields that are editable by the admin and the logged-in user. * - * @return FieldSet Returns a {@link FieldSet} containing the fields for + * @return FieldList Returns a {@link FieldList} containing the fields for * the member form. */ public function getMemberFormFields() { @@ -1091,10 +1091,10 @@ class Member extends DataObject { /** - * Return a {@link FieldSet} of fields that would appropriate for editing + * Return a {@link FieldList} of fields that would appropriate for editing * this member. * - * @return FieldSet Return a FieldSet of fields that would appropriate for + * @return FieldList Return a FieldList of fields that would appropriate for * editing this member. */ public function getCMSFields() { diff --git a/security/MemberLoginForm.php b/security/MemberLoginForm.php index f88b88bc2..7f10328a8 100644 --- a/security/MemberLoginForm.php +++ b/security/MemberLoginForm.php @@ -21,11 +21,11 @@ class MemberLoginForm extends LoginForm { * create the appropriate form action tag. * @param string $name The method on the controller that will return this * form object. - * @param FieldSet|FormField $fields All of the fields in the form - a - * {@link FieldSet} of {@link FormField} + * @param FieldList|FormField $fields All of the fields in the form - a + * {@link FieldList} of {@link FormField} * objects. - * @param FieldSet|FormAction $actions All of the action buttons in the - * form - a {@link FieldSet} of + * @param FieldList|FormAction $actions All of the action buttons in the + * form - a {@link FieldList} of * {@link FormAction} objects * @param bool $checkCurrentUser If set to TRUE, it will be checked if a * the user is currently logged in, and if