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 ...@@ -113,6 +113,21 @@ $string['newfiltersdescription'] = 'If you have downloaded a new set of HTML fil
$string['filtersinstalled'] = 'Filters installed.'; $string['filtersinstalled'] = 'Filters installed.';
$string['nofiltersinstalled'] = 'No html 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 // Site options
$string['adminsonly'] = 'Administrators only'; $string['adminsonly'] = 'Administrators only';
$string['allowpublicviews'] = 'Allow public views'; $string['allowpublicviews'] = 'Allow public views';
......
...@@ -16,11 +16,13 @@ require_once('pieforms/pieform.php'); ...@@ -16,11 +16,13 @@ require_once('pieforms/pieform.php');
* @ingroup Registration * @ingroup Registration
*/ */
function register_site() { function register_site() {
$strfield = get_string('Field', 'admin');
$strvalue = get_string('Value', 'admin');
$info = <<<EOF $info = <<<EOF
<table> <table>
<tr> <tr>
<th>Field</th> <th>$strfield</th>
<th>Value</th> <th>$strvalue</th>
</tr> </tr>
EOF; EOF;
$data = registration_data(); $data = registration_data();
...@@ -35,24 +37,24 @@ EOF; ...@@ -35,24 +37,24 @@ EOF;
'elements' => array( 'elements' => array(
'whatsent' => array( 'whatsent' => array(
'type' => 'fieldset', 'type' => 'fieldset',
'legend' => 'Data that will be sent', 'legend' => get_string('datathatwillbesent', 'admin'),
'collapsible' => true, 'collapsible' => true,
'collapsed' => true, 'collapsed' => true,
'elements' => array( 'elements' => array(
'info' => array( 'info' => array(
'type' => 'markup', 'type' => 'markup',
'value'=> $info 'value'=> $info,
), ),
) )
), ),
'sendweeklyupdates' => array( 'sendweeklyupdates' => array(
'type' => 'checkbox', 'type' => 'checkbox',
'title' => 'Send weekly updates?', 'title' => get_string('sendweeklyupdates', 'admin'),
'defaultvalue' => true 'defaultvalue' => true,
), ),
'register' => array( 'register' => array(
'type' => 'submit', 'type' => 'submit',
'value' => 'Register' 'value' => get_string('Register', 'admin'),
), ),
) )
); );
...@@ -74,16 +76,14 @@ function register_submit(Pieform $form, $values) { ...@@ -74,16 +76,14 @@ function register_submit(Pieform $form, $values) {
); );
$result = http_request($request); $result = http_request($request);
//TODO Translate needed
if ($result->data != '1') { if ($result->data != '1') {
log_debug($result); log_info($result);
$SESSION->add_error_msg('Registation failed with error code '. $result->info['http_code'] . '. Please try again later.'); $SESSION->add_error_msg(get_string('registrationfailedtrylater', 'admin', $result->info['http_code']));
} }
else { else {
set_config('registration_lastsent', strtotime('now')); set_config('registration_lastsent', strtotime('now'));
set_config('registration_sendweeklyupdates', $values['sendweeklyupdates']); set_config('registration_sendweeklyupdates', $values['sendweeklyupdates']);
$SESSION->add_ok_msg('Registation successful - thanks for registering!'); $SESSION->add_ok_msg(get_string('registrationsuccessfulthanksforregistering'));
} }
redirect('/admin/'); redirect('/admin/');
} }
......
...@@ -30,11 +30,8 @@ ...@@ -30,11 +30,8 @@
{if $register} {if $register}
<div class="message" id="register-site"> <div class="message" id="register-site">
<div> <div>
<h3>Register your Mahara Site</h3> <h3>{str tag=registeryourmaharasite section=admin}</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> {str tag=registeryourmaharasitedetail section=admin args=$WWWROOT}
<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>
{$register} {$register}
</div> </div>
</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