phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: developer_tools/inc class.bolangfile.inc.php,1.


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: developer_tools/inc class.bolangfile.inc.php,1.8.2.2,1.8.2.3 class.solangfile.inc.php,1.9.2.4,1.9.2.5 class.uilangfile.inc.php,1.10.2.1,1.10.2.2 header.inc.php,1.7.2.1,1.7.2.2 class.bochangelogs.inc.php,1.3,NONE class.bosf_project_tracker.inc.php,1.4,NONE class.sochangelogs.inc.php,1.3,NONE class.sosf_project_tracker.inc.php,1.4,NONE class.uichangelogs.inc.php,1.3,NONE class.uisf_project_tracker.inc.php,1.4,NONE hook_preferences.inc.php,1.3.2.1,NONE
Date: Mon, 07 Apr 2003 10:50:51 -0400

Update of /cvsroot/phpgroupware/developer_tools/inc
In directory subversions:/tmp/cvs-serv22406/inc

Modified Files:
      Tag: Version-0_9_14-branch
        class.bolangfile.inc.php class.solangfile.inc.php 
        class.uilangfile.inc.php header.inc.php 
Removed Files:
      Tag: Version-0_9_14-branch
        class.bochangelogs.inc.php class.bosf_project_tracker.inc.php 
        class.sochangelogs.inc.php class.sosf_project_tracker.inc.php 
        class.uichangelogs.inc.php class.uisf_project_tracker.inc.php 
        hook_preferences.inc.php 
Log Message:
imported the new TranslationTools into .14


Index: class.bolangfile.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/developer_tools/inc/class.bolangfile.inc.php,v
retrieving revision 1.8.2.2
retrieving revision 1.8.2.3
diff -C2 -r1.8.2.2 -r1.8.2.3
*** class.bolangfile.inc.php    2 Jul 2002 01:42:24 -0000       1.8.2.2
--- class.bolangfile.inc.php    7 Apr 2003 14:50:48 -0000       1.8.2.3
***************
*** 16,22 ****
                var $total;
                var $debug = False;
-               var $public_functions = array(
-                       'index' => True
-               );
                var $so;
                var $loaded_apps = array();
--- 16,19 ----
***************
*** 24,28 ****
--- 21,27 ----
                var $missing_langarray = '';
                var $target_langarray = '';
+               var $common_langarray = '';
                var $src_file;
+               var $src_apps = '';
                var $tgt_file;
                var $tgt_lang;
***************
*** 36,50 ****
                }
  
-               function cmp($a,$b)
-               {
-                       $c = strtolower($a);
-                       $d = strtolower($b);
-                       if ($c == $d)
-                       {
-                               return 0;
-                       }
-                       return ($c < $d) ? -1 : 1;
-               }
- 
                /* Sessions used to save state and not reread the langfile 
between adding/deleting phrases */
                function save_sessiondata($source,$target)
--- 35,38 ----
***************
*** 58,61 ****
--- 46,50 ----
                        
$GLOBALS['phpgw']->session->appsession('developer_t_lang','developer_tools',$this->tgt_lang);
                        
$GLOBALS['phpgw']->session->appsession('developer_loaded_apps','developer_tools',$this->loaded_apps);
+                       
$GLOBALS['phpgw']->session->appsession('developer_src_apps','developer_tools',$this->src_apps);
                }
  
***************
*** 72,81 ****
                        $tgt_lang = 
$GLOBALS['phpgw']->session->appsession('developer_t_lang','developer_tools');
                        $loaded_apps = 
$GLOBALS['phpgw']->session->appsession('developer_loaded_apps','developer_tools');
  
!                       
$this->set_sessiondata($source,$target,$src_file,$tgt_file,$tgt_lang,$loaded_apps);
!                       return;
                }
  
!               function 
set_sessiondata($source,$target,$src_file,$tgt_file,$tgt_lang,$loaded_apps)
                {
                        $this->source_langarray = $source;
--- 61,70 ----
                        $tgt_lang = 
$GLOBALS['phpgw']->session->appsession('developer_t_lang','developer_tools');
                        $loaded_apps = 
$GLOBALS['phpgw']->session->appsession('developer_loaded_apps','developer_tools');
+                       $src_apps = 
$GLOBALS['phpgw']->session->appsession('developer_src_apps','developer_tools');
  
!                       
$this->set_sessiondata($source,$target,$src_file,$tgt_file,$tgt_lang,$loaded_apps,$src_apps);
                }
  
!               function 
set_sessiondata($source,$target,$src_file,$tgt_file,$tgt_lang,$loaded_apps,$src_apps)
                {
                        $this->source_langarray = $source;
***************
*** 85,89 ****
                        $this->tgt_lang = $tgt_lang;
                        $this->loaded_apps = $loaded_apps;
! 
                }
  
--- 74,78 ----
                        $this->tgt_lang = $tgt_lang;
                        $this->loaded_apps = $loaded_apps;
!                       $this->src_apps = $src_apps;
                }
  
***************
*** 98,108 ****
                }
  
-               function list_apps()
-               {
-                       $apps = $this->so->list_apps();
-                       $this->total = $this->so->total;
-                       return $apps;
-               }
- 
                function list_langs()
                {
--- 87,90 ----
***************
*** 121,126 ****
                        );
                        @ksort($this->source_langarray);
-                       /* _debug_array($this->source_langarray);exit; */
-                       return;
                }
  
