$stylesheetshtml .= '<link rel="stylesheet" type="text/css" href="'.$stylesheet.'" />'."\n";
}
///Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
- $language = str_replace('_utf8','',$CFG->lang);
- $languagehtml = '';
- $languagehtml .= ' lang="'.$language.'" xml:lang="'.$language.'"';
+ $languagehtml = get_html_lang($dir=true);
+
//Write the header in the new logging file
fwrite ($restorelog_file,"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"");
fwrite ($restorelog_file," \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> ");
fclose($restorelog);
}
}
-?>
+?>
\ No newline at end of file
return (join('', $parts));
}
+/**
+ * Return a string containing 'lang', xml:lang and optionally 'dir' HTML attributes.
+ * Internationalisation, for print_header and backup/restorelib.
+ * @param $dir Default false.
+ * @return string Attributes.
+ */
+function get_html_lang($dir = false) {
+ $direction = '';
+ if ($dir) {
+ if (get_string('thisdirection') == 'rtl') {
+ $direction = ' dir="rtl"';
+ } else {
+ $direction = ' dir="ltr"';
+ }
+ }
+ //Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
+ $language = str_replace('_', '-', str_replace('_utf8', '', current_language()));
+ return ($direction.' lang="'.$language.'" xml:lang="'.$language.'"');
+}
+
/// STANDARD WEB PAGE PARTS ///////////////////////////////////////////////////
@header('Content-type: text/html; charset=utf-8');
}
- if ( get_string('thisdirection') == 'rtl' ) {
- $direction = ' dir="rtl"';
- } else {
- $direction = ' dir="ltr"';
- }
//Accessibility: added the 'lang' attribute to $direction, used in theme <html> tag.
- $language = str_replace('_', '-', str_replace('_utf8', '', current_language()));
- $direction .= ' lang="'.$language.'" xml:lang="'.$language.'"';
+ $direction = get_html_lang($dir=true);
if ($cache) { // Allow caching on "back" (but not on normal clicks)
@header('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
+?>
\ No newline at end of file