2005-07-07 22:09:52 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2002-09-12 21:32:53 +02:00
< html >
< head >
2005-02-08 19:22:18 +01:00
< title > eGroupWare: eTemplate-reference< / title >
2002-10-16 02:25:54 +02:00
<!-- $Id$ -->
2005-07-07 22:09:52 +02:00
< style type = "text/css" >
2002-09-12 21:32:53 +02:00
<!--
pre { font-family: monospace; background-color: #e0e0e0; padding: 2mm; border-width: thin; border-style: solid; border-color: black; white-space: pre; }
span { color: darkblue; font-family: sans-serife; }
li { margin-top: 5px; }
body { background-color: white; color: black; }
2006-04-30 09:20:36 +02:00
table { border: 1px solid black; border-collapse: collapse; }
2002-09-12 21:32:53 +02:00
-->
2005-07-07 22:09:52 +02:00
< / style >
2002-09-12 21:32:53 +02:00
< / head >
< body >
2005-02-08 19:22:18 +01:00
< h1 > eTemplate-reference - Templates and Dialog-Editor for eGroupWare< / h1 >
2003-06-29 19:00:05 +02:00
< h3 > by Ralf Becker < a href = "#" onClick = "document.location='mai'+'lto:RalfBecker'+unescape('%40')+'outdoor-training'+unescape('%2E')+'de'; return false;" > RalfBecker AT outdoor-training DOT de< / a > < / h3 >
2005-02-08 19:22:18 +01:00
< p > A reference documentation about the new eTemplates and the < a href = "#reference" > syntax and parameters< / a >
2002-09-12 21:32:53 +02:00
of the several widgets.< / p >
< hr >
< h1 > Introduction - The concept of the eTemplates< / h1 >
< p > As I already covered this in the < a href = "etemplate.html" > Tutorial< / a > , I like would suggest to have a look
there if your are not familiar with the overal concept.< / p >
< p > There are two possibilities now to create an eTemplate:< / p >
< ol >
< li > Use the eTemplate-Editor (as descript in the < a href = "etemplate.html" > Tutorial< / a > ) to interactivly
design your template.
< li > Write a xml-file in a Syntax similar to XUL (the mozilla UI-interface definition language) and import
it into the database with the eTemplate-Editor
< / ol >
< hr >
< h1 > The xml-interface to the eTemplates< / h1 >
< p > The eTemplates-Editor can import and export now eTemplates as xml-files. Here is short example showing
an eTemplate from the example app in the < a href = "etemplate.html" > Tutorial< / a >
(here are screenshots of the template in the < a href = "editor.gif" > editor< / a > and the
< a href = "show.gif" > show-function< / a > ):< / p >
< pre >
< ?xml version="1.0"?>
2002-10-03 20:26:47 +02:00
< span > < !-- $Id$ -->< / span >
2002-09-12 21:32:53 +02:00
< overlay>
2005-04-10 15:39:33 +02:00
< template id="et_media.edit" template="" lang="" group="" version="">
< grid width="100%">
< columns>
< column/>
< column/>
< column/>
< column/>
< /columns>
< rows>
< row>
< description options="ib" span="all" value="eTemplates MediaDB" no_lang="1" id="msg"/>
< /row>
< row>
< hrule span="all"/>
< /row>
< row>
< description span="all"/>
< /row>
< row>
< description value="Name"/>
< textbox size="100" maxlength="100" span="all" id="name" statustext="here goes the name of the publication / record"/>
< /row>
< row>
< description value="Author"/>
< textbox size="100" maxlength="100" span="all" id="author" statustext="please use Name, First Name"/>
< /row>
< row>
< description value="Type"/>
< menulist span="all" statustext="select the type fitting most">
< menupopup id="type"/>
< /menulist>
< /row>
< row>
< description value="Description"/>
< textbox ="" cols="3" rows="100" span="all" id="descr" statustext="we have a fulltext search using that description"/>
< /row>
< row>
2002-09-12 21:32:53 +02:00
< description span="all"/>
2005-04-10 15:39:33 +02:00
< /row>
< row>
< button label="Read" id="read" statustext="reads or searches for entries matching the criteria above"/>
< button label="Save" id="save" statustext="saves the change to the db"/>
< button label="Cancel" id="cancel" statustext="clears the form, without changing anything"/>
< button label="Delete" id="delete" statustext="deletes an entry"/>
< /row>
< /rows>
< /grid>
< /template>
2002-09-12 21:32:53 +02:00
< /overlay>
< / pre >
< p > The tags / widget-names and attributes / parameters used are as close as possible to XUL. For more
information about XUL refer to < a href = "http://www.xulplanet.com" > www.xulplanet.com< / a > or the Mozilla docs
< a href = "http://www.mozilla.org/xpfe/xulref/" > www.mozilla.org/xpfe/xulref/< / a > .< / p >
< p > Please keep in mind that the xml-files used to store the eTemplates are only similar to XUL and
implement only a subset of XUL. Here are the main differences:< / p >
< ul >
< li > only certain widgets and widget attributes are implemented
< li > xul-files can contain the actual content or refer to it via a datasources (RDF's) and use a
2005-02-16 00:22:10 +01:00
different template syntax to fill in content from a variable: < label value="?label"/>< br / >
2002-09-12 21:32:53 +02:00
eTemplates get there content from an array passed to the exec or show-function of the template-object
2005-02-08 19:22:18 +01:00
and reference to the content by the id / name-field of each widget.
2005-04-10 15:39:33 +02:00
< li > xul-files can contain an unlimited number of nested elements, the xml-root-node of an eTemplates has to
be an overlay, containing multiple (non-xul) < template>'s. That templates can contain now (HEAD)
a tree of other widgets, but not other templates direct. You can use < template id="app.template_name" />
to load an other template by its name.< / i >
2002-09-12 21:32:53 +02:00
< / ul >
< p > Like XUL the eTemplate-xml-files are quite strict with the xml-syntax:< / p >
< ul >
< li > All tags and attributes must be written in lowercase
< li > All strings must be double quoted, like id="string"
< li > Every XUL widget must use close tags (either < tag>< /tag> or < tag/>) to be well-formed
2005-04-10 15:39:33 +02:00
< li > All attributes must have a value, no < tag attr> it has to be < tag attr="1">
2002-09-12 21:32:53 +02:00
< / ul >
< hr >
2005-02-08 19:22:18 +01:00
< a name = "reference" > < / a >
< h1 > Syntax and Parameter reference< / h1 >
2002-09-12 21:32:53 +02:00
< h2 > Standard parametes / attributes for < a href = "#widgets" > all widgets< / a > < / h2 >
< table border = 1 >
< tr >
< th > Name in Editor< / th >
< th > xml attr< / th >
< th > xul< / th >
< th > internal name< / th >
< th > description of the attribut< th >
< / tr >
< tr >
< td > < b > Type< / b > < / td >
2005-02-16 00:22:10 +01:00
< td > type< br / > < i > (only for< br / > sub-types)< / td >
2002-09-17 11:36:55 +02:00
< td > no< / td >
2002-09-12 21:32:53 +02:00
< td > type< / td >
< td >
2002-09-17 11:36:55 +02:00
The type of the widget is stored in the tag itself, some widgets have sub-types (unknow to XUL).
2005-02-16 00:22:10 +01:00
In that case the subtype is stored in the type attribut.< br / >
2002-09-17 11:36:55 +02:00
The Type / tag has to be either the name of a standard eTemplate-widget or of
2002-09-12 21:32:53 +02:00
an already existing < a href = "#extensions" > extension< / a > .
< / td >
< / tr >
< tr >
< td > < b > Name< / b > < / td >
< td > id< / td >
< td > yes< / td >
< td > name< / td >
< td >
A string to locate the content for the widget in the content array (index) to show the dialog
and for the returned content.
Can be left blank or be obmitted as xml-attribut if the widget needs no content.< p >
The name can contain the following variables, which gets expanded before they are used as
2005-02-16 00:22:10 +01:00
array index (for an example see the < a href = "etemplate.html" > Tutorial< / a > ):< br / >
2002-09-12 21:32:53 +02:00
< table >
< tr >
< td > < b > $c< / b > < / td >
< td > the column-number (starting with 0, if you have a header, data-cells start at 1)< / td >
< / tr > < tr >
< td > < b > $col< / b > < / td >
< td > the column-letter: 'A', 'B', 'C', ...< / td >
< / tr > < tr >
< td > < b > $row< / b > < / td >
< td > the row-number (starting with 0, if you have a header, data-cells start at 1)< / td >
< / tr > < tr >
< td > < b > $cont< / b > < / td >
< td > the content-array the (sub-)template, on auto-repeated row's this could eg. be
used to generate button-names with id-values in it: "del[$cont[id]]" expands to "del[123]",
if $cont = array('id' => 123)< / td >
< / tr > < tr >
< td > < b > $row_cont< / b > < / td >
< td > the sub-array indexed by $row of the content-array, on auto-repeated row's this could eg. be
used to generate button-names with id-values in it: "del[$row_cont[id]]" expands to "del[123]",
if $cont = array('1' => array('id' => 123),'2' => array('id' => 456)) and $row = 1< / td >
< / tr > < tr >
2005-02-16 00:22:10 +01:00
< td > < b > $c_< br / > $col_< br / > $row_< / b > < / td >
2002-09-12 21:32:53 +02:00
< td > are the respective values of the previous template-inclusion,
eg. the column-headers in the eTemplate-editor are templates itself,
to show the column-name in the header you can not use $col as it will
be constant as it is always the same col in the header-template,
what you want is the value of the previous template-inclusion.< / td >
< / tr >
< / table >
< / td >
< / tr >
< tr >
< td > < b > Label< / b > < / td >
< td > label< / td >
< td > no< / td >
< td > label< / td >
< td >
2003-04-13 21:21:25 +02:00
The label is displayed by default in front (for radiobuttons behind) each widget (if not empty).
If you want to specify a different position, use a '%s' in the label, which gets replaced by
the widget itself. Eg. '%s Name' to have the label Name behind a checkbox.
2002-10-12 18:37:44 +02:00
The label can contain variables, as descript for name.
2002-09-12 21:32:53 +02:00
If the label starts with a '@' it is replaced by the value of the content-array at this
2005-02-16 00:22:10 +01:00
index (with the '@'-removed and after expanding the variables).< br / >
2003-10-07 15:31:23 +02:00
< b > Note< / b > : The label gets always translated, if its longer than 1 char! If this is not
disired, use a label widget, place the not-to-translate label in the content-array
2003-04-13 21:21:25 +02:00
< u > and< / u > check NoTranslation or set the xml attribute no_lang.
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Help< / b > < / td >
< td > statustext< / td >
< td > yes< / td >
< td > help< / td >
< td >
This text / help-message is displayed in the status-bar of the browser when the widget gets focus
(or as tooltip for buttons or general in gtk).
If the user has JavaScript switched off, the help-texts get NOT submitted, as this is detected.
If the helptext starts with a '@' it is replaced by the value of the content-array at this
2005-06-03 00:43:44 +02:00
index (with the '@'-removed and after expanding the variables).
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
2002-09-17 11:13:29 +02:00
< td > < b > Options< / b > < / td >
2002-09-12 21:32:53 +02:00
< td > ?< / td >
< td > ?< / td >
< td > size< / td >
< td >
This attribute controls certain aspects of the different widgets. It's meaning and xml / xul-values
are document with the widgets.
2003-06-29 19:00:05 +02:00
If the options-string starts with a '@' it is replaced by the value of the content-array at this
2005-06-03 00:43:44 +02:00
index (with the '@'-removed and after expanding the variables).
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > NoTranslation< / b > < / td >
< td > no_lang< / td >
< td > no< / td >
< td > no_lang< / td >
< td >
2005-02-16 00:22:10 +01:00
If checked the content of the widget and the label gets NOT translated.< br / >
2002-10-10 13:29:36 +02:00
The helptext of a widget is always translated.
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > needed< / b > < / td >
< td > needed< / td >
< td > no< / td >
< td > needed< / td >
< td >
If checked (xml-attr: needed="1") the etemplates will reprompt the user if he left
2005-02-16 00:22:10 +01:00
the widget / field empty.< br / >
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Readonly< / b > < / td >
< td > readonly< / td >
< td > yes< / td >
< td > readonly< / td >
< td >
If checked (xml-attr: readonly="true") the widget will NOT be editable.
If it is not supported by the browser, the etemplate-class makes shure that no
changes / content is transmitted back to the app.
Only applicable to widgets with input capabilities. Readonly Buttons get removed
from the dialog, like they where disabled.
The readonly attribute could be set on runtime via a readonly-array sublied to
the exec or show function of the class, the value on index=name/id has to be true
to make a widget readonly.
< / td >
< / tr >
< tr >
< td > < b > Disabled< / b > < / td >
< td > disabled< / td >
< td > yes< / td >
< td > disabled< / td >
< td >
If checked (xml-attr: disabled="true") the widget will NOT be shown.
For buttons this could be archived on runtime via setting them readonly.
< / td >
< / tr >
< tr >
< td > < b > onChange< / b > < / td >
< td > onchange< / td >
< td > ?< / td >
< td > onchange< / td >
< td >
If checked (xml-attr: onchange="1") and the contet of the widget is changed by
the user, the form will be submitted.
Via xml or by a program other values can be set (not in the editor at the moment and
this is not compatible with the phpGTK implementation of the eTemplates).
< / td >
< / tr >
< tr >
< td > < b > Span, Class< / b > < / td >
2005-02-16 00:22:10 +01:00
< td > span< br / > class< / td >
< td > span: no< br / > class: yes< / td >
2002-09-12 21:32:53 +02:00
< td > span< / td >
< td >
In the editor and internaly this field contains two comma-separated values:< p >
< b > span< / b > : how many cell a widget should span (default is one), the special value
of 'all' can be used to indicate it should span all remaining cells of a row.
This is not supported by xul-grid's at the moment, but is planned to be.< p >
< b > class< / b > : the CSS class for the widget.
2005-06-03 00:43:44 +02:00
If the class-string starts with a '@' it is replaced by the value of the content-array at this
index (with the '@'-removed and after expanding the variables).
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Align< / b > < / td >
< td > align< / td >
< td > yes< / td >
< td > align< / td >
< td >
Can be set to 'left' (default), 'center' or 'right'.
< / td >
< / tr >
< tr >
2005-02-16 00:22:10 +01:00
< td > < b > Width, Disabled< / b > < br / > column-attr.< / td >
2002-09-12 21:32:53 +02:00
< td > width< / td >
< td > yes< / td >
< td > row[0][#]< / td >
< td >
Can be set to a percentage (eg. '10%'), a number of pixels or ...
< / td >
< / tr >
< tr >
2005-02-16 00:22:10 +01:00
< td > < b > Height, Disabled< / b > < br / > row-attr.< / td >
2002-09-12 21:32:53 +02:00
< td > height< / td >
< td > yes< / td >
< td > row[0][h#]< / td >
< td >
Can be set to a percentage (eg. '10%'), a number of pixels or ...
< / td >
< / tr >
2002-10-10 13:29:36 +02:00
< tr >
2005-02-16 00:22:10 +01:00
< td > < b > Disabled< / b > < br / > column-attr.< br / > row-attr.< / td >
2002-10-10 13:29:36 +02:00
< td > disabled< / td >
< td > no< / td >
2003-08-28 16:31:11 +02:00
< td > disabled< / td >
2002-10-10 13:29:36 +02:00
< td >
2005-02-16 00:22:10 +01:00
Syntax: < b > [!]{@name|value}[={@name2|value2}]< / b > < br / >
Disables (=dont show it) a row/column if a certain criteria is (not (=!)) meet.< br / >
2002-10-10 13:29:36 +02:00
If no '=...' / 2. value is given, the test is made on the first value being not empty, else
the test is made by comparing the two values. Instead of a value you can give a name as an
2005-02-16 00:22:10 +01:00
index into the content prefixed by @. Examples:< br / >
< b > !@data< / b > disables row/col if value of data is empty, < br / >
2002-10-10 13:29:36 +02:00
< b > @val=false< / b > disables if value of val is equal to (the string) 'false'
< / td >
< / tr >
2002-09-12 21:32:53 +02:00
< tr >
2005-02-16 00:22:10 +01:00
< td > < b > Class, Valign< / b > < br / > row-attr.< / td >
< td > class< br / > valign< / td >
2002-09-12 21:32:53 +02:00
< td > both: yes< / td >
< td > row[0][c#]< / td >
< td >
In the editor and internaly this field contains two comma-separated values:< p >
< b > class< / b > : the CSS class for the row, there are 4 predefined css-classes:
nmh: next-match-header-background, nmr: alternating next-match-row-background which
gets replaced by the etemplate class with nmr0 or nmr1.< p >
< b > valign< / b > : vertical alignment of the widgets in the row: 'top', 'middle' (default)
or 'bottom'
< / td >
< / tr >
2003-08-28 16:31:11 +02:00
< tr >
< td > < b > blurText< / b > < / td >
< td > blur< / td >
< td > no< / td >
< td > blur< / td >
< td >
This text get displayed if an input-field is empty < u > and< / u > does not have the
2005-02-16 00:22:10 +01:00
input-focus (blur). It can be used to show a default value or a kind of help-text.< br / >
2003-08-28 16:31:11 +02:00
If it contains a text (eg. 'Search...'), this text is run through lang(), if it contains
a reference to the content array (eg. '@blur_text') it does < u > not< / u > get translated.
< / td >
< / tr >
2002-09-12 21:32:53 +02:00
< / table >
< a name = "widgets" >
< h2 > standard widgets and extensions of the eTemplates< / h2 >
2004-08-28 19:57:44 +02:00
< table border = "1" >
2002-09-12 21:32:53 +02:00
< tr >
2005-02-16 00:22:10 +01:00
< th > Widget Name< br / > in Editor< / th >
2002-09-12 21:32:53 +02:00
< th > xml tag< / th >
< th > xul< / th >
< th > internal name< / th >
< th > description of the widget< th >
< / tr >
< tr >
< td > < b > Label< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < description />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > label< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a textual label< / b > < br / >
2002-09-12 21:32:53 +02:00
The content is taken from the content-array but it can have an own label from
the label attribute too.< p >
2005-08-02 10:56:37 +02:00
< b > Options< / b > has 5 comma-separated fields:< br / >
2003-10-07 15:31:23 +02:00
< b > 1.< / b > if it contains a 'i' and/or a 'b' the content (not the label) is rendered
2005-02-16 00:22:10 +01:00
in italic and/or bold.< br / >
2005-08-02 10:56:37 +02:00
< b > 2.< / b > link: if set to a menuaction string or an array with get-params (via the content-arry),
a link to that methode = app.class.method is put around the label< br / >
2005-02-16 00:22:10 +01:00
< b > 3.< / b > if set URLs in the content get activated< br / >
2005-08-02 10:56:37 +02:00
< b > 4.< / b > name of form-element the label is for: gives focus to that element if the label gets clicked< br / >
2005-11-11 08:04:36 +01:00
< b > 5.< / b > target for the link, eg. _blank< br / >
2007-08-06 15:52:17 +02:00
< b > 6.< / b > width< i > x< / i > height if a popup should be used for the link, eg. 600x400< br / >
2006-06-15 23:57:21 +02:00
< b > 7.< / b > title< i > x< / i > title for the link
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Text< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < textbox />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > text< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a single-line input field for text< / b > < br / >
2002-09-12 21:32:53 +02:00
In the html-UI this is rendered as < input ...>< p >
2005-02-16 00:22:10 +01:00
< b > Options< / b > has 3 comma-separated fields:< br / >
xml: < b > size< / b > : the length in chars of the input-field< br / >
xml: < b > maxlength< / b > : the maximum length of the input< br / >
2004-04-05 03:33:23 +02:00
xml: < b > validator< / b > : perl regular expression to validate the input (kommas are allowed in the expression)
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Integer< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < textbox< br / > type="int" />< / td >
2002-09-12 21:32:53 +02:00
< td > ?< / td >
2002-10-13 01:01:21 +02:00
< td > int< / td >
2002-09-12 21:32:53 +02:00
< td >
2005-02-16 00:22:10 +01:00
< b > a input-field to enter an integer< / b > < br / >
2004-04-05 03:33:23 +02:00
In the html-UI this is rendered as < input ...>. < i > The input-validation is done at the moment only on server-side,
clientside validation and input-restriction to only numbers is planed.< / i > < p >
2005-02-16 00:22:10 +01:00
< b > Options< / b > has 3 comma-separated fields:< br / >
xml: < b > min< / b > : minimum value, default none, empty values are Ok, as long as < b > needed< / b > is not set< br / >
xml: < b > max< / b > : maximum value, default none, empty values are Ok, as long as < b > needed< / b > is not set< br / >
2002-09-12 21:32:53 +02:00
xml: < b > size< / b > : the length in chars of the input-field, default 5
< / td >
< / tr >
< tr >
< td > < b > Float< / b > < / td >
2005-02-16 00:22:10 +01:00
< td > < textbox< br / > type="float"/>< / td >
2002-09-12 21:32:53 +02:00
< td > ?< / td >
< td > float< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a input-field to enter a float< / b > < br / >
2004-04-05 03:33:23 +02:00
In the html-UI this is rendered as < input ...>. < i > The input-validation is done at the moment only on server-side,
clientside validation and input-restriction to only numbers is planed.< / i > < p >
2006-03-27 14:21:29 +02:00
< b > Options< / b > has 4 comma-separated fields:< br / >
2005-02-16 00:22:10 +01:00
xml: < b > min< / b > : minimum value, default none, empty values are Ok, as long as < b > needed< / b > is not set< br / >
xml: < b > max< / b > : maximum value, default none, empty values are Ok, as long as < b > needed< / b > is not set< br / >
2002-09-12 21:32:53 +02:00
xml: < b > size< / b > : the length in chars of the input-field, default 5
2006-03-27 14:21:29 +02:00
xml: < b > precision< / b > : precision of the float number, default maximum
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Textarea< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < textbox< br / > multiline="true" />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > textarea< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a multiline input-field for text< / b > < br / >
2002-09-12 21:32:53 +02:00
In the html-UI this is rendered as < textarea ...>.< p >
2005-02-16 00:22:10 +01:00
< b > Options< / b > has 2 comma-separated fields:< br / >
xml: < b > cols< / b > : the width of the field in chars< br / >
2002-09-12 21:32:53 +02:00
xml: < b > rows< / b > : the number of rows
< / td >
< / tr >
2004-02-28 23:41:32 +01:00
< tr >
2005-02-16 00:22:10 +01:00
< td > < b > Formatted Text< / b > < br / > (HTML)< / td >
2004-02-28 23:41:32 +01:00
< td > < htmlarea />< / td >
< td > no< / td >
< td > htmlarea< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a multiline input-field for formatted (HTML) text< / b > < br / >
2004-02-28 23:41:32 +01:00
In the html-UI this is rendered as < textarea ...> and the HTMLarea javascript editor is used.< p >
2007-01-18 20:19:01 +01:00
< b > Options< / b > has 5 comma-separated fields:< br / >
xml: < b > mode< / b > : {ascii|simple|extended|advanced}< br / >
xml: < b > height< / b > : height of htmlarea< br / >
xml: < b > width< / b > : width of htmlarea< br / >
xml: < b > toolbar< / b > : {true|false} show toolbar< br / >
2007-04-14 18:47:46 +02:00
xml: < b > base_href< / b > : if passed activates the browser for images at the path (relative to the docroot
2004-02-28 23:41:32 +01:00
< / td >
< / tr >
2002-09-12 21:32:53 +02:00
< tr >
< td > < b > Checkbox< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < checkbox />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > checkbox< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a widget that can be checked or unchecked< / b > < br / >
2002-09-12 21:32:53 +02:00
In the html-UI this is rendered as < input type="checkbox" ...>.
2005-06-14 23:38:49 +02:00
< p > 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 < b > form::name( )< / b > function translate the name used
in the template into the name used in the form. < i > 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!< / i > < / p >
< b > Options< / b > : [set_value][,unset_value[,ro_true[,ro_false]]]< br / >
< b > set_value< / b > : which value in the content represents the checked state, default=1< br / >
< b > unset_value< / b > : value in the content representing the unchecked state, default=0< br / >
< b > ro_true< / b > : what should be displayed for a readonly checked box, default=x< br / >
< b > ro_false< / b > : display for an unchecked box, can be set to 'disable', to not display the widget (incl. label), default is empty
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Radiobutton< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < radio />< / td >
2002-09-12 21:32:53 +02:00
< td > ?< / td >
< td > radio< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a widget in a group of which only one can be checked< / b > < br / >
In the html-UI this is rendered as < input type="radio" ...>< br / >
2006-04-30 09:20:36 +02:00
Unlike XUL (and like html) the radio-buttons are grouped by giving them the same name / id.< br / >
< b > Options< / b > : [set_value][,ro_true[,ro_false]]< br / >
< b > set_value< / b > : which value in the content represents the checked state, default=1< br / >
< b > ro_true< / b > : what should be displayed for a readonly checked box, default=x< br / >
< b > ro_false< / b > : display for an unchecked box, can be set to 'disable', to not display the widget (incl. label), default is empty
If the value of the content array at index name/id matches < b > set_value< / b > the radiobutton is marked 'checked'.
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Submitbutton< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < button image="img.gif" ro_image="img-grey.gif" />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > button< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a button to submit the form / end the dialog< / b > < br / >
In the html-UI this is rendered as < input type="submit" ...>.< br / >
2002-09-17 14:29:01 +02:00
If a button is set readonly (via seting its id in the $readonlys array passed to exec) it is not rendered
2005-06-14 23:38:49 +02:00
at all (if no ro_image is given), like it would be disabled.< p >
< b > needed< / b > : 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.< br / >
2002-09-17 14:29:01 +02:00
< b > Options< / b > xml: < b > image, ro_image< / b > : 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) .
2005-02-22 22:02:26 +01:00
< b > onclick< / b > : specify some java-script to be called if the button gets pressed/clicked: < br / >
a) general javascript: "window.close();"< br / >
b) confirmation: "return window.confirm('< message > ');" (message get run through lang()!)< br / >
2005-06-11 12:09:34 +02:00
c) popup: app.class.func& id=$cont[id],target(default _blank),width (default 600),height (default 450)
2005-04-10 15:39:33 +02:00
You can use $cont[< name > ] or $row_cont[< name > ] (note no quotes!) to pass further information to the popup
via the content array.)
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
2007-01-21 14:17:31 +01:00
< tr >
< td > < b > Button< / b > < / td >
< td > < buttononly image="img.gif" ro_image="img-grey.gif" />< / td >
< td > no< / td >
< td > buttononly< / a >
< td >
< b > a button< / b > < br / >
Same as < b > Submitbutton< / b > but it is rendered as < input type="button" ...> in the html-UI
< / td >
< / tr >
2002-09-12 21:32:53 +02:00
< tr >
< td > < b > Horizonatal Rule< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < hrule />< / td >
2002-09-12 21:32:53 +02:00
< td > no< / td >
< td > hrule< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a horizontal rule / line< / b > < br / >
In the html-UI this is rendered as < hr ...>< br / >
2002-09-17 11:13:29 +02:00
< b > Options< / b > can contain a width of the rule, default is 100%
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Template< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < template id="app.name" content="subarr" />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > template< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > a separate eTemplate to be loaded into this cell< / b > < br / >
< b > Name< / b > xml: < b > id< / b > : the name of the etemplate to load< br / >
2002-09-17 11:13:29 +02:00
< b > Options< / b > xml: < b > content< / b > : if set, the template uses an own sub-array
of the content array indexed by the value of this field (if not the full
2002-09-12 21:32:53 +02:00
content-array is used). Variables like $row can be used as descript
for the general attribute Name.
< / td >
< / tr >
< tr >
< td > < b > Image< / b > < / td >
2005-06-14 23:38:49 +02:00
< td > < image src="foo.gif" label="Get a foo" options="app.class.method" />< / td >
2002-09-12 21:32:53 +02:00
< td > yes< / td >
< td > image< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > shows an image< / b > < br / >
< b > Label< / b > xml: < b > label< / b > : the label is shown as tooltip (like html-title)< br / >
< b > Name< / b > xml: < b > src< / b > : the name of the image to load, the image is search in the apps template-dirs< br / >
2005-11-11 08:04:36 +01:00
< b > Options< / b > xml: < b > options< / b > : up to 4 comma-separated values:< br / >
< b > 1.< / b > link to a methode = app.class.method for the image< br / >
< b > 2.< / b > target for the link, eg. _blank< br / >
< b > 3.< / b > imagemap< br / >
< b > 4.< / b > width< i > x< / i > height if a popup should be used for the link, eg. 600x400< br / >
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
< tr >
< td > < b > Selectbox< / b > < / td >
< td >
2005-02-16 00:22:10 +01:00
< menulist>< br / >
2005-06-14 23:38:49 +02:00
< menupopup id="name" options="Select one" />< br / >
2002-09-17 11:13:29 +02:00
< /menulist>< p >
2005-02-16 00:22:10 +01:00
< i > multiselect: < b > options< / b > > 1< / i > < br / >
2002-10-03 20:26:47 +02:00
< listbox rows="#"/>< p >
< i > Examples for predefined selectboxes< / i > :< p >
< listbox type="select-cat" rows="5"/>< p >
2005-02-16 00:22:10 +01:00
< menulist>< br / >
< menupopup type="select-account" options="All,both,2"/>< br / >
2002-10-03 20:26:47 +02:00
< /menulist>< p >
2002-09-12 21:32:53 +02:00
< / td >
< td > yes< / td >
< td > select< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > shows a selectbox< / b > < br / >
2002-09-12 21:32:53 +02:00
The content of the selectbox / the options have to be in an array which can be in 2 locations:
< ol >
< li > in $content["options-$name"]
< li > or in an separate array only for select-box-options under the index name, this array is passed
to the exec or show function of the etemplate-class
< / ol >
2002-09-17 11:13:29 +02:00
< b > Options< / b > < i > in the editor< / i > : if set and > 1 the selectbox is a multiselection with options number of lines< p >
xml: < b > rows< / b > : < i > only for < listbox>< / i > : number of rows to show< p >
2002-10-03 20:26:47 +02:00
xml < b > options< / b > : < i > only for < menupopup/>< / i > : textual label for a first Row, e.g. 'All' or 'None'
(id will be ''), additional attr see sub-types< p >
2002-09-17 11:13:29 +02:00
xml: < b > type< / b > : can be set to get several predefined select-contents, in that case you dont need to set
2005-02-16 00:22:10 +01:00
the content as descripted above (if set it too its in front of the predefined rows): < br / >
< b > select-cat< / b > :< br / >
2006-12-04 15:39:22 +01:00
Select an eGW category, determined by the options-field:< br / >
,{no_global_cats},{extra_style_multiselct},{cat_app(default:current app)}< br / >
2005-02-16 00:22:10 +01:00
< b > select-account< / b > :< br / >
Select a user and/or group, determined by the options-field:< br / >
,{accounts(default)|groups|both},{''(phpgw-default)|0(only lid)|1(only names)|2(both)}< br / >
< b > select-percent, select-priority, select-access, select-country, select-state< / b > :< br / >
as you expect by the name< br / >
< b > select-year, select-month, select-day< / b > :< br / >
2003-05-04 11:18:56 +02:00
options for year: ,start,end (start and end can be a number of
2005-02-16 00:22:10 +01:00
years from now or if > 100 a absolut year)< br / >
< b > select-number< / b > :< br / >
Select a number out of a range specified by the options-field:< br / >
,{start (default=1)},{end (incl., default=10)},{decrement (default={padding zeros}1)}.< br / >
2003-08-28 16:31:11 +02:00
Example with padding zeros: options=',0,59,05' will give values: 00, 05, 10, ..., 55
2005-02-16 00:22:10 +01:00
(like you would use it for minutes in a time-field)< br / >
< b > select-dow< / b > :< br / >
Select one or multiple weekdays, keys are as defined in MCAL_M_... (1=Sun, 2=Mon, 4=Tue, ...)< br / >
< b > select-app< / b > :< br / >
2003-05-04 11:18:56 +02:00
Select an application, availible options: ,{''=user enabled(default)|installed|all)}
2002-10-12 18:37:44 +02:00
< / td >
< / tr >
< tr >
< td > < b > FileUpload< / b > < / td >
< td >
2005-02-16 00:22:10 +01:00
< file id="name"/>< br / >
2002-10-12 18:37:44 +02:00
< / td >
< td > no< / td >
< td > file< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > Input and Button to select a file for uploading< / b > < br / >
2002-10-12 18:37:44 +02:00
Returns the file-name of the uploaded file in the servers tmp-dir (the webserver needs to have a
writable tmp-dir) plus, if javascript is enabled, the local filename of the client as "${name}_path".
< / td >
< / tr >
2002-10-13 01:01:21 +02:00
< tr >
< td > < b > Date< / b > < / td >
< td >
2003-04-13 21:21:25 +02:00
< date options="Y-m-d,1"/>< p >
< date type="date-time"/>< p >
2005-06-03 00:43:44 +02:00
< date type="date-timeonly" options="H:i"/>< p >
< date type="date-houronly"/>< p >
< date type="date-duration"/>
2002-10-13 01:01:21 +02:00
< / td >
< td > no< / td >
< td > date< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > Date-/Time-input< / b > via selectboxes or a field for the year< br / >
The order of the input-fields is determined by the prefs of the user.< br / >
< b > Options< / b > : [datetime-storage-format] [,& 1=year-no-selectbox|& 2=today-button|& 4=one-min-steps|& 8=ro-suppress-0h0]< br / >
2003-04-13 21:21:25 +02:00
< b > datetime-storage-format< / b > is the format, in which the date is stored in the variable:
empty means an unix-timestamp (in GMT), or a string containing the letters < b > Y< / b > , < b > m< / b > ,
< b > d< / b > , < b > H< / b > , < b > i< / b > plus separators, eg. 'Y-m-d': 2002-12-31. The storage format
for times is always 24h or timestamp with date 1.1.1970 (if no date used). (This has nothing
2005-02-16 00:22:10 +01:00
to do with the format of the display, which is only determined by the users preferences.)< br / >
2003-04-13 21:21:25 +02:00
< b > year-no-selectbox< / b > if set (& 1) an int-widget (input-field) is used instead of a
2005-02-16 00:22:10 +01:00
select-year widget.< br / >
2003-04-13 21:21:25 +02:00
< b > today-button< / b > : if set (& 2) a [Today] button is displayed which sets the fields to
2005-02-16 00:22:10 +01:00
the up-to-date date (via javascript)< br / >
< b > one-min-steps< / b > : if set (& 4) the minute-selectbox uses one minutes steps, default 5min steps< br / >
< b > ro-suppress-0h0< / b > : if set (& 8) the time is suppressed for readonly and a time of 0h0< br / >
2007-03-09 12:23:26 +01:00
< b > day-of-week-prefix< / b > : if set (& 16) readonly dates get prefixed with the day of week< br / >
< b > week-number-prefix< / b > : if set (& 32) readonly dates get prefixed with lang('Wk') & weeknumber< br / >
2005-02-16 00:22:10 +01:00
< b > Sub-widgets< / b > : < b > date-time< / b > : a date and a time and < b > date-timeonly< / b > or < b > date-houronly< / b > : only a time / hour< br / >
2003-04-13 21:21:25 +02:00
These widgets allow the input of times too or only, they use 12h am/pm or 24h format as
2005-02-16 00:22:10 +01:00
specified in the user prefs.< br / >
2005-06-03 00:43:44 +02:00
< i > If readonly is set, this widget can be used to display a date, without the need to convert it.< / i > < p >
< b > Duration< / b > a floating point input with an optional selectbox for the unit (hours or days)< br >
< b > Options< / b > : [duration-storage-format] [,[duration-display][,hours_per_day]]< br / >
< b > duration-storage-format< / b > : 'h' = hours (float), 'd' = days (float), default minutes (integer)< br / >
< b > duration-display< / b > : 'd' = days, 'h' = hours, 'dh' = days or hours with selectbox, optional '%' allows to enter a percentage< br / >
< b > hours_per_day< / b > : conversation between hours and (working) day, default 8
< b > hours_per_day< / b > : conversation between hours and (working) day, default 8
2002-10-13 01:01:21 +02:00
< / td >
< / tr >
2002-10-12 18:37:44 +02:00
< tr >
2005-02-08 13:29:06 +01:00
< td > < b > VBox, HBox, Box< / b > < / td >
2002-10-12 18:37:44 +02:00
< td >
2005-02-16 00:22:10 +01:00
< vbox>< br / >
< widget ...>< br / >
< widget ...>< br / >
2002-10-12 18:37:44 +02:00
< /vbox>< p >
2005-02-16 00:22:10 +01:00
< hbox span="all">< br / >
< widget ...>< br / >
< widget ...>< br / >
2005-02-08 13:29:06 +01:00
< /hbox>< p >
2005-02-18 23:44:42 +01:00
< box orient="horizontal">< br / >
2005-02-16 00:22:10 +01:00
< widget ...>< br / >
< widget ...>< br / >
2005-02-08 13:29:06 +01:00
< /box>
2002-10-12 18:37:44 +02:00
< / td >
< td > yes< / td >
2005-02-08 13:29:06 +01:00
< td > vbox, hbox, box< / td >
2002-10-12 18:37:44 +02:00
< td >
2005-02-08 13:29:06 +01:00
vertical or horizontal < b > container< / b > for child widgets. This is useful if one needs more
widgets or widgets outside the column- / row-order of a grid. HBox or VBox is rendered as Grid/html:table
2006-09-27 15:09:28 +02:00
with only one row or colum. Box is rendered as a html:div containing all child-widgets.
2002-10-12 18:37:44 +02:00
Disabled child-cells are completly left out (no empty cells or rows get generated).< p >
2005-02-18 23:44:42 +01:00
< b > Options< / b > < i > in the editor< / i > : the number of cells in the box (does NOT need to be set in xml).< br / >
< b > orient< / b > : horizontal, vertical or none (means h/vbox as expected and no table for boxes)
2006-09-27 15:09:28 +02:00
< b > cellpadding,cellspacing< / b > : known table-options
< b > keepEmpty< / b > : if true, empty cells (lines or rows) are kept, otherwise they are completly removed
2002-10-12 18:37:44 +02:00
< / td >
2002-09-12 21:32:53 +02:00
< / tr >
2005-02-06 16:49:50 +01:00
< tr >
< td > < b > GroupBox< / b > < / td >
< td >
2005-02-16 00:22:10 +01:00
< groupbox>< br / >
< caption label="Legend"/>< br / >
< widget ...>< br / >
< widget ...>< br / >
2005-02-06 16:49:50 +01:00
< /groupbox>< p >
< / td >
< td > yes< / td >
< td > groupbox< / td >
< td >
2005-02-16 00:22:10 +01:00
container to visualy < b > group other widgets< / b > by putting a border around them.< br / >
2005-02-06 16:49:50 +01:00
The upper line may contain a legend. The widgets are ordered vertical, like a VBox.
Disabled child-cells are completly left out (no empty cells or rows get generated).< p >
2005-02-18 23:44:42 +01:00
< b > Options< / b > < i > in the editor< / i > : the number of cells in the box (does NOT need to be set in xml).< br / >
< b > orient< / b > : horizontal, vertical or none (defaults to vertical)
< b > options< / b > : cellpadding,cellspacing of the table
2005-02-06 16:49:50 +01:00
< / td >
< / tr >
2002-09-12 21:32:53 +02:00
< tr >
< td > < b > Tabs< / b > < / td >
< td >
2005-02-16 00:22:10 +01:00
< tabbox id="name">< br / >
< tabs>< br / >
< tab label="Tab 1" statustext="Help"/>< br / >
...< br / >
< /tabs>< br / >
< tabpanels>< br / >
< grid id="app.name.tab1"/>< br / >
...< br / >
< /tabpanels>< br / >
2002-09-12 21:32:53 +02:00
< /tabbox>
< / td >
< td > yes< / td >
< td > tab< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > shows a tab-widget< / b > < br / >
2002-09-12 21:32:53 +02:00
The tab-widget is implemented as an extension, as html does not have a tab-widget.< p >
The following fields / attributes are in the Editor and internaly in the class separeted by '|', in the
2005-02-16 00:22:10 +01:00
xml/xul-file the are attributes of each tab- or grid-tag:< br / >
< b > Label< / b > xml: < b > label< / b > : the labels of the tabs eg. 'Tab 1|Tab 2|Tab 3'< br / >
< b > Help< / b > xml: < b > statustext< / b > : of the tabs< br / >
2002-10-06 02:25:50 +02:00
< b > Name< / b > xml: < b > id< / b > : the names/ids of the eTemplates/grid's to fill the bodies of the tabs, if the
2005-06-14 23:38:49 +02:00
name contains no '.', it will be prefixed with the name of the template the widget is in plus a '.'
2002-10-03 20:26:47 +02:00
< / td >
< / tr >
2005-11-11 08:04:36 +01:00
< tr >
< td > < b > Manual< / b > < / td >
< td >
< manual>
< / td >
< td > no< / td >
< td > manual< / td >
< td >
< b > open the online help< / b > : displays a small manual icon.< p >
< b > Name< / b > xml: < b > id< / b > : optional name of the manual page (as index into $content or direct).
If no manual page is given, the link included the referer as _GET param.
< / td >
< / tr >
< tr >
< td > < b > Custom fields< / b > < / td >
< td >
< custom_fields>
< / td >
< td > no< / td >
< td > custom_fields< / td >
< td >
< b > display custom fields< / b > : the fields can be configured with admin.customfields.edit& appname={app}< p >
The indexes of the custom fields in content are prefixed with a hash (#).
< / td >
< / tr >
2002-10-03 20:26:47 +02:00
< tr >
< td > < b > NextMatch< / b > < / td >
< td >
< nextmatch options="notes.index.rows" id="nm"/>
< / td >
< td > yes< / td >
< td > tab< / td >
< td >
2005-02-16 00:22:10 +01:00
< b > shows a table with some selectboxes, a search-field and arrows to scroll the table< / b > < br / >
2002-10-03 20:26:47 +02:00
The nextmatch-widget is implemented as an extension.< p >
2005-02-16 00:22:10 +01:00
< b > Options< / b > xml: < b > options< / b > : name of the template to display the rows< br / >
2002-10-03 20:26:47 +02:00
< b > Name< / b > xml: < b > id< / b > : index into the content-array, it need to be pre-set with some information
for the nextmatch widget and it returns its content with it:
< / td >
< tr >
< td colspan = "5" >
< pre >
2003-06-29 19:00:05 +02:00
$content[$id] = array( < span > // I = value set by the app, 0 = value on return / output< / span >
2005-02-22 22:02:26 +01:00
'get_rows' => < span > // I method/callback to request the data for the rows eg. 'notes.bo.get_rows'< / span >
'filter_label' => < span > // I label for filter (optional)< / span >
'filter_help' => < span > // I help-msg for filter (optional)< / span >
'no_filter' => True< span > // I disable the 1. filter< / span >
'no_filter2' => True< span > // I disable the 2. filter (params are the same as for filter)< / span >
'no_cat' => True< span > // I disable the cat-selectbox< / span >
2006-12-04 15:39:22 +01:00
'cat_app' => < span > // I application the cat's should be from, default app in get_rows< / span >
2005-02-22 22:02:26 +01:00
'template' => < span > // I template to use for the rows, if not set via options< / span >
'header_left' => < span > // I template to show left of the range-value, left-aligned (optional)< / span >
'header_right' => < span > // I template to show right of the range-value, right-aligned (optional)< / span >
'bottom_too' => True< span > // I show the nextmatch-line (arrows, filters, search, ...) again after the rows< / span >
2005-07-13 10:39:42 +02:00
'never_hide' => True< span > // I never hide the nextmatch-line if less then maxmatch entrie< / span >
2006-04-30 09:20:36 +02:00
'lettersearch' => True< span > // I show a lettersearch< / span >
'searchletter' => < span > // I0 active letter of the lettersearch or false for [all]< / span >
2005-02-22 22:02:26 +01:00
'start' => < span > // IO position in list< / span >
2006-04-30 09:20:36 +02:00
'num_rows' => < span > // IO number of rows to show, defaults to maxmatches from the general prefs< / span >
2005-02-22 22:02:26 +01:00
'cat_id' => < span > // IO category, if not 'no_cat' => True< / span >
'search' => < span > // IO search pattern< / span >
'order' => < span > // IO name of the column to sort after (optional for the sortheaders)< / span >
'sort' => < span > // IO direction of the sort: 'ASC' or 'DESC'< / span >
'col_filter' => < span > // IO array of column-name value pairs (optional for the filterheaders)< / span >
'filter' => < span > // IO filter, if not 'no_filter' => True< / span >
'filter_no_lang' => True< span > // I set no_lang for filter (=dont translate the options)< / span >
2006-04-30 09:20:36 +02:00
'filter_onchange'=> 'this.form.submit();'< span > // I onChange action for filter, default: this.form.submit();< / span >
2005-02-22 22:02:26 +01:00
'filter2' => < span > // IO filter2, if not 'no_filter2' => True< / span >
'filter2_no_lang'=> True< span > // I set no_lang for filter2 (=dont translate the options)< / span >
2006-04-30 09:20:36 +02:00
'filter2_onchange'=> 'this.form.submit();'< span > // I onChange action for filter, default: this.form.submit();< / span >
2005-02-22 22:02:26 +01:00
'rows' => < span > // O content set by callback< / span >
'total' => < span > // O the total number of entries< / span >
2006-04-30 09:20:36 +02:00
'sel_options' => < span > // O additional or changed sel_options set by the callback and merged into $tmpl->sel_options< / span >
2007-03-07 13:30:17 +01:00
'no_columnselection' => < span > // I turns off the columnselection completly, turned on by default< / span >
'columnselection-pref' => < span > // I name of the preference (plus 'nextmatch-' prefix), default = template-name< / span >
2007-09-22 16:58:10 +02:00
'default_cols' => < span > // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns< / span >
2007-12-11 23:29:05 +01:00
'options-selectcols' => < span > // I array with name/label pairs for the column-selection, this gets autodetected by default.
A name => false hides the column from the column-selection.
To completely hide a column, you need to use the Grid column attributes - disabled in eTemplate, and have your get_rows function
set a key that matches.
For example, if your column name is private_phone, use the eTemplate editor to set column disabled to @no_private_phone,
and have your get_rows function set $rows['no_private_phone'] = true (or some calculated condition).
< / span >
2007-09-22 16:58:10 +02:00
'return' => < span > // IO allows to return something from the get_rows function if $query is a var-param!< / span >
'csv_fields' => < span > // I false=disable csv export, true or unset=enable it with auto-detected fieldnames,
or array with name=>label or name=>array('label'=>label,'type'=>type) pairs (type is a eT widget-type)< / span >
2002-10-03 20:26:47 +02:00
);
< span > /*
* example: the get_rows function from notes.bo.get_rows (has to be in public_functions !)
*/< / span >
function get_rows($query,& $rows,& $readonlys)
{
$rows = $this->read($query['start'],$query['search'],$query['filter'],$query['cat_id']);
if (!is_array($rows))
{
$rows = array( );
}
$readonlys = array( ); < span > // set readonlys to enable/disable our edit/delete-buttons< / span >
while (list($n,$note) = each($rows))
{
if (!$this->check_perms($this->grants[$note['owner_id']],PHPGW_ACL_EDIT))
{
$readonlys["edit[$note[id]]"] = True;
}
if (!$this->check_perms($this->grants[$note['owner_id']],PHPGW_ACL_DELETE))
{
$readonlys["delete[$note[id]]"] = True;
}
}
return $this->total_records;
}
< span > /*
* Example how the nextmatch-widget is used in notes.ui.index:
*/< / span >
function index($content = 0)
{
if (!is_array($content))
{
$content = array('nm' => $this->session_data); < span > // restore settings from the session< / span >
}
if (isset($content['nm']['rows'])) < span > // one of the buttons in the rows is pressed< / span >
{
$this->session_data = $values['nm']; < span > // save the settings in the session< / span >
unset($this->session_data['rows']); < span > // we dont want to save the content of the rows< / span >
$this->save_sessiondata();
if (isset($values['nm']['rows']['edit']))
{
list($id) = each($values['nm']['rows']['edit']);
return $this->edit($id);
}
elseif (isset($values['nm']['rows']['delete']))
{
list($id) = each($values['nm']['rows']['delete']);
return $this->delete($id);
}
}
$values['nm']['options-filter'] = array ( < span > // set up the data for our filter< / span >
'all' => 'Show all',
'public' => 'Only yours',
'private' => 'Private'
);
$values['nm']['get_rows'] = 'notes.bo.get_rows';
$values['nm']['no_filter2'] = True; < span > // disable the 2. filter< / span >
$this->tpl->read('notes.index');
$this->tpl->exec('notes.ui.index',$values);
}
< / pre >
2002-09-12 21:32:53 +02:00
< / td >
< / tr >
2003-12-18 07:08:55 +01:00
< tr >
2006-09-12 17:14:39 +02:00
< td > < b > Nextmatch-< br / > SortHeader< / b > < p > < b > Nextmatch-< br / > FilterHeader< / b > < p > < b > Nextmatch-< br / > Custom FilterHeader< / b > < p > < b > Nextmatch-< br / > AccountFilter< / b > < / td >
2003-12-18 07:08:55 +01:00
< td >
2005-07-17 23:42:11 +02:00
< nextmatch type="nextmatch-sortheader" id="col-name" options="DESC" label="ColLabel"/>< p >
2005-07-14 08:53:19 +02:00
< nextmatch type="nextmatch-filterheader" id="col-name"/>< p >
2006-09-12 17:14:39 +02:00
< nextmatch type="nextmatch-customfilter" id="col-name" options="select-precent"/>< p >
2005-07-14 08:53:19 +02:00
< nextmatch type="nextmatch-accountfilter" id="col-name"/>
2003-12-18 07:08:55 +01:00
< / td >
< td > no< / td >
2007-03-07 13:30:17 +01:00
< td > nextmatch-< br / > sortheader< p > nextmatch-< br / > filterheader< p > nextmatch-< br / > customfilter< p > nextmatch-< br / > accountfilter< p > nextmatch-< br / > header< / td >
2003-12-18 07:08:55 +01:00
< td >
These widget are an optional part of the nextmatch widget.< p >
2005-02-16 00:22:10 +01:00
< b > nextmatch-sortheader< / b > < br / >
2003-12-18 07:08:55 +01:00
Widget to be placed as a colum-header in the headerline of a nextmatch-template. It allows, by clicking on it,
to order the lines of the nextmatch after a certain column. The column-name is given as < b > name< / b > (xml:id) the
2005-07-17 23:42:11 +02:00
< b > label< / b > is show as a link of button (no javascript). One can specify a default sorting: < b > options< / b > ={DESC|ASC} (default=ASC),
to be used when the header is clicked for the first time. Consecutive click on the header change the sorting
2007-03-07 13:30:17 +01:00
direction, indicated by a little up- or down-arrow. As a second comma-separated parameter one can specify an extra
label for the column-selection.< p >
2005-02-16 00:22:10 +01:00
< b > nextmatch-filterheader< / b > < br / >
2003-12-18 07:08:55 +01:00
Widget to allow to show only certain row, which match a selected filter-value. The column-name is given as < b > name< / b >
(xml:id), the options of the displayed selectbox need to be set as for an ordinary selectbox (eg. in the options
parameter to the uietemplate::exec function). If no extra-label is given in options, lang('all') will be used for
2007-03-07 13:30:17 +01:00
the empty value, which means no filter activ. An (optional) < b > label< / b > can be given and is also used for the column-selection.< p >
2006-09-12 17:14:39 +02:00
< b > nextmatch-customfilter< / b > < br / >
The custom filterheader allows to use other (select-)widgets to filter by them. They have to be specified as the first
parameter in the comma-separated options attribute. In all other aspects it is identical to the filterheader.< p >
2005-07-14 08:53:19 +02:00
< b > nextmatch-accountfilter< / b > < br / >
2006-09-12 17:14:39 +02:00
The Accountfilter allows to select users (via the prefered user-selection-method) to filter by them.
It's identical to a < b > nextmatch-customfilter< / b > with options="select-account".< p >
2007-03-07 13:30:17 +01:00
< b > nextmatch-header< / b > < br / >
Just a header-label for a nextmatch column. It names the column for the column for the column-selection (in difference to the label).
The name is used to hide the column (with a 'no_' prefix) and as the name for the preference.
A different label for the column-selection preference can be specified via the option field.< p >
2006-09-12 17:14:39 +02:00
< i > < u > Note< / u > :< / i > All four widgets interoperate with the nextmatch-widget which passes the set values as part if
2003-12-18 07:08:55 +01:00
the query-parameter to its get_rows function, they are < u > not< / u > returned in the rows sub-array.
< / td >
< / tr >
2003-06-29 19:00:05 +02:00
< tr >
< td > < b > LinkWidgets< / b > < / td >
< td >
< link type="link-to" id="name"/>< p >
< link type="link-list" id="name"/>< p >
< link type="link-string" id="name"/>< p >
< / td >
< td > no< / td >
< td > link-to< p > link-list< p > link-string< / td >
< td >
2007-08-06 15:52:17 +02:00
These widgets are the UI-part of the link-class ({bo|so}link) in the API.< p >
eGroupWare has a linking system that lets you link two records from different apps together.< p >
For example, you can link the addressbook entry of the person you're meeting with to the meeting on your calendar,
or an infolog entry for the phone call you made to postpone the meeting.< p >
To display links in your own application, you should use the LinkList group of widgets.< p >
2005-02-16 00:22:10 +01:00
< b > link-list< / b > < br / >
2003-06-29 19:00:05 +02:00
Widget to shows the links to an entry and a Unlink Button for each link. < p >
2007-08-06 15:52:17 +02:00
It needs an array with two entries. If you name the LinkList widget 'links', you need: < / p >
< pre >
$data['links']['to_app'] = 'myapp';
$data['links']['to_id'] = $record_id;
< / pre >
< p > This will display links where the $record_id record of myapp is one side of the link.
Make sure that both variables are properly defined before the form template gets executed.
< p > < b > link-to< / b > < br / >
Widget to make a links to other entries of link-aware apps and to attach files.< p >
2003-06-29 19:00:05 +02:00
< i > < u > Note< / u > :< / i > Both Widgets can be used on the same template with the < u > same< / u > name. They share
2007-08-06 15:52:17 +02:00
the content of the variable with that name, which contains just the id of the entry in the current app.< p >
2003-12-18 07:08:55 +01:00
2005-02-16 00:22:10 +01:00
< b > link-string< / b > < br / >
2003-12-18 07:08:55 +01:00
Comma-separated list of link-titles with a link to its view-method, value is like the return
2007-08-06 15:52:17 +02:00
of bolink::get_links().< p >
< hr >
Before you can use a link to your application, you need to specify some information in a 'search_link' hook.< p >
In your setup.inc.php, you need to point $setup_info['myapp']['hooks']['search_link'] to a function that will return an array: < p >
< pre > return array(
'query' => 'myapp.bo_myapp.link_query',
// A function that takes a search string
// and returns a list of matching records
'title' => 'myapp.bo_myapp.link_title',
// A function that takes an id from one side
// of a link and returns a string for that entry
'view' => array('menuaction'=> 'myapp.ui_myapp.link_view'),
// Function to view a link, may be an existing view function
'view_id' => 'link_id',
// name of the id variable provided to the view function above
'add' => array('menuaction' => 'myapp.ui_myapp.new_entry'),
// Function to add a new entry
);
< / pre >
< p > Also, make sure that the declared methods are implemented and methods from the UI class are listed in its $public_methods attribute:
< pre >
class ui_myapp {
var $public_methods = array(
'view' => true,
'add' => true
);
...
}
< / pre >
2003-06-29 19:00:05 +02:00
< / td >
< / tr >
2002-09-12 21:32:53 +02:00
< / table >
2003-06-29 19:00:05 +02:00
< h3 > One remark about cross-site-scripting< / h3 >
2003-12-18 07:08:55 +01:00
The following eTemplate Widgets are parsing its content before displaying through < b > htmlspecialchars()< / b > to
2003-06-29 19:00:05 +02:00
correctly display the content and to gard against malecious data (like scripts etc.):
< ul >
< li > Label
< li > Text, Textarea
< li > Integer, Float
< li > SelectBoxes (it's options-strings)
< li > LinkWidgets: link-to, link-list, link-string
< / ul >
This is done in most cases by the underlaying html-class and not direct in eTemplate.
2002-09-12 21:32:53 +02:00
< p >
< hr >
< a name = "extensions" >
< h1 > How to implement new widgets / extensions to the eTemplates?< / h1 >
< p > The eTemplates have an interface to extend them with new widgets. These widgets are php-classes, can use
eTemplates to define the UI of the new widget and are stored in the eTemplate's inc-dir or the inc-dir of a
2003-10-26 20:25:13 +01:00
eGroupWare application. The editor and the etemplate-class autoload the existing extensions.< / p >
2002-09-12 21:32:53 +02:00
2003-12-18 07:08:55 +01:00
< i > I will made more documentation about the interface availible soon. For now have a look for the source
2003-06-29 19:00:05 +02:00
of the existing extensions.< / i >
2002-09-12 21:32:53 +02:00
2003-06-29 19:00:05 +02:00
< h2 > please < a href = "#" onClick = "document.location='mai'+'lto:RalfBecker'+unescape('%40')+'outdoor-training'+unescape('%2E')+'de'; return false;" > contact me< / a > if you have further questions or comments about the eTemplates< / h2 >
2002-09-12 21:32:53 +02:00
< / body >
< / html >