Related to issue 17077: Support RTL in Openbravo 3.0
authorMartin Taal <martin.taal@openbravo.com>
Mon, 18 Jul 2011 14:38:22 +0200
changeset 13180 9daad2b86943
parent 13179 34e7dbfb658c
child 13181 01f6a13554f4
Related to issue 17077: Support RTL in Openbravo 3.0
Changes to show RTL languages as RTL, disabled one line to keep RTL as LTR
src/index.jsp
src/org/openbravo/dal/core/OBContext.java
--- a/src/index.jsp	Mon Jul 18 12:13:13 2011 +0200
+++ b/src/index.jsp	Mon Jul 18 14:38:22 2011 +0200
@@ -1,5 +1,6 @@
 <%@ page import="java.util.Properties" %>
 <%@ page import="org.openbravo.base.HttpBaseServlet" %>
+<%@ page import="org.openbravo.dal.core.OBContext"%>
 <%@ page import="org.openbravo.base.util.OBClassLoader" %>
 <%@ page import="org.openbravo.base.session.OBPropertiesProvider" %>
 <%@ page import="org.openbravo.authentication.AuthenticationManager" %>
@@ -123,7 +124,7 @@
 </style>
 
 </head>
-<body>
+<body dir="<%=(OBContext.getOBContext().isRTL() ? "RTL" : "LTR")%>">
 
 <!-- shows the loading div -->
 <div class="OBLoadingPromptModalMask" id="OBLoadingDiv">
--- a/src/org/openbravo/dal/core/OBContext.java	Mon Jul 18 12:13:13 2011 +0200
+++ b/src/org/openbravo/dal/core/OBContext.java	Mon Jul 18 14:38:22 2011 +0200
@@ -464,6 +464,8 @@
   private boolean isAdministrator;
   private boolean isInitialized = false;
 
+  private boolean isRTL = false;
+
   private Set<String> additionalWritableOrganizations = new HashSet<String>();
 
   // support storing the context in a persistent tomcat session
@@ -591,6 +593,8 @@
 
   public void setLanguage(Language language) {
     this.language = language;
+    // uncomment this line to see RTL for RTL languages
+    // setRTL(language.isRTLLanguage());
   }
 
   public Organization getCurrentOrganization() {
@@ -1087,4 +1091,12 @@
       return doOrgClientAccessCheck;
     }
   }
+
+  public boolean isRTL() {
+    return isRTL;
+  }
+
+  public void setRTL(boolean isRTL) {
+    this.isRTL = isRTL;
+  }
 }
\ No newline at end of file