opening attachments in a new window

General discussion of Mantis.

Moderators: Contributor, Developer

Post Reply
didds
Posts: 16
Joined: Jan 18, 2017 11:24 am

opening attachments in a new window

Post by didds » May 09, 2018 6:51 am

mantisbt 2.5.0
Apache/2.4.6
CentOS Linux release 7.4.1708 (Core)

newly provisioned version of 2.5.0

Image and PDF attachments to a call are opened in the same window if subsequently clicked on, requiring a return to the original call if updates are needed.

is there a simple tweak that will permit opening in a separate window?

(I did search but the only hit I found was for a very old version of Mantis 1.2.3)

cheers

didds

didds
Posts: 16
Joined: Jan 18, 2017 11:24 am

Re: opening attachments in a new window

Post by didds » May 16, 2018 10:33 am

Having done some more tests...

* a text file gets the option to save or open it (separate dialogue box)
* a png file gets opened in the same window
* a pdf file gets opened in the same window

what is the config_inc.php variable that affects this? It wold make more sense to have all attachments provided with the option to "open or save" rather than just open in a browser window

cheers

didds

atrol
Site Admin
Posts: 7052
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: opening attachments in a new window

Post by atrol » May 16, 2018 10:43 am

Copy the following piece of code (defaults from config_defaults_inc.php) to your config_inc.php and adjust to your needs

Code: Select all

/**
 * Specifies the maximum size (in bytes) below which an attachment is
 * previewed in the bug view pages.
 * To disable the previewing of attachments, set max size to 0.
 * @global integer $g_preview_attachments_inline_max_size
 */
$g_preview_attachments_inline_max_size = 256 * 1024;

/**
 * Extensions for text files that can be expanded inline.
 * @global array $g_preview_text_extensions
 */
$g_preview_text_extensions = array(
	'', 'txt', 'diff', 'patch'
);

/**
 * Extensions for images that can be expanded inline.
 * @global array $g_preview_image_extensions
 */
$g_preview_image_extensions = array(
	'bmp', 'png', 'gif', 'jpg', 'jpeg'
);
Please use Search before posting and read the Manual

Post Reply