Project

General

Profile

« Previous | Next » 

Revision 1912

Added by Dietmar over 11 years ago

! /admin/preferences/index.php change to new Translate class
languages only given for existing page languages
! /admin/settings/ change to new Translate class

View differences:

branches/2.8.x/CHANGELOG
12 12
===============================================================================
13 13

  
14 14

  
15
07 Jun-2013 Build 1912 Dietmar Woellbrink (Luisehahne)
16
! /admin/preferences/index.php change to new Translate class
17
  languages only given for existing page languages
18
!  /admin/settings/ change to new Translate class
15 19
07 Jun-2013 Build 1911 Dietmar Woellbrink (Luisehahne)
16 20
! modules/menu_link/save.php coding new sql logic to replace adding an empty table row in add.php
17 21
07 Jun-2013 Build 1910 Dietmar Woellbrink (Luisehahne)
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', '1911');
54
if(!defined('REVISION')) define('REVISION', '1912');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/admin/settings/save.php
4 4
 * @category        admin
5 5
 * @package         settings
6 6
 * @author          WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
......
186 186
    'page_spacer',
187 187
    'page_icon_dir',
188 188
    );
189
$disallow_in_fields = array(
190
    'pages_directory',
191
    'media_directory',
189
$aPreventFromUpdate = array(
190
    'sp',
191
    'version',
192
//    'page_extension',
192 193
    'wb_version'
193 194
    );
194 195
$StripCodeFromInput = array(
......
207 208
    );
208 209

  
209 210
// Query current settings in the db, then loop through them and update the db with the new value
210
$settings = array();
211
$old_settings = array();
211
//$settings = array();
212
//$old_settings = array();
212 213
// Query current settings in the db, then loop through them to get old values
213 214
$sql  = 'SELECT `name`, `value` FROM `'.TABLE_PREFIX.'settings`';
214 215
$sql .= 'ORDER BY `name`';
215 216

  
216 217
if($res_settings = $database->query($sql)) {
217
	$passed = false;
218
	$iQueryStart = $database->getQueryCount;
218 219
	while($setting = $res_settings->fetchRow(MYSQL_ASSOC))
219 220
	{
221
		$passed = false;
220 222
		$setting_name = $setting['name'];
221
		$old_settings[$setting_name] = $setting['value'];
222
		$value = $admin->get_post($setting_name);
223
		$value = isset($_POST[$setting_name]) ? $value : $old_settings[$setting_name] ;
223
//		$old_settings = $setting['value'];
224
//		$value = $admin->get_post($setting_name);
225
		if(($value = $admin->get_post($setting_name)) === null) { continue; }
226
//		$value = isset($_POST[$setting_name]) ? $value : $old_settings ;
224 227
		switch ($setting_name) {
225 228
			case 'default_timezone':
226
		    	$value = (is_numeric($value) ? $value : 0);
227
		    	$value = ( ($value >= -12 && $value <= 13) ? $value :0 ) * 3600;
228
				$passed = true;
229
				$value = intval($value);
230
				$value = ( ($value >= -12 && $value <= 13) ? $value :0 ) * 3600;
231
				$passed = ($value != $setting['value']);
229 232
				break;
230 233
			case 'string_dir_mode':
231 234
				$value=$dir_mode;
232
				$passed = true;
235
				$passed = ($value != $setting['value']);
233 236
				break;
234 237
			case 'string_file_mode':
235 238
				$value=$file_mode;
236
	 			$passed = true;
237
    			break;
239
	 			$passed = ($value != $setting['value']);
240
				break;
241
			case 'page_extension':
242
				$value = $admin->StripCodeFromText($value);
243
				if(!preg_match('/^\.[a-z][a-z0-9]+$/siu', $value)) {
244
					$value = '.php';
245
				}
246
				$passed = ($value != $setting['value']);
247
				break;
238 248
			case 'sec_anchor':
239
                $value = $admin->StripCodeFromText($value);
240
				$value=(($value=='') ? 'section_' : $value);
241
	 			$passed = true;
249
				$value = $admin->StripCodeFromText($value);
250
				$value=(($value=='') ? 'Sec' : $value);
251
	 			$passed = ($value != $setting['value']);
242 252
				break;
243 253
			case 'media_directory':
244
				$value = ( (strpos($value,'/',0)===false) && ($value!= '') ) ? '/'.$value : rtrim($value,'/'); 
245
	 			$passed = true;
254
				$value = trim($value,'/');
255
				$value = ( ($value != '')  ? '/'.$value : '/media' ); 
256
	 			$passed = ($value != $setting['value']);
246 257
				break;
247
			case 'pages_directory':
248
				if( ($database->get_one('SELECT COUNT(*) FROM `'.TABLE_PREFIX.'pages`'))==0 ) {
249
					$value = rtrim($admin->StripCodeFromText($value));
250
					$passed = true;
258
			 case 'pages_directory':
259
			 $sql = 'SELECT COUNT(*) FROM `'.TABLE_PREFIX.'pages`';
260
			  if( !($database->get_one($sql)) ) {
261
			   $value = rtrim($admin->StripCodeFromText($value));
262
			   $passed = ($value != $setting['value']);
263
			  }
264
			  $value = trim($value,'/');
265
			  $value = ( ($value != '')  ? '/'.$value : '' ); 
266
			  break;
267
			default :
268
				 if($value == '')  {
269
					$passed = ((in_array($setting_name, $allow_empty_values)) && ($value != $setting['value']));
251 270
				} else {
252
					$value = rtrim($old_settings[$setting_name]);
271
					if(in_array($setting_name, $StripCodeFromInput) ) {
272
						$value = trim($admin->StripCodeFromText($value));
273
					}
274
					$passed = (($value != '') && ($value != $setting['value']));
253 275
				}
254
				$value = ( (strpos($value,'/',0)===false) && ($value != '')  ? '/'.$value : rtrim($value,'/') ); 
255 276
				break;
256
			case 'wbmailer_smtp_auth':
257
				$value = true ;
258
	 			$passed = true;
259
				break;
260
			default :
261
                $passed = in_array($setting_name, $allow_empty_values);
262
                if(in_array($setting_name, $StripCodeFromInput) ) {
263
                    $value = $admin->StripCodeFromText($value);
264
                }
265
				break;
266 277
		}
267 278

  
268 279
	    if (!in_array($setting_name, $allow_tags_in_fields))
269 280
	    {
270 281
	        $value = strip_tags($value);
271 282
	    }
272

  
273
	    if ( !in_array($value, $disallow_in_fields) && (isset($_POST[$setting_name]) || $passed == true) )
283
		if( !in_array($setting_name, $aPreventFromUpdate) && $passed )
284
//	    if ( !in_array($setting_name, $aPreventFromUpdate) && (isset($_POST[$setting_name]) || $passed == true) )
274 285
	    {
275 286
	        $value = trim($database->escapeString($value));
276 287
	        $sql = 'UPDATE `'.TABLE_PREFIX.'settings` ';
......
282 293
				if($database->is_error()) {
283 294
					$admin->print_error($database->get_error, $js_back );
284 295
				}
285
	        }
296
	        } 
286 297
		}
287 298
	}
299
	$iQueriesDone = $database->getQueryCount - $iQueryStart;
300
}
288 301

  
289
}
290 302
/**
291 303
 * now save search settings
292 304
 */
