--- /moodle/mod/glossary/lib.php,v 1.193.2.14 2008/07/10 09:48:46 scyrma Exp $
+++ /mymoodle/mod/glossary/lib.php 2009-03-02 17:03:34.000000000 +0100
@@ -957,8 +957,13 @@
echo '
| '.$icons.' |
';
}
if ($ratings) {
+ //We check if the entry was exported, so it shouldn't be rated
+ $printratingmenu = false;
+ if ($entry->glossaryid == $cm->instance) {
+ $printratingmenu = true;
+ }
echo '| ';
- $return = glossary_print_entry_ratings($course, $entry, $ratings);
+ $return = glossary_print_entry_ratings($course, $entry, $ratings, $printratingmenu);
echo ' |
';
}
echo '';
@@ -1237,7 +1242,7 @@
// if attachment is an image, $align set its aligment.
global $CFG;
- $newentry = $entry;
+ $newentry = clone $entry;
if ( $newentry->sourceglossaryid ) {
$newentry->glossaryid = $newentry->sourceglossaryid;
}
@@ -1602,7 +1607,7 @@
}
-function glossary_print_entry_ratings($course, $entry, $ratings = NULL) {
+function glossary_print_entry_ratings($course, $entry, $ratings = NULL, $printratingmenu = false) {
global $USER, $CFG;
@@ -1624,13 +1629,13 @@
if ($useratings) {
if (has_capability('mod/glossary:viewrating', $context)) {
glossary_print_ratings_mean($entry->id, $ratings->scale);
- if ($USER->id != $entry->userid) {
+ if ($USER->id != $entry->userid and $printratingmenu) {
glossary_print_rating_menu($entry->id, $USER->id, $ratings->scale);
$ratingsmenuused = true;
}
} else if ($USER->id == $entry->userid) {
glossary_print_ratings_mean($entry->id, $ratings->scale);
- } else if (!empty($ratings->allow) ) {
+ } else if (!empty($ratings->allow) and $printratingmenu) {
glossary_print_rating_menu($entry->id, $USER->id, $ratings->scale);
$ratingsmenuused = true;
}
--- /moodle/mod/glossary/formats/entrylist/entrylist_format.php,v 1.16.4.1 2007/11/09 14:35:06 nfreear Exp $
+++ /mymoodle/mod/glossary/formats/entrylist/entrylist_format.php 2009-03-02 17:03:47.000000000 +0100
@@ -19,9 +19,14 @@
glossary_print_entry_icons($course, $cm, $glossary, $entry, $mode, $hook,'print');
}
if ($ratings) {
+ //We check if the entry was exported, so it shouldn't be rated
+ $printratingmenu = false;
+ if ($entry->glossaryid == $cm->instance) {
+ $printratingmenu = true;
+ }
echo '
';
echo '';
- $return = glossary_print_entry_ratings($course, $entry, $ratings);
+ $return = glossary_print_entry_ratings($course, $entry, $ratings, $printratingmenu);
echo '';
}
echo '
';