NOMDL Workshop: Improved detection of filled description and instructions

The function strip_tags() used to be here as a way around a bug in
TinyMCE producing empty <br /> instead of empty string. This lead to the
unwanted behaviour that Workshop description of instructions consisting
of <img> only were considered as empty. The TinyMCE seems to produce
correct string now so this is not needed any more.
This commit is contained in:
David Mudrak 2010-07-19 13:20:50 +00:00
parent ec9132b5bb
commit bfbca63de3
2 changed files with 6 additions and 6 deletions

View File

@ -1919,14 +1919,14 @@ class workshop_user_plan implements renderable {
$task = new stdclass();
$task->title = get_string('taskintro', 'workshop');
$task->link = $workshop->updatemod_url();
$task->completed = !(trim(strip_tags($workshop->intro)) == '');
$task->completed = !(trim($workshop->intro) == '');
$phase->tasks['intro'] = $task;
}
if (has_capability('moodle/course:manageactivities', $workshop->context, $userid)) {
$task = new stdclass();
$task->title = get_string('taskinstructauthors', 'workshop');
$task->link = $workshop->updatemod_url();
$task->completed = !(trim(strip_tags($workshop->instructauthors)) == '');
$task->completed = !(trim($workshop->instructauthors) == '');
$phase->tasks['instructauthors'] = $task;
}
if (has_capability('mod/workshop:editdimensions', $workshop->context, $userid)) {
@ -1971,7 +1971,7 @@ class workshop_user_plan implements renderable {
$task = new stdclass();
$task->title = get_string('taskinstructreviewers', 'workshop');
$task->link = $workshop->updatemod_url();
if (trim(strip_tags($workshop->instructreviewers))) {
if (trim($workshop->instructreviewers)) {
$task->completed = true;
} elseif ($workshop->phase >= workshop::PHASE_ASSESSMENT) {
$task->completed = false;

View File

@ -68,7 +68,7 @@ echo $output->render($userplan);
switch ($workshop->phase) {
case workshop::PHASE_SETUP:
if (trim(strip_tags($workshop->intro))) {
if (trim($workshop->intro)) {
print_collapsible_region_start('', 'workshop-viewlet-intro', get_string('introduction', 'workshop'));
echo $output->box(format_module_intro('workshop', $workshop, $workshop->cm->id), 'generalbox');
print_collapsible_region_end();
@ -94,7 +94,7 @@ case workshop::PHASE_SETUP:
}
break;
case workshop::PHASE_SUBMISSION:
if (trim(strip_tags($workshop->instructauthors))) {
if (trim($workshop->instructauthors)) {
$instructions = file_rewrite_pluginfile_urls($workshop->instructauthors, 'pluginfile.php', $PAGE->context->id,
'mod_workshop', 'instructauthors', 0, workshop::instruction_editors_options($PAGE->context));
print_collapsible_region_start('', 'workshop-viewlet-instructauthors', get_string('instructauthors', 'workshop'));
@ -199,7 +199,7 @@ case workshop::PHASE_ASSESSMENT:
echo $output->render($pagingbar);
}
}
if (trim(strip_tags($workshop->instructreviewers))) {
if (trim($workshop->instructreviewers)) {
$instructions = file_rewrite_pluginfile_urls($workshop->instructreviewers, 'pluginfile.php', $PAGE->context->id,
'mod_workshop', 'instructreviewers', 0, workshop::instruction_editors_options($PAGE->context));
print_collapsible_region_start('', 'workshop-viewlet-instructreviewers', get_string('instructreviewers', 'workshop'));