1 |
<?php |
2 |
/** |
3 |
* This file contains the HTMLRedirectPage class |
4 |
* |
5 |
* $Id: HTMLRedirectPage.inc,v 1.6 2003/07/30 18:47:33 hemna Exp $ |
6 |
* |
7 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
8 |
* @package phpHtmlLib |
9 |
*/ |
10 |
|
11 |
|
12 |
/** |
13 |
* This builds an entire HTML Page |
14 |
* with the sole purpose of doing a redirect to another url. |
15 |
* |
16 |
* @author Walter A. Boring IV <waboring@buildabetterweb.com> |
17 |
* @package phpHtmlLib |
18 |
*/ |
19 |
class HTMLRedirectPage extends HTMLPageClass { |
20 |
|
21 |
/** |
22 |
* The constructor |
23 |
* |
24 |
* @param string - the title of the page |
25 |
* @param string - the url to redirect to |
26 |
* @param boolean - do we show the fallback message? |
27 |
* @param boolean - do we want to destroy a frameset |
28 |
* with the redirect? |
29 |
* @param boolean - do we want to use a Javascript |
30 |
* window.location call? |
31 |
*/ |
32 |
function HTMLRedirectPage($title, $url, $showMessage=false, |
33 |
$destroy_frameset=FALSE, |
34 |
$usejs=TRUE) { |
35 |
$this->HTMLPageClass($title); |
36 |
$this->set_refresh($url); |
37 |
|
38 |
if ($usejs) { |
39 |
if ($destroy_frameset) { |
40 |
$this->add_head_js("top.location = '".$url."';"); |
41 |
} else { |
42 |
$this->add_head_js("window.location = '".$url."';"); |
43 |
} |
44 |
} |
45 |
|
46 |
if ($showMessage) { |
47 |
//add helper link |
48 |
$p = html_p("If you are not automatically redirected, ", |
49 |
"please click ", |
50 |
html_a($url, "here")); |
51 |
$p->set_collapse(); |
52 |
$this->add( $p ); |
53 |
} |
54 |
} |
55 |
} |
56 |
?> |