registration MDL-19313 increase registration text fields width and add help icons

This commit is contained in:
jerome mouneyrac 2010-06-09 06:44:50 +00:00
parent b2c8e7a733
commit 139978e50c
4 changed files with 67 additions and 25 deletions

View File

@ -172,10 +172,12 @@ class site_registration_form extends moodleform {
//the input parameters
$mform->addElement('header', 'moodle', get_string('registrationinfo', 'hub'));
$mform->addElement('text','name' , get_string('fullsitename'));
$mform->addElement('text','name' , get_string('sitename', 'hub'),
array('class' => 'registration_textfield'));
$mform->addRule('name', $strrequired, 'required', null, 'client');
$mform->setType('name', PARAM_TEXT);
$mform->setDefault('name', $sitename);
$mform->addHelpButton('name', 'sitename', 'hub');
$options = array();
$hub = new hub();
@ -187,26 +189,34 @@ class site_registration_form extends moodleform {
$mform->addHelpButton('privacy', 'privacy', 'hub');
unset($options);
$mform->addElement('textarea', 'description', get_string('description'), array('rows'=>8, 'cols'=>50));
$mform->addElement('textarea', 'description', get_string('sitedesc', 'hub'),
array('rows'=>8, 'cols'=>41));
$mform->addRule('description', $strrequired, 'required', null, 'client');
$mform->setDefault('description', $sitedescription);
$mform->setType('description', PARAM_TEXT);
$mform->addHelpButton('description', 'sitedesc', 'hub');
$mform->addElement('static', 'urlstring',get_string('siteurl', 'hub'), $CFG->wwwroot);
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
$languages = get_string_manager()->get_list_of_languages();
$mform->addElement('static', 'langstring',get_string('language'), $languages[current_language()]);
$mform->addElement('static', 'langstring',get_string('sitelang', 'hub'), $languages[current_language()]);
$mform->addElement('hidden', 'language', current_language());
$mform->addHelpButton('langstring', 'sitelang', 'hub');
$mform->addElement('static', 'versionstring',get_string('moodleversion'), $CFG->version);
$mform->addElement('static', 'versionstring',get_string('siteversion', 'hub'), $CFG->version);
$mform->addElement('hidden', 'moodleversion', $CFG->version);
$mform->addHelpButton('versionstring', 'siteversion', 'hub');
$mform->addElement('static', 'releasestring',get_string('moodlerelease'), $CFG->release);
$mform->addElement('static', 'releasestring',get_string('siterelease', 'hub'), $CFG->release);
$mform->addElement('hidden', 'moodlerelease', $CFG->release);
$mform->addHelpButton('releasestring', 'siterelease', 'hub');
$mform->addElement('textarea','address' , get_string('postaladdress', 'hub'));
$mform->addElement('textarea','address' , get_string('postaladdress', 'hub'),
array('rows'=>4, 'cols'=>41));
$mform->setType('address', PARAM_TEXT);
$mform->setDefault('address', $address);
$mform->addHelpButton('address', 'postaladdress', 'hub');
//TODO: use the region array I generated
// $mform->addElement('select', 'region', get_string('selectaregion'), array('-' => '-'));
@ -214,43 +224,51 @@ class site_registration_form extends moodleform {
$mform->addElement('hidden', 'regioncode', '-');
$countries = get_string_manager()->get_list_of_countries();
$mform->addElement('select', 'countrycode', get_string('selectacountry'), $countries);
$mform->addElement('select', 'countrycode', get_string('sitecountry', 'hub'), $countries);
$mform->setDefault('countrycode', $country);
$mform->addHelpButton('countrycode', 'sitecountry', 'hub');
$mform->addElement('text','geolocation' , get_string('geolocation'));
$mform->addElement('text','geolocation' , get_string('sitegeolocation', 'hub'),
array('class' => 'registration_textfield'));
$mform->setDefault('geolocation', $geolocation);
$mform->addHelpButton('geolocation', 'geolocation', 'hub');
$mform->addHelpButton('geolocation', 'sitegeolocation', 'hub');
$mform->addElement('text', 'contactname', get_string('administrator'));
$mform->addElement('text', 'contactname', get_string('siteadmin', 'hub'),
array('class' => 'registration_textfield'));
$mform->addRule('contactname', $strrequired, 'required', null, 'client');
$mform->setType('contactname', PARAM_TEXT);
$mform->setDefault('contactname', $contactname);
$mform->addHelpButton('contactname', 'siteadmin', 'hub');
$mform->addElement('text','contactphone' , get_string('phone'));
$mform->addElement('text','contactphone' , get_string('sitephone', 'hub'),
array('class' => 'registration_textfield'));
$mform->setType('contactphone', PARAM_TEXT);
$mform->addHelpButton('contactphone', 'contactphone', 'hub');
$mform->addHelpButton('contactphone', 'sitephone', 'hub');
$mform->addElement('text', 'contactemail', get_string('email'));
$mform->addElement('text', 'contactemail', get_string('siteemail', 'hub'),
array('class' => 'registration_textfield'));
$mform->addRule('contactemail', $strrequired, 'required', null, 'client');
$mform->setType('contactemail', PARAM_TEXT);
$mform->setDefault('contactemail', $contactemail);
$mform->addHelpButton('contactemail', 'siteemail', 'hub');
$options = array();
$options[0] = get_string("registrationcontactno");
$options[1] = get_string("registrationcontactyes");
$mform->addElement('select', 'contactable', get_string('registrationcontact'), $options);
$mform->addElement('select', 'contactable', get_string('siteregistrationcontact', 'hub'), $options);
$mform->setDefault('contactable', $contactable);
$mform->addHelpButton('contactable', 'contactable', 'hub');
$mform->addHelpButton('contactable', 'siteregistrationcontact', 'hub');
unset($options);
$options = array();
$options[0] = get_string("registrationno");
$options[1] = get_string("registrationyes");
$mform->addElement('select', 'emailalert', get_string('registrationemail'), $options);
$mform->addElement('select', 'emailalert', get_string('siteregistrationemail', 'hub'), $options);
$mform->setDefault('emailalert', $emailalert);
$mform->addHelpButton('emailalert', 'emailalert', 'hub');
$mform->addHelpButton('emailalert', 'siteregistrationemail', 'hub');
unset($options);
//TODO site logo
// $mform->addElement('text','imageurl' , get_string('logourl', 'hub'));
// $mform->setType('imageurl', PARAM_URL);
// $mform->setDefault('imageurl', $imageurl);
@ -272,6 +290,7 @@ class site_registration_form extends moodleform {
$mform->addElement('checkbox', 'courses', get_string('sendfollowinginfo', 'hub'),
" ".get_string('coursesnumber', 'hub', $coursecount));
$mform->setDefault('courses', true);
$mform->addHelpButton('courses', 'sendfollowinginfo', 'hub');
$mform->addElement('checkbox', 'users', '',
" ".get_string('usersnumber', 'hub', $usercount));
@ -304,6 +323,7 @@ class site_registration_form extends moodleform {
$mform->addElement('static', 'courseslabel',get_string('sendfollowinginfo', 'hub'),
" ".get_string('coursesnumber', 'hub', $coursecount));
$mform->addElement('hidden', 'courses', true);
$mform->addHelpButton('courseslabel', 'sendfollowinginfo', 'hub');
$mform->addElement('static', 'userslabel', '',
" ".get_string('usersnumber', 'hub', $usercount));

View File

@ -26,10 +26,6 @@
class block_community_manager {
///////////////////////////
/// DB Facade functions //
///////////////////////////
/**
* Add a community course
* @param object $course
@ -91,8 +87,6 @@ class block_community_manager {
mkdir($CFG->dataroot.'/temp/communitydownload/', 0777, true);
}
//get hub id to make the
$url = new moodle_url($course->huburl.'/local/hub/webservice/download.php', $params);
$path = $CFG->dataroot.'/temp/communitydownload/'.'backup_'.$course->fullname."_".$course->id.".zip";
$fp = fopen($path, 'w');

View File

@ -122,6 +122,7 @@ $string['operation'] = 'Actions';
$string['orenterprivatehub'] = 'Alternatively, enter a private hub URL:';
$string['participantnumberaverage'] = 'Average number of participants ({$a})';
$string['postaladdress'] = 'Postal address';
$string['postaladdress_help'] = 'Postal address of this site, or of the entity represented by this site.';
$string['postsnumber'] = 'Number of posts ({$a})';
$string['prioritise'] = 'Prioritise';
$string['privacy'] = 'Privacy';
@ -161,7 +162,8 @@ $string['selecthub'] = 'Select hub';
$string['selecthubinfo'] = 'A community hub is a server that lists courses. You can only publish your courses on hubs that this Moodle site is registered with. If the hub you want is not listed below, please contact your site administrator.';
$string['selecthubforadvertise'] = 'Select hub for advertising';
$string['selecthubforsharing'] = 'Select hub for uploading';
$string['sendfollowinginfo'] = 'Send the following information:';
$string['sendfollowinginfo'] = 'More information';
$string['sendfollowinginfo_help'] = 'The following information will be sent but kept private from listing.';
$string['settings'] = 'Settings';
$string['settingsupdated'] = 'Settings have been updated.';
$string['share'] = 'Share this course for people to download';
@ -171,17 +173,38 @@ $string['shareonhub'] = 'Upload this course to a hub';
$string['shareonmoodleorg'] = 'Upload this course to MOOCH';
$string['sharepublication_help'] = 'Uploading this course to a community hub server will enable people to download it and install it on their own Moodle sites.';
$string['siteadmin'] = 'Administrator';
$string['siteadmin_help'] = 'Site administrator fullname';
$string['sitecountry'] = 'Country';
$string['sitecountry_help'] = 'Country of this site';
$string['sitecreated'] = 'Site created';
$string['sitedesc'] = 'Description';
$string['sitedesc_help'] = 'Description shown on the site listing.';
$string['sitegeolocation'] = 'latitude - longitude';
$string['sitegeolocation_help'] = 'A geolocation code like you can find on Google Map or Twitter (example: -31.947884,115.871285)';
$string['siteemail'] = 'Email address';
$string['siteemail_help'] = 'Email address you to contact you. It will be kept private following the privacy choosen.';
$string['sitelang'] = 'Language';
$string['sitelang_help'] = 'Your site language is displayed on the site listing.';
$string['sitename'] = 'Name';
$string['sitename_help'] = 'This name will be shown on the site listing if the privacy allows it.';
$string['sitephone'] = 'Phone';
$string['sitephone_help'] = 'Phone numbers are displayed to the Hub administrator only. There are not communicated on the hub list or anywhere else.';
$string['siteprivacy'] = 'Privacy';
$string['siteprivacynotpublished'] = 'Please do not publish this site';
$string['siteprivacypublished'] = 'Publish the site name only';
$string['siteprivacylinked'] = 'Publish the site name with a link';
$string['siteregconfcomment'] = 'Your site needs a final confirmation on {$a} (in order to avoid spam on {$a})';
$string['siteregistrationcontact'] = 'Contact form';
$string['siteregistrationcontact_help'] = 'Set to yes, the hub will display your email address.';
$string['siteregistrationemail'] = 'Email notifications';
$string['siteregistrationemail_help'] = 'Set to yes, the hub administrator will send you emails about security issues and other important news.';
$string['siteregistrationupdated'] = 'Site registration updated';
$string['siterelease'] = 'Moodle release';
$string['siterelease_help'] = 'Moodle release number of this site.';
$string['siteurl'] = 'Site URL';
$string['siteurl_help'] = 'The URL of this site, people will be redirected to it if the privacy allows it.';
$string['siteversion'] = 'Moodle version';
$string['siteversion_help'] = 'Moodle version of this site.';
$string['subject'] = 'Subject';
$string['subject_help'] = 'The main course subject.';
$string['specifichub'] = 'Specific hub';

View File

@ -590,4 +590,9 @@ body.tag .managelink {padding: 5px;}
.smartselect.compactmenu .smartselect_submenuitem:hover > .smartselect_menuitem_label {font-weight:bold;}
.image_gallery.oneimageonly a.imagelink {display:none;}
.image_gallery.oneimageonly a#imagelink1 {display:inline;}
.image_gallery.oneimageonly a#imagelink1 {display:inline;}
/**
* Registration
*/
#page-admin-registration-register .registration_textfield {width: 300px;}