course publication MDL-22762 improve the publication confirmation/error message

This commit is contained in:
jerome mouneyrac 2010-06-22 04:01:33 +00:00
parent f00340e2ca
commit de832702ad
3 changed files with 8 additions and 6 deletions

View file

@ -31,6 +31,8 @@ require_once($CFG->dirroot.'/admin/registration/lib.php');
require_once($CFG->dirroot.'/course/publish/lib.php');
$id = optional_param('id', 0, PARAM_INT);
$hubname = optional_param('hubname', 0, PARAM_TEXT);
$huburl = optional_param('huburl', 0, PARAM_URL);
$course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
@ -99,9 +101,7 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
/// UNPUBLISH
$cancel = optional_param('cancel', 0, PARAM_BOOL);
if (!empty($cancel) and confirm_sesskey()) {
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hubname = optional_param('hubname', 0, PARAM_TEXT);
$huburl = optional_param('huburl', 0, PARAM_URL);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hubcourseid = optional_param('hubcourseid', 0, PARAM_INT);
$publicationid = optional_param('publicationid', 0, PARAM_INT);
$timepublished = optional_param('timepublished', 0, PARAM_INT);
@ -144,7 +144,8 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
//check if a course was published
if (optional_param('published', 0, PARAM_TEXT)) {
$confirmmessage = $OUTPUT->notification(get_string('coursepublished', 'hub'), 'notifysuccess');
$confirmmessage = $OUTPUT->notification(get_string('coursepublished', 'hub',
empty($hubname)?$huburl:$hubname), 'notifysuccess');
}

View file

@ -217,7 +217,8 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
} else {
//redirect to the index publis page
redirect(new moodle_url('/course/publish/index.php',
array('sesskey' => sesskey(), 'id' => $id, 'published' => true)));
array('sesskey' => sesskey(), 'id' => $id, 'published' => true,
'hubname' => $hubname, 'huburl' => $huburl)));
}
}

View file

@ -59,7 +59,7 @@ $string['coursemap'] = 'Course map';
$string['coursename'] = 'Name';
$string['courseprivate'] = 'Private';
$string['coursepublic'] = 'Public';
$string['coursepublished'] = 'Course published or updated';
$string['coursepublished'] = 'This course has been published on \'{$a}\' successfully. The course will be checked for approval before to appears on the course listing.';
$string['courseshortname'] = 'Shortname';
$string['courseshortname_help'] = 'Enter any shortname for your course. It is not an identifier (i.e many courses can have a same shortname in a search result.)';
$string['coursesnumber'] = 'Number of courses ({$a})';