changed documentation to phpdoc standard

This commit is contained in:
Ralf Becker 2004-10-07 21:53:10 +00:00
parent b7d77a8588
commit cff0ca3801
3 changed files with 457 additions and 468 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* eGroupWare - EditableTemplates - Buiseness Objects * * eGroupWare - EditableTemplates - Business Objects *
* http://www.eGroupWare.org * * http://www.eGroupWare.org *
* Written by Ralf Becker <RalfBecker@outdoor-training.de> * * Written by Ralf Becker <RalfBecker@outdoor-training.de> *
* -------------------------------------------- * * -------------------------------------------- *
@ -14,13 +14,15 @@
include_once(PHPGW_INCLUDE_ROOT . '/etemplate/inc/class.soetemplate.inc.php'); include_once(PHPGW_INCLUDE_ROOT . '/etemplate/inc/class.soetemplate.inc.php');
/*! /**
@class boetemplate * Business Object for eTemplates, extending the Storage Object
@author ralfbecker *
@abstract Buiseness Objects for eTemplates * Not so much so far, as the most logic is still in the UI-class
@discussion Not so much so far, as the most logic is still in the UI-class *
@param $types,$alings converts internal names/values to (more) human readible ones * @package etemplate
*/ * @author RalfBecker-AT-outdoor-training.de
* @license GPL
*/
class boetemplate extends soetemplate class boetemplate extends soetemplate
{ {
var $extensions = array(); var $extensions = array();
@ -47,27 +49,16 @@
'hbox' => 'HBox', // a (horizontal) box to contain widgets in cols, size = # of cols 'hbox' => 'HBox', // a (horizontal) box to contain widgets in cols, size = # of cols
'deck' => 'Deck' // a container of elements where only one is visible, size = # of elem. 'deck' => 'Deck' // a container of elements where only one is visible, size = # of elem.
); );
/*! /**
@function boetemplate * constructor of class
@abstract constructor of class *
@param $name name of etemplate or array with name and other keys * Calls the constructor of soetemplate
@param $load_via name/array with keys of other etemplate to load in order to get $name *
@discussion Calls the constructor of soetemplate * @param $name string/array name of etemplate or array with name and other keys
*/ * @param $load_via string/array name or array with keys of other etemplate to load in order to get $name
*/
function boetemplate($name='',$load_via='') function boetemplate($name='',$load_via='')
{ {
$this->public_functions += array(
'set_row_attribute' => True,
'disable_row' => True,
'set_column_attribute' => True,
'disable_column' => True,
'disable_cells' => True,
'set_cell_attribute' => True,
'get_cell_attribute' => True,
'get_array' => True,
'set_array' => True,
'unset_array' => True
);
$this->soetemplate(); $this->soetemplate();
$tname = &$name; $tname = &$name;
@ -84,32 +75,32 @@
} }
} }
/*! /**
@function expand_name * allows a few variables (eg. row-number) to be used in field-names
@syntax expand_name( $name,$c,$row,$c_='',$row_='',$cont='' ) *
@author ralfbecker * This is mainly used for autorepeat, but other use is possible.
@abstract allows a few variables (eg. row-number) to be used in field-names * You need to be aware of the rules PHP uses to expand vars in strings, a name
@discussion This is mainly used for autorepeat, but other use is possible. * of "Row$row[length]" will expand to 'Row' as $row is scalar, you need to use
@discussion You need to be aware of the rules PHP uses to expand vars in strings, a name * "Row${row}[length]" instead. Only one indirection is allowd in a string by php !!!
@discussion of "Row$row[length]" will expand to 'Row' as $row is scalar, you need to use * Out of that reason we have now the variable $row_cont, which is $cont[$row] too.
@discussion "Row${row}[length]" instead. Only one indirection is allowd in a string by php !!! * Attention !!!
@discussion Out of that reason we have now the variable $row_cont, which is $cont[$row] too. * Using only number as index in field-names causes a lot trouble, as depending
@discussion Attention !!! * on the variable type (which php determines itself) you used filling and later
@discussion Using only number as index in field-names causes a lot trouble, as depending * accessing the array it can by the index or the key of an array element.
@discussion on the variable type (which php determines itself) you used filling and later * To make it short and clear, use "Row$row" or "$col$row" not "$row" or "$row$col" !!!
@discussion accessing the array it can by the index or the key of an array element. *
@discussion To make it short and clear, use "Row$row" or "$col$row" not "$row" or "$row$col" !!! * @param $name sring the name to expand
@param $name the name to expand * @param $c int is the column index starting with 0 (if you have row-headers, data-cells start at 1)
@param $c is the column index starting with 0 (if you have row-headers, data-cells start at 1) * @param $row int is the row number starting with 0 (if you have col-headers, data-cells start at 1)
@param $row is the row number starting with 0 (if you have col-headers, data-cells start at 1) * @param $c_, $row_ int are the respective values of the previous template-inclusion,
@param $c_, $row_ are the respective values of the previous template-inclusion, * eg. the column-headers in the eTemplate-editor are templates itself,
@param 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
@param 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,
@param be constant as it is always the same col in the header-template, * what you want is the value of the previous template-inclusion.
@param what you want is the value of the previous template-inclusion. * @param $cont array content of the template, you might use it to generate button-names with id values in it:
@param $cont content array of the template, you might use it to generate button-names with * "del[$cont[id]]" expands to "del[123]" if $cont = array('id' => 123)
@param id values in it: "del[$cont[id]]" expands to "del[123]" if $cont = array('id' => 123) * @return string the expanded name
*/ */
function expand_name($name,$c,$row,$c_='',$row_='',$cont='') function expand_name($name,$c,$row,$c_='',$row_='',$cont='')
{ {
$is_index_in_content = $name[0] == '@'; $is_index_in_content = $name[0] == '@';
@ -133,29 +124,29 @@
return $name; return $name;
} }
/*! /**
@function autorepeat_idx * Checks if we have an row- or column autorepeat and sets the indexes for $content, etc.
@abstract Checks if we have an row- or column autorepeat and sets the indexes for $content, etc. *
@discussion Autorepeat is important to allow a variable numer of rows or cols, eg. for a list. * Autorepeat is important to allow a variable numer of rows or cols, eg. for a list.
@discussion The eTemplate has only one (have to be the last) row or column, which gets * The eTemplate has only one (have to be the last) row or column, which gets
@discussion automaticaly repeated as long as content is availible. To check this the content * automaticaly repeated as long as content is availible. To check this the content
@discussion has to be in an sub-array of content. The index / subscript into content is * has to be in an sub-array of content. The index / subscript into content is
@discussion determined by the content of size for templates or name for regular fields. * determined by the content of size for templates or name for regular fields.
@discussion An autorepeat is defined by an index which contains variables to expand. * An autorepeat is defined by an index which contains variables to expand.
@discussion (vor variable expansion in names see expand_names). Usually I use the keys * (vor variable expansion in names see expand_names). Usually I use the keys
@discussion $row: 0, 1, 2, 3, ... for only rows, $col: '@', 'A', 'B', 'C', ... for only cols or * $row: 0, 1, 2, 3, ... for only rows, $col: '@', 'A', 'B', 'C', ... for only cols or
@discussion $col$row: '@0','A0',... '@1','A1','B1',... '@2','A2','B2',... for both rows and cells. * $col$row: '@0','A0',... '@1','A1','B1',... '@2','A2','B2',... for both rows and cells.
@discussion In general everything expand_names can generate is ok - see there. * In general everything expand_names can generate is ok - see there.
@discussion As you usually have col- and row-headers, data-cells start with '1' or 'A' !!! * As you usually have col- and row-headers, data-cells start with '1' or 'A' !!!
@syntax autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False) *
@param $cell array with data of cell: name, type, size, ... * @param $cell array with data of cell: name, type, size, ...
@param $c,$r col/row index starting from 0 * @param $c,$r int col/row index starting from 0
@param &$idx returns the index in $content and $readonlys (NOT $sel_options !!!) * @param &$idx string returns the index in $content and $readonlys (NOT $sel_options !!!)
@param &$idx_cname returns the basename for the form-name: is $idx if only one value * @param &$idx_cname string returns the basename for the form-name: is $idx if only one value
@param (no ',') is given in size (name (not template-fields) are always only one value) * @param (no ',') is given in size (name (not template-fields) are always only one value)
@param $check_col boolean to check for col- or row-autorepeat * @param $check_col boolean to check for col- or row-autorepeat
@result true if cell is autorepeat (has index with vars / '$') or false otherwise * @return boolean true if cell is autorepeat (has index with vars / '$') or false otherwise
*/ */
function autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False) function autorepeat_idx($cell,$c,$r,&$idx,&$idx_cname,$check_col=False)
{ {
$org_idx = $idx = $cell[ $cell['type'] == 'template' ? 'size' : 'name' ]; $org_idx = $idx = $cell[ $cell['type'] == 'template' ? 'size' : 'name' ];
@ -194,12 +185,9 @@
return $Ok; return $Ok;
} }
/*! /**
@function appsession_id * creates a new appsession-id via microtime()
@syntax appsession_id( ) */
@author ralfbecker
@abstract creates a new appsession-id via microtime()
*/
function appsession_id() function appsession_id()
{ {
list($msec,$sec) = explode(' ',microtime()); list($msec,$sec) = explode(' ',microtime());
@ -208,12 +196,12 @@
return $id; return $id;
} }
/*! /**
@functin appsession * db-sessions appsession function, not longer used !!!
@syntax appsession($location = 'default', $appname = '', $data = '##NOTHING##') *
@abstract db-sessions appsession function * It was used to overcome the problem with overflowing php4-sessions, which seems to not exist any more !!!
@note It is used to overcome the problem with overflowing php4-sessions * @depricated
*/ */
function appsession($location = 'default', $appname = '', $data = '##NOTHING##') function appsession($location = 'default', $appname = '', $data = '##NOTHING##')
{ {
// use the version from the sessions-class if we use db-sessions // use the version from the sessions-class if we use db-sessions
@ -289,19 +277,18 @@
return $data; return $data;
} }
/*! /**
@function save_appsession * saves content,readonlys,template-keys, ... via the appsession function
@syntax save_appsession( $data,$id='' ) *
@author ralfbecker * As a user may open several windows with the same content/template wie generate a location-id from microtime
@abstract saves content,readonlys,template-keys, ... via the appsession function * which is used as location for appsession to descriminate between the different windows. This location-id
@discussion As a user may open several windows with the same content/template wie generate a location-id from microtime * is then saved as a hidden-var in the form. The above mentions session-id has nothing to do / is different
@discussion which is used as location for appsession to descriminate between the different windows. This location-id * from the session-id which is constant for all windows opened in one session.
@discussion is then saved as a hidden-var in the form. The above mentions session-id has nothing to do / is different *
@discussion from the session-id which is constant for all windows opened in one session. * @param $data array the data to save
@param $data the data to save * @param $id string the id to use or '' to generate a new id
@param $id the id to use or '' to generate a new id * @return string location-id
@result the location-id */
*/
function save_appsession($data,$id='') function save_appsession($data,$id='')
{ {
if (!$id) if (!$id)
@ -313,14 +300,12 @@
return $id; return $id;
} }
/*! /**
@function get_appsession * gets content,readonlys,template-keys, ... back from the appsession function
@syntax get_appsession( $id ) *
@author ralfbecker * @param $id the location-id
@abstract gets content,readonlys,template-keys, ... back from the appsession function * @return array with session-data
@param $id the location-id */
@result the session-data
*/
function get_appsession($id) function get_appsession($id)
{ {
$data = $GLOBALS['phpgw']->session->appsession($id,'etemplate'); $data = $GLOBALS['phpgw']->session->appsession($id,'etemplate');
@ -334,28 +319,26 @@
return $data; return $data;
} }
/*! /**
@function get_cell_attribute * gets an attribute in a named cell
@syntax get_cell_attribute( $name,$attr ) *
@author ralfbecker * @param $name string cell-name
@abstract gets an attribute in a named cell * @param $attr string attribute-name
@result the attribute or False if named cell not found * @return mixed the attribute or False if named cell not found
*/ */
function get_cell_attribute($name,$attr) function get_cell_attribute($name,$attr)
{ {
return $this->set_cell_attribute($name,$attr,NULL); return $this->set_cell_attribute($name,$attr,NULL);
} }
/*! /**
@function set_cell_attribute * set an attribute in a named cell if val is not NULL else return the attribute
@syntax set_cell_attribute( $name,$attr,$val ) *
@author ralfbecker * @param $name sting cell-name
@abstract set an attribute in a named cell if val is not NULL else return the attribute * @param $attr attribute-name
@param $name sting name of the cell * @param $val mixed if not NULL sets attribute else returns it
@param $attr attribute-name * @return mixed number of changed cells or False, if none changed
@param $val if not NULL sets attribute else returns it */
@result the number of changed cells or False, if none changed
*/
function set_cell_attribute($name,$attr,$val) function set_cell_attribute($name,$attr,$val)
{ {
//echo "<p>set_cell_attribute(tpl->name=$this->name, name='$name', attr='$attr',val='$val')</p>\n"; //echo "<p>set_cell_attribute(tpl->name=$this->name, name='$name', attr='$attr',val='$val')</p>\n";
@ -415,29 +398,26 @@
return $n; return $n;
} }
/*! /**
@function disable_cells * disables all cells with name == $name
@syntax disable_cells( $name ) *
@author ralfbecker * @param $name sting cell-name
@abstract disables all cells with name == $name * @return mixed number of changed cells or False, if none changed
*/ */
function disable_cells($name) function disable_cells($name)
{ {
return $this->set_cell_attribute($name,'disabled',True); return $this->set_cell_attribute($name,'disabled',True);
} }
/*! /**
@function set_row_attributes * set one or more attibutes for row $n
@syntax set_row_attibutes( $n,$height=0,$class=0,$valign=0,$disabled=0 ) *
@author ralfbecker * @param $n int numerical row-number starting with 1 (!)
@abstract set one or more attibutes for row $n * @param $height string percent or pixel or '' for no height
@param $n is numerical row-number starting with 1 (!) * @param $class string name of css class (without the leading '.') or '' for no class
@param $height in percent or pixel or '' for no height * @param $valign string alignment (top,middle,bottom) or '' for none
@param $class name of css class (without the leading '.') or '' for no class * @param $disabled boolean True or expression or False to disable or enable the row (Only the number 0 means dont change the attribute !!!)
@param $valign alignment (top,middle,bottom) or '' for none */
@param $disabled True or expression or False to disable or enable the row
@param Only the number 0 means dont change the attribute !!!
*/
function set_row_attributes($n,$height=0,$class=0,$valign=0,$disabled=0) function set_row_attributes($n,$height=0,$class=0,$valign=0,$disabled=0)
{ {
list($old_height,$old_disabled) = explode(',',$this->data[0]["h$n"]); list($old_height,$old_disabled) = explode(',',$this->data[0]["h$n"]);
@ -450,29 +430,24 @@
($valign ? ','.$valign : ''); ($valign ? ','.$valign : '');
} }
/*! /**
@function disable_row * disables row $n
@syntax disable_row( $n,$enable=False ) *
@author ralfbecker * @param $n int numerical row-number starting with 1 (!)
@abstract disables row $n * @param $enable boolean can be used to re-enable a row if set to True
@param $n is numerical row-number starting with 1 (!) */
@param $enable can be used to re-enable a row if set to True
*/
function disable_row($n,$enable=False) function disable_row($n,$enable=False)
{ {
$this->set_row_attributes($n,0,0,0,!$enable); $this->set_row_attributes($n,0,0,0,!$enable);
} }
/*! /**
@function set_column_attributes * set one or more attibutes for column $c
@syntax set_column_attibutes( $n,$width=0,$disabled=0 ) *
@author ralfbecker * @param $c int/string numerical column-number starting with 0 (!), or the char-code starting with 'A'
@abstract set one or more attibutes for column $c * @param $width string percent or pixel or '' for no height
@param $c is numerical column-number starting with 0 (!), or the char-code starting with 'A' * @param $disabled boolean True or expression or False to disable or enable the column (Only the number 0 means dont change the attribute !!!)
@param $width in percent or pixel or '' for no height */
@param $disabled True or expression or False to disable or enable the column
@param Only the number 0 means dont change the attribute !!!
*/
function set_column_attributes($c,$width=0,$disabled=0) function set_column_attributes($c,$width=0,$disabled=0)
{ {
if (is_numeric($c)) if (is_numeric($c))
@ -485,27 +460,23 @@
($disabled ? ','.$disabled : ''); ($disabled ? ','.$disabled : '');
} }
/*! /**
@function disable_column * disables column $c
@syntax disable_column( $c,$enable=False ) * @param $c int/string numerical column-number starting with 0 (!), or the char-code starting with 'A'
@author ralfbecker * @param $enable can be used to re-enable a column if set to True
@abstract disables column $c
@param $c is numerical column-number starting with 0 (!), or the char-code starting with 'A'
@param $enable can be used to re-enable a column if set to True
*/ */
function disable_column($c,$enable=False) function disable_column($c,$enable=False)
{ {
$this->set_column_attributes($c,0,!$enable); $this->set_column_attributes($c,0,!$enable);
} }
/*! /**
@function loadExtension * trys to load the Extension / Widget-class from the app or etemplate
@syntax loadExtension( $type ) *
@author ralfbecker * @param $name string name of the extension, the classname should be class.${name}_widget.inc.php
@abstact trys to load the Extension / Widget-class from the app or etemplate * the $name might be "$name.$app" to give a app-name (default is the current app,or template-name)
@param $name name of the extension, the classname should be class.${name}_widget.inc.php * @return string/boolean human readable name or false if not found/loadable
@discussion the $name might be "$name.$app" to give a app-name (default is the current app,or template-name) */
*/
function loadExtension($type) function loadExtension($type)
{ {
list($class,$app) = explode('.',$type); list($class,$app) = explode('.',$type);
@ -534,11 +505,10 @@
function haveExtension($type,$function='') function haveExtension($type,$function='')
/* /*
@function haveExtension * checks if extension is loaded and load it if it isnt
@syntax haveExtension($type) *
@author ralfbecker * @return boolean
@abstract checks if extension is loaded and load it if it isnt */
*/
{ {
return ($GLOBALS['phpgw_info']['etemplate']['extension'][$type] || $this->loadExtension($type,$ui)) && return ($GLOBALS['phpgw_info']['etemplate']['extension'][$type] || $this->loadExtension($type,$ui)) &&
($function == '' || $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->public_functions[$function]); ($function == '' || $GLOBALS['phpgw_info']['etemplate']['extension'][$type]->public_functions[$function]);
@ -546,16 +516,15 @@
function extensionPreProcess($type,$name,&$value,&$cell,&$readonlys) function extensionPreProcess($type,$name,&$value,&$cell,&$readonlys)
/* /*
@function extensionPreProcess * executes the pre_process-function of the extension $cell[]type]
@syntax extensionPreProcess(&$cell,&$value,&$readonlys) *
@param $type of the extension * @param $type string type of the extension
@param $name form-name of this widget/field (used as a unique index into extension_data) * @param $name string form-name of this widget/field (used as a unique index into extension_data)
@param &$cell table-cell on which the extension operates * @param &$cell array table-cell on which the extension operates
@param &$value value of the extensions content(-array) * @param &$value mixed value of the extensions content(-array)
@param &$readonlys value of the extensions readonly-setting(-array) * @param &$readonlys array value of the extensions readonly-setting(-array)
@abstract executes the pre_process-function of the extension $cell[]type] * @return mixed the return-value of the extensions preprocess function
@author ralfbecker */
*/
{ {
if (!$this->haveExtension($type)) if (!$this->haveExtension($type))
{ {
@ -567,15 +536,13 @@
function extensionPostProcess($type,$name,&$value,$value_in) function extensionPostProcess($type,$name,&$value,$value_in)
/* /*
@function extensionPostProcess * executes the post_process-function of the extension $cell[type]
@syntax extensionPostProcess(&$cell,&$value) *
@param $type of the extension * @param $type string name of the extension
@param $name form-name of this widget/field (used as a unique index into extension_data) * @param $name string form-name of this widget/field (used as a unique index into extension_data)
@param &$value value of the extensions content(-array) * @param &$value mixed value of the extensions content(-array)
@abstract executes the post_process-function of the extension $cell[type] * @return boolean True if a value should be returned (default for no postprocess fkt.), else False
@returns True if a value should be returned (default for no postprocess fkt.), else False */
@author ralfbecker
*/
{ {
if (!$this->haveExtension($type,'post_process')) if (!$this->haveExtension($type,'post_process'))
{ {
@ -588,11 +555,9 @@
function extensionRender($type,$name,&$value,&$cell,$readonly) function extensionRender($type,$name,&$value,&$cell,$readonly)
/* /*
@function extensionRender * executes the render-function of the extension $cell[type]
@syntax extensionRender(&$cell,$form_name,&$value,$readonly) * @return mixed return-value of the render function
@abstract executes the render-function of the extension $cell[type] */
@author ralfbecker
*/
{ {
if (!$this->haveExtension($type,'render')) if (!$this->haveExtension($type,'render'))
{ {
@ -602,13 +567,13 @@
$GLOBALS['phpgw_info']['etemplate']['extension_data'][$name],$this); $GLOBALS['phpgw_info']['etemplate']['extension_data'][$name],$this);
} }
/*! /**
@function isset_array * checks if $idx is set in array $arr
@syntax isset_array( $arr,$idx ) *
@author ralfbecker * @param $arr array
@abstract checks if idx, which may contain multiple subindex (eg.'x[y][z]'), is set in array * @param $idx string may contain multiple subindex (eg.'x[y][z]')
@author ralfbecker * @return boolean
*/ */
function isset_array($arr,$idx) function isset_array($arr,$idx)
{ {
$idxs = explode('[',str_replace(']','',$idx)); $idxs = explode('[',str_replace(']','',$idx));
@ -625,21 +590,20 @@
return isset($pos[$last_idx]); return isset($pos[$last_idx]);
} }
/*! /**
@function set_array * sets $arr[$idx] = $val
@abstract sets $arr[$idx] = $val *
@author ralfbecker * This works for non-trival indexes like 'a[b][c]' too: $arr['a']['b']['c'] = $val;
@syntax set_array( &$arr,$idx,$val ) *
@param $arr array the array to search, referenz as a referenz gets returned * @param &$arr array the array to search
@param $idx string the index, may contain sub-indices like a[b], see example below * @param $idx string the index, may contain sub-indices like a[b], see example below
@discussion This works for non-trival indexes like 'a[b][c]' too: $arr['a']['b']['c'] = $val; * @param $val mixed
@author ralfbecker */
*/
function set_array(&$arr,$idx,$val) function set_array(&$arr,$idx,$val)
{ {
if (!is_array($arr)) if (!is_array($arr))
{ {
die('set_array() $arr is no array'); die('set_array() $arr is no array<br>'.function_backtrace());
} }
$idxs = explode('[',str_replace(']','',$idx)); $idxs = explode('[',str_replace(']','',$idx));
$pos = &$arr; $pos = &$arr;
@ -650,22 +614,22 @@
$pos = $val; $pos = $val;
} }
/*! /**
@function get_array * return a reference to $arr[$idx]
@abstract return a var-param to $arr[$idx] *
@author ralfbecker * This works for non-trival indexes like 'a[b][c]' too: it returns &$arr[a][b][c]
@syntax get_array( &$arr,$idx,$referenz_into=False ) * $sub = get_array($arr,'a[b]'); $sub = 'c'; is equivalent to $arr['a']['b'] = 'c';
@param $arr array the array to search, referenz as a referenz gets returned *
@param $idx string the index, may contain sub-indices like a[b], see example below * @param $arr array the array to search, referenz as a referenz gets returned
@param $referenz_into boolean default False, if True none-existing sub-arrays/-indices get created to be returned as referenz, else False is returned * @param $idx string the index, may contain sub-indices like a[b], see example below
@example $sub = get_array($arr,'a[b]'); $sub = 'c'; is equivalent to $arr['a']['b'] = 'c'; * @param $reference_into boolean default False, if True none-existing sub-arrays/-indices get created to be returned as referenz, else False is returned
@discussion This works for non-trival indexes like 'a[b][c]' too: it returns &$arr[a][b][c] * @return mixed reference to $arr[$idx] or false if $idx is not set and not $reference_into
*/ */
function &get_array(&$arr,$idx,$referenz_into=False) function &get_array(&$arr,$idx,$reference_into=False)
{ {
if (!is_array($arr)) if (!is_array($arr))
{ {
die('set_array() $arr is no array'); die('set_array() $arr is no array<br>'.function_backtrace());
} }
$idxs = explode('[',str_replace(']','',$idx)); $idxs = explode('[',str_replace(']','',$idx));
$pos = &$arr; $pos = &$arr;
@ -680,21 +644,20 @@
return $pos; return $pos;
} }
/*! /**
@function unset_array * unsets $arr[$idx]
@abstract unsets $arr[$idx] *
@author ralfbecker * This works for non-trival indexes like 'a[b][c]' too
@syntax unset_array( &$arr,$idx ) * unset_array($arr,'a[b]'); is equivalent to unset($arr['a']['b']);
@param $arr array the array to search, referenz as a referenz gets returned *
@param $idx string the index, may contain sub-indices like a[b], see example below * @param $arr array the array to search, referenz as a referenz gets returned
@example unset_array($arr,'a[b]'); is equivalent to unset($arr['a']['b']); * @param $idx string the index, may contain sub-indices like a[b], see example below
@discussion This works for non-trival indexes like 'a[b][c]' too */
*/
function unset_array(&$arr,$idx) function unset_array(&$arr,$idx)
{ {
if (!is_array($arr)) if (!is_array($arr))
{ {
die('set_array() $arr is no array'); die('set_array() $arr is no array<br>'.function_backtrace());
} }
$idxs = explode('[',str_replace(']','',$idx)); $idxs = explode('[',str_replace(']','',$idx));
$last_idx = array_pop($idxs); $last_idx = array_pop($idxs);
@ -706,31 +669,42 @@
unset($pos[$last_idx]); unset($pos[$last_idx]);
} }
/*! /**
@function complete_array_merge * merges $old and $new, content of $new has precedence over $old
@syntax complete_array_merge( $old,$new ) *
@author ralfbecker * THIS IS NOT THE SAME AS PHP4's functions:
@abstract merges $old and $new, content of $new has precedence over $old * - array_merge, as it calls itself recursive for values which are arrays.
@discussion THIS IS NOT THE SAME AS PHP4: array_merge (as it calls itself recursive for values which are arrays. * - array_merge_recursive accumulates values with the same index and $new does NOT overwrite $old
*/ *
* @param $old array
* @param $new array
* @return array the merged array
*/
function complete_array_merge($old,$new) function complete_array_merge($old,$new)
{ {
@reset($new); if (is_array($new))
while (list($k,$v) = @each($new))
{ {
if (!is_array($v) || !isset($old[$k])) foreach($new as $k => $v)
{ {
$old[$k] = $v; if (!is_array($v) || !isset($old[$k]))
} {
else $old[$k] = $v;
{ }
$old[$k] = $this->complete_array_merge($old[$k],$v); else
{
$old[$k] = $this->complete_array_merge($old[$k],$v);
}
} }
} }
return $old; return $old;
} }
/**
* generated a file-name from an eTemplates, name, template(-set) and lang
*
* @return string
*/
function cache_name($name='',$template='default',$lang='default') function cache_name($name='',$template='default',$lang='default')
{ {
if (empty($name)) if (empty($name))
@ -755,16 +729,20 @@
return $cname; return $cname;
} }
/*! /**
@function store_in_cache() * stores the etemplate in the cache in phpgw_info
@abstract stores the etemplate in the cache in phpgw_info */
*/
function store_in_cache() function store_in_cache()
{ {
//echo "<p>store_in_cache('$this->name','$this->template','$this->lang','$this->version')</p>\n"; //echo "<p>store_in_cache('$this->name','$this->template','$this->lang','$this->version')</p>\n";
$GLOBALS['phpgw_info']['etemplate']['cache'][$this->cache_name()] = $this->as_array(1); $GLOBALS['phpgw_info']['etemplate']['cache'][$this->cache_name()] = $this->as_array(1);
} }
/*
* returns true if a given eTemplate is in the cache
*
* @return boolean
*/
function in_cache($name,$template='default',$lang='default',$group=0,$version='') function in_cache($name,$template='default',$lang='default',$group=0,$version='')
{ {
$cname = $this->cache_name($name,$template,$lang); $cname = $this->cache_name($name,$template,$lang);
@ -783,6 +761,13 @@
return $cname; return $cname;
} }
/*
* reads the content of an eTemplate from the cache into the current object
*
* same as read but only via the cache
*
* @return boolean true if the eTemplate was found in the cache
*/
function read_from_cache($name,$template='default',$lang='default',$group=0,$version='') function read_from_cache($name,$template='default',$lang='default',$group=0,$version='')
{ {
//if (is_array($name)) $version = $name['version']; echo "<p>read_from_cache(,,,version='$version'): "; //if (is_array($name)) $version = $name['version']; echo "<p>read_from_cache(,,,version='$version'): ";
@ -795,13 +780,19 @@
return False; return False;
} }
/*! /**
@function read * reads an eTemplate from the cache or database / filesystem (and updates the cache)
@abstract Reads an eTemplate from the cache or database / filesystem (and updates the cache) *
@param as discripted in soetemplate::read * reimplementation of soetemplate::read to use and/or update the cache
@param $load_via name/array of keys of etemplate to load in order to get $name (only as second try!) *
@result True if a fitting template is found, else False * @param $name string name of the eTemplate or array with the values for all keys
*/ * @param $template string template-set, '' loads the prefered template of the user, 'default' loads the default one '' in the db
* @param $lang string language, '' loads the pref. lang of the user, 'default' loads the default one '' in the db
* @param $group int id of the (primary) group of the user or 0 for none, not used at the moment !!!
* @param $version string version of the eTemplate
* @param $load_via mixed name/array of keys of etemplate to load in order to get $name (only as second try!)
* @return boolean True if a fitting template is found, else False
*/
function read($name,$template='default',$lang='default',$group=0,$version='',$load_via='') function read($name,$template='default',$lang='default',$group=0,$version='',$load_via='')
{ {
if (is_array($name)) { if (is_array($name)) {
@ -816,7 +807,8 @@
return False; return False;
} }
$parent = is_array($load_via) ? $load_via['name'] : $load_via; $parent = is_array($load_via) ? $load_via['name'] : $load_via;
if (strstr($pname,'.') === False && !empty($parent))
if (strstr($pname,'.') === False && !empty($parent))
{ {
$pname = $parent . '.' . $pname; $pname = $parent . '.' . $pname;
} }
@ -837,13 +829,19 @@
return True; return True;
} }
/*! /**
@function save * saves eTemplate-object to db and update the cache
@abstract saves eTemplate-object to db and update the cache *
@params keys see soetemplate::save * reimplementation of soetemplate::save to update the cache
@result the number of affected rows, 1 should be ok, 0 somethings wrong *
*/ * @param $name string name of the eTemplate or array with the values for all keys
function save($name='',$template='.',$lang='.',$group='',$version='.') * @param $template string template-set or '' for the default one
* @param $lang string language or '' for the default one
* @param $group int id of the (primary) group of the user or 0 for none, not used at the moment !!!
* @param $version string version of the eTemplate
* @return the number of affected rows, 1 should be ok, 0 somethings wrong
*/
function save($name='',$template='.',$lang='.',$group=0,$version='.')
{ {
if ($result = soetemplate::save($name,$template,$lang,$group,$version)) if ($result = soetemplate::save($name,$template,$lang,$group,$version))
{ {
@ -851,4 +849,4 @@
} }
return $result; return $result;
} }
}; }

View File

@ -12,38 +12,29 @@
/* $Id$ */ /* $Id$ */
/*! /**
@class soetemplate * Storage Objects: Everything to store and retrive and eTemplate.
@author ralfbecker *
@abstract Storage Objects: Everything to store and retrive the eTemplates. * eTemplates are stored in the db in table 'phpgw_etemplate' and gets distributed
@discussion eTemplates are stored in the db in table 'phpgw_etemplate' and gets distributed * through the file 'etemplates.inc.php' in the setup dir of each app. That file gets
@discussion through the file 'etemplates.inc.php' in the setup dir of each app. That file gets * automatically imported in the db, whenever you show a eTemplate of the app. For
@discussion automatically imported in the db, whenever you show a eTemplate of the app. For * performace reasons the timestamp of the file is stored in the db, so 'new'
@discussion performace reasons the timestamp of the file is stored in the db, so 'new' * eTemplates need to have a newer file. The distribution-file is generated with the
@discussion eTemplates need to have a newer file. The distribution-file is generated with the * function dump, usually by pressing a button in the editor.
@discussion function dump, usually by pressing a button in the editor. * writeLangFile writes an lang-file with all Labels, incorporating an existing one.
@discussion writeLangFile writes an lang-file with all Labels, incorporating an existing one. * Beside a name eTemplates use the following keys to find the most suitable template
@discussion Beside a name eTemplates use the following keys to find the most suitable template * for an user (in order of precedence):
@discussion for an user (in order of precedence): * 1) User-/Group-Id (not yet implemented)
@discussion 1) User-/Group-Id (not yet implemented) * 2) preferd languages of the user (templates for all langs have $lang='')
@discussion 2) preferd languages of the user (templates for all langs have $lang='') * 3) selected template: verdilak, ... (the default is called '' in the db, not default)
@discussion 3) selected template: verdilak, ... (the default is called '' in the db, not default) * 4) a version-number of the form, eg: '0.9.13.001' (filled up with 0 same size)
@discussion 4) a version-number of the form, eg: '0.9.13.001' (filled up with 0 same size) *
*/ * @package etemplate
* @author RalfBecker-AT-outdoor-training.de
* @license GPL
*/
class soetemplate class soetemplate
{ {
var $public_functions = array(
'init' => True,
'empty_cell' => True,
'new_cell' => True,
'read' => True,
'search' => True,
'save' => True,
'delete' => True,
'dump2setup' => True,
'import_dump' => True,
'writeLangFile' => True
);
var $debug; // =1 show some debug-messages, = 'app.name' show messages only for eTemplate 'app.name' var $debug; // =1 show some debug-messages, = 'app.name' show messages only for eTemplate 'app.name'
var $name; // name of the template, e.g. 'infolog.edit' var $name; // name of the template, e.g. 'infolog.edit'
var $template; // '' = default (not 'default') var $template; // '' = default (not 'default')
@ -68,13 +59,20 @@
); );
var $db_cols; var $db_cols;
/*! /**
@function soetemplate * constructor of the class
@abstract constructor of the class *
@syntax soetemplate($name='',$template='',$lang='',$group=0,$version='',$rows=2,$cols=2) * calls init or read depending on a name for the template is given
@param as read *
*/ * @param $name string name of the eTemplate or array with the values for all keys
function soetemplate($name='',$template='',$lang='',$group=0,$version='',$rows=2,$cols=2) * @param $template string template-set, '' loads the prefered template of the user, 'default' loads the default one '' in the db
* @param $lang string language, '' loads the pref. lang of the user, 'default' loads the default one '' in the db
* @param $group int id of the (primary) group of the user or 0 for none, not used at the moment !!!
* @param $version string version of the eTemplate
* @param $rows int initial size of the template, default 1, only used if no name given !!!
* @param $cols int initial size of the template, default 1, only used if no name given !!!
*/
function soetemplate($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1)
{ {
$this->db = $GLOBALS['phpgw']->db; $this->db = $GLOBALS['phpgw']->db;
$this->db_cols = $this->db_key_cols + $this->db_data_cols; $this->db_cols = $this->db_key_cols + $this->db_data_cols;
@ -85,17 +83,16 @@
} }
else else
{ {
$this->read($name,$template,$lang,$group,$version,$rows,$cols); $this->read($name,$template,$lang,$group,$version);
} }
} }
/*! /**
@function num2chrs * generates column-names from index: 'A', 'B', ..., 'AA', 'AB', ..., 'ZZ' (not more!)
@abstract generates column-names from index: 'A', 'B', ..., 'AA', 'AB', ..., 'ZZ' (not more!) *
@syntax num2chrs($num) * @param $num int numerical index to generate name from 1 => 'A'
@param $num index to generate name from 1 => 'A' * @return string the name
@result the name */
*/
function num2chrs($num) function num2chrs($num)
{ {
$min = ord('A'); $min = ord('A');
@ -109,12 +106,13 @@
return $chrs; return $chrs;
} }
/*! /**
@function empty_cell * constructor for a new / empty cell
@abstracts constructor for a new / empty cell (nothing fancy so far) *
@syntax empty_cell() * nothing fancy so far
@result the cell *
*/ * @return array the cell
*/
function empty_cell($type='label',$name='') function empty_cell($type='label',$name='')
{ {
return array( return array(
@ -123,16 +121,15 @@
); );
} }
/*! /**
@function new_cell * constructs a new cell in a give row or the last row, not existing rows will be created
@abstract constructs a new cell in a give row or the last row, not existing rows will be created *
@syntax new_cell( $row=False ) * @param int $row row-number starting with 1 (!)
@param int $row row-number starting with 1 (!) * @param string $type type of the cell
@param string $type type of the cell * @param string $label label for the cell
@param string $label label for the cell * @param string $name name of the cell (index in the content-array)
@param string $name name of the cell (index in the content-array) * @param array $attributes other attributes for the cell
@param array $attributes other attributes for the cell * @return a reference to the new cell, use $new_cell = &$tpl->new_cell(); (!)
@returns a reference to the new cell, use $new_cell = &$tpl->new_cell(); (!)
*/ */
function &new_cell($row=False,$type='label',$label='',$name='',$attributes=False) function &new_cell($row=False,$type='label',$label='',$name='',$attributes=False)
{ {
@ -169,11 +166,9 @@
return $cell; return $cell;
} }
/*! /**
@function set_rows_cols() * initialises internal vars rows & cols from the size of the data-array
@abstract initialises rows & cols from the size of the data-array */
@syntax set_rows_cols()
*/
function set_rows_cols() function set_rows_cols()
{ {
$this->rows = count($this->data) - 1; $this->rows = count($this->data) - 1;
@ -188,14 +183,17 @@
} }
} }
/*! /**
@function init * initialises all internal data-structures of the eTemplate and sets the keys
@abstract initialises all internal data-structures of the eTemplate and sets the keys *
@syntax init($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1) * @param $name string name of the eTemplate or array with the values for all keys
@param $name name of the eTemplate or array with the keys or all data * @param $template string template-set or '' for the default one
@param $template,$lang,$group,$version see class * @param $lang string language or '' for the default one
@param $rows,$cols initial size of the template * @param $group int id of the (primary) group of the user or 0 for none, not used at the moment !!!
*/ * @param $version string version of the eTemplate
* @param $rows int initial size of the template, default 1
* @param $cols int initial size of the template, default 1
*/
function init($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1) function init($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1)
{ {
reset($this->db_cols); reset($this->db_cols);
@ -231,16 +229,16 @@
} }
} }
/*! /**
@function read * reads an eTemplate from the database
@abstract Reads an eTemplate from the database *
@syntax read($name,$template='default',$lang='default',$group=0,$version='') * @param $name string name of the eTemplate or array with the values for all keys
@param as discripted with the class, with the following exeptions * @param $template string template-set, '' loads the prefered template of the user, 'default' loads the default one '' in the db
@param $template as '' loads the prefered template 'default' loads the default one '' in the db * @param $lang string language, '' loads the pref. lang of the user, 'default' loads the default one '' in the db
@param $lang as '' loads the pref. lang 'default' loads the default one '' in the db * @param $group int id of the (primary) group of the user or 0 for none, not used at the moment !!!
@param $group is NOT used / implemented yet * @param $version string version of the eTemplate
@result True if a fitting template is found, else False * @return boolean True if a fitting template is found, else False
*/ */
function read($name,$template='default',$lang='default',$group=0,$version='') function read($name,$template='default',$lang='default',$group=0,$version='')
{ {
$this->init($name,$template,$lang,$group,$version); $this->init($name,$template,$lang,$group,$version);
@ -307,12 +305,10 @@
return True; return True;
} }
/*! /**
@function readfile * Reads an eTemplate from the filesystem, the keys are already set by init in read
@abstract Reads an eTemplate from the filesystem, the keys are already set by init in read * @return boolean True if a template was found, else False
@syntax readfile() */
@result True if a template is found, else False
*/
function readfile() function readfile()
{ {
list($app,$name) = split("\.",$this->name,2); list($app,$name) = split("\.",$this->name,2);
@ -383,17 +379,16 @@
return True; return True;
} }
/*! /**
@function search * Lists the eTemplates matching the given criteria
@syntax search($name,$template='default',$lang='default',$group=0,$version='') *
@author ralfbecker * @param $name string name of the eTemplate or array with the values for all keys
@abstract Lists the eTemplates matching the given criteria * @param $template string template-set, '' loads the prefered template of the user, 'default' loads the default one '' in the db
@param as discripted with the class, with the following exeptions * @param $lang string language, '' loads the pref. lang of the user, 'default' loads the default one '' in the db
@param $template as '' loads the prefered template 'default' loads the default one '' in the db * @param $group int id of the (primary) group of the user or 0 for none, not used at the moment !!!
@param $lang as '' loads the pref. lang 'default' loads the default one '' in the db * @param $version string version of the eTemplate
@param $group is NOT used / implemented yet * @return array of arrays with the template-params
@result array of arrays with the template-params */
*/
function search($name,$template='default',$lang='default',$group=0,$version='') function search($name,$template='default',$lang='default',$group=0,$version='')
{ {
if ($this->name) if ($this->name)
@ -448,11 +443,9 @@
return $result; return $result;
} }
/*! /**
@function db2obj * copies all cols into the obj and unserializes the data-array
@abstract copies all cols into the obj and unserializes the data-array */
@syntax db2obj()
*/
function db2obj() function db2obj()
{ {
for (reset($this->db_cols); list($db_col,$name) = each($this->db_cols); ) for (reset($this->db_cols); list($db_col,$name) = each($this->db_cols); )
@ -485,16 +478,15 @@
$this->set_rows_cols(); $this->set_rows_cols();
} }
/*! /**
@function compress_array * to save space in the db all empty values in the array got unset
@syntax compress_array( $arr ) *
@author ralfbecker * The never empty type field ensures a cell does not disapear completely.
@abstract to save space in the db all empty values in the array got unset * Calls it self recursivly for arrays / the rows
@discussion The never-'' type field ensures a cell does not disapear completely. *
@discussion Calls it self recursivly for arrays / the rows * @param $arr the array to compress
@param $arr the array to compress * @return array
@result the compressed array */
*/
function compress_array($arr) function compress_array($arr)
{ {
if (!is_array($arr)) if (!is_array($arr))
@ -515,13 +507,12 @@
return $arr; return $arr;
} }
/*! /**
@function as_array * returns obj-data/-vars as array
@abstract returns obj-data as array *
@syntax as_array($data_too=0) * @param $data_too int 0 = no data array, 1 = data array too, 2 = serialize data array
@param $data_too 0 = no data array, 1 = data array too, 2 = serialize data array * @return array
@result the array */
*/
function as_array($data_too=0) function as_array($data_too=0)
{ {
$arr = array(); $arr = array();
@ -543,13 +534,11 @@
return $arr; return $arr;
} }
/*! /**
@function save * saves eTemplate-object to db, can be used as saveAs by giving keys as params
@abstract saves eTemplate-object to db, can be used as saveAs by giving keys as params *
@syntax save($name='',$template='.',$lang='.',$group='',$version='.') * @return int number of affected rows, 1 should be ok, 0 somethings wrong
@params keys see class */
@result the number of affected rows, 1 should be ok, 0 somethings wrong
*/
function save($name='',$template='.',$lang='.',$group='',$version='.') function save($name='',$template='.',$lang='.',$group='',$version='.')
{ {
if (is_array($name)) if (is_array($name))
@ -630,12 +619,11 @@
return $this->db->affected_rows(); return $this->db->affected_rows();
} }
/*! /**
@function delete * Deletes the eTemplate from the db, object itself is unchanged
@abstract Deletes the eTemplate from the db, object itself is unchanged *
@syntax delete() * @return int number of affected rows, 1 should be ok, 0 somethings wrong
@result the number of affected rows, 1 should be ok, 0 somethings wrong */
*/
function delete() function delete()
{ {
foreach ($this->db_key_cols as $db_col => $col) foreach ($this->db_key_cols as $db_col => $col)
@ -647,13 +635,12 @@
return $this->db->affected_rows(); return $this->db->affected_rows();
} }
/*! /**
@function dump2setup * dumps all eTemplates to <app>/setup/etemplates.inc.php for distribution
@abstract dumps all eTemplates to <app>/setup/etemplates.inc.php for distribution *
@syntax dump2setup($app) * @param $app string app- or template-name contain app
@param $app app- or template-name * @return string translated message with number of dumped templates or error-message (webserver has no write access)
@result the number of templates dumped as message */
*/
function dump2setup($app) function dump2setup($app)
{ {
list($app) = explode('.',$app); list($app) = explode('.',$app);
@ -724,13 +711,13 @@
} }
} }
/*! /**
@function getToTranslate * extracts all texts: labels and helptexts from an eTemplate-object
@abstract extracts all texts: labels and helptexts from an eTemplate-object *
@discussion some extensions use a '|' to squezze multiple texts in a label or help field * some extensions use a '|' to squezze multiple texts in a label or help field
@syntax getToTranslate() *
@result array with messages as key AND value * @return array with messages as key AND value
*/ */
function getToTranslate() function getToTranslate()
{ {
$to_trans = array(); $to_trans = array();
@ -754,13 +741,12 @@
return $to_trans; return $to_trans;
} }
/*! /**
@function getToTranslateApp * Read all eTemplates of an app an extracts the texts to an array
@abstract Read all eTemplates of an app an extracts the texts to an array *
@syntax getToTranslateApp($app) * @param $app string name of the app
@param $app name of the app * @return array with texts
@result the array with texts */
*/
function getToTranslateApp($app) function getToTranslateApp($app)
{ {
$to_trans = array(); $to_trans = array();
@ -783,16 +769,15 @@
return $to_trans; return $to_trans;
} }
/*! /**
@function writeLangFile * Write new lang-file using the existing one and all text from the eTemplates
@abstract Write new lang-file using the existing one and all text from the eTemplates *
@syntax writeLangFile($app,$lang='en',$additional='') * @param $app string app- or template-name
@param $app app- or template-name * @param $lang string language the messages in the template are, defaults to 'en'
@param $lang language the messages in the template are, defaults to 'en' * @param $additional array extra texts to translate, if you pass here an array with all messages and
@param $additional extra texts to translate, if you pass here an array with all messages and * select-options they get writen too (form is <unique key> => <message>)
@param select-options they get writen too (form is <unique key> => <message>) * @return string translated message with number of messages written (total and new), or error-message
@result message with number of messages written (total and new) */
*/
function writeLangFile($app,$lang='en',$additional='') function writeLangFile($app,$lang='en',$additional='')
{ {
if (!$additional) if (!$additional)
@ -866,13 +851,12 @@
return lang("%1 (%2 new) Messages writen for Application '%3' and Languages '%4'",$n,$new,$app,$lang); return lang("%1 (%2 new) Messages writen for Application '%3' and Languages '%4'",$n,$new,$app,$lang);
} }
/*! /**
@function import_dump * Imports the dump-file /$app/setup/etempplates.inc.php unconditional (!)
@abstract Imports the dump-file /$app/setup/etempplates.inc.php unconditional (!) *
@syntax import_dump($app) * @param $app string app name
@param $app app name * @return string translated message with number of templates imported
@result message with number of templates imported */
*/
function import_dump($app) function import_dump($app)
{ {
include($path = PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php"); include($path = PHPGW_SERVER_ROOT."/$app/setup/etemplates.inc.php");
@ -894,14 +878,15 @@
return lang("%1 new eTemplates imported for Application '%2'",$n,$app); return lang("%1 new eTemplates imported for Application '%2'",$n,$app);
} }
/*! /**
@function test_import * test if new template-import necessary for app and does the import
@abstract test if new template-import necessary for app and does the import *
@discussion Get called on every read of a eTemplate, caches the result in phpgw_info. * Get called on every read of a eTemplate, caches the result in phpgw_info.
@discussion The timestamp of the last import for app gets written into the db. * The timestamp of the last import for app gets written into the db.
@syntax test_import($app) *
@param $app app- or template-name * @param $app string app- or template-name
*/ * @return string translated message with number of templates imported
*/
function test_import($app) // should be done from the setup-App function test_import($app) // should be done from the setup-App
{ {
list($app) = explode('.',$app); list($app) = explode('.',$app);

View File

@ -12,7 +12,6 @@
/* $Id$ */ /* $Id$ */
if (!function_exists('var2xml')) if (!function_exists('var2xml'))
{ {
if (file_exists(PHPGW_API_INC.'class.xmltool.inc.php')) if (file_exists(PHPGW_API_INC.'class.xmltool.inc.php'))
@ -25,6 +24,15 @@
} }
} }
/**
* XUL/XML Import & Export for eTemplates
*
* used only internaly
*
* @package etemplate
* @author RalfBecker-AT-outdoor-training.de
* @license GPL
*/
class xul_io class xul_io
{ {
var $widget2xul; var $widget2xul;
@ -616,5 +624,3 @@
return $imported; return $imported;
} }
} }
?>