......
391 403
if($database->is_error()) {
392 404
	$admin->print_error($database->get_error, $js_back );
393 405
} else {
406
//	$admin->print_success($iQueriesDone.' Queries '.$MESSAGE['SETTINGS_SAVED'], $js_back );
394 407
	$admin->print_success($MESSAGE['SETTINGS_SAVED'], $js_back );
395 408
}
396 409
$admin->print_footer();
branches/2.8.x/wb/admin/settings/languages/EN.php
12 12
$TEXT['MODULES_DIRECTORY'] = 'Modules for upgrade';
13 13
$HELP['ACTIVATION_MAIL'] = 'Registration per Activation-Mail (Enabled) or Directregistration (Disabled)';
14 14
$HELP['REBUILD_ACCESS_FILES'] = '- Modules listet in the next field, will be upgraded too, (Comma separate list)';
15
//
15
$TEXT['SECTION_ID_PREFIX'] = 'Section-ID prefix';
branches/2.8.x/wb/admin/settings/languages/DE.php
13 13
$TEXT['MODULES_DIRECTORY'] = 'Module für Aktualisierung';
14 14
$HELP['ACTIVATION_MAIL'] = 'Registrierung per Aktivierungs-Mail (Eingeschaltet) oder Direktregistrierung (Ausgeschaltet)';
15 15
$HELP['REBUILD_ACCESS_FILES'] = '- Aktualisiert auch nachfolgend eingetragene geprüfte Module, (Komma getrennte Liste)';
16
//
16
$TEXT['SECTION_ID_PREFIX'] = 'AbschnittsID Präfix';
branches/2.8.x/wb/admin/settings/index.php
4 4
 * @category        admin
