Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1971)
+++ branches/2.8.x/CHANGELOG	(revision 1972)
@@ -11,6 +11,10 @@
 ! = Update/Change
 ===============================================================================
 
+03 Oct-2013 Build 1972 Dietmar Woellbrink (Luisehahne)
+# bugfix pages/settings_save.php sql strict
+! update fix pages/settings.php page code list
+  deactivate hidden and none visibility for first default_language sub
 01 Oct-2013 Build 1971 Dietmar Woellbrink (Luisehahne)
 ! Finished Pages settings output page_code treelist
 01 Oct-2013 Build 1970 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/pages/SmallRawPageTree.php
===================================================================
--- branches/2.8.x/wb/admin/pages/SmallRawPageTree.php	(revision 1971)
+++ branches/2.8.x/wb/admin/pages/SmallRawPageTree.php	(revision 1972)
@@ -26,9 +26,9 @@
  * @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: $
+ * @revision     $Revision$
+ * @link         $HeadURL$
+ * @lastmodified $Date$
  * @since        File available since 05.08.2013
  * @description  xyz
  */

Property changes on: branches/2.8.x/wb/admin/pages/SmallRawPageTree.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Revision Id HeadURL
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: branches/2.8.x/wb/admin/pages/settings.php
===================================================================
--- branches/2.8.x/wb/admin/pages/settings.php	(revision 1971)
+++ branches/2.8.x/wb/admin/pages/settings.php	(revision 1972)
@@ -125,6 +125,39 @@
 		$admin->print_header();
 		$admin->print_error($MESSAGE['PAGES_NOT_FOUND']);
 	}
+/* -------------------------------------------------------------------------------------*/
+
+/*-- test if multilanguage page_code -----------------------------------------------------*/
+    function getLangInUsedDbResult ( $sLangKey='' ) {
+    global $admin,$aCurrentPage;
+    	$aPage = array();
+    	$aRetval = array();
+    	$oDb = WbDatabase::getInstance();
+    	if( (defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) && class_exists('m_MultiLingual_Lib'))
+    	{
+    		$sql = 'SELECT DISTINCT `language`,'
+    		     .                 '`page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,'
+    		     .                 '`visibility`,`viewing_groups`,`viewing_users`,`position`,`page_title` '
+                 . 'FROM `'.$oDb->TablePrefix.'pages` '
+                 . 'WHERE `level`= 0 '
+                 .   'AND `root_parent`=`page_id` '
+                 .   'AND (`visibility`!=\'none\' '
+                 .   'AND `visibility`!=\'hidden\') '
+                 .   ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\' ' : '')
+//                 .   ( (defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == 'true') ? ' AND `menu` = \''.$aCurrentPage['menu'].'\' ' : '')
+                 .   'GROUP BY `language` '
+                 .   'ORDER BY `position`';
+        	if($oRes = $oDb->query($sql)){
+        		while($aPage = $oRes->fetchRow(MYSQL_ASSOC))
+        		{
+        			if(!$admin->page_is_visible($aPage)) {continue;}
+        			$aRetval[$aPage['language']] = $aPage;
+        		}
+            }
+    	}
+        return ( sizeof($aRetval) ? $aRetval : false);
+    }
+/* -------------------------------------------------------------------------------------*/
 // Get display name of person who last modified the page
 	$user=$admin->get_user_details($aCurrentPage['modified_by']);
 // Convert the unix ts for modified_when to human a readable form
@@ -277,13 +310,24 @@
 	}
 /*-- show visibility select box --------------------------------------------------------*/
 	$aVisibility = array();
+    $sLangKey = '';
+    if( sizeof(getLangInUsedDbResult())>1 ) {
+        $sLangKey = DEFAULT_LANGUAGE;
+    	$aLangStartPageId = array();
+        $aLangStartPageId = getLangInUsedDbResult($sLangKey);
+        $iLangStartPageId = $aLangStartPageId[$sLangKey]['page_id'];
+    }
+
 	$aVisibility['PUBLIC_SELECTED']     = ($aCurrentPage['visibility'] == 'public' ? $sSelected : '');
 	$aVisibility['PRIVATE_SELECTED']    = ($aCurrentPage['visibility'] == 'private' ? $sSelected : '');
 	$aVisibility['REGISTERED_SELECTED'] = ($aCurrentPage['visibility'] == 'registered' ? $sSelected : '');
 	$aVisibility['HIDDEN_SELECTED']     = ($aCurrentPage['visibility'] == 'hidden' ? $sSelected : '');
 	$aVisibility['NO_VIS_SELECTED']     = ($aCurrentPage['visibility'] == 'none' ? $sSelected : '');
