From e233ade4c97460f850ebf33417c9fa3b09d4147d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 2 Jun 2005 22:26:41 +0000 Subject: [PATCH] - extension can now use name_expansion in their options - remove some unnecessary / doubled code --- etemplate/inc/class.uietemplate.inc.php | 27 +++++++++---------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index e7edbe8e34..b7c1428654 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -692,6 +692,10 @@ list($type,$sub_type) = explode('-',$cell['type']); if ((!$this->types[$cell['type']] || !empty($sub_type)) && $this->haveExtension($type,'pre_process')) { + if (strchr($cell['size'],'$') || $cell['size'][0] == '@') + { + $cell['size'] = $this->expand_name($cell['size'],$show_c,$show_row,$content['.c'],$content['.row'],$content); + } $ext_type = $type; $extra_label = $this->extensionPreProcess($ext_type,$form_name,$value,$cell,$readonlys[$name]); @@ -699,37 +703,26 @@ $this->set_array($content,$name,$value); } list(,$class) = explode(',',$cell['span']); // might be set by extension - if (strchr($class,'$')) + if (strchr($class,'$') || $class[0] == '@') { $class = $this->expand_name($class,$show_c,$show_row,$content['.c'],$content['.row'],$content); } - if ($class[0] == '@') - { - $class = $this->get_array($content,substr($class,1)); - } - $cell_options = $cell['size']; - if (strchr($cell_options,'$')) + if (strchr($cell_options,'$') || $cell_options[0] == '@') { $cell_options = $this->expand_name($cell_options,$show_c,$show_row,$content['.c'],$content['.row'],$content); } - if ($cell_options[0] == '@') + $label = $cell['label']; + if (strchr($label,'$') || $label[0] == '@') { - $cell_options = $this->get_array($content,substr($cell_options,1)); + $label = $this->expand_name($label,$show_c,$show_row,$content['.c'],$content['.row'],$content); } - $label = $this->expand_name($cell['label'],$show_c,$show_row,$content['.c'],$content['.row'],$content); - $help = $cell['help']; - if (strchr($help,'$')) + if (strchr($help,'$') || $help[0] == '@') { $no_lang_on_help = true; $help = $this->expand_name($help,$show_c,$show_row,$content['.c'],$content['.row'],$content); } - if ($help[0] == '@') - { - $no_lang_on_help = true; - $help = $this->get_array($content,substr($help,1)); - } $blur = $cell['blur'][0] == '@' ? $this->get_array($content,substr($cell['blur'],1)) : (strlen($cell['blur']) <= 1 ? $cell['blur'] : lang($cell['blur']));