forked from szerko/Respond2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pages.php
257 lines (188 loc) · 8.46 KB
/
pages.php
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
255
256
257
<?php
include 'app.php'; // import php files
$authUser = new AuthUser(); // get auth user
$authUser->Authenticate('All');
?>
<!DOCTYPE html>
<html>
<head>
<title><?php print $authUser->SiteName; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- include css -->
<link href="<?php print FONT; ?>" rel="stylesheet" type="text/css">
<link href="<?php print BOOTSTRAP_CSS; ?>" rel="stylesheet">
<link href="<?php print FONTAWESOME_CSS; ?>" rel="stylesheet">
<link type="text/css" href="css/app.css" rel="stylesheet">
<link type="text/css" href="css/messages.css" rel="stylesheet">
<link type="text/css" href="css/list.css" rel="stylesheet">
</head>
<body data-currpage="pages" data-timezone="<?php print $authUser->TimeZone; ?>">
<p id="message">
<span>Holds the message text.</span>
<a class="close" href="#"></a>
</p>
<?php include 'modules/menu.php'; ?>
<section class="main">
<nav>
<a class="show-menu"><i class="icon-reorder icon-large"></i></a>
<ul>
<li class="root" data-bind="click: switchPageType, css: {'active': friendlyId()=='root'}"><a data-friendlyid="root" data-pagetypeuniqid="-1" data-types="Page" data-typep="Pages">/</a></li>
<!--ko foreach: pageTypes -->
<li data-bind="css: {'active': friendlyId()==$parent.friendlyId()}"><a data-bind="text: dir, attr: {'data-friendlyid': friendlyId, 'data-pagetypeuniqid': pageTypeUniqId, 'data-types': typeS, 'data-typep': typeP}, click: $parent.switchPageType"></a> <i data-bind="click: $parent.showRemovePageTypeDialog" class="icon-minus-sign icon-large"></i></li>
<!--/ko -->
<li class="add"><i class="icon-plus-sign icon-large" data-bind="click: showAddPageTypeDialog"></i></li>
</ul>
<a class="primary-action" data-bind="click: showAddDialog"><i class="icon-plus-sign icon-large"></i> Add <span data-bind="text: typeS"></span></a>
</nav>
<div class="list" data-bind="foreach: pages">
<div class="listItem" data-bind="attr: { 'data-id': pageUniqId, 'data-name': name, 'data-isactive': isActive}, css: {'has-thumb': thumb()!=''}">
<span class="image" data-bind="if: thumb()!=''"><img height="75" width="75" data-bind="attr:{'src':thumb}"></span>
<a class="remove" data-bind="click: $parent.showRemoveDialog">
<i class="not-published icon-minus-sign icon-large"></i>
</a>
<h2><a data-bind="text:name, attr: { 'href': editUrl }"></a></h2>
<p data-bind="text:description"></p>
<em>Last updated <span data-bind="text:friendlyDate"></span> by <span data-bind="text:lastModifiedFullName"></span></em>
<span class="status" data-bind="css: { 'published': isActive() == 1, 'not-published': isActive() == 0 }, click: $parent.toggleActive">
<i class="not-published icon-circle-blank icon-large"></i>
<i class="published icon-ok-sign icon-large"></i>
</span>
</div>
<!-- /.listItem -->
</div>
<!-- /.list -->
<p data-bind="visible: pagesLoading()" class="list-loading"><i class="icon-spinner icon-spin"></i> Loading...</p>
<p data-bind="visible: pagesLoading()==false && pages().length < 1" class="list-none">No <span data-bind="text: typeP().toLowerCase()"></span> here. Click Add <span data-bind="text: typeS"></span> to get started.</p>
</section>
<!-- /.main -->
<div class="modal fade" id="addDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Add <span data-bind="text:typeS"></span></h3>
</div>
<div class="modal-body">
<div class="form-group">
<label for="name" class="control-label">Name:</label>
<input id="name" type="text" value="" maxlength="255" class="form-control">
</div>
<div class="form-group">
<label for="URL" class="control-label">Friendly URL:</label>
<input id="friendlyId" type="text" maxlength="128" value="" placeholder="page-name" class="form-control">
<span class="help-block">No spaces, no special characters, dashes allowed.</span>
</div>
<div class="form-group">
<label for="description" class="control-label">Description:</label>
<textarea id="description" class="form-control"></textarea>
</div>
</div>
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: addPage">Add <span data-bind="text: typeS"></span></button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="deleteDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Remove <span data-bind="text: typeS"></span></h3>
</div>
<div class="modal-body">
<p>
Are you sure that you want to remove <strong id="removeName">this page</strong>?
</p>
</div>
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: removePage">Remove <span data-bind="text: typeS"></span></button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="deletePageTypeDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Remove Page Type</h3>
</div>
<div class="modal-body">
<p>
Are you sure that you want to remove <strong id="removePageTypeName">this page type</strong>?
</p>
</div>
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: removePageType">Remove Type</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<div class="modal fade" id="addPageTypeDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3 id="AddEditTitle">Add Page Type</h3>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<div class="form-group">
<label for="typeS" class="control-label">Name (singular):</label>
<input id="typeS" value="" maxlength="100" class="form-control">
<span class="help-block">e.g.: Page, Blog, Product, etc.</span>
</div>
<div class="form-group">
<label for="typeP" class="control-label">Name (Plural):</label>
<input id="typeP" value="" maxlength="100" class="form-control">
<span class="help-block">e.g.: Pages, Blogs, Products, etc.</span>
</div>
<div class="form-group">
<label for="typeFriendlyId" class="control-label">Friendly URL:</label>
<input id="typeFriendlyId" value="" maxlength="50" class="form-control">
<span class="help-block">e.g. http://respondcms.com/[friendly-url]/. Must be lowercase with no spaces.</span>
</div>
</form>
<!-- /.form-horizontal -->
</div>
<!-- /.modal-body -->
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal">Close</button>
<button class="primary-button" data-bind="click: addPageType">Add Type</button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
</body>
<!-- include js -->
<script type="text/javascript" src="<?php print JQUERY_JS; ?>"></script>
<script type="text/javascript" src="<?php print JQUERYUI_JS; ?>"></script>
<script type="text/javascript" src="<?php print BOOTSTRAP_JS; ?>"></script>
<script type="text/javascript" src="<?php print KNOCKOUT_JS; ?>"></script>
<script type="text/javascript" src="js/helper/moment.min.js"></script>
<script type="text/javascript" src="js/global.js"></script>
<script type="text/javascript" src="js/messages.js"></script>
<script type="text/javascript" src="js/viewModels/models.js"></script>
<script type="text/javascript" src="js/viewModels/pagesModel.js" defer="defer"></script>
</html>