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

github.com/nextcloud/firstrunwizard.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-12-03 12:54:59 +0300
committerJulius Härtl <jus@bitgrid.net>2019-12-04 19:44:03 +0300
commitf31a57cb963611ea1d6d32e886d43a35e263426a (patch)
tree3f7c374a86c5149386df9ac7afd6cd03e45c8aef /lib
parentcdd6696a4404fab480f2eeb977fd3351f60ab3c4 (diff)
Add video intro to the wizard
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/AppInfo/Application.php19
-rw-r--r--lib/Controller/WizardController.php1
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
index 014c4c6b..920db173 100644
--- a/lib/AppInfo/Application.php
+++ b/lib/AppInfo/Application.php
@@ -23,12 +23,16 @@
namespace OCA\FirstRunWizard\AppInfo;
+use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\FirstRunWizard\Notification\AppHint;
use OCA\FirstRunWizard\Notification\Notifier;
use OCP\AppFramework\App;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\EventDispatcher\IEventDispatcher;
use OCP\IConfig;
+use OCP\IInitialStateService;
use OCP\IL10N;
+use OCP\IServerContainer;
use OCP\IUser;
use OCP\IUserSession;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -51,15 +55,17 @@ class Application extends App {
}
protected function registerScripts() {
- /** @var EventDispatcherInterface $dispatcher */
- $dispatcher = $this->getContainer()->getServer()->getEventDispatcher();
+ /** @var IServerContainer $server */
+ $server = $this->getContainer()->getServer();
+ /** @var IEventDispatcher $dispatcher */
+ $dispatcher = $server->query(IEventDispatcher::class);
$dispatcher->addListener(TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS_LOGGEDIN, function() {
\OC_Util::addScript('firstrunwizard', 'about');
});
// Display the first run wizard only on the files app,
- $dispatcher->addListener('OCA\Files::loadAdditionalScripts', function() {
+ $dispatcher->addListener(LoadAdditionalScriptsEvent::class, function() use ($server) {
/** @var IUserSession $userSession */
$userSession = $this->getContainer()->query(IUserSession::class);
$user = $userSession->getUser();
@@ -75,6 +81,13 @@ class Application extends App {
if ($config->getUserValue($user->getUID(), 'firstrunwizard', 'show', '1') !== '0') {
\OC_Util::addScript('firstrunwizard', 'activate');
+ /** @var IInitialStateService $initialState */
+ $initialState = $server->query(IInitialStateService::class);
+ $initialState->provideLazyInitialState('firstrunwizard', 'hasVideo', function () use ($server) {
+ $userHome = $server->getUserFolder();
+ return $userHome->nodeExists('/Nextcloud intro.mp4');
+ });
+
$jobList = $this->getContainer()->getServer()->getJobList();
$jobList->add('OCA\FirstRunWizard\Notification\BackgroundJob', ['uid' => $userSession->getUser()->getUID()]);
}
diff --git a/lib/Controller/WizardController.php b/lib/Controller/WizardController.php
index 130af06a..ff36c096 100644
--- a/lib/Controller/WizardController.php
+++ b/lib/Controller/WizardController.php
@@ -84,7 +84,6 @@ class WizardController extends Controller {
];
$slides = [
- $this->staticSlide('page.intro', $data),
$this->staticSlide('page.values', $data)
];
if ($this->groupManager->isAdmin($this->userId)) {