- fixed xul_io class not exporting id of tab

- fixed tab widget to use id instead of label
- added attribute names for describtion (label) in xul_io, to export them as single attributes not comma-sep. as options
- added translate: true to description/label title
--> xet-files need to be dumped new, to get the tab-ids
--> seems like describtion value is translated unconditional, it should only be translated if no_lang attribute is not set or false, while label attribute is always translated (Andreas?)
This commit is contained in:
Ralf Becker 2011-08-24 07:18:59 +00:00
parent 07c61d65f0
commit 33c6766c88
7 changed files with 30 additions and 27 deletions

View File

@ -52,6 +52,7 @@ class xul_io
'label' => array( 'label' => array(
'.name' => 'description', '.name' => 'description',
'label' => 'value', 'label' => 'value',
'size' => 'font_style,href,activate_links,for,extra_link_target,extra_link_popup,extra_link_title',
), ),
'text' => array( 'text' => array(
'.name' => 'textbox', '.name' => 'textbox',
@ -218,8 +219,9 @@ class xul_io
for ($n = 0; $n < count($labels); ++$n) for ($n = 0; $n < count($labels); ++$n)
{ {
$tab = new xmlnode('tab'); $tab = new xmlnode('tab');
$tab->set_attribute('id',$names[$n]);
$tab->set_attribute('label',$labels[$n]); $tab->set_attribute('label',$labels[$n]);
$tab->set_attribute('statustext',$helps[$n]); if ($helps[$n]) $tab->set_attribute('statustext',$helps[$n]);
$child->add_node($tab); $child->add_node($tab);
$embeded = new etemplate($names[$n],$this->load_via); $embeded = new etemplate($names[$n],$this->load_via);

View File

@ -70,7 +70,8 @@ var et2_description = et2_baseWidget.extend({
"extra_link_title": { "extra_link_title": {
"name": "Link Title", "name": "Link Title",
"type": "string", "type": "string",
"description": "Link title which is displayed on mouse over." "description": "Link title which is displayed on mouse over.",
"translate": true
} }
}, },

View File

@ -1,5 +1,5 @@
/** /**
* eGroupWare eTemplate2 - JS Tabs object * EGroupware eTemplate2 - JS Tabs object
* *
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
* @package etemplate * @package etemplate
@ -84,7 +84,7 @@ var et2_tabbox = et2_DOMWidget.extend({
et2_filteredNodeIterator(tabs, function(node, nodeName) { et2_filteredNodeIterator(tabs, function(node, nodeName) {
if (nodeName == "tab") if (nodeName == "tab")
{ {
var index_name = et2_readAttrWithDefault(node, "label"); var index_name = et2_readAttrWithDefault(node, "id");
var hide = false; var hide = false;
if(index_name) { if(index_name) {
if(selected == index_name) this.selected_index = i; if(selected == index_name) this.selected_index = i;
@ -227,4 +227,3 @@ var et2_tabbox = et2_DOMWidget.extend({
}); });
et2_register_widget(et2_tabbox, ["tabbox"]); et2_register_widget(et2_tabbox, ["tabbox"]);

View File

@ -1,10 +1,10 @@
var tabbox_data = { var tabbox_data = {
"content": { "content": {
"tab_1": "Test4" "tab_1": "test4"
}, },
"readonlys": { "readonlys": {
"tab_1": { "tab_1": {
"Disabled": true "to_disable": true
} }
} }
} }

View File

@ -2,11 +2,11 @@
<overlay> <overlay>
<tabbox width="100%" id="tab_1"> <tabbox width="100%" id="tab_1">
<tabs> <tabs>
<tab label="Test1" /> <tab id="test1" label="Test1" />
<tab label="Test2" /> <tab id="test2" label="Test2" />
<tab label="Disabled" /> <tab id="to_disable" label="Disabled" />
<tab label="Test3" /> <tab id="test3" label="Test3" />
<tab label="Test4" /> <tab id="test4" label="Test4" />
</tabs> </tabs>
<tabpanels> <tabpanels>
<vbox> <vbox>

View File

@ -54,7 +54,8 @@ class timesheet_ui extends timesheet_bo
function edit($content = null,$view = false) function edit($content = null,$view = false)
{ {
$etpl = new etemplate('timesheet.edit'); error_log(__METHOD__.'('.array2string($content).')');
$etpl = new etemplate_new('timesheet.edit');
if (!is_array($content)) if (!is_array($content))
{ {
if ($_GET['msg']) $msg = strip_tags($_GET['msg']); if ($_GET['msg']) $msg = strip_tags($_GET['msg']);

View File

@ -11,7 +11,7 @@
</columns> </columns>
<rows> <rows>
<row class="row" disabled="@ts_viewtype"> <row class="row" disabled="@ts_viewtype">
<description value="Title" options=",,,ts_title"/> <description value="Title" for="ts_title"/>
<textbox blur="@ts_title_blur" id="ts_title" size="65" maxlength="80" span="all" class="fullWidth"/> <textbox blur="@ts_title_blur" id="ts_title" size="65" maxlength="80" span="all" class="fullWidth"/>
<description/> <description/>
<description/> <description/>
@ -23,25 +23,25 @@
<description/> <description/>
</row> </row>
<row class="row"> <row class="row">
<description value="Category" options=",,,cat_id"/> <description value="Category" for="cat_id"/>
<menulist span="all"> <menulist span="all">
<menupopup type="select-cat" id="cat_id" options="None,,,timesheet"/> <menupopup type="select-cat" id="cat_id" options="None,,,timesheet"/>
</menulist> </menulist>
</row> </row>
<row class="row"> <row class="row">
<description value="Date" options=",,,ts_start"/> <description value="Date" for="ts_start"/>
<date id="ts_start" needed="1" options=",8"/> <date id="ts_start" needed="1" options=",8"/>
<description value="Starttime"/> <description value="Starttime"/>
<date-timeonly id="start_time" options="H:i"/> <date-timeonly id="start_time" options="H:i"/>
</row> </row>
<row class="row"> <row class="row">
<description value="Duration" options=",,,ts_duration"/> <description value="Duration" for="ts_duration"/>
<date-duration id="ts_duration" options=",hm"/> <date-duration id="ts_duration" options=",hm"/>
<description value="or endtime" class="noWrap"/> <description value="or endtime" class="noWrap"/>
<date-timeonly id="end_time" options="H:i"/> <date-timeonly id="end_time" options="H:i"/>
</row> </row>
<row class="row" disabled="@ts_viewtype"> <row class="row" disabled="@ts_viewtype">
<description value="Quantity" options=",,,ts_quantity"/> <description value="Quantity" for="ts_quantity"/>
<textbox type="float" blur="@ts_quantity_blur" statustext="empty if identical to duration" id="ts_quantity" precision="3" span="all"/> <textbox type="float" blur="@ts_quantity_blur" statustext="empty if identical to duration" id="ts_quantity" precision="3" span="all"/>
</row> </row>
<row class="row" disabled="@no_ts_status"> <row class="row" disabled="@no_ts_status">
@ -123,13 +123,13 @@
<description/> <description/>
</row> </row>
<row class="th" height="28"> <row class="th" height="28">
<description value="User" options=",,,ts_owner"/> <description value="User" for="ts_owner"/>
<menulist span="all"> <menulist span="all">
<menupopup id="ts_owner" no_lang="1"/> <menupopup id="ts_owner" no_lang="1"/>
</menulist> </menulist>
</row> </row>
<row class="row"> <row class="row">
<description value="Project" options=",,,ts_project"/> <description value="Project" for="ts_project"/>
<grid spacing="1" padding="1"> <grid spacing="1" padding="1">
<columns> <columns>
<column/> <column/>
@ -145,7 +145,7 @@
</grid> </grid>
</row> </row>
<row class="row" disabled="@ts_viewtype"> <row class="row" disabled="@ts_viewtype">
<description value="Unitprice" options=",,,ts_unitprice"/> <description value="Unitprice" for="ts_unitprice"/>
<grid> <grid>
<columns> <columns>
<column disabled="@pm_integration=none"/> <column disabled="@pm_integration=none"/>
@ -162,11 +162,11 @@
<row> <row>
<tabbox id="tabs" span="all"> <tabbox id="tabs" span="all">
<tabs> <tabs>
<tab label="General" statustext=""/> <tab id="general" label="General"/>
<tab label="Notes" statustext=""/> <tab id="notes" label="Notes"/>
<tab label="Links" statustext=""/> <tab id="links" label="Links"/>
<tab label="Custom Fields" statustext=""/> <tab id="customfields" label="Custom Fields"/>
<tab label="History" statustext=""/> <tab id="history" label="History"/>
</tabs> </tabs>
<tabpanels> <tabpanels>
<template id="timesheet.edit.general"/> <template id="timesheet.edit.general"/>