diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index 49411cab4c..29fedf2a61 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -309,8 +309,17 @@ abstract class bo_merge * Get links for the given record * * Uses egw_link system to get link titles + * + * @param app Name of current app + * @param id ID of current entry + * @param only_app Restrict links to only given application + * @param exclude Exclude links to these applications + * @param style String One of: + * 'title' - plain text, just the title of the link + * 'link' - URL to the entry + * 'href' - HREF tag wrapped around the title */ - protected function get_links($app, $id, $only_app='', $exclude = array()) + protected function get_links($app, $id, $only_app='', $exclude = array(), $style = 'title') { $links = egw_link::get_links($app, $id, $only_app); $link_titles = array(); @@ -331,6 +340,25 @@ abstract class bo_merge { $title = stylite_links_stream_wrapper::entry2name($link_info['app'], $link_info['id'], $title); } + if($style == 'href' || $style == 'link') + { + $link = egw_link::view($link_info['app'], $link_info['id'], $link_info); + if($link_info['app'] != egw_link::VFS_APPNAME) + { + $link = str_replace(',','%2C',egw::link('/index.php',$link, $link_info['app'])); + } + else + { + $link = egw::link($link); + } + // Prepend site + if ($link{0} == '/') + { + $link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://'). + ($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link; + } + $title = $style == 'href' ? html::a_href(html::htmlspecialchars($title), $link) : $link; + } $link_titles[] = $title; } return implode("\n",$link_titles); @@ -830,7 +858,7 @@ abstract class bo_merge case 'text/html': $replace_tags = array( '','','','','','','
    ','