Skip to content

Commit

Permalink
MDL-11461 all ressource types are now displayed in the ressource help…
Browse files Browse the repository at this point in the history
… popup, merged from 1.9
  • Loading branch information
jerome committed Jun 17, 2008
1 parent fd9ba50 commit d81f018
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 14 additions & 5 deletions help.php
Original file line number Diff line number Diff line change
Expand Up @@ -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&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.
}
Expand Down
2 changes: 2 additions & 0 deletions mod/resource/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit d81f018

Please sign in to comment.