Howto replace a function in Mantis with a customiced one

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
JeromyK
Posts: 22
Joined: 01 Mar 2012, 08:12

Howto replace a function in Mantis with a customiced one

Post by JeromyK »

Hello everybody

I want to modify a Mantis-Function with a plugin but I don't know if that is even possible. This is the thing I want to do:

print_api.php - Function: print_category_option_list (Line 658 - 689)

REPLACE

Code: Select all

		check_selected( $p_category_id, $t_category_id );
		echo '>' . string_attribute( category_full_name( $t_category_id, $t_category_row['project_id'] != $t_project_id ) ) . '</option>';
WITH

Code: Select all

		check_selected( $p_category_id, $t_category_id );
		$temp = string_attribute( category_full_name( $t_category_id, $t_category_row['project_id'] != $t_project_id ) );
		$list = explode( ' - ', $temp );
		$temp = str_repeat( "&nbsp;", (count( $list ) -1)* 4 ) . array_pop( $list );
		echo '>' . $temp . '</option>';
If I change print_api.php directly, it works, but I want to do it with a plugin. Can somebody please give me a hint or code-example how I can replace mantis-functions (if that is even possible)?

Thanks

Jeromy
atrol
Site Admin
Posts: 8575
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Howto replace a function in Mantis with a customiced one

Post by atrol »

There is no way to write a custom function for it. There is also no event at this place. So you can't write a plugin.
Please use Search before posting and read the Manual
JeromyK
Posts: 22
Joined: 01 Mar 2012, 08:12

Re: Howto replace a function in Mantis with a customiced one

Post by JeromyK »

Ok, thanks for the answer
Post Reply