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.
Automatic and programmatic modifications to MantisBT core files
Moderators: Developer, Contributor
-
CarlosFeitozaFilho
- Posts: 2
- Joined: 01 Dec 2025, 16:42
Re: Automatic and programmatic modifications to MantisBT core files
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:
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.
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';
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.