]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11461 all ressource types are now displayed in the ressource help popup, merged...
authorjerome <jerome>
Tue, 17 Jun 2008 02:00:54 +0000 (02:00 +0000)
committerjerome <jerome>
Tue, 17 Jun 2008 02:00:54 +0000 (02:00 +0000)
help.php
mod/resource/lib.php

index 6bde63c8ad35d5bc54aac7e06adaec56a16b9c67..e170c6ec61973004732222ee8cc4a44fc2ad75d9 100644 (file)
--- a/help.php
+++ b/help.php
@@ -236,18 +236,27 @@ function include_help_for_each_resource($file, $langs, $helpdir) {
 
     require_once($CFG->dirroot .'/mod/resource/lib.php');
     $typelist = resource_get_types();
-    $typelist['label'] = get_string('resourcetypelabel', 'resource');
-
-    foreach ($typelist as $type => $name) {
+    
+    //add label type
+    $labelType = new object();
+    $labelType->modclass = MOD_CLASS_RESOURCE;
+    $resourcetype = 'label';
+    $labelType->name = $resourcetype;
+    $labelType->type = "resource&amp;type=$resourcetype";
+    $labelType->typestr = get_string("resourcetype$resourcetype", 'resource');
+    $typelist[] = $labelType;
+
+    foreach ($typelist as $type) {
+   
         foreach ($langs as $lang) {
             if (empty($lang)) {
                 continue;
             }
 
-            $filepath = "$helpdir/resource/type/$type.html";
+            $filepath = "$helpdir/resource/type/".$type->name.".html";
 
             if (file_exists_and_readable($filepath)) {
-                echo '<hr size="1" />';
+                echo '<hr />';
                 @include($filepath); // The actual helpfile
                 break; // Out of loop over languages.
             }
index 5ea5413395401a96cd503e6ef51654182bbe4668..d3193070269d12c222c4852ab0de54aec73e4753 100644 (file)
@@ -533,6 +533,7 @@ function resource_get_types() {
     foreach ($standardresources as $resourcetype) {
         $type = new object();
         $type->modclass = MOD_CLASS_RESOURCE;
+        $type->name = $resourcetype;
         $type->type = "resource&amp;type=$resourcetype";
         $type->typestr = get_string("resourcetype$resourcetype", 'resource');
         $types[] = $type;
@@ -547,6 +548,7 @@ function resource_get_types() {
         if (!in_array($resourcetype, $standardresources)) {
             $type = new object();
             $type->modclass = MOD_CLASS_RESOURCE;
+            $type->name = $resourcetype;
             $type->type = "resource&amp;type=$resourcetype";
             $type->typestr = get_string("resourcetype$resourcetype", 'resource');
             $types[] = $type;