Make import dependent on version
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -24,7 +24,6 @@
|
|||||||
namespace OCA\Deck\AppInfo;
|
namespace OCA\Deck\AppInfo;
|
||||||
|
|
||||||
use OCA\Deck\Activity\CommentEventHandler;
|
use OCA\Deck\Activity\CommentEventHandler;
|
||||||
use OCA\Deck\Collaboration\Resources\ResourceProvider;
|
|
||||||
use OCA\Deck\Db\Acl;
|
use OCA\Deck\Db\Acl;
|
||||||
use OCA\Deck\Db\AclMapper;
|
use OCA\Deck\Db\AclMapper;
|
||||||
use OCA\Deck\Db\AssignedUsersMapper;
|
use OCA\Deck\Db\AssignedUsersMapper;
|
||||||
@@ -33,7 +32,6 @@ use OCA\Deck\Middleware\ExceptionMiddleware;
|
|||||||
use OCA\Deck\Notification\Notifier;
|
use OCA\Deck\Notification\Notifier;
|
||||||
use OCP\AppFramework\App;
|
use OCP\AppFramework\App;
|
||||||
use OCA\Deck\Middleware\SharingMiddleware;
|
use OCA\Deck\Middleware\SharingMiddleware;
|
||||||
use OCP\AppFramework\Http\TemplateResponse;
|
|
||||||
use OCP\Collaboration\Resources\IManager;
|
use OCP\Collaboration\Resources\IManager;
|
||||||
use OCP\Comments\CommentsEntityEvent;
|
use OCP\Comments\CommentsEntityEvent;
|
||||||
use OCP\IGroup;
|
use OCP\IGroup;
|
||||||
@@ -107,6 +105,9 @@ class Application extends App {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws \OCP\AppFramework\QueryException
|
||||||
|
*/
|
||||||
public function registerNavigationEntry() {
|
public function registerNavigationEntry() {
|
||||||
$container = $this->getContainer();
|
$container = $this->getContainer();
|
||||||
$container->query(INavigationManager::class)->add(function() use ($container) {
|
$container->query(INavigationManager::class)->add(function() use ($container) {
|
||||||
@@ -131,6 +132,9 @@ class Application extends App {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws \OCP\AppFramework\QueryException
|
||||||
|
*/
|
||||||
public function registerCommentsEntity() {
|
public function registerCommentsEntity() {
|
||||||
$this->getContainer()->getServer()->getEventDispatcher()->addListener(CommentsEntityEvent::EVENT_ENTITY, function(CommentsEntityEvent $event) {
|
$this->getContainer()->getServer()->getEventDispatcher()->addListener(CommentsEntityEvent::EVENT_ENTITY, function(CommentsEntityEvent $event) {
|
||||||
$event->addEntityCollection('deckCard', function($name) {
|
$event->addEntityCollection('deckCard', function($name) {
|
||||||
@@ -147,12 +151,18 @@ class Application extends App {
|
|||||||
$this->registerCommentsEventHandler();
|
$this->registerCommentsEventHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws \OCP\AppFramework\QueryException
|
||||||
|
*/
|
||||||
protected function registerCommentsEventHandler() {
|
protected function registerCommentsEventHandler() {
|
||||||
$this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () {
|
$this->getContainer()->getServer()->getCommentsManager()->registerEventHandler(function () {
|
||||||
return $this->getContainer()->query(CommentEventHandler::class);
|
return $this->getContainer()->query(CommentEventHandler::class);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws \OCP\AppFramework\QueryException
|
||||||
|
*/
|
||||||
protected function registerCollaborationResources() {
|
protected function registerCollaborationResources() {
|
||||||
$version = \OC_Util::getVersion()[0];
|
$version = \OC_Util::getVersion()[0];
|
||||||
if ($version < 16) {
|
if ($version < 16) {
|
||||||
@@ -164,7 +174,7 @@ class Application extends App {
|
|||||||
*/
|
*/
|
||||||
/** @var IManager $resourceManager */
|
/** @var IManager $resourceManager */
|
||||||
$resourceManager = $this->getContainer()->query(IManager::class);
|
$resourceManager = $this->getContainer()->query(IManager::class);
|
||||||
$resourceManager->registerResourceProvider(ResourceProvider::class);
|
$resourceManager->registerResourceProvider(\OCA\Deck\Collaboration\Resources\ResourceProvider::class);
|
||||||
\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () {
|
\OC::$server->getEventDispatcher()->addListener('\OCP\Collaboration\Resources::loadAdditionalScripts', function () {
|
||||||
\OCP\Util::addScript('deck', 'build/collections');
|
\OCP\Util::addScript('deck', 'build/collections');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user