aboutsummaryrefslogtreecommitdiffstats
path: root/en
diff options
context:
space:
mode:
Diffstat (limited to 'en')
-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>