Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1682)
+++ branches/2.8.x/CHANGELOG	(revision 1683)
@@ -12,6 +12,10 @@
 ===============================================================================
 
 03 May-2012 Build 1682 Werner v.d.Decken(DarkViper)
+! changed class Database into a Singleton-Class
+# added forgotten 'static' keyword in ModLanguage
+# removed version control from sm2 - include.php
+03 May-2012 Build 1682 Werner v.d.Decken(DarkViper)
 ! some little corrections ModLanguage/Database/initialize.php
 03 May-2012 Build 1681 Werner v.d.Decken(DarkViper)
 ! reorganisation of default theme of oage-settings
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1682)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1683)
@@ -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', '1682');
+if(!defined('REVISION')) define('REVISION', '1683');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/framework/initialize.php
===================================================================
--- branches/2.8.x/wb/framework/initialize.php	(revision 1682)
+++ branches/2.8.x/wb/framework/initialize.php	(revision 1683)
@@ -91,7 +91,8 @@
 	date_default_timezone_set('UTC');
 	// Create database class
 	$sSqlUrl = DB_TYPE.'://'.DB_USERNAME.':'.DB_PASSWORD.'@'.DB_HOST.'/'.DB_NAME;
-	$database = new Database($sSqlUrl);
+	$database = Database::getInstance();
+	$database->doConnect($sSqlUrl);
 	// disable all kind of magic_quotes
 	if(get_magic_quotes_gpc() || get_magic_quotes_runtime()) {
 		@ini_set('magic_quotes_sybase', 0);
Index: branches/2.8.x/wb/framework/Database.php
===================================================================
--- branches/2.8.x/wb/framework/Database.php	(revision 1682)
+++ branches/2.8.x/wb/framework/Database.php	(revision 1683)
@@ -29,10 +29,31 @@
 /* -------------------------------------------------------- */
 define('DATABASE_CLASS_LOADED', true);
 
-class Database {
 
-//	$sdb = 'mysql://user:password@demo.de:3306/datenbank';
+class Database extends DatabaseX {
+	
+	private static $_oInstance = array();
+/* prevent from public instancing */
+	protected function  __construct() {}
+/* prevent from cloning */
+	private function __clone() {}
+/**
+ * get a valid instance of this class
+ * @param string $sIdentifier selector for several different instances
+ * @return object
+ */
+	public static function getInstance($sIdentifier = 'core') {
+		if( !isset(self::$_oInstance[$sIdentifier])) {
+            $c = __CLASS__;
+            self::$_oInstance[$sIdentifier] = new $c;
+		}
+		return self::$_oInstance[$sIdentifier];
+	}
+}
 
+
+class DatabaseX {
+
 	private $_db_handle = null; // readonly from outside
 	private $_scheme    = 'mysql';
 	private $_hostname  = 'localhost';
@@ -48,9 +69,19 @@
 	private $message    = array();
 	private $iQueryCount= 0;
 
-
-	// Set DB_URL
-	function __construct($url = '') {
+/* prevent from public instancing */
+	protected function __construct() {}
+/* prevent from cloning */
+	private function __clone() {}
+	
+/**
+ * Connect to the database
+ * @param string $url
+ * @return bool
+ *
+ * Example for SQL-Url:  'mysql://user:password@demo.de[:3306]/datenbank'
+ */
+	public function doConnect($url = '') {
 		if($url != '') {
 			$aIni = parse_url($url);
 			$this->_scheme   = isset($aIni['scheme']) ? $aIni['scheme'] : 'mysql';
@@ -63,12 +94,6 @@
 		}else {
 			throw new RuntimeException('Missing parameter: unable to connect database');
 		}
-		// Connect to database
-		$this->connect();
-	}
-	
-	// Connect to the database
-	function connect() {
 		$this->_db_handle = mysql_connect($this->_hostname.$this->_hostport,
 		                                  $this->_username,
 		                                  $this->_password);
Index: branches/2.8.x/wb/framework/ModLanguage.php
===================================================================
--- branches/2.8.x/wb/framework/ModLanguage.php	(revision 1682)
+++ branches/2.8.x/wb/framework/ModLanguage.php	(revision 1683)
@@ -28,7 +28,7 @@
  * get a valid instance of this class
  * @return object
  */
-	public function getInstance() {
+	static public function getInstance() {
 		if( is_null(self::$_oInstance) ) {
             $c = __CLASS__;
             self::$_oInstance = new $c;
Index: branches/2.8.x/wb/modules/show_menu2/include.php
===================================================================
--- branches/2.8.x/wb/modules/show_menu2/include.php	(revision 1682)
+++ branches/2.8.x/wb/modules/show_menu2/include.php	(revision 1683)
@@ -535,13 +535,8 @@
         // is called (i.e. where the database is loaded) then the info won't
         // exist anyhow.
         $fields  = '`parent`,`page_id`,`menu_title`,`page_title`,`link`,`target`,';
-		$fields .= '`level`,`visibility`,`viewing_groups`';
-        if (version_compare(WB_VERSION, '2.7', '>=')) { // WB 2.7+
-            $fields .= ',`viewing_users`';
-        }
-		if(version_compare(WB_VERSION, '2.8.4', '>=')) {
-            $fields .= ',`menu_icon_0`,`menu_icon_1`,`page_icon`,`tooltip`';
-		}
+		$fields .= '`level`,`visibility`,`viewing_groups`,`viewing_users`,';
+		$fields .= '`menu_icon_0`,`menu_icon_1`,`page_icon`,`tooltip`';
         if ($flags & SM2_ALLINFO) {
             $fields = '*';
         }
