Project

General

Profile

« Previous | Next » 

Revision 275

Added by stefan almost 19 years ago

Replace 'admin' by 'wb' in all account pages. Moved print_success and print_error code to class.wb.php. Added correct parameters to these functions in account pages.

View differences:

class.wb.php
31 31

  
32 32
*/
33 33

  
34
// Include PHPLIB template class
35
require_once(WB_PATH."/include/phplib/template.inc");
36

  
34 37
require_once(WB_PATH.'/framework/class.database.php');
35 38

  
36 39
class wb
......
193 196
		}
194 197
	}
195 198

  
199
	// Print a success message which then automatically redirects the user to another page
200
	function print_success($message, $redirect = 'index.php') {
201
		global $TEXT;
202
		$success_template = new Template(ADMIN_PATH.'/interface');
203
		$success_template->set_file('page', 'success.html');
204
		$success_template->set_block('page', 'main_block', 'main');
205
		$success_template->set_var('MESSAGE', $message);
206
		$success_template->set_var('REDIRECT', $redirect);
207
		$success_template->set_var('NEXT', $TEXT['NEXT']);
208
		$success_template->parse('main', 'main_block', false);
209
		$success_template->pparse('output', 'page');
210
	}
196 211
	
212
	// Print an error message
213
	function print_error($message, $link = 'index.php', $auto_footer = true) {
214
		global $TEXT;
215
		$success_template = new Template(ADMIN_PATH.'/interface');
216
		$success_template->set_file('page', 'error.html');
217
		$success_template->set_block('page', 'main_block', 'main');
218
		$success_template->set_var('MESSAGE', $message);
219
		$success_template->set_var('LINK', $link);
220
		$success_template->set_var('BACK', $TEXT['BACK']);
221
		$success_template->parse('main', 'main_block', false);
222
		$success_template->pparse('output', 'page');
223
		if($auto_footer == true) {
224
			$this->print_footer();
225
		}
226
		exit();
227
	}
228

  
197 229
}
198 230
?>

Also available in: Unified diff