publication MDL-19315 display message when no hub can be selected

This commit is contained in:
jerome mouneyrac 2010-05-21 02:13:22 +00:00
parent a65fa92a9f
commit 544501449d
2 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,16 @@ $PAGE->set_pagelayout('course');
$PAGE->set_title(get_string('course') . ': ' . $course->fullname);
$PAGE->set_heading($course->fullname);
$hubmanager = new hub();
$registeredhubs = $hubmanager->get_registered_on_hubs();
if (empty($registeredhubs)) {
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('publishon', 'hub'), 3, 'main');
echo $OUTPUT->box(get_string('notregisteredonhub', 'hub'));
echo $OUTPUT->footer();
die();
}
$share = optional_param('share', false, PARAM_BOOL);
$advertise = optional_param('advertise', false, PARAM_BOOL);

View File

@ -112,7 +112,7 @@ $string['name_help'] = 'This name will be showing in the course listing.';
$string['no'] = 'No';
$string['nohubselected'] = 'No hub selected';
$string['nosearch'] = 'Don\'t publish hub or courses';
$string['notregisteredonhub'] = 'Your administrator needs to register this site with at least one hub before you can use this option.';
$string['notregisteredonhub'] = 'Your administrator needs to register this site with at least one hub before you can publish a course. Contact your site administrator.';
$string['notregisteredonmoodleorg'] = 'Your administrator needs to register this site with moodle.org.';
$string['operation'] = 'Actions';
$string['orenterprivatehub'] = 'Alternatively, enter a private hub URL:';