Skip to content

Commit

Permalink
registration MDL-21715 temporary disable the region code (not done) a…
Browse files Browse the repository at this point in the history
…nd the image url fields (security purpose). Add help icons.
  • Loading branch information
mouneyrac committed May 3, 2010
1 parent 3ff6bd3 commit 4032415
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 9 deletions.
21 changes: 14 additions & 7 deletions admin/registration/forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public function definition() {
$options[SITELINKPUBLISHED] = $hub->get_site_privacy_string(SITELINKPUBLISHED);
$mform->addElement('select', 'privacy', get_string('siteprivacy', 'hub'), $options);
$mform->setDefault('privacy', $privacy);
$mform->addHelpButton('privacy', 'privacy', 'hub');
unset($options);

$mform->addElement('textarea', 'description', get_string('description'), array('rows'=>10));
Expand All @@ -199,15 +200,17 @@ public function definition() {
$mform->setDefault('address', $address);

//TODO: use the region array I generated
$mform->addElement('select', 'region', get_string('selectaregion'), array('-' => '-'));
$mform->setDefault('region', $region);
// $mform->addElement('select', 'region', get_string('selectaregion'), array('-' => '-'));
// $mform->setDefault('region', $region);
$mform->addElement('hidden', 'regioncode', '-');

$countries = get_string_manager()->get_list_of_countries();
$mform->addElement('select', 'country', get_string('selectacountry'), $countries);
$mform->setDefault('country', $country);
$mform->addElement('select', 'countrycode', get_string('selectacountry'), $countries);
$mform->setDefault('countrycode', $country);

$mform->addElement('text','geolocation' , get_string('geolocation'));
$mform->setDefault('geolocation', $geolocation);
$mform->addHelpButton('geolocation', 'geolocation', 'hub');

$mform->addElement('text', 'contactname', get_string('administrator'));
$mform->addRule('contactname', $strrequired, 'required', null, 'client');
Expand All @@ -216,6 +219,7 @@ public function definition() {

$mform->addElement('text','contactphone' , get_string('phone'));
$mform->setType('contactphone', PARAM_TEXT);
$mform->addHelpButton('contactphone', 'contactphone', 'hub');

$mform->addElement('text', 'contactemail', get_string('email'));
$mform->addRule('contactemail', $strrequired, 'required', null, 'client');
Expand All @@ -227,18 +231,21 @@ public function definition() {
$options[1] = get_string("registrationcontactyes");
$mform->addElement('select', 'contactable', get_string('registrationcontact'), $options);
$mform->setDefault('contactable', $contactable);
$mform->addHelpButton('contactable', 'contactable', 'hub');
unset($options);

$options = array();
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
$mform->addElement('select', 'emailalert', get_string('registrationemail'), $options);
$mform->setDefault('emailalert', $emailalert);
$mform->addHelpButton('emailalert', 'emailalert', 'hub');
unset($options);

$mform->addElement('text','imageurl' , get_string('logourl', 'hub'));
$mform->setType('imageurl', PARAM_URL);
$mform->setDefault('imageurl', $imageurl);
// $mform->addElement('text','imageurl' , get_string('logourl', 'hub'));
// $mform->setType('imageurl', PARAM_URL);
// $mform->setDefault('imageurl', $imageurl);
// $mform->addHelpButton('imageurl', 'imageurl', 'hub');

/// Display statistic that are going to be retrieve by the hub
$coursecount = $DB->count_records('course')-1;
Expand Down
4 changes: 2 additions & 2 deletions admin/registration/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
set_config('site_imageurl_'.$cleanhuburl, $fromform->imageurl, 'hub');
set_config('site_privacy_'.$cleanhuburl, $fromform->privacy, 'hub');
set_config('site_address_'.$cleanhuburl, $fromform->address, 'hub');
set_config('site_region_'.$cleanhuburl, $fromform->region, 'hub');
set_config('site_country_'.$cleanhuburl, $fromform->country, 'hub');
set_config('site_region_'.$cleanhuburl, $fromform->regioncode, 'hub');
set_config('site_country_'.$cleanhuburl, $fromform->countrycode, 'hub');
set_config('site_geolocation_'.$cleanhuburl, $fromform->geolocation, 'hub');
set_config('site_contactable_'.$cleanhuburl, $fromform->contactable, 'hub');
set_config('site_emailalert_'.$cleanhuburl, $fromform->emailalert, 'hub');
Expand Down
10 changes: 10 additions & 0 deletions lang/en/hub.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@
$string['badurlformat'] = 'Bad URL format';
$string['community'] = 'Community';
$string['confirmregistration'] = 'Confirm registration';
$string['contactable'] = 'Contact from the public';
$string['contactable_help'] = 'Set to yes, the hub will display your email address.';
$string['contactemail'] = 'Contact email';
$string['contactname'] = 'Contact name';
$string['contactphone'] = 'Phone';
$string['contactphone_help'] = 'Phone numbers are displayed to the Hub administrator only. There are not communicated on the hub list or anywhere else.';
$string['contributornames'] = 'Contributor names';
$string['coursemap'] = 'Course map';
$string['coursename'] = 'Name';
Expand All @@ -62,11 +66,16 @@
$string['edulevelprimary'] = 'Primary';
$string['edulevelsecondary'] = 'Secondary';
$string['eduleveltertiary'] = 'Tertiary';
$string['emailalert'] = 'Email notifications';
$string['emailalert_help'] = 'Set to yes, the hub administrator will send you emails about security issues and other important news.';
$string['enrollable'] = 'Enrollable';
$string['errorbadimageheightwidth'] = 'The image should have a maximum size of {$a->width} X {$a->height}';
$string['errorlangnotrecognized'] = 'Language code is unknown by Moodle. Please contact {$a}';
$string['geolocation'] = 'latitude - longitude';
$string['geolocation_help'] = 'A geolocation code like you can find on Google Map or Twitter (example: -31.947884,115.871285)';
$string['hub'] = 'Hub';
$string['imageurl'] = 'Image url';
$string['imageurl_help'] = 'This image will be displayed on the hub. This image must be available from the hub at any moment. The image should have a maximum size of {$a->width} X {$a->height}';
$string['information'] = 'Information';
$string['language'] = 'Language';
$string['logourl'] = 'Logo URL';
Expand All @@ -90,6 +99,7 @@
$string['postsnumber'] = 'Number of posts ({$a})';
$string['prioritise'] = 'Prioritise';
$string['privacy'] = 'Privacy';
$string['privacy_help'] = 'You can either choose to not display your site on the hub site list, either to display only your site general information, either to display your site general information + a link to your site.';
$string['private'] = 'Private';
$string['privatehuburl'] = 'Private hub URL';
$string['publicationinfo'] = 'Course publication information';
Expand Down

0 comments on commit 4032415

Please sign in to comment.