From 3938faeb19b159a4317f76b0abb9aeb90b22f96a Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 31 Oct 2007 08:16:34 +0000 Subject: [PATCH] "enhanced link widgets 'link' subwidget, to allow to specify the application via the options (value is just the id then)" --- etemplate/inc/class.link_widget.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etemplate/inc/class.link_widget.inc.php b/etemplate/inc/class.link_widget.inc.php index f784cb3fd8..0b8c244817 100644 --- a/etemplate/inc/class.link_widget.inc.php +++ b/etemplate/inc/class.link_widget.inc.php @@ -18,6 +18,7 @@ * * The class contains the following widgets: * - link: Show a link to one linked entry specified by an array with keys app, id and optional title and help-message + * Optionally the application can be specified as option and the value can be just the id. * - link-to: Widget to create links to an other entries of link-aware apps * If the variables $data['widget_id']['to_app'] = $app and $data['widget_id']['to_id'] = $entry_id * are set, this widget creates the links without further interaction with the calling code. @@ -145,6 +146,14 @@ $cell['readonly'] = True; // set it readonly to NOT call our post_process function $cell['no_lang'] = 1; $link = $target = $popup = ''; + if (!is_array($value) && $value && isset($GLOBALS['egw_info']['apps'][$cell['size']])) + { + $value = array( + 'id' => $value, + 'app' => $cell['size'], + ); + $cell['size'] = ''; + } if ($value['app'] && $value['id']) { $view = $this->link->view($value['app'],$value['id']);