Project

General

Profile

« Previous | Next » 

Revision 1972

Added by Dietmar over 10 years ago

  1. 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

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
03 Oct-2013 Build 1972 Dietmar Woellbrink (Luisehahne)
15
# bugfix pages/settings_save.php sql strict
16
! update fix pages/settings.php page code list
17
  deactivate hidden and none visibility for first default_language sub
14 18
01 Oct-2013 Build 1971 Dietmar Woellbrink (Luisehahne)
15 19
! Finished Pages settings output page_code treelist
16 20
01 Oct-2013 Build 1970 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/pages/SmallRawPageTree.php
26 26
 * @author       Manuela v.d.Decken <manuela@isteam.de>
27 27
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
28 28
 * @version      0.0.1
29
 * @revision     $Revision: $
30
 * @link         $HeadURL: $
31
 * @lastmodified $Date: $
29
 * @revision     $Revision$
30
 * @link         $HeadURL$
31
 * @lastmodified $Date$
32 32
 * @since        File available since 05.08.2013
33 33
 * @description  xyz
34 34
 */
35 35

  
branches/2.8.x/wb/admin/pages/settings.php
125 125
		$admin->print_header();
126 126
		$admin->print_error($MESSAGE['PAGES_NOT_FOUND']);
127 127
	}
128
/* -------------------------------------------------------------------------------------*/
129

  
130
/*-- test if multilanguage page_code -----------------------------------------------------*/
131
    function getLangInUsedDbResult ( $sLangKey='' ) {
132
    global $admin,$aCurrentPage;
133
    	$aPage = array();
134
    	$aRetval = array();
135
    	$oDb = WbDatabase::getInstance();
136
    	if( (defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) && class_exists('m_MultiLingual_Lib'))
137
    	{
138
    		$sql = 'SELECT DISTINCT `language`,'
139
    		     .                 '`page_id`,`level`,`parent`,`root_parent`,`page_code`,`link`,'
140
    		     .                 '`visibility`,`viewing_groups`,`viewing_users`,`position`,`page_title` '
141
                 . 'FROM `'.$oDb->TablePrefix.'pages` '
142
                 . 'WHERE `level`= 0 '
143
                 .   'AND `root_parent`=`page_id` '
144
                 .   'AND (`visibility`!=\'none\' '
145
                 .   'AND `visibility`!=\'hidden\') '
146
                 .   ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\' ' : '')
147
//                 .   ( (defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == 'true') ? ' AND `menu` = \''.$aCurrentPage['menu'].'\' ' : '')
148
                 .   'GROUP BY `language` '
149
                 .   'ORDER BY `position`';
150
        	if($oRes = $oDb->query($sql)){
151
        		while($aPage = $oRes->fetchRow(MYSQL_ASSOC))
152
        		{
153
        			if(!$admin->page_is_visible($aPage)) {continue;}
154
        			$aRetval[$aPage['language']] = $aPage;
155
        		}
156
            }
157
    	}
158
        return ( sizeof($aRetval) ? $aRetval : false);
159
    }
160
/* -------------------------------------------------------------------------------------*/
128 161
// Get display name of person who last modified the page
129 162
	$user=$admin->get_user_details($aCurrentPage['modified_by']);
130 163
// Convert the unix ts for modified_when to human a readable form
......
277 310
	}
278 311
/*-- show visibility select box --------------------------------------------------------*/
279 312
	$aVisibility = array();
313
    $sLangKey = '';
314
    if( sizeof(getLangInUsedDbResult())>1 ) {
315
        $sLangKey = DEFAULT_LANGUAGE;
316
    	$aLangStartPageId = array();
317
        $aLangStartPageId = getLangInUsedDbResult($sLangKey);
318
        $iLangStartPageId = $aLangStartPageId[$sLangKey]['page_id'];
319
    }
320

  
280 321
	$aVisibility['PUBLIC_SELECTED']     = ($aCurrentPage['visibility'] == 'public' ? $sSelected : '');
281 322
	$aVisibility['PRIVATE_SELECTED']    = ($aCurrentPage['visibility'] == 'private' ? $sSelected : '');
282 323
	$aVisibility['REGISTERED_SELECTED'] = ($aCurrentPage['visibility'] == 'registered' ? $sSelected : '');
283 324
	$aVisibility['HIDDEN_SELECTED']     = ($aCurrentPage['visibility'] == 'hidden' ? $sSelected : '');
284 325
	$aVisibility['NO_VIS_SELECTED']     = ($aCurrentPage['visibility'] == 'none' ? $sSelected : '');
