Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ The First run wizard can be customized to meet specific design goals, or to chan
</description>

<licence>AGPL</licence>
<author>Frank Karlitschek, Jan-Christoph Borchardt</author>
<author>Frank Karlitschek</author>
<author>Jan-Christoph Borchardt</author>

<dependencies>
<nextcloud min-version="13" max-version="13" />
Expand All @@ -18,6 +19,10 @@ The First run wizard can be customized to meet specific design goals, or to chan
</types>

<namespace>FirstRunWizard</namespace>
<version>2.2.0</version>
<version>2.2.1</version>
<default_enable/>

<settings>
<personal>OCA\FirstRunWizard\Settings\Personal</personal>
</settings>
</info>
10 changes: 0 additions & 10 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ protected function registerScripts() {
$jobList->add('OCA\FirstRunWizard\Notification\BackgroundJob', ['uid' => $userSession->getUser()->getUID()]);
}
});

/** @var IRequest $request */
$request = $this->getContainer()->query(IRequest::class);
// Allow to enable the first run wizard with the button on the personal page
if (strpos($request->getPathInfo(), '/settings/personal') === 0) {
Util::addStyle('firstrunwizard', 'colorbox');
Util::addStyle('firstrunwizard', 'firstrunwizard');
Util::addScript('firstrunwizard', 'jquery.colorbox');
Util::addScript('firstrunwizard', 'firstrunwizard');
}
}

protected function registerNotificationNotifier() {
Expand Down
85 changes: 85 additions & 0 deletions lib/Settings/Personal.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?php
/**
* @copyright Copyright (c) 2017 Arthur Schiwon <[email protected]>
*
* @author Arthur Schiwon <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

namespace OCA\FirstRunWizard\Settings;


use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\Settings\ISettings;

class Personal implements ISettings {

/** @var IConfig */
private $config;
/** @var \OC_Defaults */
private $defaults;

public function __construct(IConfig $config, \OC_Defaults $defaults) {
$this->config = $config;
$this->defaults = $defaults;
}

/**
* @return TemplateResponse returns the instance with all parameters set, ready to be rendered
* @since 9.1
*/
public function getForm() {
$parameters = [ 'clients' => $this->getClientLinks() ];
return new TemplateResponse('firstrunwizard', 'personal-settings', $parameters);
}

/**
* @return string the section ID, e.g. 'sharing'
* @since 9.1
*/
public function getSection() {
return 'sync-clients';
}

/**
* @return int whether the form should be rather on the top or bottom of
* the admin section. The forms are arranged in ascending order of the
* priority values. It is required to return a value between 0 and 100.
*
* E.g.: 70
* @since 9.1
*/
public function getPriority() {
return 20;
}

/**
* returns an array containing links to the various clients
*
* @return array
*/
private function getClientLinks() {
$clients = [
'desktop' => $this->config->getSystemValue('customclient_desktop', $this->defaults->getSyncClientUrl()),
'android' => $this->config->getSystemValue('customclient_android', $this->defaults->getAndroidClientUrl()),
'ios' => $this->config->getSystemValue('customclient_ios', $this->defaults->getiOSClientUrl())
];
return $clients;
}
}
58 changes: 58 additions & 0 deletions templates/personal-settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* @copyright Copyright (c) 2017 Arthur Schiwon <[email protected]>
*
* @author Arthur Schiwon <[email protected]>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

/** @var array $_ */
style('firstrunwizard', ['colorbox', 'firstrunwizard']);
script('firstrunwizard', ['jquery.colorbox', 'firstrunwizard']);
?>

<div id="clientsbox" class="section clientsbox">
<h2><?php p($l->t('Get the apps to sync your files'));?></h2>
<a href="<?php p($_['clients']['desktop']); ?>" rel="noreferrer" target="_blank">
<img src="<?php print_unescaped(image_path('core', 'desktopapp.svg')); ?>"
alt="<?php p($l->t('Desktop client'));?>" />
</a>
<a href="<?php p($_['clients']['android']); ?>" rel="noreferrer" target="_blank">
<img src="<?php print_unescaped(image_path('core', 'googleplay.png')); ?>"
alt="<?php p($l->t('Android app'));?>" />
</a>
<a href="<?php p($_['clients']['ios']); ?>" rel="noreferrer" target="_blank">
<img src="<?php print_unescaped(image_path('core', 'appstore.svg')); ?>"
alt="<?php p($l->t('iOS app'));?>" />
</a>

<p>
<?php print_unescaped(str_replace(
[
'{contributeopen}',
'{linkclose}',
],
[
'<a href="https://nextcloud.com/contribute" target="_blank" rel="noreferrer">',
'</a>',
],
$l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?>
</p>

<p><a class="button" href="#" id="showWizard"><?php p($l->t('Show First Run Wizard again'));?></a></p>
</div>
4 changes: 2 additions & 2 deletions templates/wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
<a target="_blank" class="button" href="<?php p(link_to_docs('user-sync-calendars')) ?>">
<img class="appsmall appsmall-calendar svg" alt=""
src="<?php p(image_path('core', 'places/calendar-dark.svg')); ?>" />
<?php p($l->t('Connect your Calendar'));?>
<?php p($l->t('Connect your calendar'));?>
</a>
<a target="_blank" class="button" href="<?php p(link_to_docs('user-sync-contacts')) ?>">
<img class="appsmall appsmall-contacts svg" alt=""
src="<?php p(image_path('core', 'places/contacts-dark.svg')); ?>" />
<?php p($l->t('Connect your Contacts'));?>
<?php p($l->t('Connect your contacts'));?>
</a>
<a target="_blank" class="button" href="<?php p(link_to_docs('user-webdav')); ?>">
<img class="appsmall svg" alt=""
Expand Down