diff --git a/etemplate/doc/reference.html b/etemplate/doc/reference.html index 4f21087a19..dd84286476 100644 --- a/etemplate/doc/reference.html +++ b/etemplate/doc/reference.html @@ -374,7 +374,7 @@ implement only a subset of XUL. Here are the main differences:

Label - <description/> + <description /> yes label @@ -391,7 +391,7 @@ implement only a subset of XUL. Here are the main differences:

Text - <textbox/> + <textbox /> yes text @@ -405,7 +405,7 @@ implement only a subset of XUL. Here are the main differences:

Integer - <textbox
type="int"/> + <textbox
type="int" /> ? int @@ -435,7 +435,7 @@ implement only a subset of XUL. Here are the main differences:

Textarea - <textbox
multiline="true"/> + <textbox
multiline="true" /> yes textarea @@ -461,17 +461,28 @@ implement only a subset of XUL. Here are the main differences:

Checkbox - <checkbox/> + <checkbox /> yes checkbox a widget that can be checked or unchecked
In the html-UI this is rendered as <input type="checkbox" ...>. +

Multiple checkboxes can have an identical name ending with [], in that case the value will be an array with the set_value's + of the checked boxes. You can use a button with a custom javascript onclick action of eg. + "toggle_all(this.form,form::name('nm[rows][checkbox][]')); return false;" and a set_value of "$row_cont[id]" to toggle + all checkboxes in the lines of a nextmatch widget. The form::name( ) function translate the name used + in the template into the name used in the form. If the button is an image-button, check needed to render it as button + and not as image with link, which has no this.form property!

+ Options: [set_value][,unset_value[,ro_true[,ro_false]]]
+ set_value: which value in the content represents the checked state, default=1
+ unset_value: value in the content representing the unchecked state, default=0
+ ro_true: what should be displayed for a readonly checked box, default=x
+ ro_false: display for an unchecked box, can be set to 'disable', to not display the widget (incl. label), default is empty Radiobutton - <radio/> + <radio /> ? radio @@ -484,17 +495,16 @@ implement only a subset of XUL. Here are the main differences:

Submitbutton - <button image="img.gif" ro_image="img-grey.gif"/> + <button image="img.gif" ro_image="img-grey.gif" /> yes button a button to submit the form / end the dialog
In the html-UI this is rendered as <input type="submit" ...>.
If a button is set readonly (via seting its id in the $readonlys array passed to exec) it is not rendered - at all (if no ro_image is given), like it would be diabled.

- onChange xml: onchange: if set and the user has JavaScript enabled - the button is renderd as a link around the label and a hidden - input to set id if the link is clicked.
+ at all (if no ro_image is given), like it would be disabled.

+ needed: if set and the user has JavaScript enabled the button is renderd as a link around the label + and a hidden input to set id if the link is clicked.
Options xml: image, ro_image: Image to use instead of a Button with a label. There will be no button around the image. If a ro_image is given (separated by a comma in the editors options) it will be used if the button is set readonly (else the button is no rendered at all) . @@ -508,7 +518,7 @@ implement only a subset of XUL. Here are the main differences:

Horizonatal Rule - <hrule/> + <hrule /> no hrule @@ -519,7 +529,7 @@ implement only a subset of XUL. Here are the main differences:

Template - <grid id="app.name" content="subarr"/> + <template id="app.name" content="subarr" /> yes template @@ -533,7 +543,7 @@ implement only a subset of XUL. Here are the main differences:

Image - <image src="foo.gif" label="Get a foo" options="app.class.method"/> + <image src="foo.gif" label="Get a foo" options="app.class.method" /> yes image @@ -547,7 +557,7 @@ implement only a subset of XUL. Here are the main differences:

Selectbox <menulist>
-   <menupopup id="name" options="Select one"/>
+   <menupopup id="name" options="Select one" />
</menulist>

multiselect: options > 1
<listbox rows="#"/>

@@ -720,9 +730,7 @@ implement only a subset of XUL. Here are the main differences:

Label xml: label: the labels of the tabs eg. 'Tab 1|Tab 2|Tab 3'
Help xml: statustext: of the tabs
Name xml: id: the names/ids of the eTemplates/grid's to fill the bodies of the tabs, if the - name contains no '.', it will be prefixed with the name of the template the widget is in plus a '.'

- Demo: There is a demo availible: load 'etemplate.tab_widget.test' into the eTemplate editor and - run it with show. + name contains no '.', it will be prefixed with the name of the template the widget is in plus a '.' diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index f1278786a4..295c98fcd7 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -852,23 +852,24 @@ if (!empty($cell_options)) { list($set_val,$unset_val,$ro_true,$ro_false) = explode(',',$cell_options); + if (!$set_val && !$unset_val) $set_val = 1; $value = $value == $set_val; } - if (count(explode(',',$cell_options)) < 3) - { - $ro_true = 'x'; - $ro_false = ''; - } - if ($value) - { - $options .= ' checked="1"'; - } if ($readonly) { + if (count(explode(',',$cell_options)) < 3) + { + $ro_true = 'x'; + $ro_false = ''; + } + if (!$value && $ro_false == 'disable') return ''; + $html .= $value ? $this->html->bold($ro_true) : $ro_false; } else { + if ($value) $options .= ' checked="1"'; + if (($multiple = substr($cell['name'],-2) == '[]')) { // add the set_val to the id to make it unique