+    if( ($aCurrentPage['language'] == $sLangKey) && ($aCurrentPage['page_id']==$iLangStartPageId) ) {
+    	$aVisibility['HIDDEN_SELECTED'] = ($aCurrentPage['visibility'] == 'hidden' ? $sDisabled : $sDisabled);
+    	$aVisibility['NO_VIS_SELECTED'] = ($aCurrentPage['visibility'] == 'none' ? $sDisabled : $sDisabled);
+    }
 	$oTpl->set_var($aVisibility);
-
 /*-- admin group list block ------------------------------------------------------------*/
 	$aAdminGroups = explode(',', '1,'.$aCurrentPage['admin_groups']);
 	$sAdminGroups = implode(',', array_unique($aAdminGroups));
@@ -419,33 +463,15 @@
 		$oTpl->set_var('DISPLAY_VIEWERS', 'display:none;');
 	}
 /*-- start multilanguage page_code -----------------------------------------------------*/
+//    $sLangKey='';
 	$oTpl->set_block('main_block', 'show_page_code_block',  'show_page_code');
 	if( (defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) &&
-		 isset($aCurrentPage['page_code']) && class_exists('m_MultiLingual_Lib'))
+		 isset($aCurrentPage['page_code']) && sizeof(getLangInUsedDbResult())>1 )
 	{
 		$aTplBlockData = array();
 	// workout field is set but module missing
 		$aTplBlockData['PAGE_CODE_LABEL_TEXT'] = $mLang->TEXT_PAGE_CODE;
 		$aTplBlockData['PAGE_CODE_UPDATE_URL'] = WB_REL.'/modules/MultiLingual/update_keys.php?page_id='.$page_id;
-	// get the root element(level 0) of current page with same language  in same menu
-//		$sql =  'SELECT `page_id` FROM `'.$oDb->TablePrefix.'pages` '
-//		     .  'WHERE `language`=\''.DEFAULT_LANGUAGE.'\' '
-//		     .         'AND `level`=0 ';
-//		if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == 'true') {
-////			$sql .=    'AND `menu`='.$aCurrentPage['menu'].' ';
-//		}
-//		$sql .= 'ORDER BY `position` ASC';
-        $sLangKey = DEFAULT_LANGUAGE;
-        $sql = 'SELECT DISTINCT `page_id` '
-             . 'FROM `'.$oDb->TablePrefix.'pages` '
-             . 'WHERE `level`= \'0\' '
-             .   'AND `root_parent`=`page_id` '
-             .   'AND `visibility`!=\'none\' '
-             .   'AND `visibility`!=\'hidden\' '
-             .   ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\'' : '')
-             .   'GROUP BY `language` '
-             .   'ORDER BY `position`';
-		$iLangStartPageId = $oDb->get_one($sql);
 	// read the tree of the found root element
 		$oPageList = new a_pages_SmallRawPageTree();
 		$aLangCodePagesList = $oPageList->getParentList($iLangStartPageId);
Index: branches/2.8.x/wb/admin/pages/settings_save.php
===================================================================
--- branches/2.8.x/wb/admin/pages/settings_save.php	(revision 1971)
+++ branches/2.8.x/wb/admin/pages/settings_save.php	(revision 1972)
@@ -278,8 +278,8 @@
 // Update page settings in the pages table
 $sql = 'UPDATE `'.TABLE_PREFIX.'pages` '
 	 . 'SET `parent`='.$parent.', '
-	 .     '`page_title`=\''.$page_title.'\', '
-	 .     '`tooltip`=\''.$page_title.'\', '
+	 .     '`page_title`=\''.$database->escapeString($page_title).'\', '
+	 .     '`tooltip`=\''.$database->escapeString($page_title).'\', '
 	 .     '`page_icon` =\''.$database->escapeString($sPageIcon).'\', '
 	 .     '`menu_title`=\''.$database->escapeString($menu_title).'\', '
 	 .     '`menu_icon_0` =\''.$database->escapeString($sMenuIcon0).'\', '
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1971)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1972)
@@ -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', '1971');
+if(!defined('REVISION')) define('REVISION', '1972');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/MultiLingual/Lib.php
===================================================================
--- branches/2.8.x/wb/modules/MultiLingual/Lib.php	(revision 1971)
+++ branches/2.8.x/wb/modules/MultiLingual/Lib.php	(revision 1972)
@@ -98,8 +98,8 @@
 		     . 'FROM `'.$this->_oReg->TablePrefix.'pages` '
 		     . 'WHERE `level`= \'0\' '
 		     .   'AND `root_parent`=`page_id` '
-		     .   'AND `visibility`!=\'none\' '
-		     .   'AND `visibility`!=\'hidden\' '
+		     .   'AND (`visibility`!=\'none\' '
+		     .   'AND `visibility`!=\'hidden\') '
 		     .   ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\'' : '')
 		     .   'GROUP BY `language` '
 		     .   'ORDER BY `position`';
