Automatic and programmatic modifications to MantisBT core files

General discussion about MantisBT Plugins

Moderators: Developer, Contributor

Post Reply
CarlosFeitozaFilho
Posts: 2
Joined: 01 Dec 2025, 16:42

Automatic and programmatic modifications to MantisBT core files

Post by CarlosFeitozaFilho »

Hello!

I know my question isn't about plugins, but I'd like to implement something in my plugins, and perhaps some of you have already created a clever solution.

The problem:

Recently, I needed to indicate next to the MantisBT name, in the title bar, whether the user was connected to was the development environment. Therefore, I had to modify a core MantisBT file because there was no way to use hooks/events. I wondered if there was a solution where a plugin, upon installation, could "patch" specific files using some technique to modify them and achieve customized behavior. When the plugin is uninstalled, the patch would be removed.

I KNOW there's the problem of MantisBT updates reverting these changes, but that would be the second problem. Initially, I wanted to know if anyone has done this before, and if so, how they did it.
dpesch
Posts: 4
Joined: 18 Mar 2026, 19:16
Location: Between Bonn and Cologne
Contact:

Re: Automatic and programmatic modifications to MantisBT core files

Post by dpesch »

Just to make sure I understand your use case correctly: were you looking to change the text shown in the browser tab/window title, or did you want the environment label to appear somewhere inside the MantisBT UI itself (e.g. next to the logo in the navigation bar)?

Asking because if it's the browser title, MantisBT has a built-in config option for that — no core file changes needed:

Code: Select all

$g_window_title = '[DEV] MantisBT';
Set this per environment in your config_inc.php and you're done. It's documented here:
Admin Guide — Display Configuration

If you need the label inside the page UI, a small JavaScript customization would be the way to go — happy to elaborate on that if that's what you're after.
Post Reply