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

View File

@ -70,7 +70,8 @@ var et2_description = et2_baseWidget.extend({
"extra_link_title": {
"name": "Link Title",
"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
* @package etemplate
@ -84,7 +84,7 @@ var et2_tabbox = et2_DOMWidget.extend({
et2_filteredNodeIterator(tabs, function(node, nodeName) {
if (nodeName == "tab")
{
var index_name = et2_readAttrWithDefault(node, "label");
var index_name = et2_readAttrWithDefault(node, "id");
var hide = false;
if(index_name) {
if(selected == index_name) this.selected_index = i;
@ -227,4 +227,3 @@ var et2_tabbox = et2_DOMWidget.extend({
});
et2_register_widget(et2_tabbox, ["tabbox"]);

View File

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

View File

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

View File

@ -54,7 +54,8 @@ class timesheet_ui extends timesheet_bo
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 ($_GET['msg']) $msg = strip_tags($_GET['msg']);

View File

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