I'm quite new here (I installed Mantis for the first time two days ago), but I already have written a little hack to link our mantis and our inhouse developer-wiki.
I wanted to be able to put simple links from mantis notes into the wiki in a similar syntax as people here are used to. So I patched one core file (core/string_api.php) to recognize links of the types "[[Topic|Title]]" and "[[Topic]]" and replace them by "[Wiki] <a href="(confgured URL)Topic">Title</a>" (if no Title is given, replace by Topic). The URL is configurable (e.g. $g_wiki_url = 'https://ew/Wiki/index.php/';) in config.inc.php and the patch is against core/string_api.php:
Code: Select all
103a104
> $p_string = string_process_wiki_link( $p_string );
107a109,121
> # --------------------
> # Process Wiki links
> function string_process_wiki_link( $p_string ){
> $t_wiki_url = config_get( 'wiki_url' );
> # Wiki-links a la [[Title|Displayname]]
> $t_replace_with = '[Wiki] <a href="'.$t_wiki_url.'\\1">\\2</a>';
> $p_string = preg_replace( '/\[\[([^\|\]]*)\|([^\]]*)\]\]/', $t_replace_with, $p_string );
> # Wiki-links a la [[Title]]
> $t_replace_with = '[Wiki] <a href="'.$t_wiki_url.'\\1">\\1</a>';
> $p_string = preg_replace( '/\[\[([^\]]*)\]\]/', $t_replace_with, $p_string );
> return $p_string;
> }
>
Yours, Christian Treczoks