5 5
 * @package         settings
6 6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2012, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker2.org/
7
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10 10
 * @platform        WebsiteBaker 2.8.x
11 11
 * @requirements    PHP 5.2.2 and higher
......
57 57
$oTpl->set_file('page',  'settings.htt');
58 58
$oTpl->set_block('page', 'main_block', 'main');
59 59

  
60
$mLang = ModLanguage::getInstance();
61
$mLang->setLanguage(dirname(__FILE__).'/languages/', LANGUAGE, DEFAULT_LANGUAGE);
62

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

  
67
$oTpl->set_var('FTAN', $admin->getFTAN());
68

  
67 69
// Query current settings in the db, then loop through them and print them
68 70
$query = "SELECT * FROM `".TABLE_PREFIX."settings`";
69 71
if($results = $database->query($query)) {
......
82 84
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'file_perms_box');
83 85
    	$oTpl->set_var('BASIC_FILE_PERMS_ID', 'hide');
84 86
    	$oTpl->set_var('ADVANCED', 'yes');
85
    	$oTpl->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$TEXT['HIDE_ADVANCED']);
87
    	$oTpl->set_var('ADVANCED_BUTTON', '&lt;&lt; '.$mLang->TEXT_HIDE_ADVANCED);
86 88
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=no');
87 89

  
88 90
    } else {
......
91 93
    	$oTpl->set_var('ADVANCED_FILE_PERMS_ID', 'hide');
92 94

  
93 95
    	$oTpl->set_var('ADVANCED', 'no');
94
    	$oTpl->set_var('ADVANCED_BUTTON', $TEXT['SHOW_ADVANCED'].' &gt;&gt;');
96
    	$oTpl->set_var('ADVANCED_BUTTON', $mLang->TEXT_SHOW_ADVANCED.' &gt;&gt;');
95 97
    	$oTpl->set_var('ADVANCED_LINK', 'index.php?advanced=yes');
96 98
    }
97 99

  
......
104 106
		'ADMIN_URL' => ADMIN_URL,
105 107
	 ));
106 108

  
107
	// Insert language headings
108
	$oTpl->set_var(array(
109
		'HEADING_GENERAL_SETTINGS' => $HEADING['GENERAL_SETTINGS'],
110
		'HEADING_DEFAULT_SETTINGS' => $HEADING['DEFAULT_SETTINGS'],
111
		'HEADING_SEARCH_SETTINGS' => $HEADING['SEARCH_SETTINGS'],
112
		'HEADING_SERVER_SETTINGS' => $HEADING['SERVER_SETTINGS'],
113
		'HEADING_WBMAILER_SETTINGS' => $HEADING['WBMAILER_SETTINGS'],
114
		'HEADING_ADMINISTRATION_TOOLS' => $HEADING['ADMINISTRATION_TOOLS']
115
		)
116
	);
117

  
118
	// Insert language textarea label
119
	$oTpl->set_var(array(
120
		'TEXT_WEBSITE_TITLE' => $TEXT['WEBSITE_TITLE'],
121
		'TEXT_WEBSITE_DESCRIPTION' => $TEXT['WEBSITE_DESCRIPTION'],
122
		'TEXT_WEBSITE_KEYWORDS' => $TEXT['WEBSITE_KEYWORDS'],
123
		'TEXT_WEBSITE_HEADER' => $TEXT['WEBSITE_HEADER'],
124
		'TEXT_WEBSITE_FOOTER' => $TEXT['WEBSITE_FOOTER'],
125
		'TEXT_HEADER' => $TEXT['HEADER'],
126
		'TEXT_FOOTER' => $TEXT['FOOTER'],
127
		'TEXT_TEXT' => $TEXT['TEXT'],
128
		'TEXT_RESULTS_HEADER' => $TEXT['RESULTS_HEADER'],
129
		'TEXT_RESULTS_LOOP' => $TEXT['RESULTS_LOOP'],
130
		'TEXT_RESULTS_FOOTER' => $TEXT['RESULTS_FOOTER'],
131
		));
132

  
133
	// Insert generell language
134
    $oTpl->set_var(array(
135
		'TEXT_SAVE' => $TEXT['SAVE'],
136
		'TEXT_RESET' => $TEXT['RESET'],
137
		'TEXT_ENABLED' => $TEXT['ENABLED'],
138
		'TEXT_DISABLED' => $TEXT['DISABLED'],
139
		'TEXT_DEFAULT' => $TEXT['DEFAULT'],
140
		'TEXT_NO_RESULTS' => $TEXT['NO_RESULTS'],
141
		'TEXT_PLEASE_SELECT' => $TEXT['PLEASE_SELECT'],
142
		));
