From b5101945427aa87a0959da31438679aca9f30320 Mon Sep 17 00:00:00 2001 From: Web-VPF Date: Wed, 5 Jan 2022 00:52:10 +0200 Subject: [PATCH] Improving usability --- backend-controllers-ajax.md | 6 ++ backend-forms.md | 126 ++++++++++++++++++++++++++++++++++++ backend-import-export.md | 24 +++++++ backend-lists.md | 30 +++++++++ backend-relations.md | 24 +++++++ backend-reorder.md | 6 ++ backend-views-partials.md | 6 ++ cms-mediamanager.md | 18 ++++++ cms-pages.md | 6 ++ database-model.md | 12 ++++ database-relations.md | 12 ++++ markup-function-form.md | 12 ++++ markup-tag-for.md | 6 ++ plugin-registration.md | 12 ++++ services-image-resizing.md | 6 ++ services-mail.md | 1 + 16 files changed, 307 insertions(+) diff --git a/backend-controllers-ajax.md b/backend-controllers-ajax.md index c5f94336..a0e29700 100644 --- a/backend-controllers-ajax.md +++ b/backend-controllers-ajax.md @@ -55,6 +55,12 @@ Usually each controller implements functionality for working with a single type The backend controller base class defines a number of properties that allow to configure the page appearance and manage the page security: + +
+ Property | Description ------------- | ------------- `$fatalError` | allows to store a fatal exception generated in an action method in order to display it in the view. diff --git a/backend-forms.md b/backend-forms.md index 00deed98..167f37cf 100644 --- a/backend-forms.md +++ b/backend-forms.md @@ -74,6 +74,12 @@ preview: The following fields are required in the form configuration file: + +
+ Field | Description ------------- | ------------- `name` | the name of the object being managed by this form. @@ -82,6 +88,12 @@ Field | Description The configuration options listed below are optional. Define them if you want the form behavior to support the [Create](#form-create-page), [Update](#form-update-page) or [Preview](#form-preview-page) pages. + +
+ Option | Description ------------- | ------------- `defaultRedirect` | used as a fallback redirection page when no specific redirect page is defined. @@ -104,6 +116,12 @@ create: The following configuration options are supported for the Create page: + +
+ Option | Description ------------- | ------------- `title` | a page title, can refer to a [localization string](../plugin/localization). @@ -127,6 +145,12 @@ update: The following configuration options are supported for the Update page: + +
+ Option | Description ------------- | ------------- `title` | a page title, can refer to a [localization string](../plugin/localization). @@ -218,6 +242,12 @@ Fields from related models can be rendered with the [Relation Widget](#widget-re For each tab definition, namely `tabs` and `secondaryTabs`, you can specify these options: + +
+ Option | Description ------------- | ------------- `stretch` | specifies if this tab stretches to fit the parent height. @@ -260,6 +290,12 @@ tabs: For each field you can specify these options (where applicable): + +
+ Option | Description ------------- | ------------- `label` | a name when displaying the form field to the user. @@ -739,6 +775,12 @@ css_content: language: html ``` + +
+ Option | Description ------------- | ------------- `language` | code language, for example, php, css, javascript, html. Default: `php`. @@ -756,6 +798,12 @@ color: type: colorpicker ``` + +
+ Option | Description ------------- | ------------- `availableColors` | list of available colors. If not provided, the widget will use the global available colors. @@ -822,6 +870,12 @@ data: The following lists the configuration values of the data table widget itself. + +
+ Option | Description ------ | ----------- `adding` | allow records to be added to the data table. Default: `true`. @@ -858,6 +912,12 @@ columns: title: Name ``` + +
+ Option | Description ------ | ----------- `type` | the input type for this column's cells. Must be one of the following: `string`, `checkbox`, `dropdown` or `autocomplete`. @@ -871,6 +931,12 @@ Option | Description Column cells can be validated against the below types of validation. Validation should be specified as an array, with the type of validation used as a key, and an optional message specified as the `message` attrbute for that validation. + +
+ Validation | Description ---------- | ----------- `float` | Validates the data as a float. An optional boolean `allowNegative` attribute can be provided, allowing for negative float numbers. @@ -891,6 +957,12 @@ published_at: mode: date ``` + +
+ Option | Description ------------- | ------------- `mode` | the expected result, either date, datetime or time. Default: `datetime`. @@ -924,6 +996,12 @@ avatar: extension: auto ``` + +
+ Option | Description ------------- | ------------- `mode` | the expected file type, either file or image. Default: image. @@ -967,6 +1045,12 @@ background_image: mode: image ``` + +
+ Option | Description ------------- | ------------- `mode` | the expected file type, either file or image. Default: file. @@ -1047,6 +1131,12 @@ user: modelClass: Winter\User\Models\User ``` + +
+ Option | Description ------------- | ------------- `keyFrom` | the name of column to use in the relation used for key. Default: `id`. @@ -1086,6 +1176,12 @@ user: You can also provide a model scope to use to filter the results with the `scope` property. + +
+ Option | Description ------------- | ------------- `nameFrom` | a model attribute name used for displaying the relation label. Default: `name`. @@ -1116,6 +1212,12 @@ extra_information: type: text ``` + +
+ Option | Description ------------- | ------------- `form` | a reference to form field definition file, see [backend form fields](#form-fields). Inline fields can also be used. @@ -1224,6 +1326,12 @@ api_secret: hideOnTabChange: true ``` + +
+ Option | Description ------------- | ------------- `allowCopy` | adds a "copy" action to the sensitive field, allowing the user to copy the password without revealing it. Default: `false` @@ -1260,6 +1368,12 @@ tags: mode: relation ``` + +
+ Option | Description ------------- | ------------- `mode` | controls how the value is returned, either string, array or relation. Default: `string` @@ -1391,6 +1505,12 @@ slug: The following options are available for the `preset` option: + +
+ Option | Description ------------- | ------------- `field` | defines the other field name to source the value from. @@ -1430,6 +1550,12 @@ send_at: In the above example the `send_at` form field will only be shown if the `is_delayed` field is checked. In other words, the field will show (action) if the other form input (field) is checked (condition). The `trigger` definition specifies these options: + +
+ Option | Description ------------- | ------------- `action` | defines the action applied to this field when the condition is met. Supported values: show, hide, enable, disable, empty. diff --git a/backend-import-export.md b/backend-import-export.md index bbb790fb..4c6a803f 100644 --- a/backend-import-export.md +++ b/backend-import-export.md @@ -56,6 +56,12 @@ export: The configuration options listed below are optional. Define them if you want the behavior to support the [Import](#import-page) or [Export](#export-page), or both. + +
+ Option | Description ------------- | ------------- `defaultRedirect` | used as a fallback redirection page when no specific redirect page is defined. @@ -101,6 +107,12 @@ export: The following configuration options are supported for the Export page: + +
+ Option | Description ------------- | ------------- `title` | a page title, can refer to a [localization string](../plugin/localization). @@ -226,6 +238,12 @@ class SubscriberImport extends \Backend\Models\ImportModel The class must define a method called `importData` used for processing the imported data. The first parameter `$results` will contain an array containing the data to import. The second parameter `$sessionKey` will contain the session key used for the request. + +
+ Method | Description ------------- | ------------- `logUpdated()` | Called when a record is updated. @@ -329,6 +347,12 @@ export: The following configuration options are supported: + +
+ Option | Description ------------- | ------------- `definition` | the list definition to source records from, optional. diff --git a/backend-lists.md b/backend-lists.md index f7ab7703..89047034 100644 --- a/backend-lists.md +++ b/backend-lists.md @@ -61,6 +61,12 @@ recordUrl: acme/blog/posts/update/:id The following fields are required in the list configuration file: + +
+ Field | Description ------------- | ------------- `title` | a title for this list. @@ -69,6 +75,12 @@ Field | Description The configuration options listed below are optional. + +
+ Option | Description ------------- | ------------- `filter` | filter configuration, see [filtering the list](#adding-filters). @@ -110,6 +122,12 @@ Option | Description The search configuration supports the following options: + +
+ Option | Description ------------- | ------------- `prompt` | a placeholder to display when there is no active search, can refer to a [localization string](../plugin/localization). @@ -170,6 +188,12 @@ columns: For each column can specify these options (where applicable): + +
+ Option | Description ------------- | ------------- `label` | a name when displaying the list column to the user. @@ -526,6 +550,12 @@ scopes: For each scope you can specify these options (where applicable): + +
+ Option | Description ------------- | ------------- `label` | a name when displaying the filter scope to the user. diff --git a/backend-relations.md b/backend-relations.md index 4f6205da..82f32a20 100644 --- a/backend-relations.md +++ b/backend-relations.md @@ -85,6 +85,12 @@ items: The following options are then used for each relationship name definition: + +
+ Option | Description ------------- | ------------- `label` | a label for the relation, in the singular tense, required. @@ -97,6 +103,12 @@ Option | Description These configuration values can be specified for the **view** or **manage** options, where applicable to the render type of list, form or both. + +
+ Option | Type | Description ------------- | ------------- | ------------- `form` | Form | a reference to form field definition file, see [backend form fields](forms#form-fields). @@ -112,6 +124,12 @@ Option | Type | Description These configuration values can be specified only for the **view** options. + +
+ Option | Type | Description ------------- | ------------- | ------------- `showCheckboxes` | List | displays checkboxes next to each record. @@ -123,6 +141,12 @@ Option | Type | Description These configuration values can be specified only for the **manage** options. + +
+ Option | Type | Description ------------- | ------------- | ------------- `title` | Both | a popup title, can refer to a [localization string](../plugin/localization).
Additionally, you can customize the title for each mode individually by setting this to an associative array, with the key being the mode and the value being the title used when displaying that mode. Eg: `form: acme.blog::lang.subcategory.FormTitle`. diff --git a/backend-reorder.md b/backend-reorder.md index a78416d6..b0030e19 100644 --- a/backend-reorder.md +++ b/backend-reorder.md @@ -62,6 +62,12 @@ toolbar: The configuration options listed below can be used. + +
+ Option | Description ------------- | ------------- `title` | used for the page title. diff --git a/backend-views-partials.md b/backend-views-partials.md index 591b9bdc..7cea7b80 100644 --- a/backend-views-partials.md +++ b/backend-views-partials.md @@ -32,6 +32,12 @@ You can also disable the ability to hide a hint by setting the key value to a nu The following properties are available: + +
+ Property | Description ------------- | ------------- `type` | Sets the color of the hint, supported types: `danger`, `info`, `success`, `warning`. Default: `info`. diff --git a/cms-mediamanager.md b/cms-mediamanager.md index 1f9fcd57..af603c21 100644 --- a/cms-mediamanager.md +++ b/cms-mediamanager.md @@ -141,6 +141,12 @@ You should create an API user that Winter CMS will use for managing files in the Now you have all the information to update Winter CMS configuration. Open **config/filesystem.php** script and find the **disks** section. It already contains Rackspace configuration, you need to replace the API credentials and container information parameters: + +
+ Parameter | Value ------------- | ------------- `username` | Rackspace user name (for example winter.cdn.api). @@ -244,6 +250,12 @@ There are several options that allow you to fine-tune the Media Manager. All of ], ``` + +
+ Parameter | Value ------------- | ------------- `ignore` | a list of file and directory names to ignore. Defaults to ['.svn', '.git', '.DS_Store']. @@ -257,6 +269,12 @@ Parameter | Value The Media Manager provides a few [events](../services/events) that you can listen for in order to improve extensibility. + +
+ Event | Description | Parameters ------------- | ------------- | ------------- `folder.delete` | Called when a folder is deleted | `(string) $path` diff --git a/cms-pages.md b/cms-pages.md index d8f42088..ce0b69a2 100644 --- a/cms-pages.md +++ b/cms-pages.md @@ -28,6 +28,12 @@ url = "/" Page configuration is defined in the [Configuration Section](themes#configuration-section) of the page template file. The page configuration defines the page parameters, required for the routing and rendering the page and its [Components](../cms/components), which are explained in another article. The following configuration parameters are supported for pages: + +
+ Parameter | Description ------------- | ------------- `url` | the page URL, required. The URL syntax is described below. diff --git a/database-model.md b/database-model.md index 089efb4b..7ce1013e 100644 --- a/database-model.md +++ b/database-model.md @@ -84,6 +84,12 @@ class User extends Model } ``` + +
+ Property | Description ------------- | ------------- `$primaryKey` | primary key name used to identify the model. @@ -630,6 +636,12 @@ User::withoutGlobalScopes([ Models fire several events, allowing you to hook into various points in the model's lifecycle. Events allow you to easily execute code each time a specific model class is saved or updated in the database. Events are defined by overriding special methods in the class, the following method overrides are available: + +
+ Event | Description ------------- | ------------- `beforeCreate` | before the model is saved, when first created. diff --git a/database-relations.md b/database-relations.md index 57d398c9..713c5a08 100644 --- a/database-relations.md +++ b/database-relations.md @@ -76,6 +76,12 @@ public $hasMany = [ The following are parameters that can be used with all relations: + +
+ Argument | Description ------------- | ------------- `order` | sorting order for multiple records. @@ -422,6 +428,12 @@ public $belongsToMany = [ These are the parameters supported for `belongsToMany` relations: + +
+ Argument | Description ------------- | ------------- `table` | the name of the join table. diff --git a/markup-function-form.md b/markup-function-form.md index 322f131a..f8475803 100644 --- a/markup-function-form.md +++ b/markup-function-form.md @@ -42,6 +42,12 @@ There are some special options that can also be used alongside the attributes. The function support the following options: + +
+ Option | Description ------------- | ------------- `method` | Request method. Corresponds to the `method` FORM tag attribute. Eg: `POST`, `GET`, `PUT`, `DELETE` @@ -88,6 +94,12 @@ There are some special options that can also be used alongside the attributes. The function support the following options: + +
+ Option | Description ------------- | ------------- `success` | JavaScript string to execute on successful result. diff --git a/markup-tag-for.md b/markup-tag-for.md index 68b986ac..10fe7227 100644 --- a/markup-tag-for.md +++ b/markup-tag-for.md @@ -76,6 +76,12 @@ Unlike in PHP there is no function to `break` or `continue` in a loop, however y Inside of a `for` loop block you can access some special variables: + +
+ Variable | Description ------------- | ------------- `loop.index` | The current iteration of the loop. (1 indexed) diff --git a/plugin-registration.md b/plugin-registration.md index a7209acd..c2a38400 100644 --- a/plugin-registration.md +++ b/plugin-registration.md @@ -190,6 +190,12 @@ class Plugin extends \System\Classes\PluginBase The following methods are supported in the plugin registration class: + +
+ Method | Description ------------- | ------------- `pluginDetails()` | returns information about the plugin. @@ -463,6 +469,12 @@ public function boot() By default plugins are restricted from accessing certain areas of the system. This is to prevent critical errors that may lock an administrator out from the backend. When these areas are accessed without elevated permissions, the `boot` and `register` [initialization methods](#routing-initialization) for the plugin will not fire. + +
+ Request | Description ------------- | ------------- `/combine` | the asset combiner generator URL diff --git a/services-image-resizing.md b/services-image-resizing.md index fc6b7755..36aaf47b 100644 --- a/services-image-resizing.md +++ b/services-image-resizing.md @@ -67,6 +67,12 @@ Key | Description | Default | Options The `mode` option allows you to specify how the image should be resized. The available modes are as follows: + +
+ Mode | Description --- | --- `auto` | Automatically choose between `portrait` and `landscape` based on the image's orientation diff --git a/services-mail.md b/services-mail.md index 38ba898c..89f48d3a 100644 --- a/services-mail.md +++ b/services-mail.md @@ -325,6 +325,7 @@ Mail views reside in the file system and the code used represents the path to th ┗ 📂 views <=== View directory ┗ 📂 mail <=== "mail" segment ┗ 📜 message.htm <=== "message" segment +``` The content inside a mail view file can include up to 3 sections: **configuration**, **plain text**, and **HTML markup**. Sections are separated with the `==` sequence. For example: