diff --git a/docs/en/reference/advanced-templates.md b/docs/en/reference/advanced-templates.md index 3b7f483ed83..abff339153a 100644 --- a/docs/en/reference/advanced-templates.md +++ b/docs/en/reference/advanced-templates.md @@ -406,7 +406,7 @@ to debug. ## Related * [Templates](/topics/templates) * [Themes](/topics/themes) -* [Developing Themes](theme-development) +* [Developing Themes](/topics/theme-development) * [Widgets](/topics/widgets) * [Images](/reference/image) * [Built in page controls](/reference/built-in-page-controls) diff --git a/docs/en/reference/bbcode.md b/docs/en/reference/bbcode.md index 3e196c33bdf..d95deb399af 100644 --- a/docs/en/reference/bbcode.md +++ b/docs/en/reference/bbcode.md @@ -9,7 +9,7 @@ BBCode is used by default in the [blog](http://silverstripe.org/blog-module) and To add bbcode parsing to a template, instead of $Content use: - :::php + :::ss $Content.Parse(BBCodeParser) diff --git a/docs/en/reference/built-in-page-controls.md b/docs/en/reference/built-in-page-controls.md index f6bb83907b1..ab83a6444ca 100644 --- a/docs/en/reference/built-in-page-controls.md +++ b/docs/en/reference/built-in-page-controls.md @@ -60,7 +60,7 @@ SilverStripe supports a simple set of conditional logic <% end_if %> -See more information on conditional logic on [templates](templates). +See more information on conditional logic on [templates](/topics/templates). ### Site wide settings diff --git a/docs/en/reference/complextablefield.md b/docs/en/reference/complextablefield.md index f9bb74255ae..e28052e7bcf 100644 --- a/docs/en/reference/complextablefield.md +++ b/docs/en/reference/complextablefield.md @@ -15,7 +15,7 @@ See `[api:TableListField]`. ## Setting Parent/Child-Relations -ComplexTableField tries to determine the parent-relation automatically by looking at the $has_one property on the listed +`[api:ComplexTableField]` tries to determine the parent-relation automatically by looking at the $has_one property on the listed child, or the record loaded into the surrounding form (see getParentClass() and getParentIdName()). You can force a specific parent relation: @@ -62,18 +62,18 @@ You can override this behaviour in various ways: If you don't want several functions to appear (e.g. no add-link), there's several ways: -* Use ComplexTableField->setPermissions(array("show","edit")) to limit the functionality without touching the template +* Use `ComplexTableField->setPermissions(array("show","edit"))` to limit the functionality without touching the template (more secure). Possible values are "show","edit", "delete" and "add". -* Subclass ComplexTableField and override the rendering-mechanism -* Use ComplexTableField->setTemplate() and ComplexTableField->setTemplatePopup() to provide custom templates +* Subclass `[api:ComplexTableField]` and override the rendering-mechanism +* Use `ComplexTableField->setTemplate()` and `ComplexTableField->setTemplatePopup()` to provide custom templates ### Customising fields and Requirements in the popup There are several ways to customise the fields in the popup. Often you would want to display more information in the popup as there is more real-estate for you to play with. -ComplexTableField gives you several options to do this. You can either +`[api:ComplexTableField]` gives you several options to do this. You can either * Pass a FieldSet in the constructor. * Pass a String in the constructor. @@ -83,7 +83,7 @@ The second will call the String as a method on the source class (Which should re Popup. You can also customise Javascript which is loaded for the Lightbox. As Requirements::clear() is called when the popup is -instantiated, ComplexTableField will look for a function to gather any specific requirements that you might need on your +instantiated, `[api:ComplexTableField]` will look for a function to gather any specific requirements that you might need on your source class. (e.g. Inline Javascript or styling). For this, create a function called "getRequirementsForPopup". @@ -116,11 +116,11 @@ You'll have to do something like this in your form: You have to hack in an ID on the form, as the CMS forms have this, and front end forms usually do not. -It's not a perfect solution, but it works relatively well to get a simple ComplexTableField up and running on the front +It's not a perfect solution, but it works relatively well to get a simple `[api:ComplexTableField]` up and running on the front end. To come: Make it a lot more flexible so tables can be easily used on the front end. It also needs to be flexible enough -to use a popup as well, out of the box. +to use a popup as well, out of the box. ## Subclassing @@ -144,7 +144,7 @@ Most of the time, you need to override the following methods: * Find a less fragile solution for accessing this field through the main controller and ReferencedField, e.g. build a seperate CTF-instance (doesn't necessarly have to be connected to the original by ReferencedField) * Control width/height of popup by constructor (hardcoded at the moment) -* Integrate search from MemberTableField.php directly on ComplexTableField +* Integrate search from MemberTableField.php directly on `[api:ComplexTableField]` * Less performance-hungry implementation of detail-view paging (don't return all items on a single view) * Use automatic has-many and many-many functions to return a ComponentSet rather than building the join manually -* Javascript/Ajax-Sorting (see http://www.activewidgets.com/grid/ and http://openrico.org/rico/livegrid.page) +* Javascript/Ajax-Sorting (see [http://www.activewidgets.com/grid/](http://www.activewidgets.com/grid/) and [http://openrico.org/rico/livegrid.page](http://openrico.org/rico/livegrid.page)) diff --git a/docs/en/reference/database-structure.md b/docs/en/reference/database-structure.md index fa3948c0c91..0f728a922ef 100644 --- a/docs/en/reference/database-structure.md +++ b/docs/en/reference/database-structure.md @@ -5,7 +5,7 @@ opting for "convention over configuration". This page details what that databas ## Base tables -Each direct sub-class of DataObject will have its own table. +Each direct sub-class of `[api:DataObject]` will have its own table. The following fields are always created. @@ -36,21 +36,21 @@ data sub-classed objects across **multiple tables**. For example, suppose we have the following set of classes: -* Class SiteTree extends DataObject: Title, Content fields -* Class Page extends SiteTree: Abstract field -* Class NewsSection extends SiteTree: *No special fields* -* Class NewsArticle extend Page: ArticleDate field +* Class `[api:SiteTree]` extends `[api:DataObject]`: Title, Content fields +* Class `[api:Page]` extends `[api:SiteTree]`: Abstract field +* Class NewsSection extends `[api:SiteTree]`: *No special fields* +* Class NewsArticle extend `[api:Page]`: ArticleDate field The data for the following classes would be stored across the following tables: -* SiteTree +* `[api:SiteTree]` * ID: Int * ClassName: Enum('SiteTree', 'Page', 'NewsArticle') * Created: Datetime * LastEdited: Datetime * Title: Varchar * Content: Text -* Page +* `[api:Page]` * ID: Int * Abstract: Text * NewsArticle @@ -59,16 +59,16 @@ The data for the following classes would be stored across the following tables: The way it works is this: -* "Base classes" are direct sub-classes of DataObject. They are always given a table, whether or not they have special -fields. This is called the "base table" +* "Base classes" are direct sub-classes of `[api:DataObject]`. They are always given a table, whether or not they have +special fields. This is called the "base table" * The base table's ClassName field is set to class of the given record. It's an enumeration of all possible sub-classes of the base class (including the base class itself) * Each sub-class of the base object will also be given its own table, *as long as it has custom fields*. In the example above, NewsSection didn't have its own data and so an extra table would be redundant. * In all the tables, ID is the primary key. A matching ID number is used for all parts of a particular record: -record #2 in Page refers to the same object as record #2 in SiteTree. +record #2 in Page refers to the same object as record #2 in `[api:SiteTree]`. -To retrieve a news article, SilverStripe joins the SiteTree, Page and NewsArticle tables by their ID fields. We use a +To retrieve a news article, SilverStripe joins the `[api:SiteTree]`, `[api:Page]` and NewsArticle tables by their ID fields. We use a left-join for robustness; if there is no matching record in Page, we can return a record with a blank Article field. ## Staging and versioning @@ -126,4 +126,4 @@ other database platforms if we chose to support them. * We'd like to support more than just MySQL, however, there needs to be a pretty good reason for doing so since it will become something that needs to be supported for the rest of SilverStripe's life and could easily become an albatross. On the cards are MS SQL, PostgreSQL and SQLite. -* It could be desireable to implement a non-repeating auto-numbering system. +* It could be desirable to implement a non-repeating auto-numbering system. diff --git a/docs/en/reference/dataobject.md b/docs/en/reference/dataobject.md index e4a7df2f324..628fc00437a 100644 --- a/docs/en/reference/dataobject.md +++ b/docs/en/reference/dataobject.md @@ -12,7 +12,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, +The call to `DataObject->getCMSFields()` is the centerpiece of every data administration interface in SilverStripe, which returns a `[api:FieldSet]`''. :::php @@ -33,8 +33,6 @@ These calls retrieve a `[api:FieldSet]` for the area where you intend to work wi * Requirements: SilverStripe 2.3.* -// bla - :::php $fields = singleton('MyDataObject')->getCMSFields(); @@ -82,8 +80,8 @@ Example: Simple Definition } -Searchable fields will be appear in the search interface with a default form field (usually a TextField) and a default -search filter assigned (usually an ExactMatchFilter). To override these defaults, you can specify additional information +Searchable fields will be appear in the search interface with a default form field (usually a `[api:TextField]`) and a default +search filter assigned (usually an `[api:ExactMatchFilter]`). To override these defaults, you can specify additional information on `$searchable_fields`: :::php @@ -95,7 +93,7 @@ on `$searchable_fields`: } -If you assign a single string value, you can set it to be either a FormField or SearchFilter. To specify both, you can +If you assign a single string value, you can set it to be either a `[api:FormField]` or `[api:SearchFilter]`. To specify both, you can assign an array: :::php @@ -144,7 +142,7 @@ To include relations (''$has_one'', `$has_many` and `$many_many`) in your search * Requirements: SilverStripe 2.3.* -Summary fields can be used to show a quick overview of the data for a specific DataObject record. Most common use is +Summary fields can be used to show a quick overview of the data for a specific `[api:DataObject]` record. Most common use is their display as table columns, e.g. in the search results of a `[api:ModelAdmin]` CMS interface. Example: Getting predefined summary fields diff --git a/docs/en/reference/dataobjectdecorator.md b/docs/en/reference/dataobjectdecorator.md index 721fc6c6c84..2fab18cee6d 100644 --- a/docs/en/reference/dataobjectdecorator.md +++ b/docs/en/reference/dataobjectdecorator.md @@ -9,7 +9,7 @@ implementation. Have a look at `[api:Object->useCustomClass()]`. ## Usage -Your Decorator will nee to be a subclass of DataObjectDecorator or the Extension class. +Your Decorator will nee to be a subclass of `[api:DataObjectDecorator]` or the `[api:Extension]` class. :::php owner for information about the data object, such as the fields it has +* You can query ``$this->owner`` for information about the data object, such as the fields it has * You can use **DB::requireTable($tableName, $fieldList, $indexList)** to set up your new tables. This function takes care of creating, modifying, or leaving tables as required, based on your desired schema. ### Custom write queries If you have customised the generated database, then you probably want to change the way that writes happen. This is -used by Versioned to get an entry written in ClassName_versions whenever an insert/update happens. +used by `[api:Versioned]` to get an entry written in ClassName_versions whenever an insert/update happens. To do this, define the **augmentWrite(&$manipulation)** method. This method is passed a manipulation array representing the write about to happen, and is able to amend this as desired, since it is passed by reference. @@ -125,17 +125,17 @@ be modified as needed by your method. Instead of a manipulation array, we have ### Additional methods -The other thing you may want to do with a decorator is provide a method that can be called on the DataObject that is -being decorated. For instance, you may add a publish() method to every DataObject that is decorated with Versioned. +The other thing you may want to do with a decorator is provide a method that can be called on the `[api:DataObject]` that is +being decorated. For instance, you may add a publish() method to every `[api:DataObject]` that is decorated with `[api:Versioned]`. This is as simple as defining a method called publish() on your decorator. Bear in mind, however, that instead of $this, you should be referring to $this->owner. -* $this = The DataObjectDecorator object. -* $this->owner = The related DataObject object. +* $this = The `[api:DataObjectDecorator]` object. +* $this->owner = The related `[api:DataObject]` object. -If you want to add your own internal properties, you can add this to the DataObjectDecorator, and these will be referred -to as $this->propertyName. Every DataObject has an associated DataObjectDecorator instance for each class that it is +If you want to add your own internal properties, you can add this to the `[api:DataObjectDecorator]`, and these will be referred +to as `$this->propertyName`. Every `[api:DataObject]` has an associated `[api:DataObjectDecorator]` instance for each class that it is decorated by. :::php diff --git a/docs/en/reference/dataobjectset.md b/docs/en/reference/dataobjectset.md index 4eaca3a80a6..97e45fb4b58 100644 --- a/docs/en/reference/dataobjectset.md +++ b/docs/en/reference/dataobjectset.md @@ -6,7 +6,7 @@ This class represents a set of `[api:DataObject]`s, such as the results of a que [datamodel](/topics/datamodel)-related querying. It implements the [Iterator interface](http://php.net/manual/en/language.oop5.iterations.php) introduced in PHP5. -Relations (`has_many`/`many_many`) are described in `[api:ComponentSet]`, a subclass of DataObjectSet. +Relations (`has_many`/`many_many`) are described in `[api:ComponentSet]`, a subclass of `[api:DataObjectSet]`. ## Usage @@ -56,7 +56,7 @@ This works on the object itself, so do NOT do something like this: :::php $sortedSet = $mySet->sort('Lastname'); //ascending -## Merge with other DataObjectSets +## Merge with other `[api:DataObjectSet]`s :::php $myFirstSet->merge($mySecondSet); @@ -88,7 +88,7 @@ It is good practice to check for empty sets before doing any iteration. ### Paging -DataObjects have native support for dealing with **pagination**. +`[api:DataObject]`s have native support for dealing with **pagination**. See *setPageLimits*, *setPageLength*, etc. FIXME Complete pagination documentation diff --git a/docs/en/reference/director.md b/docs/en/reference/director.md index 96ed293252e..9de2babde72 100644 --- a/docs/en/reference/director.md +++ b/docs/en/reference/director.md @@ -2,7 +2,7 @@ ## Introduction -Director is the first step in the "execution pipeline". It parses the URL, matching it to one of a number of patterns, +`[api:Director]` is the first step in the "execution pipeline". It parses the URL, matching it to one of a number of patterns, and determines the controller, action and any argument to be used. It then runs the controller, which will finally run the viewer and/or perform processing steps. @@ -12,7 +12,7 @@ the viewer and/or perform processing steps. ## Redirection -The Director class has a number of methods to facilitate 301 and 302 HTTP redirection. +The `[api:Director]` class has a number of methods to facilitate 301 and 302 HTTP redirection. * **Director::redirect("action-name")**: If there's no slash in the URL passed to redirect, then it is assumed that you want to go to a different action on the current controller. @@ -33,8 +33,8 @@ redirectBack(). You can influence the way URLs are resolved one of 2 ways -1. Adding rules to Director in `/_config.php` (See Default Rewrite Rules below for examples) -2. Adding rules in your extended Controller class via the *$url_handlers* static variable +1. Adding rules to `[api:Director]` in `/_config.php` (See Default Rewrite Rules below for examples) +2. Adding rules in your extended `[api:Controller]` class via the *$url_handlers* static variable See [controller](/topics/controller) for examples and explanations on how the rules get processed for both 1 and 2 above. @@ -56,7 +56,7 @@ SilverStripe comes with certain rewrite rules (e.g. for *admin/assets*). ## Links -* See ModelAsController class for details on controller/model-coupling +* See `[api:ModelAsController]` class for details on controller/model-coupling * See [execution-pipeline](/reference/execution-pipeline) for custom routing ## API Documentation diff --git a/docs/en/reference/execution-pipeline.md b/docs/en/reference/execution-pipeline.md index 204e9c410b3..4138671292e 100644 --- a/docs/en/reference/execution-pipeline.md +++ b/docs/en/reference/execution-pipeline.md @@ -53,7 +53,7 @@ All requests go through main.php, which sets up the environment and then hands c **See:** The API documentation of `[api:Main]` for information about how main.php processes requests. ## Director and URL patterns -main.php relies on Director to work out which controller should handle this request. Director will instantiate that +main.php relies on `[api:Director]` to work out which controller should handle this request. `[api:Director]` will instantiate that controller object and then call `[api:Controller::run()]`. **See:** The API documentation of `[api:Director]` for information about how Director parses URLs and hands control over to a controller object. @@ -73,7 +73,7 @@ When you create a function, you can access the ID like this: ## Controllers and actions -Controllers are the building blocks of your application. +`[api:Controller]`s are the building blocks of your application. **See:** The API documentation for `[api:Controller]` diff --git a/docs/en/reference/form-field-types.md b/docs/en/reference/form-field-types.md index 0e36b6b865a..f4a939b54bb 100644 --- a/docs/en/reference/form-field-types.md +++ b/docs/en/reference/form-field-types.md @@ -48,7 +48,7 @@ set {inlcudeDefaultJS} to false and work with behaviour.js. * `[FileField](api:FileField)`: Simple file upload dialog. * `[FileIFrameField](api:FileIFrameField)`: File uploads through an iframe -* `[api:Image]`: Image upload through an iframe, with thumbnails and file-selection from existing assets +* `[api:ImageField]`: Image upload through an iframe, with thumbnails and file-selection from existing assets * `[SimpleImageField](api:SimpleImageField)`: SimpleImageField provides an easy way of uploading images to Image has_one relationships. Unlike ImageField, it doesn't use an iframe. diff --git a/docs/en/reference/image.md b/docs/en/reference/image.md index 634fa1c4d96..14a89ca7867 100644 --- a/docs/en/reference/image.md +++ b/docs/en/reference/image.md @@ -111,8 +111,8 @@ and whenever you upload or modify an Image through SilverStripe. If you encounter problems with images not appearing, or have mysteriously disappeared, you can try manually flushing the image cache. - + http://www.mysite.com/images/flush - + ## API Documentation `[api:Image]` diff --git a/docs/en/reference/index.md b/docs/en/reference/index.md index e42bd3dd5ba..57f75f5e8d6 100644 --- a/docs/en/reference/index.md +++ b/docs/en/reference/index.md @@ -2,6 +2,7 @@ Reference articles complement our auto-generated [API docs](http://api.silverstripe.org) in providing deeper introduction into a specific API. +* [Advanced templates](advanced-templates): Advanced SilverStripe template syntax * [BBCode](bbcode): Extensible shortcode syntax * [Built-in page controls](built-in-page-controls): Explains the template syntax and available variables/placeholders * [ComplexTableField](complextablefield): Manage records and their relations inside the CMS @@ -29,7 +30,6 @@ Reference articles complement our auto-generated [API docs](http://api.silverstr * [StaticPublisher](staticpublisher): Export a page tree as static HTML for better performance and portability * [TableField](tablefield): Add and edit records with inline edits in this form field * [TableListField](tablelistfield): View and delete records in the CMS -* [Templates](templates): Process our data for output in HTML and other formats * [Typography](typography): CSS file to enable WYSIWYG previews in the CMS * [urlvariabletools](urlvariabletools): Debug and maintenance switches * [Versioned](versioned): Extension for SiteTree and other classes to store old versions and provide "staging" diff --git a/docs/en/reference/member.md b/docs/en/reference/member.md index f42bfb866b2..de22b994219 100644 --- a/docs/en/reference/member.md +++ b/docs/en/reference/member.md @@ -2,11 +2,11 @@ ## Introduction -The Member class is used to represent user accounts on a SilverStripe site (including newsletter recipients). +The `[api:Member]` class is used to represent user accounts on a SilverStripe site (including newsletter recipients). ## Testing For Logged In Users -The Member class comes with 2 static methods for getting information about the current logged in user. +The `[api:Member]` class comes with 2 static methods for getting information about the current logged in user. **Member::currentUserID()** @@ -38,10 +38,11 @@ Returns the full *Member* Object for the current user, returns *null* if user is ## Subclassing
-This is the least desirable way of extending the Member class. It's better to use DataObjectDecorator (see below). +This is the least desirable way of extending the `[api:Member]` class. It's better to use `[api:DataObjectDecorator]` +(see below).
-You can defined subclasses of member to add extra fields or functionality to the built-in membership system. +You can defined subclasses of `[api:Member]` to add extra fields or functionality to the built-in membership system. :::php class MyMember extends Member { @@ -63,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 FieldSet object. You should generally start by calling -parent::getCMSFields() and manipulate the FieldSet from there. +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. :::php function getCMSFields() { @@ -78,11 +79,11 @@ parent::getCMSFields() and manipulate the FieldSet from there. ## Extending Member or DataObject? -Basic rule: Class "Member" should just be extended for entities who have some kind of login. -If you have different types of Members in the system, you have to make sure that those with login-capabilities have +Basic rule: Class `[api:Member]` should just be extended for entities who have some kind of login. +If you have different types of `[api:Member]`s in the system, you have to make sure that those with login-capabilities have unique email-addresses (as this is used for login-credentials). -For persons without login-capabilities (e.g. for an address-database), you shouldn't extend member to avoid conflicts -with the Member-database. This enables us to have a different subclass of Member for an email-address with login-data, +For persons without login-capabilities (e.g. for an address-database), you shouldn't extend `[api:Member]` to avoid conflicts +with the Member-database. This enables us to have a different subclass of `[api:Member]` for an email-address with login-data, and another subclass for the same email-address in the address-database. ## Member Role Decorator @@ -95,7 +96,7 @@ class. A better way is to use role decorators to add this behaviour. // OR Member::add_role('ForumRole'); -A role decorator is simply a subclass of `[api:DataObjectDecorator]` that is designed to be used to add behaviour to Member. +A role decorator is simply a subclass of `[api:DataObjectDecorator]` that is designed to be used to add behaviour to `[api:Member]`. The roles affect the entire class - all members will get the additional behaviour. However, if you want to restrict things, you should add appropriate `[api:Permission::checkMember()]` calls to the role's methods. diff --git a/docs/en/reference/modeladmin.md b/docs/en/reference/modeladmin.md index ea02c28362e..977076c4b1e 100644 --- a/docs/en/reference/modeladmin.md +++ b/docs/en/reference/modeladmin.md @@ -104,7 +104,7 @@ fields are searched (e.g. "partial match", "fulltext", etc.) using `$searchable_ ## Summary Fields Summary Fields are the columns which are shown in the `[api:TableListField]` when viewing DataObjects. These can be -customized for each DataObject's search results using `$summary_fields`. +customized for each `[api:DataObject]`'s search results using `$summary_fields`. * See `[api:DataObject]` diff --git a/docs/en/reference/partial-caching.md b/docs/en/reference/partial-caching.md index 9fd736546fd..01f8ebf556b 100644 --- a/docs/en/reference/partial-caching.md +++ b/docs/en/reference/partial-caching.md @@ -55,7 +55,7 @@ From a block that shows a summary of the page edits if administrator, nothing if Often you want to invalidate a cache when any in a set of objects change, or when the objects in a relationship change. To help do this, SilverStripe 2.4 also introduces the concept of Aggregates. These calculate and return SQL aggregates -on sets of DataObjects - the most useful for us being the Max aggregate. +on sets of `[api:DataObject]`s - the most useful for us being the Max aggregate. For example, if we have a menu, we want that menu to update whenever _any_ page is edited, but would like to cache it otherwise. By using aggregates, that's easy @@ -236,6 +236,4 @@ Can be re-written as: <% end_control %> <% end_cached %> - <% end_cached %> - - + <% end_cached %> \ No newline at end of file diff --git a/docs/en/reference/permission.md b/docs/en/reference/permission.md index 04c44b9b35b..4b313e8bded 100644 --- a/docs/en/reference/permission.md +++ b/docs/en/reference/permission.md @@ -12,7 +12,7 @@ and then select the permissions tab, and add that permission to the list. The simple usage, Permission::check("PERM_CODE") will detect if the currently logged in member has the given permission. See the API docs for more options. -** Group ACLs ** +**Group ACLs** * Call **Permission::check("MY_PERMISSION_CODE")** to see if the current user has MY_PERMISSION_CODE. * MY_PERMISSION_CODE can be loaded into the Security admin on the appropriate group, using the "Permissions" tab. @@ -22,9 +22,9 @@ You can use whatever codes you like, but for the sanity of developers and users, ## PermissionProvider -PermissionProvider is an interface which lets you define a method *providePermissions()*. This method should return a +`[api:PermissionProvider]` is an interface which lets you define a method *providePermissions()*. This method should return a map of permission code names with a human readable explanation of its purpose (see -[:permission:codes](/reference/permission)). +[permissions:codes](/reference/permission)). :::php class Page_Controller implements PermissionProvider { diff --git a/docs/en/reference/requirements.md b/docs/en/reference/requirements.md index 5965e1f362b..b2c66b3d322 100644 --- a/docs/en/reference/requirements.md +++ b/docs/en/reference/requirements.md @@ -133,8 +133,7 @@ In your controller's init() function, add: ## CMS Requirements -The Silverstripe core includes a lot of Requirements by itself. Most of these are collated in `[api:LeftAndMain]`// -first. +The SilverStripe core includes a lot of Requirements by itself. Most of these are collated in `[api:LeftAndMain]` first. ## Motivation diff --git a/docs/en/reference/restfulservice.md b/docs/en/reference/restfulservice.md index df108acff71..b7621ca0f55 100644 --- a/docs/en/reference/restfulservice.md +++ b/docs/en/reference/restfulservice.md @@ -2,12 +2,13 @@ ## Introduction -RestfulService enables connecting to remote web services which supports REST interface and consume those web services -(for example Flickr, Youtube, Amazon and etc). RestfulService can parse the XML response (sorry no JSON support) +`[api:RestfulService]` enables connecting to remote web services which supports REST interface and consume those web services +(for example [Flickr](http://www.flickr.com/services/api/), [Youtube](http://code.google.com/apis/youtube/overview.html), Amazon and etc). `[api:RestfulService]` can parse the XML response (sorry no JSON support) returned from the web service. Further it supports caching of the response, and you can customize the cache interval. -To gain the functionality you can either create a new RestfulService object or create a class extending the -RestfulService (see `flickrservice` and `youtubeservice` modules). +To gain the functionality you can either create a new `[api:RestfulService]` object or create a class extending the +RestfulService (see [flickrservice](http://silverstripe.org/flickr-module/) and +[youtubeservice](http://silverstripe.org/youtube-gallery-module/) modules). ## Examples @@ -112,8 +113,8 @@ to get the value of entry node with the namespace media, use: ### Handling Errors -If the web service returned an error (for example, API key not available or inadequate parameters) RestfulService could -delgate the error handling to it's descendant class. To handle the errors define a function called errorCatch +If the web service returned an error (for example, API key not available or inadequate parameters) `[api:RestfulService]` +could delgate the error handling to it's descendant class. To handle the errors define a function called errorCatch :::php /* @@ -142,7 +143,7 @@ If you want to bypass error handling on your sub-classes you could define that i ## Other Uses -### How to use RestfulService to easily embed an RSS feed +### How to use `[api:RestfulService]` to easily embed an RSS feed `[api:RestfulService]` can be used to easily embed an RSS feed (since it's also an xml response) from a site such as del.icio.us diff --git a/docs/en/reference/rssfeed.md b/docs/en/reference/rssfeed.md index 4779055dc18..0be4ec7f3ac 100644 --- a/docs/en/reference/rssfeed.md +++ b/docs/en/reference/rssfeed.md @@ -5,7 +5,7 @@ Generating RSS/Atom-feeds is just a matter of rendering a `[api:DataObject]` and the Page Comment Interface. Handled through the `[api:RSSFeed]` class. -RSSFeed doesn't limit you to generating "article-based" feeds, it is just as easy to create a feed of your current +`[api:RSSFeed]` doesn't limit you to generating "article-based" feeds, it is just as easy to create a feed of your current staff-members. The only logical limitation here is that every item in the RSS-feed should be accessible through a URL on your website, so its advisable to just create feeds from subclasses of `[api:SiteTree]`. @@ -31,7 +31,7 @@ your website, so its advisable to just create feeds from subclasses of `[api:Sit ### Example of showing the 10 most recently updated pages -You can use RSSFeed to easily create a feed showing your latest Page updates. Just change mysite/code/Page.php to +You can use `[api:RSSFeed]` to easily create a feed showing your latest Page updates. Just change mysite/code/Page.php to something like this: :::php @@ -44,7 +44,7 @@ something like this: } class Page_Controller extends ContentController { - + function init() { RSSFeed::linkToFeed($this->Link() . "rss", "10 Most Recently Updated Pages"); parent::init(); @@ -72,7 +72,7 @@ can also do http://www.yoursite.com/PageComment/rss?pageid=46 where pageid is th ## External Sources -RSSFeed only creates feeds from your own data. We've included the [SimplePie](http://simplepie.org) RSS-parser for +`[api:RSSFeed]` only creates feeds from your own data. We've included the [SimplePie](http://simplepie.org) RSS-parser for accessing feeds from external sources. diff --git a/docs/en/reference/searchcontext.md b/docs/en/reference/searchcontext.md index 6f8a8700fd2..8f4f8813007 100644 --- a/docs/en/reference/searchcontext.md +++ b/docs/en/reference/searchcontext.md @@ -3,16 +3,16 @@ ## Introduction Manages searching of properties on one or more `[api:DataObject]` types, based on a given set of input parameters. -SearchContext is intentionally decoupled from any controller-logic, +`[api:SearchContext]` is intentionally decoupled from any controller-logic, it just receives a set of search parameters and an object class it acts on. -The default output of a SearchContext is either a `[api:SQLQuery]` object for further refinement, or a +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 the $fields constructor parameter. -SearchContext is mainly used by `[api:ModelAdmin]`, our generic data administration interface. Another +`[api:SearchContext]` is mainly used by `[api:ModelAdmin]`, our generic data administration interface. Another implementation can be found in generic frontend search forms through the [genericviews](http://silverstripe.org/generic-views-module) module. ## Requirements @@ -33,9 +33,10 @@ See `[api:DataObject::$searchable_fields]`. ### Customizing fields and filters -In this example we're defining three attributes on our MyDataObject subclasss: `PublicProperty`, `HiddenProperty` +In this example we're defining three attributes on our MyDataObject subclass: `PublicProperty`, `HiddenProperty` and `MyDate`. The attribute `HiddenProperty` should not be searchable, and `MyDate` should only search for dates -*after* the search entry (with a `GreaterThanFilter`). Similiar to the built-in `DataObject->getDefaultSearchContext()` method, we're building our own `getCustomSearchContext()` variant. +*after* the search entry (with a `GreaterThanFilter`). Similiar to the built-in `DataObject->getDefaultSearchContext()` +method, we're building our own `getCustomSearchContext()` variant. :::php class MyDataObject extends DataObject { @@ -86,11 +87,6 @@ and `MyDate`. The attribute `HiddenProperty` should not be searchable, and `MyDa } - - - - - ### Pagination For paginating records on multiple pages, you need to get the generated `SQLQuery` before firing off the actual @@ -184,7 +180,7 @@ Results.PaginationSummary(4) defines how many pages the search will show in the ## Available SearchFilters -See SearchFilter API Documentation `[api:SearchFilter]` +See `[api:SearchFilter]` API Documentation ## API Documentation `[api:SearchContext]` diff --git a/docs/en/reference/site-reports.md b/docs/en/reference/site-reports.md index 52b46650397..fd660b91961 100644 --- a/docs/en/reference/site-reports.md +++ b/docs/en/reference/site-reports.md @@ -6,23 +6,23 @@ the site reports by clicking "Site Reports" in the left hand side bar and select ![](_images/sitereport.png) -By default the CMS ships with a couple basic reports - +By default the CMS ships with a couple of basic reports - ## Default Reports * "Empty Pages" which will generate a list of pages without content * "Pages edited in the last 2 weeks" which will list all the pages edited in the last 2 weeks in order of most recently edited. -* "To Do" which displays all the ToDo notes you have added to each page and a link to the page. This is in 2.2.2 and +* "To Do" which displays all the ToDo notes you have added to each page and a link to the page. Note: This is in 2.2.2 and later * Also the Ecommerce module provides 2 or 3 reports out of box. Such as All Products, Orders... ## Creating Custom Reports -You can create reports for you own data quickly and easily. A general knowledge of Silverstripe's +You can create reports for you own data quickly and easily. A general knowledge of SilverStripe's [Datamodel](/topics/datamodel) would help before you attempt this. -Inside the Mysite/Code folder - your projects code, create a file called CustomSideReport or MyProjectSiteReport and +Inside the Mysite/Code folder - your projects code, create a file called `CustomSideReport` or `MyProjectSiteReport` and inside this file we can add our site reports. CustomSideReport.php @@ -91,6 +91,4 @@ file and add class's as you need them inside that for each report. * More examples. ## API Documentation -`[api:ReportAdmin]` - - +`[api:ReportAdmin]` \ No newline at end of file diff --git a/docs/en/reference/siteconfig.md b/docs/en/reference/siteconfig.md index e4187a2fea5..4b3ef50dbd7 100644 --- a/docs/en/reference/siteconfig.md +++ b/docs/en/reference/siteconfig.md @@ -2,12 +2,12 @@ ## Introduction -The SiteConfig panel was introduced in 2.4 for providing a generic interface for managing site wide settings or +The `[api:SiteConfig]` panel was introduced in 2.4 for providing a generic interface for managing site wide settings or functionality which is used throughout the site. Out of the box it provides 2 fields 'Site Name' and 'Site Tagline'. -## Accessing SiteConfig Options +## Accessing `[api:SiteConfig]` Options -You can access SiteConfig options from any SS template by using the function $SiteConfig.FieldName +You can access `[api:SiteConfig]` options from any SS template by using the function $SiteConfig.FieldName :::ss $SiteConfig.Title @@ -28,8 +28,7 @@ Or if you want to access variables in the PHP you can do $config->Title - -## Extending SiteConfig +## Extending `[api:SiteConfig]` To extend the options available in the panel you can define your own fields via an Extension. @@ -59,13 +58,13 @@ Then add a link to your extension in the _config.php file like below. Object::add_extension('SiteConfig', 'CustomSiteConfig'); -This tells SilverStripe to add the CustomSiteConfig extension to the SiteConfig class. +This tells SilverStripe to add the CustomSiteConfig extension to the `[api:SiteConfig]` class. After adding those two pieces of code, rebuild your database by visiting http://yoursite.com/dev/build and then reload the admin interface. You may need to reload it with a ?flush=1 on the end. -You can define as many extensions for SiteConfig as you need. For example if you are developing a module you can define +You can define as many extensions for `[api:SiteConfig]` as you need. For example if you are developing a module you can define your own global settings for the dashboard. ## API Documentation -`[api:SiteConfig]` +`[api:SiteConfig]` \ No newline at end of file diff --git a/docs/en/reference/sqlquery.md b/docs/en/reference/sqlquery.md index 0b8e517a7fb..5b562e9a78b 100644 --- a/docs/en/reference/sqlquery.md +++ b/docs/en/reference/sqlquery.md @@ -5,7 +5,7 @@ An object representing a SQL query. It is easier to deal with object-wrappers than string-parsing a raw SQL-query. This object is used by `[api:DataObject]`, though... -A word of caution: Dealing with low-level SQL is not encouraged in the Silverstripe [datamodel](/topics/datamodel) for various +A word of caution: Dealing with low-level SQL is not encouraged in the SilverStripe [datamodel](/topics/datamodel) for various reasons. You'll break the behaviour of: * Custom getters/setters @@ -15,7 +15,7 @@ reasons. You'll break the behaviour of: * `[api:DataObject]` * Database abstraction -We'll explain some ways to use *SELECT* with the full power of SQL, but still maintain a connection to the Silverstripe +We'll explain some ways to use *SELECT* with the full power of SQL, but still maintain a connection to the SilverStripe [datamodel](/topics/datamodel). ## Usage @@ -109,7 +109,7 @@ Useful for creating dropdowns. ### "Raw" SQL with DB::query() -This is not recommended for most cases, but you can also use the Silverstripe database-layer to fire off a raw query: +This is not recommended for most cases, but you can also use the SilverStripe database-layer to fire off a raw query: :::php DB::query("UPDATE Player SET Status='Active'"); @@ -142,10 +142,10 @@ This form of building a query has the following advantages: * Selection of *ID*, *ClassName*, *RecordClassName*, which are necessary to use *buildDataObjectSet* later on * Filtering records for correct *ClassName* -### Transforming a result to DataObjectSet +### Transforming a result to `[api:DataObjectSet]` -This is a commonly used technique inside Silverstripe: Use raw SQL, but transfer the resulting rows back into -DataObjects. +This is a commonly used technique inside SilverStripe: Use raw SQL, but transfer the resulting rows back into +`[api:DataObject]`s. :::php $sqlQuery = new SQLQuery(); @@ -183,16 +183,16 @@ DataObjects. var_dump($myFirstPlayer->Status); // undefined, as we didn't LEFT JOIN the BasePlayer-table -CAUTION: Depending on the selected columns in your query, you might get into one of the following scenarios: +**CAUTION:** Depending on the selected columns in your query, you might get into one of the following scenarios: * Not all object-properties accessible: You need to take care of selecting the right stuff yourself * Overlayed object-properties: If you *LEFT JOIN* a table which also has a column 'Birthdate' and do a global select on this table, you might not be able to access original object-properties. -* You can't create DataObjects where no scalar record-data is available, e.g. when using *GROUP BY* +* You can't create `[api:DataObject]`s where no scalar record-data is available, e.g. when using *GROUP BY* * Naming conflicts with custom getters: A getter like Player->getName() will overlay the column-data selected in the above example -Be careful when saving back DataObjects created through *buildDataObjectSet*, you might get strange side-effects due to +Be careful when saving back `[api:DataObject]`s created through *buildDataObjectSet*, you might get strange side-effects due to the issues noted above. ## Using FormFields with custom SQL diff --git a/docs/en/reference/staticpublisher.md b/docs/en/reference/staticpublisher.md index 0d9e616f7b0..ec61cb6b11a 100644 --- a/docs/en/reference/staticpublisher.md +++ b/docs/en/reference/staticpublisher.md @@ -83,17 +83,17 @@ you can also add an exclusion function allPagesToCache() { $urls = array(); $pages = DataObject::get("SiteTree"); - + // ignored page types $ignored = array('UserDefinedForm'); - + foreach($pages as $page) { // check to make sure this page is not in the classname if(!in_array($page->ClassName, $ignored)) { $urls = array_merge($urls, (array)$page->subPagesToCache()); } } - + return $urls; } @@ -127,7 +127,7 @@ example](http://open.silverstripe.com/browser/modules/cms/trunk/code/staticpubli .htaccess update simpler. Just look for this line: - + RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] diff --git a/docs/en/reference/tablefield.md b/docs/en/reference/tablefield.md index 80cb651a244..c71580984fb 100644 --- a/docs/en/reference/tablefield.md +++ b/docs/en/reference/tablefield.md @@ -2,9 +2,8 @@ ## Introduction -TableField behaves in the same manner as `[api:TableListField]`, however allows the editing of existing and adding of -new rows. -The data is saved back by the surrounding form-saving (mostly EditForm->save). +`[api:TableField]` behaves in the same manner as `[api:TableListField]`, however allows the editing of existing and adding of +new rows. The data is saved back by the surrounding form-saving (mostly EditForm->save). See `[api:TableListField]` for more documentation on the base-class @@ -66,15 +65,15 @@ Note: You still have to attach some form of `[api:Validator]` to the form to tri ### Nested Table Fields -When you have TableField inside a `[api:ComplexTableField]`, the parent ID may not be known in your -getCMSFields() method. In these cases, you can set a value to '$RecordID' in your TableField extra data, and this will -be populated with the newly created record id upon save. +When you have `[api:TableField]` inside a `[api:ComplexTableField]`, the parent ID may not be known in your +getCMSFields() method. In these cases, you can set a value to '$RecordID' in your `[api:TableField]` extra data, and this +will be populated with the newly created record id upon save. ## Known Issues -* A TableField doesn't reload any submitted form-data if the saving is interrupted by a failed validation. After -refreshing the form with the validation-errors, the TableField will be blank again. -* You can't add **visible default data** to columns in a TableField, please use *setExtraData* +* A `[api:TableField]` doesn't reload any submitted form-data if the saving is interrupted by a failed validation. After +refreshing the form with the validation-errors, the `[api:TableField]` will be blank again. +* You can't add **visible default data** to columns in a `[api:TableField]`, please use *setExtraData* ## API Documentation diff --git a/docs/en/reference/tablelistfield.md b/docs/en/reference/tablelistfield.md index 665c48ab674..62590174801 100644 --- a/docs/en/reference/tablelistfield.md +++ b/docs/en/reference/tablelistfield.md @@ -8,9 +8,9 @@ Provides customizeable columns, record-deletion by ajax, paging, sorting, CSV-ex ## Example -Here's an example of a full featured TableListField implementation. It features editing members in the database directly -as a button on each record, as well as filtering, and sorting. It also makes use of the 'export' permission, allowing -export of data as a CSV. +Here's an example of a full featured `[api:TableListField]` implementation. It features editing members in the database +directly as a button on each record, as well as filtering, and sorting. It also makes use of the 'export' permission, +allowing export of data as a CSV. :::php function getReportField() { @@ -90,7 +90,7 @@ For more information on each of the features used in the example, you can read b $customCsvQuery->select[] = "CONCAT(col1,col2) AS MyCustomSQLColumn"; $myTableListField->setCustomCsvQuery($customQuery); -TableListField also tries to resolve Component-relations(has_one, has_many) and custom getters automatically: +`[api:TableListField]` also tries to resolve Component-relations(has_one, has_many) and custom getters automatically: :::php $myTableListField = new TableListField( @@ -139,12 +139,12 @@ Example (sorting by "FirstName" column): ); -If you want to sort by custom getters in your DataObject, please reformulate them to a custom SQL column. This +If you want to sort by custom getters in your `[api:DataObject]`, please reformulate them to a custom SQL column. This restriction is needed to avoid performance-hits by caching and sorting potentially large datasets on PHP-level. ### Casting -Column-values can be casted, based on the casting-types available through DBObject (sapphire/core/model/fieldtypes). +Column-values can be casted, based on the casting-types available through DBObject (sapphire/core/model/fieldtypes). :::php $myTableListField->setFieldCasting(array( @@ -155,7 +155,7 @@ Column-values can be casted, based on the casting-types available through DBObje ### Permissions -Permissions vary in different TableListField-implementations, and are evaluated in the template. +Permissions vary in different `[api:TableListField]`-implementations, and are evaluated in the template. By default, all listed permissions are enabled. :::php @@ -237,7 +237,7 @@ implement averages etc. ) ); -In TableField-implementation, these summaries also react to changes in input-fields by javascript. +In `[api:TableListField]`-implementation, these summaries also react to changes in input-fields by javascript. Available methods: * sum @@ -245,7 +245,7 @@ Available methods: ### Grouping -Used to group by a specific column in the DataObject and create partial summaries. +Used to group by a specific column in the `[api:DataObject]` and create partial summaries. Please use only together with addSummary(). (Automatically disables sorting). @@ -257,7 +257,7 @@ Please use only together with addSummary(). ### Custom Sorting -Please subclass TableListField to implement custom sorting, following the naming-convention +Please subclass `[api:TableListField]` to implement custom sorting, following the naming-convention "`colFunction_`". :::php @@ -274,7 +274,7 @@ Please subclass TableListField to implement custom sorting, following the naming In case you want to perform utility-functions like "export" or "print" through action-buttons, make sure to subclass Utility() which collates all possible actions. -### Customizing Look&Feel +### Customizing Look & Feel You can exchange the used template, e.g. to change applied CSS-classes or the HTML-markup: @@ -285,4 +285,4 @@ You can exchange the used template, e.g. to change applied CSS-classes or the HT ## API Documentation -[api:TableListField] +`[api:TableListField]` diff --git a/docs/en/reference/typography.md b/docs/en/reference/typography.md index b9947090329..1a448557e64 100644 --- a/docs/en/reference/typography.md +++ b/docs/en/reference/typography.md @@ -4,8 +4,7 @@ SilverStripe lets you customise the style of content in the CMS. ## Usage -This is done by setting up a CSS file called -(projectname)/css/typography.css +This is done by setting up a CSS file called (projectname)/css/typography.css. You also need to create a file called (projectname)/css/editor.css with the following content: @@ -40,8 +39,8 @@ It's important to realise that this CSS file is included directly into the CMS s can alter the styling of other parts of the interface. While this is novel, it can be dangerous and is probably not what you're after. -The way around this is to limit all your styling selectors to elements inside something with class="typography". The -other half of this is to put class="typography" onto any area in your template where you would like the styling to be +The way around this is to limit all your styling selectors to elements inside something with `class="typography"`. The +other half of this is to put `class="typography"` onto any area in your template where you would like the styling to be applied. **WRONG** @@ -73,7 +72,7 @@ applied. If you would to include different styles for different sections of your site, you can use class names the same as the -name of the data fields. This example sets up different paragraph styles for 2 HTML editor fieldsc alled Content and +name of the data fields. This example sets up different paragraph styles for 2 HTML editor fields called Content and OtherContent: :::css @@ -89,7 +88,7 @@ OtherContent: ### Removing the typography class Sometimes, it's not enough to add a class, you also want to remove the typography class. You can use the -HTMLEditorField method setCSSClass. +`[api:HTMLEditorField]` method setCSSClass. This example sets another CSS class typographybis: @@ -104,5 +103,4 @@ This example sets another CSS class typographybis: } -This functionality will be available in the version 2.0.2 of the CMS. - +**Note:** This functionality will be available in the version 2.0.2 of the CMS. \ No newline at end of file diff --git a/docs/en/reference/urlvariabletools.md b/docs/en/reference/urlvariabletools.md index f7dd87f4fee..789b082f845 100644 --- a/docs/en/reference/urlvariabletools.md +++ b/docs/en/reference/urlvariabletools.md @@ -3,7 +3,7 @@ ## Introduction This page lists a number of "page options" , "rendering tools" or "special URL variables" that you can use to debug your -sapphire applications. These are consumed in PHP using the $_REQUEST or $_GET superglobals throughout the Sapphire +sapphire applications. These are consumed in PHP using the $_REQUEST or $_GET super globals throughout the Sapphire core. **General Usage** @@ -18,8 +18,8 @@ Append the option and corresponding value to your URL in your browser's address | URL Variable | | Values | | Description | | ------------ | | ------ | | ----------- | | flush | | 1,all | | This will clear out all cached information about the page. This is used frequently during development - for example, when adding new PHP or SS files. See below for value descriptions. | - | showtemplate | | 1 | | Show the compiled version of all the templates used, including line numbers. Good when you have a syntax error in a template. Cannot be used on a Live site without **isDev** **flush** can be used with the following values: | - | ?flush=1 | | | | | Flushes the current page and included templates | + | showtemplate | | 1 | | Show the compiled version of all the templates used, including line numbers. Good when you have a syntax error in a template. Cannot be used on a Live site without **isDev**. **flush** can be used with the following values: | + | ?flush=1 | | | | Flushes the current page and included templates | | ?flush=all | | | | Flushes the entire template cache | ## General Testing @@ -29,13 +29,13 @@ Append the option and corresponding value to your URL in your browser's address | isDev | | 1 | | Put the site into [development mode](/topics/debugging), enabling debugging messages to the browser on a live server. For security, you'll be asked to log in with an administrator log-in | | isTest | | 1 | | Put the site into [test mode](/topics/debugging), enabling debugging messages to the admin email and generic errors to the browser on a live server | | debug | | 1 | | Show a collection of debugging information about the director / controller operation | - | debug_request | | 1 | | Show all steps of the request from initial HTTPRequest to Controller to Template Rendering | + | debug_request | | 1 | | Show all steps of the request from initial `[api:HTTPRequest]` to `[api:Controller]` to Template Rendering | ## Classes and Objects | URL Variable | | Values | | Description | | ------------ | | ------ | | ----------- | - | debugmanifest | | 1 | | Show the entire Sapphire manifest as currently built (Use /dev/build to rebuild) | + | debugmanifest | | 1 | | Show the entire Sapphire manifest as currently built (Use `/dev/build` to rebuild) | | usetestmanifest | | 1 | | Force use of the default test manifest | | debugmethods | | 1 | | Shows all methods available when an object is constructed (useful when extending classes or using object decorators) | | debugfailover | | 1 | | Shows failover methods from classes extended | @@ -52,7 +52,7 @@ Append the option and corresponding value to your URL in your browser's address | URL Variable | | Values | | Description | | ------------ | | ------ | | ----------- | | debug_memory | | 1 | | Output the number of bytes of memory used for this request | - | debug_profile | | 1 | | Enable the [profiler](/topics/debugging) for the duration of the request | + | debug_profile | | 1 | | Enable the [profiler](/topics/debugging) for the duration of the request | | profile_trace | | 1 | | Includes full stack traces, must be used with **debug_profile** | | debug_behaviour | | 1 | | Get profiling of [Behaviour.js](http://bennolan.com/behaviour) performance (Firebug recommended) | | debug_javascript | | 1 | | Force debug-output on live-sites | @@ -79,9 +79,9 @@ Redirections](security#redirect_back_to_another_page_after_login) for more infor | Site URL | | Action | | -------- | | ------ | - | %%http://yoursite.com%%**/dev/build** | | Rebuild the entire database and manifest, see below for additional URL Variables | - | %%http://yoursite.com%%**/admin/publishall/** | | Publish all pages on the site | - | %%http://yoursite.com%%**/anypage/images/flush** | | Creates new images for the page by deleting the resized ones and going back to the original to create new resized one | + | http://yoursite.com**/dev/build** | | Rebuild the entire database and manifest, see below for additional URL Variables | + | http://yoursite.com**/admin/publishall/** | | Publish all pages on the site | + | http://yoursite.com**/anypage/images/flush** | | Creates new images for the page by deleting the resized ones and going back to the original to create new resized one | ### /dev/build diff --git a/docs/en/reference/versioned.md b/docs/en/reference/versioned.md index 4d684a0da06..5e269be21ab 100644 --- a/docs/en/reference/versioned.md +++ b/docs/en/reference/versioned.md @@ -28,6 +28,4 @@ whenever a blog entry has been published. mail("sam@silverstripe.com", "Blog published", "The blog has been published"); parent::onAfterPublish(); } - } - - + } \ No newline at end of file diff --git a/docs/en/topics/access-control.md b/docs/en/topics/access-control.md index e182220e903..db6c8396d1a 100644 --- a/docs/en/topics/access-control.md +++ b/docs/en/topics/access-control.md @@ -19,22 +19,26 @@ It is unclear how this works for data-objects that are not pages. In the security tab you can make groups for security. The way this was intended was as follows (this may be a counter intuitive): -- employees -1. marketing - - marketing executive + +* employees + * marketing + * marketing executive + Thus, the further up the hierarchy you go the MORE privileges you can get. Similarly, you could have: -- members -1. coordinators - - admins + +* members + * coordinators + * admins + Where members have some privileges, coordinators slightly more and administrators the most; having each group inheriting privileges from its parent group. ## Permission checking is at class level -SilverStripe provides a security mechanism via the *Permission::check* method (see *LeftAndMain.php* for examples on how +SilverStripe provides a security mechanism via the *Permission::check* method (see `[api:LeftAndMain]` for examples on how the admin screens work) -(next step -- go from *Permission::checkMember*... +(next step -- go from *Permission::checkMember*...) ### Nuts and bolts -- figuring it out @@ -44,14 +48,14 @@ works. ### Loading the admin page: looking at security -If you go to [your site]/admin -- how does that work? -*Director.php* maps the 'admin' URL request through a *Director* rule to the CMSMain controller (see `[api:CMSMain]`, with no arguments. +If you go to [your site]/admin *Director.php* maps the 'admin' URL request through a `[api:Director]` rule to the +`[api:CMSMain]` controller (see `[api:CMSMain]`, with no arguments). -*CMSMain.init()* calls its parent which, of all things is called *LeftAndMain*. It's in *LeftAndMain* that the +*CMSMain.init()* calls its parent which, of all things is called `[api:LeftAndMain]`. It's in `[api:LeftAndMain]` that the important security checks are made by calling *Permission::check*. `[api:Security::permissionFailure]` is the next utility function you can use to redirect to the login form. ### Customizing Access Checks in CMS Classes -see `[api:LeftAndMain]` +see `[api:LeftAndMain]` \ No newline at end of file diff --git a/docs/en/topics/configuration.md b/docs/en/topics/configuration.md index a4d7886aa46..8ed469ea77c 100644 --- a/docs/en/topics/configuration.md +++ b/docs/en/topics/configuration.md @@ -1,9 +1,9 @@ -# Common Configuration through _config.php +# Common configuration through _config.php ## Introduction -Silverstripe doesn't have a global configuration-array or an interface with all available configuration-options. As all -Silverstripe logic is contained in classes, the appropriate place to configure their behaviour is directly in the class +SilverStripe doesn't have a global configuration-array or an interface with all available configuration-options. As all +SilverStripe logic is contained in classes, the appropriate place to configure their behaviour is directly in the class itself. This lack of a configuration-GUI is on purpose, as we'd like to keep developer-level options where they belong (into @@ -12,7 +12,7 @@ CMS"](http://www.silverstripe.com/core-team-discussion/flat/2723) for further re In addition to these principle, some settings are * Author-level configuration like interface language or date/time formats can be performed in the CMS "My Profile" section (`admin/myprofile`). - * Group-related configuration like [api:HTMLEditorField] settings can be found in the "Security" section (`admin/security`). + * Group-related configuration like `[api:HTMLEditorField]` settings can be found in the "Security" section (`admin/security`). * Site-wide settings like page titles can be set (and extended) on the root tree element in the CMS "Content" section (through the [siteconfig](/reference/siteconfig) API). ## _ss_environment.php @@ -24,8 +24,9 @@ See [environment-management](/topics/environment-management). This file is detected in each folder by `[api:ManifestBuilder]`. This way, every toplevel-folder (=module) can have independent configuration-rules. -//Please note that this is the only place where you can put in procedural code - all other functionality is wrapped in -classes (see [common-problems](/installation/common-problems)).// + +Please note that this is the only place where you can put in procedural code - all other functionality is wrapped in +classes (see [common-problems](/installation/common-problems)). You can call most static methods from _config.php - classes will be loaded as required. Here's a list - **this is incomplete - please add to it** *Try to keep it in alphabetical order too! :)* diff --git a/docs/en/topics/controller.md b/docs/en/topics/controller.md index 95326f58cbf..52c9e5d70f1 100644 --- a/docs/en/topics/controller.md +++ b/docs/en/topics/controller.md @@ -6,7 +6,7 @@ your SilverStripe site. ## Example -mysite/code/Controllers/FastFood.php +`mysite/code/Controllers/FastFood.php` :::php -mysite/_config.php +`mysite/_config.php` :::php Director::addRules(50, array('fastfood/$Action/$ID/$Name' => 'FastFood_Controller')); -Request for '/fastfood/order/24/cheesefries' would result in the following to the $arguments above. If needed, use -"?flush=1" on the end of request after making any code changes to your controller. +Request for `/fastfood/order/24/cheesefries` would result in the following to the $arguments above. If needed, use +`?flush=1` on the end of request after making any code changes to your controller. :::ss Array @@ -42,12 +42,12 @@ Request for '/fastfood/order/24/cheesefries' would result in the following to th In the above example the URLs were configured using the `[api:Director]` rules in the **_config.php** file. Alternatively you can specify these in your Controller class via the **$url_handlers** static array (which gets -processed by the RequestHandler). +processed by the `[api:RequestHandler]`). -This is useful when you want to subvert the fixed action mapping of 'fastfood/order/*' to the function **order**. In -the case below we also want any orders coming through '/fastfood/drivethrough/' to use the same order function. +This is useful when you want to subvert the fixed action mapping of `fastfood/order/*` to the function **order**. In +the case below we also want any orders coming through `/fastfood/drivethrough/` to use the same order function. -mysite/code/Controllers/FastFood.php +`mysite/code/Controllers/FastFood.php` :::php class FastFood_Controller extends Controller { @@ -59,15 +59,15 @@ mysite/code/Controllers/FastFood.php ## URL Patterns -The RequestHandler class will parse all rules you specify against the following patterns. +The `[api:RequestHandler]` class will parse all rules you specify against the following patterns. **A rule must always start with alphabetical ([A-Za-z]) characters or a $Variable declaration** - | Pattern | | Description | - | ----------- | | --------------- | - | `$` | | **Param Variable** - Starts the name of a paramater variable, it is optional to match this unless ! is used | - | `!` | | **Require Variable** - Placing this after a parameter variable requires data to be present for the rule to match | - | `//` | | **Shift Point** - Declares that only variables denoted with a $ are parsed into the $params AFTER this point in the regex | + | Pattern | Description | + | ----------- | --------------- | + | `$` | **Param Variable** - Starts the name of a paramater variable, it is optional to match this unless ! is used | + | `!` | **Require Variable** - Placing this after a parameter variable requires data to be present for the rule to match | + | `//` | **Shift Point** - Declares that only variables denoted with a $ are parsed into the $params AFTER this point in the regex | ## Examples diff --git a/docs/en/topics/css.md b/docs/en/topics/css.md index 1a09542e8a6..f9d9d878ac6 100644 --- a/docs/en/topics/css.md +++ b/docs/en/topics/css.md @@ -30,8 +30,9 @@ Or in your template (e.g. `themes/yourtheme/templates/Page.ss`): :::ss <% require css(mymodule/css/my.css) %> -Management through the `Requirements` class has the advantage that modules can include their own CSS files without modifying your template. -On the other hand, you as a template developer can "block" or change certain CSS files that are included from thirdparty code. +Management through the `Requirements` class has the advantage that modules can include their own CSS files without modifying +your template. On the other hand, you as a template developer can "block" or change certain CSS files that are included from +thirdparty code. ## WYSIWYG editor: typography.css and editor.css diff --git a/docs/en/topics/data-types.md b/docs/en/topics/data-types.md index 68049170b45..a999e2a88e7 100644 --- a/docs/en/topics/data-types.md +++ b/docs/en/topics/data-types.md @@ -22,9 +22,9 @@ for introducing their usage. ## HTMLText vs. Text, and HTMLVarchar vs. Varchar -The database field types HTMLVarchar and Varchar are exactly the same in the database. However, the templating engine -knows to escape the Varchar field and not the HTMLVarchar field. So, it's important you use the right field if you -don't want to be putting $FieldType.XML everywhere. +The database field types `[api:HTMLVarchar]` and `[api:Varchar]` are exactly the same in the database. However, the +templating engine knows to escape the `[api:Varchar]` field and not the `[api:HTMLVarchar]` field. So, it's important you +use the right field if you don't want to be putting $FieldType.XML everywhere. If you're going to put HTML content into the field, please use the field type with the HTML prefix. Otherwise, you're going to risk double-escaping your data, forgetting to escape your data, and generally creating a confusing situation. diff --git a/docs/en/topics/datamodel.md b/docs/en/topics/datamodel.md index 36c1091f862..4091c3f3b4b 100644 --- a/docs/en/topics/datamodel.md +++ b/docs/en/topics/datamodel.md @@ -20,9 +20,11 @@ See [database-structure](/reference/database-structure) for in-depth information ## Generating the database-schema The SilverStripe database-schema is generated automatically by visiting the URL. -`http://``/dev/build` +`http:///dev/build` -> Note: You need to be logged in as an administrator to perform this command. +
+Note: You need to be logged in as an administrator to perform this command. +
## Querying Data @@ -46,8 +48,8 @@ Passing a *$join* statement to DataObject::get will filter results further by th table. **It will NOT return the additionally joined data.** The returned *$records* will always be a `[api:DataObject]`. -When using *$join* statements be sure the string is in the proper format for the respective database engine. In MySQL -the use of backticks may be necessary when referring Table Names and potentially Columns. (see [MySQL +When using *$join* statements be sure the string is in the proper format for the respective database engine. In MySQL +the use of back-ticks may be necessary when referring Table Names and potentially Columns. (see [MySQL Identifiers](http://dev.mysql.com/doc/refman/5.0/en/identifiers.html)): :::php @@ -60,7 +62,6 @@ Identifiers](http://dev.mysql.com/doc/refman/5.0/en/identifiers.html)): "0, 10"); - ## Properties @@ -121,11 +122,15 @@ Here we combined a Player's first name and surname, accessible through $myPlayer } } -**CAUTION: It is common practice to make sure that pairs of custom getters/setter deal with the same data, in a consistent -format.** +
+**CAUTION:** It is common practice to make sure that pairs of custom getters/setter deal with the same data, in a consistent +format. +
-**CAUTION: Custom setters can be hard to debug: Please double check if you could transform your data in more -straight-forward logic embedded to your custom controller or form-saving.** +
+**CAUTION:** Custom setters can be hard to debug: Please double check if you could transform your data in more +straight-forward logic embedded to your custom controller or form-saving. +
### Default Values @@ -139,15 +144,17 @@ new object is created. ); } -> Note: Alternatively you can set defaults directly in the database-schema (rather than the object-model). See +
+Note: Alternatively you can set defaults directly in the database-schema (rather than the object-model). See [data-types](data-types) for details. +
### Casting Properties defined in *static $db* are automatically casted to their [data-types](data-types) when used in templates. You can also cast the return-values of your custom functions (e.g. your "virtual properties"). Calling those functions directly will still return whatever type your php-code generates, -but using the *obj()*-method or accessing through a template will cast the value accordig to the $casting-definition. +but using the *obj()*-method or accessing through a template will cast the value according to the $casting-definition. :::php class Player extends DataObject { @@ -164,15 +171,9 @@ but using the *obj()*-method or accessing through a template will cast the value } - - - - - ## Relations -Relations are built through static array definitions on a class, in the format:\\ -`` => ``{php} +Relations are built through static array definitions on a class, in the format ` => ` ### has_one @@ -202,8 +203,10 @@ parent element in the tree: Defines 1-to-many joins. A database-column named ""``ID"" will to be created in the child-class. -**CAUTION: Please specify a $has_one-relationship on the related child-class as well, in order to have the necessary -accessors available on both ends.** +
+**CAUTION:** Please specify a $has_one-relationship on the related child-class as well, in order to have the necessary +accessors available on both ends. +
:::php // access with $myTeam->Players() or $player->Team() @@ -219,7 +222,7 @@ accessors available on both ends.** } -To specify multiple has_manys to the same object you can use dot notation to distinguish them like below +To specify multiple $has_manys to the same object you can use dot notation to distinguish them like below :::php class Person { @@ -241,7 +244,6 @@ Multiple $has_one relationships are okay if they aren't linking to the same obje :::php /** - * THIS IS BAD */ class Team extends DataObject { @@ -261,8 +263,10 @@ Multiple $has_one relationships are okay if they aren't linking to the same obje Defines many-to-many joins. A new table, (this-class)_(relationship-name), will be created with a pair of ID fields. -**CAUTION: Please specify a $belongs_many_many-relationship on the related class as well, in order to have the necessary -accessors available on both ends.** +
+**CAUTION:** Please specify a $belongs_many_many-relationship on the related class as well, in order to have the necessary +accessors available on both ends. +
:::php // access with $myTeam->Categories() or $myCategory->Teams() @@ -372,10 +376,6 @@ casting data before saving. ); - - - - ### onBeforeWrite You can customize saving-behaviour for each DataObject, e.g. for adding security. These functions are private, obviously @@ -411,8 +411,10 @@ Example: Disallow creation of new players if the currently logged-in player is n } -> Note: There are no separate methods for *onBeforeCreate* and *onBeforeUpdate*. Please check for the existence of +
+Note: There are no separate methods for *onBeforeCreate* and *onBeforeUpdate*. Please check for the existence of $this->ID to toggle these two modes, as shown in the example above. +
### onBeforeDelete @@ -453,17 +455,13 @@ See `[api:SQLQuery]` for custom *INSERT*, *UPDATE*, *DELETE* queries. ## Decorating DataObjects -You can add properties and methods to existing DataObjects like `[api:Member]` (a core class) without hacking core +You can add properties and methods to existing `[api:DataObjects]`s like `[api:Member]` (a core class) without hacking core code or subclassing. Please see `[api:DataObjectDecorator]` for a general description, and `[api:Hierarchy]` for our most popular examples. - - - - ## FAQ ### Whats the difference between DataObject::get() and a relation-getter? @@ -471,7 +469,7 @@ You can work with both in pretty much the same way, but relationship-getters ret A `[api:ComponentSet]` with relation-specific functionality. :::php - $myTeam = DataObject::get_by_id('Team',$myPlayer->TeamID); // returns DataObjectSet + $myTeam = DataObject::get_by_id('Team',$myPlayer->TeamID); // returns DataObject $myTeam->add(new Player()); // fails $myTeam = $myPlayer->Team(); // returns Componentset diff --git a/docs/en/topics/debugging.md b/docs/en/topics/debugging.md index cc2621c3e97..16df09ac5a5 100644 --- a/docs/en/topics/debugging.md +++ b/docs/en/topics/debugging.md @@ -32,17 +32,17 @@ use devmode on a public server very very carefully Test mode is designed for staging environments or other private collaboration sites before deploying a site live. You do not need to use test mode if you do not have a staging environment or a place for testing which is on a public server) -In this mode error messages are hidden from the user and it includes BasicAuth integration if you want to password +In this mode error messages are hidden from the user and it includes `[api:BasicAuth]` integration if you want to password protect the site. -To set your site to test mode set this in your mysite/_config.php file +To set your site to test mode set this in your `mysite/_config.php` file :::php Director::set_environment_type("test"); A common situation is to enable password protected site viewing on your test site only. You can enable that but adding -this to your mysite/_config file +this to your `mysite/_config` file :::php if(Director::isTest()) BasicAuth::protect_entire_site(); @@ -54,7 +54,7 @@ Live sites should always run in live mode. Error messages are suppressed from th to email the developers. This enables near real time reporting of any fatal errors or warnings on the site and can help find any bugs users run into. -To set your site to live mode set this in your mysite/_config.php file +To set your site to live mode set this in your `mysite/_config.php` file :::php Director::set_environment_type("live"); diff --git a/docs/en/topics/directory-structure.md b/docs/en/topics/directory-structure.md index 11ef3429cf4..b4fe0ff5ebe 100644 --- a/docs/en/topics/directory-structure.md +++ b/docs/en/topics/directory-structure.md @@ -2,7 +2,7 @@ ## Introduction -The directory-structure in Silverstripe it built on "convention over configuration", so the placement of some files and +The directory-structure in SilverStripe it built on "convention over configuration", so the placement of some files and directories is meaningful to its logic. ## Core Structure @@ -16,7 +16,7 @@ Directory | Description ## Custom Code Structure We're using `` as an example - arbitrary directory-names are allowed, as long as they don't collide with -existing modules or the directories listes in "Core Structure". +existing modules or the directories lists in "Core Structure". | Directory | Description | | --------- | ----------- | @@ -30,7 +30,7 @@ existing modules or the directories listes in "Core Structure". ## Themes Structure | `themes/blackcandy/` | Standard "blackcandy" theme | - | ------------------ | --------------------------- | + | ------------------ | --------------------------- | | `themes/blackcandy_blog/` | Theme additions for the blog module | | `themes/yourtheme/` | The themes folder can contain more than one theme - here's your own | diff --git a/docs/en/topics/email.md b/docs/en/topics/email.md index 4d94171f97e..c4ffd699c2a 100644 --- a/docs/en/topics/email.md +++ b/docs/en/topics/email.md @@ -15,7 +15,7 @@ an external SMTP server (see [PHP documentation for mail()](http://php.net/mail) By default, emails are sent in both HTML and Plaintext format. A plaintext representation is automatically generated from the system -by stripping HTML markup, or transformining it where possible +by stripping HTML markup, or transforming it where possible (e.g. `text` is converted to `*text*`). :::php @@ -35,7 +35,7 @@ The default HTML template is located in `sapphire/templates/email/GenericEmail.s **Requirements: SilverStripe 2.3+** -* Create a SS-template file called, in this example we will use 'MyEmail.ss' inside mysite/templates/email. +* Create a SS-template file called, in this example we will use 'MyEmail.ss' inside `mysite/templates/email`. * Fill this out with the body text for your email. You can use any [SS-template syntax](/topics/templates) (e.g. `<% control %>`, `<% if %>`, $FirstName etc) * Choose your template with **setTemplate()** @@ -86,14 +86,14 @@ Usage: ### Administrator Emails -The static function `Email::setAdminEmail()` can be called from a _config.php file to set the address that these +The static function `Email::setAdminEmail()` can be called from a `_config.php` file to set the address that these emails should originate from. This address is used if the `from` field is empty. ### Redirecting Emails -* Email::send_all_emails_to($address) will redirect all emails sent to the given address. Handy for testing! -* Email::cc_all_emails_to() and Email::bcc_all_emails_to() will keep the email going to its original recipients, but -add an additional receipient in the BCC/CC header. Good for monitoring system-generated correspondence on the live +* `Email::send_all_emails_to($address)` will redirect all emails sent to the given address. Handy for testing! +* `Email::cc_all_emails_to()` and `Email::bcc_all_emails_to()` will keep the email going to its original recipients, but +add an additional recipient in the BCC/CC header. Good for monitoring system-generated correspondence on the live systems. :::php @@ -112,7 +112,7 @@ $value)** .. -See http://en.wikipedia.org/wiki/E-mail#Message_header for a list of header names. +See [Wikipedia E-mail Message header](http://en.wikipedia.org/wiki/E-mail#Message_header) for a list of header names. ### Newsletters @@ -120,4 +120,4 @@ The [newsletter module](http://silverstripe.org/newsletter-module) provides a UI ## API Documentation -`[api:Email]` +`[api:Email]` \ No newline at end of file diff --git a/docs/en/topics/environment-management.md b/docs/en/topics/environment-management.md index f2798950785..bb1c8a7bd45 100644 --- a/docs/en/topics/environment-management.md +++ b/docs/en/topics/environment-management.md @@ -8,17 +8,17 @@ them. Why should we have to go through the installation process and re-enter th when we deploy them to our servers. Additionally, our production host's database connection details will likely be different than our local server. -SilverStripe comes with a solution to this: the "_ss_environment.php" file. You can put a single _ss_environment.php +SilverStripe comes with a solution to this: the `_ss_environment.php` file. You can put a single `_ss_environment.php` file in your "projects" folder on your development box, and it will be used by each of your development sites. ## Setting up your development machine with _ss_environment.php -In this example, we assume that you are managing multiple projects as subfolders of "~/Sites/", and that you can visit -these at "http://localhost/". For example, you might have a project at "~/Sites/myproject/", and visit it at -"http://localhost/myproject/". +In this example, we assume that you are managing multiple projects as subfolders of `~/Sites/`, and that you can visit +these at `http://localhost/`. For example, you might have a project at `~/Sites/myproject/`, and visit it at +`http://localhost/myproject/`. -Create a new file, ~/Sites/_ss_environment.php. Put the following content in it, editing the values of the -"SS_DATABASE_..."" and "SS_DEFAULT_ADMIN_..." defines as appropriate. +Create a new file, `~/Sites/_ss_environment.php`. Put the following content in it, editing the values of the +"SS_DATABASE_..." and "SS_DEFAULT_ADMIN_..." defines as appropriate. :::php /_config.php: +`/_config.php`: :::php // log errors and warnings @@ -66,7 +66,7 @@ added. #### Deprecated method (SS 2.3 ?) -/_config.php: +`/_config.php`: :::php Debug::log_errors_to("/my/logfile/path"); @@ -77,7 +77,7 @@ added. In addition to SilverStripe-integrated logging, it is adviseable to fall back to PHPs native logging functionality. A script might terminate before it reaches the SilverStripe errorhandling, for example in the case of a fatal error. -/_config.php: +`/_config.php`: :::php ini_set("log_errors", "On"); @@ -88,7 +88,8 @@ script might terminate before it reaches the SilverStripe errorhandling, for exa ## Email Logs You can send both fatal errors and warnings in your code to a specified email-address. -/_config.php: + +`/_config.php`: :::php // log errors and warnings diff --git a/docs/en/topics/extending-the-cms.md b/docs/en/topics/extending-the-cms.md index 48a6f1b3410..a2007092f25 100644 --- a/docs/en/topics/extending-the-cms.md +++ b/docs/en/topics/extending-the-cms.md @@ -5,14 +5,13 @@ CMSMain is part of the CMS. It is the controller for the content editor. ## Creating another hierarchical editor by subclassing CMSMain Sometimes you'll want to provide an administration interface that is pretty much exactly what CMSMain provides, but it's -not appropriate to include your data in with the site content. For example, Hayden developed a hierarchical category -administrator on the Guano application. +not appropriate to include your data in with the site content. -Here's how you can do this: +Here's how you can do this: ## Using classes other than SiteTree in the site tree -It is possible to use to different classes in two separate site trees. In Guano for example, there is the usual site +It is possible to use to different classes in two separate site trees. For example, there is the usual site content tree and a category tree. To change that find: :::php @@ -50,12 +49,12 @@ where url is the relative link to the page (eg 'admin/categories'). You can chan ## Overloading EditForm -You may need to overload EditForm if your class does not use the Versioned extension. +You may need to overload EditForm if your class does not use the `[api:Versioned]` extension. ## Overloading SiteTreeAsUL The tree hints can sometimes cause problems when reorganising the tree, and the CMSMain::SiteTreeAsUL function uses -SiteTree explicitly. Use: +`[api:SiteTree]` explicitly. Use: :::php public function SiteTreeAsUL() { @@ -64,4 +63,3 @@ SiteTree explicitly. Use: return $this->getSiteTreeFor( $this->stat('tree_class') ); } - diff --git a/docs/en/topics/form-validation.md b/docs/en/topics/form-validation.md index 48c7da592ca..a93fc563204 100644 --- a/docs/en/topics/form-validation.md +++ b/docs/en/topics/form-validation.md @@ -6,8 +6,8 @@ Form validation is a combination of PHP and JavaScript ### Introduction -Validators are implemented as an argument to the [api:Form] constructor. You create a required fields validator like -so. In this case, we're creating a [api:RequiredFields] validator - the [api:Validator] class itself is an abstract +Validators are implemented as an argument to the `[api:Form]` constructor. You create a required fields validator like +so. In this case, we're creating a `[api:RequiredFields]` validator - the `[api:Validator]` class itself is an abstract class. diff --git a/docs/en/topics/forms.md b/docs/en/topics/forms.md index 673314eba95..40bdcc577c8 100644 --- a/docs/en/topics/forms.md +++ b/docs/en/topics/forms.md @@ -33,7 +33,7 @@ Example: ## Subclassing a form -It's the reponsibility of your subclass' constructor to call +It's the responsibility of your subclass' constructor to call :::php parent::__construct() @@ -56,6 +56,8 @@ $name must be passed - their values depend on where the form is instantiated. The real difference, however, is that you can then define your controller methods within the form class itself. + + ## Form Field Types There are many classes extending `[api:FormField]`. Some examples: @@ -71,6 +73,7 @@ There are many classes extending `[api:FormField]`. Some examples: 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 @@ -192,8 +195,8 @@ First of all, you need to create your form on it's own class, that way you can d } - `forTemplate()` tells the Form class to render with a template of return value of `$this->class`, which in this case -is *MyForm*, the name of the class. If the template doesn't exist, then it falls back to using Form.ss +`forTemplate()` tells the `[api:Form]` class to render with a template of return value of `$this->class`, which in this case +is *MyForm*, the name of the class. If the template doesn't exist, then it falls back to using Form.ss. *MyForm.ss* should then be placed into your *templates/Includes* directory for your project. Here is an example of basic customisation: @@ -232,7 +235,7 @@ this case `TextField->Field()` or `EmailField->Field()` which returns an `` instead of specifying each field manually, as we've done above. diff --git a/docs/en/topics/i18n.md b/docs/en/topics/i18n.md index 73b729f2cd0..dc4f0a1b945 100644 --- a/docs/en/topics/i18n.md +++ b/docs/en/topics/i18n.md @@ -2,7 +2,7 @@ ## Introduction -The i18n class (short for "internationalization") in Silverstripe enables you to display templates and PHP code in +The i18n class (short for "internationalization") in SilverStripe enables you to display templates and PHP code in different languages based on your global settings and the preferences of your website users. This process is also known as l10n (short for "localization"). @@ -28,8 +28,8 @@ The i18n class is enabled by default. ### Setting the locale -To set the locale you just need to call `[api:i18n::set_locale()]` passing, as a parameter, the name of the locale that you want to -set. +To set the locale you just need to call `[api:i18n::set_locale()]` passing, as a parameter, the name of the locale that you +want to set. :::php //Example 1: setting the locale @@ -53,7 +53,7 @@ To let browsers know which language they're displaying a document in, you can de :::html //'Page.ss' (HTML) - + //'Page.ss' (XHTML) @@ -197,9 +197,10 @@ Sprintf enables us to dynamically replace parts of a translated string, e.g. by $title ) - +
**Caution**: In templates (*.ss)-files you can only use ONE argument for your sprintf-support, and can't use spaces between parameters. +
:::php // in SS-template ($title must be available in the current template-scope) @@ -219,7 +220,9 @@ If you want to run the text collector for just one module you can use the 'modul `http:///dev/tasks/i18nTextCollectorTask/?module=cms` +
**Note**: You'll need to install PHPUnit to run the text collector (see [testing-guide](/topics/testing)). +
## Language tables in PHP @@ -317,8 +320,9 @@ Example Translation Table (mymodule/javascript/lang/de_DE.js) * No detecting/conversion of character encodings (we rely fully on UTF-8) * Translation of graphics/assets * Usage of gettext (too clumsy, too many requirements) -* Displaying multipe languages/encodings on the same page +* Displaying multiple languages/encodings on the same page ## Links * [http://www.i18nguy.com/](http://www.i18nguy.com/) + * [balbus.tk i18n notes](http://www.balbus.tk/internationalize) diff --git a/docs/en/topics/index.md b/docs/en/topics/index.md index fafe155eb24..2383deacace 100644 --- a/docs/en/topics/index.md +++ b/docs/en/topics/index.md @@ -10,7 +10,7 @@ It is where most documentation should live, and is the natural "second step" aft * [Data Types](data-types): Types that properties on `DataObject` can have (e.g. `Text` or `Date`) * [Datamodel](datamodel): How we use an "Object-relational model" to expose database information in a useful way * [Debugging](debugging): Tracking down errors via logs, URL parameters and profiling - * [Directory Structure](directory-structure): Whats core files, where do modules and my own project files go? + * [Directory Structure](directory-structure): What are core files, where do modules and my own project files go? * [Emails](email): Configuring and sending emails * [Environment management](environment-management): Sharing configuration details (e.g. database login, passwords) with multiple websites via a `_ss_environment.php` file * [Error Handling](error-handling): Error messages and filesystem logs @@ -20,7 +20,7 @@ It is where most documentation should live, and is the natural "second step" aft * [Forms](forms): Create your own form, add fields and create your own form template using the existing `Form` class * [Internationalization (i18n)](i18n): Displaying templates and PHP code in different languages using i18n * [Javascript](javascript): Best practices for developing with JavaScript in SilverStripe - * [Module Development](module-development): Creating a module (also known as "extension" or "plugin") to contain reuseable functionality + * [Module Development](module-development): Creating a module (also known as "extension" or "plugin") to contain reusable functionality * [Modules](modules): Introduction, how to download and install a module (e.g. with blog or forum functionality) * [Page Types](page-types): What is a "page type" and how do you create one? * [Search](search): Searching for properties in the database as well as other documents @@ -29,7 +29,7 @@ It is where most documentation should live, and is the natural "second step" aft * [Testing](testing): Functional and Unit Testing with PHPUnit and SilverStripe's testing framework * [Developing Themes](theme-development): Package templates, images and CSS to a reusable theme * [Translation](translation): Creating content in multiple languages - * [Widgets](widgets): Small feature blocks which can be placed on a page by the CMS editor + * [Widgets](widgets): Small feature blocks which can be placed on a page by the CMS editor, also outlines how to create and add widgets ## Feedback diff --git a/docs/en/topics/javascript.md b/docs/en/topics/javascript.md index 48be6b423f4..4750e4a8153 100644 --- a/docs/en/topics/javascript.md +++ b/docs/en/topics/javascript.md @@ -9,9 +9,9 @@ practices can be applied to other libraries as well. ## File Inclusion -SilverStripe-driven code should use the `Requirements` class to manage clientside dependencies like CSS and JavaScript +SilverStripe-driven code should use the `[api:Requirements]` class to manage clientside dependencies like CSS and JavaScript files, rather than including `