Commit 3f083a12 authored by Andrew Robert Nicols's avatar Andrew Robert Nicols Committed by Richard Mansfield
Browse files

Admin configurable default country


Signed-off-by: default avatarAndrew Robert Nicols <andrew.nicols@luns.net.uk>
parent 9e62537c
...@@ -68,6 +68,14 @@ $siteoptionform = array( ...@@ -68,6 +68,14 @@ $siteoptionform = array(
'options' => $langoptions, 'options' => $langoptions,
'help' => true, 'help' => true,
), ),
'country' => array(
'type' => 'select',
'title' => get_string('country', 'admin'),
'description' => get_string('sitecountrydescription', 'admin'),
'defaultvalue' => 'nz',
'options' => getoptions_country(),
'help' => true,
),
'theme' => array( 'theme' => array(
'type' => 'select', 'type' => 'select',
'title' => get_string('theme', 'admin'), 'title' => get_string('theme', 'admin'),
......
...@@ -106,8 +106,7 @@ foreach ( $element_list as $element => $type ) { ...@@ -106,8 +106,7 @@ foreach ( $element_list as $element => $type ) {
} }
if ($element == 'country') { if ($element == 'country') {
$items[$element]['options'] = getoptions_country(); $items[$element]['options'] = getoptions_country();
// @todo configure default country somehow... $items[$element]['defaultvalue'] = get_config('country') ? get_config('country') : 'nz';
$items[$element]['defaultvalue'] = 'nz';
} }
if (get_helpfile_location('artefact', 'internal', 'profileform', $element)) { if (get_helpfile_location('artefact', 'internal', 'profileform', $element)) {
...@@ -131,6 +130,7 @@ if ($items['firstname']) { ...@@ -131,6 +130,7 @@ if ($items['firstname']) {
$items['firstname']['autofocus'] = true; $items['firstname']['autofocus'] = true;
} }
// build form elements // build form elements
$elements = array( $elements = array(
'topsubmit' => array( 'topsubmit' => array(
......
...@@ -809,7 +809,7 @@ function auth_check_required_fields() { ...@@ -809,7 +809,7 @@ function auth_check_required_fields() {
} }
if ($field == 'country') { if ($field == 'country') {
$elements[$field]['options'] = getoptions_country(); $elements[$field]['options'] = getoptions_country();
$elements[$field]['defaultvalue'] = 'nz'; $elements[$field]['defaultvalue'] = get_config('country') ? get_config('country') : 'nz';
} }
if ($field == 'email') { if ($field == 'email') {
......
...@@ -164,6 +164,7 @@ $string['institutionautosuspenddescription'] = 'If checked, expired institutions ...@@ -164,6 +164,7 @@ $string['institutionautosuspenddescription'] = 'If checked, expired institutions
$string['institutionexpirynotification'] = 'Warning time for institution expiry'; $string['institutionexpirynotification'] = 'Warning time for institution expiry';
$string['institutionexpirynotificationdescription'] = 'A notification message will be sent to site and institutional admins the long before a site expires'; $string['institutionexpirynotificationdescription'] = 'A notification message will be sent to site and institutional admins the long before a site expires';
$string['language'] = 'Language'; $string['language'] = 'Language';
$string['country'] = 'Country';
$string['pathtoclam'] = 'Path to clam'; $string['pathtoclam'] = 'Path to clam';
$string['pathtoclamdescription'] = 'The filesystem path to clamscan or clamdscan'; $string['pathtoclamdescription'] = 'The filesystem path to clamscan or clamdscan';
$string['searchplugin'] = 'Search plugin'; $string['searchplugin'] = 'Search plugin';
...@@ -177,6 +178,7 @@ $string['showtagssideblock'] = 'Enable Tag Cloud'; ...@@ -177,6 +178,7 @@ $string['showtagssideblock'] = 'Enable Tag Cloud';
$string['showtagssideblockdescription'] = 'If enabled, users will see a side block in the My Portfolio section of the site with a list of their most frequently used tags'; $string['showtagssideblockdescription'] = 'If enabled, users will see a side block in the My Portfolio section of the site with a list of their most frequently used tags';
$string['sitedefault'] = 'Site Default'; $string['sitedefault'] = 'Site Default';
$string['sitelanguagedescription'] = 'The default language for the site'; $string['sitelanguagedescription'] = 'The default language for the site';
$string['sitecountrydescription'] = 'The default country for the site';
$string['sitename'] = 'Site name'; $string['sitename'] = 'Site name';
$string['sitenamedescription'] = 'The site name appears in certain places around the site and in e-mails sent from the site'; $string['sitenamedescription'] = 'The site name appears in certain places around the site and in e-mails sent from the site';
$string['siteoptionspagedescription'] = 'Here you can set some global options that will apply by default throughout the entire site.'; $string['siteoptionspagedescription'] = 'Here you can set some global options that will apply by default throughout the entire site.';
......
<h3>Country</h3>
<p>The country selected will be the default for country selections throughout your Mahara installation.</p>
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