326
    if( ($aCurrentPage['language'] == $sLangKey) && ($aCurrentPage['page_id']==$iLangStartPageId) ) {
327
    	$aVisibility['HIDDEN_SELECTED'] = ($aCurrentPage['visibility'] == 'hidden' ? $sDisabled : $sDisabled);
328
    	$aVisibility['NO_VIS_SELECTED'] = ($aCurrentPage['visibility'] == 'none' ? $sDisabled : $sDisabled);
329
    }
285 330
	$oTpl->set_var($aVisibility);
286

  
287 331
/*-- admin group list block ------------------------------------------------------------*/
288 332
	$aAdminGroups = explode(',', '1,'.$aCurrentPage['admin_groups']);
289 333
	$sAdminGroups = implode(',', array_unique($aAdminGroups));
......
419 463
		$oTpl->set_var('DISPLAY_VIEWERS', 'display:none;');
420 464
	}
421 465
/*-- start multilanguage page_code -----------------------------------------------------*/
466
//    $sLangKey='';
422 467
	$oTpl->set_block('main_block', 'show_page_code_block',  'show_page_code');
423 468
	if( (defined('PAGE_LANGUAGES') && PAGE_LANGUAGES) &&
424
		 isset($aCurrentPage['page_code']) && class_exists('m_MultiLingual_Lib'))
469
		 isset($aCurrentPage['page_code']) && sizeof(getLangInUsedDbResult())>1 )
425 470
	{
426 471
		$aTplBlockData = array();
427 472
	// workout field is set but module missing
428 473
		$aTplBlockData['PAGE_CODE_LABEL_TEXT'] = $mLang->TEXT_PAGE_CODE;
429 474
		$aTplBlockData['PAGE_CODE_UPDATE_URL'] = WB_REL.'/modules/MultiLingual/update_keys.php?page_id='.$page_id;
430
	// get the root element(level 0) of current page with same language  in same menu
431
//		$sql =  'SELECT `page_id` FROM `'.$oDb->TablePrefix.'pages` '
432
//		     .  'WHERE `language`=\''.DEFAULT_LANGUAGE.'\' '
433
//		     .         'AND `level`=0 ';
434
//		if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == 'true') {
435
////			$sql .=    'AND `menu`='.$aCurrentPage['menu'].' ';
436
//		}
437
//		$sql .= 'ORDER BY `position` ASC';
438
        $sLangKey = DEFAULT_LANGUAGE;
439
        $sql = 'SELECT DISTINCT `page_id` '
440
             . 'FROM `'.$oDb->TablePrefix.'pages` '
441
             . 'WHERE `level`= \'0\' '
442
             .   'AND `root_parent`=`page_id` '
443
             .   'AND `visibility`!=\'none\' '
444
             .   'AND `visibility`!=\'hidden\' '
445
             .   ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\'' : '')
446
             .   'GROUP BY `language` '
447
             .   'ORDER BY `position`';
448
		$iLangStartPageId = $oDb->get_one($sql);
449 475
	// read the tree of the found root element
450 476
		$oPageList = new a_pages_SmallRawPageTree();
451 477
		$aLangCodePagesList = $oPageList->getParentList($iLangStartPageId);
branches/2.8.x/wb/admin/pages/settings_save.php
278 278
// Update page settings in the pages table
279 279
$sql = 'UPDATE `'.TABLE_PREFIX.'pages` '
280 280
	 . 'SET `parent`='.$parent.', '
281
	 .     '`page_title`=\''.$page_title.'\', '
282
	 .     '`tooltip`=\''.$page_title.'\', '
281
	 .     '`page_title`=\''.$database->escapeString($page_title).'\', '
282
	 .     '`tooltip`=\''.$database->escapeString($page_title).'\', '
283 283
	 .     '`page_icon` =\''.$database->escapeString($sPageIcon).'\', '
284 284
	 .     '`menu_title`=\''.$database->escapeString($menu_title).'\', '
285 285
	 .     '`menu_icon_0` =\''.$database->escapeString($sMenuIcon0).'\', '
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1971');
54
if(!defined('REVISION')) define('REVISION', '1972');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/modules/MultiLingual/Lib.php
98 98
		     . 'FROM `'.$this->_oReg->TablePrefix.'pages` '
99 99
		     . 'WHERE `level`= \'0\' '
100 100
		     .   'AND `root_parent`=`page_id` '
101
		     .   'AND `visibility`!=\'none\' '
102
		     .   'AND `visibility`!=\'hidden\' '
101
		     .   'AND (`visibility`!=\'none\' '
102
		     .   'AND `visibility`!=\'hidden\') '
103 103
		     .   ( ($sLangKey!='') ? ' AND `language` = \''.$sLangKey.'\'' : '')
104 104
		     .   'GROUP BY `language` '
105 105
		     .   'ORDER BY `position`';

Also available in: Unified diff