aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-11-26 18:15:10 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-12-04 14:14:38 +0100
commita8f2e6914d15e778889c65a4bff6441ead04ee13 (patch)
treeaf6a9c80381a81e7cd941fc2ec8f093566ad3010 /core
parent293585ec12b5fcfd028d5e9835cfc144b98dcaf3 (diff)
downloadnextcloud-server-a8f2e6914d15e778889c65a4bff6441ead04ee13.tar.gz
nextcloud-server-a8f2e6914d15e778889c65a4bff6441ead04ee13.zip
Add checkbox to install recommended apps during setup
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
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>