View Issue Details

IDProjectCategoryView StatusLast Update
0022371mantisbtwikipublic2017-02-14 11:02
Reportervendeeglobe Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Product Version2.1.0 
Target VersionFixed in Version 
Summary0022371: Support for WackoWiki
Description

Adds support for WackoWiki to Wiki Integration.

Additional Information

HowTo: https://wackowiki.org/doc/Dev/PatchesHacks/MantisWackoWikiIntegration
Example: https://wackowiki.org/bugs/

TagsNo tags attached.

Activities

vendeeglobe

vendeeglobe

2017-02-14 11:02

reporter  

wackowiki_integration_mantis2.1.0.patch (4,738 bytes)
diff --git a/config_defaults_inc.php b/config_defaults_inc.php
--- a/config_defaults_inc.php
+++ b/config_defaults_inc.php
@@ -3782,7 +3782,7 @@
 
 /**
  * Wiki Engine.
- * Supported engines: 'dokuwiki', 'mediawiki', 'twiki', 'wikka', 'xwiki'
+ * Supported engines: 'dokuwiki', 'mediawiki', 'twiki', 'wackowiki', 'wikka', 'xwiki'
  * @global string $g_wiki_engine
  */
 $g_wiki_engine = '';
diff --git a/core/classes/MantisCoreWikiPlugin.class.php b/core/classes/MantisCoreWikiPlugin.class.php
--- a/core/classes/MantisCoreWikiPlugin.class.php
+++ b/core/classes/MantisCoreWikiPlugin.class.php
@@ -218,6 +218,65 @@
 }
 
 /**
+ * Basic WackoWiki support with old-style wiki integration.
+ */
+class MantisCoreWackowikiPlugin extends MantisCoreWikiPlugin {
+	/**
+	 * Plugin Registration
+	 * @return void
+	 */
+	function register() {
+		$this->name = 'MantisBT WackoWiki Integration';
+		$this->version = '0.1';
+		$this->requires = array(
+			'MantisCore' => '2.0.0',
+		);
+	}
+
+	/**
+	 * Wiki base url
+	 *
+	 * @param integer $p_project_id A project identifier.
+	 * @return string
+	 */
+	function base_url( $p_project_id = null ) {
+		$t_base = plugin_config_get( 'engine_url' ) . '';
+
+		$t_namespace = ucfirst( plugin_config_get( 'root_namespace' ) );
+		if( !is_blank( $t_namespace ) ) {
+			$t_base .= urlencode( $t_namespace ) . '/';
+		}
+
+		if( !is_null( $p_project_id ) && $p_project_id != ALL_PROJECTS ) {
+			$t_base .= urlencode( project_get_name( $p_project_id ) ) . '/';
+		}
+		return $t_base;
+	}
+
+	/**
+	 * Wiki link to a bug
+	 *
+	 * @param integer $p_event  Event.
+	 * @param integer $p_bug_id A bug identifier.
+	 * @return string
+	 */
+	function link_bug( $p_event, $p_bug_id ) {
+		return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) . 'Issue' . (int)$p_bug_id;
+	}
+
+	/**
+	 * Wiki link to a project
+	 *
+	 * @param integer $p_event      Event.
+	 * @param integer $p_project_id A project identifier.
+	 * @return string
+	 */
+	function link_project( $p_event, $p_project_id ) {
+		return $this->base_url( $p_project_id ) . '';
+	}
+}
+
+/**
  * Basic WikkaWiki support with old-style wiki integration.
  */
 class MantisCoreWikkaWikiPlugin extends MantisCoreWikiPlugin {
diff --git a/core/wiki_api.php b/core/wiki_api.php
--- a/core/wiki_api.php
+++ b/core/wiki_api.php
@@ -70,6 +70,9 @@
 		case 'twiki':
 			plugin_child( 'MantisCoreTwiki' );
 			break;
+		case 'wackowiki':
+			plugin_child( 'MantisCoreWackowiki' );
+			break;
 		case 'WikkaWiki':
 			plugin_child( 'MantisCoreWikkaWiki' );
 			break;
diff --git a/doc/en-US/Admin_Guide/Admin_Guide.txt b/doc/en-US/Admin_Guide/Admin_Guide.txt
--- a/doc/en-US/Admin_Guide/Admin_Guide.txt
+++ b/doc/en-US/Admin_Guide/Admin_Guide.txt
@@ -3802,6 +3802,8 @@
 
         * twiki: TWiki
 
+        * wackowiki: WackoWiki
+
         * wikka: WikkaWiki
 
         * xwiki: XWiki
diff --git a/doc/en-US/Admin_Guide/html-desktop/index.html b/doc/en-US/Admin_Guide/html-desktop/index.html
--- a/doc/en-US/Admin_Guide/html-desktop/index.html
+++ b/doc/en-US/Admin_Guide/html-desktop/index.html
@@ -1793,7 +1793,9 @@
 							</div></li><li class="listitem"><div class="para">
 								<span class="emphasis"><em>twiki</em></span>: <a href="http://twiki.org/">TWiki</a>
 							</div></li><li class="listitem"><div class="para">
-								<span class="emphasis"><em>wikka</em></span>: <a href="http://wikkawiki.org/">WikkaWiki</a>
+								<span class="emphasis"><em>wackowiki</em></span>: <a href="https://wackowiki.org/">WackoWiki</a>
+							</div></li><li class="listitem"><div class="para">
+								<span class="emphasis"><em>wikka</em></span>: <a href="https://wikkawiki.org/">WikkaWiki</a>
 							</div></li><li class="listitem"><div class="para">
 								<span class="emphasis"><em>xwiki</em></span>: <a href="http://www.xwiki.org/">XWiki</a>
 							</div></li></ul></div>
diff --git a/doc/en-US/Admin_Guide/html-single/index.html b/doc/en-US/Admin_Guide/html-single/index.html
--- a/doc/en-US/Admin_Guide/html-single/index.html
+++ b/doc/en-US/Admin_Guide/html-single/index.html
@@ -1793,6 +1793,8 @@
 							</div></li><li class="listitem"><div class="para">
 								<span class="emphasis"><em>twiki</em></span>: <a href="http://twiki.org/">TWiki</a>
 							</div></li><li class="listitem"><div class="para">
+								<span class="emphasis"><em>wackowiki</em></span>: <a href="https://wackowiki.org/">WackoWiki</a>
+							</div></li><li class="listitem"><div class="para">
 								<span class="emphasis"><em>wikka</em></span>: <a href="http://wikkawiki.org/">WikkaWiki</a>
 							</div></li><li class="listitem"><div class="para">
 								<span class="emphasis"><em>xwiki</em></span>: <a href="http://www.xwiki.org/">XWiki</a>

Issue History

Date Modified Username Field Change
2017-02-14 11:02 vendeeglobe New Issue
2017-02-14 11:02 vendeeglobe File Added: wackowiki_integration_mantis2.1.0.patch