Permalink
Browse files

MDL-34572 accessibility compliance for repository: add label for form…

… input text and select tag
  • Loading branch information...
1 parent 6109f21 commit 4bde11528bdfe34e66160a639f45f605581c36d5 @rwijaya rwijaya committed Nov 5, 2012
View
@@ -929,7 +929,12 @@ public function filepicker_js_templates() {
* Default contents is one text input field with name="s"
*/
public function repository_default_searchform() {
- $str = '<div class="fp-def-search"><input name="s" value='.get_string('search', 'repository').' /></div>';
+ $searchinput = html_writer::label(get_string('searchrepo', 'repository'),
+ 'reposearch', false, array('class' => 'accesshide'));
+ $searchinput .= html_writer::empty_tag('input', array('type' => 'text',
+ 'id' => 'reposearch', 'name' => 's', 'value' => get_string('search', 'repository')));
+ $str = html_writer::tag('div', $searchinput, array('class' => "fp-def-search"));
+
return $str;
}
}
View
@@ -191,6 +191,7 @@
$string['automatedbackup'] = 'Automated backups';
$string['search'] = 'Search';
$string['searching'] = 'Search in';
+$string['searchrepo'] = 'Search repository';
$string['select'] = 'Select';
$string['settings'] = 'Settings';
$string['setupdefaultplugins'] = 'Setting up default repository plugins';
@@ -32,4 +32,5 @@
$string['pluginname_help'] = 'A plug-in for Alfresco CMS';
$string['pluginname'] = 'Alfresco repository';
$string['soapmustbeenabled'] = 'SOAP extension must be enabled for alfresco plugin';
+$string['space'] = 'Space';
$string['username'] = 'User name';
@@ -219,7 +219,9 @@ public function get_link($uuid) {
public function print_search() {
$str = parent::print_search();
- $str .= '<label>Space: </label><br /><select name="space">';
+ $str .= html_writer::label(get_string('space', 'repository_alfresco'), 'space');
+ $str .= html_writer::empty_tag('br');
+ $str .= '<select id="space" name="space">';
foreach ($this->user_session->stores as $v) {
$str .= '<option ';
if ($v->__toString() === 'workspace://SpacesStore') {
@@ -111,7 +111,8 @@
$home_url->param('draftpath', $draftpath);
$home_url->param('action', 'rename');
echo ' <form method="post" action="'.$home_url->out().'">';
- echo ' <input name="newfilename" type="text" value="'.s($filename).'" />';
+ echo html_writer::label(get_string('enternewname', 'repository'), 'newfilename', array('class' => 'accesshide'));
+ echo ' <input id="newfilename" name="newfilename" type="text" value="'.s($filename).'" />';
echo ' <input name="filename" type="hidden" value="'.s($filename).'" />';
echo ' <input name="draftpath" type="hidden" value="'.s($draftpath).'" />';
echo ' <input type="submit" value="'.s(get_string('rename', 'moodle')).'" />';
@@ -227,7 +228,8 @@
$home_url->param('draftpath', $draftpath);
$home_url->param('action', 'mkdir');
echo ' <form method="post" action="'.$home_url->out().'">';
- echo ' <input name="newdirname" type="text" />';
+ echo html_writer::label(get_string('entername', 'repository'), 'newdirname', array('class' => 'accesshide'));
+ echo ' <input name="newdirname" id="newdirname" type="text" />';
echo ' <input name="draftpath" type="hidden" value="'.s($draftpath).'" />';
echo ' <input type="submit" value="'.s(get_string('makeafolder', 'moodle')).'" />';
echo ' </form>';
@@ -351,8 +351,8 @@
echo '<form method="post">';
echo '<table>';
echo ' <tr>';
- echo ' <td><label>'.get_string('filename', 'repository').'</label></td>';
- echo ' <td><input type="text" name="filename" value="'.s($filename).'" /></td>';
+ echo ' <td>'. html_writer::label(get_string('filename', 'repository'), 'filename'). '</td>';
+ echo ' <td><input type="text" id="filename" name="filename" value="'.s($filename).'" /></td>';
echo ' <td><input type="hidden" name="fileurl" value="'.s($fileurl).'" /></td>';
echo ' <td><input type="hidden" name="action" value="download" /></td>';
echo ' <td><input type="hidden" name="itemid" value="'.s($itemid).'" /></td>';

0 comments on commit 4bde115

Please sign in to comment.