-
Notifications
You must be signed in to change notification settings - Fork 276
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 #5000 from nextcloud/backport/4969/stable27
- Loading branch information
Showing
19 changed files
with
990 additions
and
472 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
namespace OCA\Deck\Reference; | ||
|
||
use OCA\Deck\AppInfo\Application; | ||
use OCP\Collaboration\Reference\ADiscoverableReferenceProvider; | ||
use OCP\Collaboration\Reference\IReference; | ||
use OCP\IL10N; | ||
|
||
use OCP\IURLGenerator; | ||
|
||
class CreateCardReferenceProvider extends ADiscoverableReferenceProvider { | ||
public function __construct( | ||
private IL10N $l10n, | ||
private IURLGenerator $urlGenerator, | ||
private ?string $userId) { | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getId(): string { | ||
return 'create-new-deck-card'; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getTitle(): string { | ||
return $this->l10n->t('Create a new deck card'); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getOrder(): int { | ||
return 10; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getIconUrl(): string { | ||
return $this->urlGenerator->getAbsoluteURL( | ||
$this->urlGenerator->imagePath(Application::APP_ID, 'deck-dark.svg') | ||
); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function matchReference(string $referenceText): bool { | ||
return false; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function resolveReference(string $referenceText): ?IReference { | ||
return null; | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function getCachePrefix(string $referenceId): string { | ||
return $this->userId ?? ''; | ||
} | ||
|
||
/** | ||
* We don't use the userId here but rather a reference unique id | ||
* @inheritDoc | ||
*/ | ||
public function getCacheKey(string $referenceId): ?string { | ||
return $referenceId; | ||
} | ||
} |
Oops, something went wrong.