Project

General

Profile

« Previous | Next » 

Revision 2098

Added by darkviper over 10 years ago

! activate class Translate for all addons in admin/ (except pages/)
! class.admin >> add translation of the current theme to Translate

View differences:

index.php
24 24
    	require($config_file);
25 25
    }
26 26
}
27
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); }
28

  
29 27
if(isset($_GET['advanced']) && $_GET['advanced'] == 'yes') {
30 28
	$admin = new admin('Settings', 'settings_advanced');
31 29
} else {
32 30
	$admin = new admin('Settings', 'settings_basic');
33 31
}
32
$oDb = WbDatabase::getInstance();
33
$oTrans = Translate::getInstance();
34
$oTrans->enableAddon('admin\\settings');
34 35

  
35 36
// add new values, later in upgrade-script
36 37
$cfg = array(
37
	'wbmail_signature' => defined('WBMAIL_SIGNATURE') ? WBMAIL_SIGNATURE : '',
38
	'wbmail_signature'       => (defined('WBMAIL_SIGNATURE') ? WBMAIL_SIGNATURE : ''),
38 39
	'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0'),
39
	'page_extendet' => (defined('PAGE_EXTENDET') ? PAGE_EXTENDET : 'true'),
40
	);
40
	'page_extendet'          => (defined('PAGE_EXTENDET') ? PAGE_EXTENDET : 'true'),
41
);
41 42
db_update_key_value( 'settings', $cfg );
42 43

  
43 44
// Include the WB functions file
......
55 56
$oTpl->set_file('page',  'settings.htt');
56 57
$oTpl->set_block('page', 'main_block', 'main');
57 58

  
58
//$mLang = ModLanguage::getInstance();
59
//$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
60
$mLang = Translate::getInstance();
61
$mLang->enableAddon('admin\settings');
62 59
/*-- insert all needed vars from language files ----------------------------------------*/
63
$oTpl->set_var($mLang->getLangArray());
60
$oTpl->set_var($oTrans->getLangArray());
64 61

  
65 62
$oTpl->set_var('FTAN', $admin->getFTAN());
66 63

  
67 64
// Query current settings in the db, then loop through them and print them
68
$query = "SELECT * FROM `".TABLE_PREFIX."settings`";
69
if($results = $database->query($query)) {
65
$sql = 'SELECT * FROM `'.$oDb->TablePrefix.'settings`';
66
if (($results = $oDb->doQuery($sql))) {
70 67
    while($setting = $results->fetchRow(MYSQL_ASSOC)) {
71 68
    	$setting_name = $setting['name'];
72 69
    	$setting_value = ( $setting_name != 'wbmailer_smtp_password' ) ? htmlspecialchars($setting['value']) : htmlentities($setting['value'], ENT_COMPAT, 'UTF-8');
......
82 79
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
83 80
    	$oTpl->set_var('BASIC_FILE_PERMS_ID', 'hide');
84 81
    	$oTpl->set_var('ADVANCED', 'yes');
85
    	$oTpl->set_var('ADVANCED_BUTTON', '<< '.$mLang->TEXT_HIDE_ADVANCED);
82
    	$oTpl->set_var('ADVANCED_BUTTON', '<< '.$oTrans->TEXT_HIDE_ADVANCED);
86 83
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=no');
87 84

  
88 85
    } else {
......
91 88
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
92 89

  
93 90
    	$oTpl->set_var('ADVANCED', 'no');
94
    	$oTpl->set_var('ADVANCED_BUTTON', $mLang->TEXT_SHOW_ADVANCED.' >>');
91
    	$oTpl->set_var('ADVANCED_BUTTON', $oTrans->TEXT_SHOW_ADVANCED.' >>');
95 92
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
96 93
    }
97 94

  
......
99 96
	$checked   = ' checked="checked"';
100 97

  
101 98
	$oTpl->set_var(array(
102
		'WB_URL' => WB_URL,
99
		'WB_URL'    => WB_URL,
103 100
		'THEME_URL' => THEME_URL,
104 101
		'ADMIN_URL' => ADMIN_URL,
105 102
	 ));
106 103

  
107 104
//  Insert permissions values
108
	if($admin->get_permission('settings_advanced') != true)
109
	{
105
	if ($admin->get_permission('settings_advanced') != true) {
110 106
		$oTpl->set_var('DISPLAY_ADVANCED_BUTTON', 'hide');
111 107
	}
112 108

  
......
148 144
	if(PAGE_TRASH == 'disabled')
149 145
	{
150 146
    	$oTpl->set_var(array(
151
				'PAGE_TRASH_DISABLED' => $checked,
152
				'PAGE_TRASH_INLINE' => '',
153
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
154
				));
155
	} elseif(PAGE_TRASH == 'inline')
156
	{
147
            'PAGE_TRASH_DISABLED'         => $checked,
148
            'PAGE_TRASH_INLINE'           => '',
149
            'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
150
        ));
151
	} elseif(PAGE_TRASH == 'inline') {
157 152
    	$oTpl->set_var(array(
158
				'PAGE_TRASH_INLINE' => $checked,
159
				'PAGE_TRASH_DISABLED' => '',
160
				'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
161
				));
162
	} elseif(PAGE_TRASH == 'separate')
163
	{
153
            'PAGE_TRASH_INLINE'           => $checked,
154
            'PAGE_TRASH_DISABLED'         => '',
155
            'DISPLAY_PAGE_TRASH_SEPARATE' => 'display: none;',
156
        ));
