Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
solverat committed Sep 25, 2023
1 parent 0d40ae8 commit 20c5754
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/SSO/20_Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ bin/console members:install:class -o

By adding the `-o` argument, this command will install the `SsoIdentity`. Already installed classes will be skipped.

If you want to use a different name, just create the class and import it from `src/MembersBundle/Resources/install/classes/class_SsoIdentity_export.json`.
If you want to use a different name, just create the class and import it from `src/MembersBundle/config/install/classes/class_SsoIdentity_export.json`.
Read more about changing the default class name [here](../20_ClassCustomization.md).

## Add SSO Identity Relation Field
Expand Down
19 changes: 5 additions & 14 deletions src/EventListener/TreeListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,16 @@ class TreeListener implements EventSubscriberInterface
public function __construct(
protected Configuration $configuration,
protected RestrictionManager $restrictionManager
)
{
) {
}

public static function getSubscribedEvents(): array
{
$defaultEvents = [
AdminEvents::OBJECT_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA => ['handleObjectTree', 0]
return [
AdminEvents::OBJECT_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA => ['handleObjectTree', 0],
AdminEvents::ASSET_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA => ['handleAssetTree', 0],
AdminEvents::DOCUMENT_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA => ['handleDocumentTree', 0]
];

if (defined('\Pimcore\Event\AdminEvents::ASSET_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA')) {
$defaultEvents[AdminEvents::ASSET_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA] = ['handleAssetTree', 0];
}

if (defined('\Pimcore\Event\AdminEvents::DOCUMENT_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA')) {
$defaultEvents[AdminEvents::DOCUMENT_TREE_GET_CHILDREN_BY_ID_PRE_SEND_DATA] = ['handleDocumentTree', 0];
}

return $defaultEvents;
}

public function handleObjectTree(GenericEvent $event): void
Expand Down

0 comments on commit 20c5754

Please sign in to comment.