]> source.dussan.org Git - nextcloud-server.git/commitdiff
Read version and product name from update template
authorVincent Petry <pvince81@owncloud.com>
Wed, 14 Jan 2015 10:31:42 +0000 (11:31 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Mon, 2 Mar 2015 10:39:23 +0000 (11:39 +0100)
During upgrade, the config settings aren't always available due to
base.php changes. This fix makes the update info page read the product
name and version from the update template, which already had them.

core/js/update.js
core/templates/update.admin.php

index e5ce322df9587baf9597b55393bf78e565de9d63..29397b2662542f8e79ee7b15ad1ff3271822f6c4 100644 (file)
@@ -17,7 +17,7 @@
                 *
                 * @param $el progress list element
                 */
-               start: function($el) {
+               start: function($el, options) {
                        if (this._started) {
                                return;
                        }
@@ -28,8 +28,8 @@
                        this.addMessage(t(
                                'core',
                                'Updating {productName} to version {version}, this may take a while.', {
-                                       productName: OC.theme.name || 'ownCloud',
-                                       version: OC.config.versionstring
+                                       productName: options.productName || 'ownCloud',
+                                       version: options.version
                                }),
                                'bold'
                        ).append('<br />'); // FIXME: these should be ul/li with CSS paddings!
 
 $(document).ready(function() {
        $('.updateButton').on('click', function() {
+               var $updateEl = $('.update');
                var $progressEl = $('.updateProgress');
                $progressEl.removeClass('hidden');
                $('.updateOverview').addClass('hidden');
-               OC.Update.start($progressEl);
+               OC.Update.start($progressEl, {
+                       productName: $updateEl.attr('data-productname'),
+                       version: $updateEl.attr('data-version'),
+               });
                return false;
        });
 });
index 29df0dd484a2a92225e781a14fc264d0bd491f83..ccd5d236828885ecd7f0d49d46b765283468b0f8 100644 (file)
@@ -1,4 +1,4 @@
-<div class="update">
+<div class="update" data-productname="<?php p($_['productName']) ?>" data-version="<?php p($_['version']) ?>">
        <div class="updateOverview">
                <h2 class="title bold"><?php p($l->t('%s will be updated to version %s.',
                        array($_['productName'], $_['version']))); ?></h2>