From 33c6766c887401ab51363ebcf5d71a48043abf50 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 24 Aug 2011 07:18:59 +0000 Subject: [PATCH] - 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?) --- etemplate/inc/class.xul_io.inc.php | 4 +++- etemplate/js/et2_description.js | 3 ++- etemplate/js/et2_tabs.js | 5 ++--- etemplate/js/test/et2_test_tabbox.json | 4 ++-- etemplate/js/test/et2_test_tabbox.xet | 10 ++++----- timesheet/inc/class.timesheet_ui.inc.php | 3 ++- timesheet/templates/default/edit.xet | 28 ++++++++++++------------ 7 files changed, 30 insertions(+), 27 deletions(-) diff --git a/etemplate/inc/class.xul_io.inc.php b/etemplate/inc/class.xul_io.inc.php index bdf527a816..f905d8a16c 100644 --- a/etemplate/inc/class.xul_io.inc.php +++ b/etemplate/inc/class.xul_io.inc.php @@ -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); diff --git a/etemplate/js/et2_description.js b/etemplate/js/et2_description.js index 4d253aff15..8b98d3ee34 100644 --- a/etemplate/js/et2_description.js +++ b/etemplate/js/et2_description.js @@ -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 } }, diff --git a/etemplate/js/et2_tabs.js b/etemplate/js/et2_tabs.js index bb69cbb4a9..34adb8b476 100644 --- a/etemplate/js/et2_tabs.js +++ b/etemplate/js/et2_tabs.js @@ -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"]); - diff --git a/etemplate/js/test/et2_test_tabbox.json b/etemplate/js/test/et2_test_tabbox.json index 2b1a829ece..05a06a6dfc 100644 --- a/etemplate/js/test/et2_test_tabbox.json +++ b/etemplate/js/test/et2_test_tabbox.json @@ -1,10 +1,10 @@ var tabbox_data = { "content": { - "tab_1": "Test4" + "tab_1": "test4" }, "readonlys": { "tab_1": { - "Disabled": true + "to_disable": true } } } diff --git a/etemplate/js/test/et2_test_tabbox.xet b/etemplate/js/test/et2_test_tabbox.xet index b0d517d341..30d4ae9f25 100644 --- a/etemplate/js/test/et2_test_tabbox.xet +++ b/etemplate/js/test/et2_test_tabbox.xet @@ -2,11 +2,11 @@ - - - - - + + + + + diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 58f4d4033b..1351e86654 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -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']); diff --git a/timesheet/templates/default/edit.xet b/timesheet/templates/default/edit.xet index 5f9337c77a..429842e6a5 100644 --- a/timesheet/templates/default/edit.xet +++ b/timesheet/templates/default/edit.xet @@ -11,7 +11,7 @@ - + @@ -23,25 +23,25 @@ - + - + - + - + @@ -123,13 +123,13 @@ - + - + @@ -145,7 +145,7 @@ - + @@ -162,11 +162,11 @@ - - - - - + + + + + - + \ No newline at end of file