fixed editing of versions other then the latest version

This commit is contained in:
Ralf Becker 2005-03-29 14:16:42 +00:00
parent 9d9de69793
commit 88577483bd
2 changed files with 8 additions and 5 deletions

View File

@ -1529,13 +1529,16 @@
if (is_array($content)) if (is_array($content))
{ {
$path = $content['goto'] ? $content['goto'] : ($content['goto2'] ? $content['goto2'] : $content['path']); $path = $content['goto'] ? $content['goto'] : ($content['goto2'] ? $content['goto2'] : $content['path']);
$Ok = $this->etemplate->read($content['name'],$content['template'],$content['lang'],$content['old_version']); $Ok = $this->etemplate->read($content['name'],$content['template'],$content['lang'],0,$path ? $content['version'] : $content['old_version']);
} }
else else
{ {
//echo "<p><b>".($_GET['path']).":</b></p>\n"; //echo "<p><b>".($_GET['path']).":</b></p>\n";
list($name,$path) = explode(':',$_GET['path'],2); // <name>:<path> list($name,$version,$path) = explode(':',$_GET['path'],3); // <name>:<version>:<path>
$Ok = $this->etemplate->read($name); $Ok = $this->etemplate->read(array(
'name' => $name,
'version' => $version,
));
} }
if (!$Ok && !$content['cancel']) if (!$Ok && !$content['cancel'])
{ {

View File

@ -958,7 +958,7 @@
if (!isset($cell['obj']->onclick_handler)) $cell['obj']->onclick_handler = $this->onclick_handler; if (!isset($cell['obj']->onclick_handler)) $cell['obj']->onclick_handler = $this->onclick_handler;
if ($cell['obj']->no_onclick) if ($cell['obj']->no_onclick)
{ {
$cell['obj']->onclick_proxy = $this->onclick_proxy ? $this->onclick_proxy : $this->name.':'.$path; $cell['obj']->onclick_proxy = $this->onclick_proxy ? $this->onclick_proxy : $this->name.':'.$this->version.':'.$path;
} }
$html = $cell['obj']->show($content,$this->sel_options,$readonlys,$cname,$show_c,$show_row); $html = $cell['obj']->show($content,$this->sel_options,$readonlys,$cname,$show_c,$show_row);
break; break;
@ -1253,7 +1253,7 @@
//echo "<p>$this->name($this->onclick_handler:$this->no_onclick:$this->onclick_proxy): $cell[type]/$cell[name]</p>\n"; //echo "<p>$this->name($this->onclick_handler:$this->no_onclick:$this->onclick_proxy): $cell[type]/$cell[name]</p>\n";
if ($this->onclick_handler && !isset($this->widgets_with_children[$cell['type']])) if ($this->onclick_handler && !isset($this->widgets_with_children[$cell['type']]))
{ {
$handler = str_replace('%p',$this->no_onclick ? $this->onclick_proxy : $this->name.':'.$path, $handler = str_replace('%p',$this->no_onclick ? $this->onclick_proxy : $this->name.':'.$this->version.':'.$path,
$this->onclick_handler); $this->onclick_handler);
if ($type == 'button' || !$label) // add something to click on if ($type == 'button' || !$label) // add something to click on
{ {