Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1993)
+++ branches/2.8.x/CHANGELOG	(revision 1994)
@@ -11,6 +11,9 @@
 ! = Update/Change
 ===============================================================================
 
+06 Nov-2013 Build 1994 Manuela v.d.Decken(DarkViper)
++ /module/news/WbLink.php  added Interface class to module news
+! ../fck_wbmodules.php & ../wbmodules.htt modified link generation for news module
 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
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1993)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1994)
@@ -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', '1993');
+if(!defined('REVISION')) define('REVISION', '1994');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/fckeditor/fckeditor/editor/plugins/WBModules/wbmodules.htt
===================================================================
--- branches/2.8.x/wb/modules/fckeditor/fckeditor/editor/plugins/WBModules/wbmodules.htt	(revision 1993)
+++ branches/2.8.x/wb/modules/fckeditor/fckeditor/editor/plugins/WBModules/wbmodules.htt	(revision 1994)
@@ -1,143 +1,143 @@
-<!-- BEGIN main_block -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-	<head>
-		<title>WB Link - Insert Website Baker Link</title>
-		<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}">
-		<meta content="noindex, nofollow" name="robots">
-		<script type="text/javascript" src="fckwbmodules.js"></script>
-		<script type="text/javascript">
-		<!--
-			var oEditor			= window.parent.InnerDialogLoaded(); 
-			var FCK				= oEditor.FCK; 
-			var FCKLang			= oEditor.FCKLang ;
-			var FCKConfig		= oEditor.FCKConfig ;
-			//var FCKCMSCCMSModules	= oEditor.FCKCMSModules; 
-			 
-			// oLink: The actual selected link in the editor.
-			var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
-			if ( oLink )
-				FCK.Selection.SelectNode( oLink ) ;
-	
-			window.onload = function ()	{ 
-				// First of all, translates the dialog box texts.
-				oEditor.FCKLanguageManager.TranslatePage(document);
-				
-				LoadSelected();							//See function below 
-				window.parent.SetOkButton( true );		//Show the "Ok" button. 
-				
-			} 
-			 
-			//If an anchor (A) object is currently selected, load the properties into the dialog 
-			function LoadSelected()	{
-				var sSelected;
-
-				if ( oEditor.FCKBrowserInfo.IsGecko || oEditor.FCKBrowserInfo.IsSafari || oEditor.FCKBrowserInfo.IsChrome ) {
-					sSelected = FCK.EditorWindow.getSelection();
-				} else {
-					sSelected = FCK.EditorDocument.selection.createRange().text;
-				}
-
-				if ( sSelected == "" ) {
-					alert( FCKLang.WBModulesErrSelection );
-					window.parent.Cancel();
-				}
-
-			}
-
-			//Code that runs after the OK button is clicked 
-			function Ok() {
-				//Validate is option is selected
-				var oTagLink = document.getElementById( 'chkTaglink' );				
-				var oPageList = document.getElementById( 'cmbPages' ) ;
-				if(oPageList.selectedIndex == -1) {
-					alert( FCKLang.WBModulesErrPageSelect );
-					return false;
-				} else {
-					var sPageId = oPageList[oPageList.selectedIndex].value;
-					newsSel = document.getElementsByName( 'cmbNews' );	
-					for (i = 0; i < newsSel.length; i++) {
-						if(newsSel[i].selectedIndex !== -1) {
-			  	  	var sPageId = newsSel[i][newsSel[i].selectedIndex].value;							
-						}
-					}
-				}
-				
-				oLink = oEditor.FCK.CreateLink( sPageId ) ;
-				// the following line was commented out as it creates an error message in some browser (e.g. IE)
-				// even Firefox seems not to make use of the title so we remove this option for know (doc)
-				oLink[0].setAttribute('title', document.getElementById( 'txtTitle' ).value ) ;
-				oLink[0].setAttribute('class', document.getElementById( 'txtClass' ).value ) ;
-			return true;
-
-			} 
-
-			
-		//-->
-		</script>
-	</head>
-			
-	<body scroll="no" style="overflow:hidden;">
-		 <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> 
-		 	<tr> 
-				<td>
-					<table width="100%">
-						<tr>
-							<td colspan="2"><span fckLang="WBModuleslblPageSelection">Select a WB Page to link to:</span>&nbsp;</td>
-						</tr>
-						<tr>
-							<td colspan="2">
-								<select id="cmbPages" style="WIDTH: 100%" size="8" name="cmbPages">
-									<!-- BEGIN page_list_block -->
-									<option value="{LINK}"{SELECTED}>{TITLE}</option>
-									<!-- END page_list_block -->
-								</select>
-							</td>
-						</tr>
-						<!-- commented out as this option will not work in all browsers (doc)-->
-						<tr>
-							<td nowrap><span fckLang="WBModuleslblTitle">Title</span>&nbsp;</td>
-							<td width="100%" style="align:right;"><input id="txtTitle" style="WIDTH: 98%" type="text" name="txtTitle"></td>
-						</tr>
-						<tr>
-							<td nowrap><span fckLang="WBModuleslblClass">Class</span>&nbsp;</td>
-							<td width="100%" style="align:right;"><input id="txtClass" style="WIDTH: 98%" type="text" name="txtClass"></td>
-						</tr>
-						<tr>
-							<td valign="top" nowrap><span fckLang="WBModuleslblNews">Class</span>&nbsp;</td>
-							<td><span id="noSelect" style="display: block;" fckLang="WBModuleslblNoNews"></span>
-								<!-- BEGIN news_select_block -->
-								<select class="newspage{PAGE_ID}" id="cmbNews" style="display: none;" size="6" name="cmbNews">
-								<!-- <select id="cmbNews" style="WIDTH: 100%;" size="6" name="cmbNews">-->
-									<!-- BEGIN news_list_block -->
-									<option value="{LINK}"{SELECTED}>{TITLE}</option>
-									<!-- END news_list_block -->
-								</select>
-								<!-- END news_select_block -->
-							</td>
-						</tr>
-						
-					</table>
-				</td>
-			</tr>
-		</table>
-		
-		<script type="text/javascript">
-			var oPageList = document.getElementById( 'cmbPages' ) ;		
-			oPageList.onchange = function() {
-				pageId = (this[this.selectedIndex].value).replace(/\[wblink(.*)\]/, "$1")
-				newsSelects = document.getElementsByName( 'cmbNews' );	
-				document.getElementById( 'noSelect' ).setAttribute('style','display: block;') ;
-				for (i = 0; i < newsSelects.length; i++) {
-					newsSelects[i].setAttribute('style','display: none') ;	
-				  if (newsSelects[i].className == "newspage"+ pageId) {
-				  	document.getElementById( 'noSelect' ).setAttribute('style','display: none;') ;
-				  	newsSelects[i].setAttribute('style','display: block; width: 100%;') ;
-				  }	
-				}
-			}
-			var oPageList = document.getElementById( 'cmbPages' ) ;	
-		</script>
-	</body>
-</html> 
+<!-- BEGIN main_block -->
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+	<head>
+		<title>WB Link - Insert Website Baker Link</title>
+		<meta http-equiv="Content-Type" content="text/html; charset={CHARSET}">
+		<meta content="noindex, nofollow" name="robots">
+		<script type="text/javascript" src="fckwbmodules.js"></script>
+		<script type="text/javascript">
+		<!--
+			var oEditor			= window.parent.InnerDialogLoaded(); 
+			var FCK				= oEditor.FCK; 
+			var FCKLang			= oEditor.FCKLang ;
+			var FCKConfig		= oEditor.FCKConfig ;
+			//var FCKCMSCCMSModules	= oEditor.FCKCMSModules; 
+			 
+			// oLink: The actual selected link in the editor.
+			var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
+			if ( oLink )
+				FCK.Selection.SelectNode( oLink ) ;
+	
+			window.onload = function ()	{ 
+				// First of all, translates the dialog box texts.
+				oEditor.FCKLanguageManager.TranslatePage(document);
+				
+				LoadSelected();							//See function below 
+				window.parent.SetOkButton( true );		//Show the "Ok" button. 
+				
+			} 
+			 
+			//If an anchor (A) object is currently selected, load the properties into the dialog 
+			function LoadSelected()	{
+				var sSelected;
+
+				if ( oEditor.FCKBrowserInfo.IsGecko || oEditor.FCKBrowserInfo.IsSafari || oEditor.FCKBrowserInfo.IsChrome ) {
+					sSelected = FCK.EditorWindow.getSelection();
+				} else {
+					sSelected = FCK.EditorDocument.selection.createRange().text;
+				}
+
+				if ( sSelected == "" ) {
+					alert( FCKLang.WBModulesErrSelection );
+					window.parent.Cancel();
+				}
+
+			}
+
+			//Code that runs after the OK button is clicked 
+			function Ok() {
+				//Validate is option is selected
+				var oTagLink = document.getElementById( 'chkTaglink' );				
+				var oPageList = document.getElementById( 'cmbPages' ) ;
+				if(oPageList.selectedIndex == -1) {
+					alert( FCKLang.WBModulesErrPageSelect );
+					return false;
+				} else {
+					var sPageId = oPageList[oPageList.selectedIndex].value;
+					newsSel = document.getElementsByName( 'cmbNews' );	
+					for (i = 0; i < newsSel.length; i++) {
+						if(newsSel[i].selectedIndex !== -1) {
+			  	  	var sPageId = newsSel[i][newsSel[i].selectedIndex].value;							
+						}
+					}
+				}
+				
+				oLink = oEditor.FCK.CreateLink( sPageId ) ;
+				// the following line was commented out as it creates an error message in some browser (e.g. IE)
+				// even Firefox seems not to make use of the title so we remove this option for know (doc)
+				oLink[0].setAttribute('title', document.getElementById( 'txtTitle' ).value ) ;
+				oLink[0].setAttribute('class', document.getElementById( 'txtClass' ).value ) ;
+			return true;
+
+			} 
+
+			
+		//-->
+		</script>
+	</head>
+			
+	<body scroll="no" style="overflow:hidden;">
+		 <table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0"> 
+		 	<tr> 
+				<td>
+					<table width="100%">
+						<tr>
+							<td colspan="2"><span fckLang="WBModuleslblPageSelection">Select a WB Page to link to:</span>&nbsp;</td>
+						</tr>
+						<tr>
+							<td colspan="2">
+								<select id="cmbPages" style="WIDTH: 100%" size="8" name="cmbPages">
+									<!-- BEGIN page_list_block -->
+									<option value="{LINK}"{SELECTED}>{TITLE}</option>
+									<!-- END page_list_block -->
+								</select>
+							</td>
+						</tr>
+						<!-- commented out as this option will not work in all browsers (doc)-->
+						<tr>
+							<td nowrap><span fckLang="WBModuleslblTitle">Title</span>&nbsp;</td>
+							<td width="100%" style="align:right;"><input id="txtTitle" style="WIDTH: 98%" type="text" name="txtTitle"></td>
+						</tr>
+						<tr>
+							<td nowrap><span fckLang="WBModuleslblClass">Class</span>&nbsp;</td>
+							<td width="100%" style="align:right;"><input id="txtClass" style="WIDTH: 98%" type="text" name="txtClass"></td>
+						</tr>
+						<tr>
+							<td valign="top" nowrap><span fckLang="WBModuleslblNews">Class</span>&nbsp;</td>
+							<td><span id="noSelect" style="display: block;" fckLang="WBModuleslblNoNews"></span>
+								<!-- BEGIN news_select_block -->
+								<select class="newspage{PAGE_ID}" id="cmbNews" style="display: none;" size="6" name="cmbNews">
+								<!-- <select id="cmbNews" style="WIDTH: 100%;" size="6" name="cmbNews">-->
+									<!-- BEGIN news_list_block -->
+									<option value="{LINK}"{SELECTED}>{TITLE}</option>
+									<!-- END news_list_block -->
+								</select>
+								<!-- END news_select_block -->
+							</td>
+						</tr>
+						
+					</table>
+				</td>
+			</tr>
+		</table>
+		
+		<script type="text/javascript">
+			var oPageList = document.getElementById( 'cmbPages' ) ;		
+			oPageList.onchange = function() {
+				pageId = (this[this.selectedIndex].value).replace(/\[wblink(\d+)[^\]]*\]/, "$1")
+				newsSelects = document.getElementsByName( 'cmbNews' );	
+				document.getElementById( 'noSelect' ).setAttribute('style','display: block;') ;
+				for (i = 0; i < newsSelects.length; i++) {
+					newsSelects[i].setAttribute('style','display: none') ;	
+				  if (newsSelects[i].className == "newspage"+ pageId) {
+				  	document.getElementById( 'noSelect' ).setAttribute('style','display: none;') ;
+				  	newsSelects[i].setAttribute('style','display: block; width: 100%;') ;
+				  }	
+				}
+			}
+			var oPageList = document.getElementById( 'cmbPages' ) ;	
+		</script>
+	</body>
+</html> 
 <!-- END main_block -->
