Skip to content

Commit

Permalink
Revert "Add new dca author field mechanic (#69)"
Browse files Browse the repository at this point in the history
This reverts commit 7bc382c.
  • Loading branch information
koertho committed Oct 12, 2023
1 parent 7bc382c commit 497a192
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 182 deletions.
33 changes: 0 additions & 33 deletions README.md
Expand Up @@ -28,8 +28,6 @@ huh.utils.pdf.preview | `"spatie/pdf-to-image": "^1.8"` or/and `"alchemy/ghostsc

## Usage

### Utils

> We're currently in a process moving all services into the Utils namespace and make them all accessible from a new Utils service.
This Bundle is a collection of utils to solve recurring tasks. See the [API Documentation](https://heimrichhannot.github.io/contao-utils-bundle/) to see all util-classes and -methods.
Expand Down Expand Up @@ -100,37 +98,6 @@ huh.utils.url
huh.utils.user
```

### Common dca fields

The bundle provides some common dca fields that can be used in your dca files.

#### Author field

Add an author field to your dca. It will be initialized with the current backend user. On copy, it will be set to the current user.

```php
# contao/dca/tl_example.php
use HeimrichHannot\UtilsBundle\Dca\AuthorField;

AuthorField::register('tl_example');
```

You can pass additional options to adjust the field:

```php
# contao/dca/tl_example.php
use HeimrichHannot\UtilsBundle\Dca\AuthorField;

AuthorField::register('tl_example', [
'type' => AuthorField::TYPE_USER, // can be change to TYPE_MEMBER to set a frontend member instead of a backend user
'fieldNamePrefix' => '', // custom prefix for the field name
'useDefaultLabel' => true, // set to false to disable the default label and set a custom label in your dca translations
'exclude' => true,
'search' => true,
'filter' => true,
]);
```

## Documentation

[API Documentation](https://heimrichhannot.github.io/contao-utils-bundle/)
Expand Down
35 changes: 0 additions & 35 deletions src/Dca/AuthorField.php

This file was deleted.

3 changes: 0 additions & 3 deletions src/Dca/DcaUtil.php
Expand Up @@ -758,9 +758,6 @@ public function generateAlias(?string $alias, int $id, ?string $table, string $t
return $alias;
}

/**
* @deprecated Use AuthorField::register() instead
*/
public function addAuthorFieldAndCallback(string $table, string $fieldPrefix = '')
{
$this->framework->getAdapter(Controller::class)->loadDataContainer($table);
Expand Down
111 changes: 0 additions & 111 deletions src/EventListener/DcaAuthorListener.php

This file was deleted.

0 comments on commit 497a192

Please sign in to comment.