-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update event registration (Register.php)
- Loading branch information
Showing
9 changed files
with
69 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
Configuration/TCA/Overrides/tx_calendarize_domain_model_configurationgroup.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use HDNET\Calendarize\Register; | ||
|
||
defined('TYPO3') or exit(); | ||
|
||
Register::createTcaConfiguration(Register::getGroupCalendarizeConfiguration()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
defined('TYPO3') or exit(); | ||
|
||
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('ke_search')) { | ||
$GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['sysfolder']['displayCond'] .= ',calendarize'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,65 @@ | ||
.. include:: /Includes.txt | ||
|
||
Own events | ||
---------- | ||
|
||
.. _ownevents: | ||
|
||
Own events | ||
========== | ||
|
||
The concept of the calendarize extension is the creation of own models and tables that should be part of the calendar output. | ||
|
||
Configuration | ||
------------- | ||
|
||
Calendarize needs a configuration to handle your own model. | ||
A common practice is to store this in a static function (e.g. :php:`Classes/Register.php`). | ||
|
||
.. code-block:: php | ||
:caption: EXT:some_extension/Classes/Register.php | ||
// in ext_tables.php | ||
$configuration = [...]; | ||
\HDNET\Calendarize\Register::extTables($configuration); | ||
$configuration = [ | ||
// Unique Key for the register (e.g. you Extension Key + "Event") | ||
'uniqueRegisterKey' => 'MyEvent', | ||
// Title for your events (this is shown in the FlexForm configuration of the Plugins) | ||
'title' => 'My Event', | ||
// Name of your model | ||
'modelName' => \HDNET\MyExtension\Domain\Model\MyEvent::class, | ||
// Partials identifier (HTML) for your event (in most cases unique) | ||
'partialIdentifier' => 'MyEvent', | ||
// Table name of your event table | ||
'tableName' => 'tx_myextension_domain_model_myevent', | ||
// If true, your event requires at least one event configuration | ||
'required' => true, | ||
// [OPTIONAL] All classNames used for the extended models | ||
'subClasses' => array of classnames, | ||
// [OPTIONAL] Field name of the configurations, default is 'calendarize' (recommended) | ||
'fieldName' => 'calendarize' | ||
]; | ||
This configuration is then registered to calendarize by adding it to your :php:`ext_localconf.php`: | ||
|
||
.. code-block:: php | ||
:caption: EXT:some_extension/ext_localconf.php | ||
// in ext_localconf.php | ||
$configuration = [...]; | ||
\HDNET\Calendarize\Register::extLocalconf($configuration); | ||
The following code show the configuration that should be the same in ext_tables and ext_localconf: | ||
Additionally, you need to add the TCA configuration for the event configuration and information field: | ||
|
||
.. code-block:: php | ||
:caption: EXT:some_extension/Configuration/TCA/Overrides/<tx_extension_domain_model_event>.php | ||
$configuration = [ | ||
'uniqueRegisterKey' => 'MyEvent', // A unique Key for the register (e.g. you Extension Key + "Event") | ||
'title' => 'My Event', // The title for your events (this is shown in the FlexForm configuration of the Plugins) | ||
'modelName' => \HDNET\MyExtension\Domain\Model\MyEvent::class, // the name of your model | ||
'partialIdentifier' => 'MyEvent', // the identifier of the partials for your event. In most cases this is also unique | ||
'tableName' => 'tx_myextension_domain_model_myevent', // the table name of your event table | ||
'required' => true, // set to true, than your event need a least one event configuration | ||
'subClasses' => array of classnames, // insert here all classNames, which are used for the extended models | ||
]; | ||
Beginning with Typo3 version 8.5 frontend requests no longer load ext_tables.php in requests. | ||
The only exception is if a backend user is logged in to the backend at the same time to initialize the admin panel or frontend editing. | ||
In order to load the needed column mapping for your Model, you have to override the tca configuration for the corresponding table: | ||
\HDNET\Calendarize\Register::createTcaConfiguration($configuration); | ||
.. code-block:: php | ||
// in Configuration/TCA/Overrides/<tx_extension_domain_model_event>.php | ||
\HDNET\Calendarize\Register::createTcaConfiguration($configuration); | ||
Change preview count | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
To modify the amount of items shown in the preview you can change the amount in the ext_tables.php after calling the Register::extTables method. | ||
The default value is 10 items. | ||
To modify the amount of items shown in the preview you can change the amount in the TCA override. | ||
10 items are displayed by default. | ||
|
||
.. code-block:: php | ||
:caption: EXT:some_extension/Configuration/TCA/Overrides/<tx_extension_domain_model_event>.php | ||
// in ext_tables.php | ||
$GLOBALS['TCA']['tx_myextension_domain_model_myevent']['columns']['calendarize_info']['config']['items'] = 25; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.