\ No newline at end of file
Index: branches/2.8.x/wb/modules/fckeditor/fckeditor/editor/plugins/WBModules/fck_wbmodules.php
===================================================================
--- branches/2.8.x/wb/modules/fckeditor/fckeditor/editor/plugins/WBModules/fck_wbmodules.php	(revision 1993)
+++ branches/2.8.x/wb/modules/fckeditor/fckeditor/editor/plugins/WBModules/fck_wbmodules.php	(revision 1994)
@@ -1,111 +1,116 @@
-<?php
-
-// $Id$
-
-/*
-
- Website Baker Project <http://www.websitebaker.org/>
- Copyright (C) 2004-2009, Ryan Djurovich
-
- Website Baker 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 2 of the License, or
- (at your option) any later version.
-
- Website Baker 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 Website Baker; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-*/
-
-// Include the config file
-require('../../../../../../config.php');
-// Create new admin object
-require(WB_PATH.'/framework/class.admin.php');
-$admin = new admin('Pages', 'pages_modify', false);
-
-// Setup the template
-$template = new Template(WB_PATH.'/modules/fckeditor/fckeditor/editor/plugins/WBModules');
-$template->set_file('page', 'wbmodules.htt');
-$template->set_block('page', 'main_block', 'main');
-
-// Function to generate page list
-function gen_page_list($parent) {
-	global $template, $database, $admin;
-	$get_pages = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' order by position");
-	while($page = $get_pages->fetchRow()) {
-		// method page_is_visible was introduced with WB 2.7
-		if(method_exists($admin, 'page_is_visible') && !$admin->page_is_visible($page))
-			continue;
-		$title = stripslashes($page['menu_title']);
-		// Add leading -'s so we can tell what level a page is at
-		$leading_dashes = '';
-		for($i = 0; $i < $page['level']; $i++) {
-			$leading_dashes .= '- ';
-		}
-		$template->set_var('TITLE', $leading_dashes.' '.$title);
-		$template->set_var('LINK', '[wblink'.$page['page_id'].']');
-		/**
-			Note: FCK uses the header defined in /fckeditor/fckeditor/editor/fckdialog.html
-			Therefore the WB charset defined in the template: wbmodules.html will be overwritten
-			Routine kept for now, maybe it is possible to define custom plugin charsets in a future FCK releases (doc)
-		*/
-		// work out the specified WB charset 
-		if(defined('DEFAULT_CHARSET')) { 
-			$template->set_var('CHARSET', DEFAULT_CHARSET);
-		} else { 
-			$template->set_var('CHARSET', 'utf-8');
-		}
-		$template->parse('page_list', 'page_list_block', true);
-		gen_page_list($page['page_id']);
-	}
-}
-
-// Get pages and put them into the pages list
-$template->set_block('main_block', 'page_list_block', 'page_list');
-$get_pages = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '0' order by position");
-if($get_pages->numRows() > 0) {
-	// Loop through pages
-	while($page = $get_pages->fetchRow()) {
-		// method page_is_visible was introduced with WB 2.7
-		if(method_exists($admin, 'page_is_visible') && !$admin->page_is_visible($page))
-			continue;
-		$title = stripslashes($page['menu_title']);
-		$template->set_var('TITLE', $title);
-		$template->set_var('LINK', '[wblink'.$page['page_id'].']');
-		$template->parse('page_list', 'page_list_block', true);
-		gen_page_list($page['page_id']);
-	}
-} else {
-	$template->set_var('TITLE', 'None found');
-	$template->set_var('LINK', 'None found');
-	$template->parse('page_list', 'page_list_block', false);
-}
-
-$newsSections = $database->query("SELECT * FROM ".TABLE_PREFIX."sections WHERE module = 'news'");
-$newsPages = array();
-$template->set_block('main_block', 'news_select_block', 'select_list');
-$template->set_block('news_select_block', 'news_list_block', 'news_list');
-while($section = $newsSections->fetchRow()){
-	$news = $database->query("SELECT title, link FROM ".TABLE_PREFIX."mod_news_posts WHERE active=1 AND section_id = ".$section['section_id']);
-	while($item = $news->fetchRow()) {
-    $template->set_var('TITLE', $item['title']);
-		$template->set_var('LINK', WB_URL.PAGES_DIRECTORY.$item['link'].PAGE_EXTENSION);
-		$template->parse('news_list', 'news_list_block', true);
-	}
-	$template->set_var('PAGE_ID', $section['page_id']);
-	$template->parse('select_list', 'news_select_block', true);
-	$template->clear_var('news_list');
-}
-
-
-// Parse the template object
-$template->parse('main', 'main_block', false);
-$template->pparse('output', 'page');
-
+<?php
+
+// $Id$
+
+/*
+
+ Website Baker Project <http://www.websitebaker.org/>
+ Copyright (C) 2004-2009, Ryan Djurovich
+
+ Website Baker 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 2 of the License, or
+ (at your option) any later version.
+
+ Website Baker 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 Website Baker; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+// Include the config file
+require('../../../../../../config.php');
+// Create new admin object
+require(WB_PATH.'/framework/class.admin.php');
+$admin = new admin('Pages', 'pages_modify', false);
+
+// Setup the template
+$template = new Template(WB_PATH.'/modules/fckeditor/fckeditor/editor/plugins/WBModules');
+$template->set_file('page', 'wbmodules.htt');
+$template->set_block('page', 'main_block', 'main');
+
+// Function to generate page list
+function gen_page_list($parent) {
+	global $template, $database, $admin;
+	$get_pages = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' order by position");
+	while($page = $get_pages->fetchRow()) {
+		// method page_is_visible was introduced with WB 2.7
+		if(method_exists($admin, 'page_is_visible') && !$admin->page_is_visible($page))
+			continue;
+		$title = stripslashes($page['menu_title']);
+		// Add leading -'s so we can tell what level a page is at
+		$leading_dashes = '';
+		for($i = 0; $i < $page['level']; $i++) {
+			$leading_dashes .= '- ';
+		}
+		$template->set_var('TITLE', $leading_dashes.' '.$title);
+		$template->set_var('LINK', '[wblink'.$page['page_id'].']');
+		/**
+			Note: FCK uses the header defined in /fckeditor/fckeditor/editor/fckdialog.html
+			Therefore the WB charset defined in the template: wbmodules.html will be overwritten
+			Routine kept for now, maybe it is possible to define custom plugin charsets in a future FCK releases (doc)
+		*/
+		// work out the specified WB charset 
+		if(defined('DEFAULT_CHARSET')) { 
+			$template->set_var('CHARSET', DEFAULT_CHARSET);
+		} else { 
+			$template->set_var('CHARSET', 'utf-8');
+		}
+		$template->parse('page_list', 'page_list_block', true);
+		gen_page_list($page['page_id']);
+	}
+}
+
+// Get pages and put them into the pages list
+$template->set_block('main_block', 'page_list_block', 'page_list');
+$get_pages = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE parent = '0' order by position");
+if($get_pages->numRows() > 0) {
+	// Loop through pages
+	while($page = $get_pages->fetchRow()) {
+		// method page_is_visible was introduced with WB 2.7
+		if(method_exists($admin, 'page_is_visible') && !$admin->page_is_visible($page))
+			continue;
+		$title = stripslashes($page['menu_title']);
+		$template->set_var('TITLE', $title);
+		$template->set_var('LINK', '[wblink'.$page['page_id'].']');
+		$template->parse('page_list', 'page_list_block', true);
+		gen_page_list($page['page_id']);
+	}
+} else {
+	$template->set_var('TITLE', 'None found');
+	$template->set_var('LINK', 'None found');
+	$template->parse('page_list', 'page_list_block', false);
+}
+
+$template->set_block('main_block', 'news_select_block', 'select_list');
+$template->set_block('news_select_block', 'news_list_block', 'news_list');
+$sql = 'SELECT * '
+     . 'FROM `'.TABLE_PREFIX.'sections` '
+     . 'WHERE `module`=\'news\'';
+$newsSections = $database->query($sql);
+while($section = $newsSections->fetchRow()){
+	$sql = 'SELECT `title`, `link`, `post_id`, `page_id` '
+	     . 'FROM `'.TABLE_PREFIX.'mod_news_posts` '
+	     . 'WHERE `active`=1 AND `section_id`='.$section['section_id'];
+	$news = $database->query($sql);
+	while($aItem = $news->fetchRow()) {
+		$template->set_var('TITLE', $aItem['title']);
+		$template->set_var('LINK', '[wblink'.$aItem['page_id'].'?addon=news&item='.$aItem['post_id'].']');
+//		$template->set_var('LINK', WB_URL.PAGES_DIRECTORY.$item['link'].PAGE_EXTENSION);
+		$template->parse('news_list', 'news_list_block', true);
+	}
+	$template->set_var('PAGE_ID', $section['page_id']);
+	$template->parse('select_list', 'news_select_block', true);
+	$template->clear_var('news_list');
+}
+
+// Parse the template object
+$template->parse('main', 'main_block', false);
+$template->pparse('output', 'page');
+
 ?>
