Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1989)
+++ branches/2.8.x/CHANGELOG	(revision 1990)
@@ -11,6 +11,11 @@
 ! = Update/Change
 ===============================================================================
 
+19 Oct-2013 Build 1990 Manuela v.d.Decken(DarkViper)
++ /framework/ModuleReorgAbstract  provides the basics for modul depending reorganisation classes
+! /modules/news/Reorg  now extends ModuleReorgAbstract
+#                      problem with empty directories fixed
+! /modules/news/upgrade.php // rebuild all access files fixed
 19 Oct-2013 Build 1989 Dietmar Woellbrink (Luisehahne)
 # bugfix /admin/start/index.php::undefined function replace_vars()
 19 Oct-2013 Build 1988 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1989)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1990)
@@ -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', '1989');
+if(!defined('REVISION')) define('REVISION', '1990');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/ModuleReorgAbstract.php
===================================================================
--- branches/2.8.x/wb/framework/ModuleReorgAbstract.php	(nonexistent)
+++ branches/2.8.x/wb/framework/ModuleReorgAbstract.php	(revision 1990)
@@ -0,0 +1,76 @@
+<?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/>.
+ */
+
+/**
+ * ModuleReorgAbstract.php
+ *
+ * @category     Core
+ * @package      Core_ModuleInterface
+ * @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 19.10.2013
+ * @description  This class provides the basics for modul depending reorganisation classes
+ */
+abstract class ModuleReorgAbstract {
+
+/** registry object */
+	protected $oReg = null;
+/** database object */
+	protected $oDb  = null;
+/** collector of return values */
+	protected $aReport = null;
+/** set kind of return values */
+	protected $bDetailedLog = false;
+
+/** show minimal log entries */
+	const LOG_SHORT    = 0;
+/** show extended log entries */
+	const LOG_EXTENDED = 1;
+
+/**
+ * execute reorganisation
+ * @return boolean
+ */
+	abstract public function execute();
+
+/**
+ * constructor
+ * @param int $bDetailedLog  can be LOG_EXTENDED or LOG_SHORT
+ */
+	public function __construct($bDetailedLog = self::LOG_SHORT) {
+		$this->bDetailedLog = (bool)($bDetailedLog & self::LOG_EXTENDED);
+		$this->oDb          = WbDatabase::getInstance();
+		$this->oReg         = WbAdaptor::getInstance();
+	}
+/**
+ * getReport
+ * @return array
+ * @description a report about the whoole reorganisation<br />
+ */
+	public function getReport()
+	{
+		return $this->aReport;
+	}
+
+} // end of class ModuleReorgAbstract
Index: branches/2.8.x/wb/modules/news/Reorg.php
===================================================================
--- branches/2.8.x/wb/modules/news/Reorg.php	(revision 1989)
+++ branches/2.8.x/wb/modules/news/Reorg.php	(revision 1990)
@@ -32,12 +32,9 @@
  * @since        File available since 15.10.2013
  * @description  reorganisize all accessfiles of the addon 'news'
  */
