]> git.mjollnir.org Git - moodle.git/commitdiff
'Extras' in cached course modinfo activities is now returned.
authormoodler <moodler>
Tue, 26 Aug 2003 13:47:46 +0000 (13:47 +0000)
committermoodler <moodler>
Tue, 26 Aug 2003 13:47:46 +0000 (13:47 +0000)
This means that Resources can now employ them on the index listing.

Specifically, Resources that are popup now popup from there too.

lib/datalib.php
mod/resource/index.php

index 9b46954d98c0eeb2df01e0d1be48ff40fbac26b2..a1ae05a36ab71e9804cd8b4a984940e0155f2020 100644 (file)
@@ -1480,7 +1480,11 @@ function get_all_instances_in_course($modulename, $course) {
 
     foreach ($modinfo as $mod) {
         if ($mod->mod == $modulename and $mod->visible > $invisible) {
-            $outputarray[] = $rawmods[$mod->cm];
+            $instance = $rawmods[$mod->cm];
+            if (!empty($mod->extra)) {
+                $instance->extra = $mod->extra;
+            }
+            $outputarray[] = $instance;
         }
     }
 
index e855f46536c8f34632945e5d686f38525f293547..2780b628901de4630506e98cc8549f126c14de34 100644 (file)
                 $tt = "$resource->section";
             }
         } else {
-            $tt = "<FONT SIZE=1>".userdate($resource->timemodified);
+            $tt = "<font size=1>".userdate($resource->timemodified);
+        }
+        if (!empty($resource->extra)) {
+            $extra = urldecode($resource->extra);
+        } else {
+            $extra = "";
         }
         if (!$resource->visible) {
            //Show dimmed if the mod is hidden
-           $table->data[] = array ($tt, "<A class=\"dimmed\" HREF=\"view.php?id=$resource->coursemodule\">$resource->name</A>",
+           $table->data[] = array ($tt, "<a class=\"dimmed\" $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
                                    text_to_html($resource->summary) );
         } else {
            //Show normal if the mod is visible
-           $table->data[] = array ($tt, "<A HREF=\"view.php?id=$resource->coursemodule\">$resource->name</A>",
+           $table->data[] = array ($tt, "<a $extra href=\"view.php?id=$resource->coursemodule\">$resource->name</a>",
                                    text_to_html($resource->summary) );
         }
     }
 
-    echo "<BR>";
+    echo "<br />";
 
     print_table($table);
 
     print_footer($course);
-
  
 ?>