Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2019-04-26 19:39:46 +0300
committerPhie <phie@phie.ovh>2019-04-26 19:39:46 +0300
commita5286ba8d1b694d177a71f7fa5dd56a678af2d6c (patch)
tree10dc716d50c3eb59c291f3231b79fb11d1d1f175 /lib
parent2df6a769a6975c13f0641c833960975ae9328ce6 (diff)
now working with owncloudv0.15.3
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Controller/NoteController.php5
-rwxr-xr-xlib/Controller/PageController.php4
-rw-r--r--lib/Settings/AdminSettings.php65
3 files changed, 38 insertions, 36 deletions
diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php
index c67017f..f85c0bb 100755
--- a/lib/Controller/NoteController.php
+++ b/lib/Controller/NoteController.php
@@ -713,7 +713,8 @@
$folder = $cache->get("currentnote".$id);
$data = $folder->get("data");
$f = $data->get($media);
- $r = new FileDisplayResponse($f);
+ $r = new DataDisplayResponse($f->getContent());
+
$r->addHeader("Content-Disposition", "attachment");
$r->addHeader("Content-Type", $f->getMimeType());
@@ -738,6 +739,8 @@
if($tmph){
try{
$this->CarnetFolder->get($path)->delete();
+ $file = $this->CarnetFolder->newFile($path);
+
} catch(\OCP\Files\NotFoundException $e) {
}
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php
index 5e2ca6c..163f02e 100755
--- a/lib/Controller/PageController.php
+++ b/lib/Controller/PageController.php
@@ -9,12 +9,10 @@ use OCP\AppFramework\Controller;
class PageController extends Controller {
private $userId;
- private $RootFolder;
private $config;
- public function __construct($AppName, IRequest $request, $UserId, $RootFolder, $Config){
+ public function __construct($AppName, IRequest $request, $UserId, $Config){
parent::__construct($AppName, $request);
$this->userId = $UserId;
- $this->RootFolder = $RootFolder;
$this->config = $Config;
}
diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php
index 03d27dc..ce8706b 100644
--- a/lib/Settings/AdminSettings.php
+++ b/lib/Settings/AdminSettings.php
@@ -26,43 +26,44 @@ namespace OCA\Carnet\Settings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\ISettings;
+if (method_exists(\OC::$server, "getContentSecurityPolicyNonceManager")){
+ class AdminSettings implements ISettings {
-class AdminSettings implements ISettings {
+ /** @var IConfig */
+ private $config;
- /** @var IConfig */
- private $config;
+ /**
+ * AdminSettings constructor.
+ *
+ * @param IConfig $config
+ */
+ public function __construct(IConfig $config) {
+ $this->config = $config;
+ }
- /**
- * AdminSettings constructor.
- *
- * @param IConfig $config
- */
- public function __construct(IConfig $config) {
- $this->config = $config;
- }
-
- /**
- * @return TemplateResponse
- */
- public function getForm() {
- $parameters = [
- 'carnet_display_fullscreen' => $this->config->getAppValue('carnet', 'carnetDisplayFullscreen', 'no'),
- ];
+ /**
+ * @return TemplateResponse
+ */
+ public function getForm() {
+ $parameters = [
+ 'carnet_display_fullscreen' => $this->config->getAppValue('carnet', 'carnetDisplayFullscreen', 'no'),
+ ];
- return new TemplateResponse('carnet', 'settings/settings-admin', $parameters);
- }
+ return new TemplateResponse('carnet', 'settings/settings-admin', $parameters);
+ }
- /**
- * @return string
- */
- public function getSection() {
- return 'additional';
- }
+ /**
+ * @return string
+ */
+ public function getSection() {
+ return 'additional';
+ }
- /**
- * @return int
- */
- public function getPriority() {
- return 20;
+ /**
+ * @return int
+ */
+ public function getPriority() {
+ return 20;
+ }
}
} \ No newline at end of file