Permalink
Browse files

MDL-11461 all ressource types are now displayed in the ressource help…

… popup, merged from 1.9
  • Loading branch information...
1 parent 5e20081 commit 31b8823ff3e07fa47f5e9063ba05488c845e48d6 jerome committed Jun 17, 2008
Showing with 16 additions and 5 deletions.
  1. +14 −5 help.php
  2. +2 −0 mod/resource/lib.php
View
19 help.php
@@ -180,18 +180,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&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.
}
View
2 mod/resource/lib.php
@@ -580,6 +580,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;
@@ -594,6 +595,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;

0 comments on commit 31b8823

Please sign in to comment.