mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
Merge branch 'MDL-78746-master' of https://github.com/aanabit/moodle
This commit is contained in:
commit
ca3c8f70a1
@ -207,8 +207,9 @@ trait form_trait {
|
||||
$completionexpectedel = 'completionexpected' . $suffix;
|
||||
$mform->addElement('date_time_selector', $completionexpectedel, get_string('completionexpected', 'completion'),
|
||||
['optional' => true]);
|
||||
$mform->addHelpButton($completionexpectedel, 'completionexpected', 'completion');
|
||||
$mform->hideIf($completionexpectedel, $completionel, 'eq', COMPLETION_TRACKING_NONE);
|
||||
$a = get_string('pluginname', $modname);
|
||||
$mform->addHelpButton($completionexpectedel, 'completionexpected', 'completion', '', false, $a);
|
||||
$mform->hideIf($completionexpectedel, 'completion', 'eq', COMPLETION_TRACKING_NONE);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,8 +91,8 @@ $string['completionactivitydefault'] = 'Use activity default';
|
||||
$string['completiondefault'] = 'Default completion tracking';
|
||||
$string['completiondisabled'] = 'Disabled, not shown in activity settings';
|
||||
$string['completionenabled'] = 'Enabled, control via completion and activity settings';
|
||||
$string['completionexpected'] = 'Expect completed on';
|
||||
$string['completionexpected_help'] = 'This setting specifies the date when the activity is expected to be completed. When the date is upcoming, the activity is listed in the Timeline block on the Dashboard.';
|
||||
$string['completionexpected'] = 'Set reminder in Timeline';
|
||||
$string['completionexpected_help'] = 'This allows you to set a reminder for students to work on this activity. It will appear on the Timeline block in their Dashboard as "{$a} requires action"';
|
||||
$string['completionexpecteddesc'] = 'Completion expected on {$a}';
|
||||
$string['completionexpectedfor'] = '{$a->instancename} should be completed';
|
||||
$string['completionicons'] = 'Completion tick boxes';
|
||||
|
@ -2354,12 +2354,21 @@ class MoodleQuickForm extends HTML_QuickForm_DHTMLRulesTableless {
|
||||
* @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
|
||||
* @param string|object|array|int $a An object, string or number that can be used
|
||||
* within translation strings
|
||||
*/
|
||||
function addHelpButton($elementname, $identifier, $component = 'moodle', $linktext = '', $suppresscheck = false) {
|
||||
public function addHelpButton(
|
||||
$elementname,
|
||||
$identifier,
|
||||
$component = 'moodle',
|
||||
$linktext = '',
|
||||
$suppresscheck = false,
|
||||
$a = null
|
||||
) {
|
||||
global $OUTPUT;
|
||||
if (array_key_exists($elementname, $this->_elementIndex)) {
|
||||
$element = $this->_elements[$this->_elementIndex[$elementname]];
|
||||
$element->_helpbutton = $OUTPUT->help_icon($identifier, $component, $linktext);
|
||||
$element->_helpbutton = $OUTPUT->help_icon($identifier, $component, $linktext, $a);
|
||||
} else if (!$suppresscheck) {
|
||||
debugging(get_string('nonexistentformelements', 'form', $elementname));
|
||||
}
|
||||
|
@ -456,6 +456,11 @@ class help_icon implements renderable, templatable {
|
||||
*/
|
||||
public $linktext = null;
|
||||
|
||||
/**
|
||||
* @var mixed An object, string or number that can be used within translation strings
|
||||
*/
|
||||
public $a = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -463,10 +468,13 @@ class help_icon implements renderable, templatable {
|
||||
* string with _help suffix is used for the actual help text.
|
||||
* string with _link suffix is used to create a link to further info (if it exists)
|
||||
* @param string $component
|
||||
* @param string|object|array|int $a An object, string or number that can be used
|
||||
* within translation strings
|
||||
*/
|
||||
public function __construct($identifier, $component) {
|
||||
public function __construct($identifier, $component, $a = null) {
|
||||
$this->identifier = $identifier;
|
||||
$this->component = $component;
|
||||
$this->a = $a;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -491,7 +499,7 @@ class help_icon implements renderable, templatable {
|
||||
public function export_for_template(renderer_base $output) {
|
||||
global $CFG;
|
||||
|
||||
$title = get_string($this->identifier, $this->component);
|
||||
$title = get_string($this->identifier, $this->component, $this->a);
|
||||
|
||||
if (empty($this->linktext)) {
|
||||
$alt = get_string('helpprefix2', '', trim($title, ". \t"));
|
||||
@ -499,7 +507,7 @@ class help_icon implements renderable, templatable {
|
||||
$alt = get_string('helpwiththis');
|
||||
}
|
||||
|
||||
$data = get_formatted_help_string($this->identifier, $this->component, false);
|
||||
$data = get_formatted_help_string($this->identifier, $this->component, false, $this->a);
|
||||
|
||||
$data->alt = $alt;
|
||||
$data->icon = (new pix_icon('help', $alt, 'core', ['class' => 'iconhelp']))->export_for_template($output);
|
||||
|
@ -2521,13 +2521,15 @@ class core_renderer extends renderer_base {
|
||||
* @param string $identifier The keyword that defines a help page
|
||||
* @param string $component component name
|
||||
* @param string|bool $linktext true means use $title as link text, string means link text value
|
||||
* @param string|object|array|int $a An object, string or number that can be used
|
||||
* within translation strings
|
||||
* @return string HTML fragment
|
||||
*/
|
||||
public function help_icon($identifier, $component = 'moodle', $linktext = '') {
|
||||
$icon = new help_icon($identifier, $component);
|
||||
public function help_icon($identifier, $component = 'moodle', $linktext = '', $a = null) {
|
||||
$icon = new help_icon($identifier, $component, $a);
|
||||
$icon->diag_strings();
|
||||
if ($linktext === true) {
|
||||
$icon->linktext = get_string($icon->identifier, $icon->component);
|
||||
$icon->linktext = get_string($icon->identifier, $icon->component, $a);
|
||||
} else if (!empty($linktext)) {
|
||||
$icon->linktext = $linktext;
|
||||
}
|
||||
|
@ -79,6 +79,8 @@ information provided here is intended especially for developers.
|
||||
* The behat step I choose "WHATEVER" in the open action menu is now compatible with action menus subpanels
|
||||
using the ">" symbol to suparate the item link text and subitem one. For example:
|
||||
- I choose "Group mode > Visible groups" in the open action menu
|
||||
* addHelpButton() function has a new optional $a parameter to allow variables with translation strings.
|
||||
* help_icon constructor has a new optional $a parameter to allow variables with translation strings.
|
||||
|
||||
=== 4.2 ===
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user