".make_form(make_link("source_history/revert"))."
					
					 
				
			
		";
		$history_html = $start_string . $history_list . $end_string;
		$page->set_title('Image '.$image_id.' Source History');
		$page->set_heading('Source History: '.$image_id);
		$page->add_block(new NavBlock());
		$page->add_block(new Block("Source History", $history_html, "main", 10));
	}
	public function display_global_page(Page $page, /*array*/ $history, /*int*/ $page_number) {
		$start_string = "
			
		";
		global $user;
		$history_list = "";
		foreach($history as $fields)
		{
			$current_id = $fields['id'];
			$image_id = $fields['image_id'];
			$current_source = html_escape($fields['source']);
			$name = $fields['name'];
			$h_ip = $user->can("view_ip") ? " ".show_ip($fields['user_ip'], "Sourcing Image #$image_id as '$current_source'") : "";
			$setter = "".html_escape($name)." $h_ip";
			$history_list .= '
				
					 
					'.$image_id.' :
					'.$current_source.' (Set by '.$setter.')
				 
			';
		}
		$history_html = $start_string . $history_list . $end_string;
		$page->set_title("Global Source History");
		$page->set_heading("Global Source History");
		$page->add_block(new Block("Source History", $history_html, "main", 10));
		$h_prev = ($page_number <= 1) ? "Prev" :
			'Prev ';
		$h_index = "Index ";
		$h_next = 'Next ';
		$nav = $h_prev.' | '.$h_index.' | '.$h_next;
		$page->add_block(new Block("Navigation", $nav, "left"));
	}
	/*
	 * Add a section to the admin page.
	 */
	public function display_admin_block(/*string*/ $validation_msg='') {
		global $page;
		
		if (!empty($validation_msg)) {
			$validation_msg = ''. $validation_msg .' ';
		}
		
		$html = '
			Revert source changes/edit by a specific IP address or username.
			 You can restrict the time frame to revert these edits as well.
			 (Date format: 2011-10-23)
			'.$validation_msg.'
			 '.make_form(make_link("source_history/bulk_revert"), 'POST')."
				
			
		";
		$page->add_block(new Block("Mass Source Revert", $html));
	}
	
	/*
	 * Show a standard page for results to be put into
	 */
	public function display_revert_ip_results() {
		global $page;
		$html = implode($this->messages, "\n");
		$page->add_block(new Block("Bulk Revert Results", $html));
	}
	
	public function add_status(/*string*/ $title, /*string*/ $body) {
		$this->messages[] = ''. $title .'  '. $body .'
';
	}
}
?>