Question about setHelpButton

Question about setHelpButton

by Victor Martin -
Number of replies: 5
Hi, when I create a button with setHelpButton, once you press it, a window appears telling me Help file "labels.html" could not be found! And I know it's because the file is not in the path moodle/lang/en_utf8/help/khronos. But what I need to know, is how I can make search this file in the directory of my module, because It will be installed this module on another machines by other people, and It is a requirement that people do not have to touch anything.

I have defined the button like this:

$mform->addElement('text', $newElement, get_string($newElement.'modform', 'khronos'), array('size'=>'64'));
$mform->setHelpButton($newElement, array($newElement, get_string($newElement.'modform', 'khronos')), 'khronos');

THANKS
Average of ratings: -
In reply to Victor Martin

Re: Question about setHelpButton

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you are using Moodle 2.x, then you should replace the old setHelpButton with the new addHelpButton.

If your are doing development, then you should have Debugging set to DEVELOPER level, and if you do that, you will get helpful messages about deprecated functions like this.

In reply to Tim Hunt

Re: Question about setHelpButton

by Victor Martin -

Sorry, I did not say that I am developing a module for Moodle 1.9. I have the system in Debugging mode yet.

In reply to Victor Martin

Re: Question about setHelpButton

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

http://docs.moodle.org/dev/Places_to_search_for_lang_strings#Adding_language_support_to_a_plugin

You need to put the help in 

mod/khronos/lang/en_utf8/help/khronos/labels.html

 

In reply to Tim Hunt

Re: Question about setHelpButton

by Victor Martin -

Thanks Tim! But It continues showing me that couldn't found the file, I'm on Linux, do you know if I need to give some privileges of reading, writing or executing?

Merry Christmas!

In reply to Victor Martin

Re: Question about setHelpButton

by Darko Miletić -

All moodle files should be marked like this on Linux:

chown -R root:<web server group> <moodle location>

chmod -R u=rwX,g=rX,o= <moodle location>

for example on redhat based distros web server group is apache.