Project

General

Profile

« Previous | Next » 

Revision 5

Added by stefan about 19 years ago

Restructured frontend code and fixed various bugs

View differences:

settings.php
100 100
	$template->set_var('TEXT_MANAGE_SECTIONS', $HEADING['MANAGE_SECTIONS']);
101 101
} else {
102 102
	$template->set_var('DISPLAY_MANAGE_SECTIONS', 'none');
103
}
103
}

104 104

  
105 105
// Visibility
106 106
if($results_array['visibility'] == 'public') {
107 107
	$template->set_var('PUBLIC_SELECTED', ' selected');
108 108
} elseif($results_array['visibility'] == 'private') {
109
	$template->set_var('PRIVATE_SELECTED', ' selected');
109
	$template->set_var('PRIVATE_SELECTED', ' selected');

110 110
} elseif($results_array['visibility'] == 'registered') {
111
	$template->set_var('REGISTERED_SELECTED', ' registered');
111
	$template->set_var('REGISTERED_SELECTED', ' selected');
112 112
} elseif($results_array['visibility'] == 'hidden') {
113 113
	$template->set_var('HIDDEN_SELECTED', ' selected');
114 114
} elseif($results_array['visibility'] == 'none') {
......
309 309
				$template->parse('template_list', 'template_list_block', true);
310 310
			}
311 311
		}
312
	}
313
	// Unset all menu arrays
312
	}

313
	// Unset all menu arrays

314 314
	unset($menu);
315
}
316

  
317
// Menu list
318
if(MULTIPLE_MENUS == false) {
319
	$template->set_var('DISPLAY_MENU_LIST', 'none');
320
}
321
// Include template info file (if it exists)
322
if($results_array['template'] != '') {
323
	$template_location = WB_PATH.'/templates/'.$results_array['template'].'/info.php';
324
} else {
325
	$template_location = WB_PATH.'/templates/'.DEFAULT_TEMPLATE.'/info.php';
326
}
327
if(file_exists($template_location)) {
328
	require($template_location);
329
}
330
// Check if $menu is set
331
if(!isset($menu[1]) OR $menu[1] == '') {
332
	// Make our own menu list
333
	$menu[1] = $TEXT['MAIN'];
334
}
335
// Add menu options to the list
336
$template->set_block('main_block', 'menu_list_block', 'menu_list');
337
foreach($menu AS $number => $name) {
338
	$template->set_var('NAME', $name);
339
	$template->set_var('VALUE', $number);
340
	if($results_array['menu'] == $number) {
341
		$template->set_var('SELECTED', 'selected');
342
	} else {
343
		$template->set_var('SELECTED', '');
344
	}
345
	$template->parse('menu_list', 'menu_list_block', true);
346
}
347

  
348
// Language list
349
if($handle = opendir(WB_PATH.'/languages/')) {
315
}

316

  
317
// Menu list

318
if(MULTIPLE_MENUS == false) {

319
	$template->set_var('DISPLAY_MENU_LIST', 'none');

320
}

321
// Include template info file (if it exists)

322
if($results_array['template'] != '') {

323
	$template_location = WB_PATH.'/templates/'.$results_array['template'].'/info.php';

324
} else {

325
	$template_location = WB_PATH.'/templates/'.DEFAULT_TEMPLATE.'/info.php';

326
}

327
if(file_exists($template_location)) {

328
	require($template_location);

329
}

330
// Check if $menu is set

331
if(!isset($menu[1]) OR $menu[1] == '') {

332
	// Make our own menu list

333
	$menu[1] = $TEXT['MAIN'];

334
}

335
// Add menu options to the list

336
$template->set_block('main_block', 'menu_list_block', 'menu_list');

337
foreach($menu AS $number => $name) {

338
	$template->set_var('NAME', $name);

339
	$template->set_var('VALUE', $number);

340
	if($results_array['menu'] == $number) {

341
		$template->set_var('SELECTED', 'selected');

342
	} else {

343
		$template->set_var('SELECTED', '');

344
	}

345
	$template->parse('menu_list', 'menu_list_block', true);

346
}

347

  
348
// Language list

