-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathhtmlEntities.inc
156 lines (140 loc) · 5.09 KB
/
htmlEntities.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?php
require_once 'config.inc';
/**
* html.inc is an includes file with HTML headers and HTML body
*
* @author talbot
*/
class HtmlEntities {
// NOWDOC fot HTML headers
private $HTML_HEADER = <<<'EOT'
<!doctype html>
<!--[if lt IE 8]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js ie9 oldie" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
EOT;
// NOWDOC for HTML head section
private $HTML_HEAD = <<<'EOT'
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.css">
<style>
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link rel="stylesheet" href="css/bootstrap-responsive.css">
<link rel="stylesheet" href="css/style.css">
<!-- <link rel="stylesheet/less" href="less/style.less"> -->
<!-- <script src="js/libs/less-1.2.1.min.js"></script> -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
EOT;
// NOWDOC for beginning of the BODY
private $HTML_BODY_START = <<<'EOT'
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">Project name</a>
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container">
<div class="hero-unit">
EOT;
// NOWDOC for login form
private $HTML_LOGIN_FORM = <<<'EOT'
<form id='login' action='server.php?action=login' method='post' accept-charset='UTF-8'>
<fieldset><legend>Login</legend>
<input type='hidden' name='submitted' id='submitted' value='1'/>
<label for='username' >UserName*:</label>
<input type='text' name='username' id='username' maxlength='50' />
<label for='password' >Password*:</label>
<input type='password' name='password' id='password' maxlength='50' />
<input type='submit' name='Submit' value='Submit' />
</fieldset></form>
EOT;
// NOWDOC for the end of the BODY
private $HTML_BODY_END = <<<'EOT'
</div><hr>
<footer><p>© Company 2012</p></footer>
</div> <!-- /container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<!-- script>
window.jQuery || document.write("<script src='js/libs/jquery-1.9.0.min.js'></script>");
</script -->
<script>
$("a").click(function() {
window.location = this.href;
});
</script>
<script src="js/libs/bootstrap/bootstrap-transition.js"></script>
<script src="js/libs/bootstrap/bootstrap-collapse.js"></script>
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>
<script>window.attachEvent("onload",function(){CFInstall.check({mode:"overlay"})})</script>
<![endif]-->
</body>
</html>
EOT;
private $HTML_ERROR_HEAD = <<<'EOT'
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>404 Error :: Page not Found</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.css">
<style>
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link rel="stylesheet" href="css/bootstrap-responsive.css">
<link rel="stylesheet" href="css/style.css">
<!-- <link rel="stylesheet/less" href="less/style.less"> -->
<!-- <script src="js/libs/less-1.2.1.min.js"></script> -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
EOT;
private $HTML_ERROR_BODY_START = <<<EOT
<h1>Error 404</h1>
<h3><em>Page you are looking for is not found on this server.</em></h3>
<br><h2><a href="
EOT;
private $HTML_ERROR_BODY_END = '">Return to Home Page.</a></h2>';
public function getLoginPage() {
$loginPage = $this->HTML_HEADER . $this->HTML_HEAD . $this->HTML_BODY_START . $this->HTML_LOGIN_FORM . $this->HTML_BODY_END;
return $loginPage;
}
public function getErrorPage() {
$errorPage = $this->HTML_HEADER . $this->HTML_ERROR_HEAD . $this->HTML_BODY_START . $this->HTML_ERROR_BODY_START . Config::getInstallPath() . $this->HTML_ERROR_BODY_END . $this->HTML_BODY_END;
return $errorPage;
}
}