Project

General

Profile

« Previous | Next » 

Revision 929

Added by doc almost 16 years ago

Redirect time for function print_success can now be defined in Settings (ticket #603)

View differences:

class.wb.php
269 269

  
270 270
	// Print a success message which then automatically redirects the user to another page
271 271
	function print_success($message, $redirect = 'index.php') {
272
		global $TEXT;
272
		global $TEXT, $database;
273
		
274
		// fetch redirect timer for sucess messages from settings table
275
		$table = TABLE_PREFIX . 'settings';
276
		$results = @$database->get_one("SELECT `value` FROM `$table` WHERE `name` = 'redirect_timer'");
277
		$redirect_timer = ($results) ? $results : '1500';
278

  
279
		// add template variables
273 280
		$success_template = new Template(ADMIN_PATH.'/interface');
274 281
		$success_template->set_file('page', 'success.html');
275 282
		$success_template->set_block('page', 'main_block', 'main');
276 283
		$success_template->set_var('MESSAGE', $message);
277 284
		$success_template->set_var('REDIRECT', $redirect);
285
		$success_template->set_var('REDIRECT_TIMER', $redirect_timer);
278 286
		$success_template->set_var('NEXT', $TEXT['NEXT']);
279 287
		$success_template->parse('main', 'main_block', false);
280 288
		$success_template->pparse('output', 'page');

Also available in: Unified diff