From 36ce6ea2d1fdc39f6f32eb5c9d378c68c84f9db2 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Fri, 26 Nov 2004 01:22:41 +0000 Subject: [PATCH] Solve some visualisation issues in encyclopedia format. I think that now it will be correct! Merged from MOODLE_14_STABLE --- .../formats/encyclopedia/encyclopedia_format.php | 7 +++---- mod/glossary/lib.php | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/mod/glossary/formats/encyclopedia/encyclopedia_format.php b/mod/glossary/formats/encyclopedia/encyclopedia_format.php index 96e06eb02c..68e464e311 100644 --- a/mod/glossary/formats/encyclopedia/encyclopedia_format.php +++ b/mod/glossary/formats/encyclopedia/encyclopedia_format.php @@ -36,6 +36,7 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode echo "\n"; echo "\n "; echo "\ncellcontent\" class=\"forumpostmessage\">"; + echo "
"; if ($entry->attachment) { $entry->course = $course->id; @@ -47,11 +48,9 @@ function glossary_show_entry_encyclopedia($course, $cm, $glossary, $entry, $mode glossary_print_entry_attachment($entry,"",$align,false); } glossary_print_entry_definition($entry); + echo "
"; + if ($printicons or $ratings or $aliases) { - echo ""; - echo "\n "; - echo "\ncellcontent\" class=\"forumpostmessage\">"; - $return = glossary_print_entry_lower_section($course, $cm, $glossary, $entry,$mode,$hook,$printicons,$ratings, $aliases); echo ' '; } diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 7b003ebcbd..3c4aab27f5 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -687,12 +687,14 @@ function glossary_print_entry_aliases($course, $cm, $glossary, $entry,$mode="", function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$hook="", $type = 'print') { global $THEME, $USER, $CFG; + $output = false; //To decide if we must really return text in "return". Activate when needed only! $importedentry = ($entry->sourceglossaryid == $glossary->id); $isteacher = isteacher($course->id); $ismainglossary = $glossary->mainglossary; $return = ""; if (!$entry->approved) { + $output = true; $return .= get_string("entryishidden","glossary"); } $return .= glossary_print_entry_commentslink($course, $cm, $glossary, $entry,$mode,$hook,'html'); @@ -701,6 +703,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho if ( (!empty($USER->id) && $glossary->allowcomments && !isguest()) || $isteacher) { + $output = true; $return .= " id&eid=$entry->id\">\"\" "; } @@ -709,9 +712,8 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho if ($isteacher and !$ismainglossary and !$importedentry) { $mainglossary = get_record("glossary","mainglossary",1,"course",$course->id); if ( $mainglossary ) { // if there is a main glossary defined, allow to export the current entry - + $output = true; $return .= " id&entry=$entry->id&mode=$mode&hook=$hook\">\"\" "; - } } @@ -726,6 +728,7 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho // -The user is teacher or he is a student with time permissions (edit period or editalways defined). $ineditperiod = ((time() - $entry->timecreated < $CFG->maxeditingtime) || $glossary->editalways); if ( !$importedentry and ($isteacher or ($entry->userid == $USER->id and $ineditperiod))) { + $output = true; $return .= " id&mode=delete&entry=$entry->id&prevmode=$mode&hook=$hook\">\"\" "; @@ -736,6 +739,12 @@ function glossary_print_entry_icons($course, $cm, $glossary, $entry,$mode="",$ho } } $return .= "  "; // just to make up a little the output in Mozilla ;) + + //If we haven't calculated any REAL thing, delete result ($return) + if (!$output) { + $return = ''; + } + //Print or get if ($type == 'print') { echo $return; } else { @@ -776,7 +785,7 @@ function glossary_print_entry_lower_section($course, $cm, $glossary, $entry, $m if ( $printicons ) { $icons = glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook,"html"); } - if ($aliases || $printicons || $ratings) { + if ($aliases || $icons || $ratings) { echo ''; if ( $aliases ) { echo '
' . -- 2.39.5