phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate.inc.php,1.10,1.1


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: etemplate/inc class.uietemplate.inc.php,1.10,1.11
Date: Mon, 10 Jun 2002 17:35:01 -0400

Update of /cvsroot/phpgroupware/etemplate/inc
In directory subversions:/tmp/cvs-serv28332

Modified Files:
        class.uietemplate.inc.php 
Log Message:
a lot of new stuff, to give the extensions more freedome:
- label and help-texts can contain '@<index>' to reference a variable in the 
content array
- content changed by an extension is now handled correct in all cases of 
sub-arrays
- added CELLSPACEING and CELLPADDING options for the template / table

Index: class.uietemplate.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/etemplate/inc/class.uietemplate.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** class.uietemplate.inc.php   9 Jun 2002 21:40:06 -0000       1.10
--- class.uietemplate.inc.php   10 Jun 2002 21:34:58 -0000      1.11
***************
*** 293,298 ****
                                
$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name] = True;
                        }
                        return "\n\n<!-- BEGIN $this->name -->\n$style\n".
!                               
$this->html->table($rows,$this->html->formatOptions($this->size,'WIDTH,HEIGHT,BORDER,CLASS')).
                                "<!-- END $this->name -->\n\n";
                }
--- 293,300 ----
                                
$GLOBALS['phpgw_info']['etemplate']['styles_included'][$this->name] = True;
                        }
+                       list(,,$border) = explode(',',$this->size);
+ 
                        return "\n\n<!-- BEGIN $this->name -->\n$style\n".
!                               
$this->html->table($rows,$this->html->formatOptions($this->size,'WIDTH,HEIGHT,BORDER,CLASS,CELLSPACING,CELLPADDING')).
                                "<!-- END $this->name -->\n\n";
                }
***************
*** 350,362 ****
                        {
                                $extra_label = 
$this->extension[$cell['type']]->pre_process($cell,$value,$this);
!                               $content[$name] = $value;       // set result 
for template
                        }
!                       if ($cell['help'])
                        {
!                               $options .= " 
onFocus=\"self.status='".addslashes(lang($cell['help']))."'; return true;\"";
                                $options .= " onBlur=\"self.status=''; return 
true;\"";
                                if ($cell['type'] == 'button')  // for button 
additionally when mouse over button
                                {
!                                       $options .= " 
onMouseOver=\"self.status='".addslashes(lang($cell['help']))."'; return 
true;\"";
                                        $options .= " 
onMouseOut=\"self.status=''; return true;\"";
                                }
--- 352,385 ----
                        {
                                $extra_label = 
$this->extension[$cell['type']]->pre_process($cell,$value,$this);
!                               if (strstr($name,'|'))
!                               {
!                                       $content = 
$this->complete_array_merge($content,$value);
!                               }
!                               elseif (!$regs)
!                               {
!                                       $content[$name] = $value;       // set 
result for template
!                               }
!                               else
!                               {
!                                       
eval(str_replace(']',"']",str_replace('[',"['",'$content['.$regs[1].']'.$regs[2].'
 = $value;')));
!                               }
!                       }
!                       $label = $cell['label'];
!                       if ($label[0] == '@')
!                       {
!                               $label = 
$this->get_array($content,substr($label,1));
!                       }
!                       $help = $cell['help'];
!                       if ($help[0] == '@')
!                       {
!                               $help = 
$this->get_array($content,substr($help,1));
                        }
!                       if ($help)
                        {
!                               $options .= " 
onFocus=\"self.status='".addslashes(lang($help))."'; return true;\"";
                                $options .= " onBlur=\"self.status=''; return 
true;\"";
                                if ($cell['type'] == 'button')  // for button 
additionally when mouse over button
                                {
!                                       $options .= " 
onMouseOver=\"self.status='".addslashes(lang($help))."'; return true;\"";
                                        $options .= " 
onMouseOut=\"self.status=''; return true;\"";
                                }
***************
*** 415,420 ****
                                        break;
                                case 'button':
!                                       $html .= 
$this->html->submit_button($form_name,$cell['label'],'',
!                                               strlen($cell['label']) <= 1 || 
$cell['no_lang'],$options);
                                        $extra_label = False;
                                        break;
--- 438,443 ----
                                        break;
                                case 'button':
!                                       $html .= 
$this->html->submit_button($form_name,$label,'',
!                                               strlen($label) <= 1 || 
$cell['no_lang'],$options);
                                        $extra_label = False;
                                        break;
***************
*** 433,443 ****
                                                        }
                                                }
!                                               $readonlys = $readonlys[$idx];
!                                               $content = $content[$idx];
                                                if ($idx_cname != '')
                                                {
!                                                       $cname .= $cname == '' 
? $idx_cname : "[$idx_cname]";
                                                }
!                                               //echo 
"<p>show_cell-autorepeat($name,$show_c,$show_row,cname='$cname',idx='$idx',idx_cname='$idx_cname',span='$span'):
 readonlys[$idx] ="; _debug_array($readonlys);
                                        }
                                        if ($readonly)
--- 456,466 ----
                                                        }
                                                }
!                                               $readonlys = 
$this->get_array($readonlys,$idx); //$readonlys[$idx];
!                                               $content = 
$this->get_array($content,$idx); // $content[$idx];
                                                if ($idx_cname != '')
                                                {
!                                                       $cname .= $cname == '' 
? $idx_cname : '['.str_replace('[','][',str_replace(']','',$idx_cname)).']';
                                                }
!                                               //echo 
"<p>show_cell-autorepeat($name,$show_c,$show_row,cname='$cname',idx='$idx',idx_cname='$idx_cname',span='$span'):
 content ="; _debug_array($content);
                                        }
                                        if ($readonly)
***************
*** 492,496 ****
                                case 'image':
                                        $image = 
$this->html->image(substr($this->name,0,strpos($this->name,'.')),
!                                               
$cell['label'],lang($cell['help']),'BORDER=0');
                                        $html .= $name == '' ? $image : 
$this->html->a_href($image,$name);
                                        $extra_label = False;
--- 515,519 ----
                                case 'image':
                                        $image = 
$this->html->image(substr($this->name,0,strpos($this->name,'.')),
!                                               $label,lang($help),'BORDER=0');
                                        $html .= $name == '' ? $image : 
$this->html->a_href($image,$name);
                                        $extra_label = False;
***************
*** 507,513 ****
                                        break;
                        }
!                       if ($extra_label && (($label = $cell['label']) != '' || 
$html == ''))
                        {
!                               if (strlen($label) > 1)
                                {
                                        $label = lang($label);
--- 530,536 ----
                                        break;
                        }
!                       if ($extra_label && ($label != '' || $html == ''))
                        {
!                               if (strlen($label) > 1 && !$cell['no_lang'])
                                {
                                        $label = lang($label);
***************
*** 738,742 ****
                                        {
                                                $this->loop = True;
!                                               echo "<p>".$this->name.": loop 
set in process_show(".$templ->name.")</p>\n";
                                        }
                                        break;
--- 761,765 ----
                                        {
                                                $this->loop = True;
!                                               //echo "<p>".$this->name.": 
loop set in process_show(".$templ->name.")</p>\n";
                                        }
                                        break;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]