@@ -31,49 +31,49 @@ |
||
31 | 31 | use Sabre\DAV\INode; |
32 | 32 | |
33 | 33 | class RestoreFolder implements ICollection, IMoveTarget { |
34 | - public function createFile($name, $data = null) { |
|
35 | - throw new Forbidden(); |
|
36 | - } |
|
34 | + public function createFile($name, $data = null) { |
|
35 | + throw new Forbidden(); |
|
36 | + } |
|
37 | 37 | |
38 | - public function createDirectory($name) { |
|
39 | - throw new Forbidden(); |
|
40 | - } |
|
38 | + public function createDirectory($name) { |
|
39 | + throw new Forbidden(); |
|
40 | + } |
|
41 | 41 | |
42 | - public function getChild($name) { |
|
43 | - return null; |
|
44 | - } |
|
42 | + public function getChild($name) { |
|
43 | + return null; |
|
44 | + } |
|
45 | 45 | |
46 | - public function delete() { |
|
47 | - throw new Forbidden(); |
|
48 | - } |
|
46 | + public function delete() { |
|
47 | + throw new Forbidden(); |
|
48 | + } |
|
49 | 49 | |
50 | - public function getName() { |
|
51 | - return 'restore'; |
|
52 | - } |
|
50 | + public function getName() { |
|
51 | + return 'restore'; |
|
52 | + } |
|
53 | 53 | |
54 | - public function setName($name) { |
|
55 | - throw new Forbidden(); |
|
56 | - } |
|
54 | + public function setName($name) { |
|
55 | + throw new Forbidden(); |
|
56 | + } |
|
57 | 57 | |
58 | - public function getLastModified(): int { |
|
59 | - return 0; |
|
60 | - } |
|
58 | + public function getLastModified(): int { |
|
59 | + return 0; |
|
60 | + } |
|
61 | 61 | |
62 | - public function getChildren(): array { |
|
63 | - return []; |
|
64 | - } |
|
62 | + public function getChildren(): array { |
|
63 | + return []; |
|
64 | + } |
|
65 | 65 | |
66 | - public function childExists($name): bool { |
|
67 | - return false; |
|
68 | - } |
|
66 | + public function childExists($name): bool { |
|
67 | + return false; |
|
68 | + } |
|
69 | 69 | |
70 | - public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
71 | - if (!($sourceNode instanceof VersionFile)) { |
|
72 | - return false; |
|
73 | - } |
|
70 | + public function moveInto($targetName, $sourcePath, INode $sourceNode): bool { |
|
71 | + if (!($sourceNode instanceof VersionFile)) { |
|
72 | + return false; |
|
73 | + } |
|
74 | 74 | |
75 | - $sourceNode->rollBack(); |
|
76 | - return true; |
|
77 | - } |
|
75 | + $sourceNode->rollBack(); |
|
76 | + return true; |
|
77 | + } |
|
78 | 78 | |
79 | 79 | } |
@@ -33,26 +33,26 @@ |
||
33 | 33 | */ |
34 | 34 | class Config { |
35 | 35 | |
36 | - /** @var ICloudFederationProviderManager */ |
|
37 | - private $cloudFederationProviderManager; |
|
36 | + /** @var ICloudFederationProviderManager */ |
|
37 | + private $cloudFederationProviderManager; |
|
38 | 38 | |
39 | - public function __construct(ICloudFederationProviderManager $cloudFederationProviderManager) { |
|
40 | - $this->cloudFederationProviderManager = $cloudFederationProviderManager; |
|
41 | - } |
|
39 | + public function __construct(ICloudFederationProviderManager $cloudFederationProviderManager) { |
|
40 | + $this->cloudFederationProviderManager = $cloudFederationProviderManager; |
|
41 | + } |
|
42 | 42 | |
43 | - /** |
|
44 | - * get a list of supported share types |
|
45 | - * |
|
46 | - * @param string $resourceType |
|
47 | - * @return array |
|
48 | - */ |
|
49 | - public function getSupportedShareTypes($resourceType) { |
|
50 | - try { |
|
51 | - $provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType); |
|
52 | - return $provider->getSupportedShareTypes(); |
|
53 | - } catch (\Exception $e) { |
|
54 | - return []; |
|
55 | - } |
|
56 | - } |
|
43 | + /** |
|
44 | + * get a list of supported share types |
|
45 | + * |
|
46 | + * @param string $resourceType |
|
47 | + * @return array |
|
48 | + */ |
|
49 | + public function getSupportedShareTypes($resourceType) { |
|
50 | + try { |
|
51 | + $provider = $this->cloudFederationProviderManager->getCloudFederationProvider($resourceType); |
|
52 | + return $provider->getSupportedShareTypes(); |
|
53 | + } catch (\Exception $e) { |
|
54 | + return []; |
|
55 | + } |
|
56 | + } |
|
57 | 57 | |
58 | 58 | } |
@@ -31,14 +31,14 @@ |
||
31 | 31 | */ |
32 | 32 | interface IStore { |
33 | 33 | |
34 | - /** |
|
35 | - * Get login credentials of the currently logged in user |
|
36 | - * |
|
37 | - * @since 12 |
|
38 | - * |
|
39 | - * @throws CredentialsUnavailableException |
|
40 | - * @return ICredentials the login credentials of the current user |
|
41 | - */ |
|
42 | - public function getLoginCredentials(): ICredentials; |
|
34 | + /** |
|
35 | + * Get login credentials of the currently logged in user |
|
36 | + * |
|
37 | + * @since 12 |
|
38 | + * |
|
39 | + * @throws CredentialsUnavailableException |
|
40 | + * @return ICredentials the login credentials of the current user |
|
41 | + */ |
|
42 | + public function getLoginCredentials(): ICredentials; |
|
43 | 43 | |
44 | 44 | } |
@@ -29,29 +29,29 @@ |
||
29 | 29 | |
30 | 30 | class Admin implements ISettings { |
31 | 31 | |
32 | - /** |
|
33 | - * @return TemplateResponse |
|
34 | - */ |
|
35 | - public function getForm() { |
|
36 | - return new TemplateResponse('systemtags', 'admin', [], ''); |
|
37 | - } |
|
32 | + /** |
|
33 | + * @return TemplateResponse |
|
34 | + */ |
|
35 | + public function getForm() { |
|
36 | + return new TemplateResponse('systemtags', 'admin', [], ''); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @return string the section ID, e.g. 'sharing' |
|
41 | - */ |
|
42 | - public function getSection() { |
|
43 | - return 'server'; |
|
44 | - } |
|
39 | + /** |
|
40 | + * @return string the section ID, e.g. 'sharing' |
|
41 | + */ |
|
42 | + public function getSection() { |
|
43 | + return 'server'; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * @return int whether the form should be rather on the top or bottom of |
|
48 | - * the admin section. The forms are arranged in ascending order of the |
|
49 | - * priority values. It is required to return a value between 0 and 100. |
|
50 | - * |
|
51 | - * E.g.: 70 |
|
52 | - */ |
|
53 | - public function getPriority() { |
|
54 | - return 70; |
|
55 | - } |
|
46 | + /** |
|
47 | + * @return int whether the form should be rather on the top or bottom of |
|
48 | + * the admin section. The forms are arranged in ascending order of the |
|
49 | + * priority values. It is required to return a value between 0 and 100. |
|
50 | + * |
|
51 | + * E.g.: 70 |
|
52 | + */ |
|
53 | + public function getPriority() { |
|
54 | + return 70; |
|
55 | + } |
|
56 | 56 | |
57 | 57 | } |
@@ -29,45 +29,45 @@ |
||
29 | 29 | use OCP\Settings\IIconSection; |
30 | 30 | |
31 | 31 | class Section implements IIconSection { |
32 | - /** @var IL10N */ |
|
33 | - private $l; |
|
34 | - /** @var IURLGenerator */ |
|
35 | - private $url; |
|
32 | + /** @var IL10N */ |
|
33 | + private $l; |
|
34 | + /** @var IURLGenerator */ |
|
35 | + private $url; |
|
36 | 36 | |
37 | - /** |
|
38 | - * @param IURLGenerator $url |
|
39 | - * @param IL10N $l |
|
40 | - */ |
|
41 | - public function __construct(IURLGenerator $url, IL10N $l) { |
|
42 | - $this->url = $url; |
|
43 | - $this->l = $l; |
|
44 | - } |
|
37 | + /** |
|
38 | + * @param IURLGenerator $url |
|
39 | + * @param IL10N $l |
|
40 | + */ |
|
41 | + public function __construct(IURLGenerator $url, IL10N $l) { |
|
42 | + $this->url = $url; |
|
43 | + $this->l = $l; |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * {@inheritdoc} |
|
48 | - */ |
|
49 | - public function getID() { |
|
50 | - return 'workflow'; |
|
51 | - } |
|
46 | + /** |
|
47 | + * {@inheritdoc} |
|
48 | + */ |
|
49 | + public function getID() { |
|
50 | + return 'workflow'; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * {@inheritdoc} |
|
55 | - */ |
|
56 | - public function getName() { |
|
57 | - return $this->l->t('Flow'); |
|
58 | - } |
|
53 | + /** |
|
54 | + * {@inheritdoc} |
|
55 | + */ |
|
56 | + public function getName() { |
|
57 | + return $this->l->t('Flow'); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * {@inheritdoc} |
|
62 | - */ |
|
63 | - public function getPriority() { |
|
64 | - return 55; |
|
65 | - } |
|
60 | + /** |
|
61 | + * {@inheritdoc} |
|
62 | + */ |
|
63 | + public function getPriority() { |
|
64 | + return 55; |
|
65 | + } |
|
66 | 66 | |
67 | - /** |
|
68 | - * {@inheritdoc} |
|
69 | - */ |
|
70 | - public function getIcon() { |
|
71 | - return $this->url->imagePath(Application::APP_ID, 'app-dark.svg'); |
|
72 | - } |
|
67 | + /** |
|
68 | + * {@inheritdoc} |
|
69 | + */ |
|
70 | + public function getIcon() { |
|
71 | + return $this->url->imagePath(Application::APP_ID, 'app-dark.svg'); |
|
72 | + } |
|
73 | 73 | } |
@@ -32,68 +32,68 @@ |
||
32 | 32 | */ |
33 | 33 | interface IEditor { |
34 | 34 | |
35 | - /** |
|
36 | - * Return a unique identifier for the editor |
|
37 | - * |
|
38 | - * e.g. richdocuments |
|
39 | - * |
|
40 | - * @since 18.0.0 |
|
41 | - * @return string |
|
42 | - */ |
|
43 | - public function getId(): string; |
|
35 | + /** |
|
36 | + * Return a unique identifier for the editor |
|
37 | + * |
|
38 | + * e.g. richdocuments |
|
39 | + * |
|
40 | + * @since 18.0.0 |
|
41 | + * @return string |
|
42 | + */ |
|
43 | + public function getId(): string; |
|
44 | 44 | |
45 | - /** |
|
46 | - * Return a readable name for the editor |
|
47 | - * |
|
48 | - * e.g. Collabora Online |
|
49 | - * |
|
50 | - * @since 18.0.0 |
|
51 | - * @return string |
|
52 | - */ |
|
53 | - public function getName(): string; |
|
45 | + /** |
|
46 | + * Return a readable name for the editor |
|
47 | + * |
|
48 | + * e.g. Collabora Online |
|
49 | + * |
|
50 | + * @since 18.0.0 |
|
51 | + * @return string |
|
52 | + */ |
|
53 | + public function getName(): string; |
|
54 | 54 | |
55 | - /** |
|
56 | - * A list of mimetypes that should open the editor by default |
|
57 | - * |
|
58 | - * @since 18.0.0 |
|
59 | - * @return string[] |
|
60 | - */ |
|
61 | - public function getMimetypes(): array; |
|
55 | + /** |
|
56 | + * A list of mimetypes that should open the editor by default |
|
57 | + * |
|
58 | + * @since 18.0.0 |
|
59 | + * @return string[] |
|
60 | + */ |
|
61 | + public function getMimetypes(): array; |
|
62 | 62 | |
63 | - /** |
|
64 | - * A list of mimetypes that can be opened in the editor optionally |
|
65 | - * |
|
66 | - * @since 18.0.0 |
|
67 | - * @return string[] |
|
68 | - */ |
|
69 | - public function getMimetypesOptional(): array; |
|
63 | + /** |
|
64 | + * A list of mimetypes that can be opened in the editor optionally |
|
65 | + * |
|
66 | + * @since 18.0.0 |
|
67 | + * @return string[] |
|
68 | + */ |
|
69 | + public function getMimetypesOptional(): array; |
|
70 | 70 | |
71 | - /** |
|
72 | - * Return a list of file creation options to be presented to the user |
|
73 | - * |
|
74 | - * @since 18.0.0 |
|
75 | - * @return ACreateFromTemplate[]|ACreateEmpty[] |
|
76 | - */ |
|
77 | - public function getCreators(): array; |
|
71 | + /** |
|
72 | + * Return a list of file creation options to be presented to the user |
|
73 | + * |
|
74 | + * @since 18.0.0 |
|
75 | + * @return ACreateFromTemplate[]|ACreateEmpty[] |
|
76 | + */ |
|
77 | + public function getCreators(): array; |
|
78 | 78 | |
79 | - /** |
|
80 | - * Return if the view is able to securely view a file without downloading it to the browser |
|
81 | - * |
|
82 | - * @since 18.0.0 |
|
83 | - * @return bool |
|
84 | - */ |
|
85 | - public function isSecure(): bool; |
|
79 | + /** |
|
80 | + * Return if the view is able to securely view a file without downloading it to the browser |
|
81 | + * |
|
82 | + * @since 18.0.0 |
|
83 | + * @return bool |
|
84 | + */ |
|
85 | + public function isSecure(): bool; |
|
86 | 86 | |
87 | - /** |
|
88 | - * Return a template response for displaying the editor |
|
89 | - * |
|
90 | - * open can only be called once when the client requests the editor with a one-time-use token |
|
91 | - * For handling editing and later requests, editors need to impelement their own token handling and take care of invalidation |
|
92 | - * |
|
93 | - * This behavior is similar to the current direct editing implementation in collabora where we generate a one-time token and switch over to the regular wopi token for the actual editing/saving process |
|
94 | - * |
|
95 | - * @since 18.0.0 |
|
96 | - * @return Response |
|
97 | - */ |
|
98 | - public function open(IToken $token): Response; |
|
87 | + /** |
|
88 | + * Return a template response for displaying the editor |
|
89 | + * |
|
90 | + * open can only be called once when the client requests the editor with a one-time-use token |
|
91 | + * For handling editing and later requests, editors need to impelement their own token handling and take care of invalidation |
|
92 | + * |
|
93 | + * This behavior is similar to the current direct editing implementation in collabora where we generate a one-time token and switch over to the regular wopi token for the actual editing/saving process |
|
94 | + * |
|
95 | + * @since 18.0.0 |
|
96 | + * @return Response |
|
97 | + */ |
|
98 | + public function open(IToken $token): Response; |
|
99 | 99 | } |
@@ -28,12 +28,12 @@ |
||
28 | 28 | */ |
29 | 29 | abstract class ACreateFromTemplate extends ACreateEmpty { |
30 | 30 | |
31 | - /** |
|
32 | - * List of available templates for the create from template action |
|
33 | - * |
|
34 | - * @since 18.0.0 |
|
35 | - * @return ATemplate[] |
|
36 | - */ |
|
37 | - abstract public function getTemplates(): array; |
|
31 | + /** |
|
32 | + * List of available templates for the create from template action |
|
33 | + * |
|
34 | + * @since 18.0.0 |
|
35 | + * @return ATemplate[] |
|
36 | + */ |
|
37 | + abstract public function getTemplates(): array; |
|
38 | 38 | |
39 | 39 | } |
@@ -30,28 +30,28 @@ |
||
30 | 30 | */ |
31 | 31 | class RegisterDirectEditorEvent extends Event { |
32 | 32 | |
33 | - /** |
|
34 | - * @var IManager |
|
35 | - */ |
|
36 | - private $manager; |
|
33 | + /** |
|
34 | + * @var IManager |
|
35 | + */ |
|
36 | + private $manager; |
|
37 | 37 | |
38 | - /** |
|
39 | - * RegisterDirectEditorEvent constructor. |
|
40 | - * |
|
41 | - * @param IManager $manager |
|
42 | - * @since 18.0.0 |
|
43 | - */ |
|
44 | - public function __construct(IManager $manager) { |
|
45 | - parent::__construct(); |
|
46 | - $this->manager = $manager; |
|
47 | - } |
|
38 | + /** |
|
39 | + * RegisterDirectEditorEvent constructor. |
|
40 | + * |
|
41 | + * @param IManager $manager |
|
42 | + * @since 18.0.0 |
|
43 | + */ |
|
44 | + public function __construct(IManager $manager) { |
|
45 | + parent::__construct(); |
|
46 | + $this->manager = $manager; |
|
47 | + } |
|
48 | 48 | |
49 | - /** |
|
50 | - * @since 18.0.0 |
|
51 | - * @param IEditor $editor |
|
52 | - */ |
|
53 | - public function register(IEditor $editor): void { |
|
54 | - $this->manager->registerDirectEditor($editor); |
|
55 | - } |
|
49 | + /** |
|
50 | + * @since 18.0.0 |
|
51 | + * @param IEditor $editor |
|
52 | + */ |
|
53 | + public function register(IEditor $editor): void { |
|
54 | + $this->manager->registerDirectEditor($editor); |
|
55 | + } |
|
56 | 56 | |
57 | 57 | } |
@@ -36,37 +36,37 @@ |
||
36 | 36 | |
37 | 37 | class DirectEditingViewController extends Controller { |
38 | 38 | |
39 | - /** @var IEventDispatcher */ |
|
40 | - private $eventDispatcher; |
|
39 | + /** @var IEventDispatcher */ |
|
40 | + private $eventDispatcher; |
|
41 | 41 | |
42 | - /** @var IManager */ |
|
43 | - private $directEditingManager; |
|
42 | + /** @var IManager */ |
|
43 | + private $directEditingManager; |
|
44 | 44 | |
45 | - /** @var ILogger */ |
|
46 | - private $logger; |
|
45 | + /** @var ILogger */ |
|
46 | + private $logger; |
|
47 | 47 | |
48 | - public function __construct($appName, IRequest $request, IEventDispatcher $eventDispatcher, IManager $manager, ILogger $logger) { |
|
49 | - parent::__construct($appName, $request); |
|
48 | + public function __construct($appName, IRequest $request, IEventDispatcher $eventDispatcher, IManager $manager, ILogger $logger) { |
|
49 | + parent::__construct($appName, $request); |
|
50 | 50 | |
51 | - $this->eventDispatcher = $eventDispatcher; |
|
52 | - $this->directEditingManager = $manager; |
|
53 | - $this->logger = $logger; |
|
54 | - } |
|
51 | + $this->eventDispatcher = $eventDispatcher; |
|
52 | + $this->directEditingManager = $manager; |
|
53 | + $this->logger = $logger; |
|
54 | + } |
|
55 | 55 | |
56 | - /** |
|
57 | - * @PublicPage |
|
58 | - * @NoCSRFRequired |
|
59 | - * |
|
60 | - * @param string $token |
|
61 | - * @return Response |
|
62 | - */ |
|
63 | - public function edit(string $token): Response { |
|
64 | - $this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager)); |
|
65 | - try { |
|
66 | - return $this->directEditingManager->edit($token); |
|
67 | - } catch (Exception $e) { |
|
68 | - $this->logger->logException($e); |
|
69 | - return new NotFoundResponse(); |
|
70 | - } |
|
71 | - } |
|
56 | + /** |
|
57 | + * @PublicPage |
|
58 | + * @NoCSRFRequired |
|
59 | + * |
|
60 | + * @param string $token |
|
61 | + * @return Response |
|
62 | + */ |
|
63 | + public function edit(string $token): Response { |
|
64 | + $this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager)); |
|
65 | + try { |
|
66 | + return $this->directEditingManager->edit($token); |
|
67 | + } catch (Exception $e) { |
|
68 | + $this->logger->logException($e); |
|
69 | + return new NotFoundResponse(); |
|
70 | + } |
|
71 | + } |
|
72 | 72 | } |