\ No newline at end of file
Index: branches/2.8.x/wb/modules/news/WbLink.php
===================================================================
--- branches/2.8.x/wb/modules/news/WbLink.php	(nonexistent)
+++ branches/2.8.x/wb/modules/news/WbLink.php	(revision 1994)
@@ -0,0 +1,72 @@
+<?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/>.
+ */
+
+/**
+ * WbLink.php
+ *
+ * @category     Addons
+ * @package      Addons_News
+ * @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 04.11.2013
+ * @description  This class implements an interface for the wblink-outputfilter
+ *
+ * @inherited WbDatabase $oDb
+ * @inherited WbAdaptor  $oReg
+ *
+ */
+
+class m_news_WbLink extends WbLinkAbstract
+{
+/**
+ * makeLinkFromTag
+ * @param type $aReplacement
+ * @return string
+ * @description
+ */
+	public function makeLinkFromTag(array $aReplacement)
+	{
+	// set link on failure ('#' means, still stay on current page)
+		$sRetval = '#';
+	// search `link` from posts table and create absolute URL
+		$sql = 'SELECT `link` '
+			 . 'FROM `'.$this->oDb->TablePrefix.'mod_news_posts` '
+			 . 'WHERE `post_id`='.$aReplacement['Args']['item'];
+		if(($sLink = $this->oDb->get_one($sql)))
+		{
+			$sLink = trim(str_replace('\\', '/', $sLink), '/');
+		// test if valid accessfile is available
+			if(is_readable($this->oReg->AppPath.$this->oReg->PagesDir.$sLink.$this->oReg->PageExtension))
+			{
+				$sRetval = $this->oReg->AppUrl.$this->oReg->PagesDir.$sLink.$this->oReg->PageExtension;
+			}
+		}
+		return $sRetval;
+	}
+
+//	public function generateLinkList(Template $oTpl)
+//	{
+//		;
+//	}
+} // end of class m_news_WbLink
