-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48206 from nextcloud/feat/systemtags-public
- Loading branch information
Showing
11 changed files
with
136 additions
and
18 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
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
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
32 changes: 32 additions & 0 deletions
32
apps/systemtags/lib/Listeners/BeforeSabrePubliclyLoadedListener.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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
namespace OCA\SystemTags\Listeners; | ||
|
||
use OCA\DAV\SystemTag\SystemTagPlugin; | ||
use OCP\BeforeSabrePubliclyLoadedEvent; | ||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
use OCP\Server; | ||
|
||
/** | ||
* @template-implements IEventListener<BeforeSabrePubliclyLoadedEvent> | ||
*/ | ||
class BeforeSabrePubliclyLoadedListener implements IEventListener { | ||
public function handle(Event $event): void { | ||
if (!$event instanceof BeforeSabrePubliclyLoadedEvent) { | ||
return; | ||
} | ||
|
||
$server = $event->getServer(); | ||
if ($server === null) { | ||
return; | ||
} | ||
|
||
$server->addPlugin(Server::get(SystemTagPlugin::class)); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/systemtags/lib/Listeners/BeforeTemplateRenderedListener.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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
namespace OCA\SystemTags\Listeners; | ||
|
||
use OCA\Files_Sharing\Event\BeforeTemplateRenderedEvent; | ||
use OCA\SystemTags\AppInfo\Application; | ||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
use OCP\Util; | ||
|
||
/** | ||
* @template-implements IEventListener<BeforeTemplateRenderedEvent> | ||
*/ | ||
class BeforeTemplateRenderedListener implements IEventListener { | ||
public function handle(Event $event): void { | ||
if (!$event instanceof BeforeTemplateRenderedEvent) { | ||
return; | ||
} | ||
Util::addInitScript(Application::APP_ID, 'init'); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
apps/systemtags/lib/Listeners/LoadAdditionalScriptsListener.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,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
namespace OCA\SystemTags\Listeners; | ||
|
||
use OCA\Files\Event\LoadAdditionalScriptsEvent; | ||
use OCA\SystemTags\AppInfo\Application; | ||
use OCP\EventDispatcher\Event; | ||
use OCP\EventDispatcher\IEventListener; | ||
use OCP\Util; | ||
|
||
/** | ||
* @template-implements IEventListener<LoadAdditionalScriptsEvent> | ||
*/ | ||
class LoadAdditionalScriptsListener implements IEventListener { | ||
public function handle(Event $event): void { | ||
if (!$event instanceof LoadAdditionalScriptsEvent) { | ||
return; | ||
} | ||
Util::addInitScript(Application::APP_ID, 'init'); | ||
} | ||
} |
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