143

  
144
// Insert language labels
145
	$oTpl->set_var(array(
146
		'TEXT_PAGE_TRASH' => $TEXT['PAGE_TRASH'],
147
		'TEXT_PAGE_LANGUAGES' => $TEXT['PAGE_LANGUAGES'],
148
		'TEXT_FRONTEND' => $TEXT['FRONTEND'],
149
		'TEXT_LOGIN' => $TEXT['LOGIN'],
150
		'TEXT_HOMEPAGE_REDIRECTION' => $TEXT['HOMEPAGE_REDIRECTION'],
151
		'TEXT_SECTION_BLOCKS' => $TEXT['SECTION_BLOCKS'],
152
		'TEXT_MANAGE' => $TEXT['MANAGE'],
153
		'TEXT_SMART_LOGIN' => $TEXT['SMART_LOGIN'],
154
		'TEXT_PHP_ERROR_LEVEL' => $TEXT['PHP_ERROR_LEVEL'],
155
		'TEXT_WYSIWYG_STYLE' => $TEXT['WYSIWYG_STYLE'],
156
		'TEXT_CHARSET' => $TEXT['CHARSET'],
157
		'TEXT_REDIRECT_AFTER' => $TEXT['REDIRECT_AFTER'],
158
		'TEXT_SIGNUP' => $TEXT['SIGNUP'].' '.$TEXT['GROUP'],
159
		'TEXT_MULTILINGUAL' => $TEXT['MULTILINGUAL'],
160
		'TEXT_HOME_FOLDERS' => $TEXT['HOME_FOLDERS'],
161
		'TEXT_MANAGE_SECTIONS' => $HEADING['MANAGE_SECTIONS'],
162
		'TEXT_MULTIPLE_MENUS' => $TEXT['MULTIPLE_MENUS'],
163
		'TEXT_INLINE' => $TEXT['INLINE'],
164
		'TEXT_SEPARATE' => $TEXT['SEPARATE'],
165
		'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
166
		'TEXT_TIMEZONE' => $TEXT['TIMEZONE'],
167
		'TEXT_DATE_FORMAT' => $TEXT['DATE_FORMAT'],
168
		'TEXT_TIME_FORMAT' => $TEXT['TIME_FORMAT'],
169
		'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
170
		'TEXT_THEME' => $TEXT['THEME'],
171
		'TEXT_WYSIWYG_EDITOR' => $TEXT['WYSIWYG_EDITOR'],
172
		'TEXT_PAGE_LEVEL_LIMIT' => $TEXT['PAGE_LEVEL_LIMIT'],
173
		'TEXT_INTRO_PAGE' => $TEXT['INTRO_PAGE'],
174
		));
175

  
176 109
//  Insert permissions values
177 110
	if($admin->get_permission('settings_advanced') != true)
178 111
	{
......
293 226
    }
294 227

  
295 228
//  Work-out if media home folder feature is enabled
296
    $oTpl->set_var('TEXT_HOME_FOLDERS', $TEXT['HOME_FOLDERS']);
229
    $oTpl->set_var('TEXT_HOME_FOLDERS', $mLang->TEXT_HOME_FOLDERS);
297 230
	if(HOME_FOLDERS)
298 231
	{
299 232
    	$oTpl->set_var(array(
......
450 383
    		}
451 384
    	} else {
452 385
    		$oTpl->set_var('ID', 'disabled');
453
    		$oTpl->set_var('NAME', $MESSAGE['GROUPS']['NO_GROUPS_FOUND']);
386
    		$oTpl->set_var('NAME', $mLang->MESSAGE_GROUPS_NO_GROUPS_FOUND);
454 387
    		$oTpl->parse('group_list', 'group_list_block', true);
455 388
    	}
456 389
	}
......
503 436
    $oTpl->set_block('main_block', 'show_wysiwyg_block',        'show_wysiwyg');
504 437
    $oTpl->set_block('show_wysiwyg_block', 'editor_list_block', 'editor_list');
505 438
	$file='none';
506
	$module_name=$TEXT['NONE'];
439
	$module_name=$mLang->TEXT_NONE;
507 440
	$oTpl->set_var('FILE', $file);
508 441
	$oTpl->set_var('NAME', $module_name);
509 442
	$selected = (!defined('WYSIWYG_EDITOR') || $file == WYSIWYG_EDITOR) ? $sSelected : '';
