summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-06-06 15:24:14 -0700
committerAndy Staudacher <andy.st@gmail.com>2009-06-06 15:24:14 -0700
commit0e415dae9b29d792f631d3b94349086b8094c920 (patch)
treeedc30275caff571f2d447dd517f42d94fb3e38d7 /modules
parent329bd8caa126040ba7abaf28e8f76e0b6739ceff (diff)
Preliminary BiDi support (needs *a lot* of tweaking)
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/css/l10n_client.css12
-rw-r--r--modules/gallery/helpers/locale.php6
-rw-r--r--modules/gallery/libraries/MY_View.php7
-rw-r--r--modules/gallery/views/admin_block_log_entries.html.php2
4 files changed, 20 insertions, 7 deletions
diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css
index 6616f511..dd8d5c5d 100644
--- a/modules/gallery/css/l10n_client.css
+++ b/modules/gallery/css/l10n_client.css
@@ -71,7 +71,9 @@ how it wants to round. */
#l10n-client-string-select {
display:none;
float:left;
- width:25%;}
+ width:25%;
+ direction: ltr;
+}
#l10n-client .string-list {
height:17em;
@@ -150,15 +152,17 @@ how it wants to round. */
float:left;
width:74%;}
- #l10n-client-string-editor .source {
+#l10n-client-string-editor .source {
overflow:hidden;
width:50%; float:left;}
- #l10n-client-string-editor .source .source-text {
+#l10n-client-string-editor .source .source-text {
line-height:1.5em;
background:#eee;
height:16em; margin:1em; padding:1em;
- overflow:auto;}
+ overflow:auto;
+ direction: ltr;
+}
#l10n-client-string-editor .translation {
overflow:hidden;
diff --git a/modules/gallery/helpers/locale.php b/modules/gallery/helpers/locale.php
index c176dcc6..9783a53a 100644
--- a/modules/gallery/helpers/locale.php
+++ b/modules/gallery/helpers/locale.php
@@ -114,7 +114,9 @@ class locale_Core {
return self::$locales["$locale"];
}
- static function is_rtl($locale) {
- return in_array($locale, array("he_IL", "fa_IR", "ar_SA"));
+ static function is_rtl($locale=null) {
+ $locale or $locale = I18n::instance()->locale();
+ list ($language, $territory) = explode('_', $locale . "_");
+ return in_array($language, array("he", "fa", "ar"));
}
} \ No newline at end of file
diff --git a/modules/gallery/libraries/MY_View.php b/modules/gallery/libraries/MY_View.php
index 836d1087..bd2794a0 100644
--- a/modules/gallery/libraries/MY_View.php
+++ b/modules/gallery/libraries/MY_View.php
@@ -43,4 +43,11 @@ class View extends View_Core {
return "";
}
}
+
+ public function main_element_attributes() {
+ if (locale::is_rtl()) {
+ return 'class="rtl"';
+ }
+ return '';
+ }
}
diff --git a/modules/gallery/views/admin_block_log_entries.html.php b/modules/gallery/views/admin_block_log_entries.html.php
index 5d8f3084..38070fe1 100644
--- a/modules/gallery/views/admin_block_log_entries.html.php
+++ b/modules/gallery/views/admin_block_log_entries.html.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.") ?>
<ul>
<? foreach ($entries as $entry): ?>
- <li class="<?= log::severity_class($entry->severity) ?>">
+ <li class="<?= log::severity_class($entry->severity) ?>" style="direction: ltr">
<a href="<?= url::site("user/$entry->user_id") ?>"><?= p::clean($entry->user->name) ?></a>
<?= date("Y-M-d H:i:s", $entry->timestamp) ?>
<?= $entry->message ?>