forked from szerko/Respond2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyles.php
164 lines (116 loc) · 5 KB
/
styles.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
<?php
include 'app.php'; // import php files
$authUser = new AuthUser(); // get auth user
$authUser->Authenticate('Admin');
Utilities::SetLanguage($authUser->Language); // set language
?>
<!DOCTYPE html>
<html lang="<?php print str_replace('_', '-', $authUser->Language) ?>">
<head>
<title><?php print _("Stylesheets"); ?>—<?php print $authUser->SiteName; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- include css -->
<?php include 'modules/css.php'; ?>
<link type="text/css" href="js/helper/codemirror/codemirror.css?v=<?php print VERSION; ?>" rel="stylesheet">
</head>
<body data-currpage="styles">
<?php include 'modules/menu.php'; ?>
<!-- messages -->
<input id="msg-updating" value="<?php print _("Updating..."); ?>" type="hidden">
<input id="msg-updated" value="<?php print _("Styles updated successfully"); ?>" type="hidden">
<input id="msg-updating-error" value="<?php print _("There was a problem saving the style file, please try again"); ?>" type="hidden">
<input id="msg-name-required" value="<?php print _("A name is required to add a stylesheet"); ?>" type="hidden">
<input id="msg-style-adding" value="<?php print _("Adding..."); ?>" type="hidden">
<input id="msg-style-added" value="<?php print _("Stylesheet successfully added"); ?>" type="hidden">
<input id="msg-style-adding-error" value="<?php print _("Adding..."); ?>" type="hidden">
<input id="msg-style-removing" value="<?php print _("Removing..."); ?>" type="hidden">
<input id="msg-style-removed" value="<?php print _("Stylesheet successfully removed"); ?>" type="hidden">
<input id="msg-style-removing-error" value="<?php print _("There was a problem removing the stylesheet, please try again"); ?>" type="hidden">
<section class="main">
<nav>
<a class="show-menu"><i class="fa fa-bars fa-lg"></i></a>
<div class="fs-container full">
<div class="fs">
<ul>
<!-- ko foreach: files -->
<li data-bind="css: name"><a data-bind="text: file, click: $parent.updateContent"></a><i data-bind="click: $parent.showRemoveDialog" class="fa fa-minus-circle fa-lg"></i></li>
<!-- /ko -->
<li class="add"><i class="fa fa-plus-circle fa-lg" data-bind="click: showAddDialog"></i></li>
</ul>
</div>
<!-- /.fs -->
</div>
<!-- /.fs-container -->
</nav>
<div class="codemirror-block">
<textarea id="content" spellcheck="false" data-bind="value: content"></textarea>
</div>
<div class="actions">
<button class="primary-button" data-bind="click: save"><?php print _("Save"); ?></button>
</div>
</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">x</button>
<h3><?php print _("Add Stylesheet"); ?></h3>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<div class="form-group">
<label for="name"><?php print _("Name:"); ?></label>
<input id="name" type="text" class="form-control">
<span class="help-block"><?php print _("Lowercase, no spaces, leave the .less off"); ?></span>
</div>
</div>
<!-- /.modal-body -->
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal"><?php print _("Close"); ?></button>
<button class="primary-button" data-bind="click: addStylesheet"><?php print _("Add Stylesheet"); ?></button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal-body -->
</div>
<!-- /.modal -->
<div class="modal fade" id="removeDialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">x</button>
<h3><?php print _("Remove Stylesheet"); ?></h3>
</div>
<!-- /.modal-header -->
<div class="modal-body">
<p>
<?php print _("Confirm that you want to remove:"); ?> <strong id="removeName">this styleshet</strong>
</p>
</div>
<!-- /.modal-body -->
<div class="modal-footer">
<button class="secondary-button" data-dismiss="modal"><?php print _("Close"); ?></button>
<button class="primary-button" data-bind="click: removeStylesheet"><?php print _("Remove Stylesheet"); ?></button>
</div>
<!-- /.modal-footer -->
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal-body -->
</div>
<!-- /.modal -->
</body>
<!-- include js -->
<?php include 'modules/js.php'; ?>
<script type="text/javascript" src="js/helper/codemirror/codemirror.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/helper/codemirror/mode/css/css.js?v=<?php print VERSION; ?>"></script>
<script type="text/javascript" src="js/viewModels/stylesModel.js?v=<?php print VERSION; ?>"></script>
</html>