Skip to content

Commit c5ec541

Browse files
authored
Merge pull request #592 from ExpressionEngine/7.dev
7 dev into 7.x
2 parents 177235b + 644d560 commit c5ec541

File tree

8 files changed

+228
-61
lines changed

8 files changed

+228
-61
lines changed
105 KB
Loading

docs/control-panel/channels.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ The Fields tab contains the channel's field and field group assignments.
5151

5252
A channel can have any combination of fields and field groups assigned to it. You can also create fields and field groups on this tab, for a smooth workflow.
5353

54+
![Channel Preferences - Add New Field](_images/cp-channel-new-field.png)
55+
5456
---
5557

5658
### Categories tab

docs/control-panel/create.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
This is the area where you'll create content for your site by publishing new Entries to your Channels. If you have more than one Channel, moving your cursor over the Publish menu will show all of your Channels and allow you to select one.
1717

18-
TIP: **Tip:** Site builders can customize the display of the Publish Page on a per Channel bases by creating a custom layout. Just go to the [Channel manager](control-panel/channels.md) and click 'layouts' to access the [Form layout](control-panel/channels.md#form-layouts).
18+
TIP: **Tip:** Site builders can customize the display of the Publish Page on a per Channel bases by creating a custom layout. Just go to the [Channel manager](control-panel/channels.md) and click 'layouts' to access the [Publish Layouts](control-panel/channels.md#publish-layouts).
1919

2020
![Control Panel Create Entry Page](_images/cp-create.png)
2121

@@ -39,15 +39,18 @@ NOTE: **Note:** If you let the system create your URL Title for you it will conv
3939

4040
### Entry Fields
4141

42-
The names and types of entry fields displayed will be determined by what [Fields](control-panel/field-manager/field-manager-settings.md) you have defined for this channel. If an entry field is set to be "hidden" by default, it will have to be expanded by clicking on the field name before content can be entered.
42+
The names and types of entry custom fields displayed will be determined by what [Fields](/fieldtypes/overview.md) you have defined for this channel.
4343

44-
### Save Revision
44+
If an entry field is set to be "hidden" by default, it will have to be expanded by clicking on the field name before content can be entered.
4545

46-
Allows the content editor to force a revision save.
46+
The fields can be [conditionally hidden](control-panel/field-manager/conditional-fields.md).
4747

48-
### Submit
48+
In order for the field to be available when publishing or editing an entry, it needs to be assigned to the channel the entry is in.
49+
50+
This can be done in two ways:
51+
- assign custom field to a [Field Group](/control-panel/field-manager/field-manager-settings.md#createedit-field-group) which is associated to the Channel
52+
- assign field directly to channel by editing [Channel preferences](control-panel/channels.md#fields-tab)
4953

50-
The Submit button allows you to save the entry and publish it to your site.
5154

5255
## Date Tab
5356

docs/development/fieldtypes/enhanced.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,16 @@ Possible return values are:
239239
- `'text'` - shows text input
240240
- `'select'` - shows select input populated with the field options (for fieldtypes that extend `OptionFieldtype`)
241241

242+
## File Manager support
243+
244+
When a file is referenced inside content, it can be in two different forms depending on if the file manager is running in compatibility mode or not. An example of this is when a file is chosen inside an RTE field via the filepicker. If the file manager is not running in [compatibility mode](control-panel/file-manager/file-manager.md#compatibility-mode), the file references in content will contain a file ID (e.g. `{file:123:url}` where 123 is the file ID). The file can also be referenced in content with a directory ID and file name (e.g. `{filedir_2}filename.jpg`) when in compatibility mode.
245+
246+
To parse both cases correctly, please use the `ee()->file_field->parse_string()` function.
247+
248+
ee()->load->library('file_field');
249+
$data = ee()->file_field->parse_string($data);
250+
251+
If the fieldtype is using custom JavaScript for manipulating the files, be sure to make the code aware of the [`EE.fileManagerCompatibilityMode`](development/control-panel-js/globals.md#filemanagercompatibilitymode) variable.
242252

243253
## Implementing Filepicker for Rich Text Editor
244254

docs/development/models/file.md

Lines changed: 150 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,40 @@ lang: php
1313

1414
# File Model
1515

16-
**class `ExpressionEngine\Model\File\File`**
16+
In ExpressionEngine 7 the `File` model is inheriting `FileSystemEntity` model, which is also parent of `Directory` model. They share same properties and most of the methods; different models are being used when there is need to distinguish between file and subfolder.
17+
18+
We recommend using `FileSystemEntity` when you need everything that is in certain Upload Directory, and use `File` or `Directory` when working specifically with files or folders within Upload Directory. When saving, the exact model (`File` or `Directory`) always needs to be used.
19+
20+
## `FileSystemEntity`
21+
22+
**class `ExpressionEngine\Model\File\FileSystemEntity`**
1723

1824
[TOC]
1925

20-
## Properties
21-
22-
- `file_id` Key
23-
- `site_id`
24-
- `title`
25-
- `upload_location_id`
26-
- `mime_type`
27-
- `file_name`
28-
- `file_size`
29-
- `description`
30-
- `credit`
31-
- `location`
32-
- `uploaded_by_member_id`
33-
- `upload_date`
34-
- `modified_by_member_id`
35-
- `modified_date`
36-
- `file_hw_original`
37-
38-
## Relationships
26+
### Properties
27+
28+
| Name | Validation | Type | Description |
29+
| ------------------- | -------------------- | ---------- | --------------- |
30+
| `file_id` Key | | | Primary ID of file or subfolder |
31+
| `site_id` | | | MSM site ID, default is 1 |
32+
| `title` | `xss` | | Title (can be different from file name, often used for alt text) |
33+
| `upload_location_id`| | | ID of Upload Directory that the file is in |
34+
| `directory_id` | | | Sobfolder ID, if file is in subfolder |
35+
| `mime_type` | | | Registered MIME type for the file. |
36+
| `file_type` | | | File type. The built-in types are Image / Document / Archive / Audio / Video |
37+
| `file_name` | | | Name of file on filesystem |
38+
| `file_size` | | | File size |
39+
| `description` | `xss` | | Description |
40+
| `credit` | `xss` | | Credits |
41+
| `location` | `xss` | | Location where the photo was made |
42+
| `uploaded_by_member_id`| | | ID of member who initially uploaded the file |
43+
| `upload_date` | | | Date when file was initially uploaded |
44+
| `modified_by_member_id`| | | ID of member who made last modification to the file |
45+
| `modified_date` | | | Date when file was modified last time |
46+
| `file_hw_original` | | | Height and width of the file when it was originally uploaded |
47+
| `total_records` | | | Number of times the file is being used in entries & categories |
48+
49+
### Relationships
3950

4051
#### `UploadDestination`
4152

@@ -57,23 +68,130 @@ Selected categories the file has.
5768

5869
The site the file is apart of.
5970

71+
#### `FileCategories`
72+
73+
Categories that are using this file as category image
74+
75+
#### `FileEntries`
76+
77+
Entries that are using this file
78+
6079
## Methods
6180

62-
- `isImage`
63-
- `isEditableImage`
64-
- `isSVG`
65-
- `getAbsolutePath`
66-
- `getAbsoluteThumbnailPath`
67-
- `getAbsoluteURL`
68-
- `getAbsoluteThumbnailURL`
69-
- `memberHasAccess`
70-
- `exists`
71-
- `isWritable`
72-
- `setCategoriesFromPost`
81+
#### `isFile()`
82+
83+
Returns `true` is entity is `File`, `false` otherwise
84+
85+
#### `isDirectory()`
86+
87+
Returns `true` is entity is `Directory` (subfolder), `false` otherwise
88+
89+
#### `isImage()`
90+
91+
Uses the file's mime-type to determine if the file is an image or not.
92+
93+
#### `isEditableImage()`
94+
95+
Uses the file's mime-type to determine if the file is an editable image or not.
96+
97+
#### `isSVG()`
98+
99+
Uses the file's mime-type to determine if the file is an SVG or not.
100+
101+
#### `getFilesystem()`
102+
103+
Get Filesystem object for the file's Upload Directory
104+
105+
#### `getSubfoldersPath()`
106+
107+
Get the subfolder path to the given file
108+
109+
#### `getBaseServerPath()`
110+
111+
Get base server path for file's upload location
112+
113+
#### `getBaseUrl()`
114+
115+
Get base url for upload location and folder
116+
117+
#### `getAbsolutePath()`
118+
119+
Get abolute path to the file on the filesystem
120+
121+
#### `getAbsoluteManipulationPath($manipulation = 'thumbs')`
122+
123+
Get absolute path to the file's pre-manipulated version on the filesystem. Accepts manipulation name as parameter
124+
125+
#### `getAbsoluteThumbnailPath()`
126+
127+
Uses the file's upload destination's server path to compute the absolute thumbnail path of the file
73128

74-
## Events
129+
#### `getAbsoluteURL()`
130+
131+
Uses the file's upload destination's url to compute the absolute URL of the file
132+
133+
#### `getAbsoluteManipulationURL($manipulation = 'thumbs')`
134+
135+
Get URL for pre-manupuilated file version. Accepts manipulation name as parameter
136+
137+
#### `getAbsoluteThumbnailURL()`
138+
139+
Get URL of file's thumbnail
140+
141+
#### `getThumbnailUrl()`
142+
143+
Alias of `getAbsoluteThumbnailURL`
144+
145+
#### `deleteOriginalFile()`
146+
147+
Deletes the original file
148+
149+
#### `deleteGeneratedFiles()`
150+
151+
Deletes the file's manipulated versions
152+
153+
#### `deleteAllFiles()`
154+
155+
Deletes the original file and all of its manipulated versions
156+
157+
#### `memberHasAccess(Member $member)`
158+
159+
Determines if the member has access permission to file's upload destination.
160+
161+
#### `exists()`
162+
163+
Determines if the file exists
164+
165+
#### `isWritable()`
166+
167+
Determines if the file or subfolder is writable
168+
169+
#### `getChildIds()`
170+
171+
Get an array of IDs for files and folders that belong to this `FileSystemEntity`
172+
173+
#### `actLocally(callable $callback)`
174+
175+
Perform some action on the file in a local context
176+
177+
### Events
75178

76179
- `beforeDelete`
180+
- `beforeInsert`
181+
- `beforeSave`
182+
183+
## `File`
184+
185+
**class `ExpressionEngine\Model\File\File`**
186+
187+
Represents a file. Child of `FileSystemEntity` and is sharing all of it's properties and methods.
188+
Defines some extra necessary
189+
190+
## `Directory`
191+
192+
**class `ExpressionEngine\Model\File\Directory`**
193+
194+
Represents a folder. Child of `FileSystemEntity` and is sharing all of it's properties and methods. Has extra
77195

78196
## Examples
79197

docs/fieldtypes/grid.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ Specifies the maximum number of rows this Grid can have. For example, if you ent
3333

3434
Enables moving the Grid rows with drag & drop to change the order
3535

36-
#### Always use a vertical grid layout?
36+
#### Grid layout
3737

38-
The fields within the grid will be always stacked vertically on the publish form.
38+
**Auto (default)** - the fields within the grid will be placed in a horizontal row on bigger screens, and stacked vertically on smaller screens or when there is not enough space on the page.
3939

40-
When turned off, the fields within the grid will be placed in a horizontal row next to each other in bigger screens, and stacked vertically on smaller screens.
40+
**Vertical layout** - The fields within the grid will always be stack vertically on the publish form.
41+
42+
**Horizontal layout** - The fields within the grid will always be stacked horizontally on the publish form.
4143

4244
### Grid Fields
4345

docs/fieldtypes/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ ExpressionEngine has the following built-in fieldtypes:
3737
- [Value Slider](/fieldtypes/value-slider.md)
3838
- [Toggle](/fieldtypes/toggle.md)
3939
- [URL](/fieldtypes/url.md)
40+
41+
Additionally, more fieldtypes are available in [ExpressionEngine Add-on Store](https://expressionengine.com/add-ons) as add-ons that can be [installed](add-ons/overview.md#installing-add-ons)

0 commit comments

Comments
 (0)