summaryrefslogtreecommitdiff
path: root/program/include/rcmail_output_html.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-06-05 09:18:07 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-06-05 09:18:07 +0200
commit99cdca46b7bcc46fe6affd9e9f9f60a546b2e5b8 (patch)
treee3d0bec8e981825e98681fb4d5ec1ec73ee65c40 /program/include/rcmail_output_html.php
parent17a76c3fd7665e92d2160f2178e31b3821a98e1e (diff)
parent3412e50b54e3daac8745234e21ab6e72be0ed165 (diff)
Merge branch 'dev-accessibility'
Conflicts: program/include/rcmail_output_html.php program/js/app.js program/js/treelist.js program/lib/Roundcube/html.php skins/larry/styles.css skins/larry/templates/compose.html
Diffstat (limited to 'program/include/rcmail_output_html.php')
-rw-r--r--program/include/rcmail_output_html.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php
index 43d73a6b4..6594209f6 100644
--- a/program/include/rcmail_output_html.php
+++ b/program/include/rcmail_output_html.php
@@ -893,6 +893,14 @@ EOF;
return '';
}
+ // localize title and summary attributes
+ if ($command != 'button' && !empty($attrib['title']) && $this->app->text_exists($attrib['title'])) {
+ $attrib['title'] = $this->app->gettext($attrib['title']);
+ }
+ if ($command != 'button' && !empty($attrib['summary']) && $this->app->text_exists($attrib['summary'])) {
+ $attrib['summary'] = $this->app->gettext($attrib['summary']);
+ }
+
// execute command
switch ($command) {
// return a button
@@ -1165,6 +1173,17 @@ EOF;
$attrib['alt'] = html::quote($this->app->gettext($attrib['alt'], $attrib['domain']));
}
+ // set accessibility attributes
+ if (!$attrib['role']) {
+ $attrib['role'] = 'button';
+ }
+ if (!empty($attrib['class']) && !empty($attrib['classact']) || !empty($attrib['imagepas']) && !empty($attrib['imageact'])) {
+ if (array_key_exists('tabindex', $attrib))
+ $attrib['data-tabindex'] = $attrib['tabindex'];
+ $attrib['tabindex'] = '-1'; // disable button by default
+ $attrib['aria-disabled'] = 'true';
+ }
+
// set title to alt attribute for IE browsers
if ($this->browser->ie && !$attrib['title'] && $attrib['alt']) {
$attrib['title'] = $attrib['alt'];
@@ -1353,6 +1372,20 @@ EOF;
$is_empty = true;
}
+ // set default page title
+ if (empty($this->pagetitle)) {
+ $this->pagetitle = 'Roundcube Mail';
+ }
+
+ // declare page language
+ if (!empty($_SESSION['language'])) {
+ $lang = substr($_SESSION['language'], 0, 2);
+ $output = preg_replace('/<html/', '<html lang="' . html::quote($lang) . '"', $output, 1);
+ if (!headers_sent()) {
+ header('Content-Language: ' . $lang);
+ }
+ }
+
// replace specialchars in content
$page_title = html::quote($this->pagetitle);
$page_header = '';