Commit 059ee0fb authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Tidied up the installer somewhat:

  - i18n
  - no more bumpitybump when each plugin is installed
  - success message is only shown on success
  - other fixes
parent 8ebd7842
......@@ -87,6 +87,7 @@ if (!empty($upgrade)) {
try {
$funname($upgrade);
$data['success'] = 1;
$data['install'] = $upgrade->install;
}
catch (Exception $e) {
$data['errormessage'] = $e->getMessage();
......@@ -98,5 +99,6 @@ else {
$data['errormessage'] = get_string('nothingtoupgrade','admin');
}
// @todo json_reply?
echo json_encode($data);
?>
......@@ -44,6 +44,7 @@ $successicon = theme_get_image_path('success.gif');
$failureicon = theme_get_image_path('failure.gif');
$loadingstring = get_string('upgradeloading', 'admin');
$installsuccessstring = get_string('installsuccess', 'admin');
$successstring = get_string('upgradesuccess', 'admin');
$failurestring = get_string('upgradefailure', 'admin');
......@@ -56,10 +57,11 @@ if (!empty($upgrades['core']->install)) {
$('coredata').innerHTML = '<img src="{$loadingicon}" alt="{$loadingstring}" />';
d.addCallback(function (data) {
d.addCallbacks(function (data) {
if ( data.success ) {
var message = 'Successfully installed core data';
$('coredata').innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
$('finished').style.visibility = 'visible';
}
else {
var message = '';
......@@ -71,10 +73,10 @@ if (!empty($upgrades['core']->install)) {
}
$('coredata').innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + message;
}
});
d.addErrback(function () {
}, function () {
$('coredata').innerHTML = '<img src="{$failureicon}" alt=":(" /> {$failurestring}';
});
EOJS;
}
else {
......@@ -88,7 +90,6 @@ $js .= <<< EOJS
if ( ! element ) {
// we're done
$installjs
$('finished').style.display = 'block';
return;
}
......@@ -96,9 +97,16 @@ $js .= <<< EOJS
$(element).innerHTML = '<img src="{$loadingicon}" alt="{$loadingstring}" />';
d.addCallback(function (data) {
d.addCallbacks(function (data) {
if ( data.success ) {
var message = '{$successstring}' + data.newversion;
var message;
if (data.install) {
message = '{$installsuccessstring}';
}
else {
message = '{$successstring}';
}
message += data.newversion;
$(data.key).innerHTML = '<img src="{$successicon}" alt=":)" /> ' + message;
}
else {
......@@ -112,8 +120,7 @@ $js .= <<< EOJS
$(data.key).innerHTML = '<img src="{$failureicon}" alt=":(" /> ' + message;
}
processNext();
});
d.addErrback(function () {
}, function () {
$(element).innerHTML = '<img src="{$failureicon}" alt=":(" /> {$failurestring}';
});
}
......
......@@ -32,12 +32,18 @@ institution uses another authentication type then they will be listed beside it.
<p>Did you want to <a href="institution.php">change the type of authentication for an institution</a>?</p>';
$string['authnoconfigurationoptions'] = 'No configuration options are available for this authentication type';
// Installer
$string['release'] = 'Release %s (%s)';
$string['component'] = 'Component or plugin';
$string['continue'] = 'Continue';
$string['coredata'] = 'core data';
$string['fromversion'] = 'From version';
$string['installsuccess'] = 'Successfully installed version ';
$string['toversion'] = 'To version';
$string['notinstalled'] = 'Not installed';
$string['nothingtoupgrade'] = 'Nothing to upgrade';
$string['successfullyinstalled'] = 'Successfully installed Mahara!';
$string['upgradeloading'] = 'Loading...';
$string['upgradesuccess'] = 'Successfully upgraded to version ';
$string['upgradefailure'] = 'Failed to upgrade!';
......
......@@ -26,9 +26,8 @@
defined('INTERNAL') || die();
// General form strings
$string['cancel'] = 'Cancel';
$string['sessiontimedout'] = 'Your session has timed out, please enter your login details to continue';
$string['sessiontimedoutpublic'] = 'Your session has timed out. You may <a href="?login">log in</a> to continue browsing';
$string['submit'] = 'Submit';
$string['nextpage'] = 'Next page';
......@@ -52,6 +51,8 @@ $string['passwordnotchanged'] = 'You did not change your password, please choose
$string['passwordsaved'] = 'Your new password has been saved';
$string['passwordsdonotmatch'] = 'The passwords do not match';
$string['passwordtooeasy'] = 'Your password is too easy! Please choose a harder password';
$string['sessiontimedout'] = 'Your session has timed out, please enter your login details to continue';
$string['sessiontimedoutpublic'] = 'Your session has timed out. You may <a href="?login">log in</a> to continue browsing';
$string['username'] = 'Username';
$string['usernamedesc'] = 'Your username';
$string['usernamehelp'] = 'The username you have been given to access this system.';
......
......@@ -15,3 +15,7 @@ div.content {
margin-bottom: 10px;
}
#footer {
font-size: smaller;
text-align: center;
}
@import url(wrapper.css);
@import url(pagelayout.css);
@import url(form.css);
@import url(table.css);
#installer tr {
height: 2em;
}
{include file='header.tpl'}
<a href="http://mahara.org">Mahara</a> {str section='admin' tag='release' args=$releaseargs}
Copyright &copy; 2006 onwards, Catalyst IT Ltd<br />
<a href="http://www.gnu.org/licenses/gpl.html">GNU Public License</a><br />
Copyright &copy; 2006 onwards, Catalyst IT Ltd<br>
<a href="http://www.gnu.org/licenses/gpl.html">GNU Public License</a><br>
<a href="{$WWWROOT}admin/upgrade.php">Agree</a>
{include file='footer.tpl'}
\ No newline at end of file
{include file='admin/upgradefooter.tpl'}
{include file='header.tpl'}
<table>
<table cellspacing="0" cellpadding="1" id="installer">
<tr>
<th>{str section=admin tag=component}</th>
<th>{str section=admin tag=fromversion}</th>
......@@ -23,5 +23,5 @@
</tr>
{/if}
</table>
<div id="finished" style="display: none;">All done! <a href="{$WWWROOT}">Continue</a> (FIXME: displays on errors)</div>
{include file='footer.tpl'}
<div id="finished" style="visibility: hidden;">{str section=admin tag=successfullyinstalled} <a href="{$WWWROOT}">{str section=admin tag=continue}</a></div>
{include file='admin/upgradefooter.tpl'}
<div id="footer"><a href="http://mahara.org/">Mahara</a> {str section=admin tag=release args=$releaseargs}<br>
&copy; 2006 onwards, <a href="http://catalyst.net.nz/">Catalyst IT Ltd</a></div>
</body>
</html>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment