From 120a18f051cdd003673ce40f61e01958b67cc51d Mon Sep 17 00:00:00 2001 From: nfreear Date: Wed, 7 Nov 2007 17:45:57 +0000 Subject: [PATCH] Follow up fixes MDL-12029 "Glossary view needs heading markup..." --- mod/glossary/formats/TEMPLATE/TEMPLATE_format.php | 7 ++++--- mod/glossary/formats/continuous/continuous_format.php | 4 ++-- mod/glossary/formats/dictionary/dictionary_format.php | 4 ++-- .../formats/encyclopedia/encyclopedia_format.php | 4 ++-- mod/glossary/formats/entrylist/entrylist_format.php | 4 ++-- mod/glossary/formats/faq/faq_format.php | 4 ++-- .../formats/fullwithauthor/fullwithauthor_format.php | 9 +++++---- .../fullwithoutauthor/fullwithoutauthor_format.php | 8 ++++---- mod/glossary/lib.php | 5 ++++- mod/glossary/view.php | 4 ++-- theme/standard/styles_fonts.css | 9 ++++++--- 11 files changed, 35 insertions(+), 27 deletions(-) diff --git a/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php b/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php index 96886b5bc5..b13d962507 100755 --- a/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php +++ b/mod/glossary/formats/TEMPLATE/TEMPLATE_format.php @@ -24,6 +24,7 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', //Use this code to show author's name //Comments: Configuration not supported $fullname = fullname($user); + $by = new object(); $by->name = ''.$fullname.''; $by->date = userdate($entry->timemodified); echo ''.get_string('bynameondate', 'forum', $by).'' . '
'; @@ -67,12 +68,12 @@ function glossary_show_entry_TEMPLATE($course, $cm, $glossary, $entry, $mode='', echo ''; echo ''; - //Use this function to print the concept + //Use this function to print the concept in a heading

