Fixes MDL-12029 "Glossary view needs heading markup + other accessibility fixes".

This commit is contained in:
nfreear 2007-11-05 15:22:22 +00:00
parent 0760ba2c40
commit 097d705e6d
5 changed files with 28 additions and 19 deletions

View file

@ -16,17 +16,17 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode
print_user_picture($user->id, $course->id, $user->picture); print_user_picture($user->id, $course->id, $user->picture);
echo '</td>'; echo '</td>';
echo '<td class="entryheader">'; echo '<th class="entryheader">';
echo '<span class="concept">'; echo '<span class="concept">';
glossary_print_entry_concept($entry); glossary_print_entry_concept($entry);
echo '</span><br />'; echo '</span>';
$fullname = fullname($user); $fullname = fullname($user);
$by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>'; $by->name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id.'">'.$fullname.'</a>';
$by->date = userdate($entry->timemodified); $by->date = userdate($entry->timemodified);
echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>'; echo '<span class="author">'.get_string('bynameondate', 'forum', $by).'</span>';
echo '</td>'; echo '</th>';
echo '<td class="entryapproval">'; echo '<td class="entryapproval">';
glossary_print_entry_approval($cm, $entry, $mode); glossary_print_entry_approval($cm, $entry, $mode);

View file

@ -8,16 +8,16 @@ function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode="", $hoo
echo '<table class="glossarypost faq" cellspacing="0">'; echo '<table class="glossarypost faq" cellspacing="0">';
echo '<tr valign="top">'; echo '<tr valign="top">';
echo '<td class="entryheader">'; echo '<th class="entryheader">';
$entry->course = $course->id; $entry->course = $course->id;
echo '<span class="concept">' . get_string('question','glossary') . ': '; echo '<span class="concept">' . get_string('question','glossary') . ': ';
glossary_print_entry_concept($entry); glossary_print_entry_concept($entry);
echo '</span><br />'; echo '</span>';
echo '<span class="time">('.get_string('lastedited').': '. echo '<span class="time">('.get_string('lastedited').': '.
userdate($entry->timemodified).')</span>'; userdate($entry->timemodified).')</span>';
echo '</td>'; echo '</th>';
echo '<td class="entryattachment">'; echo '<td class="entryattachment">';
glossary_print_entry_approval($cm, $entry, $mode); glossary_print_entry_approval($cm, $entry, $mode);

View file

