Author Topic: Default_RTL skin  (Read 4857 times)

Offline zakwanhaj

  • Newbie
  • *
  • Posts: 1
Default_RTL skin
« on: November 17, 2008, 10:26:00 AM »
Some languages are written in a form known as right-to-left (RTL) like Arabic, Hebrew, etc.. .

I have added default_rtl directory which contains the default skin but in RTL direction
also there are some changes on config and settings files:

1st: find default_rtl.zip in attachment, unzip and put it in /skins directory

2nd: apply this patch on /config/main.inc.php

Indexmain.inc.php.dist
===================================================================
--- 
main.inc.php.dist   (revision 2060)
+++ 
main.inc.php.dist   (working copy)
@@ -
337,+337,14 @@
 
// skin name: folder from skins/
 
$rcmail_config['skin'] = 'default';

+
// which languages are written in a form known as right-to-left (RTL)
+// ex: array('lang_shortcut_1', 'lang_shortcut_2', ..)
+$rcmail_config['rtl_languages'] = array('ar_SA');
+
+
// the skins are written in RTL
+// ex: array('ltr_skin_1' => 'rtl_skin_1', 'ltr_skin_2' => 'rtl_skin_2', ..)
+$rcmail_config['rtl_skins'] = array('default' => 'default_rtl');
+
 
// show up to X items in list view
 
$rcmail_config['pagesize'] = 40;
3rd: apply this on /program/steps/setting/save_prefs.inc.

Indexsave_prefs.inc
===================================================================
--- 
save_prefs.inc      (revision 2060)
+++ 
save_prefs.inc      (working copy)
@@ -
69,+69,18 @@
   
$RCMAIL->load_language($a_user_prefs['language']);
 }

+if (
in_array($a_user_prefs['language'], (array)$CONFIG['rtl_languages'])) {
+    if (
array_key_exists($a_user_prefs['skin'], $CONFIG['rtl_skins'])){
+      
$a_user_prefs['skin'] = $CONFIG['rtl_skins'][$a_user_prefs['skin']];
+    }
+}
+else
+{
+    if (!
array_key_exists($a_user_prefs['skin'], $CONFIG['rtl_skins'])){
+      
$a_user_prefs['skin'] = array_search($a_user_prefs['skin'], $CONFIG['rtl_skins']);
+    }
+}
+
 
// switch skin
 
$OUTPUT->set_skin($a_user_prefs['skin']);
4th: and apply the last patch on /program/steps/settings/func.inc
Indexfunc.inc
===================================================================
--- 
func.inc    (revision 2060)
+++ 
func.inc    (working copy)
@@ -
394,+394,@@

 function 
rcmail_get_skins()
   {
+  global 
$RCMAIL;
+  
$config $RCMAIL->config->all();
+
   
$path 'skins';
   
$skins = array();

@@ -
407,+410,@@
     
$filename $path.'/'.$file;
     if (
is_dir($filename) && is_readable($filename)
        && !
in_array($file, array('.''..''.svn')))
+    if (
array_search($file$config['rtl_skins']) == false ){
       
$skins[] = $file;
+     }
     }

   
closedir($dir);
     One thing that I couldn't covert it to RTL. it is vertical splitter in both mail page and addressbook page so I have committed it out in RTL interface.

     After performing all steps in the above, go to preferences and select Arabic language then click save.

That's it :) .