Product SiteDocumentation Site

5.20. HTML

$g_html_make_links
This flag controls whether URLs and email addresses are automatically converted to clickable links. Additionally, for URL links, it determines where they open when clicked (target attribute) and their type.
The options below can be combined using bitwise operators, though not all possible combinations make sense. The default is LINKS_SAME_WINDOW | LINKS_NOOPENER.
  • OFF - do not convert URLs or emails
  • LINKS_SAME_WINDOW - convert to links that open in current tab/window. NOTE: for backwards-compatibility, this is equivalent to ON.
  • LINKS_NEW_WINDOW - convert to links that open in a new tab/window. Overrides LINKS_SAME_WINDOW.
  • LINKS_NOOPENER - Links have the noopener type.
  • LINKS_NOREFERRER - Links have the noreferrer type, i.e. they omit the Referer header. Implies LINKS_NOOPENER.
$g_html_valid_tags
This is the list of HTML tags that are allowed for multi-line fields (e.g. description).

Warning

For security reasons, do NOT include href or img or any tags that have parameters, as the HTML code is stored in the database as-is.
$g_html_valid_tags_single_line
This is the list of HTML tags that are allowed for single line fields (e.g. issue summary).

Warning

For security reasons, do NOT include href or img or any tags that have parameters, as the HTML code is stored in the database as-is.
$g_bottom_include_page
Specifies a file to be included at the bottom of each page. It can be used e.g. for company branding, to include Google Analytics script, etc.
$g_top_include_page
Specifies a file to be included at the top of each page. It can be used e.g. for company branding.
If a file is supplied, the logo specified by $g_logo_image (see Section 5.11, “Display”) will not be shown, and the include file will have to handle display of the logo. To do so you can use the html_print_logo() API function, which will display the logo with an URL link if one has been specified in $g_logo_url
Example top include PHP file with logo and centered page title:
<div id="banner" style="display: flex; align-items: center;">
	<div style="width: 10%;">
		<?php html_print_logo(); ?>
	</div>

	<div class="center">
		<span class="pagetitle">
			<?php global $g_window_title; echo $g_window_title; ?>
		</span>
	</div>

	<div style="width: 10%;">
	</div>
</div>
$g_css_include_file
Set this to point to the CSS file of your choice.
$g_css_rtl_include_file
Set this to point to the RTL CSS file of your choice.
$g_cdn_enabled
A flag that indicates whether to use CDN (content delivery networks) for loading javascript libraries and their associated CSS. This improves performance for loading MantisBT pages. This can be disabled if it is desired that MantisBT doesn't reach out outside corporate network. Default OFF.
$g_main_menu_custom_options
This option will add custom options to the main menu. It is an array of arrays listing the caption, access level required, and the link to be executed. For example:
$g_main_menu_custom_options = array(
    array( 
        'title'        => 'My Link',
        'access_level' => MANAGER,
        'url'          => 'my_link.php',
        'icon'         => 'fa-plug'
    ),
    array( 
        'title'        => 'My Link2',
        'access_level' => ADMINISTRATOR,
        'url'          => 'my_link2.php',
        'icon'         => 'fa-plug'
    )
);
Note that if the caption is found in custom_strings_inc.php (see Section 7.1, “Strings / Translations”), it will be replaced by the corresponding translated string. Options will only be added to the menu if the current logged in user has the appropriate access level.
Use icons from Font Awesome. Add "fa-" prefix to icon name.
Access level is an optional field, and no check will be done if it is not set. Icon is an optional field, and 'fa-plug' will be used if it is not set.
$g_max_dropdown_length
Maximum length of the description in a dropdown menu (for search) set to 0 to disable truncations
$g_wrap_in_preformatted_text
This flag controls whether pre-formatted text (delimited by HTML pre tags is wrapped to a maximum linelength (defaults to 100 chars in strings_api). If turned off, the display may be wide when viewing the text.