aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfilip <filip.komar@gmail.com>2020-10-25 21:45:32 +0100
committerfilip <filip.komar@gmail.com>2020-10-25 21:45:32 +0100
commit2882b91642de93238a530d4d064a03335aacbcce (patch)
tree4a4a37a574888531e9584d7e0378bebe0753c6db
parent148e98a3d8891d48ed8c7576fcdeb9395caa53fb (diff)
downloadwww-2882b91642de93238a530d4d064a03335aacbcce.tar
www-2882b91642de93238a530d4d064a03335aacbcce.tar.gz
www-2882b91642de93238a530d4d064a03335aacbcce.tar.bz2
www-2882b91642de93238a530d4d064a03335aacbcce.tar.xz
www-2882b91642de93238a530d4d064a03335aacbcce.zip
adding RTL support for timeline page
-rw-r--r--en/timeline/index.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/en/timeline/index.php b/en/timeline/index.php
index d6ecc1539..4de3a8b9c 100644
--- a/en/timeline/index.php
+++ b/en/timeline/index.php
@@ -3,6 +3,7 @@ define('HLANG', true);
define('ALIGNMENT', 'Center');
require '../../langs.php';
$dictionary = read_translation_file($locale, array('timeline', 'common_footer'));
+$rtl = is_locale_rtl($locale);
/**
* Output all events
@@ -11,20 +12,20 @@ $dictionary = read_translation_file($locale, array('timeline', 'common_footer'))
*
* @return string $timeline html code of all events
*/
-function list_events($events = array())
+function list_events($events = array(), $rtl = false)
{
$indent = "\t\t\t\t";
$timeline = '';
foreach ($events as $year => $events_in_year) {
$timeline .= "$indent<li class=\"tliy\">\n";
- $timeline .= "$indent\t<h2>$year</h2>\n";
+ $timeline .= "$indent\t<h2 " . ($rtl ? 'style="text-align: right;"' : '') . ">$year</h2>\n";
$timeline .= "$indent\t<ul class=\"hl\">\n";
foreach ($events_in_year as $month => $events_in_month) {
$timeline .= "$indent\t\t<li class=\"tlim\">\n";
- $timeline .= "$indent\t\t\t<h3>$month</h3>\n";
+ $timeline .= "$indent\t\t\t<h3 " . ($rtl ? 'style="text-align: right;"' : '') . ">$month</h3>\n";
$timeline .= "$indent\t\t\t<ul class=\"hl\">\n";
foreach ($events_in_month as $event) {
- $timeline .= "$indent\t\t\t\t<li class=\"tlie\">$event</li>\n";
+ $timeline .= "$indent\t\t\t\t<li " . ($rtl ? 'style="text-align: right;"' : '') . " class=\"tlie\">$event</li>\n";
}
$timeline .= "$indent\t\t\t</ul>\n";
$timeline .= "$indent\t\t</li>\n";
@@ -87,7 +88,7 @@ $events = array(
);
?>
<!DOCTYPE html>
-<html lang="<?php echo $locale; ?>">
+<html <?php echo $rtl ? 'dir="rtl"' : 'dir="ltr"'?> lang="<?php echo $locale; ?>">
<head>
<meta charset="utf-8">
<title><?php _g('Mageia Timeline')?></title>
@@ -115,7 +116,7 @@ $events = array(
<div id="bd" role="main">
<div class="yui-g"><div class="para">
<ul class="hl" id="tl0">
-<?php echo list_events($events); ?>
+<?php echo list_events($events, $rtl); ?>
</ul>
</div></div>
</div>