-class m_news_Reorg {
 
-/** registry object */
-	protected $oReg = null;
-/** database object */
-	protected $oDb  = null;
+class m_news_Reorg extends ModuleReorgAbstract{
+
 /** root directory for accessfiles */
 	protected $sAccessFilesRoot = '';
 /** sub directory for accessfiles
@@ -46,39 +43,28 @@
  *               without a hardcoded subdirectory name.
  */
 	protected $sAccessFilesSubdir = 'posts/';
-/** collector of return values */
-	protected $aReport = null;
-/** set kind of return values */
-	protected $bDetailedLog = false;
 
-/** show extended log entries */
-	const LOG_EXTENDED = true;
-/** show minimal log entries */
-	const LOG_SHORT    = false;
-
 /**
- * constructor
- * @param int $bDetailedLog  can be LOG_EXTENDED or LOG_SHORT
- */
-	public function __construct($bDetailedLog = self::LOG_SHORT)
-	{
-		$this->bDetailedLog     = $bDetailedLog;
-		$this->oDb              = WbDatabase::getInstance();
-		$this->oReg             = WbAdaptor::getInstance();
-		$this->sAccessFilesRoot = $this->oReg->AppPath.$this->oReg->PagesDir.$this->sAccessFilesSubdir;
-	}
-/**
  * execute reorganisation
  * @return boolean
  */
 	public function execute()
 	{
-	// reset areport
+/**
+ * @description Structure of report array.<br />
+ *              (int) number of 'FilesDeleted'<br />
+ *              (int) number of 'FilesCreated'<br />
+ *              (array) 'Success'<br />
+ *              (array) 'Failed'
+ */
+	// reset report
 		$this->aReport = array( 'FilesDeleted'=>0,
 		                        'FilesCreated'=>0,
 		                        'Success'=>array(),
 		                        'Failed'=>array()
 		                      );
+	// build AccessFilesRoot
+		$this->sAccessFilesRoot = $this->oReg->AppPath.$this->oReg->PagesDir.$this->sAccessFilesSubdir;
 	// delete old accessfiles
 		$this->deleteAll();
 	// recreate new accessfiles
@@ -87,20 +73,6 @@
 		return (sizeof($this->aReport['Failed']) == 0);
 	}
 /**
- * getReport
- * @return array
- * @description a report about the whoole reorganisation<br />
- *              returns an array including<br />
- *              (int) number of 'FilesDeleted'<br />
- *              (int) number of 'FilesCreated'<br />
- *              (array) 'Success'<br />
- *              (array) 'Failed'
- */
-	public function getReport()
-	{
-		return $this->aReport;
-	}
-/**
  * deleteAll
  * @throws AccessFileException
  * @description delete all accessfiles and its children in $sAccessFilesRoot
@@ -108,29 +80,36 @@
 	protected function deleteAll()
 	{
 	// scan start directory for access files
-		foreach (glob($this->sAccessFilesRoot . '*'.$this->oReg->PageExtension, GLOB_MARK) as $sItem)
+		$aMatches = glob($this->sAccessFilesRoot . '*'.$this->oReg->PageExtension);
+		if(is_array($aMatches))
 		{
-		// sanitize itempath
-            $sItem = str_replace('\\', '/', $sItem);
-			if(AccessFileHelper::isAccessFile($sItem))
+			foreach($aFileList as $sItem)
 			{
-			// delete accessfiles only
-				if(is_writable($sItem) && @unlink($sItem))
+			// sanitize itempath
+				$sItem = str_replace('\\', '/', $sItem);
+				if(AccessFileHelper::isAccessFile($sItem))
 				{
-				// if file is successful deleted
-					if($this->bDetailedLog)
+				// delete accessfiles only
+					if(is_writable($sItem) && @unlink($sItem))
 					{
-						$this->aReport['Success'][] = 'File successful removed : '.str_replace($this->oReg->AppPath, '', $sItem);
+					// if file is successful deleted
+						if($this->bDetailedLog)
+						{
+							$this->aReport['Success'][] = 'File successful removed : '.str_replace($this->oReg->AppPath, '', $sItem);
+						}
+					// increment successful counter
+						$this->aReport['FilesDeleted']++;
+					}else
+					{
+					// if failed
+						$this->aReport['Failed'][] = 'Delete file failed : '.str_replace($this->oReg->AppPath, '', $sItem);
 					}
-				// increment successful counter
-					$this->aReport['FilesDeleted']++;
-				}else
-				{
-				// if failed
-					$this->aReport['Failed'][] = 'Delete file failed : '.str_replace($this->oReg->AppPath, '', $sItem);
-				}
-			} // endif
-		} // endforeach
+				} // endif
+			} // endforeach
+		}else
+		{
+			$this->aReport['Failed'][] = 'Directory scan failed : '.str_replace($this->oReg->AppPath, '', $this->sAccessFilesRoot);
+		}
 	} // end of function deleteAll()
 /**
  * rebuildAll
Index: branches/2.8.x/wb/modules/news/upgrade.php
===================================================================
--- branches/2.8.x/wb/modules/news/upgrade.php	(revision 1989)
+++ branches/2.8.x/wb/modules/news/upgrade.php	(revision 1990)
@@ -179,24 +179,24 @@
 	}
 // ************************************************
 // Check the validity of 'create-file-timestamp' and balance against 'posted-timestamp'
-			$sql  = 'UPDATE `'.$database->TablePrefix.'mod_news_posts` ';
-			$sql .= 'SET `created_when`=`published_when` ';
-			$sql .= 'WHERE `published_when`<`created_when`';
+			$sql = 'UPDATE `'.$database->TablePrefix.'mod_news_posts` '
+			     . 'SET `created_when`=`published_when` '
+			     . 'WHERE `published_when`<`created_when`';
 			$database->query($sql);
-			$sql  = 'UPDATE `'.$database->TablePrefix.'mod_news_posts` ';
-			$sql .= 'SET `created_when`=`posted_when` ';
-			$sql .= 'WHERE `published_when`=0 OR `published_when`>`posted_when`';
+			$sql = 'UPDATE `'.$database->TablePrefix.'mod_news_posts` '
+			     . 'SET `created_when`=`posted_when` '
+			     . 'WHERE `published_when`=0 OR `published_when`>`posted_when`';
 			$database->query($sql);
 // ************************************************
+// rebuild all access files
 			$aReport = array('FilesDeleted'=>0,'FilesCreated'=>0,);
-        	$sModulReorg = 'm_news_Reorg';
-        	if( !$globalStarted && class_exists($sModulReorg) ) {
-        		$oReorg = new $sModulReorg($sModulReorg::LOG_EXTENDED);
-				$aReturnMsg = $oReorg->execute(); // show details
+        	if( !$globalStarted && class_exists('m_news_Reorg') ) {
+        		$oReorg = new m_news_Reorg(ModuleReorgAbstract::LOG_EXTENDED);
+				$oReorg->execute(); // show details
                 $aReport = $oReorg->getReport();
                 unset($oReorg);
         	}
-
+// ************************************************
 			// only for upgrade-script
 			if($globalStarted) {
 				if($bDebug) {
