Skip to content

Commit 8e56384

Browse files
committed
Update part 3 documentation
1 parent 96cae79 commit 8e56384

1 file changed

Lines changed: 55 additions & 42 deletions

File tree

docs/tutorial/series/part_3.md

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,50 +24,66 @@ In addition to the components used in [part 1](part_1.md), we will use the [obje
2424
The complete package will have the following file structure (including the files from [part 1](part_1.md)):
2525

2626
```
27-
├── acpMenu.xml
2827
├── acptemplates
29-
├── personAdd.tpl
30-
└── personList.tpl
28+
   ├── personAdd.tpl
29+
   └── personList.tpl
3130
├── files
32-
│ ├── acp
33-
│ │ └── database
34-
│ │ └── install_com.woltlab.wcf.people.php
35-
│ └── lib
36-
│ ├── acp
37-
│ │ ├── form
38-
│ │ │ ├── PersonAddForm.class.php
39-
│ │ │ └── PersonEditForm.class.php
40-
│ │ └── page
41-
│ │ └── PersonListPage.class.php
42-
│ ├── data
43-
│ │ └── person
44-
│ │ ├── Person.class.php
45-
│ │ ├── PersonAction.class.php
46-
│ │ ├── PersonEditor.class.php
47-
│ │ └── PersonList.class.php
48-
│ ├── page
49-
│ │ ├── PersonListPage.class.php
50-
│ │ └── PersonPage.class.php
51-
│ └── system
52-
│ ├── cache
53-
│ │ └── runtime
54-
│ │ └── PersonRuntimeCache.class.php
55-
│ ├── comment
56-
│ │ └── manager
57-
│ │ └── PersonCommentManager.class.php
58-
│ └── page
59-
│ └── handler
60-
│ └── PersonPageHandler.class.php
31+
│   ├── acp
32+
│   │   └── database
33+
│   │   └── install_com.woltlab.wcf.people.php
34+
│   └── lib
35+
│   ├── acp
36+
│   │   ├── form
37+
│   │   │   ├── PersonAddForm.class.php
38+
│   │   │   └── PersonEditForm.class.php
39+
│   │   └── page
40+
│   │   └── PersonListPage.class.php
41+
│   ├── bootstrap
42+
│   │   └── com.woltlab.wcf.people.php
43+
│   ├── data
44+
│   │   └── person
45+
│   │   ├── Person.class.php
46+
│   │   ├── PersonAction.class.php
47+
│   │   ├── PersonEditor.class.php
48+
│   │   └── PersonList.class.php
49+
│   ├── event
50+
│   │   └── gridView
51+
│   │   └── admin
52+
│   │   └── PersonGridViewInitialized.class.php
53+
│   ├── page
54+
│   │   ├── PersonListPage.class.php
55+
│   │   └── PersonPage.class.php
56+
│   └── system
57+
│   ├── cache
58+
│   │   └── runtime
59+
│   │   └── PersonRuntimeCache.class.php
60+
│   ├── comment
61+
│   │   └── manager
62+
│   │   └── PersonCommentManager.class.php
63+
│   ├── endpoint
64+
│   │   └── controller
65+
│   │   └── core
66+
│   │   └── persons
67+
│   │   └── DeletePerson.class.php
68+
│   ├── gridView
69+
│   │   └── admin
70+
│   │   └── PersonGridView.class.php
71+
│   ├── interaction
72+
│   │   └── admin
73+
│   │   └── PersonInteractions.class.php
74+
│   └── page
75+
│   └── handler
76+
│   └── PersonPageHandler.class.php
6177
├── language
62-
├── de.xml
63-
└── en.xml
78+
   ├── de.xml
79+
   └── en.xml
6480
├── menuItem.xml
6581
├── objectType.xml
6682
├── package.xml
6783
├── page.xml
6884
├── templates
69-
├── person.tpl
70-
└── personList.tpl
85+
   ├── person.tpl
86+
   └── personList.tpl
7187
└── userGroupOption.xml
7288
```
7389

@@ -132,8 +148,8 @@ With this option, comments on individual people can be disabled.
132148

133149
The `PersonPage` class is similar to the `PersonEditForm` in the ACP in that it reads the id of the requested person from the request data and validates the id in `readParameters()`.
134150
The rest of the code only handles fetching the list of comments on the requested person.
135-
In `readData()`, this list is fetched using `CommentHandler::getCommentList()` if comments are enabled for the person.
136-
The `assignVariables()` method assigns some additional template variables like `$commentCanAdd`, which is `1` if the active person can add comments and is `0` otherwise, `$lastCommentTime`, which contains the UNIX timestamp of the last comment, and `$likeData`, which contains data related to the likes for the disabled comments.
151+
In `readData()`, this list is fetched using a `CommentsView` if comments are enabled for the person.
152+
The `assignVariables()` method assigns this view as a template variables.
137153

138154
### `person.tpl`
139155

@@ -144,10 +160,7 @@ The `assignVariables()` method assigns some additional template variables like `
144160
) }}
145161

146162
For now, the `person` template is still very empty and only shows the comments in the content area.
147-
The template code shown for comments is very generic and used in this form in many locations as it only sets the header of the comment list and the container `ul#personCommentList` element for the comments shown by `commentList` template.
148-
The `ul#personCommentList` elements has five additional `data-` attributes required by the JavaScript API for comments for loading more comments or creating new ones.
149-
The `commentListAddComment` template adds the WYSIWYG support.
150-
The attribute `wysiwygSelector` should be the id of the comment list `personCommentList` with an additional `AddComment` suffix.
163+
For the main part of the page we only need to call the `render()` method of the `CommentsView`.
151164

152165
### `page.xml`
153166

0 commit comments

Comments
 (0)