@@ -14,12 +14,10 @@ |
||
| 14 | 14 | use OCP\AppFramework\Controller; |
| 15 | 15 | use OCP\AppFramework\Http\TemplateResponse; |
| 16 | 16 | use OCP\AppFramework\Http\ContentSecurityPolicy; |
| 17 | -use OC\Encryption\Exceptions\DecryptionFailedException; |
|
| 18 | 17 | use OCP\IRequest; |
| 19 | 18 | use OCP\IConfig; |
| 20 | 19 | use OCP\IL10N; |
| 21 | 20 | use OCA\Notes\Service\NotesService; |
| 22 | -use OCA\Notes\Service\NoteDoesNotExistException; |
|
| 23 | 21 | |
| 24 | 22 | /** |
| 25 | 23 | * Class PageController |
@@ -85,6 +85,9 @@ discard block |
||
| 85 | 85 | return $this->getNote($this->getFileById($folder, $id), $folder, $this->getTags($id)); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | + /** |
|
| 89 | + * @param integer $id |
|
| 90 | + */ |
|
| 88 | 91 | private function getTags ($id) { |
| 89 | 92 | $tagger = \OC::$server->getTagManager()->load('files'); |
| 90 | 93 | if($tagger===null) { |
@@ -136,6 +139,7 @@ discard block |
||
| 136 | 139 | * @param string $content the content which will be written into the note |
| 137 | 140 | * the title is generated from the first line of the content |
| 138 | 141 | * @param int $mtime time of the note modification (optional) |
| 142 | + * @param string $userId |
|
| 139 | 143 | * @throws NoteDoesNotExistException if note does not exist |
| 140 | 144 | * @return \OCA\Notes\Db\Note the updated note |
| 141 | 145 | */ |
@@ -194,6 +198,7 @@ discard block |
||
| 194 | 198 | * Set or unset a note as favorite. |
| 195 | 199 | * @param int $id the id of the note used to update |
| 196 | 200 | * @param boolean $favorite whether the note should be a favorite or not |
| 201 | + * @param string $userId |
|
| 197 | 202 | * @throws NoteDoesNotExistException if note does not exist |
| 198 | 203 | * @return boolean the new favorite state of the note |
| 199 | 204 | */ |
@@ -249,6 +254,9 @@ discard block |
||
| 249 | 254 | return trim($str); |
| 250 | 255 | } |
| 251 | 256 | |
| 257 | + /** |
|
| 258 | + * @param string $content |
|
| 259 | + */ |
|
| 252 | 260 | private function getSafeTitleFromContent($content) { |
| 253 | 261 | // prepare content: remove markdown characters and empty spaces |
| 254 | 262 | $content = preg_replace("/^\s*[*+-]\s+/mu", "", $content); // list item |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | use OCA\Notes\Db\Note; |
| 22 | 22 | use OCA\Notes\Service\SettingsService; |
| 23 | 23 | use OCP\IConfig; |
| 24 | -use OCP\IUserSession; |
|
| 25 | 24 | |
| 26 | 25 | |
| 27 | 26 | /** |