Commit 4626fa2c authored by Nigel McNie's avatar Nigel McNie
Browse files

i18n for Registration button.

parent 2070cc59
......@@ -113,6 +113,21 @@ $string['newfiltersdescription'] = 'If you have downloaded a new set of HTML fil
$string['filtersinstalled'] = 'Filters installed.';
$string['nofiltersinstalled'] = 'No html filters installed.';
// Register your Mahara
$string['Field'] = 'Field';
$string['Value'] = 'Value';
$string['datathatwillbesent'] = 'Data that will be sent';
$string['sendweeklyupdates'] = 'Send weekly updates?';
$string['Register'] = 'Register';
$string['registrationfailedtrylater'] = 'Registation failed with error code %s. Please try again later.';
$string['registrationsuccessfulthanksforregistering'] = 'Registation successful - thanks for registering!';
$string['registeryourmaharasite'] = 'Register your Mahara Site';
$string['registeryourmaharasitedetail'] = '
<p>You can choose to register your Mahara Site with <a href="http://mahara.org/">mahara.org</a>. Registration is free, and helps us build up a picture of the Mahara installation base around the world.</p>
<p>You can see the information that will be sent to mahara.org - nothing that can personally identify any of your users will be sent.</p>
<p>If you tick &quot;send weekly updates&quot;, Mahara will automatically send an update to mahara.org once a week with your updated information.</p>
<p>Registering will remove this notice. You will be able to change whether you send weekly updates on the <a href="%sadmin/site/options.php">site options</a> page.</p>';
// Site options
$string['adminsonly'] = 'Administrators only';
$string['allowpublicviews'] = 'Allow public views';
......
......@@ -16,11 +16,13 @@ require_once('pieforms/pieform.php');
* @ingroup Registration
*/
function register_site() {
$strfield = get_string('Field', 'admin');
$strvalue = get_string('Value', 'admin');
$info = <<<EOF
<table>
<tr>
<th>Field</th>
<th>Value</th>
<th>$strfield</th>
<th>$strvalue</th>
</tr>
EOF;
$data = registration_data();
......@@ -35,24 +37,24 @@ EOF;
'elements' => array(
'whatsent' => array(
'type' => 'fieldset',
'legend' => 'Data that will be sent',
'legend' => get_string('datathatwillbesent', 'admin'),
'collapsible' => true,
'collapsed' => true,
'elements' => array(
'info' => array(
'type' => 'markup',
'value'=> $info
'value'=> $info,
),
)
),
'sendweeklyupdates' => array(
'type' => 'checkbox',
'title' => 'Send weekly updates?',
'defaultvalue' => true
'title' => get_string('sendweeklyupdates', 'admin'),
'defaultvalue' => true,
),
'register' => array(
'type' => 'submit',
'value' => 'Register'
'value' => get_string('Register', 'admin'),
),
)
);
......@@ -74,16 +76,14 @@ function register_submit(Pieform $form, $values) {
);
$result = http_request($request);
//TODO Translate needed
if ($result->data != '1') {
log_debug($result);
$SESSION->add_error_msg('Registation failed with error code '. $result->info['http_code'] . '. Please try again later.');
log_info($result);
$SESSION->add_error_msg(get_string('registrationfailedtrylater', 'admin', $result->info['http_code']));
}
else {
set_config('registration_lastsent', strtotime('now'));
set_config('registration_sendweeklyupdates', $values['sendweeklyupdates']);
$SESSION->add_ok_msg('Registation successful - thanks for registering!');
$SESSION->add_ok_msg(get_string('registrationsuccessfulthanksforregistering'));
}
redirect('/admin/');
}
......
......@@ -30,11 +30,8 @@
{if $register}
<div class="message" id="register-site">
<div>
<h3>Register your Mahara Site</h3>
<p>You can choose to register your Mahara Site with <a href="http://mahara.org/">mahara.org</a>. Registration is free, and helps us build up a picture of the Mahara installation base around the world.</p>
<p>You can see the information that will be sent to mahara.org - nothing that can personally identify any of your users will be sent.</p>
<p>If you tick &quot;send weekly updates&quot;, Mahara will automatically send an update to mahara.org once a week with your updated information.</p>
<p>Registering will remove this notice. You will be able to change whether you send weekly updates on the <a href="{$WWWROOT}admin/site/options.php">site options</a> page.</p>
<h3>{str tag=registeryourmaharasite section=admin}</h3>
{str tag=registeryourmaharasitedetail section=admin args=$WWWROOT}
{$register}
</div>
</div>
......
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