@ -639,7 +639,7 @@ function glossary_print_entry($course, $cm, $glossary, $entry, $mode='',$hook=''
//Default (old) print format used if custom function doesn't exist in format //Default (old) print format used if custom function doesn't exist in format
function glossary_print_entry_default ($entry) { function glossary_print_entry_default ($entry) {
echo '<b>'. strip_tags($entry->concept) . ': </b>'; echo '<h3>'. strip_tags($entry->concept) . ': </h3>';
$definition = $entry->definition; $definition = $entry->definition;
@ -671,7 +671,7 @@ function glossary_print_entry_default ($entry) {
function glossary_print_entry_concept($entry) { function glossary_print_entry_concept($entry) {
$options = new object(); $options = new object();
$options->para = false; $options->para = false;
$text = format_text('<span class="nolink">' . $entry->concept . '</span>', FORMAT_MOODLE, $options); $text = format_text('<h3 class="nolink">' . $entry->concept . '</h3>', FORMAT_MOODLE, $options);
if (!empty($entry->highlight)) { if (!empty($entry->highlight)) {
$text = highlight($entry->highlight, $text); $text = highlight($entry->highlight, $text);
} }
@ -839,6 +839,8 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$return = '<span class="commands">'; $return = '<span class="commands">';
// Differentiate links for each entry.
$altsuffix = ': '.$entry->concept;
if (!$entry->approved) { if (!$entry->approved) {
$output = true; $output = true;
$return .= get_string('entryishidden','glossary'); $return .= get_string('entryishidden','glossary');
@ -847,7 +849,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
if (has_capability('mod/glossary:comment', $context) and $glossary->allowcomments) { if (has_capability('mod/glossary:comment', $context) and $glossary->allowcomments) {
$output = true; $output = true;
$return .= ' <a title="' . get_string('addcomment','glossary') . '" href="comment.php?action=add&amp;eid='.$entry->id.'"><img src="comment.gif" class="iconsmall" alt="'.get_string('addcomment','glossary').'" /></a>'; $return .= ' <a title="' . get_string('addcomment','glossary') . '" href="comment.php?action=add&amp;eid='.$entry->id.'"><img src="comment.gif" class="iconsmall" alt="'.get_string('addcomment','glossary').$altsuffix.'" /></a>';
} }
@ -857,7 +859,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$mainglossary = get_record('glossary','mainglossary',1,'course',$course->id); $mainglossary = get_record('glossary','mainglossary',1,'course',$course->id);
if ( $mainglossary ) { // if there is a main glossary defined, allow to export the current entry if ( $mainglossary ) { // if there is a main glossary defined, allow to export the current entry
$output = true; $output = true;
$return .= ' <a title="'.get_string('exporttomainglossary','glossary') . '" href="exportentry.php?id='.$cm->id.'&amp;entry='.$entry->id.'&amp;mode='.$mode.'&amp;hook='.$hook.'"><img src="export.gif" class="iconsmall" alt="'.get_string('exporttomainglossary','glossary').'" /></a>'; $return .= ' <a title="'.get_string('exporttomainglossary','glossary') . '" href="exportentry.php?id='.$cm->id.'&amp;entry='.$entry->id.'&amp;mode='.$mode.'&amp;hook='.$hook.'"><img src="export.gif" class="iconsmall" alt="'.get_string('exporttomainglossary','glossary').$altsuffix.'" /></a>';
} }
} }
@ -875,9 +877,9 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode='',$h
$output = true; $output = true;
$return .= " <a title=\"" . get_string("delete") . "\" href=\"deleteentry.php?id=$cm->id&amp;mode=delete&amp;entry=$entry->id&amp;prevmode=$mode&amp;hook=$hook\"><img src=\""; $return .= " <a title=\"" . get_string("delete") . "\" href=\"deleteentry.php?id=$cm->id&amp;mode=delete&amp;entry=$entry->id&amp;prevmode=$mode&amp;hook=$hook\"><img src=\"";
$return .= $icon; $return .= $icon;
$return .= "\" class=\"iconsmall\" alt=\"" . get_string("delete") . "\" /></a> "; $return .= "\" class=\"iconsmall\" alt=\"" . get_string("delete") .$altsuffix."\" /></a> ";
$return .= " <a title=\"" . get_string("edit") . "\" href=\"edit.php?id=$cm->id&amp;e=$entry->id&amp;mode=$mode&amp;hook=$hook\"><img src=\"$CFG->pixpath/t/edit.gif\" class=\"iconsmall\" alt=\"" . get_string("edit") . "\" /></a>"; $return .= " <a title=\"" . get_string("edit") . "\" href=\"edit.php?id=$cm->id&amp;e=$entry->id&amp;mode=$mode&amp;hook=$hook\"><img src=\"$CFG->pixpath/t/edit.gif\" class=\"iconsmall\" alt=\"" . get_string("edit") .$altsuffix. "\" /></a>";
} elseif ( $importedentry ) { } elseif ( $importedentry ) {
$return .= " <font size=\"-1\">" . get_string("exportedentry","glossary") . "</font>"; $return .= " <font size=\"-1\">" . get_string("exportedentry","glossary") . "</font>";
} }

View file

@ -337,10 +337,10 @@
} else { } else {
$fullsearchchecked = ''; $fullsearchchecked = '';
} }
echo '<input type="checkbox" name="fullsearch" value="1" '.$fullsearchchecked.' alt="'.$strsearchindefinition.'" />'; echo '<input type="checkbox" name="fullsearch" id="fullsearch" value="1" '.$fullsearchchecked.' />';
echo '<input type="hidden" name="mode" value="search" />'; echo '<input type="hidden" name="mode" value="search" />';
echo '<input type="hidden" name="id" value="'.$cm->id.'" />'; echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
echo $strsearchindefinition; echo '<label for="fullsearch">'.$strsearchindefinition.'</label>';
echo '</td></tr></table>'; echo '</td></tr></table>';
echo '</form>'; echo '</form>';
@ -439,11 +439,11 @@
print_user_picture($user->id, $course->id, $user->picture); print_user_picture($user->id, $course->id, $user->picture);
$pivottoshow = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id))); $pivottoshow = fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)));
} else { } else {
echo '<td align="center">'; echo '<th >';
} }
echo "<strong> $pivottoshow</strong>" ; print_heading($pivottoshow);
echo '</td></tr></table></div>'; echo '</th></tr></table></div>';
} }
} }

View file

@ -734,8 +734,15 @@ body#mod-forum-index .generalbox .cell {
.glossarypost .time { .glossarypost .time {
font-size: 0.8em; font-size: 0.8em;
} }
.concept { .glossarycategoryheader h2 {
font-weight: bold; margin: 0;
}
.glossarypost .concept h3 {
margin: 0;
}
.glossarypost .entryheader {
font-weight: normal;
text-align: left;
} }
.glossarycomment .author { .glossarycomment .author {
font-size: 0.8em; font-size: 0.8em;