Howto replace a function in Mantis with a customiced one

Post about your customizations to share with others.

Moderators: Developer, Contributor

Howto replace a function in Mantis with a customiced one

Postby JeromyK » Apr 18, 2012 6:07 am

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
JeromyK
 
Posts: 8
Joined: Mar 01, 2012 3:12 am

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

Postby atrol » Apr 18, 2012 6:46 am

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
 
Posts: 3632
Joined: Mar 26, 2008 4:37 pm
Location: Germany

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

Postby JeromyK » Apr 18, 2012 7:32 am

Ok, thanks for the answer
JeromyK
 
Posts: 8
Joined: Mar 01, 2012 3:12 am


Return to Customizations

Who is online

Users browsing this forum: No registered users and 4 guests

cron