......
775 708

  
776 709
	$oTpl->set_var(array(
777 710
	        'FILE' => '',
778
			'TEXT_MODULE_ORDER' => $TEXT['MODULE_ORDER'],
779
	        'NAME' => $TEXT['SYSTEM_DEFAULT'],
711
			'TEXT_MODULE_ORDER' => $mLang->TEXT_MODULE_ORDER,
712
	        'NAME' => $mLang->TEXT_SYSTEM_DEFAULT,
780 713
	        'SELECTED' => $selected
781 714
	    ));
782 715
	$oTpl->parse('search_template_list', 'search_template_list_block', true);
......
800 733
	}
801 734

  
802 735
	// Insert search select
803
    $oTpl->set_var(array(
804
		'TEXT_REGISTERED' => $TEXT['REGISTERED'],
805
		'TEXT_PUBLIC' => $TEXT['PUBLIC'],
806
		'TEXT_PRIVATE' => $TEXT['PRIVATE'],
807
		'TEXT_NONE' => $TEXT['NONE'],
808
		'TEXT_MAX_EXCERPT' => $TEXT['MAX_EXCERPT'],
809
		'TEXT_TIME_LIMIT' => $TEXT['TIME_LIMIT'],
810
		'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
811
		'TEXT_SEARCH' => $TEXT['SEARCH'],
812
		));
736
//    $oTpl->set_var(array(
737
//		'TEXT_REGISTERED' => $mLang->TEXT_REGISTERED'],
738
//		'TEXT_PUBLIC' => $mLang->TEXT_PUBLIC,
739
//		'TEXT_PRIVATE' => $mLang->TEXT_PRIVATE'],
740
//		'TEXT_NONE' => $mLang->TEXT_NONE'],
741
//		'TEXT_MAX_EXCERPT' => $mLang->TEXT_MAX_EXCERPT'],
742
//		'TEXT_TIME_LIMIT' => $mLang->TEXT_TIME_LIMIT'],
743
//		'TEXT_VISIBILITY' => $mLang->TEXT_VISIBILITY'],
744
//		'TEXT_SEARCH' => $mLang->TEXT_SEARCH'],
745
//		));
813 746
	if(SEARCH == 'private')
