White Label CMS - Version 1.6.2

Version Description

Fixed deprecated php function

Download this release

Release Info

Developer VideoUserManuals
Plugin Icon 128x128 White Label CMS
Version 1.6.2
Comparing to
See all releases

Version 1.6.2

css/editor.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ .mceContentBody
2
+ {
3
+ background-color: black;
4
+ }
css/wlcms_style.css ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .wlcms_section {/*margin-bottom:15px*/}
2
+ /* Custom CSS */
3
+ #wlcms-footer-container {
4
+ float: left;
5
+ margin-left: 15px;
6
+ }
7
+ p#safari-fix {
8
+ display: none;
9
+ }
10
+ #wlcms-footer-logo {
11
+ float:left;
12
+ padding-right: 10px;
13
+ }
14
+
15
+ .video-container {
16
+ margin-right: 20px;
17
+ float: left;
18
+ text-align: center;
19
+ margin-bottom: 20px;
20
+ }
21
+ .video-container img {
22
+ margin-bottom: 6px;
23
+ }
24
+ .wlcms_wrap{
25
+ width:740px;
26
+ }
27
+
28
+ .wlcms_section{
29
+ border:1px solid #ddd;
30
+ border-bottom:0;
31
+ background:#f9f9f9;
32
+ }
33
+ .wlcms_opts label{
34
+ font-size:12px;
35
+ font-weight:700;
36
+ width:200px;
37
+ display:block;
38
+ float:left;
39
+ }
40
+ .wlcms_input {
41
+ clear:both;
42
+ padding:30px 10px;
43
+ border-bottom:1px solid #ddd;
44
+ border-top:1px solid #fff;
45
+ overflow: hidden;
46
+ }
47
+
48
+ #wlcms_o_head_cap {margin-top:10px;padding-left:30px}
49
+
50
+ /**************************/
51
+ .wlcms_radioinput {
52
+ padding:30px 10px;
53
+
54
+ }
55
+ .wlcms_input_message1 {
56
+ padding: 10px 10px;
57
+ border-bottom: 1px solid #ddd;
58
+ }
59
+ /**************************/
60
+ .wlcms_input_profile {
61
+ padding:30px 10px 10px 10px;
62
+ }
63
+ .wlcms_checkbox_last {
64
+ /*padding:10px 10px 30px 10px;*/
65
+ clear:left;
66
+ padding: 3px 3px 20px 3px;
67
+ border-bottom:1px solid #ddd;
68
+ }
69
+ .wlcms_input_local_video {
70
+ padding: 3px;
71
+ clear:both;
72
+ }
73
+ .wlcms_input_message {
74
+ padding: 10px 10px 0;
75
+ border-bottom: none;
76
+ }
77
+ .wlcms_input_welcome_last {
78
+ padding:10px 10px 30px 10px;
79
+ border-bottom:1px solid #ddd;
80
+ }
81
+ .wlcms_opts small{
82
+ display:block;
83
+ float:right;
84
+ width:200px;
85
+ color:#999;
86
+ }
87
+ .wlcms_opts input[type="text"], .wlcms_opts select{
88
+ width:250px;
89
+ font-size:12px;
90
+ padding:4px;
91
+ color:#333;
92
+ line-height:1em;
93
+ background:#f3f3f3;
94
+ }
95
+ /***************************************************************************************************************/
96
+ .wlcms_optsnew input[type="text"], .wlcms_optsnew select{
97
+ width:125px;
98
+ font-size:12px;
99
+ padding:4px;
100
+ color:#333;
101
+ line-height:1em;
102
+ background:#f3f3f3;
103
+ }
104
+ /***************************************************************************************************************/
105
+ .wlcms_input input:focus, .wlcms_input_welcome_last textarea:focus{
106
+ background:#fff;
107
+ }
108
+ .wlcms_input_welcome_last textarea{
109
+ width:280px;
110
+ height:280px;
111
+ font-size:10px;
112
+ padding:4px;
113
+ color:#333;
114
+ line-height:1.5em;
115
+ background:#f3f3f3;
116
+ }
117
+ .wlcms_title h3 {
118
+ cursor:pointer;
119
+ font-size:1em;
120
+ text-transform: uppercase;
121
+ margin:0;
122
+ font-weight:bold;
123
+ color:#232323;
124
+ float:left;
125
+ width:80%;
126
+ padding:14px 4px 4px;
127
+ }
128
+
129
+ .wlcms_title{
130
+ cursor:pointer;
131
+ border-bottom:1px solid #ddd;
132
+ background:#fff ;
133
+ padding:0;
134
+ }
135
+
136
+ .wlcms_title h3 img.inactive{
137
+ margin:-8px 10px 0 2px;
138
+ width:32px;
139
+ height:32px;
140
+ background:url('../images/pointer.png') no-repeat 0 0;
141
+ float:left;
142
+ -moz-border-radius:6px;
143
+ border:1px solid #ccc;
144
+ }
145
+
146
+ .wlcms_subtitle{
147
+ cursor:pointer;
148
+ border-bottom:1px solid #ddd;
149
+ background:#eee;
150
+ padding:0;
151
+ }
152
+ .wlcms_subtitle h3{
153
+ margin:-8px 10px 0 2px;
154
+ height:10px;
155
+ float:left;
156
+ -moz-border-radius:6px;
157
+ padding: 22px 8px;
158
+ }
159
+ .wlcms_title h3 img.active{
160
+ margin:-8px 10px 0 2px;
161
+ width:32px;
162
+ height:32px;
163
+ background:url('../images/pointer.png') no-repeat 0 -32px;
164
+ float:left;
165
+ -moz-border-radius:6px;
166
+ -webkit-border-radius:6px;
167
+ border:1px solid #ccc;
168
+ }
169
+
170
+ .wlcms_title h3:hover img{
171
+ border:1px solid #999;
172
+ }
173
+ .wlcms_options h4 {
174
+ font-size: 1.1em;
175
+ padding: 1.33em 0 1em 10px;
176
+ margin: 0;
177
+ }
178
+
179
+ .wlcms_title span.submit{
180
+ display:block;
181
+ float:right;
182
+ margin:0;
183
+ padding:0;
184
+ width:15%;
185
+ padding:12px 0;
186
+ }
187
+
188
+ .clearfix{
189
+ clear:both;
190
+ }
191
+
192
+ .wlcms_table th, .wlcms_table td{
193
+ border:1px solid #bbb;
194
+ padding:10px;
195
+ text-align:center;
196
+ }
197
+
198
+ .wlcms_table th, .wlcms_table td.feature{
199
+ border-color:#888;
200
+ }
201
+ .wlcms_opts label.radioyesno {
202
+ width: 50px;
203
+ }
204
+ .wlcms_opts label.radioCustom {
205
+ width: 80px;
206
+ }
207
+ .wlcms_opts label.radioWebsite {
208
+ width: 80px;
209
+ }
210
+ .wlcms_opts label.radioBlog {
211
+ width: 60px;
212
+ }
213
+ /*.pretty-hover {
214
+ background-color: #EEEEEE;
215
+ }*/
216
+ #vVideoVariables .wlcms_input {
217
+ border-bottom: none;
218
+ border-top:none;
219
+ padding:10px 10px;
220
+ }
221
+ #wlcm-reset {
222
+ margin: 0;
223
+ padding-top: 0;
224
+ }
225
+ .wlcms-icon32 {
226
+ float:left;
227
+ height:36px;
228
+ margin:0 6px 0 0;
229
+ width:36px;
230
+ }
231
+ #wlcms_o_header_height{
232
+ width:46px;
233
+ }
234
+ #wlcms_o_header_custom_logo_width{
235
+ width:46px;
236
+ }
237
+ #wlcms_o_welcome_visible_to{
238
+ width:80px;
239
+ }
240
+ #wlcms_o_footer_custom_logo_width{
241
+ width:46px;
242
+ }
243
+ #wlcms_o_welcome_visible_to1{
244
+ width:110px;
245
+ }
246
+ .wlcms_input_local_video wlcms_checkbox{
247
+
248
+ float:left;
249
+ }
250
+
251
+ #wlcms_o_hide_post_div{
252
+ padding:0 0 0 200px;
253
+ margin-top:-35px;
254
+ float:left;
255
+ width:100px;}
256
+ #wlcms_o_hide_post_divnew{
257
+ padding:0 0 0 50px;
258
+ float:left;
259
+ width:200px;
260
+ margin-top:-35px;
261
+ }
262
+ #wlcms_o_hide_page_div{
263
+ padding:0 0 0 200px;
264
+ float:left;
265
+ margin-top:-35px;
266
+ width:140px;
267
+ }
268
+ #wlcms_o_hide_page_divnew{
269
+ padding:0 0 0px 10px;
270
+ float:left;
271
+ width:200px;
272
+ margin:-35px 0 10px 0;
273
+ }
274
+ #wlcms_o_hide_page_divmain{
275
+ }
276
+ ul.role_name_editor{
277
+ width:650px;}
278
+ ul.role_name_editor li{
279
+ float:left;
280
+ width:200px;
281
+ height:auto;
282
+ }
283
+ #wlcms_o_welcome_visible_to{
284
+ width:110px;
285
+ }
286
+ .wlcms_o_parent_label{
287
+ width:15px;
288
+ height:15px;
289
+ float:left;
290
+ display:block;
291
+ background:url('../images/arrow.gif') no-repeat 5px 2px !important;
292
+ cursor:pointer;
293
+ padding:0 0 0 20px;
294
+ }
295
+ .wlcms_o_parent_label_active{
296
+ background:url('../images/arrow-down.gif') no-repeat 2px 5px !important;
297
+ padding:0 0 0 20px;
298
+
299
+ }
300
+ .wlcms_o_child_label{
301
+ padding:0 0 0 20px;}
302
+
303
+ .wlcms_options .plugin-count, .wlcms_options .pending-count, .wlcms_options .update-count {display:none}
304
+
305
+ #menus {margin-left:10px}
306
+ #menus li {margin-bottom:10px}
307
+ #menus li ul {padding-top:3px}
308
+ #menus li li {margin:0 0 3px 15px}
309
+ #menus li em {font-style:normal;font-weight:bold;color:#006699}
310
+ #menus li strong {cursor:pointer}
311
+
312
+ #wlcms-footer-container {position:relative}
313
+ #wlcms-footer-container span {position:absolute;top:20%;width:500px}
314
+
315
+ #form-show-template { border-top: none; padding: 10px;}
316
+
317
+ .lineup {float:left}
318
+
319
+ #vTheAppearanceMenu .wlcms_checkbox {padding:5px 10px}
320
+ #vTheAppearanceMenu .wlcms_text {padding-bottom:15px;border-bottom: 1px solid #DDD}
images/WPElevation-WP-Skyscaper-Button-157x40.gif ADDED
Binary file
images/WPElevatoon-WP-Skyscraper-Image-232x337.jpg ADDED
Binary file
images/arrow-down.gif ADDED
Binary file
images/arrow.gif ADDED
Binary file
images/arrow.jpg ADDED
Binary file
images/arrow.png ADDED
Binary file
images/arrows-dark-vs.png ADDED
Binary file
images/better-ebooks-ad.jpg ADDED
Binary file
images/better-ebooks-ad.png ADDED
Binary file
images/download-button.png ADDED
Binary file
images/pointer.png ADDED
Binary file
images/privacy.png ADDED
Binary file
images/screenshot-1.png ADDED
Binary file
images/screenshot-2.png ADDED
Binary file
images/screenshot-3.png ADDED
Binary file
images/screenshot-4.png ADDED
Binary file
images/screenshot-5.png ADDED
Binary file
images/toggle-arrow.gif ADDED
Binary file
images/trans.png ADDED
Binary file
images/wlcms-plugin-advert.png ADDED
Binary file
includes/admin.config.php ADDED
@@ -0,0 +1,647 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $wlcmsShortName = "wlcms_o";
4
+
5
+
6
+
7
+ global $wp_version, $submenu;
8
+
9
+ $wlcmsOptions = array(
10
+ array( "name" => "White Label CMS Options", "type" => "title"),
11
+ array( "name" => "Branding", "type" => "section"),
12
+ array( "type" => "open"),
13
+ array( "name" => "Admin Bar", "type" => "subtitle")
14
+ );
15
+
16
+ if ( version_compare( $wp_version, '3.2.5', '>=' ) )
17
+ {
18
+ $wlcmsOptions[] = array(
19
+ "name" => "Hide WordPress Logos",
20
+ "desc" => "Hide WordPress logo from the admin bar and home icon",
21
+ "id" => $wlcmsShortName."_hide_wp_adminbar",
22
+ "type" => "radio",
23
+ "options" => array("1", "0"),
24
+ "std" => 0);
25
+ $wlcmsOptions[] = array(
26
+ "name" => "Add Your Logo (16px x 16px)",
27
+ "desc" => "Adds a 16px logo to the admin bar",
28
+ "id" => $wlcmsShortName."_adminbar_custom_logo",
29
+ "class" => 'upload_image_button',
30
+ "type" => "file",
31
+ "std" => '');
32
+ $wlcmsOptions[] = array( "name" => "Add Dashboard Logo", "type" => "subtitle" );
33
+ $wlcmsOptions[] = array(
34
+ "name" => "Add Dashboard Logo",
35
+ "desc" => "This will replace the home icon on the dashboard with your own logo.",
36
+ "id" => $wlcmsShortName."_header_custom_logo",
37
+ "class" =>'upload_image_button',
38
+ "type" => "file",
39
+ "std" => '');
40
+ $wlcmsOptions[] = array(
41
+ "name" => "Replace Dashboard Heading",
42
+ "desc" => "This will replace the heading \"Dashboard\" on the dashboard page. This combined with a custom logo will help improve the branding experience for your client",
43
+ "id" => $wlcmsShortName."_dashboard_override",
44
+ "type" => "text",
45
+ "title" => '',
46
+ "std" => __('Dashboard'));
47
+ }
48
+ else
49
+ {
50
+ $wlcmsOptions[] = array(
51
+ "name" => "Classic Header Height",
52
+ "desc" => "<b>3.2 Only</b> - This will keep Header height to 46px, pre WordPress 3.2 size (better for branding) if its empty",
53
+ "id" => $wlcmsShortName."_header_height",
54
+ "type" => "text",
55
+ "unit" => "px",
56
+ "class" => 'default-text',
57
+ "title" => 'Header',
58
+ "std" => '0');
59
+
60
+ $wlcmsOptions[] = array(
61
+ "name" => "Custom Header Logo",
62
+ "desc" => "This is a logo that will appear in the header. It should be a transparent .gif or .png and about 32px by 32px. You can either upload an image, or just type in the image name if you have already placed it in the images folder of your theme or child.",
63
+ "id" => $wlcmsShortName."_header_custom_logo",
64
+ "class" => 'upload_image_button',
65
+ "type" => "file",
66
+ "std" => '');
67
+
68
+ $wlcmsOptions[] = array(
69
+ "name" => "Custom Header Logo Width",
70
+ "desc" => "Leave blank for default value of 32px.",
71
+ "id" => $wlcmsShortName."_header_custom_logo_width",
72
+ "type" => "text",
73
+ "unit" => "px",
74
+ "class" => 'default-text',
75
+ "title" => '32',
76
+ "std" => '');
77
+
78
+ $wlcmsOptions[] = array(
79
+ "name" => "Header Logo As Site Link",
80
+ "desc" => "The logo that appears in the header with be the link to the site. It will remove the text link",
81
+ "id" => $wlcmsShortName."_header_logo_link",
82
+ "type" => "radio",
83
+ "options" => array("1", "0"),
84
+ "std" => 0);
85
+ }
86
+
87
+ $wlcmsOptions2 = array(
88
+ array( "name" => "Footer", "type" => "subtitle" ),
89
+ array(
90
+ "name" => "Custom Footer Logo",
91
+ "desc" => "This logo will appear in the footer on the left hand side",
92
+ "id" => $wlcmsShortName."_footer_custom_logo",
93
+ "type" => "file",
94
+ "class" => 'upload_image_button',
95
+ "std" => ''),
96
+
97
+ array(
98
+ "name" => "Developer Website URL",
99
+ "desc" => "There will be a link to your website in the footer. Leave it blank if you don't want the link otherwise please include http://",
100
+ "id" => $wlcmsShortName."_developer_url",
101
+ "type" => "text",
102
+ "std" => ''),
103
+
104
+ array(
105
+ "name" => "Developer Website Name",
106
+ "desc" => "The developer's name will appear in the footer",
107
+ "id" => $wlcmsShortName."_developer_name",
108
+ "type" => "text",
109
+ "std" => ''),
110
+
111
+ array(
112
+ "name" => "Hide WP Version",
113
+ "desc" => "This will hide WordPress Version in right corner of the footer and on the Right Now dashboard panel",
114
+ "id" => $wlcmsShortName."_hide_wpversion",
115
+ "type" => "radio",
116
+ "options" => array("1", "0"),
117
+ "std" => 0),
118
+
119
+ array( "name" => "Login", "type" => "subtitle"),
120
+
121
+ array(
122
+ "name" => "Make background colour white",
123
+ "desc" => "This will make the login screen have a white background. Useful if your logo isn't transparent.",
124
+ "id" => $wlcmsShortName."_loginbg_white",
125
+ "type" => "radio",
126
+ "options" => array("1", "0"),
127
+ "std" => 0),
128
+
129
+ array(
130
+ "name" => "Custom Login Logo",
131
+ "desc" => "This logo will appear on the login page. It should be about 300px by 80px.",
132
+ "id" => $wlcmsShortName."_login_custom_logo",
133
+ "type" => "file",
134
+ "class" => 'upload_image_button',
135
+ "std" => ''),
136
+
137
+ array(
138
+ "name" => "Custom Login CSS",
139
+ "desc" => "For example:<br /> .login form { background-color: #0013FF } <br />.login #login p#nav a { color: #333 !important }<br /><br /> Or if you want to get fancy:<br /> #wlcms-login-wrapper{ background: url('wp-content/plugins/white-label-cms/images/footergrass.jpg') repeat-x fixed center bottom transparent; display: block; height: 100%; left: 0; overflow: auto; position: absolute; top: 0; width: 100%;} ",
140
+ "id" => $wlcmsShortName."_login_bg_css",
141
+ "type" => "textarea",
142
+ "std" => ''),
143
+
144
+ array( "name" => "Admin Page Title","type" => "subtitle"),
145
+
146
+ array(
147
+ "name" => "Custom Page Titles",
148
+ "desc" => "This replaces the - WordPress in the admin page titles. If this is set to nothing WordPress will continue to appear in the page titles",
149
+ "id" => $wlcmsShortName."_admin_page_title",
150
+ "type" => "text",
151
+ "std" => ''),
152
+
153
+ array( "type" => "close"),
154
+ array( "name" => "Dashboard Panels", "type" => "section"),
155
+ array( "type" => "open"),
156
+
157
+ array(
158
+ "name" => "Hide 'At a Glance'",
159
+ "desc" => "Hides the at a glance panel",
160
+ "id" => $wlcmsShortName."_dashboard_remove_right_now",
161
+ "type" => "radio",
162
+ "options" => array("1", "0"),
163
+ "std" => 0),
164
+
165
+ array(
166
+ "name" => "Hide 'Activity'",
167
+ "desc" => "Hides the activity panel",
168
+ "id" => $wlcmsShortName."_dashboard_remove_activity_panel",
169
+ "type" => "radio",
170
+ "options" => array("1", "0"),
171
+ "std" => 0),
172
+
173
+ array(
174
+ "name" => "Hide 'Recent Comments'",
175
+ "desc" => "Hides the comments panel",
176
+ "id" => $wlcmsShortName."_dashboard_remove_recent_comments",
177
+ "type" => "radio",
178
+ "options" => array("1", "0"),
179
+ "std" => 1),
180
+
181
+ array(
182
+ "name" => "Hide Other Dashboard Panels",
183
+ "desc" => "These are all the other default dashboard panels",
184
+ "id" => $wlcmsShortName."_dashboard_others",
185
+ "type" => "radio",
186
+ "options" => array("1", "0"),
187
+ "std" => 1),
188
+
189
+ array(
190
+ "name" => "Show Dashboard To Admin",
191
+ "desc" => "All panels will appear for the admin",
192
+ "id" => $wlcmsShortName."_dashboard_admin",
193
+ "type" => "radio",
194
+ "options" => array("1", "0"),
195
+ "std" => 1),
196
+
197
+ array(
198
+ "name" => "Remove Empty Dashed Panel",
199
+ "desc" => "If you only have 1 dashboard panel then a empty panel will appear with a dashed border. Selecting yes will remove the border.",
200
+ "id" => $wlcmsShortName."_dashboard_border",
201
+ "type" => "radio",
202
+ "options" => array("1", "0"),
203
+ "std" => 1),
204
+
205
+ array(
206
+ "name" => "Add your own Welcome Panel?",
207
+ "desc" => "This will appear on the dashboard. We recommend providing your contact details and links to the help files you have made for your client.",
208
+ "id" => $wlcmsShortName."_show_welcome",
209
+ "type" => "radio",
210
+ "options" => array("1", "0"),
211
+ "std" => "0" ),
212
+
213
+ array( "name" => "Welcome Panel Settings", "type" => "subsectionvars"),
214
+
215
+ array(
216
+ "name" => "Visible To",
217
+ "desc" => "This means the welcome panel will appear for users with roles higher or equal to the one chosen.",
218
+ "id" => $wlcmsShortName."_welcome_visible_to",
219
+ "type" => "select",
220
+ "options"=>wlcms_roles_dropdown(),
221
+ "std" => 'editor'),
222
+
223
+ array(
224
+ "name" => "Title",
225
+ "desc" => "The title of your dashboard panel.",
226
+ "id" => $wlcmsShortName."_welcome_title",
227
+ "type" => "text",
228
+ "std" => 'Welcome To Your New Website'),
229
+
230
+ array(
231
+ "name" => "Description",
232
+ "desc" => "Please add the text in html format here.",
233
+ "id" => $wlcmsShortName."_welcome_text",
234
+ "type" => "textarea",
235
+ "std" => ''),
236
+
237
+ array( "name" => "Second Panel Settings","type" => "subtitle"),
238
+
239
+ array( "name" => "Visible To",
240
+ "desc" => "This means the welcome panel will appear for users with roles lesser or equal to the one chosen.",
241
+ "id" => $wlcmsShortName."_welcome_visible_to1",
242
+ "type" => "select",
243
+ "options"=>wlcms_roles_dropdown(),
244
+ "std" => ''),
245
+
246
+ array( "name" => "Title",
247
+ "desc" => "The title of your dashboard panel.",
248
+ "id" => $wlcmsShortName."_welcome_title1",
249
+ "type" => "text",
250
+ "std" => ''),
251
+
252
+ array( "name" => "Description",
253
+ "desc" => "Please add the text in html format here.",
254
+ "id" => $wlcmsShortName."_welcome_text1",
255
+ "type" => "textarea",
256
+ "std" => ''),
257
+
258
+ array( "type" => "closeonce"),
259
+
260
+ array(
261
+ "name" => "Add an RSS Dashboard panel?",
262
+ "desc" => "This will appear on the dashboard. If you want your client to be kept up to date with what your are doing in the your business, set up your RSS feed.",
263
+ "id" => $wlcmsShortName."_show_rss_widget",
264
+ "type" => "radio",
265
+ "options" => array("1", "0"),
266
+ "std" => "0" ),
267
+
268
+ array( "name" => "RSS Settings", "type" => "subsectionvars"),
269
+
270
+ array(
271
+ "name" => "RSS Title",
272
+ "desc" => "The title of your RSS dashboard panel.",
273
+ "id" => $wlcmsShortName."_rss_title",
274
+ "type" => "text",
275
+ "std" => ''),
276
+ array(
277
+ "name" => "Add Your Logo (16px x 16px)",
278
+ "desc" => "Adds a 16px logo before the title",
279
+ "id" => $wlcmsShortName."_rss_logo",
280
+ "class" => 'upload_image_button',
281
+ "type" => "file",
282
+ "std" => ''),
283
+ array(
284
+ "name" => "RSS Feed",
285
+ "desc" => "The RSS feed address. For example feed://www.vitaminseo.com.au/feed/",
286
+ "id" => $wlcmsShortName."_rss_value",
287
+ "type" => "text",
288
+ "std" => ''),
289
+ array(
290
+ "name" => "Number Items",
291
+ "desc" => "Number of RSS items to show",
292
+ "id" => $wlcmsShortName."_rss_num_items",
293
+ "type" => "selectbox",
294
+ "options"=> array(1=>1,2=>2,3=>3,4=>4,5=>5,6=>6,7=>7,8=>8,9=>9,10=>10),
295
+ "std" => 2),
296
+ array(
297
+ "name" => "Show Post Contents",
298
+ "desc" => "Show the content of the RSS item. This will display what is in your RSS feed, if this is not what you want, please modify your RSS feed.",
299
+ "id" => $wlcmsShortName."_rss_show_intro",
300
+ "type" => "selectbox",
301
+ "options"=> array('yes'=>'Yes','no'=>'No'),
302
+ "std" => 'yes'),
303
+ array(
304
+ "name" => "RSS Intro",
305
+ "desc" => "If you would like to have some text above the RSS items explaining it. Please add the text in html format here.",
306
+ "id" => $wlcmsShortName."_rss_intro_html",
307
+ "type" => "textarea",
308
+ "std" => ''),
309
+
310
+
311
+ array( "type" => "closeonce"),
312
+
313
+ array( "type" => "close"),
314
+
315
+ array( "name" => "Admin Settings", "type" => "section"),
316
+ array( "type" => "open"),
317
+
318
+ array( "name" => "Enable Login URL Redirect",
319
+ "desc" => "Clients can go to /login as well as /wp-login.php only when permalinks are enabled",
320
+ "id" => $wlcmsShortName."_enable_login_redirect",
321
+ "type" => "radio",
322
+ "options" => array("1", "0"),
323
+ "std" => 1),
324
+
325
+ array( "name" => "Hide Nag Update",
326
+ "desc" => "This will hide the Nag Update for out of date versions of WordPress",
327
+ "id" => $wlcmsShortName."_dashboard_remove_nag_update",
328
+ "type" => "radio",
329
+ "options" => array("1", "0"),
330
+ "std" => 1),
331
+
332
+ array( "name" => "Hide Help Box",
333
+ "desc" => "This will hide the Help Box dropdown",
334
+ "id" => $wlcmsShortName."_dashboard_remove_help_box",
335
+ "type" => "radio",
336
+ "options" => array("1", "0"),
337
+ "std" => 0),
338
+
339
+ array( "name" => "Hide Screen Options",
340
+ "desc" => "This will hide the Screen Options dropdown",
341
+ "id" => $wlcmsShortName."_dashboard_remove_screen_options",
342
+ "type" => "radio",
343
+ "options" => array("1", "0"),
344
+ "std" => 0),
345
+
346
+ array( "name" => "Hide Meta Boxes","type" => "subtitle"),
347
+
348
+ array("id"=>'',"type"=>"divopen",'class'=>"wlcms_input"),
349
+
350
+ array( "heading" => "Hide Post Meta Boxes",
351
+ "desc" => "Choose meta boxes that you want to remove from the Edit Post panel",
352
+ "type"=>"headings"),
353
+
354
+ array(
355
+ "id" => $wlcmsShortName."_hide_post_div",
356
+ "type" => "divopen",
357
+ 'class'=>$wlcmsShortName."_hide_post_divclass"),
358
+ array(
359
+ "id" => $wlcmsShortName."_post_meta_box_excerpt",
360
+ "type" => "checkbox",
361
+ "label"=>"Excerpt",
362
+ "std" => 0),
363
+ array(
364
+ "id" => $wlcmsShortName."_post_meta_box_slug",
365
+ "type" => "checkbox",
366
+ "label"=>"Slug",
367
+ "std" => 0),
368
+ array(
369
+
370
+ "id" => $wlcmsShortName."_post_meta_box_tags",
371
+ "type" => "checkbox",
372
+ "label"=>"Tags",
373
+ "std" => 0),
374
+
375
+ array(
376
+ "id" => $wlcmsShortName."_post_meta_box_author",
377
+ "type" => "checkbox",
378
+ "label"=>"Author",
379
+ "std" => 0),
380
+ array(
381
+
382
+ "id" => $wlcmsShortName."_post_meta_box_comments",
383
+ "type" => "checkbox",
384
+ "label"=>"Comments",
385
+ "std" => 0),
386
+ array( "type" => "divclose"),
387
+
388
+ array(
389
+ "id" => $wlcmsShortName."_hide_post_divnew",
390
+ "type" => "divopen",
391
+ 'class'=>$wlcmsShortName."_hide_post_divclassnew"),
392
+
393
+ array(
394
+
395
+ "id" => $wlcmsShortName."_post_meta_box_revisions",
396
+ "type" => "checkbox",
397
+ "label"=>"Revisions",
398
+ "std" => 0),
399
+ array(
400
+
401
+ "id" => $wlcmsShortName."_post_meta_box_discussions",
402
+ "type" => "checkbox",
403
+ "label"=>"Discussion",
404
+ "std" => 0),
405
+ array(
406
+
407
+ "id" => $wlcmsShortName."_post_meta_box_categories",
408
+ "type" => "checkbox",
409
+ "label"=>"Categories",
410
+ "std" => 0),
411
+
412
+ array(
413
+ "id" => $wlcmsShortName."_post_meta_box_custom",
414
+ "type" => "checkbox",
415
+ "label"=>"Custom Fields",
416
+ "std" => 0),
417
+
418
+ array(
419
+ "id" => $wlcmsShortName."_post_meta_box_send",
420
+ "type" => "checkbox",
421
+ "label"=>"Send Trackbacks",
422
+ "std" => 0),
423
+
424
+
425
+
426
+ array("type" => "divclose"),
427
+ array("type" => "divclose"),
428
+ array('type'=>'clear'),
429
+ array('type'=>'space'),
430
+
431
+ array(
432
+
433
+ "id" => '',
434
+ "type" => "divopen",
435
+ 'class'=>"wlcms_input"),
436
+
437
+ /**/
438
+ array( "heading" => "Hide Page Meta Boxes",
439
+ "desc" => "Choose meta boxes that you want to remove from the Edit Page panel",
440
+ "type"=>"headings"),
441
+ array(
442
+
443
+ "id" => $wlcmsShortName."_hide_page_divmain",
444
+ "type" => "divopen",
445
+ 'class'=>$wlcmsShortName."_hide_page_divclassmain"),
446
+
447
+ array(
448
+
449
+ "id" => $wlcmsShortName."_hide_page_div",
450
+ "type" => "divopen",
451
+ 'class'=>$wlcmsShortName."_hide_page_divclass"),
452
+ array(
453
+
454
+ "id" => $wlcmsShortName."_page_meta_box_custom",
455
+ "type" => "checkbox",
456
+ "label"=>"Custom Fields",
457
+ "std" => 0),
458
+ array(
459
+
460
+ "id" => $wlcmsShortName."_page_meta_box_author",
461
+ "type" => "checkbox",
462
+ "label"=>"Author",
463
+ "std" => 0),
464
+
465
+ array(
466
+
467
+ "id" => $wlcmsShortName."_page_meta_box_discussions",
468
+ "type" => "checkbox",
469
+ "label"=>"Discussion",
470
+ "std" => 0),
471
+ array(
472
+
473
+ "id" => $wlcmsShortName."_page_meta_box_revisions",
474
+ "type" => "checkbox",
475
+ "label"=>"Revisions",
476
+ "std" => 0),
477
+ array(
478
+
479
+
480
+ "type" => "divclose"
481
+ ),
482
+ array(
483
+
484
+ "id" => $wlcmsShortName."_hide_page_divnew",
485
+ "type" => "divopen",
486
+ 'class'=>$wlcmsShortName."_hide_page_divclassnew"),
487
+
488
+ array(
489
+
490
+ "id" => $wlcmsShortName."_page_meta_box_page",
491
+ "type" => "checkbox",
492
+ "label"=>"Page Attributes",
493
+ "std" => 0),
494
+ array(
495
+
496
+ "id" => $wlcmsShortName."_page_meta_box_slug",
497
+ "type" => "checkbox",
498
+ "label"=>"Slug",
499
+ "std" => 0),
500
+ array("type" => "divclose"),
501
+ array("type" => "divclose"),
502
+ array("type" => "divclose"),
503
+
504
+ array( "name" => "Custom CSS for Admin",
505
+ "desc" => "Override or add to any of the styles in the WordPress admin enter your own custom css here",
506
+ "id" => $wlcmsShortName."_custom_css",
507
+ "type" => "textarea",
508
+ "std" => ''),
509
+ array( "name" => "Custom Editor Stylesheet",
510
+ "desc" => "Create and upload a custom stylesheet with all style rules prefixed with .mceContentBody to your themes directory and enter the filename",
511
+ "id" => $wlcmsShortName."_welcome_stylesheet",
512
+ "type" => "textcustom",
513
+ "std" => ''),
514
+ array( "type" => "close"),
515
+
516
+ //*///////////////////////////////////
517
+
518
+ array( "name" => "Modify Menus",
519
+ "type" => "section"),
520
+ array( "type" => "open"),
521
+
522
+ array( "name" => "These changes will only effect people with the user role of <strong>Editor</strong>. You are currently logged in as the admin, so you will not see any changes in the menus until you login with a different user role.",
523
+ "type" => "message"),
524
+
525
+ array("name" => "Choose A CMS Profile","desc" => "Which profile best fits your clients needs?","id" => $wlcmsShortName."_cms_profile","type" => "radioprofile","options" => array("1", "2","3"), "std" => '1'),
526
+ //array("name" => "Menus", "type" => "menus"),
527
+ array(
528
+
529
+ "id" => $wlcmsShortName."_modify_menus",
530
+ "type" => "divopen",
531
+ 'class'=>$wlcmsShortName."_modify_menu"),
532
+ array(
533
+ "id" => $wlcmsShortName."_modify_menu_post",
534
+ "type" => "divopen",
535
+ 'class'=>$wlcmsShortName."_modify_menu"),
536
+ /***/
537
+ array( "name" => "Hide Posts Menu",
538
+ "desc" => "Hides Posts &amp; Comments sections",
539
+ "id" => $wlcmsShortName."_hide_posts",
540
+ "type" => "checkbox",
541
+ "class"=>$wlcmsShortName."_child_label",
542
+ "std" => 0),
543
+
544
+ array( "name" => "Hide Media Menu",
545
+ "desc" => "Hides Media from left menu",
546
+ "id" => $wlcmsShortName."_hide_media",
547
+ "type" => "checkbox",
548
+ "class"=>$wlcmsShortName."_child_label",
549
+ "std" => 0),
550
+
551
+ array( "name" => "Hide Links Menu",
552
+ "desc" => "Hides Links from left menu",
553
+ "id" => $wlcmsShortName."_hide_links",
554
+ "type" => "checkbox",
555
+ "class"=>$wlcmsShortName."_child_label",
556
+ "std" => 0),
557
+
558
+
559
+ array( "name" => "Hide Pages Menu",
560
+ "desc" => "Hides Pages from left menu",
561
+ "id" => $wlcmsShortName."_hide_pages",
562
+ "type" => "checkbox",
563
+ "class"=>$wlcmsShortName."_child_label",
564
+ "std" => 0),
565
+
566
+ array( "name" => "Hide Comments Menu",
567
+ "desc" => "Hides Comments from left menu",
568
+ "id" => $wlcmsShortName."_hide_comments",
569
+ "type" => "checkbox",
570
+ "class" => $wlcmsShortName."_child_label",
571
+ "std" => 0),
572
+
573
+ array( "name" => "Hide Profile",
574
+ "desc" => "Hides Profile menu item from left menu",
575
+ "id" => $wlcmsShortName."_hide_profile",
576
+ "type" => "checkbox",
577
+ "class" => $wlcmsShortName."_child_label",
578
+ "std" => 0),
579
+
580
+ array( "name" => "Hide Tools",
581
+ "desc" => "Hides Tools from left menu",
582
+ "id" => $wlcmsShortName."_hide_tools",
583
+ "type" => "checkboxlast",
584
+ "class" => $wlcmsShortName."_child_label",
585
+ "std" => 0),
586
+
587
+
588
+
589
+
590
+ array(
591
+
592
+ "type" => "divclose"
593
+ ),
594
+
595
+
596
+ array(
597
+
598
+ "type" => "divclose"
599
+ ) ,
600
+
601
+ );
602
+
603
+
604
+ $wlcms_show_appearance_legacy = '0';
605
+ $wlcms_show_menus_legacy = '1';
606
+ $wlcms_show_widgets_legacy = '1';
607
+
608
+ $wlcmsOptions3[] = array( "name" => "The following change will display the Widgets or Menus or Background or Header option in Appearance to users with the role of <strong>Editor</strong>. Please refer to the help tab to understand the consequences of enabling this option. <br /><br />",
609
+ "type" => "message2") ;
610
+
611
+ $wlcmsOptions3[] = array( "name" => "Access To Appearance Menu",
612
+ "desc" => "This will give the editor access to the appearance section. You can customise what they have access to.",
613
+ "id" => $wlcmsShortName."_editor_template_access",
614
+ "type" => "radio",
615
+ "options" => array("1", "0"),
616
+ "std" => '0' );
617
+
618
+ $wlcmsOptions3[] = array( "name" => "The Appearance Menu", "type" => "subsectionvars");
619
+
620
+ foreach($submenu['themes.php'] as $optId=> $optArray) // Build Dynamically the sub options for Appearance tab
621
+ {
622
+ if ( $optArray[2] != 'theme-editor.php' ) { // Never want to allow Theme Editor Access
623
+
624
+ $std='1';
625
+
626
+ if($optArray[2] == 'widgets.php') { $std = $wlcms_show_widgets_legacy; }
627
+ if($optArray[2] == 'nav-menus.php') { $std = $wlcms_show_menus_legacy; }
628
+
629
+ $wlcmsOptions3[] = array( "name" => "Hide {$optArray[0]}",
630
+ "desc" => "Removes the {$optArray[0]} option under the Appearance tab.",
631
+ "id" => $wlcmsShortName."_subtemplate_hide_".$optId,
632
+ "type" => "checkboxlast",
633
+ "std" => $std);
634
+ }
635
+ }
636
+
637
+
638
+ $wlcmsOptions3[] = array( "type" => "divclose" );
639
+ $wlcmsOptions3[] = array( "type" => "close" );
640
+
641
+
642
+
643
+ // To improve the config builder.
644
+ // $wlcmsOptions3 = array_merge($wlcmsOptions3);
645
+ $wlcmsOptions = array_merge( $wlcmsOptions, $wlcmsOptions2, $wlcmsOptions3 );
646
+
647
+ ?>
includes/admin.view.php ADDED
@@ -0,0 +1,647 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap wlcms_wrap" style="width:auto;">
2
+ <h2>White Label CMS Settings</h2>
3
+
4
+ <div class="wlcms_opts" style="position:relative;">
5
+ <div id="wlcms-sidebar" style="position: absolute; top: 0; right: 0; z-index: 2; background-color:#FFFFFF; width: 250px; border: 1px solid #ccc; padding: 20px;">
6
+ <img src="<?php echo plugins_url('images/WPElevatoon-WP-Skyscraper-Image-232x337.jpg', dirname(__FILE__)); ?>" alt="Better Clients" title="Better Clients" />
7
+ <form method="post" accept-charset="UTF-8" onsubmit="return quickValidate()" action="https://sk199.infusionsoft.com/app/form/process/6903821baa449ff51394d0f57cfd2cdb" target="_blank" name="Better WP ClickFunnels">
8
+ <div style="display: none;">
9
+ <input name="inf_form_xid" type="hidden" value="6903821baa449ff51394d0f57cfd2cdb" />
10
+ <input name="inf_form_name" type="hidden" value="White Label CMS Form" />
11
+ <input name="infusionsoft_version" type="hidden" value="1.56.0.55" />
12
+ <input name="inf_field_LeadSoruceId" type="hidden" value="148" />
13
+ </div>
14
+ <table style="text-align:left;margin-left: 20px;">
15
+ <tr>
16
+ <td><strong>Name: </strong><input id="sub_name" name="inf_field_FirstName" type="text" name="name" class="text" tabindex="500" value="" style="width: 170px;"/></td>
17
+ </tr>
18
+ <tr>
19
+ <td><strong>Email: </strong>&nbsp;<input class="text" id="sub_email" type="text" name="inf_field_Email" tabindex="501" value="" style="width: 170px;" /></td>
20
+ </tr>
21
+ <tr>
22
+ <td style="text-align:center"><span class="submit"><input name="submit" type="image" alt="submit" tabindex="502" src="<?php echo plugins_url('images/WPElevation-WP-Skyscaper-Button-157x40.gif', dirname(__FILE__)); ?>" width="157" height="40" style="background: none; border: 0;" /></span></td>
23
+ </tr>
24
+ <tr>
25
+ <td style="padding-top: 20px;text-align:center;">
26
+ <a title="Privacy Policy" href="http://www.wpelevation.com/privacy-policy/" target="_blank"><img src="<?php echo plugins_url('images/privacy.png', dirname(__FILE__)); ?>" alt="" title="" /></a>
27
+ </td>
28
+ </tr>
29
+ </table>
30
+ </form>
31
+ </div>
32
+ <div id="wlcms-container" style="margin-right: 320px;">
33
+
34
+ <form method="post" enctype="multipart/form-data" <?php echo admin_url( 'options-general.php?page=wlcms-plugin.php' );?> >
35
+ <?php wp_nonce_field( 'wlcms-update_settings' ); ?>
36
+ <input type="hidden" name="wlcms_" value="<?php echo WLCMS; ?>" />
37
+ <?php foreach ($wlcmsOptions as $value) {
38
+ switch ( $value['type'] ) {
39
+
40
+ case "open":
41
+ ?>
42
+
43
+ <?php break;
44
+
45
+ case "closeonce":
46
+ ?>
47
+
48
+ </div>
49
+
50
+ <?php break;
51
+
52
+ case "close":
53
+ ?>
54
+
55
+ </div>
56
+ </div>
57
+ <br />
58
+
59
+
60
+ <?php break;
61
+
62
+ case "menus":
63
+
64
+ global $menu, $submenu;
65
+
66
+ //echo '<pre>';print_r($menu); print_r($submenu);
67
+
68
+
69
+ echo '<ul id="menus">';
70
+
71
+ foreach($menu as $m_key => $menu_item):
72
+
73
+ if(!$menu_item[0]) { continue; }
74
+
75
+ echo '<li><strong><input type="checkbox" value="1" name="wlcms_o_hide_menu_'.$m_key.'" '.( get_option( 'wlcms_o_hide_menu_'.$m_key ) ? 'checked="checked" ' : '' ).' /> <span>'.$menu_item[0] . ' <em></em></span> </strong>';
76
+
77
+ if( isset( $submenu[ $menu_item[2] ] ) ):
78
+
79
+ echo '<ul >';
80
+
81
+ foreach($submenu[ $menu_item[2] ] as $sm_key => $submenu_item):
82
+
83
+ echo '<li><input type="checkbox" value="1" name="wlcms_o_hide_submenu_'.$m_key .'_'.$sm_key.'" '. ( get_option( 'wlcms_o_hide_submenu_'.$m_key .'_'.$sm_key ) ? 'checked="checked" ' : '') .'/> '.$submenu_item[0].'</li>';
84
+
85
+ endforeach;
86
+
87
+ echo '</ul>';
88
+
89
+ endif;
90
+
91
+
92
+ echo '</li>';
93
+
94
+
95
+ endforeach;
96
+
97
+ echo '</ul>';
98
+
99
+ break;
100
+
101
+ case "title":
102
+ ?>
103
+ <p><strong>For a detailed explanation of the plugin please refer to the official <a href="http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=helplink" target="_blank">help page</a>.</strong></p>
104
+
105
+ <p><em>Please Note:</em> For any images, if you just put the file name, the image will come from the images directory of your theme/child theme. Use the full url if the image comes from another site. If you upload a image, make sure you click "Use This Image"</p>
106
+
107
+ <?php break;
108
+
109
+ case 'text':
110
+ ?>
111
+ <?php if ($value['id']=='wlcms_o_header_custom_logo' || $value['id']=='wlcms_o_footer_custom_logo' ) { ?>
112
+
113
+ <div style="border:0;" class="wlcms_input wlcms_text">
114
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
115
+ <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>" class="<?php echo $value['class']; ?>" title="<?php echo $value['title']; ?>"/><?php echo $value['unit']?>
116
+ <small><?php echo $value['desc']; ?></small>
117
+ <div class="clearfix"></div>
118
+
119
+ </div>
120
+
121
+ <?php } else { ?>
122
+ <div class="wlcms_input wlcms_text">
123
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
124
+
125
+ <input
126
+ name="<?php echo $value['id']; ?>"
127
+ id="<?php echo $value['id']; ?>"
128
+ type="<?php echo $value['type']; ?>"
129
+ value="<?php if ( get_option( $value['id'] ) != "")
130
+ { echo stripslashes(get_option( $value['id']) ); }
131
+ else
132
+ { echo $value['std']; } ?>"
133
+ class="<?php echo (isset($value['class']) ? $value['class'] : '' ); ?>"
134
+ title="<?php echo (isset($value['title']) ? $value['title'] : '' ); ?>" />
135
+ <?php echo (isset($value['unit']) ? $value['unit'] : '' );?>
136
+
137
+ <small><?php echo $value['desc']; ?></small>
138
+ <div class="clearfix"></div>
139
+
140
+ </div>
141
+
142
+ <?php } ?>
143
+ <?php break;
144
+ ////////////////////////////////////////////////////////////////////////////////************************************************************************//
145
+ case 'textcustom':
146
+ ?>
147
+
148
+ <div class="wlcms_input wlcms_text">
149
+
150
+ <label for="<?php echo $value['id']; ?>" title="CSS filename relative from <?php echo get_stylesheet_directory_uri();?>/" ><?php echo $value['name']; ?> </label>
151
+
152
+ <input
153
+ name="<?php echo $value['id']; ?>"
154
+ id="<?php echo $value['id']; ?>"
155
+ type="<?php echo $value['type']; ?>"
156
+ value="<?php if ( get_option( $value['id'] ) != "")
157
+ { echo stripslashes(get_option( $value['id']) ); }
158
+ else
159
+ { echo $value['std']; } ?>"
160
+
161
+ class="<?php echo (isset($value['class']) ? $value['class'] : '' ); ?>"
162
+ title="<?php echo (isset($value['title']) ? $value['title'] : '' ); ?>"/>
163
+
164
+ <?php echo (isset($value['unit']) ? $value['unit'] : '' );?>
165
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
166
+
167
+ </div>
168
+
169
+ <?php break;
170
+ //********************************************************************/////////////////////////////////////////////////////////////////////////////////////
171
+
172
+ case "file":
173
+ ?>
174
+
175
+ <div class="wlcms_input wlcms_file">
176
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
177
+ <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>"/>
178
+ <input name="upload_image_button" type="button" value="Upload" rel="<?php echo $value['id']; ?>" class="<?php echo $value['class']; ?>"/>
179
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
180
+
181
+ </div>
182
+ <?php
183
+ break;
184
+
185
+ case "import_file":
186
+ ?>
187
+ <div class="wlcms_input import_file">
188
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
189
+ <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="file" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>"/>
190
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
191
+
192
+ </div>
193
+ <?php
194
+ break;
195
+
196
+ /******************************************************************/
197
+ case "button":
198
+ ?>
199
+
200
+ <div class="wlcms_input wlcms_file">
201
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
202
+
203
+ <input name="export_button" type="submit" value="Export" class="<?php echo $value['class']; ?>"/>
204
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
205
+ </div>
206
+ <?php
207
+ break;
208
+
209
+ /*******************************************************************/
210
+ case 'textlocalvideo':
211
+ ?>
212
+
213
+ <div class="wlcms_input_local_video wlcms_text">
214
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
215
+ <input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="text" value="<?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?>" />
216
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
217
+
218
+ </div>
219
+ <?php break;
220
+ case 'message':
221
+ ?>
222
+ <div class="wlcms_input_message wlcms_text">
223
+ <div id="icon-users" class="wlcms-icon32"><br></div><?php echo $value['name']; ?>
224
+ </div>
225
+ <?php
226
+ break;
227
+
228
+ case 'message2':
229
+ ?>
230
+ <div class="wlcms_input_message wlcms_text">
231
+ <div id="icon-themes" class="wlcms-icon32"><br></div><?php echo $value['name']; ?>
232
+ </div>
233
+ <?php
234
+ break;
235
+ /*************************************/
236
+ case 'message3':
237
+ ?>
238
+ <div class="wlcms_input_message1 wlcms_text">
239
+ <?php echo $value['name']; ?>
240
+ </div>
241
+ <?php
242
+ break;
243
+ /*************************************/
244
+
245
+ case 'textarea':
246
+ ?>
247
+
248
+ <div class="wlcms_input_welcome_last wlcms_textarea">
249
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
250
+ <textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="" rows=""><?php if ( get_option( $value['id'] ) != "") { echo stripslashes(get_option( $value['id']) ); } else { echo $value['std']; } ?></textarea>
251
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
252
+ </div>
253
+
254
+ <?php
255
+ break;
256
+ case 'selectbox':
257
+ ?>
258
+
259
+ <div class="wlcms_input wlcms_select">
260
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
261
+
262
+ <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
263
+ <?php foreach ($value['options'] as $role => $option) { ?>
264
+ <option value="<?php echo $role;?>"<?php if (get_option( $value['id'] ) == $role) { echo 'selected="selected"'; } elseif ($role==$value['std']) {echo 'selected="selected"';} ?>><?php echo $option; ?></option><?php } ?>
265
+ </select>
266
+
267
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
268
+ </div>
269
+ <?php
270
+ break;
271
+ case 'select':
272
+ ?>
273
+
274
+ <div class="wlcms_input wlcms_select">
275
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
276
+
277
+ <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
278
+ <option value="0">choose a role</option>
279
+ <?php foreach ($value['options'] as $role => $option) { ?>
280
+ <option value="<?php echo $role;?>"<?php if (get_option( $value['id'] ) == $role) { echo 'selected="selected"'; } elseif ($role==$value['std']) {echo 'selected="selected"';} ?>><?php echo $option; ?></option><?php } ?>
281
+ </select>
282
+
283
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
284
+ </div>
285
+ <?php
286
+ break;
287
+ //////////////////////////////////////////////////
288
+ case 'selectnew':
289
+ ?>
290
+ <div class="wlcms_optsnew">
291
+ <div class="wlcms_input wlcms_select">
292
+ <label for="<?php echo $value['idname']; ?>"><?php echo $value['name']; ?></label>
293
+ <span class="lineup"><input name="<?php echo $value['idname']; ?>" id="<?php echo $value['idname']; ?>" type="text" value="<?php if ( get_option( $value['idname'] ) != "") { echo stripslashes(get_option( $value['idname']) ); } else { echo $value['std']; } ?>" /> <br />
294
+ <?php echo $value['label']; ?><br />
295
+ <select name="<?php echo $value['idlabel']; ?>" id="<?php echo $value['idlabel']; ?>">
296
+ <?php foreach ($value['options'] as $role => $option) { ?>
297
+ <option value="<?php echo $role;?>"<?php if (get_option( $value['idlabel'] ) == $role) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?>
298
+ </select>
299
+ <br />
300
+ <input name="add_button" type="submit" value="add" class="<?php echo $value['class']; ?>"/></span> <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
301
+ </div>
302
+ </div>
303
+ <?php
304
+ break;
305
+ case 'selectnewnew':
306
+ ?>
307
+ <div class="wlcms_optsnew">
308
+ <div class="wlcms_input wlcms_select">
309
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
310
+
311
+
312
+ <select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>">
313
+ <?php
314
+ foreach ($value['options'] as $role => $option) {
315
+ ?>
316
+ <option value="<?php echo $role;?>"<?php if (get_option( $value['id'] ) == $role) { echo 'selected="selected"'; } ?>><?php echo $option; ?></option>
317
+ <?php
318
+ }
319
+ ?>
320
+ </select>
321
+
322
+ <input name="delete_button" OnClick="javascript:return confirm('<?php _e('WARNING! Deleting a role can have severe consequences, proceed only if you know what you are doing.','wlcms')?>');" type="submit" value="delete" class="<?php echo $value['class']; ?>"/> <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
323
+ </div>
324
+ </div>
325
+ <?php
326
+ break;
327
+
328
+ case "headings":
329
+ ?>
330
+ <label id="<?php echo (isset($value['id']) ? $value['id'] : '' ); ?>"><?php echo $value['heading']; ?> </label>
331
+ <small><?php echo (isset($value['desc']) ? $value['desc'] : '' ); ?></small><div class="clearfix"></div>
332
+ <?php
333
+ break;
334
+ ///////////////////////////////////////////////////
335
+ case "checkboxlast":
336
+ case "checkbox":
337
+ ?>
338
+
339
+ <div class="<?php if($value['type'] == 'checkbox') { echo 'wlcms_input_local_video'; } else { echo 'wlcms_checkbox_last'; }?> wlcms_checkbox">
340
+
341
+ <label id="<?php echo $value['id']; ?>" class="<?php echo (!empty($value['class'])?$value['class']:'');?>"><?php echo (isset($value['name']) ? $value['name'] : ''); ?></label>
342
+
343
+ <?php
344
+ if(get_option($value['id']))
345
+ {
346
+ $checked = "checked=\"checked\""; $remChecked = 'wlcms_remChecked';
347
+ }
348
+ elseif ( ( ! get_option( 'wlcms_o_ver' ) ) && ($value['std'] == '1') )
349
+ {
350
+ $checked = "checked=\"checked\"";
351
+ $remChecked = 'wlcms_remChecked';
352
+ }
353
+ else
354
+ {
355
+ $checked = '';
356
+ $remChecked = '';
357
+ }
358
+ ?>
359
+ <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> class="<?php echo $remChecked; ?>" />
360
+ <?php echo (isset($value['label']) ? $value['label'] : '' ); ?>
361
+
362
+
363
+ <small><?php echo ( isset($value['desc'] ) ? $value['desc'] : '' ); ?></small><div class="clearfix"></div>
364
+ </div>
365
+ <?php
366
+ break;
367
+
368
+ case "divopen":
369
+ ?>
370
+ <div id="<?php echo $value['id']; ?>" class="<?php echo $value['class']; ?>">
371
+ <?php
372
+ break;
373
+
374
+ case "divclose":
375
+ ?>
376
+ </div>
377
+ <?php
378
+ break;
379
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
380
+ case "checkboxnewnew":
381
+ ?>
382
+
383
+ <div class="<?php if($value['type'] == 'checkbox') { echo 'wlcms_input_local_video'; } else { echo 'wlcms_checkbox_last'; }?> wlcms_checkbox">
384
+
385
+
386
+
387
+ <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; $remChecked = 'wlcms_remChecked'; }else{ $checked = ""; $remChecked = '';} ?>
388
+
389
+
390
+ <table>
391
+ <?php
392
+ echo $value['options'];
393
+ ?></table>
394
+
395
+ <small><?php echo (isset($value['desc']) ? $value['desc'] : '' ); ?></small><div class="clearfix"></div>
396
+ </div>
397
+ <?php
398
+ break;
399
+ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
400
+ case "checkboxlastv3":
401
+ // only show if version 3 of WordPress or above
402
+ global $wp_version;
403
+ if (substr($wp_version,0,3) < 3) {
404
+ echo '<div class="wlcms_checkbox_last wlcms_checkbox">';
405
+ echo '<input type="hidden" name="' . $value['id'] . '" id="' . $value['id'] . '" value="" />';
406
+ echo '<div class="clearfix"></div>';
407
+ echo '</div>';
408
+ } else {
409
+
410
+ ?>
411
+ <div class="<?php if($value['type'] == 'checkbox') { echo 'wlcms_input_local_video'; } else { echo 'wlcms_checkbox_last'; }?> wlcms_checkbox">
412
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
413
+
414
+ <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; $remChecked = 'wlcms_remChecked'; }else{ $checked = ""; $remChecked = '';} ?>
415
+ <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> class="<?php echo $remChecked; ?>" />
416
+
417
+ <?php echo (isset($value['label']) ? $value['label'] : '' ); ?>
418
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
419
+ </div>
420
+ <?php
421
+ }
422
+ break;
423
+ case "radio":
424
+ ?>
425
+
426
+ <div class="wlcms_input wlcms_radio" <?php if($value['id'] == 'wlcms_o_show_welcome') { echo ' id="form-show-welcome" '; }?>
427
+ <?php if($value['id'] == 'wlcms_o_editor_template_access') { echo ' id="form-show-template" '; }?>
428
+ <?php if($value['id'] == 'wlcms_o_show_rss_widget') { echo ' id="form-show-rss" '; }?>
429
+ >
430
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
431
+
432
+ <?php
433
+ $counter = 1;
434
+ foreach ($value['options'] as $option) { ?>
435
+ <?php $checked=''; if( ( get_option($value['id']) || get_option($value['id']) == '0' ) && (get_option($value['id']) == $option)){ $checked = "checked=\"checked\""; }elseif( (! get_option($value['id']) ) && $option == $value['std']){ $checked = "checked=\"checked\""; } else { $checked = ""; } ?>
436
+ <label class="radioyesno"> <?php if ($counter == 1) { echo 'Yes '; } else { echo 'No '; } ?><input type="radio" name="<?php echo $value['id']; ?>" class="<?php echo $value['id']; ?>" value="<?php echo $option; ?>" <?php echo $checked; ?> /></label>
437
+ <?php
438
+ $counter++;
439
+ }
440
+ ?>
441
+
442
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
443
+ </div>
444
+ <?php break;
445
+ /************************************************/
446
+ case "radionew":
447
+ ?>
448
+
449
+ <div class="wlcms_radioinput wlcms_radio" <?php if($value['id'] == 'wlcms_o_show_welcome') { echo ' id="form-show-welcome" '; }?> >
450
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
451
+
452
+ <?php
453
+ $counter = 1;
454
+ foreach ($value['options'] as $option) { ?>
455
+ <?php if(get_option($value['id']) == $option){ $checked = "checked=\"checked\""; }else{ $checked = ""; } ?>
456
+ <label class="radioyesno"><?php if ($counter == 1) { echo 'Yes '; } else { echo 'No '; } ?><input type="radio" name="<?php echo $value['id']; ?>" class="<?php echo $value['id']; ?>" value="<?php echo $option; ?>" <?php echo $checked; ?> /></label>
457
+ <?php
458
+ $counter++;
459
+ }
460
+ ?>
461
+
462
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
463
+ </div>
464
+ <?php break;
465
+ /************************************************/
466
+ case "radioprofile":
467
+ ?>
468
+
469
+ <div class="wlcms_input_profile" <?php if($value['id'] == 'wlcms_o_show_welcome') { echo ' id="form-show-welcome" '; }?> >
470
+ <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
471
+
472
+ <?php
473
+ $counter = 1;
474
+ foreach ($value['options'] as $option) { ?>
475
+ <?php
476
+ switch ($counter) {
477
+ case 1:
478
+ $profileName = 'Custom';
479
+ if(get_option($value['id']) == 1){ $checked = "checked=\"checked\""; }else{ $checked = ""; }
480
+ break;
481
+ case 2:
482
+ $profileName = 'Website';
483
+ if(get_option($value['id']) == 2){ $checked = "checked=\"checked\""; }else{ $checked = ""; }
484
+ break;
485
+ case 3:
486
+ $profileName = 'Blog';
487
+ if(get_option($value['id']) == 3){ $checked = "checked=\"checked\""; }else{ $checked = ""; }
488
+ break;
489
+ }
490
+ ?>
491
+ <label class="radio<?php echo $profileName;?>"><?php echo $profileName;?><input type="radio" name="wlcms_o_radio_profiles" class="<?php echo $value['id']; ?>" value="<?php echo $counter; ?>" <?php echo $checked; ?> id="radio<?php echo $profileName; ?>" /></label>
492
+ <?php
493
+ $counter++;
494
+ }
495
+ ?>
496
+ <small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
497
+ </div>
498
+ <?php break;
499
+
500
+ case "subtitle":
501
+ ?>
502
+ <div class="wlcms_section">
503
+ <div class="wlcms_subtitle">
504
+ <h3><?php echo $value['name']; ?></h3>
505
+ <div class="clearfix"></div>
506
+ </div>
507
+ </div>
508
+ <?php
509
+ break;
510
+ case "section":
511
+
512
+ $i++;
513
+ ?>
514
+
515
+ <div class="wlcms_section">
516
+ <div class="wlcms_title"><h3><img src="<?php echo plugins_url('images/trans.png', dirname(__FILE__)); ?>" class="inactive" alt=""><?php echo $value['name']; ?></h3><span class="submit"><input name="save<?php echo $i; ?>" type="submit" style="font-size:10px" value="Save changes" />
517
+ </span><div class="clearfix"></div></div>
518
+ <div class="wlcms_options" style="display: none;">
519
+
520
+ <?php break;
521
+ case "subsection":
522
+ ?>
523
+ <div id="v<?php echo str_replace(" ", "", $value['name']); ?>" class="video-h">
524
+ <h4><?php echo $value['name']; ?> <span class="submit"><input type="submit" value="clear" onclick="clearvid('v<?php echo str_replace(" ", "", $value['name']); ?>');return false;" /></span></h4>
525
+ <div class="clearfix"></div>
526
+
527
+ <?php break;
528
+ case "subsectionvars":
529
+ ?>
530
+ <div id="v<?php echo str_replace(" ", "", $value['name']); ?>" class="video-h">
531
+ <h4><?php echo $value['name']; ?></h4>
532
+ <div class="clearfix"></div>
533
+
534
+ <?php break;
535
+
536
+ }
537
+ }
538
+ ?>
539
+
540
+ <input type="hidden" name="action" value="save" />
541
+ </form>
542
+ </div>
543
+
544
+ <p style="margin-top:0px;" class="submit">
545
+ <a href="" onclick="return false;" class="importbtn">Import your settings</a> |
546
+ <a href="" onclick="return false;" class="exportbtn">Export your settings</a> |
547
+ <a onclick="if(confirm('Are you sure you want to reset?')){return true;}return false;" href="?page=wlcms-plugin.php&amp;action=reset">Reset the plugin </a> </p>
548
+
549
+ <form method="post" action="<?php echo admin_url( 'options-general.php?page=wlcms-plugin.php&amp;action=import' );?>" enctype="multipart/form-data" id="importform" style="display:none">
550
+ Import File: <input type="file" name="wlcms_import" />
551
+ <input type="submit" value="Import" />
552
+ <?php echo wp_nonce_field( 'wlcms_import' ); ?>
553
+ </form>
554
+
555
+ <form method="get" action="<?php echo admin_url( 'options-general.php?page=wlcms-plugin.php' );?>" id="exportopts" style="display:none">
556
+ <p>
557
+ Do you want to include images that were added using the media upload button? (If you choose yes, the image path will point to this domain)
558
+ </p>
559
+
560
+ <p>
561
+ <input type="radio" name="wlcms_export_imgs" value="yes" /> Yes
562
+ <input type="radio" name="wlcms_export_imgs" value="no" checked="checked" /> No
563
+ <input type="radio" name="wlcms_export_imgs" value="partial" /> Partial (the domain name will be updated and you will need to upload the images to the new domain)
564
+ </p>
565
+
566
+ <input type="hidden" name="page" value="wlcms-plugin.php" />
567
+ <input type="hidden" name="action" value="export" />
568
+
569
+ <input type="submit" value="Export" />
570
+
571
+ </form>
572
+ </div>
573
+
574
+ <script type="text/javascript">
575
+
576
+ function quickValidate()
577
+ {
578
+ if (! jQuery('#sub_name').val() )
579
+ {
580
+ alert('Your Name is required');
581
+ return false;
582
+ }
583
+ if(! jQuery('#sub_email').val() )
584
+ {
585
+ alert('Your Email is required');
586
+ return false;
587
+ }
588
+ return true;
589
+ }
590
+
591
+ jQuery('.importbtn').click(function(){
592
+ jQuery('#importform').slideDown();
593
+ });
594
+
595
+ jQuery('.exportbtn').click(function(){
596
+ jQuery('#exportopts').slideDown();
597
+ });
598
+
599
+ jQuery(document).ready(function($) {
600
+ // Upload function goes here
601
+
602
+ jQuery('.upload_image_button').click(function() {
603
+ formField = jQuery(this).attr('rel');
604
+ tb_show('', 'media-upload.php?type=image&wlcms=true&TB_iframe=true');
605
+ return false;
606
+ });
607
+
608
+ window.send_to_editor = function(html) {
609
+ var imgurl = '';
610
+
611
+ // Parse out the image source
612
+ var regex = /<img[^>]+src=['"](.*?)['"]/i;
613
+ var matches = regex.exec( html );
614
+ if ( matches.length >= 2 ) {
615
+ imgurl = matches[ 1 ];
616
+ }
617
+
618
+ jQuery('#'+formField).val(imgurl);
619
+ tb_remove();
620
+
621
+ }
622
+
623
+ var formfield=null;
624
+ window.original_send_to_editor = window.send_to_editor;
625
+ window.send_to_editor = function(html){
626
+ if (formfield) {
627
+ var fileurl = jQuery('img',html).attr('src');
628
+ formfield.val(fileurl);
629
+ tb_remove();
630
+ } else {
631
+ window.original_send_to_editor(html);
632
+ }
633
+ formfield=null;
634
+ };
635
+
636
+ jQuery('.lu_upload_button').click(function() {
637
+ formfield = jQuery(this).parent().parent().find(".text_input");
638
+ tb_show('', 'media-upload.php?type=image&wlcms=true&TB_iframe=true');
639
+ jQuery('#TB_overlay,#TB_closeWindowButton').bind("click",function(){formfield=null;});
640
+ return false;
641
+ });
642
+ jQuery(document).keyup(function(e) {
643
+ if (e.keyCode == 27) formfield=null;
644
+ });
645
+
646
+ });
647
+ </script>
includes/conditionals.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * CONDITIONAL ACTIONS
5
+ */
6
+
7
+
8
+ if(get_option('wlcms_o_footer_custom_logo'))
9
+ {
10
+ add_filter('admin_footer_text', 'wlcms_remove_footer_admin');
11
+ }
12
+ elseif(get_option('wlcms_o_developer_name'))
13
+ {
14
+ add_filter('admin_footer_text', 'wlcms_developer_link');
15
+ }
16
+
17
+ if (get_option('wlcms_o_dashboard_remove_right_now') == 1)
18
+ {
19
+ add_action('wp_dashboard_setup', 'wlcms_remove_right_now');
20
+ }
21
+
22
+ if (get_option('wlcms_o_dashboard_remove_activity_panel') == 1)
23
+ {
24
+ add_action('wp_dashboard_setup', 'wlcms_remove_activity_panel');
25
+ }
26
+
27
+ if (get_option('wlcms_o_dashboard_remove_recent_comments') == 1)
28
+ {
29
+ add_action('wp_dashboard_setup', 'wlcms_remove_recent_comments');
30
+ }
31
+
32
+ if (get_option('wlcms_o_dashboard_others') == 1)
33
+ {
34
+ add_action('wp_dashboard_setup', 'wlcms_remove_others');
35
+ }
36
+
37
+ if (get_option('wlcms_o_dashboard_remove_nag_update') == 1)
38
+ {
39
+ add_action( 'admin_init', 'wlcms_remove_update_nag');
40
+ }
41
+
42
+ if (get_option('wlcms_o_hide_admin_bar') == 1)
43
+ {
44
+ add_filter( 'show_admin_bar', '__return_false' );
45
+ }
46
+
47
+ if (get_option('wlcms_o_hide_wpversion') == 1)
48
+ {
49
+ add_filter( 'update_footer', 'remove_footer_version', 9999 );
50
+ add_action( 'admin_head', 'wlcms_hide_wp_version');
51
+ }
52
+
53
+ function wlcms_remove_update_nag() {
54
+ remove_action('admin_notices', 'update_nag', 3);
55
+ remove_action('admin_notices', 'maintenance_nag', 10);
56
+ }
57
+
58
+ /*
59
+ * ADDITIONAL HEADER CSS
60
+ */
61
+
62
+ function wlcms_custom_css()
63
+ {
64
+
65
+ $wlcms_header_css = '';
66
+
67
+ if(get_option('wlcms_o_custom_css')!="")
68
+ {
69
+ $wlcms_header_css .= wp_specialchars_decode( stripslashes( get_option('wlcms_o_custom_css') ), 1, 0, 1 );
70
+ }
71
+
72
+ if (get_option('wlcms_o_dashboard_remove_help_box') == 1)
73
+ {
74
+ $wlcms_header_css .= '#contextual-help-link-wrap { display: none; }';
75
+ $wlcms_header_css .= '#contextual-help-link { display: none; }';
76
+ }
77
+
78
+ if (get_option('wlcms_o_post_meta_box_slug'))
79
+ {
80
+ $wlcms_header_css .= '#slugdiv, #edit-slug-box { display: none; } ';
81
+ }
82
+
83
+ if (get_option('wlcms_o_dashboard_remove_screen_options') == 1)
84
+ {
85
+ $wlcms_header_css .= '#screen-options-link-wrap { display: none; }';
86
+ }
87
+
88
+ if (!current_user_can('activate_plugins'))
89
+ {
90
+ if (get_option('wlcms_o_hide_admin_bar_option') == 1)
91
+ {
92
+ $wlcms_header_css .= '.show-admin-bar { display: none; }';
93
+ }
94
+
95
+ if (get_option('wlcms_o_inherit_hide_menus') == 1)
96
+ {
97
+ if (get_option('wlcms_o_hide_posts'))
98
+ {
99
+ $wlcms_header_css .= '#wp-admin-bar-new-post { display: none; }';
100
+ }
101
+ if (get_option('wlcms_o_hide_pages'))
102
+ {
103
+ $wlcms_header_css .= '#wp-admin-bar-new-page { display: none; }';
104
+ }
105
+ if (get_option('wlcms_o_hide_media'))
106
+ {
107
+ $wlcms_header_css .= '#wp-admin-bar-new-media { display: none; }';
108
+ }
109
+ if (get_option('wlcms_o_hide_links'))
110
+ {
111
+ $wlcms_header_css .= '#wp-admin-bar-new-link { display: none; }';
112
+ }
113
+ if (get_option('wlcms_o_hide_comments'))
114
+ {
115
+ $wlcms_header_css .= '#wp-admin-bar-comments { display: none; }';
116
+ }
117
+ if (!get_option('wlcms_o_show_widgets'))
118
+ {
119
+ $wlcms_header_css .= '#wp-admin-bar-widgets { display: none; }';
120
+ }
121
+ if (!get_option('wlcms_o_show_appearance'))
122
+ {
123
+ $wlcms_header_css .='#wp-admin-bar-menus { display: none; }';
124
+ }
125
+ if (!get_option('wlcms_o_show_background'))
126
+ {
127
+ $wlcms_header_css .= '#wp-admin-bar-background { display: none; }';
128
+ }
129
+ if (!get_option('wlcms_o_show_header'))
130
+ {
131
+ $wlcms_header_css .= '#wp-admin-bar-header { display: none; }';
132
+ }
133
+ }
134
+ }
135
+
136
+
137
+ echo '<style type="text/css">';
138
+ echo $wlcms_header_css;
139
+ echo '</style>';
140
+ }
141
+
142
+
143
+ ?>
includes/plugin_deactivate.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ function wlcms_plugin_deactivate()
4
+ {
5
+
6
+ include('admin.config.php');
7
+ // Delete all the options that are defined in config
8
+ foreach($wlcmsOptions as $opt):
9
+ if( isset($opt['id']) ):
10
+ delete_option($opt['id']);
11
+ endif;
12
+ endforeach;
13
+
14
+
15
+ wlcmsUpdateCaps(); // Restores other caps back to default
16
+
17
+ // remove editor changes
18
+ $role = get_role( 'editor');
19
+ $role->remove_cap( 'switch_themes');
20
+ $role->remove_cap( 'edit_theme_options');
21
+
22
+ } // end :: function :: plugin_cleanup
23
+
24
+
25
+ ?>
readme.txt ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === White Label CMS ===
2
+
3
+ Contributors: VideoUserManuals
4
+ Plugin Name: White Label CMS
5
+ Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
6
+ Tags: cms, custom, admin, branding, dashboard, administration, plugin, login, client, menu, navigation, appearance, menus, widgets
7
+ Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
8
+ Author: Video User Manuals
9
+ Requires at least: 3.3
10
+ Tested up to: 4.9.5
11
+ Stable tag: 1.6.2
12
+
13
+ Customize dashboard panels and branding, remove menus, give editors access to widgets plus lots more.
14
+
15
+ == Description ==
16
+ The White Label CMS plugin is for developers who want to give their clients a more personalised and less confusing content management system
17
+
18
+ For a video overview of the changes in 1.5 and how this affects WordPress 3.4 please visit the [White Label CMS](http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=description "White Label CMS") home hosted on the [WordPress Manual Plugin](http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=description "WordPress Manual Plugin") website.
19
+
20
+ WordPress 3.3's new admin bar has restricted the type of branding you can have for clients, which is why we have introduced the ability to brand the dashboard.
21
+
22
+ You also have the ability to choose which menus are visible. We have 3 CMS profiles available as presets: Website, Blog or Custom so you can modify the menu system to suit the CMS purpose. These only apply to the user role of Editor and below. Admins will see all menus.
23
+
24
+ You can also give Editors access to the Menu and Widgets, but the switch theme option will not appear.
25
+
26
+ White Label CMS allows you to remove all the panels from the WordPress dashboard and insert your own panel, which you can use to write 2 personalised messages to your client and link to the important elements in the CMS.
27
+
28
+ It also allows you to add custom logos to the header and footer as well as the all important login page, giving your client a better branded experience of their new website.
29
+
30
+ There is also the option to hide the nag update as well.
31
+
32
+ No longer will you have to tell your clients to ignore the dashboard!
33
+
34
+ == Installation ==
35
+ 1. Download the White Label CMS plugin
36
+ 2. Upload it to your plugins directory
37
+ 3. Go to the plugins directory and activate the plugin
38
+ 4. Go to Settings->White Label CMS and use the menu system to change the default values.
39
+
40
+ Please note:
41
+ We have updated the way images now work. There are 3 options:
42
+ You can either just add the filename, and this will look inside your theme/child theme's images folder for the file.
43
+ You can put the full url of the image, if you want it to load from an external site
44
+ You can use the WordPress uploader, but please make sure you click "insert image"
45
+
46
+ == Upgrade Notice ==
47
+ Updates for WordPress 3.3
48
+ More Bug Fixes for WLCMS 1.4 and improved support for other languages.
49
+ You can now brand the dashboard as well as the admin bar.
50
+ !You must save the new settings if you are upgrading from 1.3!
51
+
52
+ == Screenshots ==
53
+ 1. An example of a custom login
54
+ 2. An example of how your clients dashboard could look
55
+ 3. Customize which menus appear for editors
56
+ 4. Simple menu options
57
+ 5. Customize the homepage
58
+
59
+ == Changelog ==
60
+
61
+ = 1.6.2 =
62
+ Fixed deprecated php function
63
+
64
+ = 1.6.1 =
65
+ Fixed Import for php5.2
66
+
67
+ = 1.6 =
68
+ Fixed Import
69
+
70
+ = 1.5.9 =
71
+ Minor changes
72
+
73
+ = 1.5.8 =
74
+ Fixed minor bugs
75
+
76
+ = 1.5.7 =
77
+ Fixed issue with importer
78
+
79
+ = 1.5.6 =
80
+ Fixed bug with dashboard panels in wp-admin
81
+
82
+ = 1.5.5 =
83
+ WordPress v4.4.1 Compatibility
84
+
85
+ = 1.5.4 =
86
+ Fixed conflict with WP Mandrill plugin
87
+ Added option to hide the activity panel in the dashboard
88
+ Renamed Right Now widget to At a Glance
89
+
90
+ = 1.5.3 =
91
+ Security release. Better use of WordPress nonces and enhanced validation on import functionality. Disclosed by g0blin.
92
+
93
+ = 1.5.2 =
94
+ Login Logo width fixed for version WordPress 3.8
95
+ fixed 16px logo in admin bar on front end
96
+ Fixed advert on wlcms advert on the settings page
97
+ Fixed Dashboard logo not appear on dashboard for WP 3.8
98
+ Fixed Footer logo does not line up properly WP 3.8
99
+ Fixed Hide WordPress Logos from admin bar
100
+
101
+
102
+ = 1.5.1 =
103
+ Security patch - added nonce to admin form for better security. Props PC SJJ.
104
+
105
+ = 1.5 =
106
+ Added Custom RSS Feeds as new option
107
+ Added Import/Export of settings feature.
108
+ Updated CSS rules for wp-login.
109
+ Minor bug fixes
110
+
111
+ = 1.4.7 =
112
+ Minor Bug introduced with WordPress 3.4 and custom login images.
113
+ Also added conditionals to prevent any errors with user capabilities.
114
+
115
+ = 1.4.6 =
116
+ Patch submitted by Chris @ iThemes. Better support for users of iThemes.
117
+
118
+ = 1.4.5 =
119
+ Changed how media menu is hidden to allow both hiding the menu and still able to add content. (Small bug)
120
+
121
+ = 1.4.4 =
122
+ Better support for other languages, deactivating the plugin does not remove options, only deleting it will run the uninstall script. Other minor fixes.
123
+
124
+ = 1.4.3 =
125
+ Minor Bug Fixes and some improvements on how forms are saved.
126
+
127
+ = 1.4.2 =
128
+ Bug Fixes, hopefully the last ones for this version
129
+
130
+ = 1.4.1 =
131
+ Bug Fixes for radio buttons, media uploader and login style
132
+
133
+ = 1.4 =
134
+ Changes for WordPress 3.3
135
+ Ability to brand the dashboard
136
+ Lots of new changes and bug fixes
137
+
138
+ = 1.3 =
139
+ Changes for WordPress 3.2
140
+ Restructure of menus
141
+ Added classic header and footer for 3.2 to improve branding
142
+ Header logo as site link
143
+ Admin can view dashboards but hide them from editors
144
+ Hide browser nag
145
+
146
+ Bug fixes
147
+
148
+ = 1.2 =
149
+ Ability to show Menu & Widgets menu for Editors
150
+ Removed WordPress link and ALT text from login page.
151
+ Custom css for forgotten link on login page.
152
+ Tested on multi user sites.
153
+ Fixed a bug which was stopping the Profile from appearing.
154
+
155
+ = 1.1 =
156
+ Ability to remove menus
157
+ Added widths for header and footer logos.
158
+
159
+ = 1.0.5 =
160
+ Updated terminology
161
+
162
+ = 1.0.4 =
163
+ Updated custom login image file height
164
+
165
+ = 1.0.3 =
166
+ Updated logo filename
167
+
168
+ = 1.0.2 =
169
+ Added update log!
170
+
171
+ == Frequently Asked Questions ==
172
+ = Who is this plugin for?=
173
+ For developers who handover websites to their clients and use WordPress as a CMS.
174
+
175
+ =How to I add links to my own panel?=
176
+ Your custom panel accepts html, so just write the markup as you normally would in html.
177
+
178
+ =How do I remove menu items?=
179
+ Click on the Remove Menus section and either choose a CMS profile, or manually select which menu items to be removed. Please not this will only effect user roles of Editor and below. So you will need to logout in order to see the difference.
180
+
181
+ =How do you recommend using this plugin?=
182
+ We have been using this for a number of months now, and we have found clients respond best when it is set up in the following fashion:
183
+
184
+ * Use the clients logo for the login (it gives the CMS a bit of a wow factor!)
185
+ * Use the clients logo in the header
186
+ * Use your own logo in the footer, and place a link back to your website
187
+ * Remove all panels from the dashboard (they have a lot of information that just confuses the client)
188
+ * Add your own panel. Personalise the experience for your client by welcoming them to their website. Provide links to the most relevant elements in the CMS. Provide a link back to your support system if you have one.
189
+
190
+ =Appearance Menu=
191
+ With WordPress 3 comes the much need Menus option. However, this sits inside the Appearance menu which is hidden to editors. You can you make the Menus and Widgets menus available to editors, but can keep the switch theme menu removed.
192
+
193
+ Please note: The plugin works by granting Editor's the 'switch_themes' and 'edit_theme_options' privilege which gives them access to the Appearance menu, but removes the switch themes menu from the Appearance menu and the WordPress 3 Right Now dashboard. However it could still be possible for a Editor to switch themes, if they knew the direct url path. Unlikely, but you should be aware of this before you choose to enable these options.
194
+
195
+ Menus is only available to WordPress 3 users.
196
+
197
+ If you see menus like background or header, then you must modify your theme in order to remove them.
198
+
199
+ When the plugin is uninstalled, the Editor privileges are reset to their original values.
200
+
201
+ =How do I use it on Multi Site?=
202
+ * You must install the plugin network wide in order for it to work on all sites.
203
+ * You must save the options on each new site in order for the default options to appear.
204
+ * You can have separate login logos for each mini site. Simply change the filename, and upload it to the relevant theme.
205
+
206
+ =Troubleshooting=
207
+ I installed the plugin and the logos disappear?: You need to upload your logos to you current themes images directory.
208
+
209
+ The menus have not changes?: Make sure you are logged in as the editor
210
+
211
+ Lost Password CSS not working?: Make sure you use the example format. The color must be the last css style and it must not have a closing ; as !important is appended to the end of the style to overwrite and existing style.
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.png ADDED
Binary file
scripts/wlcms_script.js ADDED
@@ -0,0 +1,271 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function wlcms_menus() {
2
+ // Set initial open/close
3
+ jQuery('#menus > li').each(function() {
4
+ var submenu = jQuery('ul',this);
5
+
6
+ if(jQuery(submenu).length>0) {
7
+ jQuery(submenu).slideDown(500);
8
+ jQuery("em",this).text("↓");
9
+ }
10
+
11
+ if(jQuery('input:eq(0)',this).is(':checked')) {
12
+ if(jQuery(submenu).length>0) {
13
+ jQuery(submenu).slideDown(500);
14
+ jQuery("em",this).text("↑");
15
+ }
16
+ } else {
17
+ if(jQuery(submenu).length>0) {
18
+ jQuery(submenu).hide();
19
+ jQuery("em",this).text("↓");
20
+ }
21
+ }
22
+ });
23
+
24
+ // On click
25
+ jQuery('#menus span').click(function() {
26
+ var parent = jQuery(this).parent().parent();
27
+ var submenu = jQuery('ul',parent);
28
+ jQuery(submenu).slideToggle(500,function() {
29
+ var parent = jQuery(this).parent();
30
+ jQuery("em",parent).text(jQuery(submenu).is(':visible') ? "↑" : "↓");
31
+ });
32
+ });
33
+
34
+ // On click
35
+ jQuery('#menus input').click(function() {
36
+ var parent = jQuery(this).parent().parent();
37
+ var submenu = jQuery('ul',parent);
38
+ if(jQuery(this).is(':checked')) {
39
+ if(jQuery(submenu).length>0) {
40
+ jQuery(submenu).slideDown(500);
41
+ jQuery('li',submenu).each(function() {
42
+ jQuery('input',this).attr('checked','checked');
43
+ });
44
+ }
45
+ } else {
46
+ if(jQuery(submenu).length>0) {
47
+ jQuery(submenu).slideUp(500);
48
+ jQuery('li',submenu).each(function() {
49
+ jQuery('input',this).removeAttr('checked');
50
+ });
51
+ }
52
+ }
53
+ });
54
+ }
55
+
56
+ jQuery(document).ready(function($){
57
+ wlcms_menus();
58
+
59
+
60
+ $('#wlcms_o_edit_role').parent().css('borderTop','0');
61
+ $('#roles_capabilities').parent().css('paddingLeft','30px').css('paddingRight','30px').css('paddingBottom','10px');
62
+
63
+ jQuery('.edit_role_name').hide();
64
+ jQuery('#wlcms_o_head_cap').hide();
65
+ /**/
66
+ jQuery('.wlcms_o_modify_sub_menu').hide();
67
+
68
+ /**/
69
+ /*jQuery('#footer-left').remove();*/
70
+
71
+ jQuery('.wlcms_options').slideUp();
72
+
73
+ jQuery('.video-h').hover(function() {
74
+ jQuery(this).addClass('pretty-hover');
75
+ }, function() {
76
+ jQuery(this).removeClass('pretty-hover');
77
+ });
78
+
79
+ var showHideWelcome;
80
+ var showHideAppearance;
81
+ var formField;
82
+
83
+ //Showhide RSS
84
+ showHideRSS = jQuery('.wlcms_opts form #form-show-rss input:radio:checked').val();
85
+ if(showHideRSS == 0) {
86
+ jQuery('#vRSSSettings').hide();
87
+ }
88
+
89
+ jQuery('.wlcms_opts form #form-show-rss input:radio').click(function() {
90
+ showHideRSS = jQuery('.wlcms_opts form #form-show-rss input:radio:checked').val();
91
+ if(showHideRSS == 0) {
92
+ jQuery('#vRSSSettings').hide();
93
+ } else {
94
+ jQuery('#vRSSSettings').show();
95
+ }
96
+ });
97
+
98
+ // Showhide Welcome
99
+ showHideWelcome = jQuery('.wlcms_opts form #form-show-welcome input:radio:checked').val();
100
+ if(showHideWelcome == 0) {
101
+ jQuery('#vWelcomePanelSettings').hide();
102
+ }
103
+
104
+ jQuery('.wlcms_opts form #form-show-welcome input:radio').click(function() {
105
+ showHideWelcome = jQuery('.wlcms_opts form #form-show-welcome input:radio:checked').val();
106
+ if(showHideWelcome == 0) {
107
+ jQuery('#vWelcomePanelSettings').hide();
108
+ } else {
109
+ jQuery('#vWelcomePanelSettings').show();
110
+ }
111
+ });
112
+
113
+ // Showhide Appearance Menu
114
+ showHideAppearance = jQuery('.wlcms_opts form #form-show-template input:radio:checked').val();
115
+ if(showHideAppearance == 0) {
116
+ jQuery('#vTheAppearanceMenu').hide();
117
+ }
118
+
119
+ jQuery('.wlcms_opts form #form-show-template input:radio').click(function() {
120
+ showHideWelcome = jQuery('.wlcms_opts form #form-show-template input:radio:checked').val();
121
+ if(showHideWelcome == 0) {
122
+ jQuery('#vTheAppearanceMenu').hide();
123
+ } else {
124
+ jQuery('#vTheAppearanceMenu').show();
125
+ }
126
+ });
127
+
128
+
129
+ jQuery('.wlcms_section h3').click(function(){
130
+ if(jQuery(this).parent().next('.wlcms_options').css('display')=='none')
131
+ { jQuery(this).removeClass('inactive');
132
+ jQuery(this).addClass('active');
133
+ jQuery(this).children('img').removeClass('inactive');
134
+ jQuery(this).children('img').addClass('active');
135
+
136
+ }
137
+ else
138
+ { jQuery(this).removeClass('active');
139
+ jQuery(this).addClass('inactive');
140
+ jQuery(this).children('img').removeClass('active');
141
+ jQuery(this).children('img').addClass('inactive');
142
+ }
143
+
144
+ jQuery(this).parent().next('.wlcms_options').slideToggle('slow');
145
+ });
146
+
147
+ jQuery('#radioWebsite').click(function() {
148
+ jQuery('input[name=wlcms_o_hide_posts]').attr('checked', true);
149
+ jQuery('input[name=wlcms_o_hide_media]').attr('checked', false);
150
+ jQuery('input[name=wlcms_o_hide_links]').attr('checked', true);
151
+ jQuery('input[name=wlcms_o_hide_pages]').attr('checked', false);
152
+ jQuery('input[name=wlcms_o_hide_comments]').attr('checked', true);
153
+ jQuery('input[name=wlcms_o_hide_users]').attr('checked', true);
154
+ jQuery('input[name=wlcms_o_hide_tools]').attr('checked', true);
155
+ jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', true);
156
+ jQuery('input[name=wlcms_o_show_appearance]').attr('checked', false);
157
+ jQuery('input[name=wlcms_o_show_widgets]').attr('checked', false);
158
+ });
159
+
160
+ jQuery('#radioBlog').click(function() {
161
+ jQuery('input[name=wlcms_o_hide_posts]').attr('checked', false);
162
+ jQuery('input[name=wlcms_o_hide_media]').attr('checked', false);
163
+ jQuery('input[name=wlcms_o_hide_links]').attr('checked', true);
164
+ jQuery('input[name=wlcms_o_hide_pages]').attr('checked', false);
165
+ jQuery('input[name=wlcms_o_hide_comments]').attr('checked', false);
166
+ jQuery('input[name=wlcms_o_hide_users]').attr('checked', true);
167
+ jQuery('input[name=wlcms_o_hide_tools]').attr('checked', true);
168
+ jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', true);
169
+ jQuery('input[name=wlcms_o_show_appearance]').attr('checked', false);
170
+ jQuery('input[name=wlcms_o_show_widgets]').attr('checked', false);
171
+ });
172
+
173
+ jQuery('.wlcms_input_local_video').click(function() {
174
+ if(jQuery('label',this).hasClass('wlcms_o_parent_label_active')) {
175
+ jQuery('.wlcms_o_parent_label_active',this).removeClass('wlcms_o_parent_label_active');
176
+ } else {
177
+ jQuery('.wlcms_o_parent_label',this).addClass('wlcms_o_parent_label_active');
178
+ }
179
+
180
+ jQuery(this).next('.wlcms_o_modify_sub_menu').slideToggle('slow');
181
+ });
182
+
183
+ jQuery('#radioCustom').click(function() {
184
+ if (jQuery('#wlcms_o_hide_posts').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_posts]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_posts]').attr('checked', false); }
185
+ if (jQuery('#wlcms_o_hide_media').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_media]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_media]').attr('checked', false); }
186
+ if (jQuery('#wlcms_o_hide_links').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_links]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_links]').attr('checked', false); }
187
+ if (jQuery('#wlcms_o_hide_pages').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_pages]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_pages]').attr('checked', false); }
188
+ if (jQuery('#wlcms_o_hide_comments').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_comments]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_comments]').attr('checked', false); }
189
+ if (jQuery('#wlcms_o_hide_users').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_users]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_users]').attr('checked', false); }
190
+ if (jQuery('#wlcms_o_hide_tools').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_tools]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_tools]').attr('checked', false); }
191
+ if (jQuery('#wlcms_o_hide_separator2').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', true); } else { jQuery('input[name=wlcms_o_hide_separator2]').attr('checked', false); }
192
+ if (jQuery('#wlcms_o_show_appearance').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_show_appearance]').attr('checked', true); } else { jQuery('input[name=wlcms_o_show_appearance]').attr('checked', false); }
193
+ if (jQuery('#wlcms_o_show_widgets').is('.wlcms_remChecked')) { jQuery('input[name=wlcms_o_show_widgets]').attr('checked', true); } else { jQuery('input[name=wlcms_o_show_widgets]').attr('checked', false); }
194
+
195
+ });
196
+
197
+
198
+ // Set default value
199
+
200
+ jQuery(".default-text").focus(function(srcc){
201
+ if (jQuery(this).val() == jQuery(this)[0].title){
202
+ jQuery(this).val("");
203
+ }
204
+ });
205
+
206
+ jQuery(".default-text").blur(function(){
207
+ if (jQuery(this).val() == "" || isNaN(jQuery(this).val())){
208
+ jQuery(this).val(jQuery(this)[0].title);
209
+ }
210
+ });
211
+ /***********************************************************************************/
212
+ jQuery(".add").click(function(){
213
+ if (jQuery("#wlcms_o_role_name").val() == ""){
214
+ alert("must fill role name");
215
+ return false;
216
+
217
+ }
218
+
219
+ });
220
+
221
+ /*hide roles_capabilities*/
222
+ var roleName;
223
+
224
+
225
+ jQuery('#wlcms_o_edit_role').change(function() {
226
+ jQuery('.edit_role_name').hide();
227
+ jQuery('#wlcms_o_head_cap').show();
228
+ roleName=jQuery("#wlcms_o_edit_role").val();
229
+ if(roleName==0)
230
+ jQuery('#wlcms_o_head_cap').hide();
231
+
232
+ jQuery('#roles_'+roleName).show();
233
+
234
+ });
235
+
236
+ /**/
237
+
238
+ /***********************************************************************************/
239
+
240
+ jQuery(".default-text").blur();
241
+
242
+
243
+ // Add http with devoloper url if not exist
244
+
245
+ jQuery("#wlcms_o_developer_url").blur(function() {
246
+ var input = jQuery(this);
247
+ var val = input.val();
248
+ if (val && !val.match(/^http([s]?):\/\/.*/)) {
249
+ input.val('http://' + val);
250
+ }
251
+ });
252
+
253
+
254
+
255
+
256
+
257
+
258
+ // Ajax function goes here
259
+
260
+
261
+ /*$.ajax({
262
+ url: "wlcms-plugin.php",
263
+ context: document.body,
264
+ success: function update_function(){
265
+ alert("hai";
266
+ $(this).addClass("done");
267
+ }
268
+ });*/
269
+ ////////////////////////////////////////////////
270
+ });
271
+
uninstall.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if( WP_UNINSTALL_PLUGIN ):
4
+
5
+ global $wpdb;
6
+
7
+ $x = "DELETE FROM $wpdb->options WHERE option_name LIKE 'wlcms_o_%' ";
8
+ $wpdb->query($x);
9
+
10
+ $role = get_role( 'editor' );
11
+ $role->remove_cap( 'switch_themes' ); // Legacy
12
+ $role->remove_cap( 'edit_themes' ); // Legacy
13
+ $role->remove_cap( 'edit_theme_options' );
14
+
15
+ endif;
16
+
17
+ ?>
wlcms-plugin.php ADDED
@@ -0,0 +1,957 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: White Label CMS
4
+ Plugin URI: http://www.videousermanuals.com/white-label-cms/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
5
+ Description: A plugin that allows you to brand WordPress CMS as your own
6
+ Version: 1.6.2
7
+ Author: www.videousermanuals.com
8
+ Author URI: http://www.videousermanuals.com/?utm_campaign=wlcms&utm_medium=plugin&utm_source=readme-txt
9
+ */
10
+
11
+ define('WLCMS','1.6.2');
12
+
13
+ if ( ! defined('ABSPATH') ) {
14
+ die('Please do not load this file directly.');
15
+ }
16
+
17
+
18
+ global $wpdbb_content_dir;
19
+
20
+ $wpdbb_content_dir = ( defined('WP_CONTENT_DIR') ) ? WP_CONTENT_DIR : ABSPATH . 'wp-content';
21
+
22
+ if ( ! defined('WP_BACKUP_DIR') ) {
23
+ define('WP_BACKUP_DIR', $wpdbb_content_dir . '/');
24
+ }
25
+
26
+ //if(!function_exists('wp_get_current_user')) {
27
+ // include(ABSPATH . "wp-includes/pluggable.php");
28
+ //}
29
+
30
+ include('includes/conditionals.php');
31
+
32
+ add_action('init', 'wlcms_check_for_login');
33
+ add_action('admin_menu', 'wlcms_add_menu');
34
+ add_action('admin_init', 'wlcms_add_init');
35
+ add_action('admin_menu', 'wlcms_add_admin');
36
+ add_action('admin_head', 'wlcms_custom_css');
37
+ add_action('login_head', 'wlcms_custom_login_logo');
38
+ add_action('admin_head', 'wlcms_hide_switch_theme');
39
+ add_action('admin_menu', 'wlcms_remove_default_post_metaboxes');
40
+ add_action('admin_init', 'wlcms_remove_admin_menus');
41
+ add_action('admin_menu', 'wlcms_remove_default_page_metaboxes');
42
+ add_action('admin_head', 'wlcms_dashboard_mod');
43
+ add_action('admin_head-media-upload-popup', 'wlcms_iframe_mod');
44
+ add_action('wp_before_admin_bar_render', 'wlcms_adminbar', 0);
45
+ add_action('wp_before_admin_bar_render', 'wlcms_admin_bar', 0);
46
+ add_action('wp_dashboard_setup', 'wlcms_add_dashboard_widget_custom' );
47
+
48
+ add_filter( 'admin_title', 'wlcms_admin_title', 10, 2);
49
+ add_filter( 'mce_css', 'wlcms_custom_editor_stylesheet' );
50
+
51
+ function wlcms_check_for_login()
52
+ {
53
+ if( get_option('wlcms_o_enable_login_redirect') ):
54
+ $segments = explode('/' , $_SERVER['REQUEST_URI'] );
55
+ if ( $segments[ (count($segments) - 1) ] == 'login' ):
56
+ wp_redirect( get_bloginfo('url') . '/wp-login.php' );
57
+ exit;
58
+ endif;
59
+ endif;
60
+ }
61
+
62
+
63
+ function wlcms_dashboard_mod()
64
+ {
65
+ global $current_screen, $wp_version;
66
+ if( isset($current_screen) && ($current_screen->id == 'dashboard' ) ):
67
+
68
+ if( get_option('wlcms_o_dashboard_override') || get_option('wlcms_o_dashboard_override') == '' ) :
69
+
70
+ if ( get_option('wlcms_o_dashboard_override') != __('Dashboard') ) :
71
+
72
+ $val = (get_option('wlcms_o_dashboard_override') == '' ? '&nbsp;' : get_option('wlcms_o_dashboard_override') );
73
+ echo '
74
+ <script type="text/javascript">
75
+ jQuery(document).ready(function($) {
76
+ $("#wpbody-content .wrap h1:eq(0)").html("'.$val.'");
77
+ // $("#wpbody-content .wrap h1").css("visibility","visible");
78
+ });
79
+ </script>';
80
+
81
+ endif;
82
+
83
+ endif;
84
+
85
+ if( get_option('wlcms_o_header_custom_logo') ):
86
+
87
+ $background = get_option('wlcms_o_header_custom_logo');
88
+
89
+ if(!preg_match("@^https?://@", $background)){
90
+ $background = get_bloginfo('stylesheet_directory').'/images/'.$background;
91
+ }
92
+
93
+ echo '<style type="text/css">
94
+ #icon-index {background:transparent;height:auto;width:auto;visibility: hidden;}
95
+ #dashboard-widgets-wrap {clear:both}
96
+ </style>';
97
+ echo '<script type="text/javascript">
98
+ jQuery(document).ready(function($) {';
99
+ if ( version_compare( $wp_version, '3.8-beta', '>=' ) )
100
+ {
101
+ echo '$(".index-php #wpbody-content .wrap h1:eq(0)").prepend("<span id=\"wlcms_dashboard_logo\"><img src=\"'.$background.'\" alt=\"\" /></span>");
102
+ $("#wlcms_dashboard_logo").css({"visibility":"visible", "display": "block", "float" : "left", "margin": "-2px 8px 0px 0px"});';
103
+ }else{
104
+ echo '$("#icon-index").html("<img src=\"'.$background.'\" alt=\"\" />");
105
+ $("#icon-index").css({"visibility":"visible", "display": "block", "float" : "left", "margin": "7px 8px 0px 0px"});';
106
+ }
107
+ echo'});
108
+ </script>';
109
+ endif;
110
+
111
+ endif;
112
+
113
+ }
114
+
115
+ // set admin screen
116
+ function wlcms_add_menu()
117
+ {
118
+ $hook_name = add_options_page('White Label CMS','White Label CMS','manage_options','wlcms-plugin.php','wlcms_admin');
119
+ add_action( "admin_print_scripts-$hook_name", 'wlcms_add_admin_scripts' );
120
+ }
121
+
122
+ function wlcmsUserCompare($needsToBe,$current)
123
+ {
124
+ if($needsToBe == '0' || $needsToBe == '')
125
+ return;
126
+
127
+ $roles = array( 'administrator' => 25 , 'editor' => 20, 'author' => 15, 'contributor' => 10, 'subscriber' => 5 );
128
+
129
+ $needsToBe = $roles[$needsToBe];
130
+ $current = $roles[$current];
131
+
132
+ if($current >= $needsToBe ):
133
+ return true;
134
+ else:
135
+ return false;
136
+ endif;
137
+ }
138
+
139
+ function wlcms_remove_others() {
140
+
141
+ if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
142
+
143
+ global $wp_meta_boxes;
144
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
145
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
146
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
147
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
148
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
149
+ unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
150
+ unset($wp_meta_boxes['dashboard']['normal']['core']['custom_help_widget']);
151
+ unset($wp_meta_boxes['dashboard']['normal']['core']['my_dashboard_widget']);
152
+
153
+ }
154
+
155
+ function wlcms_remove_activity_panel()
156
+ {
157
+ if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
158
+ global $wp_meta_boxes;
159
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
160
+ }
161
+
162
+ function wlcms_remove_right_now()
163
+ {
164
+ if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
165
+ global $wp_meta_boxes;
166
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
167
+ }
168
+
169
+ function wlcms_remove_recent_comments()
170
+ {
171
+ if( get_option('wlcms_o_dashboard_admin') && current_user_can('activate_plugins') ) { return; }
172
+ global $wp_meta_boxes;
173
+ unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
174
+ }
175
+
176
+ function wlcms_output()
177
+ {
178
+ global $userdata;
179
+ $WP_Roles = new WP_Roles();
180
+ $role_names = $WP_Roles->get_names();
181
+ unset($role_names['administrator']);
182
+ $all_caps = wlcms_get_all_caps_from_wp_roles();
183
+
184
+ sort($all_caps);
185
+ $output = "<div id=\"roles_capabilities\">";
186
+
187
+ foreach($role_names as $role_id => $role_name)
188
+ {
189
+ $output .= "<div id=\"roles_$role_id\" class=\"edit_role_name\">";
190
+ $output .= "<ul class=\"role_name_editor\">";
191
+
192
+ foreach($all_caps as $capability)
193
+ {
194
+ $checked = isset($WP_Roles->roles[$role_id]['capabilities'][$capability])&&$WP_Roles->roles[$role_id]['capabilities'] [$capability]==1?'checked="checked"':'';
195
+ $output .= "<li><input type=\"checkbox\" $checked name=\"ROLES[$role_id][$capability]\" value=1 />&nbsp;".ucfirst(str_replace("_"," ",$capability))."</li>&nbsp; ";
196
+ }
197
+
198
+ $output .= "</ul>"; $output .= "</div>";
199
+ }
200
+ $output .= "</div>";
201
+ return $output;
202
+ }
203
+
204
+ function wlcms_get_all_caps_from_wp_roles()
205
+ {
206
+ $WP_Roles = new WP_Roles();
207
+ $role_names = $WP_Roles->get_names();
208
+ $all_caps = array();
209
+ if(count($WP_Roles->roles)>0)
210
+ {
211
+ foreach($WP_Roles->roles as $role_id => $row)
212
+ {
213
+ foreach($row['capabilities'] as $capability => $allowed)
214
+ {
215
+ $all_caps[$capability]=$capability;
216
+ }
217
+ }
218
+ }
219
+ return $all_caps;
220
+ }
221
+
222
+ function wlcms_roles_dropdown($params = array())
223
+ {
224
+ $wp_roles = new WP_Roles();
225
+ // remove unwanted roles
226
+ if(!empty($params['remove_role']))
227
+ unset($wp_roles->role_names[$params['remove_role']]);
228
+
229
+ return $wp_roles->role_names;
230
+ }
231
+
232
+ function wlcms_adminbar()
233
+ {
234
+ global $wp_version;
235
+
236
+ if(get_option('wlcms_o_dashboard_border')):
237
+ echo '<style type="text/css"> .postbox-container .meta-box-sortables.empty-container, #side-sortables.empty-container{border:0;} </style>';
238
+ endif;
239
+ if( get_option('wlcms_o_hide_wp_adminbar') ):
240
+ echo " \n\n <style type=\"text/css\">#wp-admin-bar-wp-logo { display:none; } #wpadminbar #wp-admin-bar-site-name > .ab-item:before { content: normal;}</style> \n\n";
241
+ else:
242
+ echo " \n\n <style type=\"text/css\">#wp-admin-bar-wp-logo { display:block!important; }</style> \n\n";
243
+ endif;
244
+
245
+ if( get_option('wlcms_o_adminbar_custom_logo') ):
246
+ $background = get_option('wlcms_o_adminbar_custom_logo');
247
+ if(!preg_match("@^https?://@", $background))
248
+ $background = get_bloginfo('stylesheet_directory').'/images/'.$background;
249
+
250
+ echo '<script type="text/javascript"> jQuery(document).ready(function(){ ';
251
+ echo 'jQuery("#wp-admin-bar-root-default").prepend(" <li id=\"wlcms_admin_logo\"> <span style=\"float:left;height:28px;line-height:28px;vertical-align:middle;text-align:center;width:28px\"><img src=\"'.$background.'\" width=\"16\" height=\"16\" alt=\"Login\" style=\"height:16px;width:16px;vertical-align:middle\" /> </span> </li> "); ';
252
+ echo ' }); ';
253
+ echo '</script> ';
254
+
255
+ endif;
256
+
257
+ $style = '<style type="text/css">';
258
+
259
+ if(get_option('wlcms_o_header_custom_logo') != "")
260
+ {
261
+ $background = get_option('wlcms_o_header_custom_logo');
262
+
263
+ if(!preg_match("@^https?://@", $background))
264
+ $background = get_bloginfo('stylesheet_directory').'/images/'.$background;
265
+
266
+ $style .= '#header-logo { background-image: url('.$background . ') !important; ';
267
+ $css_width = get_option('wlcms_o_header_custom_logo_width');
268
+
269
+ if ($css_width != '')
270
+ {
271
+ $style .= 'width: ' . get_option('wlcms_o_header_custom_logo_width') . 'px; ';
272
+ }
273
+ else
274
+ {
275
+ if (( version_compare( $wp_version, '3.2', '>=' ) ) && (!empty($customHFHeight)))
276
+ {
277
+ $style .= 'height: '.$customHFHeight.'px; ';
278
+ }
279
+ }
280
+ $style .= '} ';
281
+ }
282
+
283
+ if (( version_compare( $wp_version, '3.2', '>=' ) ) && (!empty($customHFHeight))) {
284
+ $style .= ' #wphead { height: '.$customHFHeight.'px; }
285
+ #wphead h1 { font-size: 22px; padding: 10px 8px 5px; }
286
+ #header-logo { height: 32px; }
287
+ #user_info { padding-top: 8px }
288
+ #user_info_arrow { margin-top: 8px; }
289
+ #user_info_links { top: 8px; }
290
+ #footer p { padding-top: 15px; }
291
+ #wlcms-footer-container { padding-top: 10px; line-height: 30px;} '."\n";
292
+ }
293
+
294
+ if (( version_compare( $wp_version, '3.2', '<' ) ) && (empty($customHFHeight))) {
295
+ $style .= '#wlcms-footer-container { padding-top: 10px; line-height: 30px; }';
296
+ }
297
+
298
+ if (get_option('wlcms_o_header_logo_link') == 1) {
299
+ $style .= '#site-heading { display: none; } ';
300
+ }
301
+
302
+ $style .= '</style>';
303
+
304
+ echo $style;
305
+
306
+
307
+ if (get_option('wlcms_o_header_logo_link') == 1) {
308
+ echo '<script type="text/javascript">';
309
+ echo "jQuery(function($){ $('#header-logo').wrap('<a href=\"" . site_url() . "\" alt=\"" . get_bloginfo('name') . "\" title=\"" . get_bloginfo('name') . "\">'); });";
310
+ echo '</script>';
311
+ }
312
+ }
313
+
314
+ // add footer logo
315
+ function wlcms_remove_footer_admin() {
316
+ $footer_logo = get_option('wlcms_o_footer_custom_logo');
317
+ if($footer_logo)
318
+ if(!preg_match("@^https?://@", $footer_logo))
319
+ $footer_logo = get_bloginfo('stylesheet_directory').'/images/'.$footer_logo;
320
+
321
+ echo '<span id="footer-thankyou">';
322
+ if (get_option('wlcms_o_developer_url')) {
323
+
324
+ echo '<a target="_blank" href="' . get_option('wlcms_o_developer_url') . '">';
325
+
326
+ if (get_option('wlcms_o_footer_custom_logo_width')) {
327
+ echo '<img style="width:' . get_option('wlcms_o_footer_custom_logo_width') . 'px;" ';
328
+ } else {
329
+ echo '<img ';
330
+ }
331
+ echo ' src="'.$footer_logo. '" id="wlcms-footer-logo"> </a> <span> <a target="_blank" href="' . get_option('wlcms_o_developer_url') . '">' . stripslashes(get_option('wlcms_o_developer_name')) . '</a> </span>';
332
+ } else {
333
+ if (get_option('wlcms_o_footer_custom_logo_width')) {
334
+ echo '<img style="width:' . get_option('wlcms_o_footer_custom_logo_width') . 'px;" ';
335
+ } else {
336
+ echo '<img ';
337
+ }
338
+ echo ' src="'.$footer_logo . '" id="wlcms-footer-logo"> <span>' . stripslashes(get_option('wlcms_o_developer_name')).'</span>';
339
+ }
340
+ echo '</span>';
341
+ }
342
+
343
+ function wlcms_developer_link()
344
+ {
345
+ echo '<span id="footer-thankyou">';
346
+ echo ( get_option('wlcms_o_developer_url') ? '<a target="_blank" href="' . get_option('wlcms_o_developer_url') . '">' : '' );
347
+ echo stripslashes(get_option('wlcms_o_developer_name'));
348
+ echo ( get_option('wlcms_o_developer_url') ? '</a>' : '' );
349
+ echo '</span>';
350
+ }
351
+
352
+
353
+ // custom logo login
354
+ function wlcms_custom_login_logo()
355
+ {
356
+ wp_print_scripts( array( 'jquery' ) );
357
+
358
+ $login_custom_logo = get_option('wlcms_o_login_custom_logo');
359
+
360
+ if(!preg_match("@^https?://@", $login_custom_logo))
361
+ $login_custom_logo = get_bloginfo('stylesheet_directory').'/images/'.$login_custom_logo;
362
+
363
+ echo '<style type="text/css">';
364
+ echo stripslashes( get_option('wlcms_o_login_bg_css') );
365
+
366
+ if (get_option('wlcms_o_login_custom_logo')):
367
+ echo ' .login h1 a { display:all; background: url('.$login_custom_logo . ') no-repeat bottom center !important; margin-bottom: 10px; background-size: auto; } ';
368
+
369
+ if(get_option('wlcms_o_loginbg_white') ):
370
+ echo ' body.login {background: #fff } ';
371
+ endif;
372
+ echo '.login h1 a { width :auto!important;} ';
373
+ echo '</style> ';
374
+ ;
375
+
376
+ echo '<script type="text/javascript">
377
+ jQuery(document).ready(function()
378
+ {
379
+ jQuery(\'#login h1 a\').attr(\'title\',\'' . get_bloginfo('name') . '\');
380
+ jQuery(\'#login h1 a\').attr(\'href\',\'' . get_bloginfo('url') . '\');
381
+ });
382
+ </script>';
383
+
384
+ elseif( get_option('wlcms_o_login_bg_css') ):
385
+
386
+ echo stripslashes( get_option('wlcms_o_login_bg_css') );
387
+ echo '</style> ';
388
+ else:
389
+ echo '</style> ';
390
+ endif;
391
+
392
+ if(get_option('wlcms_o_login_bg_css')):
393
+ echo '<script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#login").wrap("<div id=\'wlcms-login-wrapper\'></div>"); }); </script> ';
394
+ endif;
395
+
396
+ }
397
+
398
+ function wlcms_custom_dashboard_help()
399
+ {
400
+ echo stripslashes(get_option('wlcms_o_welcome_text'));
401
+ }
402
+ function wlcms_custom_dashboard_help_new()
403
+ {
404
+ echo stripslashes(get_option('wlcms_o_welcome_text1'));
405
+ }
406
+
407
+ function wlcms_add_dashboard_widget_custom()
408
+ {
409
+ if ( get_option('wlcms_o_show_rss_widget') ):
410
+ $img = ( get_option('wlcms_o_rss_logo') ? get_option('wlcms_o_rss_logo') : '' );
411
+ if($img)
412
+ $img = '<img src="'.$img.'" height="16" width="16" alt="Logo" style="padding-right:5px;vertical-align:bottom;"/>';
413
+
414
+ wp_add_dashboard_widget('wlcms_rss_box', $img . get_option('wlcms_o_rss_title'), 'wlcms_rss_box');
415
+ endif;
416
+
417
+ if ( get_option('wlcms_o_show_welcome') ):
418
+ if ( wlcmsUserCompare( strtolower(get_option('wlcms_o_welcome_visible_to')), strtolower( wlcms_get_current_user_role() ) ) ):
419
+ wp_add_dashboard_widget('custom_help_widget', get_option('wlcms_o_welcome_title'), 'wlcms_custom_dashboard_help');
420
+ endif;
421
+
422
+ if ( wlcmsUserCompare( strtolower(get_option('wlcms_o_welcome_visible_to1')), strtolower( wlcms_get_current_user_role() ) ) ):
423
+ wp_add_dashboard_widget('my_dashboard_widget', get_option('wlcms_o_welcome_title1'), 'wlcms_custom_dashboard_help_new');
424
+ endif;
425
+ endif;
426
+ }
427
+
428
+ function remove_footer_version()
429
+ {
430
+ return '';
431
+ }
432
+
433
+ function wlcms_rss_box()
434
+ {
435
+ if(!get_option('wlcms_o_rss_value'))
436
+ return;
437
+
438
+ include_once(ABSPATH . WPINC . '/feed.php');
439
+ $num_items = get_option('wlcms_o_rss_num_items');
440
+ $rss = fetch_feed( get_option('wlcms_o_rss_value') );
441
+
442
+ if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
443
+ $maxitems = $rss->get_item_quantity($num_items);
444
+ $rss_items = $rss->get_items(0, $maxitems);
445
+ endif;
446
+
447
+ if( get_option('wlcms_o_rss_intro_html') ):
448
+ echo wpautop ( stripslashes( get_option('wlcms_o_rss_intro_html') ) );
449
+ endif;
450
+ ?>
451
+
452
+ <ul>
453
+ <?php if ($maxitems == 0) echo '<li>No items.</li>';
454
+ else
455
+ // Loop through each feed item and display each item as a hyperlink.
456
+
457
+ foreach ( $rss_items as $item ) : ?>
458
+ <li>
459
+ <strong> <a href='<?php echo esc_url( $item->get_permalink() ); ?>'
460
+ title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>' target='_blank'>
461
+ <?php echo esc_html( $item->get_title() ); ?></a> </strong> <br />
462
+
463
+ <?php if(get_option('wlcms_o_rss_show_intro') == 'yes'):
464
+ echo $item->get_content();
465
+ endif; ?>
466
+
467
+ </li>
468
+ <?php endforeach; ?>
469
+ </ul>
470
+
471
+ <?php
472
+
473
+ }
474
+
475
+ function wlcms_hide_wp_version()
476
+ {
477
+ echo '<style type="text/css">#wp-version-message { display: none;}</style>';
478
+ }
479
+
480
+ function wlcms_get_current_user_role() {
481
+ global $wp_roles;
482
+ $current_user = wp_get_current_user();
483
+ $roles = $current_user->roles;
484
+ $role = array_shift($roles);
485
+ return isset($wp_roles->role_names[$role]) ? $wp_roles->role_names[$role] : false;
486
+ }
487
+
488
+ function wlcms_custom_editor_stylesheet($url)
489
+ {
490
+
491
+ if( get_option('wlcms_o_welcome_stylesheet')):
492
+ $url = get_stylesheet_directory_uri() . '/' ;
493
+ $url .= get_option('wlcms_o_welcome_stylesheet');
494
+ endif;
495
+
496
+ return $url;
497
+ }
498
+
499
+ function wlcms_hide_switch_theme()
500
+ {
501
+ if(!current_user_can( 'manage_options' ) ):
502
+ echo '<style type="text/css">
503
+ #dashboard_right_now .versions p, #dashboard_right_now .versions #wp-version-message { display: none; }
504
+ </style>
505
+ ';
506
+ endif;
507
+ }
508
+
509
+ function wlcms_admin_title($admin_title)
510
+ {
511
+ if( get_option('wlcms_o_admin_page_title') ):
512
+ return str_replace (
513
+ "&#8212; WordPress",
514
+ get_option('wlcms_o_admin_page_title'),
515
+ $admin_title
516
+ );
517
+ else:
518
+ return $admin_title;
519
+ endif;
520
+ }
521
+
522
+ function wlcms_admin_bar()
523
+ {
524
+ // Show all to admin
525
+ if (current_user_can('activate_plugins'))
526
+ return;
527
+
528
+ global $wp_admin_bar;
529
+
530
+ if (get_option('wlcms_o_hide_posts'))
531
+ $wp_admin_bar->remove_menu('new-post', 'new-content');
532
+ if (get_option('wlcms_o_hide_comments'))
533
+ $wp_admin_bar->remove_menu('comments');
534
+ if (get_option('wlcms_o_hide_media'))
535
+ $wp_admin_bar->remove_menu('media');
536
+
537
+ $wp_admin_bar->remove_menu('appearance');
538
+
539
+ }
540
+
541
+ function wlcms_remove_admin_menus () {
542
+
543
+ global $menu, $submenu;
544
+
545
+ $exclude[0] = '';
546
+
547
+ if (get_option('wlcms_o_hide_posts'))
548
+ array_push($exclude,__('Posts','default'));
549
+ if (get_option('wlcms_o_hide_media'))
550
+ array_push($exclude,__('Media','default'));
551
+ if (get_option('wlcms_o_hide_comments'))
552
+ array_push($exclude,__('Comments','default'));
553
+ if (get_option('wlcms_o_hide_tools'))
554
+ array_push($exclude,__('Tools','default'));
555
+ if (get_option('wlcms_o_hide_profile'))
556
+ array_push($exclude,__('Profile','default'));
557
+
558
+
559
+
560
+
561
+ unset($exclude[0]);
562
+
563
+ // print_r($exclude);die;
564
+
565
+ if (sizeof($exclude) > 0):
566
+ if (!current_user_can('activate_plugins')):
567
+ if( isset($menu) && is_array($menu) ):
568
+ foreach($menu as $mId=>$menuArray):
569
+ $tmp = explode(' ',$menuArray[0]);
570
+ if(in_array( $tmp[0] , $exclude )):
571
+ unset($menu[$mId]);
572
+ endif;
573
+ endforeach;
574
+ endif;
575
+ endif;
576
+ endif;
577
+
578
+ if(isset($submenu['themes.php'])):
579
+ if (!current_user_can('activate_plugins')):
580
+ foreach( $submenu['themes.php'] as $k=>$v):
581
+ if(get_option('wlcms_o_subtemplate_hide_'.$k) ):
582
+ unset($submenu['themes.php'][$k]);
583
+ endif;
584
+ endforeach;
585
+ endif;
586
+ endif;
587
+
588
+ }
589
+
590
+ function wlcms_custom_pages_columns($defaults)
591
+ {
592
+ if (get_option('wlcms_o_page_meta_box_comments'))
593
+ unset($defaults['comments']);
594
+ if (get_option('wlcms_o_page_meta_box_author'))
595
+ unset($defaults['author']);
596
+ return $defaults;
597
+ }
598
+
599
+ function wlcms_remove_default_page_metaboxes()
600
+ {
601
+ add_filter('manage_pages_columns', 'wlcms_custom_pages_columns');
602
+
603
+ if (get_option('wlcms_o_page_meta_box_custom'))
604
+ remove_meta_box( 'postcustom','page','normal' );
605
+ if (get_option('wlcms_o_page_meta_box_author'))
606
+ remove_meta_box( 'authordiv','page','normal' );
607
+ if (get_option('wlcms_o_page_meta_box_discussions'))
608
+ remove_meta_box( 'commentstatusdiv','page','normal' );
609
+ if (get_option('wlcms_o_page_meta_box_slug'))
610
+ remove_meta_box( 'slugdiv','page','normal' );
611
+ if (get_option('wlcms_o_page_meta_box_revisions'))
612
+ remove_meta_box( 'revisionsdiv','page','normal' );
613
+ if (get_option('wlcms_o_page_meta_box_page'))
614
+ remove_meta_box( 'pageparentdiv','page','normal' );
615
+ if (get_option('wlcms_o_page_meta_box_comments'))
616
+ remove_meta_box( 'commentsdiv','page','normal' );
617
+ }
618
+
619
+ function wlcms_custom_post_columns($defaults)
620
+ {
621
+ if (get_option('wlcms_o_post_meta_box_comments'))
622
+ unset($defaults['comments']);
623
+ if (get_option('wlcms_o_post_meta_box_author'))
624
+ unset($defaults['author']);
625
+ if (get_option('wlcms_o_post_meta_box_categories'))
626
+ unset($defaults['categories']);
627
+ return $defaults;
628
+ }
629
+
630
+ function wlcms_manage_my_category_columns($defaults)
631
+ {
632
+ if (get_option('wlcms_o_post_meta_box_slug'))
633
+ unset($defaults['slug']);
634
+ return $defaults;
635
+ }
636
+
637
+ function wlcms_remove_default_post_metaboxes()
638
+ {
639
+ add_filter('manage_posts_columns', 'wlcms_custom_post_columns');
640
+ add_filter('manage_edit-post_tag_columns','wlcms_manage_my_category_columns');
641
+ add_filter('manage_edit-category_columns','wlcms_manage_my_category_columns');
642
+
643
+ if (get_option('wlcms_o_post_meta_box_custom'))
644
+ remove_meta_box( 'postcustom','post','normal' );
645
+ if (get_option('wlcms_o_post_meta_box_excerpt'))
646
+ remove_meta_box( 'postexcerpt','post','normal' );
647
+ if (get_option('wlcms_o_post_meta_box_discussions'))
648
+ remove_meta_box( 'commentstatusdiv','post','normal' );
649
+ if (get_option('wlcms_o_post_meta_box_send'))
650
+ remove_meta_box( 'trackbacksdiv','post','normal' );
651
+ if (get_option('wlcms_o_post_meta_box_slug'))
652
+ remove_meta_box( 'slugdiv','post','normal' );
653
+ if (get_option('wlcms_o_post_meta_box_author'))
654
+ remove_meta_box( 'authordiv','post','normal');
655
+ if (get_option('wlcms_o_post_meta_box_revisions'))
656
+ remove_meta_box( 'revisionsdiv','post','normal' );
657
+ if (get_option('wlcms_o_post_meta_box_tags'))
658
+ remove_meta_box( 'tagsdiv-post_tag','post','normal' );
659
+ if (get_option('wlcms_o_post_meta_box_categories'))
660
+ remove_meta_box( 'categorydiv','post','normal' );
661
+ if (get_option('wlcms_o_post_meta_box_comments'))
662
+ remove_meta_box( 'commentsdiv','post','normal' );
663
+ }
664
+
665
+ function wlcms_add_admin()
666
+ {
667
+
668
+ global $wlcmsThemeName, $wlcmsShortName, $menu, $submenu;
669
+
670
+ if ( isset($_GET['page']) && $_GET['page'] == 'wlcms-plugin.php')
671
+ {
672
+ if ( isset($_REQUEST['action']) && 'save' == $_REQUEST['action'] )
673
+ {
674
+ add_action('admin_init', 'wlcmsSave');
675
+ }
676
+ elseif( isset($_REQUEST['action']) && 'reset' == $_REQUEST['action'] )
677
+ {
678
+ add_action('admin_init', 'wlcmsReset');
679
+ }
680
+ elseif( isset($_REQUEST['action']) && 'export' == $_REQUEST['action'] )
681
+ {
682
+ add_action('admin_init', 'wlcmsExport');
683
+ }
684
+ elseif( isset($_REQUEST['action']) && 'import' == $_REQUEST['action'] )
685
+ {
686
+ // Only run the import function if we pass a nonce
687
+ if( check_admin_referer( 'wlcms_import' ) ) {
688
+ add_action('admin_init', 'wlcmsImport');
689
+ } else {
690
+ wp_die( 'Failed the WLCMS Import Nonce' );
691
+ }
692
+ }
693
+ }
694
+ }
695
+
696
+ function vum_fix_json($matches) {
697
+ return "s:".strlen($matches[2]).':"'.$matches[2].'";';
698
+ }
699
+
700
+ function wlcmsImport()
701
+ {
702
+ if ($_FILES['wlcms_import']['error'] == UPLOAD_ERR_OK
703
+ && is_uploaded_file($_FILES['wlcms_import']['tmp_name'])):
704
+
705
+ $import = file_get_contents($_FILES['wlcms_import']['tmp_name']);
706
+ $import = preg_replace_callback( '/s:([0-9]+):\"(.*?)\";/', 'vum_fix_json', $import );
707
+ $import = unserialize($import);
708
+
709
+ if( ! is_array($import) )
710
+ {
711
+ // Not an array some how? Rather than pressing on, just return.
712
+ header("Location: admin.php?page=wlcms-plugin.php&import=false&error=noArray");
713
+ }
714
+
715
+ // Reset all WLCMS settings;
716
+ wlcmsReset(true);
717
+
718
+ $site_url = get_bloginfo('url');
719
+
720
+ foreach ( $import as $name => $value ) {
721
+
722
+ // If the value includes this shortcode, replace it.
723
+ $val = str_replace( '{SITEURL}', $site_url, $value );
724
+
725
+ // Check that our option key starts with WLCMS
726
+ if ( strpos( $name, 'wlcms_o' ) === 0 ) {
727
+ add_option( $name, $val );
728
+ } else {
729
+ wp_die( __('<strong>Error!</strong> During the import process we almost imported a non White Label CMS setting - please ensure you uploaded the correct file and try again.' ) );
730
+ }
731
+ }
732
+
733
+ header("Location: admin.php?page=wlcms-plugin.php&import=true");
734
+ exit;
735
+
736
+ endif;
737
+
738
+ header("Location: admin.php?page=wlcms-plugin.php&import=false");
739
+ die;
740
+ }
741
+
742
+ function wlcmsExport()
743
+ {
744
+ global $wpdb;
745
+ $export=array();
746
+ $site_url = get_bloginfo('url');
747
+
748
+ // Get all WLCMS vals from options table
749
+ $results = $wpdb->get_results("select * from $wpdb->options where option_name like 'wlcms_o_%'");
750
+
751
+ // Are there any options to grab?
752
+ if($results):
753
+ // Loop through results and prep array.
754
+ foreach($results as $result):
755
+
756
+ if($result->option_value=='') continue; // Ignore empty values
757
+
758
+ // Does the blog URL exist in this option value?
759
+ if ( strpos( $result->option_value ,$site_url) !== false ):
760
+
761
+ // Do we want to keep the full URL?
762
+ if( $_GET['wlcms_export_imgs'] == 'yes' ):
763
+ $export[$result->option_name] = $result->option_value;
764
+
765
+ // If we do a partial - that means we str replace the SITEURL.
766
+ elseif( $_GET['wlcms_export_imgs'] == 'partial' ):
767
+ $val = str_replace( $site_url, '{SITEURL}', $result->option_value );
768
+ $export[$result->option_name] = $val;
769
+
770
+ endif;
771
+
772
+ // Otherwise they will have selected no, in which case, we dont
773
+ // add them to the $export array.
774
+
775
+ else:
776
+
777
+ // Add non-url matched items to our $export array
778
+ $export[$result->option_name] = $result->option_value;
779
+
780
+ endif;
781
+
782
+ endforeach;
783
+
784
+ endif;
785
+
786
+ $export=serialize($export);
787
+
788
+ header("Content-Disposition: attachment; filename=\"wlcms-backup-" . date('Y-m-d') . ".txt\"");
789
+ header("Content-Type: application/force-download");
790
+ header("Content-Length: " . strlen($export));
791
+ header("Connection: close");
792
+ echo $export;
793
+ exit;
794
+ }
795
+
796
+ function wlcmsSave()
797
+ {
798
+ check_admin_referer( 'wlcms-update_settings' );
799
+
800
+ include('includes/admin.config.php');
801
+
802
+ update_option('wlcms_o_ver', WLCMS);
803
+ foreach ($wlcmsOptions as $value):
804
+ if( isset( $value['id'] ) && isset( $_REQUEST[ $value['id'] ] ) ):
805
+ update_option( $value['id'], $_REQUEST[ $value['id'] ] );
806
+ elseif( isset( $value['id'] ) && (!isset($_REQUEST[$value['id']])) ):
807
+ delete_option( $value['id'] );
808
+ endif;
809
+ endforeach;
810
+
811
+ wlcmsUpdateCaps();
812
+
813
+ if($_REQUEST['wlcms_o_editor_template_access'] == "1")
814
+ {
815
+ $role = get_role( 'editor' );
816
+ $role->add_cap( 'edit_theme_options' );
817
+ }
818
+ elseif($_REQUEST['wlcms_o_editor_template_access'] == "0")
819
+ {
820
+ $role = get_role( 'editor' );
821
+ $role->remove_cap( 'switch_themes' ); // Legacy
822
+ $role->remove_cap( 'edit_themes' ); // Legacy
823
+ $role->remove_cap( 'edit_theme_options' );
824
+ }
825
+
826
+ header("Location: admin.php?page=wlcms-plugin.php&saved=true");
827
+ die;
828
+ }
829
+
830
+ function wlcmsReset($return=false)
831
+ {
832
+ include('includes/admin.config.php');
833
+ foreach ($wlcmsOptions as $value):
834
+ if(isset($value['id'])):
835
+ delete_option( $value['id'] );
836
+ endif;
837
+ endforeach;
838
+
839
+ if($return) return;
840
+
841
+ header("Location: admin.php?page=wlcms-plugin.php&reset=true");
842
+ die;
843
+ }
844
+
845
+ function wlcmsUpdateCaps()
846
+ {
847
+ $config = array(
848
+ /* array(
849
+ 'key' => 'wlcms_o_hide_posts',
850
+ 'caps' => array('edit_posts', 'manage_categories')
851
+ ),*/
852
+ array(
853
+ 'key' => 'wlcms_o_hide_pages',
854
+ 'caps' => array('edit_pages')
855
+ ),
856
+ array(
857
+ 'key' => 'wlcms_o_hide_media',
858
+ 'caps' => array('upload_files')
859
+ ),
860
+ array(
861
+ 'key' => 'wlcms_o_hide_links',
862
+ 'caps' => array('manage_links')
863
+ )
864
+ );
865
+
866
+ foreach($config as $opts):
867
+ if(isset( $_POST[ $opts['key'] ] )):
868
+
869
+ if( $opts['key'] == 'wlcms_o_hide_media')
870
+ continue;
871
+
872
+ $role = get_role( 'editor' );
873
+ foreach($opts['caps'] as $cap):
874
+ if(is_object($role) && method_exists($role,'add_cap'))
875
+ {
876
+ $role->remove_cap( $cap );
877
+ }
878
+
879
+ endforeach;
880
+ else:
881
+ $role = get_role( 'editor' );
882
+ foreach($opts['caps'] as $cap):
883
+ if(is_object($role) && method_exists($role,'add_cap'))
884
+ {
885
+ $role->add_cap( $cap );
886
+ }
887
+
888
+ endforeach;
889
+ endif;
890
+ endforeach;
891
+ }
892
+
893
+
894
+
895
+ function wlcms_add_init()
896
+ {
897
+ global $wlcmsThemeName, $wlcmsShortName, $menu, $submenu;
898
+
899
+ if(! get_option('wlcms_o_welcome_title') )
900
+ {
901
+ include('includes/admin.config.php');
902
+ foreach ($wlcmsOptions as $value):
903
+ if ( isset($value['id']) && $value['id'] != '' && isset($value['std']) ):
904
+ add_option( $value['id'], $value['std'] );
905
+ endif;
906
+ endforeach;
907
+ }
908
+
909
+ }
910
+ function wlcms_add_admin_scripts() {
911
+ wp_enqueue_script('wlcms-script', plugins_url('scripts/wlcms_script.js', __FILE__), array('media-upload'), WLCMS);
912
+ wp_enqueue_style('thickbox');
913
+ wp_enqueue_style('wlcms-style', plugins_url('css/wlcms_style.css', __FILE__), false, WLCMS);
914
+ }
915
+ function wlcms_admin()
916
+ {
917
+ global $menu, $submenu;
918
+ $i=0;
919
+ include('includes/admin.config.php');
920
+
921
+ if ( isset($_REQUEST['saved']) && $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong> Settings saved.</strong></p></div>';
922
+ if ( isset($_REQUEST['reset']) && $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong> Settings reset.</strong></p></div>';
923
+ if ( isset($_REQUEST['import']) && $_REQUEST['import'] == 'true' ) echo '<div id="message" class="updated fade"><p><strong> Your Import has been completed.</strong></p></div>';
924
+
925
+ require('includes/admin.view.php');
926
+ }
927
+
928
+ function wlcms_iframe_mod()
929
+ {
930
+ if( (isset($_GET['wlcms']) ) || isset( $_GET["post_id"] ) && ( $_GET['post_id'] == '0' ) )
931
+ { ?>
932
+ <style type="text/css">
933
+ #media-upload-header #sidemenu li#tab-type_url,
934
+ #media-upload-header #sidemenu li#tab-gallery {display: none;}
935
+ #media-items tr.url,#media-items tr.align,#media-items tr.image_alt,
936
+ #media-items tr.post_title, #media-items tr.image-size,
937
+ #media-items tr.post_excerpt,#media-items tr.post_content,
938
+ #media-items tr.image_alt p, #media-items table thead input.button,
939
+ #media-items table thead img.imgedit-wait-spin,
940
+ #media-items tr.submit a.wp-post-thumbnail {display: none;}
941
+ </style>
942
+ <script type="text/javascript">
943
+ (function($){
944
+ $(document).ready(function(){
945
+ $('#media-items').bind('DOMNodeInserted',function(){
946
+ $('input[value="Insert into Post"]').each(function(){
947
+ $(this).attr('value','Use This Image');
948
+ });
949
+ });
950
+ });
951
+
952
+ })(jQuery);
953
+ </script>
954
+ <?php
955
+ }
956
+ }
957
+ ?>