This repository was archived by the owner on May 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.php
More file actions
254 lines (235 loc) · 9.17 KB
/
Copy pathadmin.php
File metadata and controls
254 lines (235 loc) · 9.17 KB
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Configuration</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet/less" href="less/style.less">
<script src="js/libs/less-1.3.0.min.js"></script>
<!-- Use SimpLESS (Win/Linux/Mac) or LESS.app (Mac) to compile your .less files
to style.css, and replace the 2 lines above by this one:
<link rel="stylesheet" href="less/style.css">
-->
<script src="js/libs/modernizr-2.5.3-respond-1.1.0.min.js"></script>
</head>
<body>
<?php
require("loader.php");
$action = new Action("myAction", "This is a first action that should create a file");
$db = new Database();
?>
<!--[if lt IE 7]><div class="alert alert-warn"><a class="close" data-dismiss="alert" href="#">×</a><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p></div><![endif]-->
<div class="container">
<ul class="breadcrumb">
<li>
<a href="index.php"> <i class="icon-dashboard"></i> Dashboard</a><span class="divider">/</span>
</li>
<li class="active">
<i class="icon-settings"></i> Configuration
</li>
</ul>
<ul class="nav nav-tabs">
<li class="active">
<a href="#admin_pages" data-toggle="tab">Pages</a>
</li>
<li>
<a href="#admin_actions" data-toggle="tab">Actions</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="admin_pages">
<?php
$result = $db -> loadFromBase('page');
if (count($result) > 0) {
echo '
<table class="table table-striped">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Description</th>
<th>Icon</th>
<th>Link</th>
<th>Actions</th>
<th></th>
</tr>
</thead>
<tbody>';
foreach ($result as $value) {
echo '
<tr>
<td>' . $value -> _id . '</td>
<td>' . $value -> _title . '</td>
<td>' . $value -> _content . '</td>
<td>' . $value -> _icon . '</td>
<td>' . $value -> _link . '</td>
<td>' . $value -> actionsToString() . '</td>
<td>
<a href="#" class="btn btn-primary btn-mini"><i class="icon-edit icon-white"></i> Modify</a>
<a href="#" class="btn btn-danger btn-mini"><i class="icon-remove icon-white"></i> Delete</a>
</td>
</tr>';
}
echo '
</tbody>
</table>';
} else
echo '<div class="alert alert-info">No element found in the database for pages.</div>';
?>
<div class="well row" style="margin: 0 auto !important;">
<a id="collapse_add_page" class="close" href="#">−</a>
<div id="collapsable_add_page">
<div class="span5">
<h4>Add a page</h4>
<hr />
<form id="form_add_page" name="form_add_page" method="post" action="test.php">
<div class="input-prepend">
<span class="add-on prepend-mini">Title</span><input type="text" class="span3" name="page_title" placeholder="Enter page title…"> <span class="label label-important">* required</span>
</div>
<span class="help-block">Example block-level help text here.</span>
<div class="input-prepend">
<span class="add-on prepend-mini">Content</span><textarea type="text" class="span3" name="page_content" placeholder="Enter page content…" rows="3" style="resize: vertical;"></textarea> <span class="label label-important">* required</span>
</div>
<span class="help-block">Example block-level help text here.</span>
<div class="input-prepend">
<span class="add-on prepend-mini">Icon</span><select id="page_icon" name="page_icon" class="span3">
<?php
$dirPath = dir('img/icon/');
$imgArray = array();
while (($file = $dirPath -> read()) !== false) {
if ((substr($file, -3) == "gif") || (substr($file, -3) == "jpg") || (substr($file, -3) == "png")) {
$imgArray[] = trim($file);
}
}
$dirPath -> close();
sort($imgArray);
$c = count($imgArray);
for ($i = 0; $i < $c; $i++) {
echo "<option value=\"" . $imgArray[$i] . "\">" . $imgArray[$i] . "</option>\n";
}
?>
</select>
</div>
<span class="help-block">Example block-level help text here.</span>
<div class="input-prepend">
<span class="add-on prepend-mini">Link</span><input type="text" class="span3" name="page_link" placeholder="Enter page link…"> <span class="label label-important">* required</span>
</div>
<span class="help-block">Example block-level help text here.</span>
<button type="submit" class="btn">Submit</button>
</form>
</div>
<div class="span5">
<ul class="nav nav-tabs">
<li class="active">
<a href="#icon_preview" data-toggle="tab">Icon preview</a>
</li>
<li>
<a href="#page_preview" data-toggle="tab">Page preview</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="icon_preview">
<img id="preview-icon-mini" src=""/> <img id="preview-icon-maxi" src=""/>
</div>
<div class="tab-pane" id="page_preview">
<span class="loading"> </span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane" id="admin_actions">
<?php
$result = $db -> loadFromBase('action');
if (count($result) > 0) {
echo '
<table class="table table-striped">
<thead>
<tr>
<th>Id</th>
<th>Title</th>
<th>Content</th>
<th>Actions</th>
</tr>
</thead>
<tbody>';
foreach ($result as $value) {
echo '
<tr>
<td>' . $value -> _id . '</td>
<td class="editable">' . $value -> _name . '</span></td>
<td class="editable">' . $value -> _description . '</span></td>
<td>
<button class="btn btn-primary btn-mini modify"><i class="icon-edit icon-white"></i> Modify</button>
<button class="btn btn-danger btn-mini delete"><i class="icon-remove icon-white"></i> Delete</button>
</td>
</tr>';
}
echo '
</tbody>
</table>';
} else
echo '<div class="alert alert-info">No element found in the database for actions.</div>';
?>
<div class="well row" style="margin: 0 auto !important;">
<a id="collapse_add_action" class="close" href="#">−</a>
<div id="collapsable_add_action">
<div class="span5">
<h4>Add an action</h4>
<hr />
<form id="form_add_action" name="form_add_action" method="post" action="test.php">
<div class="input-prepend">
<span class="add-on prepend-mini">Name</span><input type="text" class="span3" name="action_name" placeholder="Enter action name…"> <span class="label label-important">* required</span>
</div>
<span class="help-block">Example block-level help text here.</span>
<div class="input-prepend">
<span class="add-on prepend-mini">Description</span><textarea type="text" class="span3" name="action_description" placeholder="Enter action description…" rows="3" style="resize: vertical;"></textarea> <span class="label label-important">* required</span>
</div>
<span class="help-block">Example block-level help text here.</span>
<button type="submit" class="btn">Submit</button>
</form>
</div>
<div class="span5">
<div id="action_preview">
<img id="preview-icon-mini" src=""/> <img id="preview-icon-maxi" src=""/>
</div>
</div>
</div>
</div>
</div>
</div>
<hr>
<footer>
<div class="row">
<h3>
<div class="span3">
<span><?php echo APP_NAME
?></span>
</div>
<div class="span4 offset5">
<span class="pull-right"> <span id="jclock"></span> </span>
</div></h3>
</div>
</footer>
</div>
<!-- /container -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/libs/jquery-1.7.2.min.js"><\/script>')
</script>
<script src="js/libs/jquery.jclock.js"></script>
<!-- scripts concatenated and minified via ant build script-->
<script src="js/libs/bootstrap/bootstrap.min.js"></script>
<script src="js/plugins.js"></script>
<script src="js/script.js"></script>
<!-- end scripts-->
</body>
</html>