summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-12-04 19:41:54 +0100
committerGitHub <noreply@github.com>2019-12-04 19:41:54 +0100
commitb0a702897877b0fde58b3eb6a0416a888a6c15c2 (patch)
treeeda9fa9901596ecd9b7d47d7d7acd43cfc96bd3b /core
parent592cc07b30a242b9e85c65839da613f0eb1a45ca (diff)
parenta8f2e6914d15e778889c65a4bff6441ead04ee13 (diff)
downloadnextcloud-server-b0a702897877b0fde58b3eb6a0416a888a6c15c2.tar.gz
nextcloud-server-b0a702897877b0fde58b3eb6a0416a888a6c15c2.zip
Merge pull request #18121 from nextcloud/feature/setup-install-recommended-apps
Add checkbox to install recommended apps during setup
Diffstat (limited to 'core')
-rw-r--r--core/Controller/SetupController.php11
-rw-r--r--core/js/setup.js2
-rw-r--r--core/templates/installation.php9
3 files changed, 18 insertions, 4 deletions
diff --git a/core/Controller/SetupController.php b/core/Controller/SetupController.php
index 3dd02fc31dc..fd0a6895471 100644
--- a/core/Controller/SetupController.php
+++ b/core/Controller/SetupController.php
@@ -31,6 +31,7 @@ namespace OC\Core\Controller;
use OC\Setup;
use OCP\ILogger;
+use function urlencode;
class SetupController {
/** @var Setup */
@@ -76,7 +77,7 @@ class SetupController {
$options = array_merge($opts, $post, $errors);
$this->display($options);
} else {
- $this->finishSetup();
+ $this->finishSetup(isset($post['install-recommended-apps']));
}
} else {
$options = array_merge($opts, $post);
@@ -105,7 +106,7 @@ class SetupController {
\OC_Template::printGuestPage('', 'installation', $parameters);
}
- public function finishSetup() {
+ private function finishSetup(bool $installRecommended) {
if( file_exists( $this->autoConfigFile )) {
unlink($this->autoConfigFile);
}
@@ -117,6 +118,12 @@ class SetupController {
}
}
+ if ($installRecommended) {
+ $urlGenerator = \OC::$server->getURLGenerator();
+ $location = $urlGenerator->getAbsoluteURL('/index.php/settings/apps/recommended?download&returnTo=' . urlencode(\OC_Util::getDefaultPageUrl()));
+ header('Location: ' . $location);
+ exit();
+ }
\OC_Util::redirectToDefaultPage();
}
diff --git a/core/js/setup.js b/core/js/setup.js
index 5b0bd679dbe..eb41795e427 100644
--- a/core/js/setup.js
+++ b/core/js/setup.js
@@ -41,8 +41,6 @@ $(document).ready(function() {
$('#dbname').attr('pattern','[0-9a-zA-Z$_-.]+');
});
- $('input[checked]').trigger('click');
-
$('#showAdvanced').click(function(e) {
e.preventDefault();
$('#datadirContent').slideToggle(250);
diff --git a/core/templates/installation.php b/core/templates/installation.php
index de9427a74d8..bdc06c54086 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -158,6 +158,15 @@ script('core', [
</fieldset>
<?php endif ?>
+ <fieldset>
+ <p class="info">
+ <input type="checkbox" id="install-recommended-apps" name="install-recommended-apps" class="checkbox checkbox--white" checked>
+ <label for="install-recommended-apps">
+ <?php p($l->t( 'Install recommended apps' )); ?>
+ </label>
+ </p>
+ </fieldset>
+
<div class="icon-loading-dark float-spinner">&nbsp;</div>
<div class="buttons"><input type="submit" class="primary" value="<?php p($l->t( 'Finish setup' )); ?>" data-finishing="<?php p($l->t( 'Finishing …' )); ?>"></div>