Skip to content

Commit

Permalink
Fix: #0007484: implement RTL css
Browse files Browse the repository at this point in the history
  • Loading branch information
siebrand committed Apr 27, 2009
1 parent 023b302 commit e9cbf60
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 1 deletion.
7 changes: 7 additions & 0 deletions config_defaults_inc.php
Expand Up @@ -2746,6 +2746,13 @@
*/
$g_css_include_file = 'css/default.css';

/**
* RTL CSS file
* @global string $g_css_rtl_include_file
*/
$g_css_rtl_include_file = 'css/rtl.css';


/**
* meta tags
* @global string $g_meta_include_file
Expand Down
1 change: 1 addition & 0 deletions core/config_api.php
Expand Up @@ -597,6 +597,7 @@ function config_is_private( $p_config_var ) {
case 'bottom_include_page':
case 'top_include_page':
case 'css_include_file':
case 'css_rtl_include_file':
case 'meta_include_file':
case 'log_level':
case 'log_destination':
Expand Down
6 changes: 6 additions & 0 deletions core/html_api.php
Expand Up @@ -304,6 +304,12 @@ function html_css() {
$t_css_url = config_get( 'css_include_file' );
echo "\t", '<link rel="stylesheet" type="text/css" href="', helper_mantis_url( $t_css_url ), '" />', "\n";

# Add right-to-left css if needed
if( lang_get( 'directionality' ) == 'rtl' ) {
$t_css_rtl_url = config_get( 'css_rtl_include_file' );
echo "\t", '<link rel="stylesheet" type="text/css" href="', helper_mantis_url( $t_css_rtl_url ), '" />', "\n";
}

# fix for NS 4.x css
echo "\t", '<script type="text/javascript" language="JavaScript"><!--', "\n";
echo "\t\t", 'if(document.layers) {document.write("<style>td{padding:0px;}<\/style>")}', "\n";
Expand Down
74 changes: 74 additions & 0 deletions css/rtl.css
@@ -0,0 +1,74 @@
html {
direction: rtl;
}

td {
text-align: right;
}

td.left {
text-align: right;
}

td.right {
text-align: left;
}

td.form-title {
text-align: right;
}

td.form-title-caps {
text-align: right;
}

td.print {
text-align: right;
}

td.print-category {
text-align: left;
}

tr.row-category-history td {
text-align: right;
}

td.login-info-left {
text-align: right;
}

td.login-info-right {
text-align: left;
}

td.news-heading-public {
text-align: right;
}

td.news-heading-private {
text-align: right;
}

div.quick-summary-left {
text-align: right;
float: right;
}

div.quick-summary-right {
text-align: left;
float: left;
}

.left {
text-align: right;
}

.right {
text-align: left;
}

.avatar
{
float: left;
}
8 changes: 7 additions & 1 deletion docbook/adminguide/en/configuration.sgml
Expand Up @@ -1491,7 +1491,7 @@
<varlistentry>
<term>$g_top_include_page</term>
<listitem>
<para>If this page eixsts it will be displayed at the top of every
<para>If this page exists it will be displayed at the top of every
page. It makes a good company branding include page.
</para>
</listitem>
Expand All @@ -1502,6 +1502,12 @@
<para>Set this to point to the CSS file of your choice.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_css_rtl_include_file</term>
<listitem>
<para>Set this to point to the RTL CSS file of your choice.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>$g_meta_include_file</term>
<listitem>
Expand Down
1 change: 1 addition & 0 deletions lang/strings_arabic.txt
Expand Up @@ -31,6 +31,7 @@
*/

$s_charset = 'utf-8';
$s_directionality = 'rtl';
$s_actiongroup_menu_move = 'نقل';
$s_actiongroup_menu_copy = 'نسخ';
$s_actiongroup_menu_assign = 'توكيل';
Expand Down
1 change: 1 addition & 0 deletions lang/strings_arabicegyptianspoken.txt
Expand Up @@ -30,6 +30,7 @@
*/

$s_charset = 'utf-8';
$s_directionality = 'rtl';
$s_actiongroup_menu_move = 'نقل';
$s_actiongroup_menu_copy = 'نسخ';
$s_actiongroup_menu_assign = 'توكيل';
Expand Down
1 change: 1 addition & 0 deletions lang/strings_english.txt
Expand Up @@ -29,6 +29,7 @@

# Charset
$s_charset = 'utf-8';
$s_directionality = 'ltr';

# Group commands menuitems
$s_actiongroup_menu_move = 'Move';
Expand Down
1 change: 1 addition & 0 deletions lang/strings_hebrew.txt
Expand Up @@ -34,6 +34,7 @@
*/

$s_charset = 'utf-8';
$s_directionality = 'rtl';
$s_actiongroup_menu_move = 'העברה';
$s_actiongroup_menu_copy = 'העתקה';
$s_actiongroup_menu_assign = 'שיוך';
Expand Down
1 change: 1 addition & 0 deletions lang/strings_urdu.txt
Expand Up @@ -32,6 +32,7 @@
*/

$s_charset = 'utf-8';
$s_directionality = 'rtl';
$s_actiongroup_menu_move = 'حرکت مين لاو';
$s_actiongroup_menu_copy = 'نقل کرو';
$s_actiongroup_menu_assign = 'سپرد کرو';
Expand Down

0 comments on commit e9cbf60

Please sign in to comment.