157
	} elseif(PAGE_TRASH == 'separate') {
164 158
		$oTpl->set_var('PAGE_TRASH_SEPARATE', $checked);
165 159
		$oTpl->set_var('DISPLAY_PAGE_TRASH_SEPARATE', 'display: inline;');
166 160
	}
......
171 165
     */
172 166
    $oTpl->set_block('main_block', 'show_checkbox_1_block', 'show_checkbox_1');
173 167
//  Work-out if page languages feature is enabled
174
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true)
175
	{
168
	if(defined('PAGE_LANGUAGES') && PAGE_LANGUAGES == true) {
176 169
    	$oTpl->set_var(array(
177 170
				'PAGE_LANGUAGES_ENABLED' => $checked,
178 171
				'PAGE_LANGUAGES_DISABLED' => '',
......
185 178
	}
186 179

  
187 180
//  Work-out if page extended feature is enabled
188
	if(defined('PAGE_EXTENDET') && PAGE_EXTENDET == true)
189
	{
181
	if(defined('PAGE_EXTENDET') && PAGE_EXTENDET == true) {
190 182
    	$oTpl->set_var(array(
191 183
				'PAGE_EXTENDET_ENABLED' => $checked,
192 184
				'PAGE_EXTENDET_DISABLED' => '',
......
199 191
	}
200 192

  
201 193
//  Work-out if multiple menus feature is enabled
202
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true)
203
	{
194
	if(defined('MULTIPLE_MENUS') && MULTIPLE_MENUS == true) {
204 195
    	$oTpl->set_var(array(
205 196
				'MULTIPLE_MENUS_ENABLED' => $checked,
206 197
				'MULTIPLE_MENUS_DISABLED' => '',
......
216 207
     * <!-- END show_checkbox_1_block -->
217 208
     * advanced yes
218 209
     */
219
    if($is_advanced)
220
    {
210
    if($is_advanced) {
221 211
    	$oTpl->parse('show_checkbox_1', 'show_checkbox_1_block');
222 212
    } else {
223 213
    	$oTpl->parse('show_checkbox_1', '');
224 214
    }
225 215

  
226 216
//  Work-out if media home folder feature is enabled
227
    $oTpl->set_var('TEXT_HOME_FOLDERS', $mLang->TEXT_HOME_FOLDERS);
217
    $oTpl->set_var('TEXT_HOME_FOLDERS', $oTrans->TEXT_HOME_FOLDERS);
228 218
	if(HOME_FOLDERS)
229 219
	{
230 220
    	$oTpl->set_var(array(
......
363 353

  
364 354
//  Insert groups into signup list
365 355
    $oTpl->set_block('main_block', 'group_list_block', 'group_list');
366
    $sql = "SELECT `group_id`, `name` FROM `".TABLE_PREFIX."groups` WHERE `group_id` != '1'";
367
	if($results = $database->query($sql)) {
368
    	if($results->numRows() > 0)
369
    	{
370
    		while($group = $results->fetchRow(MYSQL_ASSOC))
371
    	    {
356
    $sql = 'SELECT `group_id`, `name` FROM `'.$oDb->TablePrefix.'groups` '
357
         . 'WHERE `group_id` != 1';
358
	if (($results = $oDb->doQuery($sql))) {
359
    	if ($results->numRows() > 0) {
360
    		while($group = $results->fetchRow(MYSQL_ASSOC)) {
372 361
    			$oTpl->set_var('ID', $group['group_id']);
373 362
    			$oTpl->set_var('NAME', $group['name']);
374 363
    			if(FRONTEND_SIGNUP == $group['group_id'])
......
381 370
    		}
382 371
    	} else {
383 372
    		$oTpl->set_var('ID', 'disabled');
384
    		$oTpl->set_var('NAME', $mLang->MESSAGE_GROUPS_NO_GROUPS_FOUND);
373
    		$oTpl->set_var('NAME', $oTrans->MESSAGE_GROUPS_NO_GROUPS_FOUND);
385 374
    		$oTpl->parse('group_list', 'group_list_block', true);
386 375
    	}
387 376
	}
......
394 383
    /**
395 384
     * <!-- END show_redirect_timer_block -->
396 385
     */
397
    if($is_advanced)
398
    {
386
    if ($is_advanced) {
399 387
    	$oTpl->parse('show_redirect_timer', 'show_redirect_timer_block');
400 388
    } else {
401 389
    	$oTpl->parse('show_redirect_timer', '');
......
420 408
    /**
421 409
     * <!-- END show_php_error_level_block -->
422 410
     */
423
    if($is_advanced)
424
    {
411
    if ($is_advanced) {
425 412
    	$oTpl->parse('show_php_error_level',  'show_php_error_level_block');
426 413
    } else {
427 414
    	$oTpl->parse('show_php_error_level', '');
......
434 421
    $oTpl->set_block('main_block', 'show_wysiwyg_block',        'show_wysiwyg');
435 422
    $oTpl->set_block('show_wysiwyg_block', 'editor_list_block', 'editor_list');
436 423
	$file='none';
437
	$module_name=$mLang->TEXT_NONE;
424
	$module_name = $oTrans->TEXT_NONE;
438 425
	$oTpl->set_var('FILE', $file);
439 426
	$oTpl->set_var('NAME', $module_name);
440 427
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $sSelected : '';
441 428
	$oTpl->set_var('SELECTED', $selected);
442 429
	$oTpl->parse('editor_list', 'editor_list_block', true);
443
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
444
	$sql .= 'WHERE `type` = \'module\' ';
445
	$sql .= 'AND `function` = \'wysiwyg\' ';
446
	$sql .= 'ORDER BY `name`';
447
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
448
	{
449
		while($addon = $result->fetchRow(MYSQL_ASSOC))
450
	    {
451
			if( $admin->get_permission($addon['directory'],'module' ) )
452
			{
430
	$sql = 'SELECT `name`, `directory` FROM `'.$oDb->TablePrefix.'addons` '
431
	     . 'WHERE `type` = \'module\' AND `function` = \'wysiwyg\' '
432
	     . 'ORDER BY `name`';
433
	if (($result = $oDb->doQuery($sql))) {
434
		while ($addon = $result->fetchRow(MYSQL_ASSOC)) {
435
			if ($admin->get_permission($addon['directory'],'module' )) {
453 436
				$oTpl->set_var('FILE', $addon['directory']);
454 437
				$oTpl->set_var('NAME', $addon['name']);
455 438
				$selected = (!defined('WYSIWYG_EDITOR') || $addon['directory'] == WYSIWYG_EDITOR) ? $sSelected : '';
......
471 454

  
472 455
//  Insert language values
473 456
    $oTpl->set_block('main_block', 'language_list_block', 'language_list');
474
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
475
	$sql .= 'WHERE `type` = \'language\' ';
476
	$sql .= 'AND `function` != \'theme\' ';
477
	$sql .= 'ORDER BY `directory`';
478
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
479
	{
457
	$sql = 'SELECT `name`, `directory` FROM `'.$oDb->TablePrefix.'addons` '
458
	     . 'WHERE `type` = \'language\' AND `function` != \'theme\' '
459
	     . 'ORDER BY `directory`';
460
	if (($result = $oDb->doQuery($sql))) {
480 461
		while($addon = $result->fetchRow(MYSQL_ASSOC)) {
481 462
	        $langIcons = (empty($addon['directory'])) ? 'none' : strtolower($addon['directory']);
482

  
483 463
			$oTpl->set_var('CODE',        $addon['directory']);
484 464
			$oTpl->set_var('NAME',        $addon['name']);
485 465
			$oTpl->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
......
494 474
    $oTpl->set_block('main_block', 'show_charset_block', 'show_charset');
495 475
	require(ADMIN_PATH.'/interface/charsets.php');
496 476
    $oTpl->set_block('show_charset_block', 'charset_list_block', 'charset_list');
497
	foreach($CHARSETS AS $code => $title) {
477
	foreach ($CHARSETS AS $code => $title) {
498 478
		$oTpl->set_var('VALUE', $code);
499 479
		$oTpl->set_var('NAME', $title);
500 480
		if(DEFAULT_CHARSET == $code) {
......
507 487
    /**
508 488
     * <!-- END show_charset_block -->
509 489
     */
510
    if($is_advanced)
511
    {
490
    if ($is_advanced) {
512 491
    	$oTpl->parse('show_charset', 'show_charset_block');
513 492
    } else {
514 493
    	$oTpl->parse('show_charset', '');
515 494
    }
516 495

  
517
//  nsert default timezone values
496
//  insert default timezone values
518 497
	require(ADMIN_PATH.'/interface/timezones.php');
519 498
    $oTpl->set_block('main_block', 'timezone_list_block','timezone_list');
520
	foreach($TIMEZONES AS $hour_offset => $title)
521
	{
499
	foreach ($TIMEZONES AS $hour_offset => $title) {
522 500
//  Make sure we dont list "System Default" as we are setting this value!
523 501
		if($hour_offset != '-20') {
524 502
			$oTpl->set_var('VALUE', $hour_offset);
......
535 513
//  Insert date format list
536 514
	require(ADMIN_PATH.'/interface/date_formats.php');
537 515
    $oTpl->set_block('main_block', 'date_format_list_block', 'date_format_list');
538
	foreach($DATE_FORMATS AS $format => $title) {
516
	foreach ($DATE_FORMATS AS $format => $title) {
539 517
		$format = str_replace('|', ' ', $format); // Add's white-spaces (not able to be stored in array key)
540 518
		if($format != 'system_default') {
541 519
			$oTpl->set_var('VALUE', $format);
......
571 549
	}
572 550

  
573 551
// Insert templates
574
    $oTpl->set_block('main_block', 'template_list_block',         'template_list');
575
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
576
	$sql .= 'WHERE `type` = \'template\' ';
577
	$sql .= 'AND `function` != \'theme\' ';
578
	$sql .= 'ORDER BY `name`';
579
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
580
	{
581
		while($addon = $result->fetchRow(MYSQL_ASSOC))
582
		{
583
			if( $admin->get_permission($addon['directory'],'template' ) )
584
			{
552
    $oTpl->set_block('main_block', 'template_list_block', 'template_list');
553
	$sql = 'SELECT `name`, `directory` FROM `'.$oDb->TablePrefix.'addons` '
554
	     . 'WHERE `type` = \'template\' AND `function` != \'theme\' '
555
	     . 'ORDER BY `name`';
556
	if (($result = $database->query($sql))) {
557
		while ($addon = $result->fetchRow(MYSQL_ASSOC)) {
558
			if ($admin->get_permission($addon['directory'],'template' )) {
585 559
				$oTpl->set_var('FILE', $addon['directory']);
586 560
				$oTpl->set_var('NAME', $addon['name']);
587 561
				$selected = (($addon['directory'] == DEFAULT_TEMPLATE) ? $sSelected : '');
......
592 566
	}
593 567

  
594 568
// Insert backend theme
595
    $oTpl->set_block('main_block', 'theme_list_block',            'theme_list');
596
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
597
	$sql .= 'WHERE `type` = \'template\' ';
598
	$sql .= 'AND `function` = \'theme\' ';
599
	$sql .= 'ORDER BY `name`';
600

  
601
	if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
602
	{
603
		while($addon = $result->fetchRow(MYSQL_ASSOC))
604
		{
605
			if( $admin->get_permission($addon['directory'],'template' ) )
606
			{
569
    $oTpl->set_block('main_block', 'theme_list_block', 'theme_list');
570
	$sql = 'SELECT `name`, `directory` FROM `'.$oDb->TablePrefix.'addons` '
571
	     . 'WHERE `type` = \'template\' AND `function` = \'theme\' '
572
	     . 'ORDER BY `name`';
573
	if (($result = $database->query($sql))) {
574
		while ($addon = $result->fetchRow(MYSQL_ASSOC)) {
575
			if ($admin->get_permission($addon['directory'],'template' )) {
607 576
				$oTpl->set_var('FILE', $addon['directory']);
608 577
				$oTpl->set_var('NAME', $addon['name']);
609 578
				$selected = (($addon['directory'] == DEFAULT_THEME) ? $sSelected : '');
......
646 615
 *
647 616
 */
648 617
    $oTpl->set_block('main_block', 'show_search_block','show_search');
649
	$query = "SELECT * FROM `".TABLE_PREFIX."search` WHERE `extra` = '' ";
650
	if($results = $database->query($query))
651
    {
618
	$sql = 'SELECT * FROM `'.$oDb->TablePrefix.'search` WHERE `extra` = \'\'';
619
	if (($results = $oDb->doQuery($sql))) {
652 620
    	// Query current settings in the db, then loop through them and print them
653
    	while($setting = $results->fetchRow(MYSQL_ASSOC))
654
    	{
621
    	while ($setting = $results->fetchRow(MYSQL_ASSOC)) {
655 622
    		$setting_name = $setting['name'];
656 623
    		$setting_value = htmlspecialchars(($setting['value']));
657 624
    		switch($setting_name) {
......
700 667
	}
701 668

  
702 669
// Insert templates for search settings
703
    $oTpl->set_block('main_block', 'search_template_list_block',  'search_template_list');
670
    $oTpl->set_block('main_block', 'search_template_list_block', 'search_template_list');
704 671
	$search_template = ( ($search_template == DEFAULT_TEMPLATE) || ($search_template == '') ) ? '' : $search_template;
705 672
	$selected = ( ($search_template != DEFAULT_TEMPLATE) ) ?  $sSelected : '';
706 673

  
707 674
	$oTpl->set_var(array(
708
	        'FILE' => '',
709
			'TEXT_MODULE_ORDER' => $mLang->TEXT_MODULE_ORDER,
710
	        'NAME' => $mLang->TEXT_SYSTEM_DEFAULT,
711
	        'SELECTED' => $selected
712
	    ));
675
        'FILE'              => '',
676
        'TEXT_MODULE_ORDER' => $oTrans->TEXT_MODULE_ORDER,
677
        'NAME'              => $oTrans->TEXT_SYSTEM_DEFAULT,
678
        'SELECTED'          => $selected
679
    ));
713 680
	$oTpl->parse('search_template_list', 'search_template_list_block', true);
714
	$sql  = 'SELECT `name`, `directory` FROM `'.TABLE_PREFIX.'addons` ';
715
	$sql .= 'WHERE `type` = \'template\' ';
716
	$sql .= 'AND `function` = \'template\' ';
717
	$sql .= 'ORDER BY `name`';
718
    if( ($result = $database->query($sql)) && ($result->numRows() > 0) )
719
	{
720
		while($addon = $result->fetchRow(MYSQL_ASSOC))
721
	    {
722
			if( $admin->get_permission($addon['directory'],'template' ) )
723
			{
681
	$sql = 'SELECT `name`, `directory` FROM `'.$oDb->TablePrefix.'addons` '
682
	     . 'WHERE `type` = \'template\' AND `function` = \'template\' '
683
	     . 'ORDER BY `name`';
684
    if (($result = $oDb->doQuery($sql))) {
685
		while ($addon = $result->fetchRow(MYSQL_ASSOC)) {
686
			if ($admin->get_permission($addon['directory'],'template' )) {
724 687
				$oTpl->set_var('FILE', $addon['directory']);
725 688
				$oTpl->set_var('NAME', $addon['name']);
726 689
		        $selected = ($addon['directory'] == $search_template) ? $sSelected :  '';
......
732 695

  
733 696
	// Insert search select
734 697
//    $oTpl->set_var(array(
735
//		'TEXT_REGISTERED' => $mLang->TEXT_REGISTERED'],
736
//		'TEXT_PUBLIC' => $mLang->TEXT_PUBLIC,
737
//		'TEXT_PRIVATE' => $mLang->TEXT_PRIVATE'],
738
//		'TEXT_NONE' => $mLang->TEXT_NONE'],
739
//		'TEXT_MAX_EXCERPT' => $mLang->TEXT_MAX_EXCERPT'],
740
//		'TEXT_TIME_LIMIT' => $mLang->TEXT_TIME_LIMIT'],
741
//		'TEXT_VISIBILITY' => $mLang->TEXT_VISIBILITY'],
742
//		'TEXT_SEARCH' => $mLang->TEXT_SEARCH'],
698
//		'TEXT_REGISTERED' => $oTrans->TEXT_REGISTERED'],
699
//		'TEXT_PUBLIC' => $oTrans->TEXT_PUBLIC,
700
//		'TEXT_PRIVATE' => $oTrans->TEXT_PRIVATE'],
701
//		'TEXT_NONE' => $oTrans->TEXT_NONE'],
702
//		'TEXT_MAX_EXCERPT' => $oTrans->TEXT_MAX_EXCERPT'],
703
//		'TEXT_TIME_LIMIT' => $oTrans->TEXT_TIME_LIMIT'],
704
//		'TEXT_VISIBILITY' => $oTrans->TEXT_VISIBILITY'],
705
//		'TEXT_SEARCH' => $oTrans->TEXT_SEARCH'],
743 706
//		));
744 707
	if(SEARCH == 'private')
745 708
	{
......
768 731
				));
769 732
	}
770 733

  
771
if($is_advanced)
772
{
773
	$oTpl->parse('show_search', 'show_search_block');
774
} else {
775
	$oTpl->parse('show_search', '');
776
}
734
    if ($is_advanced) {
735
        $oTpl->parse('show_search', 'show_search_block');
736
    } else {
737
        $oTpl->parse('show_search', '');
738
    }
777 739

  
778 740
    $oTpl->set_block('main_block', 'show_access_block','show_access');
779 741
//  Work-out which wbmailer routine should be checked
780 742
	$oTpl->set_var(array(
781
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $mLang->TEXT_REQUIRED.' '.$mLang->TEXT_WBMAILER_SMTP_AUTH,
782
		'SMTP_AUTH_SELECTED' => $checked,
783
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $mLang->TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE,
784
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $mLang->TEXT_WBMAILER_DEFAULT_SENDER_MAIL,
785
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $mLang->TEXT_WBMAILER_DEFAULT_SENDER_NAME,
786
		'TEXT_WBMAILER_NOTICE' => $mLang->TEXT_WBMAILER_NOTICE,
787
		'TEXT_WBMAILER_FUNCTION' => $mLang->TEXT_WBMAILER_FUNCTION,
788
		'TEXT_WBMAILER_SMTP_HOST' => $mLang->TEXT_WBMAILER_SMTP_HOST,
789
		'TEXT_WBMAILER_PHP' => $mLang->TEXT_WBMAILER_PHP,
790
		'TEXT_WBMAILER_SMTP' => $mLang->TEXT_WBMAILER_SMTP,
791
		'TEXT_WBMAILER_SMTP_AUTH' => $mLang->TEXT_WBMAILER_SMTP_AUTH,
792
		'TEXT_WBMAILER_SMTP_USERNAME' => $mLang->TEXT_WBMAILER_SMTP_USERNAME,
793
		'TEXT_WBMAILER_SMTP_PASSWORD' => $mLang->TEXT_WBMAILER_SMTP_PASSWORD,
794
		));
743
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE'        => $oTrans->TEXT_REQUIRED.' '.$oTrans->TEXT_WBMAILER_SMTP_AUTH,
744
		'SMTP_AUTH_SELECTED'                    => $checked,
745
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $oTrans->TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE,
746
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL'     => $oTrans->TEXT_WBMAILER_DEFAULT_SENDER_MAIL,
747
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME'     => $oTrans->TEXT_WBMAILER_DEFAULT_SENDER_NAME,
748
		'TEXT_WBMAILER_NOTICE'                  => $oTrans->TEXT_WBMAILER_NOTICE,
749
		'TEXT_WBMAILER_FUNCTION'                => $oTrans->TEXT_WBMAILER_FUNCTION,
750
		'TEXT_WBMAILER_SMTP_HOST'               => $oTrans->TEXT_WBMAILER_SMTP_HOST,
751
		'TEXT_WBMAILER_PHP'                     => $oTrans->TEXT_WBMAILER_PHP,
752
		'TEXT_WBMAILER_SMTP'                    => $oTrans->TEXT_WBMAILER_SMTP,
753
		'TEXT_WBMAILER_SMTP_AUTH'               => $oTrans->TEXT_WBMAILER_SMTP_AUTH,
754
		'TEXT_WBMAILER_SMTP_USERNAME'           => $oTrans->TEXT_WBMAILER_SMTP_USERNAME,
755
		'TEXT_WBMAILER_SMTP_PASSWORD'           => $oTrans->TEXT_WBMAILER_SMTP_PASSWORD,
756
	));
795 757

  
796 758
	// Work-out if developer infos feature is enabled
797
	if(defined('DEV_INFOS') && DEV_INFOS == true)
798
	{
759
	if (defined('DEV_INFOS') && DEV_INFOS == true) {
799 760
    	$oTpl->set_var(array(
800 761
				'DEV_INFOS_ENABLED' => $checked,
801 762
				'DEV_INFOS_DISABLED' => '',
......
953 914
	}
954 915
	$sReadOnly = '';
955 916
	$sPagesEditType = 'text';
956
	if( $bPagesCanModify = ($database->get_one('SELECT COUNT(*) FROM `'.TABLE_PREFIX.'pages`'))!=0 ) {
917
    $sql = 'SELECT COUNT(*) FROM `'.$oDb->TablePrefix.'pages`';
918
	if (!($bPagesCanModify = ($oDb->getOne($sql)))) {
957 919
		$sReadOnly = ' readonly="readonly"';
958 920
		$sPagesEditType = 'grey bold';
959 921
	}
......
974 936

  
975 937
// Insert language text and messages
976 938
	$oTpl->set_var(array(
977
		'TEXT_CHANGES' => $mLang->TEXT_CHANGES,
978
		'TEXT_FILES' => strtoupper(substr($mLang->TEXT_FILES, 0, 1)).substr($mLang->TEXT_FILES, 1),
939
		'TEXT_CHANGES' => $oTrans->TEXT_CHANGES,
940
		'TEXT_FILES' => strtoupper(substr($oTrans->TEXT_FILES, 0, 1)).substr($oTrans->TEXT_FILES, 1),
979 941
		'TEXT_WARN_PAGE_LEAVE' => '',
980
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $mLang->TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS,
981
		'MODE_SWITCH_WARNING' => $mLang->MESSAGE_SETTINGS_MODE_SWITCH_WARNING,
982
		'WORLD_WRITEABLE_WARNING' => $mLang->MESSAGE_SETTINGS_WORLD_WRITEABLE_WARNING
942
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $oTrans->TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS,
943
		'MODE_SWITCH_WARNING' => $oTrans->MESSAGE_SETTINGS_MODE_SWITCH_WARNING,
944
		'WORLD_WRITEABLE_WARNING' => $oTrans->MESSAGE_SETTINGS_WORLD_WRITEABLE_WARNING
983 945
		));
984 946

  
985
if($is_advanced && $admin->get_user_id()=='1')
986
{
987
	$oTpl->parse('show_access', 'show_access_block');
988
}else {
989
	$oTpl->parse('show_access' , '');
990
}
947
    if ($is_advanced && $admin->get_user_id()=='1') {
948
        $oTpl->parse('show_access', 'show_access_block');
949
    }else {
950
        $oTpl->parse('show_access' , '');
951
    }
991 952

  
992
// Parse template objects output
993
$oTpl->parse('main', 'main_block',false);
994
$oTpl->pparse('output', 'page');
995
//$oTpl->p('page');
996
unset($oTpl);
997
$mLang->disableAddon();
998
$admin->print_footer();
953
    // Parse template objects output
954
    $oTpl->parse('main', 'main_block',false);
955
    $oTpl->pparse('output', 'page');
956
    //$oTpl->p('page');
957
    unset($oTpl);
958
    $admin->print_footer();

Also available in: Unified diff