//Comments: Configuration not supported glossary_print_entry_concept($entry); - //Line separator to show this template fine. :-) - echo "
\n"; + //Line separator not normally needed now. + //echo "
\n"; //Use this function to show the definition //Comments: Configuration not supported diff --git a/mod/glossary/formats/continuous/continuous_format.php b/mod/glossary/formats/continuous/continuous_format.php index a1152bd04a..f87d0fc008 100644 --- a/mod/glossary/formats/continuous/continuous_format.php +++ b/mod/glossary/formats/continuous/continuous_format.php @@ -9,9 +9,9 @@ function glossary_show_entry_continuous($course, $cm, $glossary, $entry, $mode=' echo ''; glossary_print_entry_approval($cm, $entry, $mode); glossary_print_entry_attachment($entry,'html','right'); - echo ''; + echo '
'; glossary_print_entry_concept($entry); - echo ': '; + echo ':
'; glossary_print_entry_definition($entry); $entry->alias = ''; echo ''; diff --git a/mod/glossary/formats/dictionary/dictionary_format.php b/mod/glossary/formats/dictionary/dictionary_format.php index db5634b536..e24c2f661d 100644 --- a/mod/glossary/formats/dictionary/dictionary_format.php +++ b/mod/glossary/formats/dictionary/dictionary_format.php @@ -9,9 +9,9 @@ function glossary_show_entry_dictionary($course, $cm, $glossary, $entry, $mode=' echo ''; glossary_print_entry_approval($cm, $entry, $mode); glossary_print_entry_attachment($entry,'html','right'); - echo ''; + echo '
'; glossary_print_entry_concept($entry); - echo ': '; + echo ':
'; glossary_print_entry_definition($entry); echo ''; echo ''; diff --git a/mod/glossary/formats/encyclopedia/encyclopedia_format.php b/mod/glossary/formats/encyclopedia/encyclopedia_format.php index e46ce0280f..b19ead33ff 100644 --- a/mod/glossary/formats/encyclopedia/encyclopedia_format.php +++ b/mod/glossary/formats/encyclopedia/encyclopedia_format.php @@ -17,9 +17,9 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode echo ''; echo ''; - echo ''; + echo '
'; glossary_print_entry_concept($entry); - echo ''; + echo '
'; $fullname = fullname($user); $by->name = ''.$fullname.''; diff --git a/mod/glossary/formats/entrylist/entrylist_format.php b/mod/glossary/formats/entrylist/entrylist_format.php index 011748b93e..47b2e5438d 100644 --- a/mod/glossary/formats/entrylist/entrylist_format.php +++ b/mod/glossary/formats/entrylist/entrylist_format.php @@ -11,9 +11,9 @@ function glossary_show_entry_entrylist($course, $cm, $glossary, $entry, $mode='' echo ''; if ($entry) { glossary_print_entry_approval($cm, $entry, $mode); - echo "id&eid=$entry->id&displayformat=dictionary\" target=\"_blank\" onClick=\"return openpopup('/mod/glossary/showentry.php?courseid=$course->id&eid=$entry->id&displayformat=dictionary', 'entry', 'menubar=0,location=0,scrollbars,resizable,width=600,height=450', 0);\">"; + echo " '; echo ''; if ($printicons) { glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook,'print'); diff --git a/mod/glossary/formats/faq/faq_format.php b/mod/glossary/formats/faq/faq_format.php index b4ed5cc706..0780a5802a 100644 --- a/mod/glossary/formats/faq/faq_format.php +++ b/mod/glossary/formats/faq/faq_format.php @@ -11,9 +11,9 @@ function glossary_show_entry_faq($course, $cm, $glossary, $entry, $mode="", $hoo echo ''; $entry->course = $course->id; - echo '' . get_string('question','glossary') . ': '; + echo '
' . get_string('question','glossary') . ': '; glossary_print_entry_concept($entry); - echo ''; + echo '
'; echo '('.get_string('lastedited').': '. userdate($entry->timemodified).')'; diff --git a/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php b/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php index 545069257e..f251bfaf99 100644 --- a/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php +++ b/mod/glossary/formats/fullwithauthor/fullwithauthor_format.php @@ -16,18 +16,19 @@ function glossary_show_entry_fullwithauthor($course, $cm, $glossary, $entry, $mo print_user_picture($user->id, $course->id, $user->picture); echo ''; - echo ''; + echo ''; - echo ''; + echo '
'; glossary_print_entry_concept($entry); - echo '
'; + echo '
'; $fullname = fullname($user); + $by = new object(); $by->name = ''.$fullname.''; $by->date = userdate($entry->timemodified); echo ''.get_string('bynameondate', 'forum', $by).''; - echo ''; + echo ''; echo ''; glossary_print_entry_approval($cm, $entry, $mode); diff --git a/mod/glossary/formats/fullwithoutauthor/fullwithoutauthor_format.php b/mod/glossary/formats/fullwithoutauthor/fullwithoutauthor_format.php index fad2ba4f37..06534b2d44 100644 --- a/mod/glossary/formats/fullwithoutauthor/fullwithoutauthor_format.php +++ b/mod/glossary/formats/fullwithoutauthor/fullwithoutauthor_format.php @@ -9,15 +9,15 @@ function glossary_show_entry_fullwithoutauthor($course, $cm, $glossary, $entry, echo ''; echo ''; - echo ''; echo '
'; + echo ''; - echo ''; + echo '
'; glossary_print_entry_concept($entry); - echo '
'; + echo '
'; echo '('.get_string('lastedited').': '. userdate($entry->timemodified).')'; - echo ''; + echo '
'; glossary_print_entry_approval($cm, $entry, $mode); diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index fe100d0f9f..83053f8b30 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -668,10 +668,13 @@ function glossary_print_entry_default ($entry) { echo '

'; } +/** + * Print glossary concept/term as a heading <h3> + */ function glossary_print_entry_concept($entry) { $options = new object(); $options->para = false; - $text = format_text('', FORMAT_MOODLE, $options); + $text = format_text(print_heading($entry->concept, '', 3, 'nolink'), FORMAT_MOODLE, $options); if (!empty($entry->highlight)) { $text = highlight($entry->highlight, $text); } diff --git a/mod/glossary/view.php b/mod/glossary/view.php index bac4bad575..f55ad450b2 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -433,7 +433,7 @@ $pivottoshow = $currentpivot; if ( isset($entry->userispivot) ) { // printing the user icon if defined (only when browsing authors) - echo '
'; + echo ''; $user = get_record("user","id",$entry->userid); print_user_picture($user->id, $course->id, $user->picture); @@ -443,7 +443,7 @@ } print_heading($pivottoshow); - echo '
'; + echo "\n"; } } diff --git a/theme/standard/styles_fonts.css b/theme/standard/styles_fonts.css index 25243fb0d2..95f7891fed 100644 --- a/theme/standard/styles_fonts.css +++ b/theme/standard/styles_fonts.css @@ -734,12 +734,15 @@ body#mod-forum-index .generalbox .cell { .glossarypost .time { font-size: 0.8em; } -.glossarycategoryheader h2 { - margin: 0; -} +.glossarycategoryheader h2, .glossarypost .concept h3 { + font-size: 1em; margin: 0; } +.glossarypost div.concept h3, +.glossarypost.continuous .concept { + display: inline; +} .glossarypost .entryheader { font-weight: normal; text-align: left; -- 2.39.5