Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1992)
+++ branches/2.8.x/CHANGELOG	(revision 1993)
@@ -11,6 +11,9 @@
 ! = Update/Change
 ===============================================================================
 
+06 Nov-2013 Build 1993 Manuela v.d.Decken(DarkViper)
+! /module/output_filter/filters/filterWbLink added extended format to [wblinkXX] - tag
++ /framework/WbLinkAbstract.php added abstract class/interface for filterWbLink
 25 Oct-2013 Build 1992 Dietmar Woellbrink (Luisehahne)
 ! /admin/modules/index.php : captions of module lists changed from `directory` to real `name` and sorted by name
 21 Oct-2013 Build 1991 Manuela v.d.Decken(DarkViper)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1992)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1993)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.3');
-if(!defined('REVISION')) define('REVISION', '1992');
+if(!defined('REVISION')) define('REVISION', '1993');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/WbLinkAbstract.php
===================================================================
--- branches/2.8.x/wb/framework/WbLinkAbstract.php	(nonexistent)
+++ branches/2.8.x/wb/framework/WbLinkAbstract.php	(revision 1993)
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * WbLinkAbstract.php
+ *
+ * @category     Core
+ * @package      Core_Interfaces
+ * @subpackage   WbLink outputfilter
+ * @copyright    Manuela v.d.Decken <manuela@isteam.de>
+ * @author       Manuela v.d.Decken <manuela@isteam.de>
+ * @license      http://www.gnu.org/licenses/gpl.html   GPL License
+ * @version      0.0.1
+ * @revision     $Revision: $
+ * @link         $HeadURL: $
+ * @lastmodified $Date: $
+ * @since        File available since 03.11.2013
+ * @description  Interface definition for all addon/ * /WbLink.php
+ */
+abstract class WbLinkAbstract {
+
+	protected $oDb  = null;
+	protected $oReg = null;
+
+	final public function __construct()
+	{
+		$this->oDb  = WbDatabase::getInstance();
+		$this->oReg = WbAdaptor::getInstance();
+	}
+
+	abstract public function makeLinkFromTag(array $aReplacement);
+//	abstract public function generateLinkList(Template $oTpl);
+
+
+} // end of class WbLinkAbstract
Index: branches/2.8.x/wb/modules/output_filter/filters/filterWbLink.php
===================================================================
--- branches/2.8.x/wb/modules/output_filter/filters/filterWbLink.php	(revision 1992)
+++ branches/2.8.x/wb/modules/output_filter/filters/filterWbLink.php	(revision 1993)
@@ -1,29 +1,82 @@
 <?php
 /*
- * replace all "[wblink{page_id}]" with real links
- * @param string &$content : reference to global $content
- * @return void
- * @history 100216 17:00:00 optimise errorhandling, speed, SQL-strict
+ * @param  string $content : contains the full content of the current page
+ * @return string
+ * @description replace all "[wblink{page_id}{?addon=n&item=n...}]" with real links to accessfiles<br />
+ *     All modules must offer the class 'WbLink'(implementing 'WbLinkAbstract'), to be taken into consideration.
  */
-	function doFilterWbLink($content)
+	function doFilterWbLink($sContent)
 	{
-		global $database, $wb;
-		$replace_list = array();
-		$pattern = '/\[wblink([0-9]+)\]/isU';
-		if(preg_match_all($pattern,$content,$ids))
+		$oDb  = WbDatabase::getInstance();
+		$oReg = WbAdaptor::getInstance();
+		$aReplaceList = array();
+		$sPattern = '/\[wblink([0-9]+)\??([^\]]*)\]/is';
+		if(preg_match_all($sPattern,$sContent,$aMatches))
 		{
-			foreach($ids[1] as $key => $page_id) {
-				$replace_list[$page_id] = $ids[0][$key];
-			}
-			foreach($replace_list as $page_id => $tag)
+		// iterate through all found matches
+			foreach($aMatches[0] as $iKey => $sKeyString )
 			{
-				$sql = 'SELECT `link` FROM `'.TABLE_PREFIX.'pages` WHERE `page_id` = '.(int)$page_id;
-				$link = $database->get_one($sql);
-				if(!is_null($link)) {
-					$link = $wb->page_link($link);
-					$content = str_replace($tag, $link, $content);
+				$aReplaceList[$sKeyString] = array();
+			// use original Tag to save PageId
+				$aReplaceList[$sKeyString]['PageId'] = $aMatches[1][$iKey];
+			// if there are additional arguments given
+				if($aMatches[2][$iKey])
+				{
+					$aReplaceList[$sKeyString]['Args'] = array();
+					$aArgs = explode('&', $aMatches[2][$iKey]);
+					foreach($aArgs as $sArgument)
+					{
+						$aTmp = explode('=', $sArgument);
+						$aReplaceList[$sKeyString]['Args'][$aTmp[0]] = $aTmp[1];
+					}
 				}
 			}
+			if(sizeof($aReplaceList) > 0)
+			{ // iterate list if replacements are available
+				foreach($aReplaceList as $sKey => $aReplacement)
+				{
+				// set link on failure ('#' means, still stay on current page)
+					$aReplaceList[$sKey] = '#';
+				// handle normal pages links
+					if(!isset($aReplacement['Args'])) 
+					{
+					// read corresponding link from table 'pages'
+						$sql = 'SELECT `link` FROM `'.$oDb->TablePrefix.'pages` WHERE `page_id` = '.(int)$aReplacement['PageId'];
+						if(($sLink = $oDb->get_one($sql)))
+						{
+							$sLink = trim(str_replace('\\', '/', $sLink), '/');
+						// test if valid accessfile is available
+							if(is_readable($oReg->AppPath.$oReg->PagesDir.$sLink.$oReg->PageExtension))
+							{
+							// create absolute URL
+								$aReplaceList[$sKey] = $oReg->AppUrl.$oReg->PagesDir.$sLink.$oReg->PageExtension;
+							}
+						}
+					// handle links of modules
+					}else 
+					{
+					// build name of the needed class
+						$sClass = 'm_'.$aReplacement['Args']['addon'].'_WbLink';
+					// remove addon name from replacement array
+						unset($aReplacement['Args']['addon']);
+						if(class_exists($sClass))
+						{
+						// instantiate class
+							$oWbLink = new $sClass();
+						// the class must implement the interface
+							if($oWbLink instanceof WbLinkAbstract)
+							{
+							// create real link from replacement data
+								$aReplaceList[$sKey] = $oWbLink->makeLinkFromTag($aReplacement);
+							}
+						}
+					}
+				}
+			// extract indexes into a new array
+				$aSearchList = array_keys($aReplaceList);
+			// replace all identified wblink-tags in content
+				$sContent = str_replace($aSearchList, $aReplaceList, $sContent);
+			}
 		}
-		return $content;
+		return $sContent;
 	}