--- 103,106 ----
***************
*** 129,133 ****
                        if ($mess !='' && 
($this->missing_langarray[$mess]['message_id']))
                        {
!                               $this->source_langarray[$mess] = array(
                                        'message_id' => 
$this->missing_langarray[$mess]['message_id'],
                                        'content'    => 
$this->missing_langarray[$mess]['content'],
--- 109,113 ----
                        if ($mess !='' && 
($this->missing_langarray[$mess]['message_id']))
                        {
!                               $this->source_langarray[$mess] = $m = array(
                                        'message_id' => 
$this->missing_langarray[$mess]['message_id'],
                                        'content'    => 
$this->missing_langarray[$mess]['content'],
***************
*** 137,161 ****
                                @ksort($this->source_langarray);
                                reset($this->source_langarray);
  
                        }
!                       /*echo '<HR>'.$mess.'<HR><pre>';
!                       print_r($this->source_langarray[$mess]);
!                       print_r($this->missing_langarray);
!                       echo '</pre>';*/
!                       return;
                }
  
                function missing_app($app,$userlang='en')
                {
!                       //$this->src_file = $this->so->src_file;
!                       //if ($this->missing_langarray=='')
!                       //{
!                       //$this->missing_langarray=array();
                        $plist = $this->so->missing_app($app,$userlang);
!                       while (list($p,$loc) = each($plist))
                        {
- //                            if 
((!$this->source_langarray[strtolower($p)])&&(!$this->source_langarray[$p]))
                                $_mess_id = strtolower(trim($p));
!                               if (!$this->source_langarray[$_mess_id])
                                {
                                        
$this->missing_langarray[$_mess_id]['message_id'] = $_mess_id;
--- 117,143 ----
                                @ksort($this->source_langarray);
                                reset($this->source_langarray);
+                               
+                               if ($this->tgt_lang == 'en')
+                               {
+                                       $this->target_langarray[$mess] = $m;
  
+                                       @ksort($this->target_langarray);
+                                       reset($this->target_langarray);
+                               }
                        }
!                       //else echo "'$mess' not found in missing_langarray 
!!!<br>\n";
                }
  
                function missing_app($app,$userlang='en')
                {
!                       if (!is_array($this->common_langarray))
!                       {
!                               $this->common_langarray = 
$this->so->add_app('phpgwapi',$userlang);
!                       }
                        $plist = $this->so->missing_app($app,$userlang);
!                       foreach($plist as $p => $loc)
                        {
                                $_mess_id = strtolower(trim($p));
!                               if (!empty($_mess_id) && 
!$this->source_langarray[$_mess_id] && !$this->common_langarray[$_mess_id])
                                {
                                        
$this->missing_langarray[$_mess_id]['message_id'] = $_mess_id;
***************
*** 164,168 ****
                                }
                        }
-                       //}
                        if (is_array($this->missing_langarray))
                        {
--- 146,149 ----
***************
*** 170,174 ****
                                @ksort($this->missing_langarray);               
        
                        }
- //                    
$this->save_sessiondata($this->bo->source_langarray,$this->bo->target_langarray);
                        return $this->missing_langarray;
                }
--- 151,154 ----
***************
*** 183,186 ****
--- 163,167 ----
                        $this->src_file = $this->so->src_file;
                        $this->loaded_apps = $this->so->loaded_apps;
+                       $this->src_apps = $this->so->src_apps;
                        return $this->source_langarray;
                }

Index: class.solangfile.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/developer_tools/inc/class.solangfile.inc.php,v
retrieving revision 1.9.2.4
retrieving revision 1.9.2.5
diff -C2 -r1.9.2.4 -r1.9.2.5
*** class.solangfile.inc.php    28 Feb 2003 15:44:35 -0000      1.9.2.4
--- class.solangfile.inc.php    7 Apr 2003 14:50:48 -0000       1.9.2.5
***************
*** 23,26 ****
--- 23,35 ----
                var $tgt_file;
                var $loaded_apps = array(); // Loaded app langs
+               
+               var $functions = array(         // functions containing phrases 
to translate and param#
+                       'lang' => array(1),
+                       'create_input_box' => array(1,3),
+                       'create_check_box' => array(1,3),
+                       'create_select_box' => array(1,4),
+                       'create_text_area' => array(1,5),
+                       'create_password_box' => array(1,3)
+               );
  
                var $public_functions = array(
***************
*** 33,52 ****
                }
  
-               function isin_array($needle,$haystack)
-               {
-                       while (list ($k,$v) = each($haystack))
-                       {
-                               if ($v == $needle)
-                               {
-                                       return True;
-                               }
-                       }
-                       return False;
-               }
- 
-               //Known Issue, if a phrase contains a ' or a " the parse will 
be thrown off. unless ' are nested inside " or vice versa
                function parse_php_app($fd,$plist)
                {
                        define('SEP',filesystem_separator());
                        $d=dir($fd);
                        while ($fn=$d->read())
--- 42,50 ----
                }
  
                function parse_php_app($fd,$plist)
                {
+                       $reg_expr = 
'('.implode('|',array_keys($this->functions)).")[ \t]*\([ \t]*(.*)$";
                        define('SEP',filesystem_separator());
+                       list($app) = explode(SEP,$fd);
                        $d=dir($fd);
                        while ($fn=$d->read())
***************
*** 61,91 ****
                                elseif ((strpos($fn,'.php')>1) && 
(is_readable($fd.$fn)))
                                {
!                                       $fp=fopen($fd.SEP.$fn,'r');
!                                       $fds=substr($fd,strpos($fd,SEP));
!                                       while (!feof($fp))
                                        {
!                                               $str=fgets($fp,8192);
!                                               while 
(strlen($str=$this->strstr_multiple($str,'lang','(','')))
                                                {
!                                                       if ($str[0]=="\"" || 
$str[0]=="'")
                                                        {
!                                                               if ($str[0] == 
"'")
                                                                {
!                                                                       
$str=substr($str,1);
!                                                                       
$s2=substr($str,0,strpos($str,"'"));
                                                                }
!                                                               else
                                                                {
!                                                                       
$str=substr($str,1);
!                                                                       
$s2=substr($str,0,strpos($str,"\""));
                                                                }
!                                                               if ($s2!='')
                                                                {
!                                                                       
$plist[$s2]=$fds;
                                                                }
                                                        }
                                                }
                                        }
-                                       fclose($fp);
                                }
                        }
--- 59,114 ----
                                elseif ((strpos($fn,'.php')>1) && 
(is_readable($fd.$fn)))
                                {
!                                       $lines = file($fd.SEP.$fn);
! 
!                                       foreach($lines as $n => $line)
                                        {
!                                               //echo "line='$line', 
lines[1+$n]='".$lines[1+$n]."'<br>\n";
!                                               while 
(eregi($reg_expr,$line,$parts))
                                                {
!                                                       //echo 
"***func='$parts[1]', rest='$parts[2]'<br>\n";
!                                                       $args = 
$this->functions[$parts[1]];
!                                                       $rest = $parts[2];
!                                                       for($i = 1; $i <= 
$args[0]; ++$i)
                                                        {
!                                                               $next = 1;
!                                                               if (!$rest || 
strpos($rest,$del,1) === False)
                                                                {
!                                                                       $rest 
.= trim($lines[++$n]);
                                                                }
!                                                               $del = $rest[0];
!                                                               if ($del == '"' 
|| $del == "'")
                                                                {
!                                                                       //echo 
"rest='$rest'<br>\n";
!                                                                       while 
(($next = strpos($rest,$del,$next)) !== False && $rest[$next-1] == '\\')
!                                                                       {
!                                                                               
$rest = substr($rest,0,$next-1).substr($rest,$next);
!                                                                       }
!                                                                       if 
($next === False)
!                                                                       {
!                                                                               
break;
!                                                                       }
!                                                                       $phrase 
= substr($rest,1,$next-1);
!                                                                       //echo 
"next2=$next, phrase='$phrase'<br>\n";
!                                                                       if 
($args[0] == $i)
!                                                                       {
!                                                                               
//if (!isset($plist[$phrase])) echo ">>>$phrase<<<<br>\n";
!                                                                               
$plist[$phrase] = $app;
!                                                                               
array_shift($args);
!                                                                               
if (!count($args))
!                                                                               
{
!                                                                               
        break;  // no more args needed
!                                                                               
}
!                                                                       }
!                                                                       $rest = 
substr($rest,$next+1);
                                                                }
!                                                               if(!ereg("[ 
\t\n]*,[ \t\n]*(.*)$",$rest,$parts)) 
                                                                {
!                                                                       break;  
// nothing found
                                                                }
+                                                               $rest = 
$parts[1];
                                                        }
+                                                       $line = $rest;
                                                }
                                        }
                                }
                        }
***************
*** 94,134 ****
                }
  
-               /*!
-               @function strstr_multiple
-               @abstract search for a substring consisted of parts separated 
by whitespaces
-               @param $str original string
-               @param $sub1 first part of substring
-               @param $sub2 second part of substring
-               @result returns portion of $str from the end of substring to 
the end of $str, or empty string if substring was not found
-               */
-               function strstr_multiple($str,$sub1,$sub2)
-               {
-                       if (isset($sub1))
-                       {
-                               if(is_integer($pos=strpos($str,$sub1)))
-                               {
-                                       $str=substr($str,$pos+strlen($sub1));
-                                       if (isset($sub2))
-                                       {
-                                               $str=ltrim($str);
-                                               if(substr($str,0,strlen($sub2)) 
== $sub2)
-                                               {
-                                                       
$str=substr($str,strlen($sub2));
-                                                       return $str;
-                                               }
-                                       }
-                                       else
-                                       {
-                                               return $str;
-                                       }
-                               }
-                       }
-                       else
-                       {
-                               return $str;
-                       }
-                       return "";
-               }
- 
                function missing_app($app,$userlang=en)
                {
--- 117,120 ----
***************
*** 153,165 ****
                        $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup';
                        $fn = $fd . SEP . 'phpgw_' . $userlang . '.lang';
!                       if (is_writeable($fn))
                        {
                                $wr = True;
                        }
!                       elseif(!file_exists($fn) && is_writeable($fd))
  
-                       {
-                               $wr = True;
-                       }
                        if (file_exists($fn))
                        {
--- 139,148 ----
                        $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup';
                        $fn = $fd . SEP . 'phpgw_' . $userlang . '.lang';
!                       if (@is_writeable($fn) || is_writeable($fd))
                        {
                                $wr = True;
                        }
!                       $this->src_apps = array($app => $app);
  
                        if (file_exists($fn))
                        {
***************
*** 175,181 ****
                                        //echo '<br>add_app(): adding phrase: 
$this->langarray["'.$message_id.'"]=' . trim($content);
                                        $_mess_id = 
strtolower(trim($message_id));
                                        
$this->langarray[$_mess_id]['message_id'] = $_mess_id;
!                                       $this->langarray[$_mess_id]['app_name'] 
  = trim($app_name);
                                        $this->langarray[$_mess_id]['content']  
  = trim($content);
                                }
                                fclose($fp);
--- 158,166 ----
                                        //echo '<br>add_app(): adding phrase: 
$this->langarray["'.$message_id.'"]=' . trim($content);
                                        $_mess_id = 
strtolower(trim($message_id));
+                                       $app_name = trim($app_name);
                                        
$this->langarray[$_mess_id]['message_id'] = $_mess_id;
!                                       $this->langarray[$_mess_id]['app_name'] 
  = $app_name;
                                        $this->langarray[$_mess_id]['content']  
  = trim($content);
+                                       $this->src_apps[$app_name] = $app_name;
                                }
                                fclose($fp);
***************
*** 205,213 ****
                        $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup';
                        $fn = $fd . SEP . 'phpgw_' . $userlang . '.lang';
!                       if (@is_writeable($fn))
!                       {
!                               $wr = True;
!                       }
!                       elseif(!file_exists($fn) && is_writeable($fd))
                        {
                                $wr = True;
--- 190,194 ----
                        $fd = PHPGW_SERVER_ROOT . SEP . $app . SEP . 'setup';
                        $fn = $fd . SEP . 'phpgw_' . $userlang . '.lang';
!                       if (@is_writeable($fn) || is_writeable($fd))
                        {
                                $wr = True;
***************
*** 247,274 ****
                }
  
!               function list_apps()
                {
!                       $this->db->query("SELECT * FROM 
phpgw_applications",__LINE__,__FILE__);
!                       if($this->db->num_rows())
                        {
!                               while($this->db->next_record())
!                               {
!                                       $name   = $this->db->f('app_name');
!                                       $title  = $this->db->f('app_title');
!                                       $apps[$name] = array(
!                                               'title'  => $title,
!                                               'name'   => $name
!                                       );
!                               }
                        }
!                       @reset($apps);
!                       $this->total = count($apps);
!                       if ($this->debug) { _debug_array($apps); }
!                       return $apps;
!               }
! 
!               function list_langs()
!               {
!                       $this->db->query("SELECT lang_id,lang_name FROM 
languages ORDER BY lang_name");
                        $i = 0;
                        while ($this->db->next_record())
--- 228,243 ----
                }
  
!               function list_langs()
                {
!                       $this->db->query("SELECT DISTINCT lang FROM lang");
!                       while($this->db->next_record())
                        {
!                               $lang = $this->db->f('lang');
!                               $installed[] = $lang;
                        }
!                       $installed = "('".implode("','",$installed)."')"; 
!                       
!                       // this shows first the installed, then the available 
and then the rest
!                       $this->db->query("SELECT lang_id,lang_name,lang_id IN 
$installed as installed FROM languages ORDER BY installed DESC,available 
DESC,lang_name");
                        $i = 0;
                        while ($this->db->next_record())
***************
*** 286,289 ****
--- 255,264 ----
                {
                        $fn = PHPGW_SERVER_ROOT . SEP . $app_name . SEP . 
'setup' . SEP . 'phpgw_' . $userlang . '.lang';
+                       if (file_exists($fn))
+                       {
+                               $backup = $fn . '.old';
+                               @unlink($backup);
+                               @rename($fn,$backup);
+                       }
                        $fp = fopen($fn,'wb');
                        while(list($mess_id,$data) = @each($langarray))
***************
*** 304,312 ****
                        while (list($x,$data) = @each($langarray))
                        {
                                $addit = False;
                                /*echo '<br><br><pre> checking ' . 
$data['message_id'] . "\t" . $data['app_name'] . "\t" . $userlang . "\t" . 
$data['content'];*/
                                $this->db->query("SELECT COUNT(*) FROM lang"
!                                       ."  WHERE message_id='" . 
$this->db->db_addslashes($data['message_id'])
!                                       ."' AND lang='$userlang' AND 
app_name='$app_name'",__LINE__,__FILE__);
                                $this->db->next_record();
  
--- 279,293 ----
                        while (list($x,$data) = @each($langarray))
                        {
+                               if (strlen($data['message_id']) > 
MAX_MESSAGE_ID_LENGTH)
+                               {
+                                       $data['message_id'] = 
substr($data['message_id'],0,MAX_MESSAGE_ID_LENGTH);
+                               }
+                               
+                               $message_id = 
$this->db->db_addslashes(substr($data['message_id'],0,MAX_MESSAGE_ID_LENGTH));
+ 
                                $addit = False;
                                /*echo '<br><br><pre> checking ' . 
$data['message_id'] . "\t" . $data['app_name'] . "\t" . $userlang . "\t" . 
$data['content'];*/
                                $this->db->query("SELECT COUNT(*) FROM lang"
!                                       ."  WHERE message_id='$message_id' AND 
lang='$userlang' AND app_name='$app_name'",__LINE__,__FILE__);
                                $this->db->next_record();
  
***************
*** 326,332 ****
                                        {
                                                /* echo "<br>adding - insert 
into lang values ('" . $data['message_id'] . "','$app_name','$userlang','" . 
$data['content'] . "')"; */
!                                               $this->db->query("INSERT into 
lang VALUES ('"
!                                                       . 
$this->db->db_addslashes($data['message_id'])
!                                                       . 
"','$app_name','$userlang','"
                                                        . 
$this->db->db_addslashes($data['content']) . "')",__LINE__,__FILE__);
                                        }
--- 307,311 ----
                                        {
                                                /* echo "<br>adding - insert 
into lang values ('" . $data['message_id'] . "','$app_name','$userlang','" . 
$data['content'] . "')"; */
!                                               $this->db->query("INSERT into 
lang VALUES ('$message_id','$app_name','$userlang','"
                                                        . 
$this->db->db_addslashes($data['content']) . "')",__LINE__,__FILE__);
                                        }
***************
*** 337,341 ****
                                        {
                                                $this->db->query("UPDATE lang 
SET content='". $this->db->db_addslashes($data['content']) . "'"
!                                                       . " WHERE message_id='" 
. $this->db->db_addslashes($data['message_id']) . "'"
                                                        . " AND 
app_name='$app_name' AND lang='$userlang'",__LINE__,__FILE__);
                                                if ($this->db->affected_rows() 
> 0)
--- 316,320 ----
                                        {
                                                $this->db->query("UPDATE lang 
SET content='". $this->db->db_addslashes($data['content']) . "'"
!                                                       . " WHERE 
message_id='message_id'"
                                                        . " AND 
app_name='$app_name' AND lang='$userlang'",__LINE__,__FILE__);
                                                if ($this->db->affected_rows() 
> 0)

Index: class.uilangfile.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/developer_tools/inc/class.uilangfile.inc.php,v
retrieving revision 1.10.2.1
retrieving revision 1.10.2.2
diff -C2 -r1.10.2.1 -r1.10.2.2
*** class.uilangfile.inc.php    30 Jun 2002 00:11:25 -0000      1.10.2.1
--- class.uilangfile.inc.php    7 Apr 2003 14:50:48 -0000       1.10.2.2
***************
*** 41,47 ****
                function load()
                {
!                       $app_name   = $GLOBALS['HTTP_POST_VARS']['app_name'];
!                       $sourcelang = $GLOBALS['HTTP_POST_VARS']['sourcelang'];
!                       $targetlang = $GLOBALS['HTTP_POST_VARS']['targetlang'];
  
                        $GLOBALS['phpgw']->common->phpgw_header();
--- 41,47 ----
                function load()
                {
!                       $app_name   = $_POST['app_name'];
!                       $sourcelang = $_POST['sourcelang'];
!                       $targetlang = $_POST['targetlang'];
  
                        $GLOBALS['phpgw']->common->phpgw_header();
***************
*** 50,119 ****
                        echo '<br>' . lang('Loading source langfile') . ': ' . 
$sourcelang . '... ';
                        echo $this->bo->loaddb($app_name,$sourcelang);
!                       echo '<br>' . lang('Loading target langfile') . ': ' . 
$targetlang . '... ';
!                       echo $this->bo->loaddb($app_name,$targetlang);
! 
!                       echo '<br><a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='
 . $app_name
!                               . '&sourcelang=' . $sourcelang . '&targetlang=' 
. $targetlang) . '">' . lang('ok') . '</a>';
                }
  
                function addphrase()
                {
!                       $app_name   = $GLOBALS['HTTP_POST_VARS']['app_name'];
!                       $sourcelang = $GLOBALS['HTTP_POST_VARS']['sourcelang'];
!                       $targetlang = $GLOBALS['HTTP_POST_VARS']['targetlang'];
!                       $entry      = $GLOBALS['HTTP_POST_VARS']['entry'];
!                       $submit     = $GLOBALS['HTTP_POST_VARS']['submit'];
  
                        $this->bo->read_sessiondata();
!                       if($submit)
                        {
!                               $this->bo->addphrase($entry);
!                               if ($sourcelang == $targetlang)
                                {
!                                       $this->bo->target_langarray = 
$this->bo->source_langarray;
                                }
!                               
$this->bo->save_sessiondata($this->bo->source_langarray,$this->bo->target_langarray);
! 
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='
 . $app_name
!                                       . '&sourcelang=' . $sourcelang . 
'&targetlang=' . $targetlang));
                        }
!                       else
!                       {
!                               $GLOBALS['phpgw']->common->phpgw_header();
!                               echo parse_navbar();
! 
!                               $this->template->set_file(array('form' => 
'addphrase.tpl'));
!                               
$this->template->set_var('message_id_field','<input size ="40" 
name="entry[message_id]">');
!                               
$this->template->set_var('translation_field','<input size ="40" 
name="entry[content]">');
!                               $this->template->set_var('app_name','<input 
type="hidden" name="entry[app_name]" value="'.$app_name.'">');
  
!                               
$this->template->set_var('lang_message',lang('Add new phrase'));
!                               
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.addphrase'));
!                               
$this->template->set_var('sourcelang',$sourcelang);
!                               
$this->template->set_var('targetlang',$targetlang);
!                               $this->template->set_var('app_name',$app_name);
  
!                               
$this->template->set_var('lang_message_id',lang('message_id in English'));
!                               
$this->template->set_var('lang_translation',lang('Phrase in English'));
!                               
$this->template->set_var('lang_button',lang('add'));
  
!                               $this->template->pfp('out','form');
!                               $GLOBALS['phpgw']->common->phpgw_footer();
!                       }
                }
  
                function missingphrase()
                {
!                       $app_name    = $GLOBALS['HTTP_POST_VARS']['app_name'] ? 
$GLOBALS['HTTP_POST_VARS']['app_name'] : $GLOBALS['HTTP_GET_VARS']['app_name'];
!                       $newlang     = $GLOBALS['HTTP_POST_VARS']['newlang'];
!                       $sourcelang  = $GLOBALS['HTTP_POST_VARS']['sourcelang'];
!                       $targetlang  = $GLOBALS['HTTP_POST_VARS']['targetlang'];
!                       $dlsource    = $GLOBALS['HTTP_POST_VARS']['dlsource'];
!                       $writesource = 
$GLOBALS['HTTP_POST_VARS']['writesource'];
!                       $dltarget    = $GLOBALS['HTTP_POST_VARS']['dltarget'];
!                       $writetarget = 
$GLOBALS['HTTP_POST_VARS']['writetarget'];
!                       $update      = $GLOBALS['HTTP_POST_VARS']['update'];
!                       $entry       = $GLOBALS['HTTP_POST_VARS']['entry'];
!                       $submit      = $GLOBALS['HTTP_POST_VARS']['submit'];
                        $this->bo->read_sessiondata();
  
--- 50,124 ----
                        echo '<br>' . lang('Loading source langfile') . ': ' . 
$sourcelang . '... ';
                        echo $this->bo->loaddb($app_name,$sourcelang);
!                       if ($sourcelang != $targetlang)
!                       {
!                               echo '<br>' . lang('Loading target langfile') . 
': ' . $targetlang . '... ';
!                               echo $this->bo->loaddb($app_name,$targetlang);
!                       }
!                       echo '<br><form method="post" action="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='
 . $app_name
!                               . '&sourcelang=' . $sourcelang . '&targetlang=' 
. $targetlang) . '"><input type="submit" name="Ok" value="' . lang('Ok') . 
'"></from>';
                }
  
                function addphrase()
                {
!                       $app_name   = $_POST['app_name'];
!                       $sourcelang = $_POST['sourcelang'];
!                       $targetlang = $_POST['targetlang'];
!                       $entry      = $_POST['entry'];
  
                        $this->bo->read_sessiondata();
!                       if($_POST['add'] || $_POST['cancel'])
                        {
!                               if($_POST['add'])
                                {
!                                       $this->bo->addphrase($entry);
!                                       if ($sourcelang == $targetlang)
!                                       {
!                                               $this->bo->target_langarray = 
$this->bo->source_langarray;
!                                       }
!                                       
$this->bo->save_sessiondata($this->bo->source_langarray,$this->bo->target_langarray);
                                }
!                               header('Location: 
'.$GLOBALS['phpgw']->link('/index.php',array(
!                                       'menuaction' => 
'developer_tools.uilangfile.edit',
!                                       'app_name'   => $app_name,
!                                       'sourcelang' => $sourcelang,
!                                       'targetlang' => $targetlang
!                               )));
!                               $GLOBALS['phpgw']->phpgw_exit();
                        }
!                       $GLOBALS['phpgw']->common->phpgw_header();
!                       echo parse_navbar();
  
!                       $this->template->set_file(array('form' => 
'addphrase.tpl'));
!                       $this->template->set_var('message_id_field','<input 
size ="40" name="entry[message_id]">');
!                       $this->template->set_var('translation_field','<input 
size ="40" name="entry[content]">');
!                       $this->template->set_var('app_name','<input 
type="hidden" name="entry[app_name]" value="'.$app_name.'">');
! 
!                       $this->template->set_var('lang_message',lang('Add new 
phrase'));
!                       
$this->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.addphrase'));
!                       $this->template->set_var('sourcelang',$sourcelang);
!                       $this->template->set_var('targetlang',$targetlang);
!                       $this->template->set_var('app_name',$app_name);
  
!                       
$this->template->set_var('lang_message_id',lang('message_id in English'));
!                       
$this->template->set_var('lang_translation',lang('Phrase in English'));
!                       $this->template->set_var('lang_add',lang('Add'));
!                       $this->template->set_var('lang_cancel',lang('Cancel'));
  
!                       $this->template->pfp('phpgw_body','form');
                }
  
                function missingphrase()
                {
!                       $app_name    = $_POST['app_name'] ? $_POST['app_name'] 
: $_GET['app_name'];
!                       $newlang     = $_POST['newlang'];
!                       $sourcelang  = $_POST['sourcelang'];
!                       $targetlang  = $_POST['targetlang'];
!                       $dlsource    = $_POST['dlsource'];
!                       $writesource = $_POST['writesource'];
!                       $dltarget    = $_POST['dltarget'];
!                       $writetarget = $_POST['writetarget'];
!                       $update      = $_POST['update'];
!                       $entry       = $_POST['entry'];
!                       $submit      = $_POST['submit'];
                        $this->bo->read_sessiondata();
  
***************
*** 123,130 ****
                        
$this->template->set_block('langfile','detail','detail');
                        
$this->template->set_block('langfile','prefooter','prefooter');
-                       
$this->template->set_block('langfile','srcwrite','srcwrite');
-                       
$this->template->set_block('langfile','tgtwrite','tgtwrite');
-                       
$this->template->set_block('langfile','srcdownload','srcdownload');
-                       
$this->template->set_block('langfile','tgtdownload','tgtdownload');
                        
$this->template->set_block('langfile','footer','footer');
                        if(!$sourcelang)
--- 128,131 ----
***************
*** 137,148 ****
                        }
                        $missingarray = 
$this->bo->missing_app($app_name,$sourcelang);
                        if ($update)
                        {
!                               $deleteme     = 
$GLOBALS['HTTP_POST_VARS']['delete'];
                                while (list($_mess,$_checked) = 
@each($deleteme))
                                {
                                        if($_checked == 'on')
                                        {
!                                               $_mess = 
$this->reverse_htmlspecialchars($_mess);
                                                $this->bo->movephrase($_mess);
                                                /* 
_debug_array($missingarray[$_mess]); */
--- 138,152 ----
                        }
                        $missingarray = 
$this->bo->missing_app($app_name,$sourcelang);
+                       //echo "missingarray=<pre>"; print_r($missingarray); 
echo "</pre>\n";
                        if ($update)
                        {
!                               $deleteme     = $_POST['delete'];
!                               //echo "deleteme=<pre>"; print_r($deleteme); 
echo "</pre>\n";
! 
                                while (list($_mess,$_checked) = 
@each($deleteme))
                                {
                                        if($_checked == 'on')
                                        {
!                                               $_mess = 
$this->recode_id($_mess);
                                                $this->bo->movephrase($_mess);
                                                /* 
_debug_array($missingarray[$_mess]); */
***************
*** 152,162 ****
                                }
                                unset($deleteme);
!                               /*
!                               if ($deleteme!='')
!                               {
!                                       echo 'tEST';
!                                       Header('Location: ' 
.$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='
 . $app_name)),TRUE);
!                                       exit;
!                               }*/
                        }
                        $GLOBALS['phpgw']->common->phpgw_header();
--- 156,170 ----
                                }
                                unset($deleteme);
! 
!                               if (!count($missingarray)) {    // if no 
phrases left, go direct back
!                                       
$this->bo->save_sessiondata($this->bo->source_langarray,$this->bo->target_langarray);
!                                       header('Location: 
'.$GLOBALS['phpgw']->link('/index.php',array(
!                                               'menuaction' => 
'developer_tools.uilangfile.edit',
!                                               'app_name'   => $app_name,
!                                               'sourcelang' => $sourcelang,
!                                               'targetlang' => $targetlang
!                                       )));
!                                       $GLOBALS['phpgw']->phpgw_exit();
!                               }
                        }
                        $GLOBALS['phpgw']->common->phpgw_header();
***************
*** 164,214 ****
                        include(PHPGW_APP_INC . '/header.inc.php');
  
!                       $this->template->set_var('lang_remove',lang('add 
phrase'));
                        
$this->template->set_var('lang_application',lang('Application'));
!                       // $this->template->set_var('lang_source',lang('Source 
Language'));
!                       // $this->template->set_var('lang_target',lang('Target 
Language'));
!                       // 
$this->template->set_var('lang_submit',lang('Submit'));
!                       $this->template->set_var('lang_update',lang('Update'));
!                       $this->template->set_var('lang_write',lang('Write'));
!                       // 
$this->template->set_var('lang_cancel',lang('Cancel'));
                        $this->template->set_var('lang_view',lang('Back'));
!                       $languages = $this->bo->list_langs();
!                       while (list($x,$_lang) = @each($languages))
!                       {
!                               $sourcelangs .= '      <option value="' . 
$_lang['lang_id'] . '"';
!                               if ($sourcelang)
!                               {
!                                       if ($_lang['lang_id'] == $sourcelang)
!                                       {
!                                               $sourcelangs .= ' selected';
!                                       }
!                               }
!                               elseif ($_lang['lang_id'] == 'EN')
!                               {
!                                       $sourcelangs .= ' selected';
!                               }
!                               $sourcelangs .= '>' . $_lang['lang_name'] . 
'</option>' . "\n";
!                       }
!                       @reset($languages);
!                       while (list($x,$_lang) = @each($languages))
!                       {
!                               $targetlangs .= '      <option value="' . 
$_lang['lang_id'] . '"';
!                               if ($targetlang)
!                               {
!                                       if ($_lang['lang_id'] == $targetlang)
!                                       {
!                                               $targetlangs .= ' selected';
!                                       }
!                               }
!                               elseif ($_lang['lang_id'] == 'EN')
!                               {
!                                       $targetlangs .= ' selected';
!                               }
!                               $targetlangs .= '>' . $_lang['lang_name'] . 
'</option>' . "\n";
!                       }
                        
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.missingphrase'));
!                       $this->template->set_var('sourcelangs',$sourcelangs);
!                       $this->template->set_var('targetlangs',$targetlangs);
                        $this->template->set_var('app_name',$app_name);
                        $this->template->pfp('out','header');
                        if($sourcelang && $targetlang)
--- 172,185 ----
                        include(PHPGW_APP_INC . '/header.inc.php');
  
!                       $this->template->set_var('lang_remove',lang('Add 
phrase'));
                        
$this->template->set_var('lang_application',lang('Application'));
!                       $this->template->set_var('lang_update',lang('Save'));
                        $this->template->set_var('lang_view',lang('Back'));
!                       
                        
$this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.missingphrase'));
!                       $this->template->set_var('sourcelang',$sourcelang);
!                       $this->template->set_var('targetlang',$targetlang);
                        $this->template->set_var('app_name',$app_name);
+                       
$this->template->set_var('app_title',$GLOBALS['phpgw_info']['apps'][$app_name]['title']);
                        $this->template->pfp('out','header');
                        if($sourcelang && $targetlang)
***************
*** 217,221 ****
                                
$this->template->set_var('lang_message',lang('Message'));
                                
$this->template->set_var('lang_original',lang('Original'));
-                               
//$this->template->set_var('lang_translation',lang('Translation'));
                                
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
                                $this->template->set_var('view_link',
--- 188,191 ----
***************
*** 226,262 ****
                                );
                                $this->template->pfp('out','postheader');
-                               //Is this needed? $translation is never used 
and bo->load_app() does nothing here.
-                               $translation = 
$this->bo->load_app($app_name,$targetlang);
-                               // 
$this->template->set_var('src_file',$this->bo->src_file);
                                while(list($key,$data) = @each($missingarray))
                                {
!                                       $mess_id  = $key;
!                                       $content  = $data['content'];
!                                       $transapp = $data['app_name'];
!                                       // $transy   = $content;
!                                       
$this->template->set_var('mess_id',htmlspecialchars($mess_id));
!                                       
$this->template->set_var('source_content',htmlspecialchars($content));
!                                       // 
$this->template->set_var('content',$GLOBALS['phpgw']->strip_html($transy));
!                                       
$this->template->set_var('transapp',$this->lang_option($app_name,$transapp,$mess_id));
                                        
$this->template->set_var('tr_color',$this->nextmatchs->alternate_row_color());
                                        $this->template->pfp('out','detail');
                                }
-                               // 
$this->template->set_var('sourcelang',$sourcelang);
-                               // 
$this->template->set_var('targetlang',$targetlang);
-                               // 
$this->template->set_var('app_name',$app_name);
                                $this->template->pfp('out','prefooter');
-                               // $this->template->pfp('out','srcdownload');
-                               
if($this->bo->loaded_apps[$sourcelang]['writeable'])
-                               {
-                                       $this->template->pfp('out','srcwrite');
-                               }
- 
-                               // 
$this->template->set_var('tgt_file',$this->bo->tgt_file);
-                               // 
$this->template->set_var('targetlang',$targetlang);
-                               // $this->template->pfp('out','tgtdownload');
-                               // 
if($this->bo->loaded_apps[$targetlang]['writeable'])
-                               // {
-                               //     $this->template->pfp('out','tgtwrite');
-                               // }
                                $this->template->pfp('out','footer');
                        }
--- 196,209 ----
                                );
                                $this->template->pfp('out','postheader');
                                while(list($key,$data) = @each($missingarray))
                                {
!                                       $mess_id  = $this->encode_id($key);
!                                       
$this->template->set_var('mess_id',$mess_id);
!                                       
$this->template->set_var('source_content',htmlspecialchars($data['content']));
!                                       
$this->template->set_var('transapp',$this->lang_option($app_name,$data['app_name'],$mess_id));
                                        
$this->template->set_var('tr_color',$this->nextmatchs->alternate_row_color());
                                        $this->template->pfp('out','detail');
                                }
                                $this->template->pfp('out','prefooter');
                                $this->template->pfp('out','footer');
                        }
***************
*** 267,288 ****
                function edit()
                {
!                       $app_name    = $GLOBALS['HTTP_POST_VARS']['app_name'] ? 
$GLOBALS['HTTP_POST_VARS']['app_name'] : $GLOBALS['HTTP_GET_VARS']['app_name'];
!                       $newlang     = $GLOBALS['HTTP_POST_VARS']['newlang'];
!                       $sourcelang  = $GLOBALS['HTTP_POST_VARS']['sourcelang'] 
? $GLOBALS['HTTP_POST_VARS']['sourcelang'] : 
$GLOBALS['HTTP_GET_VARS']['sourcelang'];
!                       $targetlang  = $GLOBALS['HTTP_POST_VARS']['targetlang'] 
? $GLOBALS['HTTP_POST_VARS']['targetlang'] : 
$GLOBALS['HTTP_GET_VARS']['targetlang'];
!                       $dlsource    = $GLOBALS['HTTP_POST_VARS']['dlsource'];
!                       $writesource = 
$GLOBALS['HTTP_POST_VARS']['writesource'];
!                       $dltarget    = $GLOBALS['HTTP_POST_VARS']['dltarget'];
!                       $writetarget = 
$GLOBALS['HTTP_POST_VARS']['writetarget'];
!                       $add_phrase  = $GLOBALS['HTTP_POST_VARS']['add_phrase'];
!                       $update      = $GLOBALS['HTTP_POST_VARS']['update'];
!                       $revert      = $GLOBALS['HTTP_POST_VARS']['revert'];
!                       $entry       = $GLOBALS['HTTP_POST_VARS']['entry'];
!                       $submit      = $GLOBALS['HTTP_POST_VARS']['submit'];
  
                        if($add_phrase)
                        {
!                               Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.addphrase&app_name='.$app_name
!                                       . '&sourcelang=' . $sourcelang . 
'&targetlang=' . $targetlang));
                        }
                        elseif ($revert)
--- 214,235 ----
                function edit()
                {
!                       $app_name    = $_POST['app_name'] ? $_POST['app_name'] 
: $_GET['app_name'];
!                       $newlang     = $_POST['newlang'];
!                       $sourcelang  = $_POST['sourcelang'] ? 
$_POST['sourcelang'] : $_GET['sourcelang'];
!                       $targetlang  = $_POST['targetlang'] ? 
$_POST['targetlang'] : $_GET['targetlang'];
!                       $dlsource    = $_POST['dlsource'];
!                       $writesource = $_POST['writesource'];
!                       $dltarget    = $_POST['dltarget'];
!                       $writetarget = $_POST['writetarget'];
!                       $add_phrase  = $_POST['add_phrase'];
!                       $update      = $_POST['update'];
!                       $revert      = $_POST['revert'];
!                       $entry       = $_POST['entry'];
!                       $submit      = $_POST['submit'];
  
                        if($add_phrase)
                        {
!                               
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.addphrase&app_name='.$app_name
!                                       . '&sourcelang=' . $sourcelang . 
'&targetlang=' . $targetlang);
                        }
                        elseif ($revert)
***************
*** 318,326 ****
                        
$this->template->set_block('langfile','postheader','postheader');
                        
$this->template->set_block('langfile','detail','detail');
!                       
$this->template->set_block('langfile','prefooter','prefooter');
!                       
$this->template->set_block('langfile','srcwrite','srcwrite');
!                       
$this->template->set_block('langfile','tgtwrite','tgtwrite');
!                       
$this->template->set_block('langfile','srcdownload','srcdownload');
!                       
$this->template->set_block('langfile','tgtdownload','tgtdownload');
                        
$this->template->set_block('langfile','footer','footer');
  
--- 265,269 ----
                        
$this->template->set_block('langfile','postheader','postheader');
                        
$this->template->set_block('langfile','detail','detail');
!                       
$this->template->set_block('langfile','detail_long','detail_long');
                        
$this->template->set_block('langfile','footer','footer');
  
***************
*** 330,341 ****
                        
$this->template->set_var('loaddb_url',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.load'));
                        $this->template->set_var('lang_remove',lang('Remove'));
!                       $this->template->set_var('lang_loaddb',lang('Write to 
lang table'));
                        
$this->template->set_var('lang_application',lang('Application'));
                        $this->template->set_var('lang_source',lang('Source 
Language'));
                        $this->template->set_var('lang_target',lang('Target 
Language'));
!                       $this->template->set_var('lang_submit',lang('Submit'));
!                       $this->template->set_var('lang_update',lang('Update'));
                        $this->template->set_var('lang_revert',lang('Revert'));
                        $this->template->set_var('lang_cancel',lang('Cancel'));
  
                        $languages = $this->bo->list_langs();
--- 273,295 ----
                        
$this->template->set_var('loaddb_url',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.load'));
                        $this->template->set_var('lang_remove',lang('Remove'));
!                       $this->template->set_var('lang_loaddb',lang('Update 
Database'));
                        
$this->template->set_var('lang_application',lang('Application'));
                        $this->template->set_var('lang_source',lang('Source 
Language'));
                        $this->template->set_var('lang_target',lang('Target 
Language'));
!                       $this->template->set_var('lang_submit',lang('Load'));
!                       $this->template->set_var('lang_update',lang('Save'));
                        $this->template->set_var('lang_revert',lang('Revert'));
                        $this->template->set_var('lang_cancel',lang('Cancel'));
+                       $this->template->set_var('lang_step',lang('Step'));
+                       $help = 'onMouseOver="self.status=\'%s\'; return true;" 
onMouseOut="self.status=\'\'; return true;"';
+                       
$this->template->set_var('cancel_help',sprintf($help,lang('Returns to the 
application list, not saved changes get lost !!!')));
+                       
$this->template->set_var('load_help',sprintf($help,lang('Loads the selected 
lang-files, to be modified in the next steps')));
+                       
$this->template->set_var('update_help',sprintf($help,lang('Saves the 
added/changed translations to an internal buffer, to be used in further 
steps')));
+                       
$this->template->set_var('search_help',sprintf($help,lang('Searches the 
source-code for phrases not in the actual source-lang-file')));
+                       
$this->template->set_var('add_help',sprintf($help,lang('Allows you to add a 
single phrase')));
+                       
$this->template->set_var('revert_help',sprintf($help,lang('Clears the internal 
buffer, all changes made sofar are lost')));
+                       
$this->template->set_var('download_help',sprintf($help,lang('Download the 
lang-file to be saved in the apps setup-dir')));
+                       
$this->template->set_var('write_help',sprintf($help,lang('Write the lang-file 
to the apps setup-dir')));
+                       
$this->template->set_var('loaddb_help',sprintf($help,lang('Updates the 
translations of both lang-files in your database, so you can verify your work 
imediatly')));
  
                        $languages = $this->bo->list_langs();
***************
*** 347,351 ****
                        if(!$targetlang)
                        {
!                               $targetlang = 'en';
                        }
  
--- 301,305 ----
                        if(!$targetlang)
                        {
!                               $targetlang = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
                        }
  
***************
*** 387,390 ****
--- 341,345 ----
                        $this->template->set_var('targetlangs',$targetlangs);
                        $this->template->set_var('app_name',$app_name);
+                       
$this->template->set_var('app_title',$GLOBALS['phpgw_info']['apps'][$app_name]['title']);
                        $this->template->pfp('out','header');
  
***************
*** 405,409 ****
                                                $userapps .= ' selected';
                                        }
!                                       $userapps .= '>' . 
lang($GLOBALS['phpgw_info']['apps'][$userapp]['title']) . '</option>' . "\n";
                                }
                        }
--- 360,364 ----
                                                $userapps .= ' selected';
                                        }
!                                       $userapps .= '>' . 
$GLOBALS['phpgw_info']['apps'][$userapp]['title'] . '</option>' . "\n";
                                }
                        }
***************
*** 412,423 ****
                        if ($update)
                        {
!                               $transapp     = 
$GLOBALS['HTTP_POST_VARS']['transapp'];
!                               $translations = 
$GLOBALS['HTTP_POST_VARS']['translations'];
!                               $deleteme     = 
$GLOBALS['HTTP_POST_VARS']['delete'];
                                while (list($_mess,$_app) = each($transapp))
                                {
                                        if($_mess)
                                        {
!                                               $_mess = 
$this->reverse_htmlspecialchars($_mess);
                                                
$this->bo->source_langarray[$_mess]['app_name'] = $_app;
                                                
$this->bo->target_langarray[$_mess]['app_name'] = $_app;
--- 367,378 ----
                        if ($update)
                        {
!                               $transapp     = $_POST['transapp'];
!                               $translations = $_POST['translations'];
!                               $deleteme     = $_POST['delete'];
                                while (list($_mess,$_app) = each($transapp))
                                {
                                        if($_mess)
                                        {
!                                               $_mess = 
strtolower(trim($this->recode_id($_mess)));
                                                
$this->bo->source_langarray[$_mess]['app_name'] = $_app;
                                                
$this->bo->target_langarray[$_mess]['app_name'] = $_app;
***************
*** 428,432 ****
                                        if($_mess && $_cont)
                                        {
!                                               $_mess = 
$this->reverse_htmlspecialchars(strtolower(trim($_mess)));
                                                //Known issue: if a message 
containing a ] is used as index of array, when the array is posted the index 
gets truncated;
                                                
$this->bo->target_langarray[$_mess]['message_id'] = $_mess;
--- 383,387 ----
                                        if($_mess && $_cont)
                                        {
!                                               $_mess = 
strtolower(trim($this->recode_id($_mess)));
                                                //Known issue: if a message 
containing a ] is used as index of array, when the array is posted the index 
gets truncated;
                                                
$this->bo->target_langarray[$_mess]['message_id'] = $_mess;
***************
*** 444,448 ****
                                        if($_checked == 'on')
                                        {
!                                               $_mess = 
$this->reverse_htmlspecialchars($_mess);
                                                
unset($this->bo->source_langarray[$_mess]);
                                                
unset($this->bo->target_langarray[$_mess]);
--- 399,403 ----
                                        if($_checked == 'on')
                                        {
!                                               $_mess = 
strtolower(trim($this->recode_id($_mess)));
                                                
unset($this->bo->source_langarray[$_mess]);
                                                
unset($this->bo->target_langarray[$_mess]);
***************
*** 467,476 ****
                                
$this->template->set_var('lang_original',lang('Original'));
                                
$this->template->set_var('lang_translation',lang('Translation'));
!                               
$this->template->set_var('lang_missingphrase',lang('Search for missing 
phrase'));
!                               
$this->template->set_var('lang_addphrase',lang('Add Phrase'));
                                
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
                                
$this->template->set_var('sourcelang',$sourcelang);
                                
$this->template->set_var('targetlang',$targetlang);
-                               $this->template->set_var('app_name',$app_name);
                                
$this->template->set_var('missing_link',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.missingphrase'));
                                
$this->template->set_var('phrase_link',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.addphrase'));
--- 422,430 ----
                                
$this->template->set_var('lang_original',lang('Original'));
                                
$this->template->set_var('lang_translation',lang('Translation'));
!                               
$this->template->set_var('lang_missingphrase',lang('Search new phrases'));
!                               
$this->template->set_var('lang_addphrase',lang('Add new phrase'));
                                
$this->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
                                
$this->template->set_var('sourcelang',$sourcelang);
                                
$this->template->set_var('targetlang',$targetlang);
                                
$this->template->set_var('missing_link',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.missingphrase'));
                                
$this->template->set_var('phrase_link',$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.addphrase'));
***************
*** 479,519 ****
                                $langarray = 
$this->bo->add_app($app_name,$sourcelang);
                                $translation = 
$this->bo->load_app($app_name,$targetlang);
-                               
$this->template->set_var('src_file',$this->bo->src_file);
  
                                while(list($key,$data) = @each($langarray))
                                {
!                                       $mess_id  = $data['message_id'];
                                        $content  = $data['content'];
-                                       $transapp = $data['app_name'];
                                        $transy   = 
$translation[$key]['content'];
!                                       
$this->template->set_var('mess_id',htmlspecialchars($key));
                                        
$this->template->set_var('source_content',htmlspecialchars($content));
                                        
$this->template->set_var('content',htmlspecialchars($transy));
!                                       
$this->template->set_var('transapp',$this->lang_option($app_name,$transapp,htmlspecialchars($key)));
                                        
$this->template->set_var('tr_color',$this->nextmatchs->alternate_row_color());
!                                       $this->template->pfp('out','detail');
                                }
                                
$this->template->set_var('sourcelang',$sourcelang);
                                
$this->template->set_var('targetlang',$targetlang);
-                               $this->template->set_var('app_name',$app_name);
                                
$this->template->set_var('lang_write',lang('Write'));
                                
$this->template->set_var('lang_download',lang('Download'));
! 
!                               $this->template->pfp('out','prefooter');
!                               $this->template->pfp('out','srcdownload');
! 
!                               
if($this->bo->loaded_apps[$sourcelang]['writeable'])
                                {
!                                       $this->template->pfp('out','srcwrite');
                                }
- 
                                
$this->template->set_var('tgt_file',$this->bo->tgt_file);
                                
$this->template->set_var('targetlang',$targetlang);
!                               $this->template->pfp('out','tgtdownload');
!                               
if($this->bo->loaded_apps[$targetlang]['writeable'])
                                {
!                                       $this->template->pfp('out','tgtwrite');
                                }
! 
                                $this->template->pfp('out','footer');
                        }
--- 433,476 ----
                                $langarray = 
$this->bo->add_app($app_name,$sourcelang);
                                $translation = 
$this->bo->load_app($app_name,$targetlang);
  
                                while(list($key,$data) = @each($langarray))
                                {
!                                       $mess_id  = $this->encode_id($key);
                                        $content  = $data['content'];
                                        $transy   = 
$translation[$key]['content'];
!                                       
$this->template->set_var('mess_id',$mess_id);
                                        
$this->template->set_var('source_content',htmlspecialchars($content));
                                        
$this->template->set_var('content',htmlspecialchars($transy));
!                                       
$this->template->set_var('transapp',$this->lang_option($app_name,$data['app_name'],$mess_id));
                                        
$this->template->set_var('tr_color',$this->nextmatchs->alternate_row_color());
!                                       if (strlen($key) > 50)
!                                       {
!                                               
$this->template->set_var('rows',min(intval(strlen($key)/80+0.5),10));
!                                               
$this->template->pfp('out','detail_long');
!                                       }
!                                       else
!                                       {
!                                               
$this->template->pfp('out','detail');
!                                       }
                                }
                                
$this->template->set_var('sourcelang',$sourcelang);
                                
$this->template->set_var('targetlang',$targetlang);
                                
$this->template->set_var('lang_write',lang('Write'));
                                
$this->template->set_var('lang_download',lang('Download'));
!                               
$this->template->set_var('src_file',$this->bo->src_file);
!                               
if(!$this->bo->loaded_apps[$sourcelang]['writeable'])
                                {
!                                       
$this->template->set_block('footer','srcwrite','srcwrite');
!                                       $this->template->set_var('srcwrite','');
                                }
                                
$this->template->set_var('tgt_file',$this->bo->tgt_file);
                                
$this->template->set_var('targetlang',$targetlang);
!                               
if(!$this->bo->loaded_apps[$targetlang]['writeable'])
                                {
!                                       
$this->template->set_block('footer','tgtwrite','tgtwrite');
!                                       $this->template->set_var('tgtwrite','');
                                }
!                               
!                               $this->template->set_var('helpmsg',lang('!!! 
You have to [Save] every manual change in the above fields, before you can go 
to the next step !!!'));
                                $this->template->pfp('out','footer');
                        }
***************
*** 522,547 ****
                }
  
!               /*!
!               @function reverse_htmlspecialchars
!               @abstract reverts a string converted by htmlspecialchars() to 
its original form
!               @param $text
!               */
!               function reverse_htmlspecialchars($text)
                {
!                       $text=ereg_replace('&gt;', '>', $text);
!                       $text=ereg_replace('&lt;', '<', $text);
!                       $text=ereg_replace('&quot;', "\"", $text);
!                       return ereg_replace('&amp;', '&', $text);
!               }
  
                function save($which,$userlang)
                {
!                       $app_name = $GLOBALS['HTTP_POST_VARS']['app_name'];
!                       $sourcelang = $GLOBALS['HTTP_POST_VARS']['sourcelang'];
!                       $targetlang = $GLOBALS['HTTP_POST_VARS']['targetlang'];
  
                        $this->bo->write_file($which,$app_name,$userlang);
!                       Header('Location: ' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='.$app_name
!                               . '&sourcelang=' . $sourcelang . '&targetlang=' 
. $targetlang));
                }
  
--- 479,506 ----
                }
  
!               function encode_id($id)
                {
!                       return 
str_replace(array('[',']','&','"'),array('%5B','%5D','&amp;','&quot;'),$id);
!               }
! 
!               function recode_id($id)
!               {
!                       return 
str_replace(array('%5B','%5D'),array('[',']'),$id);      // &amp; + &quot; are 
recode by php
!               }
  
                function save($which,$userlang)
                {
!                       $app_name = $_POST['app_name'];
!                       $sourcelang = $_POST['sourcelang'];
!                       $targetlang = $_POST['targetlang'];
  
                        $this->bo->write_file($which,$app_name,$userlang);
!                       header('Location: 
'.$GLOBALS['phpgw']->link('/index.php',array(
!                               'menuaction' => 
'developer_tools.uilangfile.edit',
!                               'app_name'   => $app_name,
!                               'sourcelang' => $sourcelang,
!                               'targetlang' => $targetlang
!                       )));
!                       $GLOBALS['phpgw']->phpgw_exit();
                }
  
***************
*** 570,577 ****
                function index()
                {
!                       $start = $GLOBALS['HTTP_POST_VARS']['start'];
!                       $sort  = $GLOBALS['HTTP_POST_VARS']['sort'];
!                       $order = $GLOBALS['HTTP_POST_VARS']['order'];
!                       $query = $GLOBALS['HTTP_POST_VARS']['query'];
  
                        $this->bo->save_sessiondata('','');
--- 529,536 ----
                function index()
                {
!                       $start = $_POST['start'];
!                       $sort  = $_POST['sort'];
!                       $order = $_POST['order'];
!                       $query = $_POST['query'];
  
                        $this->bo->save_sessiondata('','');
***************
*** 586,591 ****
                        $offset = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
  
!                       $apps = $this->bo->list_apps();
!                       $total = $this->bo->total;
  
                        if(!$sort)
--- 545,553 ----
                        $offset = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
  
!                       foreach($GLOBALS['phpgw_info']['apps'] as $app => $data)
!                       {
!                               $apps[strtolower($data['title'])] = $data;
!                       }
!                       $total = count($apps);
  
                        if(!$sort)
***************
*** 626,640 ****
                        }
  
-                       $i = 0;
-                       $applications = array();
-                       while(list($app,$data) = @each($apps))
-                       {
-                               if($i >= $start && $i<= $limit)
-                               {
-                                       $applications[$app] = $data;
-                               }
-                               $i++;
-                       }
- 
                        
$this->template->set_var('lang_installed',lang('Installed applications'));
                        
$this->template->set_var('bg_color',$GLOBALS['phpgw_info']['theme']['bg_color']);
--- 588,591 ----
***************
*** 651,685 ****
                        $this->template->set_var('create_new',lang('Create New 
Language File'));
  
!                       @reset($applications);
!                       while (list($key,$app) = @each($applications))
                        {
!                               $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
! 
!                               if($app['name'])
!                               {
!                                       $name = $app['name'];
!                               }
!                               else
                                {
!                                       $name = '&nbsp;';
!                               }
  
!                               $this->template->set_var('tr_color',$tr_color);
!                               $this->template->set_var('name',$name);
  
!                               $this->template->set_var('edit','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='
 . urlencode($app['name'])) . '"> ' . lang('Edit') . ' </a>');
!                       //      $this->template->set_var('translate','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.translate&app_name='
 . urlencode($app['name'])) . '"> ' . lang('Translate') . ' </a>');
  
!                               $this->template->set_var('status',$status);
  
!                               $this->template->parse('rows','row',True);
                        }
  
!                       $this->template->pparse('out','list');
                }
  
                function lang_option($app_name,$current,$name)
                {
!                       $list = array(
                                $app_name     => $app_name,
                                'common'      => 'common',
--- 602,631 ----
                        $this->template->set_var('create_new',lang('Create New 
Language File'));
  
!                       $i = 0;
!                       foreach($apps as $data)
                        {
!                               if($start <= $i && $i < $limit)
                                {
!                                       $tr_color = 
$this->nextmatchs->alternate_row_color($tr_color);
  
!                                       
$this->template->set_var('tr_color',$tr_color);
!                                       
$this->template->set_var('name',$data['title']);
  
!                                       $this->template->set_var('edit','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.edit&app_name='
 . urlencode($data['name'])) . '"> ' . lang('Edit') . ' </a>');
!                               //      
$this->template->set_var('translate','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.translate&app_name='
 . urlencode($app['name'])) . '"> ' . lang('Translate') . ' </a>');
  
!                                       
$this->template->set_var('status',$status);
  
!                                       
$this->template->parse('rows','row',True);
!                               }
!                               ++$i;
                        }
  
!                       $this->template->pparse('phpgw_body','list');
                }
  
                function lang_option($app_name,$current,$name)
                {
!                       $list = $this->bo->src_apps + array(
                                $app_name     => $app_name,
                                'common'      => 'common',

Index: header.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/developer_tools/inc/header.inc.php,v
retrieving revision 1.7.2.1
retrieving revision 1.7.2.2
diff -C2 -r1.7.2.1 -r1.7.2.2
*** header.inc.php      15 Jan 2002 01:59:17 -0000      1.7.2.1
--- header.inc.php      7 Apr 2003 14:50:48 -0000       1.7.2.2
***************
*** 14,26 ****
        $GLOBALS['phpgw']->template->set_file(array('header' => 'header.tpl'));
  
!       
$GLOBALS['phpgw']->template->set_var('lang_developer_tools',lang('Developer 
tools'));
        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
        $GLOBALS['phpgw']->template->set_var('link_diary',lang('Diary'));
!       /*
!       $GLOBALS['phpgw']->template->set_var('link_sourceforge_project','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uisf_project_tracker.display_tracker')
 . '">' . lang('SF Project tracker') . '</a>');
!       */
        $GLOBALS['phpgw']->template->set_var('link_changelog','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uichangelogs.list_changelogs')
 . '">' . lang('Changelogs') . '</a>');
        $GLOBALS['phpgw']->template->set_var('link_language_management','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.index')
 . '">' . lang('Language file management'));
        $GLOBALS['phpgw']->template->set_var('link_preferences','<a href="' . 
$GLOBALS['phpgw']->link('/preferences/index.php#developer_tools') . '">' . 
lang('Preferences') . '</a>');
! 
        $GLOBALS['phpgw']->template->pfp('out','header');
--- 14,27 ----
        $GLOBALS['phpgw']->template->set_file(array('header' => 'header.tpl'));
  
!       
$GLOBALS['phpgw']->template->set_var('lang_developer_tools',$GLOBALS['phpgw_info']['apps']['developer_tools']['title']);
        
$GLOBALS['phpgw']->template->set_var('th_bg',$GLOBALS['phpgw_info']['theme']['th_bg']);
+ /*
        $GLOBALS['phpgw']->template->set_var('link_diary',lang('Diary'));
! 
!       //$GLOBALS['phpgw']->template->set_var('link_sourceforge_project','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uisf_project_tracker.display_tracker')
 . '">' . lang('SF Project tracker') . '</a>');
! 
        $GLOBALS['phpgw']->template->set_var('link_changelog','<a href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uichangelogs.list_changelogs')
 . '">' . lang('Changelogs') . '</a>');
        $GLOBALS['phpgw']->template->set_var('link_language_management','<a 
href="' . 
$GLOBALS['phpgw']->link('/index.php','menuaction=developer_tools.uilangfile.index')
 . '">' . lang('Language file management'));
        $GLOBALS['phpgw']->template->set_var('link_preferences','<a href="' . 
$GLOBALS['phpgw']->link('/preferences/index.php#developer_tools') . '">' . 
lang('Preferences') . '</a>');
! */
        $GLOBALS['phpgw']->template->pfp('out','header');

--- class.bochangelogs.inc.php DELETED ---

--- class.bosf_project_tracker.inc.php DELETED ---

--- class.sochangelogs.inc.php DELETED ---

--- class.sosf_project_tracker.inc.php DELETED ---

--- class.uichangelogs.inc.php DELETED ---

--- class.uisf_project_tracker.inc.php DELETED ---

--- hook_preferences.inc.php DELETED ---





reply via email to

[Prev in Thread] Current Thread [Next in Thread]