diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-13 17:25:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 17:25:51 +0200 |
commit | 14314584ba88ed8d8a7c8486b61c6677a14271f2 (patch) | |
tree | a24439cf1b1c243318532322d52d89fe4530fc47 /apps | |
parent | 1801e4e03f3a0b5ef253d67c13702b0fa22578a3 (diff) | |
parent | ca6094f3900fd463449d9973589b1d49aed28b2a (diff) | |
download | nextcloud-server-14314584ba88ed8d8a7c8486b61c6677a14271f2.tar.gz nextcloud-server-14314584ba88ed8d8a7c8486b61c6677a14271f2.zip |
Merge pull request #10110 from nextcloud/feature/100500/whats-new-info-users
Display What's New info to users
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/css/merged.scss | 1 | ||||
-rw-r--r-- | apps/files/js/app.js | 2 | ||||
-rw-r--r-- | apps/updatenotification/lib/Settings/Admin.php | 33 |
3 files changed, 9 insertions, 27 deletions
diff --git a/apps/files/css/merged.scss b/apps/files/css/merged.scss index d65bac512f1..8a11e55c269 100644 --- a/apps/files/css/merged.scss +++ b/apps/files/css/merged.scss @@ -2,3 +2,4 @@ @import 'upload.scss'; @import 'mobile.scss'; @import 'detailsView.scss'; +@import '../../../core/css/whatsnew.scss'; diff --git a/apps/files/js/app.js b/apps/files/js/app.js index 52c92645b2d..c2cef563fa0 100644 --- a/apps/files/js/app.js +++ b/apps/files/js/app.js @@ -133,6 +133,8 @@ }); this._debouncedPersistShowHiddenFilesState = _.debounce(this._persistShowHiddenFilesState, 1200); + + OCP.WhatsNew.query(); // for Nextcloud server }, /** diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php index b859ca79f62..cae62ee0a9f 100644 --- a/apps/updatenotification/lib/Settings/Admin.php +++ b/apps/updatenotification/lib/Settings/Admin.php @@ -123,39 +123,18 @@ class Admin implements ISettings { return $filtered; } - $isFirstCall = true; + $iterator = $this->l10nFactory->getLanguageIterator(); do { - $lang = $this->l10nFactory->iterateLanguage($isFirstCall); - if($this->findWhatsNewTranslation($lang, $filtered, $changes['whatsNew'])) { - return $filtered; + $lang = $iterator->current(); + if(isset($changes['whatsNew'][$lang])) { + return $filtered['whatsNew'][$lang]; } - $isFirstCall = false; - } while($lang !== 'en'); + $iterator->next(); + } while($lang !== 'en' && $iterator->valid()); return $filtered; } - protected function getLangTrunk(string $lang):string { - $pos = strpos($lang, '_'); - if($pos !== false) { - $lang = substr($lang, 0, $pos); - } - return $lang; - } - - protected function findWhatsNewTranslation(string $lang, array &$result, array $whatsNew): bool { - if(isset($whatsNew[$lang])) { - $result['whatsNew'] = $whatsNew[$lang]; - return true; - } - $trunkedLang = $this->getLangTrunk($lang); - if($trunkedLang !== $lang && isset($whatsNew[$trunkedLang])) { - $result['whatsNew'] = $whatsNew[$trunkedLang]; - return true; - } - return false; - } - /** * @param array $groupIds * @return array |