Skip to content

Commit

Permalink
Merge branch 'MDL-47899-master' of https://github.com/lucaboesch/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Jul 11, 2018
2 parents fd2b5d5 + aab977e commit c2164bf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 3 additions & 1 deletion course/renderer.php
Expand Up @@ -435,6 +435,9 @@ function course_search_form($value = '', $format = 'plain') {
$output .= html_writer::empty_tag('input', array('type' => 'submit',
'value' => get_string('go')));
$output .= html_writer::end_tag('fieldset');
if ($format != 'navbar') {
$output .= $this->output->help_icon("coursesearch", "core");
}
$output .= html_writer::end_tag('form');

return $output;
Expand Down Expand Up @@ -1853,7 +1856,6 @@ public function search_courses($searchcriteria) {
// just print search form
$content .= $this->box_start('generalbox mdl-align');
$content .= $this->course_search_form();
$content .= html_writer::tag('div', get_string("searchhelp"), array('class' => 'searchhelp'));
$content .= $this->box_end();
}
return $content;
Expand Down
13 changes: 7 additions & 6 deletions lang/en/moodle.php
Expand Up @@ -383,6 +383,13 @@
$string['coursesettings'] = 'Course default settings';
$string['coursesmovedout'] = 'Courses moved out from {$a}';
$string['coursespending'] = 'Courses pending approval';
$string['coursesearch'] = 'Search courses';
$string['coursesearch_help'] = '<p>You can search for multiple words at once and can refine your search as follows:</p>
<ul>
<li>word - find any match of this word within the text.</li>
<li>+word - only exact matching words will be found.</li>
<li>-word - don\'t include results containing this word.</li>
</ul>';
$string['coursestart'] = 'Course start';
$string['coursesummary'] = 'Course summary';
$string['coursesummary_help'] = 'The course summary is displayed in the list of courses. A course search searches course summary text in addition to course names.';
Expand Down Expand Up @@ -1743,12 +1750,6 @@
$string['searchbyemail'] = 'Search by email address';
$string['searchbyusername'] = 'Search by username';
$string['searchcourses'] = 'Search courses';
$string['searchhelp'] = '<p>You can search for multiple words at once and can refine your search as follows:</p>
<ul>
<li>word - find any match of this word within the text.</li>
<li>+word - only exact matching words will be found.</li>
<li>-word - don\'t include results containing this word.</li>
</ul>';
$string['searchoptions'] = 'Search options';
$string['searchresults'] = 'Search results';
$string['sec'] = 'sec';
Expand Down
4 changes: 4 additions & 0 deletions theme/boost/classes/output/core/course_renderer.php
Expand Up @@ -74,6 +74,10 @@ public function course_search_form($value = '', $format = 'plain') {
'inputsize' => $inputsize,
'value' => $value
];
if ($format != 'navbar') {
$helpicon = new \help_icon('coursesearch', 'core');
$data->helpicon = $helpicon->export_for_template($this);
}

return $this->render_from_template('theme_boost/course_search_form', $data);
}
Expand Down
3 changes: 3 additions & 0 deletions theme/boost/templates/course_search_form.mustache
Expand Up @@ -19,5 +19,8 @@
<label for="{{inputid}}">{{#str}}searchcourses{{/str}}</label>
<input id="{{inputid}}" name="search" type="text" size="{{inputsize}}" value="{{value}}" class="form-control">
<button class="btn btn-secondary" type="submit">{{#str}}go{{/str}}</button>
{{#helpicon}}
{{>core/help_icon}}
{{/helpicon}}
</fieldset>
</form>

0 comments on commit c2164bf

Please sign in to comment.