diff --git a/etemplate/inc/class.editor.inc.php b/etemplate/inc/class.editor.inc.php index a44a21c433..692bdb0c58 100644 --- a/etemplate/inc/class.editor.inc.php +++ b/etemplate/inc/class.editor.inc.php @@ -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', @@ -406,13 +407,21 @@ } elseif ($content['langfile']) { - $additional = array(); - if (substr($content['name'],0,9) == 'etemplate') + list($name) = explode('.',$content['name']); + if (empty($name) || !@is_dir(PHPGW_SERVER_ROOT.'/'.$name)) { - $m = new editor(False); - $additional = $m->messages + $this->etemplate->types + $this->extensions + $this->aligns; + $msg = $this->messages['need_name']; + } + else + { + $additional = array(); + if ($name == 'etemplate') + { + $m = new editor(False); + $additional = $m->messages + $this->etemplate->types + $this->extensions + $this->aligns; + } + $msg = $this->etemplate->writeLangFile($name,'en',$additional); } - $msg = $this->etemplate->writeLangFile($content['name'],'en',$additional); } elseif ($content['export_xml']) { diff --git a/etemplate/inc/class.soetemplate.inc.php b/etemplate/inc/class.soetemplate.inc.php index a7c5f97fa5..f5b1f5e555 100644 --- a/etemplate/inc/class.soetemplate.inc.php +++ b/etemplate/inc/class.soetemplate.inc.php @@ -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);