added more error-messages and changed soetemplate::toTranslate to not write messages starting with '@' and do write extra-line of selection in options

This commit is contained in:
Ralf Becker 2002-10-03 16:46:18 +00:00
parent 84ef2380ee
commit 8a541d29e8
2 changed files with 26 additions and 9 deletions

View File

@ -29,7 +29,8 @@
'no_filename'=> 'no filename given or selected via Browse...',
'not_writeable' => "Error: webserver is not allowed to write into '%s' !!!",
'exported' => "eTemplate '%s' written to '%s'",
'newer_version' => "newer version '%s' exists !!!"
'newer_version' => "newer version '%s' exists !!!",
'need_name' => 'Application name needed to write a langfile !!!'
);
var $aligns = array(
'' => 'Left',
@ -405,14 +406,22 @@
return;
}
elseif ($content['langfile'])
{
list($name) = explode('.',$content['name']);
if (empty($name) || !@is_dir(PHPGW_SERVER_ROOT.'/'.$name))
{
$msg = $this->messages['need_name'];
}
else
{
$additional = array();
if (substr($content['name'],0,9) == 'etemplate')
if ($name == 'etemplate')
{
$m = new editor(False);
$additional = $m->messages + $this->etemplate->types + $this->extensions + $this->aligns;
}
$msg = $this->etemplate->writeLangFile($content['name'],'en',$additional);
$msg = $this->etemplate->writeLangFile($name,'en',$additional);
}
}
elseif ($content['export_xml'])
{

View File

@ -431,7 +431,7 @@
{
$arr[$key] = $this->compress_array($val);
}
elseif ($val == '' || $val == '0')
elseif ($val == '')
{
unset($arr[$key]);
}
@ -628,10 +628,14 @@
{
while (list($col,$cell) = each($cols))
{
$all = explode('|',$cell['help'].($cell['type'] != 'image'?'|'.$cell['label']:''));
list($extra_row) = explode(',',$cell['size']);
if (substr($cell['type'],0,6) != 'select' || !empty($extra_row) && $extra_row > 0)
$extra_row = '';
$all = explode('|',$cell['help'].($cell['type'] != 'image'?'|'.$cell['label']:'').
(!empty($extra_row) ? '|'.$extra_row : ''));
while (list(,$str) = each($all))
{
if (strlen($str) > 1)
if (strlen($str) > 1 && $str[0] != '@')
{
$to_trans[strtolower($str)] = $str;
}
@ -679,6 +683,10 @@
}
list($app) = explode('.',$app);
if (!file_exists(PHPGW_SERVER_ROOT.'/developer_tools/inc/class.solangfile.inc.php'))
{
return 'Error: app developer-tools not installed !!!';
}
$solangfile = CreateObject('developer_tools.solangfile');
$langarr = $solangfile->load_app($app,$lang);