Own wiki integration plugin
Moderators: Developer, Contributor
Own wiki integration plugin
Hello,
is there a way to replace the integrated wikiplugin of 1.2.0 RC2 with a custom one?
Greetings
PAB
is there a way to replace the integrated wikiplugin of 1.2.0 RC2 with a custom one?
Greetings
PAB
Re: Own wiki integration plugin
Do you have some more info for me? (I know, i didn't explicitely requested...
)
Re: Own wiki integration plugin
Short question (still the same after your second post) without any more information.
I don't know where to start and can not imagine which information will be helpful for you or not.
You should start with some kind of:
I installed MantisBT 1.2.0rc2, I tried out the Wiki module which is delivered with Wiki XYZ.
But this module does not fit my expections, because I want to have .......
I tried out various configurations, but this was still not what I want ....
After that I had a look at the sourcecode and ....
I don't know where to start and can not imagine which information will be helpful for you or not.
You should start with some kind of:
I installed MantisBT 1.2.0rc2, I tried out the Wiki module which is delivered with Wiki XYZ.
But this module does not fit my expections, because I want to have .......
I tried out various configurations, but this was still not what I want ....
After that I had a look at the sourcecode and ....
Re: Own wiki integration plugin
I already patched the MediaWikiPlugin in core/classes/MantisCoreWikiPlugin.class.php, but want to separate my changes from the original code.
I had a look at core/wiki_api.php and found wiki_init with a hardcoded switch-case. My question is, how do i integrate a custom wikiplugin? Can I hook into the legacy style wiki integration or do i need to write a general plugin, which, for example, adds the "Wiki"-link in mantis' toolbar by itself?
I had a look at core/wiki_api.php and found wiki_init with a hardcoded switch-case. My question is, how do i integrate a custom wikiplugin? Can I hook into the legacy style wiki integration or do i need to write a general plugin, which, for example, adds the "Wiki"-link in mantis' toolbar by itself?
Re: Own wiki integration plugin
much better
First to clarify: the current implementation is not a plugin in the way plugin's are meant in 1.2.x. (even if the name of it contains plugin)
There are at least two alternatives:
Change the current code, so that the hardcoding is replaced by customization.
Provide the patches to the developers.
They will have a look on it, and when they think that it's good enough, your changes will be merged into upcoming versions.
So there is no more need for you to seperate anything of your code.
However my opinion regarding long term development of MantisBT is, that this should be implemented as a seperated plugin (and after having the plugin the current implementation in core should be removed)
Check, whether the new plugin system provides enough functionality for it, I suggest it will.
If you think about starting with development of a new plugin, you should start with a source repository for it at: http://git.mantisforge.org/
First you should write to mantisbt-dev@lists.sourceforge.net where developers are listening.
I am pretty sure they will provide you with better technical and internal information than I am able to do.
But write more than: "Is there a way to replace the integrated wikiplugin of 1.2.0 RC2 with a custom one?"
First to clarify: the current implementation is not a plugin in the way plugin's are meant in 1.2.x. (even if the name of it contains plugin)
There are at least two alternatives:
Change the current code, so that the hardcoding is replaced by customization.
Provide the patches to the developers.
They will have a look on it, and when they think that it's good enough, your changes will be merged into upcoming versions.
So there is no more need for you to seperate anything of your code.
However my opinion regarding long term development of MantisBT is, that this should be implemented as a seperated plugin (and after having the plugin the current implementation in core should be removed)
Check, whether the new plugin system provides enough functionality for it, I suggest it will.
If you think about starting with development of a new plugin, you should start with a source repository for it at: http://git.mantisforge.org/
First you should write to mantisbt-dev@lists.sourceforge.net where developers are listening.
I am pretty sure they will provide you with better technical and internal information than I am able to do.
But write more than: "Is there a way to replace the integrated wikiplugin of 1.2.0 RC2 with a custom one?"
Re: Own wiki integration plugin
I think i'll try to post my changes as a patch. None the less, i'll ask on the mailinglist to clarify the "official" way to integrate wikiplugins.
Thanks for your help.
Thanks for your help.
Re: Own wiki integration plugin
If you think about providing patches you should read this:
http://www.mantisforge.org/dev/manual/e ... ubmit.html
http://www.mantisforge.org/dev/manual/e ... ubmit.html
Re: Own wiki integration plugin
Just played around with wikiplugins and found the way to implement: Inherit from MantisWikiPlugin and leave "wiki_engine" empty.
Here is a stub:
plugins/MyWiki/MyWiki.php
config_inc.php
Here is a stub:
plugins/MyWiki/MyWiki.php
Code: Select all
<?php
require_once( config_get( 'class_path' ) . 'MantisWikiPlugin.class.php' );
class MyWikiPlugin extends MantisWikiPlugin {
function register() {
$this->name = 'Authors\' MyWikiPlugin';
$this->description = 'Own MediaWiki link';
$this->version = '0.1';
$this->requires = array(
'MantisCore' => '1.2.0',
);
$this->author = 'Author';
$this->contact = 'author@example.com';
$this->url = 'http://www.example.com';
}
function config(){}
function base_url( $p_project_id=null ) {
$t_base = 'http://example.com/mediawiki/index.php/';
if ( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
$t_base .= urlencode( project_get_name( $p_project_id ) ) . ':';
} else {
$t_base .= urlencode( 'root:' );
}
return $t_base;
}
function link_bug( $p_event, $p_bug_id ) {
return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) . (int)$p_bug_id;
}
function link_project( $p_event, $p_project_id ) {
return $this->base_url( $p_project_id ) . 'Main_Page';
}
}
Code: Select all
$g_wiki_enable = ON;
$g_wiki_engine = '';
Re: Own wiki integration plugin
Thank you for posting this information and also the patch you attached at http://www.mantisbt.org/bugs/view.php?id=11544
-
wxfhnmdedc
- Posts: 1
- Joined: 01 Jun 2011, 07:33
Re: Own wiki integration plugin
I had a look at core/wiki_api.php and found wiki_init with a hardcoded switch-case. My question is, how do i integrate a custom wikiplugin? Can I hook into the legacy style wiki integration or do i need to write a general plugin, which, for example, adds the "Wiki"-link in mantis' toolbar by itself?