diff options
-rwxr-xr-x | appinfo/routes.php | 6 | ||||
-rwxr-xr-x | lib/Controller/NoteController.php | 24 | ||||
m--------- | templates/CarnetElectron | 0 |
3 files changed, 24 insertions, 6 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php index 73e03e0..37ab09e 100755 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -50,9 +50,9 @@ return [ ['name' => 'note#deleteNote', 'url' => '/notes', 'verb' => 'DELETE'], ['name' => 'note#search', 'url' => '/notes/search', 'verb' => 'GET'], ['name' => 'note#getSearchCache', 'url' => '/notes/getSearchCache', 'verb' => 'GET'], - ['name' => 'note#getUbuntuFont', 'url' => 'templates/CarnetElectron/fonts/ubuntu.woff2', 'verb' => 'GET' ], - ['name' => 'note#getMaterialFont', 'url' => 'templates/CarnetElectron/fonts/material-icons.woff2', 'verb' => 'GET' ], - + ['name' => 'note#getUbuntuFont', 'url' => '/templates/CarnetElectron/fonts/ubuntu.woff2', 'verb' => 'GET' ], + ['name' => 'note#getMaterialFont', 'url' => '/templates/CarnetElectron/fonts/material-icons.woff2', 'verb' => 'GET' ], + ['name' => 'note#getChangelog', 'url' => '/settings/changelog', 'verb' => 'GET' ], ] ];
\ No newline at end of file diff --git a/lib/Controller/NoteController.php b/lib/Controller/NoteController.php index 0431e47..0606a8e 100755 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/NoteController.php @@ -1,6 +1,7 @@ <?php namespace OCA\Carnet\Controller; use Exception; + use OCP\App; use OCP\IRequest; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\FileDisplayResponse; @@ -161,12 +162,29 @@ * @NoAdminRequired * @NoCSRFRequired */ - public function getKeywordsDB() { + public function getChangelog() { - - return json_decode($this->getKeywordsDBFile()->getContent(),true); + $changelog = file_get_contents(__DIR__."/../../CHANGELOG.md"); + $current = App::getAppInfo($this->appName)['version']; + $last = $this->Config->getUserValue($this->userId, $this->appName, "last_changelog_version"); + if($last !== $current){ + $this->Config->setUserValue($this->userId, $this->appName, "last_changelog_version", $current); + } + $result = array(); + $result['changelog'] = $changelog; + $result['shouldDisplayChangelog'] = $last !== $current; + return $result; } + /** + * @NoAdminRequired + * @NoCSRFRequired + */ + public function getKeywordsDB() { + + return json_decode($this->getKeywordsDBFile()->getContent(),true); + } + private function getKeywordsDBFile(){ try { return $this->CarnetFolder->get("quickdoc/keywords/keywordsnc"); diff --git a/templates/CarnetElectron b/templates/CarnetElectron -Subproject 5eb62a4fad50f089bc247ff0bf353d7cc7af793 +Subproject d6f26fb2fd77a405fc2331a0c5d34fc664c8993 |