[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: setup lang.php,1.46,1.47
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: setup lang.php,1.46,1.47 |
Date: |
Wed, 02 Apr 2003 12:46:39 -0500 |
Update of /cvsroot/phpgroupware/setup
In directory subversions:/tmp/cvs-serv24166
Modified Files:
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
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** lang.php 22 Mar 2003 01:32:30 -0000 1.46
--- lang.php 2 Apr 2003 17:46:37 -0000 1.47
***************
*** 43,46 ****
--- 43,51 ----
}
+ if (!defined('MAX_MESSAGE_ID_LENGTH'))
+ {
+ define('MAX_MESSAGE_ID_LENGTH',230);
+ }
+
if (@$GLOBALS['HTTP_POST_VARS']['submit'])
{
***************
*** 67,71 ****
$GLOBALS['phpgw_info']['server']['lang_ctimes']
= array();
}
! while (list($null,$lang) = each($lang_selected))
{
//echo '<br>Working on: ' . $lang;
--- 72,76 ----
$GLOBALS['phpgw_info']['server']['lang_ctimes']
= array();
}
! foreach($lang_selected as $lang)
{
//echo '<br>Working on: ' . $lang;
***************
*** 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))
{
--- 93,98 ----
$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
phpgw_lang 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 phpgw_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();
--- 102,128 ----
{
//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 phpgw_lang 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
phpgw_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: phpgw_lang values
('".$message_id."','".$app_name."','".$GLOBALS['phpgw_setup']->db_lang."','".$content."')";
}
}
--- 138,146 ----
if($message_id
&& $content)
{
! //echo
"<br>adding - insert into phpgw_lang values
('$message_id','$app_name','$lang','$content')";
! $result
= $GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_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: phpgw_lang values
('$message_id','$app_name','$lang','$content')";
}
}
***************
*** 149,153 ****
addslashes(serialize($GLOBALS['phpgw_info']['server']['lang_ctimes']))."')",__LINE__,__FILE__);
}
-
if(!$included)
{
--- 156,159 ----
***************
*** 190,194 ****
$select_box_desc = lang('Select which languages you
would like to use');
$select_box = '';
! $GLOBALS['phpgw_setup']->db->query("select
lang_id,lang_name from phpgw_languages where available='Yes'");
while ($GLOBALS['phpgw_setup']->db->next_record())
{
--- 196,200 ----
$select_box_desc = lang('Select which languages you
would like to use');
$select_box = '';
! $GLOBALS['phpgw_setup']->db->query($q="select
lang_id,lang_name from phpgw_languages where available='Yes'");
while ($GLOBALS['phpgw_setup']->db->next_record())
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: setup lang.php,1.46,1.47,
Ralf Becker <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: preferences/inc hook_settings.inc.php,1.7,1.8
- Next by Date:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.setup_detection.inc.php,1.6,1.7 class.setup_translation.inc.php,1.3,1.4 class.translation_sql.inc.php,1.15,1.16
- Previous by thread:
[Phpgroupware-cvs] CVS: preferences/inc hook_settings.inc.php,1.7,1.8
- Next by thread:
[Phpgroupware-cvs] CVS: phpgwapi/inc class.setup_detection.inc.php,1.6,1.7 class.setup_translation.inc.php,1.3,1.4 class.translation_sql.inc.php,1.15,1.16
- Index(es):