allow to write only a relative eTemplate-name for each tab:

relative means it contains no '.' and it will then be prefixed with the name of tpl it is used in (plus a '.')
eg. tpl-name 'etemplate.tab_widget.test' tab-names 'work|privat|note' will expand to 'etemplate.tab_widget.test.work', ...
This commit is contained in:
Ralf Becker 2002-10-05 10:40:02 +00:00
parent 18b0e6efe6
commit 702e169b42
2 changed files with 51 additions and 106 deletions

View File

@ -46,6 +46,10 @@
$tab_row = array(); // generate the tab row
while (list($k,$name) = each($names))
{
if (!strstr($name,'.'))
{
$name = $names[$k] = $tmpl->name . '.' . $name;
}
$tcell = $tabs->empty_cell();
if ($extension_data == $name)
{
@ -60,7 +64,7 @@
$tcell['name'] = $tab->name;
}
$tcell['type'] = 'template';
$tcell['size'] = $cell['name']/*form_name*/.'['.$name.']';
$tcell['size'] = $cell['name'].'['.$name.']';
$value[$name] = array(
'name' => $name,
'label' => $labels[$k],

View File

@ -1,76 +1,17 @@
<?xml version="1.0"?>
<!-- $Id$ -->
<overlay>
<grid id="etemplate.tab_widget.test.privat" template="" lang="" group="0" version="" width="100%">
<columns>
<column width="100"/>
<column/>
</columns>
<rows>
<row class="nmr">
<description value="Street"/>
<textbox size="40" id="p_str" statustext="Street"/>
</row>
<row class="nmr">
<textbox size="8" label="city" id="p_zip" statustext="ZIP Code"/>
<textbox size="40" id="p_city" statustext="City"/>
</row>
<row class="nmr">
<description value="Telefon"/>
<textbox id="p_telefon" statustext="Telefonnumber"/>
</row>
<row class="nmr">
<description value="Fax"/>
<textbox id="p_fax" statustext="Faxnumber"/>
</row>
<row class="nmr">
<description value="Birthday"/>
<datefield options="Y-m-d" id="geb_date" statustext="Birtday"/>
</row>
</rows>
<grid id="privat" template="" lang="" group="0" version="">
<columns/>
<rows/>
</grid>
<grid id="etemplate.tab_widget.test.work" template="" lang="" group="0" version="" width="100%">
<columns>
<column width="100"/>
<column/>
</columns>
<rows>
<row class="nmr">
<description value="Companyname"/>
<textbox size="40" id="company"/>
</row>
<row class="nmr">
<description value="Street"/>
<textbox size="40" id="w_str" statustext="Street"/>
</row>
<row class="nmr">
<textbox size="8" label="city" id="w_zip" statustext="ZIP Code"/>
<textbox size="40" id="w_city" statustext="City"/>
</row>
<row class="nmr">
<description value="Telefon"/>
<textbox id="w_telefon" statustext="Telefonnumber"/>
</row>
<row class="nmr">
<description value="Fax"/>
<textbox id="w_fax" statustext="Faxnumber"/>
</row>
<row class="nmr">
<description value="Founded"/>
<datefield options="Y-m-d" id="founded" statustext="when was the company founded"/>
</row>
</rows>
<grid id="work" template="" lang="" group="0" version="">
<columns/>
<rows/>
</grid>
<grid id="etemplate.tab_widget.test.note" template="" lang="" group="0" version="" width="100%">
<columns>
<column width="100"/>
<column/>
</columns>
<rows>
<row class="nmr" valign="top">
<description value="Note"/>
<textbox multiline="true" rows="10" cols="80" id="note" statustext="You can enter some free text here."/>
</row>
</rows>
<grid id="note" template="" lang="" group="0" version="">
<columns/>
<rows/>
</grid>
<grid id="etemplate.tab_widget.test" template="" lang="" group="" version="">
<columns>
@ -83,16 +24,16 @@
<textbox label="Familyname" id="familyname" statustext="Familyname"/>
</row>
<row>
<tabbox span="all">
<tabs>
<tabbox>
<tabs span="all">
<tab label="Privat" statustext="privat address"/>
<tab label="Work" statustext="work address"/>
<tab label="Note" statustext="free note-text"/>
</tabs>
<tabpanels>
<grid id="etemplate.tab_widget.test.privat"/>
<grid id="etemplate.tab_widget.test.work"/>
<grid id="etemplate.tab_widget.test.note"/>
<grid id="privat"/>
<grid id="work"/>
<grid id="note"/>
</tabpanels>
</tabbox>
</row>