function addHelpButton($elementname, $identifier, $component = 'moodle', $linktext = '', $suppresscheck = false) {
        global $OUTPUT;
        if (array_key_exists($elementname, $this->_elementIndex)) {
            $element = $this->_elements[$this->_elementIndex[$elementname]];
            $element->_helpbutton = $OUTPUT->help_icon($identifier, $component, $linktext);
        } else if (!$suppresscheck) {
            debugging(get_string('nonexistentformelements', 'form', $elementname));
        }
    }
function addHelpButton($elementname, $identifier, $component = 'moodle', $linktext = '', $suppresscheck = false) {
        global $OUTPUT;
        if (array_key_exists($elementname, $this->_elementIndex)) {
            $element = $this->_elements[$this->_elementIndex[$elementname]];
            $element->_helpbutton = $OUTPUT->help_icon($identifier, $component, $linktext);
        } else if (!$suppresscheck) {
            debugging(get_string('nonexistentformelements', 'form', $elementname));
        }
    }
function addHelpButton ( $ elementname , $ identifier , $ component = 'moodle' , $ linktext = '' , $ suppresscheck = false ) { global $ OUTPUT ; if ( array_key_exists ( $ elementname , $ this -> _elementIndex ) ) { $ element = $ this -> _elements [ $ this -> _elementIndex [ $ elementname ] ] ; $ element -> _helpbutton = $ OUTPUT -> help_icon ( $ identifier , $ component , $ linktext ) ; } else if ( ! $ suppresscheck ) { debugging ( get_string ( 'nonexistentformelements' , 'form' , $ elementname ) ) ; } }
Add a help button to element, only one button per element is allowed.

This is new, simplified and preferable method of setting a help icon on form elements.
It uses the new $OUTPUT->help_icon().

Typically, you will provide the same identifier and the component as you have used for the
label of the element. The string identifier with the _help suffix added is then used
as the help string.

There has to be two strings defined:
1/ get_string($identifier, $component) - the title of the help page
2/ get_string($identifier.'_help', $component) - the actual help page text

@since Moodle 2.0
@param string $elementname name of the element to add the item to
@param string $identifier help string identifier without _help suffix
@param string $component component name to look the help string in
@param string $linktext optional text to display next to the icon
@param bool $suppresscheck set to true if the element may not exist
Add a help button to element only one button per element is allowed .