diff --git a/appinfo/info.xml b/appinfo/info.xml index 3d50a28aa..66ef76462 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -7,7 +7,8 @@ The First run wizard can be customized to meet specific design goals, or to chan AGPL - Frank Karlitschek, Jan-Christoph Borchardt + Frank Karlitschek + Jan-Christoph Borchardt @@ -18,6 +19,10 @@ The First run wizard can be customized to meet specific design goals, or to chan FirstRunWizard - 2.2.0 + 2.2.1 + + + OCA\FirstRunWizard\Settings\Personal + diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index cfc11eda2..e8a462c8b 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -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() { diff --git a/lib/Settings/Personal.php b/lib/Settings/Personal.php new file mode 100644 index 000000000..cd519c97b --- /dev/null +++ b/lib/Settings/Personal.php @@ -0,0 +1,85 @@ + + * + * @author Arthur Schiwon + * + * @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 . + * + */ + +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; + } +} diff --git a/templates/personal-settings.php b/templates/personal-settings.php new file mode 100644 index 000000000..83ecdbd2e --- /dev/null +++ b/templates/personal-settings.php @@ -0,0 +1,58 @@ + + * + * @author Arthur Schiwon + * + * @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 . + * + */ + +/** @var array $_ */ +style('firstrunwizard', ['colorbox', 'firstrunwizard']); +script('firstrunwizard', ['jquery.colorbox', 'firstrunwizard']); +?> + +
+

t('Get the apps to sync your files'));?>

+ + <?php p($l->t('Desktop client'));?> + + + <?php p($l->t('Android app'));?> + + + <?php p($l->t('iOS app'));?> + + +

+ ', + '', + ], + $l->t('If you want to support the project {contributeopen}join development{linkclose} or {contributeopen}spread the word{linkclose}!'))); ?> +

+ +

t('Show First Run Wizard again'));?>

+
diff --git a/templates/wizard.php b/templates/wizard.php index 1e4258933..8006611a7 100644 --- a/templates/wizard.php +++ b/templates/wizard.php @@ -44,12 +44,12 @@ - t('Connect your Calendar'));?> + t('Connect your calendar'));?> - t('Connect your Contacts'));?> + t('Connect your contacts'));?>