814 747
	{
815 748
    	$oTpl->set_var(array(
......
847 780
    $oTpl->set_block('main_block', 'show_access_block','show_access');
848 781
//  Work-out which wbmailer routine should be checked
849 782
	$oTpl->set_var(array(
850
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $TEXT['WBMAILER_DEFAULT_SETTINGS_NOTICE'],
851
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $TEXT['WBMAILER_DEFAULT_SENDER_MAIL'],
852
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $TEXT['WBMAILER_DEFAULT_SENDER_NAME'],
853
		'TEXT_WBMAILER_NOTICE' => $TEXT['WBMAILER_NOTICE'],
854
		'TEXT_WBMAILER_FUNCTION' => $TEXT['WBMAILER_FUNCTION'],
855
		'TEXT_WBMAILER_SMTP_HOST' => $TEXT['WBMAILER_SMTP_HOST'],
856
		'TEXT_WBMAILER_PHP' => $TEXT['WBMAILER_PHP'],
857
		'TEXT_WBMAILER_SMTP' => $TEXT['WBMAILER_SMTP'],
858
		'TEXT_WBMAILER_SMTP_AUTH' => $TEXT['WBMAILER_SMTP_AUTH'],
859
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $TEXT['REQUIRED'].' '.$TEXT['WBMAILER_SMTP_AUTH'],
860
		'TEXT_WBMAILER_SMTP_USERNAME' => $TEXT['WBMAILER_SMTP_USERNAME'],
861
		'TEXT_WBMAILER_SMTP_PASSWORD' => $TEXT['WBMAILER_SMTP_PASSWORD'],
862
		'SMTP_AUTH_SELECTED' => $checked
783
		'TEXT_WBMAILER_SMTP_AUTH_NOTICE' => $mLang->TEXT_REQUIRED.' '.$mLang->TEXT_WBMAILER_SMTP_AUTH,
784
		'SMTP_AUTH_SELECTED' => $checked,
785
		'TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE' => $mLang->TEXT_WBMAILER_DEFAULT_SETTINGS_NOTICE,
786
		'TEXT_WBMAILER_DEFAULT_SENDER_MAIL' => $mLang->TEXT_WBMAILER_DEFAULT_SENDER_MAIL,
787
		'TEXT_WBMAILER_DEFAULT_SENDER_NAME' => $mLang->TEXT_WBMAILER_DEFAULT_SENDER_NAME,
788
		'TEXT_WBMAILER_NOTICE' => $mLang->TEXT_WBMAILER_NOTICE,
789
		'TEXT_WBMAILER_FUNCTION' => $mLang->TEXT_WBMAILER_FUNCTION,
790
		'TEXT_WBMAILER_SMTP_HOST' => $mLang->TEXT_WBMAILER_SMTP_HOST,
791
		'TEXT_WBMAILER_PHP' => $mLang->TEXT_WBMAILER_PHP,
792
		'TEXT_WBMAILER_SMTP' => $mLang->TEXT_WBMAILER_SMTP,
793
		'TEXT_WBMAILER_SMTP_AUTH' => $mLang->TEXT_WBMAILER_SMTP_AUTH,
794
		'TEXT_WBMAILER_SMTP_USERNAME' => $mLang->TEXT_WBMAILER_SMTP_USERNAME,
795
		'TEXT_WBMAILER_SMTP_PASSWORD' => $mLang->TEXT_WBMAILER_SMTP_PASSWORD,
863 796
		));
864 797

  
865 798
	// Work-out if developer infos feature is enabled
......
1043 976

  
1044 977
// Insert language text and messages
1045 978
	$oTpl->set_var(array(
1046
		'TEXT_DEV_INFOS' => $TEXT['DEV_INFOS'],
1047
		'TEXT_PAGES_DIRECTORY' => $TEXT['PAGES_DIRECTORY'],
1048
		'TEXT_PAGE_ICON_DIR' => $TEXT['PAGE_ICON_DIR'],
1049
		'TEXT_MEDIA_DIRECTORY' => $TEXT['MEDIA_DIRECTORY'],
1050
		'TEXT_PAGE_EXTENSION' => $TEXT['PAGE_EXTENSION'],
1051
		'TEXT_PAGE_SPACER' => $TEXT['PAGE_SPACER'],
1052
		'TEXT_RENAME_FILES_ON_UPLOAD' => $TEXT['RENAME_FILES_ON_UPLOAD'],
1053
		'TEXT_APP_NAME' => $TEXT['APP_NAME'],
1054
		'TEXT_SESSION_IDENTIFIER' => $TEXT['SESSION_IDENTIFIER'],
1055
		'TEXT_SEC_ANCHOR' => $TEXT['SEC_ANCHOR'],
1056
		'TEXT_SERVER_OPERATING_SYSTEM' => $TEXT['SERVER_OPERATING_SYSTEM'],
1057
		'TEXT_LINUX_UNIX_BASED' => $TEXT['LINUX_UNIX_BASED'],
1058
		'TEXT_WINDOWS' => $TEXT['WINDOWS'],
1059
		'TEXT_ADMIN' => $TEXT['ADMIN'],
1060
		'TEXT_TYPE' => $TEXT['TYPE'],
1061
		'TEXT_DATABASE' => $TEXT['DATABASE'],
1062
		'TEXT_HOST' => $TEXT['HOST'],
1063
		'TEXT_USERNAME' => $TEXT['USERNAME'],
1064
		'TEXT_PASSWORD' => $TEXT['PASSWORD'],
1065
		'TEXT_NAME' => $TEXT['NAME'],
1066
		'TEXT_TABLE_PREFIX' => $TEXT['TABLE_PREFIX'],
1067
		'TEXT_CHANGES' => $TEXT['CHANGES'],
1068
		'TEXT_FILES' => strtoupper(substr($TEXT['FILES'], 0, 1)).substr($TEXT['FILES'], 1),
1069
		'TEXT_DIRECTORIES' => $TEXT['DIRECTORIES'],
1070
		'TEXT_FILESYSTEM_PERMISSIONS' => $TEXT['FILESYSTEM_PERMISSIONS'],
1071
		'TEXT_USER' => $TEXT['USER'],
1072
		'TEXT_GROUP' => $TEXT['GROUP'],
1073
		'TEXT_OTHERS' => $TEXT['OTHERS'],
1074
		'TEXT_READ' => $TEXT['READ'],
1075
		'TEXT_WRITE' => $TEXT['WRITE'],
1076
		'TEXT_EXECUTE' => $TEXT['EXECUTE'],
979
		'TEXT_CHANGES' => $mLang->TEXT_CHANGES,
980
		'TEXT_FILES' => strtoupper(substr($mLang->TEXT_FILES, 0, 1)).substr($mLang->TEXT_FILES, 1),
1077 981
		'TEXT_WARN_PAGE_LEAVE' => '',
1078
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $TEXT['WORLD_WRITEABLE_FILE_PERMISSIONS'],
1079
		'MODE_SWITCH_WARNING' => $MESSAGE['SETTINGS_MODE_SWITCH_WARNING'],
1080
		'WORLD_WRITEABLE_WARNING' => $MESSAGE['SETTINGS_WORLD_WRITEABLE_WARNING'],
982
		'TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS' => $mLang->TEXT_WORLD_WRITEABLE_FILE_PERMISSIONS,
983
		'MODE_SWITCH_WARNING' => $mLang->MESSAGE_SETTINGS_MODE_SWITCH_WARNING,
984
		'WORLD_WRITEABLE_WARNING' => $mLang->MESSAGE_SETTINGS_WORLD_WRITEABLE_WARNING
1081 985
		));
1082 986

  
1083 987
if($is_advanced && $admin->get_user_id()=='1')
branches/2.8.x/wb/admin/preferences/index.php
4 4
 * @category        admin
5 5
 * @package         preferences
6 6
 * @author          Ryan Djurovich, WebsiteBaker Project
7
 * @copyright       2009-2011, Website Baker Org. e.V.
8
 * @link			http://www.websitebaker2.org/
7
 * @copyright       2009-2013, WebsiteBaker Org. e.V.
8
 * @link            http://www.websitebaker.org/
9 9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.x
10
 * @platform        WebsiteBaker 2.8.4
11 11
 * @requirements    PHP 5.2.2 and higher
12 12
 * @version         $Id$
13
 * @filesource		$HeadURL$
13
 * @filesource      $HeadURL$
14 14
 * @lastmodified    $Date$
15 15
 *
16 16
 */
......
22 22
// put all inside a function to prevent global vars
23 23
function build_page( &$admin, &$database )
24 24
{
25
	global $HEADING, $TEXT;
25
//	global $HEADING, $TEXT;
26 26
	include_once(WB_PATH.'/framework/functions-utf8.php');
27 27
	// Setup template object, parse vars to it, then parse it
28 28
	// Setup template object, parse vars to it, then parse it
......
30 30
	$template = new Template(dirname($admin->correct_theme_source('preferences.htt')));
31 31
	$template->set_file( 'page', 'preferences.htt' );
32 32
	$template->set_block( 'page', 'main_block', 'main' );
33
	$mLang = Translate::getinstance();
34
	$mLang->enableAddon('admin\preferences');
35
	$template->set_var($mLang->getLangArray());
36

  
33 37
// read user-info from table users and assign it to template
34 38
	$sql  = 'SELECT `display_name`, `username`, `email` FROM `'.TABLE_PREFIX.'users` ';
35 39
	$sql .= 'WHERE `user_id` = '.(int)$admin->get_user_id();
......
44 48
		}
45 49
	}
46 50
// read available languages from table addons and assign it to the template
47
	$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
48
	$sql .= 'WHERE `type` = \'language\' ORDER BY `directory`';
49
	if( $res_lang = $database->query($sql) )
50
	{
51
		$template->set_block('main_block', 'language_list_block', 'language_list');
52
		while( $rec_lang = $res_lang->fetchRow() )
53
		{
54
	        $langIcons = (empty($rec_lang['directory'])) ? 'none' : strtolower($rec_lang['directory']);
55
			$template->set_var('CODE',        $rec_lang['directory']);
56
			$template->set_var('NAME',        $rec_lang['name']);
57
			$template->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
58
			$template->set_var('SELECTED',    (LANGUAGE == $rec_lang['directory'] ? ' selected="selected"' : '') );
59
			$template->parse('language_list', 'language_list_block', true);
60
		}
61
	}
51
//	$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
52
//	$sql .= 'WHERE `type` = \'language\' ORDER BY `directory`';
53
//	if( $res_lang = $database->query($sql) )
54
//	{
55
//		$template->set_block('main_block', 'language_list_block', 'language_list');
56
//		while( $rec_lang = $res_lang->fetchRow(MYSQL_ASSOC) )
57
//		{
58
//	        $langIcons = (empty($rec_lang['directory'])) ? 'none' : strtolower($rec_lang['directory']);
59
//			$template->set_var('CODE',        $rec_lang['directory']);
60
//			$template->set_var('NAME',        $rec_lang['name']);
61
//			$template->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
62
//			$template->set_var('SELECTED',    (LANGUAGE == $rec_lang['directory'] ? ' selected="selected"' : '') );
63
//			$template->parse('language_list', 'language_list_block', true);
64
//		}
65
//	}
66

  
67
$aLangAddons = array();
68
$aLangBrowser = array();
69

  
70
// read available languages from table addons
71
$sql  = 'SELECT * FROM `'.TABLE_PREFIX.'addons` ';
72
$sql .= 'WHERE `type` = \'language\' ORDER BY `directory`';
73
if( $oLang = $database->query($sql) )
74
{
75
    while( $aLang = $oLang->fetchRow(MYSQL_ASSOC) )
76
    {
77
        $aLangAddons[$aLang['directory']] = $aLang['name'];
78
    }
79
}
80

  
81
// default, if no information from client available
82
$sAutoLanguage = DEFAULT_LANGUAGE;
83

  
84
$aLangUsed = array_flip(explode(',',$admin->GetLanguagesInUsed()));
85
$aLangUsed = array_intersect_key($aLangAddons, $aLangUsed);
86
$template->set_block('main_block', 'language_list_block', 'language_list');
87
foreach( $aLangUsed as $sDirectory => $sName  )
88
{
89
	$langIcons = ( empty($sDirectory) ? 'none' : strtolower($sDirectory));
90

  
91
	$template->set_var('CODE',        $sDirectory);
92
	$template->set_var('NAME',        $sName);
93
	$template->set_var('FLAG',        THEME_URL.'/images/flags/'.$langIcons);
94
	$template->set_var('SELECTED',    ( $_SESSION['LANGUAGE'] == $sDirectory ? ' selected="selected"' : '') );
95

  
96
	$template->parse('language_list', 'language_list_block', true);
97
}
98

  
62 99
// Insert default timezone values
63 100
	$user_time = true;
64 101
	include_once( ADMIN_PATH.'/interface/timezones.php' );
......
118 155
	$template->set_var('FTAN', $admin->getFTAN());
119 156
	$template->set_var('FORM_NAME', 'preferences_save');
120 157
// assign language vars
121
	$template->set_var(array( 'HEADING_MY_SETTINGS'      => $HEADING['MY_SETTINGS'],
122
                              'HEADING_MY_EMAIL'         => $HEADING['MY_EMAIL'],
123
                              'HEADING_MY_PASSWORD'      => $HEADING['MY_PASSWORD'],
124
                              'TEXT_SAVE'                => $TEXT['SAVE'],
125
                              'TEXT_RESET'               => $TEXT['RESET'],
126
                              'TEXT_DISPLAY_NAME'        => $TEXT['DISPLAY_NAME'],
127
                              'TEXT_USERNAME'            => $TEXT['USERNAME'],
128
                              'TEXT_EMAIL'               => $TEXT['EMAIL'],
129
                              'TEXT_LANGUAGE'            => $TEXT['LANGUAGE'],
130
                              'TEXT_TIMEZONE'            => $TEXT['TIMEZONE'],
131
                              'TEXT_DATE_FORMAT'         => $TEXT['DATE_FORMAT'],
132
                              'TEXT_TIME_FORMAT'         => $TEXT['TIME_FORMAT'],
133
                              'TEXT_CURRENT_PASSWORD'    => $TEXT['CURRENT_PASSWORD'],
134
                              'TEXT_NEW_PASSWORD'        => $TEXT['NEW_PASSWORD'],
135
                              'TEXT_RETYPE_NEW_PASSWORD' => $TEXT['RETYPE_NEW_PASSWORD'],
136
							  'TEXT_NEW_PASSWORD'        => $TEXT['NEW_PASSWORD'],
137
                              'TEXT_RETYPE_NEW_PASSWORD' => $TEXT['RETYPE_NEW_PASSWORD'],
138
							  'TEXT_NEED_CURRENT_PASSWORD' => $TEXT['NEED_CURRENT_PASSWORD'],
139
	                          'EMPTY_STRING'             => ''
158
	$template->set_var(array( 
159
                              'EMPTY_STRING'             => ''
140 160
                            )
141 161
                      );
142 162
// Parse template for preferences form
143 163
	$template->parse('main', 'main_block', false);
144 164
	$output = $template->finish($template->parse('output', 'page'));
165
	$mLang->disableAddon();
166

  
145 167
	return $output;
146 168
}
147 169
// test if valid $admin-object already exists (bit complicated about PHP4 Compatibility)
......
153 175
}
154 176
echo build_page($admin, $database);
155 177
$admin->print_footer();
156

  
157
?>

Also available in: Unified diff