Commit 0824fc66 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Add hidden label to site search box (Bug #1262867)"

parents c2b75ace f19fd70a
......@@ -1404,12 +1404,19 @@ EOF;
$requiredmarker = '';
}
if (!empty($element['hiddenlabel'])) {
$labelclass = ' class="accessible-hidden"';
}
else {
$labelclass = '';
}
if (!empty($element['nolabel'])) {
// Don't bother with a label for the element
$element['labelhtml'] = $title . $requiredmarker;
}
else {
$element['labelhtml'] = '<label for="' . $this->name . '_' . $element['id'] . '">' . $title . $requiredmarker . '</label>';
$element['labelhtml'] = '<label' . $labelclass . ' for="' . $this->name . '_' . $element['id'] . '">' . $title . $requiredmarker . '</label>';
}
}
......
......@@ -111,7 +111,9 @@ class PluginSearchElasticsearch extends PluginSearch {
'query' => array(
'type' => 'text',
'defaultvalue' => get_string('pagetitle', 'search.elasticsearch'),
'title' => get_string('pagetitle', 'search.elasticsearch'),
'class' => 'emptyonfocus',
'hiddenlabel' => true,
),
'submit' => array(
'type' => 'submit',
......
......@@ -211,7 +211,9 @@ abstract class PluginSearch extends Plugin {
'query' => array(
'type' => 'text',
'defaultvalue' => get_string('searchusers'),
'title' => get_string('searchusers'),
'class' => 'emptyonfocus',
'hiddenlabel' => true,
),
'submit' => array(
'type' => 'submit',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment