[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: setup lang.php,1.46.2.1,1.46.2.2
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: setup lang.php,1.46.2.1,1.46.2.2 |
Date: |
Wed, 02 Apr 2003 05:48:06 -0500 |
Update of /cvsroot/phpgroupware/setup
In directory subversions:/tmp/cvs-serv22698
Modified Files:
Tag: Version-0_9_16-branch
lang.php
Log Message:
limited the length of the message_id to 230 and defined a constant for it
Index: lang.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/lang.php,v
retrieving revision 1.46.2.1
retrieving revision 1.46.2.2
diff -C2 -r1.46.2.1 -r1.46.2.2
*** lang.php 26 Mar 2003 23:59:29 -0000 1.46.2.1
--- lang.php 2 Apr 2003 10:48:04 -0000 1.46.2.2
***************
*** 43,46 ****
--- 43,51 ----
}
+ if (!defined('MAX_MESSAGE_ID_LENGTH'))
+ {
+ define('MAX_MESSAGE_ID_LENGTH',230);
+ }
+
if (@$GLOBALS['HTTP_POST_VARS']['submit'])
{
***************
*** 48,51 ****
--- 53,61 ----
$upgrademethod = @$GLOBALS['HTTP_POST_VARS']['upgrademethod'];
+ $langTbl = $GLOBALS['phpgw_setup']->alessthanb(
+
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],
+ '0.9.15.002'
+ ) ? 'lang' : 'phpgw_lang';
+
if (!isset($GLOBALS['phpgw_info']['server']) && $upgrademethod
!= 'dumpold')
{
***************
*** 63,71 ****
{
// dont delete the custom main- & loginscreen
messages every time
! $GLOBALS['phpgw_setup']->db->query("DELETE FROM
lang where app_name != 'mainscreen' AND app_name !=
'loginscreen'",__LINE__,__FILE__);
//echo '<br>Test: dumpold';
$GLOBALS['phpgw_info']['server']['lang_ctimes']
= array();
}
! while (list($null,$lang) = each($lang_selected))
{
//echo '<br>Working on: ' . $lang;
--- 73,81 ----
{
// dont delete the custom main- & loginscreen
messages every time
! $GLOBALS['phpgw_setup']->db->query("DELETE FROM
$langTbl where app_name != 'mainscreen' AND app_name !=
'loginscreen'",__LINE__,__FILE__);
//echo '<br>Test: dumpold';
$GLOBALS['phpgw_info']['server']['lang_ctimes']
= array();
}
! foreach($lang_selected as $lang)
{
//echo '<br>Working on: ' . $lang;
***************
*** 73,78 ****
if ($upgrademethod == 'addonlynew')
{
! //echo "<br>Test: addonlynew - select
count(*) from lang where lang='".$lang."'";
!
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM lang WHERE
lang='".$lang."'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
--- 83,88 ----
if ($upgrademethod == 'addonlynew')
{
! //echo "<br>Test: addonlynew - select
count(*) from $langTbl where lang='".$lang."'";
!
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM $langTbl WHERE
lang='".$lang."'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
***************
*** 88,93 ****
$setup_info =
$GLOBALS['phpgw_setup']->detection->get_versions();
$setup_info =
$GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info);
! $raw = $raw_file = array();
! // Visit each app/setup dir, look for a
lang file
while (list($key,$app) =
each($setup_info))
{
--- 98,103 ----
$setup_info =
$GLOBALS['phpgw_setup']->detection->get_versions();
$setup_info =
$GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info);
! $raw = array();
! // Visit each app/setup dir, look for a
$langTbl file
while (list($key,$app) =
each($setup_info))
{
***************
*** 97,121 ****
{
//echo '<br>Including:
' . $appfile;
! $raw[] = file($appfile);
!
$GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app['name']] =
filectime($appfile);
}
}
! @reset($raw);
! while (list($a,$raw_file) = @each($raw))
{
! while (list($_null,$line) =
@each($raw_file))
{
$addit = False;
-
list($message_id,$app_name,$GLOBALS['phpgw_setup']->db_lang,$content) =
explode("\t",$line);
- $message_id =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($message_id));
//echo '<br>APPNAME:' .
$app_name . ' PHRASE:' . $message_id;
- $app_name =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($app_name));
-
$GLOBALS['phpgw_setup']->db_lang =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($GLOBALS['phpgw_setup']->db_lang));
- $content =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($content));
if ($upgrademethod ==
'addmissing')
{
//echo
'<br>Test: addmissing';
!
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM lang WHERE
message_id='".$message_id."' and lang='".$GLOBALS['phpgw_setup']->db_lang."'
and (app_name='".$app_name."' or app_name='common')",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
--- 107,133 ----
{
//echo '<br>Including:
' . $appfile;
! $lines = file($appfile);
! foreach($lines as $line)
! {
!
list($message_id,$app_name,,$content) = explode("\t",$line);
! $message_id =
$GLOBALS['phpgw_setup']->db->db_addslashes(substr(chop($message_id),0,MAX_MESSAGE_ID_LENGTH));
! $app_name =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($app_name));
! $content =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($content));
!
!
$raw[$app_name][$message_id] = $content;
! }
$GLOBALS['phpgw_info']['server']['lang_ctimes'][$lang][$app['name']] =
filectime($appfile);
}
}
! foreach($raw as $app_name => $ids)
{
! foreach($ids as $message_id =>
$content)
{
$addit = False;
//echo '<br>APPNAME:' .
$app_name . ' PHRASE:' . $message_id;
if ($upgrademethod ==
'addmissing')
{
//echo
'<br>Test: addmissing';
!
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM $langTbl WHERE
message_id='$message_id' and lang='$lang' and (app_name='$app_name' or
app_name='common')",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
***************
*** 131,139 ****
if($message_id
&& $content)
{
! //echo
"<br>adding - insert into lang values
('".$message_id."','".$app_name."','".$GLOBALS['phpgw_setup']->db_lang."','".$content."')";
! $result
= $GLOBALS['phpgw_setup']->db->query("INSERT INTO
lang(message_id,app_name,lang,content)
VALUES('".$message_id."','".$app_name."','".$GLOBALS['phpgw_setup']->db_lang."','".$content."')",__LINE__,__FILE__);
if
(intval($result) <= 0)
{
!
//echo "<br>Error inserting record: lang values
('".$message_id."','".$app_name."','".$GLOBALS['phpgw_setup']->db_lang."','".$content."')";
}
}
--- 143,151 ----
if($message_id
&& $content)
{
! //echo
"<br>adding - insert into $langTbl values
('$message_id','$app_name','$lang','$content')";
! $result
= $GLOBALS['phpgw_setup']->db->query("INSERT INTO
lang(message_id,app_name,lang,content)
VALUES('$message_id','$app_name','$lang','$content')",__LINE__,__FILE__);
if
(intval($result) <= 0)
{
!
//echo "<br>Error inserting record: $langTbl values
('$message_id','$app_name','$lang','$content')";
}
}
***************
*** 149,153 ****
addslashes(serialize($GLOBALS['phpgw_info']['server']['lang_ctimes']))."')",__LINE__,__FILE__);
}
-
if(!$included)
{
--- 161,164 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: setup lang.php,1.46.2.1,1.46.2.2,
Ralf Becker <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc common_functions.inc.php,1.16,1.17
- Next by Date:
[Phpgroupware-cvs] CVS: property/inc class.uiwo_hour.inc.php,1.6,1.7 hook_settings.inc.php,1.6,1.7
- Previous by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc common_functions.inc.php,1.16,1.17
- Next by thread:
[Phpgroupware-cvs] CVS: property/inc class.uiwo_hour.inc.php,1.6,1.7 hook_settings.inc.php,1.6,1.7
- Index(es):