Add missing filenames as code box titles
authorMatthias Schmidt <gravatronics@live.com>
Mon, 3 May 2021 06:26:23 +0000 (08:26 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 3 May 2021 06:26:23 +0000 (08:26 +0200)
docs/migration/wsc31/form-builder.md
docs/tutorial/series/part_4.md
docs/tutorial/series/part_5.md

index ab828b657ae439a127f7554746fedede1b9482b8..7eaacdcb49c164738a36803bfd7efa628fac1259 100644 (file)
@@ -7,36 +7,48 @@ This form is the perfect first examples as it is very simple with only two text
 
 As a reminder, here are the two relevant PHP files and the relevant template file:
 
-```php
---8<-- "migration/wsc-31/formBuilder/PersonAddForm_old.class.php"
-```
-
-```php
---8<-- "migration/wsc-31/formBuilder/PersonEditForm_old.class.php"
-```
-
-```php
---8<-- "migration/wsc-31/formBuilder/personAdd_old.tpl"
-```
+{jinja{ codebox(
+title="files/lib/acp/form/PersonAddForm.class.php",
+language="php",
+filepath="migration/wsc-31/formBuilder/PersonAddForm_old.class.php"
+) }}
+
+{jinja{ codebox(
+title="files/lib/acp/form/PersonEditForm.class.php",
+language="php",
+filepath="migration/wsc-31/formBuilder/PersonEditForm_old.class.php"
+) }}
+
+{jinja{ codebox(
+title="acptemplates/personAdd.tpl",
+language="smarty",
+filepath="migration/wsc-31/formBuilder/personAdd_old.tpl"
+) }}
 
 Updating the template is easy as the complete form is replace by a single line of code:
 
-```php
---8<-- "migration/wsc-31/formBuilder/personAdd_new.tpl"
-```
+{jinja{ codebox(
+title="acptemplates/personAdd.tpl",
+language="smarty",
+filepath="migration/wsc-31/formBuilder/personAdd_new.tpl"
+) }}
 
 `PersonEditForm` also becomes much simpler:
 only the edited `Person` object must be read:
 
-```php
---8<-- "migration/wsc-31/formBuilder/PersonEditForm_new.class.php"
-```
+{jinja{ codebox(
+title="files/lib/acp/form/PersonEditForm.class.php",
+language="php",
+filepath="migration/wsc-31/formBuilder/PersonEditForm_new.class.php"
+) }}
 
 Most of the work is done in `PersonAddForm`:
 
-```php
---8<-- "migration/wsc-31/formBuilder/PersonAddForm_new.class.php"
-```
+{jinja{ codebox(
+title="files/lib/acp/form/PersonAddForm.class.php",
+language="php",
+filepath="migration/wsc-31/formBuilder/PersonAddForm_new.class.php"
+) }}
 
 But, as you can see, the number of lines almost decreased by half.
 All changes are due to extending `AbstractFormBuilderForm`:
index 94ac35f17b9122d8606481bd11fcd4cdb1789186..3ecb3376b51b674ffb6d80e31284379ac08a186f 100644 (file)
@@ -77,9 +77,13 @@ By extending `AbstractDatabaseObjectListBoxController`, we only have to provide
 5. `getObjectList()` returns an instance of `DatabaseObjectList` that is used to read the listed objects.
    `getObjectList()` itself must not call `readObjects()`, as `AbstractDatabaseObjectListBoxController` takes care of calling the method after adding the conditions and setting the sort order.
 6. `getTemplate()` returns the contents of the box relying on the `boxPersonList` template here:
-   ```smarty
-   --8<-- "tutorial/tutorial-series/part-4/templates/boxPersonList.tpl"
-   ```
+   
+   {jinja{ codebox(
+       title="templates/boxPersonList.tpl",
+       language="smarty",
+       filepath="tutorial/tutorial-series/part-4/templates/boxPersonList.tpl"
+   ) }}
+   
    The template relies on a `.sidebarItemList` element, which is generally used for sidebar listings.
    (If different box positions were supported, we either have to generate different output by considering the value of `$boxPosition` in the template or by using different templates in `getTemplate()`.)
    One specific piece of code is the `$__boxPersonDescription` variable, which supports an optional description below the person's name relying on the optional language item `wcf.person.boxList.description.{$boxSortField}`.
index 12f84425be5c01a7c129ed806611bffbf1c327cb..5ce0d6988946ef13bd6f5e17bbfc35f1191579ec 100644 (file)
@@ -218,26 +218,34 @@ As we store the name of the user who create a new piece of information and store
 
 1. If the user is renamed, the value of `username` stored with the person information has to be updated, which can be achieved by a simple event listener that only has to specify the name of relevant database table if `AbstractUserActionRenameListener` is extended:
 
-    ```php
-    --8<-- "tutorial//tutorial-series/part-5/files/lib/system/event/listener/PersonUserActionRenameListener.class.php"
-    ```
+    {jinja{ codebox(
+        title="files/lib/system/event/listener/PersonUserActionRenameListener.class.php",
+        language="php",
+        filepath="tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonUserActionRenameListener.class.php"
+    ) }}
 2. If users are merged, all pieces of information need to be assigned to the target user of the merging.
   Again, we only have to specify the name of relevant database table if `AbstractUserMergeListener` is extended:
 
-    ```php
-    --8<-- "tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonUserMergeListener.class.php"
-    ```
+   {jinja{ codebox(
+       title="files/lib/system/event/listener/PersonUserMergeListener.class.php",
+       language="php",
+       filepath="tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonUserMergeListener.class.php"
+   ) }}
 3. If the option to prune stored ip addresses after a certain period of time is enabled, we also have to prune them in the person information database table.
   Here we also only have to specify the name of the relevant database table and provide the mapping from the `ipAddress` column to the `time` column:
 
-    ```php
-    --8<-- "tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonPruneIpAddressesCronjobListener.class.php"
-    ```
-4. The ip addresses in the person information database table also have to be considered for the user data export which can also be done with minimal effort by providing the name of the relevant database table: 
-
-    ```php
-    --8<-- "tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonUserExportGdprListener.class.php"
-    ```
+   {jinja{ codebox(
+       title="files/lib/system/event/listener/PersonPruneIpAddressesCronjobListener.class.php",
+       language="php",
+       filepath="tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonPruneIpAddressesCronjobListener.class.php"
+   ) }}
+4. The ip addresses in the person information database table also have to be considered for the user data export which can also be done with minimal effort by providing the name of the relevant database table:
+
+   {jinja{ codebox(
+       title="files/lib/system/event/listener/PersonUserExportGdprListener.class.php",
+       language="php",
+       filepath="tutorial/tutorial-series/part-5/files/lib/system/event/listener/PersonUserExportGdprListener.class.php"
+   ) }}
 
 Lastly, we present the updated `eventListener.xml` file with new entries for all of these event listeners: