Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1647)
+++ branches/2.8.x/CHANGELOG	(revision 1648)
@@ -11,6 +11,10 @@
 ! = Update/Change
 ===============================================================================
 
+24 Mar-2012 Build 1648 Werner v.d.Decken(DarkViper)
+# a litte fix in /admin/addons/index.php.
++ added unregister_Theme to CopyTheme::_doRollback()
++ added CopyTheme::_activateTheme()
 23 Mar-2012 Build 1647 Werner v.d.Decken(DarkViper)
 + add additional exeptionhandling in globalExceptionHandler
 23 Mar-2012 Build 1646 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/skel/themes/htt/addons.htt
===================================================================
--- branches/2.8.x/wb/admin/skel/themes/htt/addons.htt	(revision 1647)
+++ branches/2.8.x/wb/admin/skel/themes/htt/addons.htt	(revision 1648)
@@ -54,6 +54,7 @@
 					<tr>
 						<td class="description" valign="top"><span class="title">{TXT_THEME_COPY_CURRENT}</span>
 							{TXT_THEME_CURRENT}: {CURRENT_THEME}<br />
+							<i>[{THEME_PATH}]</i><br />
 							{MESSAGE_THEME_COPY_CURRENT}
 							<br style="margin-bottom: 0.5em" />
 							<input type="text" id="theme_newname" name="ThNewTheme" value="{THEME_DEFAULT_NAME}" />
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1647)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1648)
@@ -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', '1647');
+if(!defined('REVISION')) define('REVISION', '1648');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/admin/addons/CopyTheme.php
===================================================================
--- branches/2.8.x/wb/admin/addons/CopyTheme.php	(revision 1647)
+++ branches/2.8.x/wb/admin/addons/CopyTheme.php	(revision 1648)
@@ -38,6 +38,9 @@
 		$this->_aLang = $GLOBALS['MESSAGE'];
 	// import global Consts
 		$this->_aGlobals['TablePrefix']     = TABLE_PREFIX;
+		$this->_aGlobals['AddonTable']      = 'addons';
+		$this->_aGlobals['SettingsTable']   = 'settings';
+
 		$this->_aGlobals['Debug']           = (defined('DEBUG') && DEBUG === true);
 		$this->_aGlobals['IsLinux']         = ((substr(__FILE__, 0, 1)) == '/');
 		$this->_aGlobals['StringDirMode']   = STRING_DIR_MODE;
@@ -62,7 +65,9 @@
 		if($this->_copyTree()) {
 			if($this->_modifyInfoFile()) {
 				if($this->_registerNewTheme()) {
-					return true;
+					if($this->_activateTheme()) {
+						return true;
+					}
 				}
 			}
 		}
@@ -96,7 +101,8 @@
 		$iCount = '';
 		do {
 			$sSearch = $sName.($iCount ? ' '.$iCount : '');
-			$sql = 'SELECT COUNT(*) FROM `'.$this->_aGlobals['TablePrefix'].'addons` '
+			$sql = 'SELECT COUNT(*) '
+			     . 'FROM `'.$this->_aGlobals['TablePrefix'].$this->_aGlobals['AddonTable'].'` '
 				 . 'WHERE LOWER(`name`)=\''.strtolower($sSearch).'\' AND `function`=\'theme\'';
 			$exists = $this->_oDb->get_one($sql);
 			$iCount = (int)$iCount + 1;
@@ -118,7 +124,8 @@
 		$iCount = '';
 		do {
 			$sSearch = $sName.($iCount ? '_'.$iCount : '');
-			$sql = 'SELECT COUNT(*) FROM `'.$this->_aGlobals['TablePrefix'].'addons` '
+			$sql = 'SELECT COUNT(*) '
+			     . 'FROM `'.$this->_aGlobals['TablePrefix'].$this->_aGlobals['AddonTable'].'` '
 				 . 'WHERE `directory`=\''.$sSearch.'\' AND `function`=\'theme\'';
 			$exists = $this->_oDb->get_one($sql);
 			$iCount = (int)$iCount + 1;
@@ -231,7 +238,7 @@
 		$bRetval = true;
 		$sThemeInfoFile = $this->_sThemesBasePath.'/'.$this->_sNewThemeDir.'/info.php';
 		$aVariables = $this->_getThemeInfo($sThemeInfoFile);
-		$sql = 'INSERT INTO `'.$this->_aGlobals['TablePrefix'].'addons` '
+		$sql = 'INSERT INTO `'.$this->_aGlobals['TablePrefix'].$this->_aGlobals['AddonTable'].'` '
 		     . 'SET `type`=\'template\', '
 		     .     '`function`=\'theme\', '
 		     .     '`directory`=\''.$aVariables['directory'].'\', '
@@ -312,6 +319,25 @@
 		}
 	}
 /**
+ * activates the new theme
+ * @return boolean
+ */
+	private function _activateTheme()
+	{
+		$bRetval = true;
+		if(!db_update_key_value( $this->_aGlobals['SettingsTable'],
+		                         'default_theme',
+		                         $value = $this->_sNewThemeDir))
+		{
+			$sMsg = 'CopyTheme::activateTheme('.$this->_sNewThemeName.') >> '
+			        .$this->_aLang['GENERIC_NOT_UPGRADED'];
+			$sMsg .= (($this->_aGlobals['Debug']) ? '<br />'.$this->_oDb->get_error() : '');
+			$this->_setError($sMsg);
+			$bRetval = false;
+		}
+		return $bRetval;
+	}
+/**
  * on Error undo all already done copy/create actions
  * @param string $dir
  */
@@ -331,6 +357,9 @@
 		unset($path);
 		unset($iterator);
 		if(file_exists($dir)) { rmdir($dir); }
+		$sql = 'DELETE FROM `'.$this->_aGlobals['TablePrefix'].$this->_aGlobals['AddonTable'].'` '
+		     . 'WHERE `directory`=\''.$this->_sNewThemeDir.'\' AND `function`=\'theme\'';
+		$this->_oDb->query($sql);
 	}
 /**
  * add a new error message to the queue
Index: branches/2.8.x/wb/admin/addons/index.php
===================================================================
--- branches/2.8.x/wb/admin/addons/index.php	(revision 1647)
+++ branches/2.8.x/wb/admin/addons/index.php	(revision 1648)
@@ -106,10 +106,11 @@
 		 . 'WHERE `directory`=\''.DEFAULT_THEME.'\' AND `function`=\'theme\'';
 	$tmp = $database->get_one($sql);
 	$template->set_var('THEME_DEFAULT_NAME', $tmp);
+	$template->set_var('THEME_PATH', THEME_PATH);
 // end copy current theme
 // start template import
 	include(dirname(__FILE__).'/CopyThemeHtt.php');
-	$aTplList = CopyThemeHtt::getDivList(ADMIN_PATH.'/themes/templates',
+	$aTplList = CopyThemeHtt::getDivList(ADMIN_PATH.'/skel/themes/htt',
 	                                     THEME_PATH.'/templates', 'htt');
 	$sOptionList = '';
 	if(sizeof($aTplList)) {
