@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | public static function delete_metadata_hook($params) { |
64 | 64 | $path = $params[\OC\Files\Filesystem::signal_param_path]; |
65 | - if ($path<>'') { |
|
65 | + if ($path <> '') { |
|
66 | 66 | $hook = self::createForStaticLegacyCode(); |
67 | 67 | $hook->deleteBookMetadata($path); |
68 | 68 | } |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | - private function getBookIdforPath($dir, $filename){ |
|
153 | + private function getBookIdforPath($dir, $filename) { |
|
154 | 154 | if (!empty($filename)) { |
155 | 155 | $path = $dir . '/' . $filename; |
156 | 156 | |
157 | 157 | $fileInfo = $this->view->getFileInfo($path); |
158 | - if($fileInfo && $bookId = $this->paperHiveMetadata->getBookID($fileInfo['fileid'])) { |
|
158 | + if ($fileInfo && $bookId = $this->paperHiveMetadata->getBookID($fileInfo['fileid'])) { |
|
159 | 159 | return $bookId; |
160 | 160 | } |
161 | 161 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | // Save the file |
244 | 244 | $title = $paperHiveObject['metadata']['title']; |
245 | 245 | $filename = $title . $this->paperhive_file_extension; |
246 | - if($dir == '/') { |
|
246 | + if ($dir == '/') { |
|
247 | 247 | $path = $dir . $filename; |
248 | 248 | } else { |
249 | 249 | $path = $dir . '/' . $filename; |
@@ -251,26 +251,26 @@ discard block |
||
251 | 251 | |
252 | 252 | $exists = $this->view->file_exists($path); |
253 | 253 | if ($exists) { |
254 | - $message = (string) $this->l->t('The file already exists.'); |
|
254 | + $message = (string)$this->l->t('The file already exists.'); |
|
255 | 255 | return new DataResponse(['message' => $message], Http::STATUS_BAD_REQUEST); |
256 | 256 | } |
257 | 257 | |
258 | 258 | try { |
259 | 259 | $created = $this->view->touch($path); |
260 | - if(!$created) { |
|
261 | - $message = (string) $this->l->t('Could not save document.'); |
|
260 | + if (!$created) { |
|
261 | + $message = (string)$this->l->t('Could not save document.'); |
|
262 | 262 | return new DataResponse(['message' => $message], Http::STATUS_BAD_REQUEST); |
263 | 263 | } |
264 | 264 | |
265 | 265 | $fileInfo = $this->view->getFileInfo($path); |
266 | 266 | $inserted = $this->paperHiveMetadata->insertBookID($fileInfo['fileid'], $bookID); |
267 | - if(!$inserted) { |
|
267 | + if (!$inserted) { |
|
268 | 268 | $this->view->unlink($path); |
269 | - $message = (string) $this->l->t('Could not save document metadata.'); |
|
269 | + $message = (string)$this->l->t('Could not save document metadata.'); |
|
270 | 270 | return new DataResponse(['message' => $message], Http::STATUS_BAD_REQUEST); |
271 | 271 | } |
272 | 272 | } catch (LockedException $e) { |
273 | - $message = (string) $this->l->t('The file is locked.'); |
|
273 | + $message = (string)$this->l->t('The file is locked.'); |
|
274 | 274 | return new DataResponse(['message' => $message], Http::STATUS_BAD_REQUEST); |
275 | 275 | } catch (ForbiddenException $e) { |
276 | 276 | return new DataResponse(['message' => $e->getMessage()], Http::STATUS_BAD_REQUEST); |