From 2a03d32d810d5f812020dfbe7f62222ad1638206 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 14 May 2009 17:45:00 +0000 Subject: [PATCH] Automatic import labels into the content of an edited template via a callback: ${app}_bo::labels(). They are set as $content['labels'] --- etemplate/inc/class.editor.inc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/etemplate/inc/class.editor.inc.php b/etemplate/inc/class.editor.inc.php index 2274adf02c..85e3a33921 100644 --- a/etemplate/inc/class.editor.inc.php +++ b/etemplate/inc/class.editor.inc.php @@ -509,6 +509,13 @@ class editor unserialize(substr($vals["A$r"],0,-5)) : $vals["A$r"]; } } + // check if bo class of $app exists and has a labels method --> add labels to content to display them in the editor + if(class_exists($app.'_bo') && method_exists($app.'_bo','labels')) + { + $new_content['labels'] = ExecMethod($acm=$app.'.'.$app.'_bo.labels'); + $new_content['cont']['labels'] =& $new_content['labels']; + //echo $acm; _debug_array($new_content['labels']); + } $preserv['olds'] = $vals; $preserv['old_keys'] = $this->etemplate->as_array(-1); // in case we do a save as