349
if($handle = opendir(WB_PATH.'/languages/')) {

350 350
	$template->set_block('main_block', 'language_list_block', 'language_list');
351 351
	while (false !== ($file = readdir($handle))) {
352
		if($file != '.' AND $file != '..' AND $file != 'CVS' AND $file != 'index.php') {
353
			// Include the languages info file
354
			require(WB_PATH.'/languages/'.$file);
355
			// Work-out if this language is selected
356
			if($language_code == $results_array['language']) { $selected = ' selected'; } else { $selected = ''; }
357
			// Set the language info
358
			$template->set_var(array('VALUE' => $language_code, 'SELECTED' => $selected, 'NAME' => $language_name));
359
			// Parse row
360
			$template->parse('language_list', 'language_list_block', true);
361
		}
362
	}
363
}
364
// Restore to original language
365
require(WB_PATH.'/languages/'.LANGUAGE.'.php');
352
		if($file != '.' AND $file != '..' AND $file != 'CVS' AND $file != 'index.php') {

353
			// Include the languages info file

354
			require(WB_PATH.'/languages/'.$file);

355
			// Work-out if this language is selected

356
			if($language_code == $results_array['language']) { $selected = ' selected'; } else { $selected = ''; }

357
			// Set the language info

358
			$template->set_var(array('VALUE' => $language_code, 'SELECTED' => $selected, 'NAME' => $language_name));

359
			// Parse row

360
			$template->parse('language_list', 'language_list_block', true);

361
		}

362
	}

363
}

364
// Restore to original language

365
require(WB_PATH.'/languages/'.LANGUAGE.'.php');

366 366

  
367 367
// Select disabled if searching is disabled
368 368
if($results_array['searching'] == 0) {
......
384 384
								'LAST_MODIFIED' => $MESSAGE['PAGES']['LAST_MODIFIED'],
385 385
								'TEXT_PAGE_TITLE' => $TEXT['PAGE_TITLE'],
386 386
								'TEXT_MENU_TITLE' => $TEXT['MENU_TITLE'],
387
								'TEXT_TYPE' => $TEXT['TYPE'],
387
								'TEXT_TYPE' => $TEXT['TYPE'],

388 388
								'TEXT_MENU' => $TEXT['MENU'],
389 389
								'TEXT_PARENT' => $TEXT['PARENT'],
390 390
								'TEXT_VISIBILITY' => $TEXT['VISIBILITY'],
391 391
								'TEXT_PUBLIC' => $TEXT['PUBLIC'],
392
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],
392
								'TEXT_PRIVATE' => $TEXT['PRIVATE'],

393 393
								'TEXT_REGISTERED' => $TEXT['REGISTERED'],
394
								'TEXT_NONE' => $TEXT['NONE'],
394
								'TEXT_NONE' => $TEXT['NONE'],

395 395
								'TEXT_HIDDEN' => $TEXT['HIDDEN'],
396 396
								'TEXT_TEMPLATE' => $TEXT['TEMPLATE'],
397 397
								'TEXT_TARGET' => $TEXT['TARGET'],
......
400 400
								'TEXT_NEW_WINDOW' => $TEXT['NEW_WINDOW'],
401 401
								'TEXT_SAME_WINDOW' => $TEXT['SAME_WINDOW'],
402 402
								'TEXT_ADMINISTRATORS' => $TEXT['ADMINISTRATORS'],
403
								'TEXT_PRIVATE_VIEWERS' => $TEXT['PRIVATE_VIEWERS'],
403
								'TEXT_PRIVATE_VIEWERS' => $TEXT['PRIVATE_VIEWERS'],

404 404
								'TEXT_REGISTERED_VIEWERS' => $TEXT['REGISTERED_VIEWERS'],
405 405
								'TEXT_DESCRIPTION' => $TEXT['DESCRIPTION'],
406 406
								'TEXT_KEYWORDS' => $TEXT['KEYWORDS'],
407
								'TEXT_SEARCHING' => $TEXT['SEARCHING'],
407
								'TEXT_SEARCHING' => $TEXT['SEARCHING'],

408 408
								'TEXT_LANGUAGE' => $TEXT['LANGUAGE'],
409 409
								'TEXT_ENABLED' => $TEXT['ENABLED'],
410 410
								'TEXT_DISABLED' => $TEXT['DISABLED'],
......
421 421
// Print admin footer
422 422
$admin->print_footer();
423 423

  
424
?>
424
?>

Also available in: Unified diff