Hello,
I’ve been coming up to speed with eGroupware for a project and have been using the online developer resources. The eTemplate Tutorial (http://www.egroupware.org/egroupware/etemplate/doc/etemplate.html) is one that I found very valuable. However, I did find a couple of errors that I wanted to share (i would correct but it’s not in the wiki).
First area:
Code snippet for Section 6 - /et_media/inc/class.ui_et_media.inc.php
-
trailing curly brace “}” is missing to close the open curly brace for the overall class (it should be on the last line of the example)
-
the read functionality of the “edit” function will not work as outlined in the overview below the code snippet. Here’s what I changed it to in order for it to function properly (I’ve set to the font to bold on the lines that needed adjustment):
function edit($content=null,$msg = ‘’)
{
if (is_array($content)) // not first call from index
{
if ($content[‘read’])
{
$this->read($content);
}
//echo “
edit: content =”; _debug_array($content);
// moved to check for “save” - $this->data_merge($content);
//echo “
edit: data =”; _debug_array($this->data);
if (isset($content['save']))
{
<b>$this->data_merge($content);</b>
$msg .= !$this->save() ? lang('Entry saved') : lang('Error: while saving !!!');
}
}
// now we filling the content array for the next call to etemplate.exec
$content = $this->data + array(
'msg' => $msg
);
$sel_options = array(
'type' => $this->types
);
$this->tmpl->exec('et_media.ui_et_media.edit',$content,$sel_options,$no_button,array(
'id' => $this->data['id']
));
}