Issue Details (XML | Word | Printable)

Key: MDL-11461
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jerome Mouneyrac
Reporter: Ralf Hilgenstock
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Ressource/types/... help files not available

Created: 27/Sep/07 12:54 AM   Updated: 17/Jun/08 04:49 PM
Return to search
Component/s: Documentation, Resource
Affects Version/s: 1.8.3, 1.9
Fix Version/s: 1.8.6

File Attachments: 1. Text File MDL-11461.patch (2 kB)

Image Attachments:

1. help_ress.png
(144 kB)

URL: http://moodle.org/help.php?module=moodle&file=resource/types.html
Participants: Eloy Lafuente (stronk7), Helen Foster, Jerome Mouneyrac, Ralf Hilgenstock and Valery Fremaux
Security Level: None
QA Assignee: Helen Foster
Resolved date: 17/Jun/08
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_18_STABLE


 Description  « Hide
The informations about the types of help files are not available via the ressource/types.html file.

http://19.moodle.de/help.php?module=moodle&file=resource/types.html&forcelang=
This link openes the ressource/types/*.html files and integrates them in the window.

Actual only the resource/types/label.html is integrated.

The screenshot shows two different views on the same help file.
left side : actual version right side: elder version.

This behaviour is not related to the translation!



The ressources/types*.html files should also be available in the settings page for the ressource.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Helen Foster added a comment - 29/Sep/07 02:21 PM
Moodle 1.8 is also affected.

Valery Fremaux added a comment - 04/Oct/07 05:04 AM
Issue is in a change in the resource_get_type output.

This affects the
include_help_for_each_resource($file, $langs, $helpdir)
functon in help.html

This function should extract the "type" value from the $typrec->type string that is now resource&type=<typename>

Following code fixes the issue, recodeing the way this function gets files : Note that although I signal wherethe major fix is, it affects entire code of the function.

Note again that I prepared the code for eventual reintegration of all module docs and language files within the module directory so that a module should be entirely self-contained.

function include_help_for_each_resource($file, $langs, $helpdir) {
global $CFG;

require_once($CFG->dirroot .'/mod/resource/lib.php');
$typelist = resource_get_types();
//**** HERE IS THE FIX ****//
foreach($typelist as $aType){
if (preg_match("/type=(.*)/", $aType->type, $matches)){ $typeset[] = $matches[1]; }
}
$typeset[] = 'label';
//$typeset['label'] = get_string('resourcetypelabel', 'resource');

foreach ($typeset as $type) {
//**** HERE IS THE FIX END ****//
foreach ($langs as $lang) {
if (empty($lang)) { continue; }

$filepath = "$helpdir/resource/type/{$type}.html";

// If that does not exist, try a fallback into the module code folder.
if (!file_exists($filepath)) {
$filepath = "$CFG->dirroot/mod/resource/lang/$lang/help/resource/type/{$type}.html";
}

if (file_exists_and_readable($filepath)) { echo '<hr size="1" />'; @include($filepath); // The actual helpfile break; // Out of loop over languages. }
}
}
}


Eloy Lafuente (stronk7) added a comment - 12/May/08 09:27 AM
Assigning this to Jérôme... ciao

Jerome Mouneyrac added a comment - 16/May/08 04:17 PM
Patch attached. Thank you Valery

Eloy Lafuente (stronk7) added a comment - 22/May/08 09:10 AM
Uhm...

perhaps... I would modify the resource_get_types() function to return one more attribute, say, $type->name or $type->code or something like that.

And them, I'd use that new attribute directly in help.php

Ciao


Jerome Mouneyrac added a comment - 16/Jun/08 11:04 AM
new patch attached (I fixed XHTML issue too)

Eloy Lafuente (stronk7) added a comment - 17/Jun/08 09:02 AM
Looks perfect for me. If it also works... +1 :-D

Thanks, ciao


Jerome Mouneyrac added a comment - 17/Jun/08 10:02 AM
commited and tested in 1.8 Stable, 1.9 Stable and HEAD

Helen Foster added a comment - 17/Jun/08 04:49 PM
Ralf, thanks for reporting this issue, Valery and Eloy, thanks for your contributions, and Jerome, thanks for fixing it