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.admin.php
145 145
		$footer_template->pparse('output', 'page');
146 146
	}
147 147
	
148
	// Print a success message which then automatically redirects the user to another page
149
	function print_success($message, $redirect = 'index.php') {
150
		global $TEXT;
151
		$success_template = new Template(ADMIN_PATH.'/interface');
152
		$success_template->set_file('page', 'success.html');
153
		$success_template->set_block('page', 'main_block', 'main');
154
		$success_template->set_var('MESSAGE', $message);
155
		$success_template->set_var('REDIRECT', $redirect);
156
		$success_template->set_var('NEXT', $TEXT['NEXT']);
157
		$success_template->parse('main', 'main_block', false);
158
		$success_template->pparse('output', 'page');
159
	}
160
	
161
	// Print a error message
162
	function print_error($message, $link = 'index.php', $auto_footer = true) {
163
		global $TEXT;
164
		$success_template = new Template(ADMIN_PATH.'/interface');
165
		$success_template->set_file('page', 'error.html');
166
		$success_template->set_block('page', 'main_block', 'main');
167
		$success_template->set_var('MESSAGE', $message);
168
		$success_template->set_var('LINK', $link);
169
		$success_template->set_var('BACK', $TEXT['BACK']);
170
		$success_template->parse('main', 'main_block', false);
171
		$success_template->pparse('output', 'page');
172
		if($auto_footer == true) {
173
			$this->print_footer();
174
		}
175
		exit();
176
	}
177

  
178 148
	// Return a system permission
179 149
	function get_permission($name, $type = 'system') {
180 150
		// Append to permission type

Also available in: Unified diff