Absolutely Glamorous Custom Admin - Version 6.5.3

Version Description

  • Compatibility w/ 5.2.3
Download this release

Release Info

Developer cusmin
Plugin Icon 128x128 Absolutely Glamorous Custom Admin
Version 6.5.3
Comparing to
See all releases

Code changes from version 6.5.2 to 6.5.3

Files changed (11) hide show
  1. .gitignore +0 -2
  2. ag-custom-admin.html +94 -94
  3. composer.json +0 -5
  4. composer.lock +0 -2246
  5. plugin.php +3200 -3200
  6. readme.txt +8 -2
  7. require/dynamic.php +94 -94
  8. script/ag_script.js +941 -941
  9. script/agca_tmpl.js +743 -743
  10. style/ag_style.css +879 -879
  11. uninstall.php +89 -89
.gitignore DELETED
@@ -1,2 +0,0 @@
1
- /vendor
2
- tests/_output/*
 
 
ag-custom-admin.html CHANGED
@@ -1,95 +1,95 @@
1
- <html>
2
- <head><title>WordPress Admin Themes - Absolutely Glamorous Custom Admin Plugin</title></head>
3
- <body>
4
- <h1><a href="http://wordpress.org/plugins/ag-custom-admin/">What is Absolutely Glamorous Custom Admin?</a></h1>
5
- <p>Absolutely Glamorous Custom Admin is plugin for WordPress that can be used for WordPress admin panel customizations. There are dozens of options available for customizations:</p>
6
- <h2>Admin Bar Options</h2>
7
- <ul>
8
- <li>Hide admin bar completely</li>
9
- <li>Hide admin bar on front end</li>
10
- <li>Change admin bar logo and link</li>
11
- <li>Hide admin bar WordPress logo</li>
12
- <li>Add custom image in admin header</li>
13
- <li>Add custom admin bar logo</li>
14
- <li>Hide admin bar dropdown menus</li>
15
- <li>Hide "New" dropdown items</li>
16
- <li>Hide comments from admin bar</li>
17
- <li>Hide updates from admin bar</li>
18
- <li>Hide WordPress update notification bar</li>
19
- <li>Hide default blog heading in admin bar</li>
20
- <li>Change admin bar heading text</li>
21
- <li>Hide Screen Options menu</li>
22
- <li>Hide Help menu</li>
23
- <li>Hide Favorite Actions</li>
24
- <li>Change/remove Howdy text</li>
25
- <li>Change Log out text</li>
26
- <li>Log out button only</li>
27
- </ul>
28
-
29
- <h2>Admin Footer Options</h2>
30
- <ul>
31
- <li>Hide footer completely</li>
32
- <li>Change/remove footer text</li>
33
- <li>Change/remove footer version text</li>
34
- </ul>
35
-
36
- <h2>Dashboard Page Options</h2>
37
- <ul>
38
- <li>Hide Dashboard heading icon</li>
39
- <li>Change Dashboard heading text</li>
40
- <li>Add custom Dashboard content</li>
41
- <li>Hide dashboard widgets</li>
42
- </ul>
43
-
44
- <h2>Login Page Options</h2>
45
- <ul>
46
- <li>Hide back to blog completely</li>
47
- <li>Change login image </li>
48
- <li>Change hyperlink on login image</li>
49
- <li>Hide login image</li>
50
- <li>Round corners on login boxes</li>
51
- <li>Hide register and lost password links</li>
52
- <li>Change hyperlink on register button</li>
53
- </ul>
54
-
55
- <h2>Admin Menu Options</h2>
56
- <ul>
57
- <li>Rename menu and submenu items</li>
58
- <li>Remove menu and submenu items</li>
59
- <li>Add new buttons with custom links</li>
60
- <li>Remove icons from admin menu buttons</li>
61
- <li>Remove spaces between admin menu buttons</li>
62
- <li>Remove admin menu arrow on rollower</li>
63
- <li>Round admin submenu popups </li>
64
- <li>Add custom branding image above the admin menu</li>
65
- <li>Add custom link to branding image</li>
66
- <li>Admin menu auto-folding options for mobile devices</li>
67
- </ul>
68
-
69
- <h2>Colorizer</h2>
70
- <ul>
71
- <li>Change background and text colors on admin and login page </li>
72
- <li>Change admin menu colors</li>
73
- <li>Change widget colors</li>
74
- </ul>
75
-
76
- <h2>Advanced</h2>
77
- <ul>
78
- <li>Add custom CSS</li>
79
- <li>Add custom JavaScript</li>
80
- <li>Export/import customization settings</li>
81
- </ul>
82
- </br>
83
- <h1><a href="http://wordpressadminpanel.com/themes/home">AG Custom Admin WordPress Themes</a></h1>
84
- <p>From AGCA version 1.3 we introduce AG Custom Admin themes. With AGCA themes you can easily change your WordPress admin panel theme in matter of seconds!</p>
85
- <p>Please check our <a href="http://wordpressadminpanel.com/themes/home">AG Custom Admin WordPress Themes</a> page for more info.</p>
86
- </br>
87
- <h1><a href="https://cusmin.com">Upgrade</a></h1>
88
- <p>If you need even more features and premium support, you can upgrade to <a href="https://cusmin.com">Cusmin</a> - premium tool for advanced WordPress admin panel customization.</p>
89
- </br>
90
- <h1><a href="http://wordpressadminpanel.com/agca-support/">Support</a></h1>
91
- <p>Feel free to check our <a href="http://wordpressadminpanel.com/agca-support/">support page</a> in case you have found any issues with your AGCA or AGCA themes features.</p>
92
- <p>Happy blogging!</p>
93
- </br>
94
- </body>
95
  </html>
1
+ <html>
2
+ <head><title>WordPress Admin Themes - Absolutely Glamorous Custom Admin Plugin</title></head>
3
+ <body>
4
+ <h1><a href="http://wordpress.org/plugins/ag-custom-admin/">What is Absolutely Glamorous Custom Admin?</a></h1>
5
+ <p>Absolutely Glamorous Custom Admin is plugin for WordPress that can be used for WordPress admin panel customizations. There are dozens of options available for customizations:</p>
6
+ <h2>Admin Bar Options</h2>
7
+ <ul>
8
+ <li>Hide admin bar completely</li>
9
+ <li>Hide admin bar on front end</li>
10
+ <li>Change admin bar logo and link</li>
11
+ <li>Hide admin bar WordPress logo</li>
12
+ <li>Add custom image in admin header</li>
13
+ <li>Add custom admin bar logo</li>
14
+ <li>Hide admin bar dropdown menus</li>
15
+ <li>Hide "New" dropdown items</li>
16
+ <li>Hide comments from admin bar</li>
17
+ <li>Hide updates from admin bar</li>
18
+ <li>Hide WordPress update notification bar</li>
19
+ <li>Hide default blog heading in admin bar</li>
20
+ <li>Change admin bar heading text</li>
21
+ <li>Hide Screen Options menu</li>
22
+ <li>Hide Help menu</li>
23
+ <li>Hide Favorite Actions</li>
24
+ <li>Change/remove Howdy text</li>
25
+ <li>Change Log out text</li>
26
+ <li>Log out button only</li>
27
+ </ul>
28
+
29
+ <h2>Admin Footer Options</h2>
30
+ <ul>
31
+ <li>Hide footer completely</li>
32
+ <li>Change/remove footer text</li>
33
+ <li>Change/remove footer version text</li>
34
+ </ul>
35
+
36
+ <h2>Dashboard Page Options</h2>
37
+ <ul>
38
+ <li>Hide Dashboard heading icon</li>
39
+ <li>Change Dashboard heading text</li>
40
+ <li>Add custom Dashboard content</li>
41
+ <li>Hide dashboard widgets</li>
42
+ </ul>
43
+
44
+ <h2>Login Page Options</h2>
45
+ <ul>
46
+ <li>Hide back to blog completely</li>
47
+ <li>Change login image </li>
48
+ <li>Change hyperlink on login image</li>
49
+ <li>Hide login image</li>
50
+ <li>Round corners on login boxes</li>
51
+ <li>Hide register and lost password links</li>
52
+ <li>Change hyperlink on register button</li>
53
+ </ul>
54
+
55
+ <h2>Admin Menu Options</h2>
56
+ <ul>
57
+ <li>Rename menu and submenu items</li>
58
+ <li>Remove menu and submenu items</li>
59
+ <li>Add new buttons with custom links</li>
60
+ <li>Remove icons from admin menu buttons</li>
61
+ <li>Remove spaces between admin menu buttons</li>
62
+ <li>Remove admin menu arrow on rollower</li>
63
+ <li>Round admin submenu popups </li>
64
+ <li>Add custom branding image above the admin menu</li>
65
+ <li>Add custom link to branding image</li>
66
+ <li>Admin menu auto-folding options for mobile devices</li>
67
+ </ul>
68
+
69
+ <h2>Colorizer</h2>
70
+ <ul>
71
+ <li>Change background and text colors on admin and login page </li>
72
+ <li>Change admin menu colors</li>
73
+ <li>Change widget colors</li>
74
+ </ul>
75
+
76
+ <h2>Advanced</h2>
77
+ <ul>
78
+ <li>Add custom CSS</li>
79
+ <li>Add custom JavaScript</li>
80
+ <li>Export/import customization settings</li>
81
+ </ul>
82
+ </br>
83
+ <h1><a href="http://wordpressadminpanel.com/themes/home">AG Custom Admin WordPress Themes</a></h1>
84
+ <p>From AGCA version 1.3 we introduce AG Custom Admin themes. With AGCA themes you can easily change your WordPress admin panel theme in matter of seconds!</p>
85
+ <p>Please check our <a href="http://wordpressadminpanel.com/themes/home">AG Custom Admin WordPress Themes</a> page for more info.</p>
86
+ </br>
87
+ <h1><a href="https://cusmin.com">Upgrade</a></h1>
88
+ <p>If you need even more features and premium support, you can upgrade to <a href="https://cusmin.com">Cusmin</a> - premium tool for advanced WordPress admin panel customization.</p>
89
+ </br>
90
+ <h1><a href="http://wordpressadminpanel.com/agca-support/">Support</a></h1>
91
+ <p>Feel free to check our <a href="http://wordpressadminpanel.com/agca-support/">support page</a> in case you have found any issues with your AGCA or AGCA themes features.</p>
92
+ <p>Happy blogging!</p>
93
+ </br>
94
+ </body>
95
  </html>
composer.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "require": {
3
- "codeception/codeception": "^2.2"
4
- }
5
- }
 
 
 
 
 
composer.lock DELETED
@@ -1,2246 +0,0 @@
1
- {
2
- "_readme": [
3
- "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
- "This file is @generated automatically"
6
- ],
7
- "hash": "fb5785c0a0e075cde41e6c79ac15d771",
8
- "content-hash": "c4884e34fd65287a5a178a1f79d98a2e",
9
- "packages": [
10
- {
11
- "name": "behat/gherkin",
12
- "version": "v4.4.5",
13
- "source": {
14
- "type": "git",
15
- "url": "https://github.com/Behat/Gherkin.git",
16
- "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74"
17
- },
18
- "dist": {
19
- "type": "zip",
20
- "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74",
21
- "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74",
22
- "shasum": ""
23
- },
24
- "require": {
25
- "php": ">=5.3.1"
26
- },
27
- "require-dev": {
28
- "phpunit/phpunit": "~4.5|~5",
29
- "symfony/phpunit-bridge": "~2.7|~3",
30
- "symfony/yaml": "~2.3|~3"
31
- },
32
- "suggest": {
33
- "symfony/yaml": "If you want to parse features, represented in YAML files"
34
- },
35
- "type": "library",
36
- "extra": {
37
- "branch-alias": {
38
- "dev-master": "4.4-dev"
39
- }
40
- },
41
- "autoload": {
42
- "psr-0": {
43
- "Behat\\Gherkin": "src/"
44
- }
45
- },
46
- "notification-url": "https://packagist.org/downloads/",
47
- "license": [
48
- "MIT"
49
- ],
50
- "authors": [
51
- {
52
- "name": "Konstantin Kudryashov",
53
- "email": "ever.zet@gmail.com",
54
- "homepage": "http://everzet.com"
55
- }
56
- ],
57
- "description": "Gherkin DSL parser for PHP 5.3",
58
- "homepage": "http://behat.org/",
59
- "keywords": [
60
- "BDD",
61
- "Behat",
62
- "Cucumber",
63
- "DSL",
64
- "gherkin",
65
- "parser"
66
- ],
67
- "time": "2016-10-30 11:50:56"
68
- },
69
- {
70
- "name": "codeception/codeception",
71
- "version": "2.2.6",
72
- "source": {
73
- "type": "git",
74
- "url": "https://github.com/Codeception/Codeception.git",
75
- "reference": "5fbe312c8138e71458ec1e715b0ce262331ca5a2"
76
- },
77
- "dist": {
78
- "type": "zip",
79
- "url": "https://api.github.com/repos/Codeception/Codeception/zipball/5fbe312c8138e71458ec1e715b0ce262331ca5a2",
80
- "reference": "5fbe312c8138e71458ec1e715b0ce262331ca5a2",
81
- "shasum": ""
82
- },
83
- "require": {
84
- "behat/gherkin": "~4.4.0",
85
- "ext-json": "*",
86
- "ext-mbstring": "*",
87
- "facebook/webdriver": ">=1.0.1 <2.0",
88
- "guzzlehttp/guzzle": ">=4.1.4 <7.0",
89
- "guzzlehttp/psr7": "~1.0",
90
- "php": ">=5.4.0 <8.0",
91
- "phpunit/php-code-coverage": ">=2.1.3 <5.0",
92
- "phpunit/phpunit": ">4.8.20 <6.0",
93
- "sebastian/comparator": "~1.1",
94
- "sebastian/diff": "^1.4",
95
- "symfony/browser-kit": ">=2.7 <4.0",
96
- "symfony/console": ">=2.7 <4.0",
97
- "symfony/css-selector": ">=2.7 <4.0",
98
- "symfony/dom-crawler": ">=2.7 <4.0",
99
- "symfony/event-dispatcher": ">=2.7 <4.0",
100
- "symfony/finder": ">=2.7 <4.0",
101
- "symfony/yaml": ">=2.7 <4.0"
102
- },
103
- "require-dev": {
104
- "codeception/specify": "~0.3",
105
- "facebook/graph-sdk": "~5.3",
106
- "flow/jsonpath": "~0.2",
107
- "league/factory-muffin": "^3.0",
108
- "league/factory-muffin-faker": "^1.0",
109
- "mongodb/mongodb": "^1.0",
110
- "monolog/monolog": "~1.8",
111
- "pda/pheanstalk": "~3.0",
112
- "php-amqplib/php-amqplib": "~2.4",
113
- "predis/predis": "^1.0",
114
- "squizlabs/php_codesniffer": "~2.0"
115
- },
116
- "suggest": {
117
- "codeception/specify": "BDD-style code blocks",
118
- "codeception/verify": "BDD-style assertions",
119
- "flow/jsonpath": "For using JSONPath in REST module",
120
- "league/factory-muffin": "For DataFactory module",
121
- "league/factory-muffin-faker": "For Faker support in DataFactory module",
122
- "phpseclib/phpseclib": "for SFTP option in FTP Module",
123
- "symfony/phpunit-bridge": "For phpunit-bridge support"
124
- },
125
- "bin": [
126
- "codecept"
127
- ],
128
- "type": "library",
129
- "extra": {
130
- "branch-alias": []
131
- },
132
- "autoload": {
133
- "psr-4": {
134
- "Codeception\\": "src\\Codeception",
135
- "Codeception\\Extension\\": "ext"
136
- }
137
- },
138
- "notification-url": "https://packagist.org/downloads/",
139
- "license": [
140
- "MIT"
141
- ],
142
- "authors": [
143
- {
144
- "name": "Michael Bodnarchuk",
145
- "email": "davert@mail.ua",
146
- "homepage": "http://codegyre.com"
147
- }
148
- ],
149
- "description": "BDD-style testing framework",
150
- "homepage": "http://codeception.com/",
151
- "keywords": [
152
- "BDD",
153
- "TDD",
154
- "acceptance testing",
155
- "functional testing",
156
- "unit testing"
157
- ],
158
- "time": "2016-10-27 00:00:34"
159
- },
160
- {
161
- "name": "doctrine/instantiator",
162
- "version": "1.0.5",
163
- "source": {
164
- "type": "git",
165
- "url": "https://github.com/doctrine/instantiator.git",
166
- "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
167
- },
168
- "dist": {
169
- "type": "zip",
170
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
171
- "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
172
- "shasum": ""
173
- },
174
- "require": {
175
- "php": ">=5.3,<8.0-DEV"
176
- },
177
- "require-dev": {
178
- "athletic/athletic": "~0.1.8",
179
- "ext-pdo": "*",
180
- "ext-phar": "*",
181
- "phpunit/phpunit": "~4.0",
182
- "squizlabs/php_codesniffer": "~2.0"
183
- },
184
- "type": "library",
185
- "extra": {
186
- "branch-alias": {
187
- "dev-master": "1.0.x-dev"
188
- }
189
- },
190
- "autoload": {
191
- "psr-4": {
192
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
193
- }
194
- },
195
- "notification-url": "https://packagist.org/downloads/",
196
- "license": [
197
- "MIT"
198
- ],
199
- "authors": [
200
- {
201
- "name": "Marco Pivetta",
202
- "email": "ocramius@gmail.com",
203
- "homepage": "http://ocramius.github.com/"
204
- }
205
- ],
206
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
207
- "homepage": "https://github.com/doctrine/instantiator",
208
- "keywords": [
209
- "constructor",
210
- "instantiate"
211
- ],
212
- "time": "2015-06-14 21:17:01"
213
- },
214
- {
215
- "name": "facebook/webdriver",
216
- "version": "1.2.0",
217
- "source": {
218
- "type": "git",
219
- "url": "https://github.com/facebook/php-webdriver.git",
220
- "reference": "af21de3ae5306a8ca0bcc02a19735dadc43e83f3"
221
- },
222
- "dist": {
223
- "type": "zip",
224
- "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/af21de3ae5306a8ca0bcc02a19735dadc43e83f3",
225
- "reference": "af21de3ae5306a8ca0bcc02a19735dadc43e83f3",
226
- "shasum": ""
227
- },
228
- "require": {
229
- "ext-curl": "*",
230
- "php": "^5.5 || ~7.0"
231
- },
232
- "require-dev": {
233
- "friendsofphp/php-cs-fixer": "^1.11",
234
- "php-mock/php-mock-phpunit": "^1.1",
235
- "phpunit/phpunit": "4.6.* || ~5.0",
236
- "squizlabs/php_codesniffer": "^2.6"
237
- },
238
- "suggest": {
239
- "phpdocumentor/phpdocumentor": "2.*"
240
- },
241
- "type": "library",
242
- "autoload": {
243
- "psr-4": {
244
- "Facebook\\WebDriver\\": "lib/"
245
- }
246
- },
247
- "notification-url": "https://packagist.org/downloads/",
248
- "license": [
249
- "Apache-2.0"
250
- ],
251
- "description": "A PHP client for WebDriver",
252
- "homepage": "https://github.com/facebook/php-webdriver",
253
- "keywords": [
254
- "facebook",
255
- "php",
256
- "selenium",
257
- "webdriver"
258
- ],
259
- "time": "2016-10-14 15:16:51"
260
- },
261
- {
262
- "name": "guzzlehttp/guzzle",
263
- "version": "6.2.2",
264
- "source": {
265
- "type": "git",
266
- "url": "https://github.com/guzzle/guzzle.git",
267
- "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60"
268
- },
269
- "dist": {
270
- "type": "zip",
271
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
272
- "reference": "ebf29dee597f02f09f4d5bbecc68230ea9b08f60",
273
- "shasum": ""
274
- },
275
- "require": {
276
- "guzzlehttp/promises": "^1.0",
277
- "guzzlehttp/psr7": "^1.3.1",
278
- "php": ">=5.5"
279
- },
280
- "require-dev": {
281
- "ext-curl": "*",
282
- "phpunit/phpunit": "^4.0",
283
- "psr/log": "^1.0"
284
- },
285
- "type": "library",
286
- "extra": {
287
- "branch-alias": {
288
- "dev-master": "6.2-dev"
289
- }
290
- },
291
- "autoload": {
292
- "files": [
293
- "src/functions_include.php"
294
- ],
295
- "psr-4": {
296
- "GuzzleHttp\\": "src/"
297
- }
298
- },
299
- "notification-url": "https://packagist.org/downloads/",
300
- "license": [
301
- "MIT"
302
- ],
303
- "authors": [
304
- {
305
- "name": "Michael Dowling",
306
- "email": "mtdowling@gmail.com",
307
- "homepage": "https://github.com/mtdowling"
308
- }
309
- ],
310
- "description": "Guzzle is a PHP HTTP client library",
311
- "homepage": "http://guzzlephp.org/",
312
- "keywords": [
313
- "client",
314
- "curl",
315
- "framework",
316
- "http",
317
- "http client",
318
- "rest",
319
- "web service"
320
- ],
321
- "time": "2016-10-08 15:01:37"
322
- },
323
- {
324
- "name": "guzzlehttp/promises",
325
- "version": "1.3.0",
326
- "source": {
327
- "type": "git",
328
- "url": "https://github.com/guzzle/promises.git",
329
- "reference": "2693c101803ca78b27972d84081d027fca790a1e"
330
- },
331
- "dist": {
332
- "type": "zip",
333
- "url": "https://api.github.com/repos/guzzle/promises/zipball/2693c101803ca78b27972d84081d027fca790a1e",
334
- "reference": "2693c101803ca78b27972d84081d027fca790a1e",
335
- "shasum": ""
336
- },
337
- "require": {
338
- "php": ">=5.5.0"
339
- },
340
- "require-dev": {
341
- "phpunit/phpunit": "~4.0"
342
- },
343
- "type": "library",
344
- "extra": {
345
- "branch-alias": {
346
- "dev-master": "1.0-dev"
347
- }
348
- },
349
- "autoload": {
350
- "psr-4": {
351
- "GuzzleHttp\\Promise\\": "src/"
352
- },
353
- "files": [
354
- "src/functions_include.php"
355
- ]
356
- },
357
- "notification-url": "https://packagist.org/downloads/",
358
- "license": [
359
- "MIT"
360
- ],
361
- "authors": [
362
- {
363
- "name": "Michael Dowling",
364
- "email": "mtdowling@gmail.com",
365
- "homepage": "https://github.com/mtdowling"
366
- }
367
- ],
368
- "description": "Guzzle promises library",
369
- "keywords": [
370
- "promise"
371
- ],
372
- "time": "2016-11-18 17:47:58"
373
- },
374
- {
375
- "name": "guzzlehttp/psr7",
376
- "version": "1.3.1",
377
- "source": {
378
- "type": "git",
379
- "url": "https://github.com/guzzle/psr7.git",
380
- "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b"
381
- },
382
- "dist": {
383
- "type": "zip",
384
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
385
- "reference": "5c6447c9df362e8f8093bda8f5d8873fe5c7f65b",
386
- "shasum": ""
387
- },
388
- "require": {
389
- "php": ">=5.4.0",
390
- "psr/http-message": "~1.0"
391
- },
392
- "provide": {
393
- "psr/http-message-implementation": "1.0"
394
- },
395
- "require-dev": {
396
- "phpunit/phpunit": "~4.0"
397
- },
398
- "type": "library",
399
- "extra": {
400
- "branch-alias": {
401
- "dev-master": "1.4-dev"
402
- }
403
- },
404
- "autoload": {
405
- "psr-4": {
406
- "GuzzleHttp\\Psr7\\": "src/"
407
- },
408
- "files": [
409
- "src/functions_include.php"
410
- ]
411
- },
412
- "notification-url": "https://packagist.org/downloads/",
413
- "license": [
414
- "MIT"
415
- ],
416
- "authors": [
417
- {
418
- "name": "Michael Dowling",
419
- "email": "mtdowling@gmail.com",
420
- "homepage": "https://github.com/mtdowling"
421
- }
422
- ],
423
- "description": "PSR-7 message implementation",
424
- "keywords": [
425
- "http",
426
- "message",
427
- "stream",
428
- "uri"
429
- ],
430
- "time": "2016-06-24 23:00:38"
431
- },
432
- {
433
- "name": "myclabs/deep-copy",
434
- "version": "1.5.5",
435
- "source": {
436
- "type": "git",
437
- "url": "https://github.com/myclabs/DeepCopy.git",
438
- "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108"
439
- },
440
- "dist": {
441
- "type": "zip",
442
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/399c1f9781e222f6eb6cc238796f5200d1b7f108",
443
- "reference": "399c1f9781e222f6eb6cc238796f5200d1b7f108",
444
- "shasum": ""
445
- },
446
- "require": {
447
- "php": ">=5.4.0"
448
- },
449
- "require-dev": {
450
- "doctrine/collections": "1.*",
451
- "phpunit/phpunit": "~4.1"
452
- },
453
- "type": "library",
454
- "autoload": {
455
- "psr-4": {
456
- "DeepCopy\\": "src/DeepCopy/"
457
- }
458
- },
459
- "notification-url": "https://packagist.org/downloads/",
460
- "license": [
461
- "MIT"
462
- ],
463
- "description": "Create deep copies (clones) of your objects",
464
- "homepage": "https://github.com/myclabs/DeepCopy",
465
- "keywords": [
466
- "clone",
467
- "copy",
468
- "duplicate",
469
- "object",
470
- "object graph"
471
- ],
472
- "time": "2016-10-31 17:19:45"
473
- },
474
- {
475
- "name": "phpdocumentor/reflection-common",
476
- "version": "1.0",
477
- "source": {
478
- "type": "git",
479
- "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
480
- "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c"
481
- },
482
- "dist": {
483
- "type": "zip",
484
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
485
- "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c",
486
- "shasum": ""
487
- },
488
- "require": {
489
- "php": ">=5.5"
490
- },
491
- "require-dev": {
492
- "phpunit/phpunit": "^4.6"
493
- },
494
- "type": "library",
495
- "extra": {
496
- "branch-alias": {
497
- "dev-master": "1.0.x-dev"
498
- }
499
- },
500
- "autoload": {
501
- "psr-4": {
502
- "phpDocumentor\\Reflection\\": [
503
- "src"
504
- ]
505
- }
506
- },
507
- "notification-url": "https://packagist.org/downloads/",
508
- "license": [
509
- "MIT"
510
- ],
511
- "authors": [
512
- {
513
- "name": "Jaap van Otterdijk",
514
- "email": "opensource@ijaap.nl"
515
- }
516
- ],
517
- "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
518
- "homepage": "http://www.phpdoc.org",
519
- "keywords": [
520
- "FQSEN",
521
- "phpDocumentor",
522
- "phpdoc",
523
- "reflection",
524
- "static analysis"
525
- ],
526
- "time": "2015-12-27 11:43:31"
527
- },
528
- {
529
- "name": "phpdocumentor/reflection-docblock",
530
- "version": "3.1.1",
531
- "source": {
532
- "type": "git",
533
- "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
534
- "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e"
535
- },
536
- "dist": {
537
- "type": "zip",
538
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e",
539
- "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e",
540
- "shasum": ""
541
- },
542
- "require": {
543
- "php": ">=5.5",
544
- "phpdocumentor/reflection-common": "^1.0@dev",
545
- "phpdocumentor/type-resolver": "^0.2.0",
546
- "webmozart/assert": "^1.0"
547
- },
548
- "require-dev": {
549
- "mockery/mockery": "^0.9.4",
550
- "phpunit/phpunit": "^4.4"
551
- },
552
- "type": "library",
553
- "autoload": {
554
- "psr-4": {
555
- "phpDocumentor\\Reflection\\": [
556
- "src/"
557
- ]
558
- }
559
- },
560
- "notification-url": "https://packagist.org/downloads/",
561
- "license": [
562
- "MIT"
563
- ],
564
- "authors": [
565
- {
566
- "name": "Mike van Riel",
567
- "email": "me@mikevanriel.com"
568
- }
569
- ],
570
- "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
571
- "time": "2016-09-30 07:12:33"
572
- },
573
- {
574
- "name": "phpdocumentor/type-resolver",
575
- "version": "0.2.1",
576
- "source": {
577
- "type": "git",
578
- "url": "https://github.com/phpDocumentor/TypeResolver.git",
579
- "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb"
580
- },
581
- "dist": {
582
- "type": "zip",
583
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb",
584
- "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb",
585
- "shasum": ""
586
- },
587
- "require": {
588
- "php": ">=5.5",
589
- "phpdocumentor/reflection-common": "^1.0"
590
- },
591
- "require-dev": {
592
- "mockery/mockery": "^0.9.4",
593
- "phpunit/phpunit": "^5.2||^4.8.24"
594
- },
595
- "type": "library",
596
- "extra": {
597
- "branch-alias": {
598
- "dev-master": "1.0.x-dev"
599
- }
600
- },
601
- "autoload": {
602
- "psr-4": {
603
- "phpDocumentor\\Reflection\\": [
604
- "src/"
605
- ]
606
- }
607
- },
608
- "notification-url": "https://packagist.org/downloads/",
609
- "license": [
610
- "MIT"
611
- ],
612
- "authors": [
613
- {
614
- "name": "Mike van Riel",
615
- "email": "me@mikevanriel.com"
616
- }
617
- ],
618
- "time": "2016-11-25 06:54:22"
619
- },
620
- {
621
- "name": "phpspec/prophecy",
622
- "version": "v1.6.2",
623
- "source": {
624
- "type": "git",
625
- "url": "https://github.com/phpspec/prophecy.git",
626
- "reference": "6c52c2722f8460122f96f86346600e1077ce22cb"
627
- },
628
- "dist": {
629
- "type": "zip",
630
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/6c52c2722f8460122f96f86346600e1077ce22cb",
631
- "reference": "6c52c2722f8460122f96f86346600e1077ce22cb",
632
- "shasum": ""
633
- },
634
- "require": {
635
- "doctrine/instantiator": "^1.0.2",
636
- "php": "^5.3|^7.0",
637
- "phpdocumentor/reflection-docblock": "^2.0|^3.0.2",
638
- "sebastian/comparator": "^1.1",
639
- "sebastian/recursion-context": "^1.0|^2.0"
640
- },
641
- "require-dev": {
642
- "phpspec/phpspec": "^2.0",
643
- "phpunit/phpunit": "^4.8 || ^5.6.5"
644
- },
645
- "type": "library",
646
- "extra": {
647
- "branch-alias": {
648
- "dev-master": "1.6.x-dev"
649
- }
650
- },
651
- "autoload": {
652
- "psr-0": {
653
- "Prophecy\\": "src/"
654
- }
655
- },
656
- "notification-url": "https://packagist.org/downloads/",
657
- "license": [
658
- "MIT"
659
- ],
660
- "authors": [
661
- {
662
- "name": "Konstantin Kudryashov",
663
- "email": "ever.zet@gmail.com",
664
- "homepage": "http://everzet.com"
665
- },
666
- {
667
- "name": "Marcello Duarte",
668
- "email": "marcello.duarte@gmail.com"
669
- }
670
- ],
671
- "description": "Highly opinionated mocking framework for PHP 5.3+",
672
- "homepage": "https://github.com/phpspec/prophecy",
673
- "keywords": [
674
- "Double",
675
- "Dummy",
676
- "fake",
677
- "mock",
678
- "spy",
679
- "stub"
680
- ],
681
- "time": "2016-11-21 14:58:47"
682
- },
683
- {
684
- "name": "phpunit/php-code-coverage",
685
- "version": "4.0.3",
686
- "source": {
687
- "type": "git",
688
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
689
- "reference": "903fd6318d0a90b4770a009ff73e4a4e9c437929"
690
- },
691
- "dist": {
692
- "type": "zip",
693
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/903fd6318d0a90b4770a009ff73e4a4e9c437929",
694
- "reference": "903fd6318d0a90b4770a009ff73e4a4e9c437929",
695
- "shasum": ""
696
- },
697
- "require": {
698
- "php": "^5.6 || ^7.0",
699
- "phpunit/php-file-iterator": "~1.3",
700
- "phpunit/php-text-template": "~1.2",
701
- "phpunit/php-token-stream": "^1.4.2",
702
- "sebastian/code-unit-reverse-lookup": "~1.0",
703
- "sebastian/environment": "^1.3.2 || ^2.0",
704
- "sebastian/version": "~1.0|~2.0"
705
- },
706
- "require-dev": {
707
- "ext-xdebug": ">=2.1.4",
708
- "phpunit/phpunit": "^5.4"
709
- },
710
- "suggest": {
711
- "ext-dom": "*",
712
- "ext-xdebug": ">=2.4.0",
713
- "ext-xmlwriter": "*"
714
- },
715
- "type": "library",
716
- "extra": {
717
- "branch-alias": {
718
- "dev-master": "4.0.x-dev"
719
- }
720
- },
721
- "autoload": {
722
- "classmap": [
723
- "src/"
724
- ]
725
- },
726
- "notification-url": "https://packagist.org/downloads/",
727
- "license": [
728
- "BSD-3-Clause"
729
- ],
730
- "authors": [
731
- {
732
- "name": "Sebastian Bergmann",
733
- "email": "sb@sebastian-bergmann.de",
734
- "role": "lead"
735
- }
736
- ],
737
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
738
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
739
- "keywords": [
740
- "coverage",
741
- "testing",
742
- "xunit"
743
- ],
744
- "time": "2016-11-28 16:00:31"
745
- },
746
- {
747
- "name": "phpunit/php-file-iterator",
748
- "version": "1.4.2",
749
- "source": {
750
- "type": "git",
751
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
752
- "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5"
753
- },
754
- "dist": {
755
- "type": "zip",
756
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
757
- "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5",
758
- "shasum": ""
759
- },
760
- "require": {
761
- "php": ">=5.3.3"
762
- },
763
- "type": "library",
764
- "extra": {
765
- "branch-alias": {
766
- "dev-master": "1.4.x-dev"
767
- }
768
- },
769
- "autoload": {
770
- "classmap": [
771
- "src/"
772
- ]
773
- },
774
- "notification-url": "https://packagist.org/downloads/",
775
- "license": [
776
- "BSD-3-Clause"
777
- ],
778
- "authors": [
779
- {
780
- "name": "Sebastian Bergmann",
781
- "email": "sb@sebastian-bergmann.de",
782
- "role": "lead"
783
- }
784
- ],
785
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
786
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
787
- "keywords": [
788
- "filesystem",
789
- "iterator"
790
- ],
791
- "time": "2016-10-03 07:40:28"
792
- },
793
- {
794
- "name": "phpunit/php-text-template",
795
- "version": "1.2.1",
796
- "source": {
797
- "type": "git",
798
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
799
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
800
- },
801
- "dist": {
802
- "type": "zip",
803
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
804
- "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
805
- "shasum": ""
806
- },
807
- "require": {
808
- "php": ">=5.3.3"
809
- },
810
- "type": "library",
811
- "autoload": {
812
- "classmap": [
813
- "src/"
814
- ]
815
- },
816
- "notification-url": "https://packagist.org/downloads/",
817
- "license": [
818
- "BSD-3-Clause"
819
- ],
820
- "authors": [
821
- {
822
- "name": "Sebastian Bergmann",
823
- "email": "sebastian@phpunit.de",
824
- "role": "lead"
825
- }
826
- ],
827
- "description": "Simple template engine.",
828
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
829
- "keywords": [
830
- "template"
831
- ],
832
- "time": "2015-06-21 13:50:34"
833
- },
834
- {
835
- "name": "phpunit/php-timer",
836
- "version": "1.0.8",
837
- "source": {
838
- "type": "git",
839
- "url": "https://github.com/sebastianbergmann/php-timer.git",
840
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260"
841
- },
842
- "dist": {
843
- "type": "zip",
844
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260",
845
- "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260",
846
- "shasum": ""
847
- },
848
- "require": {
849
- "php": ">=5.3.3"
850
- },
851
- "require-dev": {
852
- "phpunit/phpunit": "~4|~5"
853
- },
854
- "type": "library",
855
- "autoload": {
856
- "classmap": [
857
- "src/"
858
- ]
859
- },
860
- "notification-url": "https://packagist.org/downloads/",
861
- "license": [
862
- "BSD-3-Clause"
863
- ],
864
- "authors": [
865
- {
866
- "name": "Sebastian Bergmann",
867
- "email": "sb@sebastian-bergmann.de",
868
- "role": "lead"
869
- }
870
- ],
871
- "description": "Utility class for timing",
872
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
873
- "keywords": [
874
- "timer"
875
- ],
876
- "time": "2016-05-12 18:03:57"
877
- },
878
- {
879
- "name": "phpunit/php-token-stream",
880
- "version": "1.4.9",
881
- "source": {
882
- "type": "git",
883
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
884
- "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b"
885
- },
886
- "dist": {
887
- "type": "zip",
888
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/3b402f65a4cc90abf6e1104e388b896ce209631b",
889
- "reference": "3b402f65a4cc90abf6e1104e388b896ce209631b",
890
- "shasum": ""
891
- },
892
- "require": {
893
- "ext-tokenizer": "*",
894
- "php": ">=5.3.3"
895
- },
896
- "require-dev": {
897
- "phpunit/phpunit": "~4.2"
898
- },
899
- "type": "library",
900
- "extra": {
901
- "branch-alias": {
902
- "dev-master": "1.4-dev"
903
- }
904
- },
905
- "autoload": {
906
- "classmap": [
907
- "src/"
908
- ]
909
- },
910
- "notification-url": "https://packagist.org/downloads/",
911
- "license": [
912
- "BSD-3-Clause"
913
- ],
914
- "authors": [
915
- {
916
- "name": "Sebastian Bergmann",
917
- "email": "sebastian@phpunit.de"
918
- }
919
- ],
920
- "description": "Wrapper around PHP's tokenizer extension.",
921
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
922
- "keywords": [
923
- "tokenizer"
924
- ],
925
- "time": "2016-11-15 14:06:22"
926
- },
927
- {
928
- "name": "phpunit/phpunit",
929
- "version": "5.7.2",
930
- "source": {
931
- "type": "git",
932
- "url": "https://github.com/sebastianbergmann/phpunit.git",
933
- "reference": "336aff0ac52e306c98e7455bc3e8d7b0bf777a5e"
934
- },
935
- "dist": {
936
- "type": "zip",
937
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/336aff0ac52e306c98e7455bc3e8d7b0bf777a5e",
938
- "reference": "336aff0ac52e306c98e7455bc3e8d7b0bf777a5e",
939
- "shasum": ""
940
- },
941
- "require": {
942
- "ext-dom": "*",
943
- "ext-json": "*",
944
- "ext-libxml": "*",
945
- "ext-mbstring": "*",
946
- "ext-xml": "*",
947
- "myclabs/deep-copy": "~1.3",
948
- "php": "^5.6 || ^7.0",
949
- "phpspec/prophecy": "^1.3.1",
950
- "phpunit/php-code-coverage": "^4.0.3",
951
- "phpunit/php-file-iterator": "~1.4",
952
- "phpunit/php-text-template": "~1.2",
953
- "phpunit/php-timer": "^1.0.6",
954
- "phpunit/phpunit-mock-objects": "^3.2",
955
- "sebastian/comparator": "~1.2.2",
956
- "sebastian/diff": "~1.2",
957
- "sebastian/environment": "^1.3.4 || ^2.0",
958
- "sebastian/exporter": "~2.0",
959
- "sebastian/global-state": "~1.0",
960
- "sebastian/object-enumerator": "~2.0",
961
- "sebastian/resource-operations": "~1.0",
962
- "sebastian/version": "~1.0|~2.0",
963
- "symfony/yaml": "~2.1|~3.0"
964
- },
965
- "conflict": {
966
- "phpdocumentor/reflection-docblock": "3.0.2"
967
- },
968
- "require-dev": {
969
- "ext-pdo": "*"
970
- },
971
- "suggest": {
972
- "ext-xdebug": "*",
973
- "phpunit/php-invoker": "~1.1"
974
- },
975
- "bin": [
976
- "phpunit"
977
- ],
978
- "type": "library",
979
- "extra": {
980
- "branch-alias": {
981
- "dev-master": "5.7.x-dev"
982
- }
983
- },
984
- "autoload": {
985
- "classmap": [
986
- "src/"
987
- ]
988
- },
989
- "notification-url": "https://packagist.org/downloads/",
990
- "license": [
991
- "BSD-3-Clause"
992
- ],
993
- "authors": [
994
- {
995
- "name": "Sebastian Bergmann",
996
- "email": "sebastian@phpunit.de",
997
- "role": "lead"
998
- }
999
- ],
1000
- "description": "The PHP Unit Testing framework.",
1001
- "homepage": "https://phpunit.de/",
1002
- "keywords": [
1003
- "phpunit",
1004
- "testing",
1005
- "xunit"
1006
- ],
1007
- "time": "2016-12-03 08:33:00"
1008
- },
1009
- {
1010
- "name": "phpunit/phpunit-mock-objects",
1011
- "version": "3.4.2",
1012
- "source": {
1013
- "type": "git",
1014
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
1015
- "reference": "90a08f5deed5f7ac35463c161f2e8fa0e5652faf"
1016
- },
1017
- "dist": {
1018
- "type": "zip",
1019
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/90a08f5deed5f7ac35463c161f2e8fa0e5652faf",
1020
- "reference": "90a08f5deed5f7ac35463c161f2e8fa0e5652faf",
1021
- "shasum": ""
1022
- },
1023
- "require": {
1024
- "doctrine/instantiator": "^1.0.2",
1025
- "php": "^5.6 || ^7.0",
1026
- "phpunit/php-text-template": "^1.2",
1027
- "sebastian/exporter": "^1.2 || ^2.0"
1028
- },
1029
- "conflict": {
1030
- "phpunit/phpunit": "<5.4.0"
1031
- },
1032
- "require-dev": {
1033
- "phpunit/phpunit": "^5.4"
1034
- },
1035
- "suggest": {
1036
- "ext-soap": "*"
1037
- },
1038
- "type": "library",
1039
- "extra": {
1040
- "branch-alias": {
1041
- "dev-master": "3.2.x-dev"
1042
- }
1043
- },
1044
- "autoload": {
1045
- "classmap": [
1046
- "src/"
1047
- ]
1048
- },
1049
- "notification-url": "https://packagist.org/downloads/",
1050
- "license": [
1051
- "BSD-3-Clause"
1052
- ],
1053
- "authors": [
1054
- {
1055
- "name": "Sebastian Bergmann",
1056
- "email": "sb@sebastian-bergmann.de",
1057
- "role": "lead"
1058
- }
1059
- ],
1060
- "description": "Mock Object library for PHPUnit",
1061
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
1062
- "keywords": [
1063
- "mock",
1064
- "xunit"
1065
- ],
1066
- "time": "2016-11-27 07:52:03"
1067
- },
1068
- {
1069
- "name": "psr/http-message",
1070
- "version": "1.0.1",
1071
- "source": {
1072
- "type": "git",
1073
- "url": "https://github.com/php-fig/http-message.git",
1074
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
1075
- },
1076
- "dist": {
1077
- "type": "zip",
1078
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
1079
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
1080
- "shasum": ""
1081
- },
1082
- "require": {
1083
- "php": ">=5.3.0"
1084
- },
1085
- "type": "library",
1086
- "extra": {
1087
- "branch-alias": {
1088
- "dev-master": "1.0.x-dev"
1089
- }
1090
- },
1091
- "autoload": {
1092
- "psr-4": {
1093
- "Psr\\Http\\Message\\": "src/"
1094
- }
1095
- },
1096
- "notification-url": "https://packagist.org/downloads/",
1097
- "license": [
1098
- "MIT"
1099
- ],
1100
- "authors": [
1101
- {
1102
- "name": "PHP-FIG",
1103
- "homepage": "http://www.php-fig.org/"
1104
- }
1105
- ],
1106
- "description": "Common interface for HTTP messages",
1107
- "homepage": "https://github.com/php-fig/http-message",
1108
- "keywords": [
1109
- "http",
1110
- "http-message",
1111
- "psr",
1112
- "psr-7",
1113
- "request",
1114
- "response"
1115
- ],
1116
- "time": "2016-08-06 14:39:51"
1117
- },
1118
- {
1119
- "name": "psr/log",
1120
- "version": "1.0.2",
1121
- "source": {
1122
- "type": "git",
1123
- "url": "https://github.com/php-fig/log.git",
1124
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
1125
- },
1126
- "dist": {
1127
- "type": "zip",
1128
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
1129
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
1130
- "shasum": ""
1131
- },
1132
- "require": {
1133
- "php": ">=5.3.0"
1134
- },
1135
- "type": "library",
1136
- "extra": {
1137
- "branch-alias": {
1138
- "dev-master": "1.0.x-dev"
1139
- }
1140
- },
1141
- "autoload": {
1142
- "psr-4": {
1143
- "Psr\\Log\\": "Psr/Log/"
1144
- }
1145
- },
1146
- "notification-url": "https://packagist.org/downloads/",
1147
- "license": [
1148
- "MIT"
1149
- ],
1150
- "authors": [
1151
- {
1152
- "name": "PHP-FIG",
1153
- "homepage": "http://www.php-fig.org/"
1154
- }
1155
- ],
1156
- "description": "Common interface for logging libraries",
1157
- "homepage": "https://github.com/php-fig/log",
1158
- "keywords": [
1159
- "log",
1160
- "psr",
1161
- "psr-3"
1162
- ],
1163
- "time": "2016-10-10 12:19:37"
1164
- },
1165
- {
1166
- "name": "sebastian/code-unit-reverse-lookup",
1167
- "version": "1.0.0",
1168
- "source": {
1169
- "type": "git",
1170
- "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
1171
- "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe"
1172
- },
1173
- "dist": {
1174
- "type": "zip",
1175
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
1176
- "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe",
1177
- "shasum": ""
1178
- },
1179
- "require": {
1180
- "php": ">=5.6"
1181
- },
1182
- "require-dev": {
1183
- "phpunit/phpunit": "~5"
1184
- },
1185
- "type": "library",
1186
- "extra": {
1187
- "branch-alias": {
1188
- "dev-master": "1.0.x-dev"
1189
- }
1190
- },
1191
- "autoload": {
1192
- "classmap": [
1193
- "src/"
1194
- ]
1195
- },
1196
- "notification-url": "https://packagist.org/downloads/",
1197
- "license": [
1198
- "BSD-3-Clause"
1199
- ],
1200
- "authors": [
1201
- {
1202
- "name": "Sebastian Bergmann",
1203
- "email": "sebastian@phpunit.de"
1204
- }
1205
- ],
1206
- "description": "Looks up which function or method a line of code belongs to",
1207
- "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
1208
- "time": "2016-02-13 06:45:14"
1209
- },
1210
- {
1211
- "name": "sebastian/comparator",
1212
- "version": "1.2.2",
1213
- "source": {
1214
- "type": "git",
1215
- "url": "https://github.com/sebastianbergmann/comparator.git",
1216
- "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f"
1217
- },
1218
- "dist": {
1219
- "type": "zip",
1220
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
1221
- "reference": "6a1ed12e8b2409076ab22e3897126211ff8b1f7f",
1222
- "shasum": ""
1223
- },
1224
- "require": {
1225
- "php": ">=5.3.3",
1226
- "sebastian/diff": "~1.2",
1227
- "sebastian/exporter": "~1.2 || ~2.0"
1228
- },
1229
- "require-dev": {
1230
- "phpunit/phpunit": "~4.4"
1231
- },
1232
- "type": "library",
1233
- "extra": {
1234
- "branch-alias": {
1235
- "dev-master": "1.2.x-dev"
1236
- }
1237
- },
1238
- "autoload": {
1239
- "classmap": [
1240
- "src/"
1241
- ]
1242
- },
1243
- "notification-url": "https://packagist.org/downloads/",
1244
- "license": [
1245
- "BSD-3-Clause"
1246
- ],
1247
- "authors": [
1248
- {
1249
- "name": "Jeff Welch",
1250
- "email": "whatthejeff@gmail.com"
1251
- },
1252
- {
1253
- "name": "Volker Dusch",
1254
- "email": "github@wallbash.com"
1255
- },
1256
- {
1257
- "name": "Bernhard Schussek",
1258
- "email": "bschussek@2bepublished.at"
1259
- },
1260
- {
1261
- "name": "Sebastian Bergmann",
1262
- "email": "sebastian@phpunit.de"
1263
- }
1264
- ],
1265
- "description": "Provides the functionality to compare PHP values for equality",
1266
- "homepage": "http://www.github.com/sebastianbergmann/comparator",
1267
- "keywords": [
1268
- "comparator",
1269
- "compare",
1270
- "equality"
1271
- ],
1272
- "time": "2016-11-19 09:18:40"
1273
- },
1274
- {
1275
- "name": "sebastian/diff",
1276
- "version": "1.4.1",
1277
- "source": {
1278
- "type": "git",
1279
- "url": "https://github.com/sebastianbergmann/diff.git",
1280
- "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
1281
- },
1282
- "dist": {
1283
- "type": "zip",
1284
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
1285
- "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
1286
- "shasum": ""
1287
- },
1288
- "require": {
1289
- "php": ">=5.3.3"
1290
- },
1291
- "require-dev": {
1292
- "phpunit/phpunit": "~4.8"
1293
- },
1294
- "type": "library",
1295
- "extra": {
1296
- "branch-alias": {
1297
- "dev-master": "1.4-dev"
1298
- }
1299
- },
1300
- "autoload": {
1301
- "classmap": [
1302
- "src/"
1303
- ]
1304
- },
1305
- "notification-url": "https://packagist.org/downloads/",
1306
- "license": [
1307
- "BSD-3-Clause"
1308
- ],
1309
- "authors": [
1310
- {
1311
- "name": "Kore Nordmann",
1312
- "email": "mail@kore-nordmann.de"
1313
- },
1314
- {
1315
- "name": "Sebastian Bergmann",
1316
- "email": "sebastian@phpunit.de"
1317
- }
1318
- ],
1319
- "description": "Diff implementation",
1320
- "homepage": "https://github.com/sebastianbergmann/diff",
1321
- "keywords": [
1322
- "diff"
1323
- ],
1324
- "time": "2015-12-08 07:14:41"
1325
- },
1326
- {
1327
- "name": "sebastian/environment",
1328
- "version": "2.0.0",
1329
- "source": {
1330
- "type": "git",
1331
- "url": "https://github.com/sebastianbergmann/environment.git",
1332
- "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
1333
- },
1334
- "dist": {
1335
- "type": "zip",
1336
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
1337
- "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
1338
- "shasum": ""
1339
- },
1340
- "require": {
1341
- "php": "^5.6 || ^7.0"
1342
- },
1343
- "require-dev": {
1344
- "phpunit/phpunit": "^5.0"
1345
- },
1346
- "type": "library",
1347
- "extra": {
1348
- "branch-alias": {
1349
- "dev-master": "2.0.x-dev"
1350
- }
1351
- },
1352
- "autoload": {
1353
- "classmap": [
1354
- "src/"
1355
- ]
1356
- },
1357
- "notification-url": "https://packagist.org/downloads/",
1358
- "license": [
1359
- "BSD-3-Clause"
1360
- ],
1361
- "authors": [
1362
- {
1363
- "name": "Sebastian Bergmann",
1364
- "email": "sebastian@phpunit.de"
1365
- }
1366
- ],
1367
- "description": "Provides functionality to handle HHVM/PHP environments",
1368
- "homepage": "http://www.github.com/sebastianbergmann/environment",
1369
- "keywords": [
1370
- "Xdebug",
1371
- "environment",
1372
- "hhvm"
1373
- ],
1374
- "time": "2016-11-26 07:53:53"
1375
- },
1376
- {
1377
- "name": "sebastian/exporter",
1378
- "version": "2.0.0",
1379
- "source": {
1380
- "type": "git",
1381
- "url": "https://github.com/sebastianbergmann/exporter.git",
1382
- "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
1383
- },
1384
- "dist": {
1385
- "type": "zip",
1386
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
1387
- "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
1388
- "shasum": ""
1389
- },
1390
- "require": {
1391
- "php": ">=5.3.3",
1392
- "sebastian/recursion-context": "~2.0"
1393
- },
1394
- "require-dev": {
1395
- "ext-mbstring": "*",
1396
- "phpunit/phpunit": "~4.4"
1397
- },
1398
- "type": "library",
1399
- "extra": {
1400
- "branch-alias": {
1401
- "dev-master": "2.0.x-dev"
1402
- }
1403
- },
1404
- "autoload": {
1405
- "classmap": [
1406
- "src/"
1407
- ]
1408
- },
1409
- "notification-url": "https://packagist.org/downloads/",
1410
- "license": [
1411
- "BSD-3-Clause"
1412
- ],
1413
- "authors": [
1414
- {
1415
- "name": "Jeff Welch",
1416
- "email": "whatthejeff@gmail.com"
1417
- },
1418
- {
1419
- "name": "Volker Dusch",
1420
- "email": "github@wallbash.com"
1421
- },
1422
- {
1423
- "name": "Bernhard Schussek",
1424
- "email": "bschussek@2bepublished.at"
1425
- },
1426
- {
1427
- "name": "Sebastian Bergmann",
1428
- "email": "sebastian@phpunit.de"
1429
- },
1430
- {
1431
- "name": "Adam Harvey",
1432
- "email": "aharvey@php.net"
1433
- }
1434
- ],
1435
- "description": "Provides the functionality to export PHP variables for visualization",
1436
- "homepage": "http://www.github.com/sebastianbergmann/exporter",
1437
- "keywords": [
1438
- "export",
1439
- "exporter"
1440
- ],
1441
- "time": "2016-11-19 08:54:04"
1442
- },
1443
- {
1444
- "name": "sebastian/global-state",
1445
- "version": "1.1.1",
1446
- "source": {
1447
- "type": "git",
1448
- "url": "https://github.com/sebastianbergmann/global-state.git",
1449
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
1450
- },
1451
- "dist": {
1452
- "type": "zip",
1453
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
1454
- "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
1455
- "shasum": ""
1456
- },
1457
- "require": {
1458
- "php": ">=5.3.3"
1459
- },
1460
- "require-dev": {
1461
- "phpunit/phpunit": "~4.2"
1462
- },
1463
- "suggest": {
1464
- "ext-uopz": "*"
1465
- },
1466
- "type": "library",
1467
- "extra": {
1468
- "branch-alias": {
1469
- "dev-master": "1.0-dev"
1470
- }
1471
- },
1472
- "autoload": {
1473
- "classmap": [
1474
- "src/"
1475
- ]
1476
- },
1477
- "notification-url": "https://packagist.org/downloads/",
1478
- "license": [
1479
- "BSD-3-Clause"
1480
- ],
1481
- "authors": [
1482
- {
1483
- "name": "Sebastian Bergmann",
1484
- "email": "sebastian@phpunit.de"
1485
- }
1486
- ],
1487
- "description": "Snapshotting of global state",
1488
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
1489
- "keywords": [
1490
- "global state"
1491
- ],
1492
- "time": "2015-10-12 03:26:01"
1493
- },
1494
- {
1495
- "name": "sebastian/object-enumerator",
1496
- "version": "2.0.0",
1497
- "source": {
1498
- "type": "git",
1499
- "url": "https://github.com/sebastianbergmann/object-enumerator.git",
1500
- "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35"
1501
- },
1502
- "dist": {
1503
- "type": "zip",
1504
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35",
1505
- "reference": "96f8a3f257b69e8128ad74d3a7fd464bcbaa3b35",
1506
- "shasum": ""
1507
- },
1508
- "require": {
1509
- "php": ">=5.6",
1510
- "sebastian/recursion-context": "~2.0"
1511
- },
1512
- "require-dev": {
1513
- "phpunit/phpunit": "~5"
1514
- },
1515
- "type": "library",
1516
- "extra": {
1517
- "branch-alias": {
1518
- "dev-master": "2.0.x-dev"
1519
- }
1520
- },
1521
- "autoload": {
1522
- "classmap": [
1523
- "src/"
1524
- ]
1525
- },
1526
- "notification-url": "https://packagist.org/downloads/",
1527
- "license": [
1528
- "BSD-3-Clause"
1529
- ],
1530
- "authors": [
1531
- {
1532
- "name": "Sebastian Bergmann",
1533
- "email": "sebastian@phpunit.de"
1534
- }
1535
- ],
1536
- "description": "Traverses array structures and object graphs to enumerate all referenced objects",
1537
- "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
1538
- "time": "2016-11-19 07:35:10"
1539
- },
1540
- {
1541
- "name": "sebastian/recursion-context",
1542
- "version": "2.0.0",
1543
- "source": {
1544
- "type": "git",
1545
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
1546
- "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
1547
- },
1548
- "dist": {
1549
- "type": "zip",
1550
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1551
- "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
1552
- "shasum": ""
1553
- },
1554
- "require": {
1555
- "php": ">=5.3.3"
1556
- },
1557
- "require-dev": {
1558
- "phpunit/phpunit": "~4.4"
1559
- },
1560
- "type": "library",
1561
- "extra": {
1562
- "branch-alias": {
1563
- "dev-master": "2.0.x-dev"
1564
- }
1565
- },
1566
- "autoload": {
1567
- "classmap": [
1568
- "src/"
1569
- ]
1570
- },
1571
- "notification-url": "https://packagist.org/downloads/",
1572
- "license": [
1573
- "BSD-3-Clause"
1574
- ],
1575
- "authors": [
1576
- {
1577
- "name": "Jeff Welch",
1578
- "email": "whatthejeff@gmail.com"
1579
- },
1580
- {
1581
- "name": "Sebastian Bergmann",
1582
- "email": "sebastian@phpunit.de"
1583
- },
1584
- {
1585
- "name": "Adam Harvey",
1586
- "email": "aharvey@php.net"
1587
- }
1588
- ],
1589
- "description": "Provides functionality to recursively process PHP variables",
1590
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
1591
- "time": "2016-11-19 07:33:16"
1592
- },
1593
- {
1594
- "name": "sebastian/resource-operations",
1595
- "version": "1.0.0",
1596
- "source": {
1597
- "type": "git",
1598
- "url": "https://github.com/sebastianbergmann/resource-operations.git",
1599
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
1600
- },
1601
- "dist": {
1602
- "type": "zip",
1603
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1604
- "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
1605
- "shasum": ""
1606
- },
1607
- "require": {
1608
- "php": ">=5.6.0"
1609
- },
1610
- "type": "library",
1611
- "extra": {
1612
- "branch-alias": {
1613
- "dev-master": "1.0.x-dev"
1614
- }
1615
- },
1616
- "autoload": {
1617
- "classmap": [
1618
- "src/"
1619
- ]
1620
- },
1621
- "notification-url": "https://packagist.org/downloads/",
1622
- "license": [
1623
- "BSD-3-Clause"
1624
- ],
1625
- "authors": [
1626
- {
1627
- "name": "Sebastian Bergmann",
1628
- "email": "sebastian@phpunit.de"
1629
- }
1630
- ],
1631
- "description": "Provides a list of PHP built-in functions that operate on resources",
1632
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
1633
- "time": "2015-07-28 20:34:47"
1634
- },
1635
- {
1636
- "name": "sebastian/version",
1637
- "version": "2.0.1",
1638
- "source": {
1639
- "type": "git",
1640
- "url": "https://github.com/sebastianbergmann/version.git",
1641
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
1642
- },
1643
- "dist": {
1644
- "type": "zip",
1645
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
1646
- "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
1647
- "shasum": ""
1648
- },
1649
- "require": {
1650
- "php": ">=5.6"
1651
- },
1652
- "type": "library",
1653
- "extra": {
1654
- "branch-alias": {
1655
- "dev-master": "2.0.x-dev"
1656
- }
1657
- },
1658
- "autoload": {
1659
- "classmap": [
1660
- "src/"
1661
- ]
1662
- },
1663
- "notification-url": "https://packagist.org/downloads/",
1664
- "license": [
1665
- "BSD-3-Clause"
1666
- ],
1667
- "authors": [
1668
- {
1669
- "name": "Sebastian Bergmann",
1670
- "email": "sebastian@phpunit.de",
1671
- "role": "lead"
1672
- }
1673
- ],
1674
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
1675
- "homepage": "https://github.com/sebastianbergmann/version",
1676
- "time": "2016-10-03 07:35:21"
1677
- },
1678
- {
1679
- "name": "symfony/browser-kit",
1680
- "version": "v3.2.0",
1681
- "source": {
1682
- "type": "git",
1683
- "url": "https://github.com/symfony/browser-kit.git",
1684
- "reference": "34348c2691ce6254e8e008026f4c5e72c22bb318"
1685
- },
1686
- "dist": {
1687
- "type": "zip",
1688
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/34348c2691ce6254e8e008026f4c5e72c22bb318",
1689
- "reference": "34348c2691ce6254e8e008026f4c5e72c22bb318",
1690
- "shasum": ""
1691
- },
1692
- "require": {
1693
- "php": ">=5.5.9",
1694
- "symfony/dom-crawler": "~2.8|~3.0"
1695
- },
1696
- "require-dev": {
1697
- "symfony/css-selector": "~2.8|~3.0",
1698
- "symfony/process": "~2.8|~3.0"
1699
- },
1700
- "suggest": {
1701
- "symfony/process": ""
1702
- },
1703
- "type": "library",
1704
- "extra": {
1705
- "branch-alias": {
1706
- "dev-master": "3.2-dev"
1707
- }
1708
- },
1709
- "autoload": {
1710
- "psr-4": {
1711
- "Symfony\\Component\\BrowserKit\\": ""
1712
- },
1713
- "exclude-from-classmap": [
1714
- "/Tests/"
1715
- ]
1716
- },
1717
- "notification-url": "https://packagist.org/downloads/",
1718
- "license": [
1719
- "MIT"
1720
- ],
1721
- "authors": [
1722
- {
1723
- "name": "Fabien Potencier",
1724
- "email": "fabien@symfony.com"
1725
- },
1726
- {
1727
- "name": "Symfony Community",
1728
- "homepage": "https://symfony.com/contributors"
1729
- }
1730
- ],
1731
- "description": "Symfony BrowserKit Component",
1732
- "homepage": "https://symfony.com",
1733
- "time": "2016-10-13 13:35:11"
1734
- },
1735
- {
1736
- "name": "symfony/console",
1737
- "version": "v3.2.0",
1738
- "source": {
1739
- "type": "git",
1740
- "url": "https://github.com/symfony/console.git",
1741
- "reference": "09d0fd33560e3573185a2ea17614e37ba38716c5"
1742
- },
1743
- "dist": {
1744
- "type": "zip",
1745
- "url": "https://api.github.com/repos/symfony/console/zipball/09d0fd33560e3573185a2ea17614e37ba38716c5",
1746
- "reference": "09d0fd33560e3573185a2ea17614e37ba38716c5",
1747
- "shasum": ""
1748
- },
1749
- "require": {
1750
- "php": ">=5.5.9",
1751
- "symfony/debug": "~2.8|~3.0",
1752
- "symfony/polyfill-mbstring": "~1.0"
1753
- },
1754
- "require-dev": {
1755
- "psr/log": "~1.0",
1756
- "symfony/event-dispatcher": "~2.8|~3.0",
1757
- "symfony/filesystem": "~2.8|~3.0",
1758
- "symfony/process": "~2.8|~3.0"
1759
- },
1760
- "suggest": {
1761
- "psr/log": "For using the console logger",
1762
- "symfony/event-dispatcher": "",
1763
- "symfony/filesystem": "",
1764
- "symfony/process": ""
1765
- },
1766
- "type": "library",
1767
- "extra": {
1768
- "branch-alias": {
1769
- "dev-master": "3.2-dev"
1770
- }
1771
- },
1772
- "autoload": {
1773
- "psr-4": {
1774
- "Symfony\\Component\\Console\\": ""
1775
- },
1776
- "exclude-from-classmap": [
1777
- "/Tests/"
1778
- ]
1779
- },
1780
- "notification-url": "https://packagist.org/downloads/",
1781
- "license": [
1782
- "MIT"
1783
- ],
1784
- "authors": [
1785
- {
1786
- "name": "Fabien Potencier",
1787
- "email": "fabien@symfony.com"
1788
- },
1789
- {
1790
- "name": "Symfony Community",
1791
- "homepage": "https://symfony.com/contributors"
1792
- }
1793
- ],
1794
- "description": "Symfony Console Component",
1795
- "homepage": "https://symfony.com",
1796
- "time": "2016-11-16 22:18:16"
1797
- },
1798
- {
1799
- "name": "symfony/css-selector",
1800
- "version": "v3.2.0",
1801
- "source": {
1802
- "type": "git",
1803
- "url": "https://github.com/symfony/css-selector.git",
1804
- "reference": "e1241f275814827c411d922ba8e64cf2a00b2994"
1805
- },
1806
- "dist": {
1807
- "type": "zip",
1808
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/e1241f275814827c411d922ba8e64cf2a00b2994",
1809
- "reference": "e1241f275814827c411d922ba8e64cf2a00b2994",
1810
- "shasum": ""
1811
- },
1812
- "require": {
1813
- "php": ">=5.5.9"
1814
- },
1815
- "type": "library",
1816
- "extra": {
1817
- "branch-alias": {
1818
- "dev-master": "3.2-dev"
1819
- }
1820
- },
1821
- "autoload": {
1822
- "psr-4": {
1823
- "Symfony\\Component\\CssSelector\\": ""
1824
- },
1825
- "exclude-from-classmap": [
1826
- "/Tests/"
1827
- ]
1828
- },
1829
- "notification-url": "https://packagist.org/downloads/",
1830
- "license": [
1831
- "MIT"
1832
- ],
1833
- "authors": [
1834
- {
1835
- "name": "Jean-François Simon",
1836
- "email": "jeanfrancois.simon@sensiolabs.com"
1837
- },
1838
- {
1839
- "name": "Fabien Potencier",
1840
- "email": "fabien@symfony.com"
1841
- },
1842
- {
1843
- "name": "Symfony Community",
1844
- "homepage": "https://symfony.com/contributors"
1845
- }
1846
- ],
1847
- "description": "Symfony CssSelector Component",
1848
- "homepage": "https://symfony.com",
1849
- "time": "2016-11-03 08:11:03"
1850
- },
1851
- {
1852
- "name": "symfony/debug",
1853
- "version": "v3.2.0",
1854
- "source": {
1855
- "type": "git",
1856
- "url": "https://github.com/symfony/debug.git",
1857
- "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231"
1858
- },
1859
- "dist": {
1860
- "type": "zip",
1861
- "url": "https://api.github.com/repos/symfony/debug/zipball/9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
1862
- "reference": "9f923e68d524a3095c5a2ae5fc7220c7cbc12231",
1863
- "shasum": ""
1864
- },
1865
- "require": {
1866
- "php": ">=5.5.9",
1867
- "psr/log": "~1.0"
1868
- },
1869
- "conflict": {
1870
- "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
1871
- },
1872
- "require-dev": {
1873
- "symfony/class-loader": "~2.8|~3.0",
1874
- "symfony/http-kernel": "~2.8|~3.0"
1875
- },
1876
- "type": "library",
1877
- "extra": {
1878
- "branch-alias": {
1879
- "dev-master": "3.2-dev"
1880
- }
1881
- },
1882
- "autoload": {
1883
- "psr-4": {
1884
- "Symfony\\Component\\Debug\\": ""
1885
- },
1886
- "exclude-from-classmap": [
1887
- "/Tests/"
1888
- ]
1889
- },
1890
- "notification-url": "https://packagist.org/downloads/",
1891
- "license": [
1892
- "MIT"
1893
- ],
1894
- "authors": [
1895
- {
1896
- "name": "Fabien Potencier",
1897
- "email": "fabien@symfony.com"
1898
- },
1899
- {
1900
- "name": "Symfony Community",
1901
- "homepage": "https://symfony.com/contributors"
1902
- }
1903
- ],
1904
- "description": "Symfony Debug Component",
1905
- "homepage": "https://symfony.com",
1906
- "time": "2016-11-16 22:18:16"
1907
- },
1908
- {
1909
- "name": "symfony/dom-crawler",
1910
- "version": "v3.2.0",
1911
- "source": {
1912
- "type": "git",
1913
- "url": "https://github.com/symfony/dom-crawler.git",
1914
- "reference": "c6b6111f5aae7c58698cdc10220785627ac44a2c"
1915
- },
1916
- "dist": {
1917
- "type": "zip",
1918
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/c6b6111f5aae7c58698cdc10220785627ac44a2c",
1919
- "reference": "c6b6111f5aae7c58698cdc10220785627ac44a2c",
1920
- "shasum": ""
1921
- },
1922
- "require": {
1923
- "php": ">=5.5.9",
1924
- "symfony/polyfill-mbstring": "~1.0"
1925
- },
1926
- "require-dev": {
1927
- "symfony/css-selector": "~2.8|~3.0"
1928
- },
1929
- "suggest": {
1930
- "symfony/css-selector": ""
1931
- },
1932
- "type": "library",
1933
- "extra": {
1934
- "branch-alias": {
1935
- "dev-master": "3.2-dev"
1936
- }
1937
- },
1938
- "autoload": {
1939
- "psr-4": {
1940
- "Symfony\\Component\\DomCrawler\\": ""
1941
- },
1942
- "exclude-from-classmap": [
1943
- "/Tests/"
1944
- ]
1945
- },
1946
- "notification-url": "https://packagist.org/downloads/",
1947
- "license": [
1948
- "MIT"
1949
- ],
1950
- "authors": [
1951
- {
1952
- "name": "Fabien Potencier",
1953
- "email": "fabien@symfony.com"
1954
- },
1955
- {
1956
- "name": "Symfony Community",
1957
- "homepage": "https://symfony.com/contributors"
1958
- }
1959
- ],
1960
- "description": "Symfony DomCrawler Component",
1961
- "homepage": "https://symfony.com",
1962
- "time": "2016-11-25 12:32:42"
1963
- },
1964
- {
1965
- "name": "symfony/event-dispatcher",
1966
- "version": "v3.2.0",
1967
- "source": {
1968
- "type": "git",
1969
- "url": "https://github.com/symfony/event-dispatcher.git",
1970
- "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283"
1971
- },
1972
- "dist": {
1973
- "type": "zip",
1974
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
1975
- "reference": "e8f47a327c2f0fd5aa04fa60af2b693006ed7283",
1976
- "shasum": ""
1977
- },
1978
- "require": {
1979
- "php": ">=5.5.9"
1980
- },
1981
- "require-dev": {
1982
- "psr/log": "~1.0",
1983
- "symfony/config": "~2.8|~3.0",
1984
- "symfony/dependency-injection": "~2.8|~3.0",
1985
- "symfony/expression-language": "~2.8|~3.0",
1986
- "symfony/stopwatch": "~2.8|~3.0"
1987
- },
1988
- "suggest": {
1989
- "symfony/dependency-injection": "",
1990
- "symfony/http-kernel": ""
1991
- },
1992
- "type": "library",
1993
- "extra": {
1994
- "branch-alias": {
1995
- "dev-master": "3.2-dev"
1996
- }
1997
- },
1998
- "autoload": {
1999
- "psr-4": {
2000
- "Symfony\\Component\\EventDispatcher\\": ""
2001
- },
2002
- "exclude-from-classmap": [
2003
- "/Tests/"
2004
- ]
2005
- },
2006
- "notification-url": "https://packagist.org/downloads/",
2007
- "license": [
2008
- "MIT"
2009
- ],
2010
- "authors": [
2011
- {
2012
- "name": "Fabien Potencier",
2013
- "email": "fabien@symfony.com"
2014
- },
2015
- {
2016
- "name": "Symfony Community",
2017
- "homepage": "https://symfony.com/contributors"
2018
- }
2019
- ],
2020
- "description": "Symfony EventDispatcher Component",
2021
- "homepage": "https://symfony.com",
2022
- "time": "2016-10-13 06:29:04"
2023
- },
2024
- {
2025
- "name": "symfony/finder",
2026
- "version": "v3.2.0",
2027
- "source": {
2028
- "type": "git",
2029
- "url": "https://github.com/symfony/finder.git",
2030
- "reference": "4263e35a1e342a0f195c9349c0dee38148f8a14f"
2031
- },
2032
- "dist": {
2033
- "type": "zip",
2034
- "url": "https://api.github.com/repos/symfony/finder/zipball/4263e35a1e342a0f195c9349c0dee38148f8a14f",
2035
- "reference": "4263e35a1e342a0f195c9349c0dee38148f8a14f",
2036
- "shasum": ""
2037
- },
2038
- "require": {
2039
- "php": ">=5.5.9"
2040
- },
2041
- "type": "library",
2042
- "extra": {
2043
- "branch-alias": {
2044
- "dev-master": "3.2-dev"
2045
- }
2046
- },
2047
- "autoload": {
2048
- "psr-4": {
2049
- "Symfony\\Component\\Finder\\": ""
2050
- },
2051
- "exclude-from-classmap": [
2052
- "/Tests/"
2053
- ]
2054
- },
2055
- "notification-url": "https://packagist.org/downloads/",
2056
- "license": [
2057
- "MIT"
2058
- ],
2059
- "authors": [
2060
- {
2061
- "name": "Fabien Potencier",
2062
- "email": "fabien@symfony.com"
2063
- },
2064
- {
2065
- "name": "Symfony Community",
2066
- "homepage": "https://symfony.com/contributors"
2067
- }
2068
- ],
2069
- "description": "Symfony Finder Component",
2070
- "homepage": "https://symfony.com",
2071
- "time": "2016-11-03 08:11:03"
2072
- },
2073
- {
2074
- "name": "symfony/polyfill-mbstring",
2075
- "version": "v1.3.0",
2076
- "source": {
2077
- "type": "git",
2078
- "url": "https://github.com/symfony/polyfill-mbstring.git",
2079
- "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4"
2080
- },
2081
- "dist": {
2082
- "type": "zip",
2083
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/e79d363049d1c2128f133a2667e4f4190904f7f4",
2084
- "reference": "e79d363049d1c2128f133a2667e4f4190904f7f4",
2085
- "shasum": ""
2086
- },
2087
- "require": {
2088
- "php": ">=5.3.3"
2089
- },
2090
- "suggest": {
2091
- "ext-mbstring": "For best performance"
2092
- },
2093
- "type": "library",
2094
- "extra": {
2095
- "branch-alias": {
2096
- "dev-master": "1.3-dev"
2097
- }
2098
- },
2099
- "autoload": {
2100
- "psr-4": {
2101
- "Symfony\\Polyfill\\Mbstring\\": ""
2102
- },
2103
- "files": [
2104
- "bootstrap.php"
2105
- ]
2106
- },
2107
- "notification-url": "https://packagist.org/downloads/",
2108
- "license": [
2109
- "MIT"
2110
- ],
2111
- "authors": [
2112
- {
2113
- "name": "Nicolas Grekas",
2114
- "email": "p@tchwork.com"
2115
- },
2116
- {
2117
- "name": "Symfony Community",
2118
- "homepage": "https://symfony.com/contributors"
2119
- }
2120
- ],
2121
- "description": "Symfony polyfill for the Mbstring extension",
2122
- "homepage": "https://symfony.com",
2123
- "keywords": [
2124
- "compatibility",
2125
- "mbstring",
2126
- "polyfill",
2127
- "portable",
2128
- "shim"
2129
- ],
2130
- "time": "2016-11-14 01:06:16"
2131
- },
2132
- {
2133
- "name": "symfony/yaml",
2134
- "version": "v3.2.0",
2135
- "source": {
2136
- "type": "git",
2137
- "url": "https://github.com/symfony/yaml.git",
2138
- "reference": "f2300ba8fbb002c028710b92e1906e7457410693"
2139
- },
2140
- "dist": {
2141
- "type": "zip",
2142
- "url": "https://api.github.com/repos/symfony/yaml/zipball/f2300ba8fbb002c028710b92e1906e7457410693",
2143
- "reference": "f2300ba8fbb002c028710b92e1906e7457410693",
2144
- "shasum": ""
2145
- },
2146
- "require": {
2147
- "php": ">=5.5.9"
2148
- },
2149
- "require-dev": {
2150
- "symfony/console": "~2.8|~3.0"
2151
- },
2152
- "suggest": {
2153
- "symfony/console": "For validating YAML files using the lint command"
2154
- },
2155
- "type": "library",
2156
- "extra": {
2157
- "branch-alias": {
2158
- "dev-master": "3.2-dev"
2159
- }
2160
- },
2161
- "autoload": {
2162
- "psr-4": {
2163
- "Symfony\\Component\\Yaml\\": ""
2164
- },
2165
- "exclude-from-classmap": [
2166
- "/Tests/"
2167
- ]
2168
- },
2169
- "notification-url": "https://packagist.org/downloads/",
2170
- "license": [
2171
- "MIT"
2172
- ],
2173
- "authors": [
2174
- {
2175
- "name": "Fabien Potencier",
2176
- "email": "fabien@symfony.com"
2177
- },
2178
- {
2179
- "name": "Symfony Community",
2180
- "homepage": "https://symfony.com/contributors"
2181
- }
2182
- ],
2183
- "description": "Symfony Yaml Component",
2184
- "homepage": "https://symfony.com",
2185
- "time": "2016-11-18 21:17:59"
2186
- },
2187
- {
2188
- "name": "webmozart/assert",
2189
- "version": "1.2.0",
2190
- "source": {
2191
- "type": "git",
2192
- "url": "https://github.com/webmozart/assert.git",
2193
- "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
2194
- },
2195
- "dist": {
2196
- "type": "zip",
2197
- "url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
2198
- "reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
2199
- "shasum": ""
2200
- },
2201
- "require": {
2202
- "php": "^5.3.3 || ^7.0"
2203
- },
2204
- "require-dev": {
2205
- "phpunit/phpunit": "^4.6",
2206
- "sebastian/version": "^1.0.1"
2207
- },
2208
- "type": "library",
2209
- "extra": {
2210
- "branch-alias": {
2211
- "dev-master": "1.3-dev"
2212
- }
2213
- },
2214
- "autoload": {
2215
- "psr-4": {
2216
- "Webmozart\\Assert\\": "src/"
2217
- }
2218
- },
2219
- "notification-url": "https://packagist.org/downloads/",
2220
- "license": [
2221
- "MIT"
2222
- ],
2223
- "authors": [
2224
- {
2225
- "name": "Bernhard Schussek",
2226
- "email": "bschussek@gmail.com"
2227
- }
2228
- ],
2229
- "description": "Assertions to validate method input/output with nice error messages.",
2230
- "keywords": [
2231
- "assert",
2232
- "check",
2233
- "validate"
2234
- ],
2235
- "time": "2016-11-23 20:04:58"
2236
- }
2237
- ],
2238
- "packages-dev": [],
2239
- "aliases": [],
2240
- "minimum-stability": "stable",
2241
- "stability-flags": [],
2242
- "prefer-stable": false,
2243
- "prefer-lowest": false,
2244
- "platform": [],
2245
- "platform-dev": []
2246
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
plugin.php CHANGED
@@ -1,3201 +1,3201 @@
1
- <?php
2
- /*
3
- Plugin Name: Absolutely Glamorous Custom Admin
4
- Plugin URI: https://wordpressadminpanel.com/ag-custom-admin/
5
- Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
- Author: Cusmin
7
- Version: 6.5.2
8
- Text Domain: ag-custom-admin
9
- Domain Path: /languages
10
- Author URI: https://cusmin.com
11
-
12
- Copyright 2017. WAP (email : info@wordpressadminpanel.com)
13
-
14
- This program is free software: you can redistribute it and/or modify
15
- it under the terms of the GNU General Public License as published by
16
- the Free Software Foundation, either version 3 of the License, or
17
- (at your option) any later version.
18
-
19
- This program is distributed in the hope that it will be useful,
20
- but WITHOUT ANY WARRANTY; without even the implied warranty of
21
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
- GNU General Public License for more details.
23
-
24
- You should have received a copy of the GNU General Public License
25
- along with this program. If not, see <http://www.gnu.org/licenses/>.
26
- */
27
-
28
- $agca = new AGCA();
29
-
30
- class AGCA{
31
- private $colorizer="";
32
- private $agca_version;
33
- private $agca_debug = false;
34
- private $admin_capabilities;
35
- private $context = "";
36
- private $saveAfterImport = false;
37
- private $templateCustomizations = "";
38
- private $templates_ep = "https://wordpressadminpanel.com/configuration.php";
39
-
40
- public function __construct()
41
- {
42
- add_action('init', array(&$this,'init'));
43
- }
44
-
45
- function init(){
46
- $this->reloadScript();
47
- $this->checkPOST();
48
- $this->checkGET();
49
-
50
- if(function_exists("add_filter")){
51
- add_filter('admin_title', array(&$this,'change_title'), 10, 2);
52
- add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
53
- }
54
-
55
- add_action('admin_init', array(&$this,'admin_init'));
56
- add_action('login_init', array(&$this,'login_init'));
57
- add_action('admin_head', array(&$this,'print_admin_css'));
58
- add_action('login_head', array(&$this,'print_login_head'));
59
- add_action('admin_menu', array(&$this,'agca_create_menu'));
60
- add_action('wp_head', array(&$this,'print_page'));
61
- //add_action( 'wp_before_admin_bar_render', array(&$this,'admin_bar_changes') );
62
- add_action( 'plugins_loaded', array(&$this,'load_plugin_textdomain') );
63
- register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
64
-
65
- add_action( 'customize_controls_enqueue_scripts', array(&$this,'agca_customizer_php') );
66
-
67
- add_action( 'admin_bar_menu', array(&$this,'wp_admin_bar_my_custom_account_menu'), 11 );
68
-
69
- /* wp_localize_script(
70
- 'agca-script',//use agca enqueued script
71
- 'agca_string',
72
- $this->get_language_strings()
73
- );*/
74
-
75
- /*Initialize properties*/
76
- $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
77
-
78
- $this->agca_version = "6.5.2";
79
- }
80
-
81
- function load_plugin_textdomain() {
82
- load_plugin_textdomain( 'ag-custom-admin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
83
- }
84
-
85
- // Add donate and support information
86
- function jk_filter_plugin_links($links, $file)
87
- {
88
- if ( $file == plugin_basename(__FILE__) )
89
- {
90
- if(!is_network_admin()){
91
- $links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php#general-settings">' . __('Settings', 'ag-custom-admin') . '</a>';
92
- //$links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php#ag-templates">' . __('Admin Themes', 'ag-custom-admin') . '</a>';
93
- }
94
- $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/ag-custom-admin">' . __('Support', 'ag-custom-admin') . '</a>';
95
- $links[] = '<a target="_blank" href="https://cusmin.com/upgrade-to-cusmin?ref=plugins">' . __('Upgrade', 'ag-custom-admin') . '</a>';
96
- $links[] = '<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development">' . __('Donate', 'ag-custom-admin') . '</a>';
97
- }
98
- return $links;
99
- }
100
-
101
-
102
- function filePath($url){
103
- $absPath = ABSPATH;
104
- $absPath = rtrim($absPath, '/');
105
- $url = ltrim($url, '/');
106
- return $absPath.'/'.$url;
107
- }
108
-
109
- function change_admin_color(){
110
- return 'default';
111
- }
112
-
113
- function agca_customizer_php(){
114
- $this->agca_get_includes();
115
- }
116
-
117
- function admin_init(){
118
- $this->agca_register_settings();
119
- $this->agca_init_session();
120
- $isAdminUser = current_user_can($this->admin_capability());
121
- if(!$isAdminUser || ($isAdminUser && !get_option('agca_role_allbutadmin'))){
122
- if(get_option('agca_profile_color_scheme')){
123
- remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
124
- }
125
- }
126
- }
127
-
128
- function login_init(){
129
- $this->agca_enqueue_scripts();
130
- }
131
-
132
- function agca_init_session(){
133
- if (!session_id())
134
- session_start();
135
- }
136
-
137
- function checkGET(){
138
- if(isset($_GET['agca_action'])){
139
- if($_GET['agca_action'] =="remove_templates"){
140
- $this->delete_template_images_all();
141
- update_option('agca_templates', "");
142
- update_option('agca_selected_template', "");
143
- }
144
- }
145
- if(isset($_GET['agca_debug'])){
146
- if($_GET['agca_debug'] =="true"){
147
- $this->agca_debug = true;
148
- }else{
149
- $this->agca_debug = false;
150
- }
151
- }
152
- }
153
-
154
- function checkPOST(){
155
- if(isset($_POST['_agca_save_template'])){
156
- $this->verifyPostRequest();
157
- //print_r($_POST);
158
- $data = $_POST['templates_data'];
159
- $parts = explode("|||",$data);
160
-
161
- $common_data = $parts [0];
162
- $admin_js = $parts [1];
163
- $admin_css = $parts [2];
164
- $login_js = $parts [3];
165
- $login_css = $parts [4];
166
- $settings = $parts [5];
167
- $images = $parts [6];
168
-
169
- $template_name = $_POST['templates_name'];
170
-
171
- update_option('agca_selected_template', $template_name);
172
-
173
- $templates = get_option( 'agca_templates' );
174
- if($templates == ""){
175
- $templates = array();
176
- }
177
-
178
- $templates[$template_name] = array(
179
- 'common'=>$common_data,
180
- 'admin'=>"",
181
- 'adminjs'=>$admin_js,
182
- 'admincss'=>$admin_css,
183
- 'login'=>"",
184
- 'loginjs'=>$login_js,
185
- 'logincss'=>$login_css,
186
- 'images'=>$images,
187
- 'settings'=>$settings
188
- );
189
- update_option('agca_templates', $templates);
190
-
191
- $_POST = array();
192
-
193
- }else if(isset($_POST['_agca_templates_session'])){
194
- $this->verifyPostRequest();
195
- $this->agcaAdminSession();
196
- if($_POST['template'] !="")
197
- $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
198
-
199
- //print_r($_SESSION);
200
- echo "_agca_templates_session:OK";
201
- exit;
202
- }else if(isset($_POST['_agca_templates_session_remove_license'])){
203
- $this->verifyPostRequest();
204
- $this->agcaAdminSession();
205
- if($_POST['template'] !="")
206
- $_SESSION["AGCA"]["Templates"][$_POST['template']] = null;
207
- print_r($_SESSION);
208
- echo "_agca_templates_session_remove_license:OK";
209
- exit;
210
- }else if(isset($_POST['_agca_get_templates'])){
211
- $this->verifyPostRequest();
212
- $templates = get_option( 'agca_templates' );
213
- if($templates == "") $templates = array();
214
- $results = array();
215
- foreach($templates as $key=>$val){
216
- $results[]=$key;
217
- }
218
- echo json_encode($results);
219
- exit;
220
- }else if(isset($_POST['_agca_activate_template'])){
221
- $this->verifyPostRequest();
222
- update_option('agca_selected_template', $_POST['_agca_activate_template']);
223
- $_POST = array();
224
- //unset($_POST);
225
- exit;
226
- }else if(isset($_POST['_agca_template_settings'])){
227
- $this->verifyPostRequest();
228
- $settings = $_POST['_agca_template_settings'];
229
-
230
- $templates = get_option( 'agca_templates' );
231
- if($templates == ""){
232
- $templates = array();
233
- }
234
- $template_name = $_POST["_agca_current_template"];
235
-
236
- $templates[$template_name]["settings"] = $settings;
237
- update_option('agca_templates', $templates);
238
-
239
- $_POST = array();
240
- //print_r($templates);
241
- exit;
242
- }else if(isset($_POST['_agca_upload_image'])){
243
- $this->verifyPostRequest();
244
- function my_sideload_image() {
245
- $remoteurl = $_POST['_agca_upload_image'];
246
- $file = media_sideload_image( $remoteurl, 0 ,__("Absolutely Glamorous Custom Admin theme image (do not delete)", 'ag-custom-admin'));
247
- try{
248
- $fileparts = explode("src='", $file);
249
- $url=explode("'",$fileparts[1]);
250
- echo $url[0];
251
- }catch (\Exception $e){}
252
- exit;
253
- }
254
- add_action( 'admin_init', 'my_sideload_image' );
255
-
256
- }else if(isset($_POST['_agca_remove_template_images'])){
257
- $this->verifyPostRequest();
258
- $this->delete_template_images($_POST['_agca_remove_template_images']);
259
- exit;
260
- }
261
- }
262
-
263
- function verifyPostRequest(){
264
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
265
- if (!is_admin()) {
266
- _e('Not allowed. This action is allowed exclusively in admin panel', 'ag-custom-admin');
267
- exit;
268
- }
269
- //In case of problems with saving AGCA settings on MS disable verification temporary
270
- if(get_option('agca_disable_postver')){
271
- return;
272
- }
273
- if (is_multisite()) {
274
- $blog_id = get_current_blog_id();
275
- $user_id = get_current_user_id();
276
- $msError = __('Please try temporary disabling POST verification. Go to Absolutely Glamorous Custom Admin -> Advanced -> Temporary disable POST verification. Do not forget to un-check this option once you are done with customizations.', 'ag-custom-admin');
277
- if (is_user_member_of_blog($user_id, $blog_id)) {
278
- if (!current_user_can('manage_options')) {
279
- _e('Multi-site: Current user is not recognized as administrator.', 'ag-custom-admin');
280
- echo ' '.$msError;
281
- exit;
282
- }
283
- } else {
284
- printf(
285
- /*translators: 1: User Id 2: Blog Id*/
286
- __('Multi-site: User (%1$s) does not have access to this blog (%2$s).', 'ag-custom-admin'),
287
- $user_id,
288
- $blog_id
289
- );
290
- echo ' '. $msError;
291
- exit;
292
- }
293
- } else {
294
- include_once($this->filePath('wp-includes/pluggable.php'));
295
- if (!is_user_logged_in() || !current_user_can('manage_options')) {
296
- echo !is_user_logged_in() ? __('User is not logged in.', 'ag-custom-admin').' ' : '';
297
- echo !current_user_can('manage_options') ? __('User can not manage options.', 'ag-custom-admin').' ' : '';
298
- exit;
299
- }
300
- }
301
- if (!wp_verify_nonce($_POST['_agca_token'], 'agca_form')) {
302
- echo __('Nonce verification failed.', 'ag-custom-admin');
303
- exit;
304
- }
305
- }
306
- }
307
-
308
- function get_language_strings() {
309
- $strings = array(
310
-
311
- );
312
- return $strings;
313
- }
314
-
315
- function admin_bar_changes(){
316
- if( current_user_can( 'manage_options' )){
317
- global $wp_admin_bar;
318
- if(!is_network_admin()){
319
- $wp_admin_bar->add_menu( array(
320
- 'id' => 'agca-admin-themes',
321
- 'title' => '<span class="ab-icon"></span>'.__( 'Admin Themes', 'ag-custom-admin' ),
322
- 'href' => 'tools.php?page=ag-custom-admin/plugin.php#ag-templates'
323
- ));
324
- }
325
- }
326
- }
327
-
328
- function delete_template_images_all(){
329
- $templates = get_option('agca_templates');
330
- if($templates != null && $templates != ""){
331
- foreach($templates as $template){
332
- if($template != null && $template['images'] != null && $template['images'] != ""){
333
- //print_r($template['images']);
334
- $imgs = explode(',',$template['images']);
335
- foreach($imgs as $imageSrc){
336
- $this->delete_attachment_by_src($imageSrc);
337
- }
338
- //print_r($imgs);
339
- }
340
- }
341
- }
342
- //print_r($templates);
343
- }
344
-
345
- function delete_template_images($template_name){
346
- $templates = get_option('agca_templates');
347
- if($templates != null && $templates != ""){
348
- $template = $templates[$template_name];
349
- if($template != null && $template['images'] != null && $template['images'] != ""){
350
- //print_r($template['images']); exit;
351
- $imgs = explode(',',$template['images']);
352
- foreach($imgs as $imageSrc){
353
- $this->delete_attachment_by_src($imageSrc);
354
- }
355
- //print_r($imgs);
356
- }
357
- }
358
- //print_r($templates);
359
- }
360
-
361
- function delete_attachment_by_src ($image_src) {
362
- global $wpdb;
363
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
364
- $id = $wpdb->get_var($query);
365
- wp_delete_attachment( $id, $true );
366
- }
367
-
368
- function get_installed_agca_templates(){
369
- $templates = get_option( 'agca_templates' );
370
- if($templates == "")return '[]';
371
- $results = array();
372
- foreach($templates as $key=>$val){
373
- $results[]=$key;
374
- }
375
- return json_encode($results);
376
- }
377
-
378
- function isGuest(){
379
- global $user_login;
380
- if($user_login) {
381
- return false;
382
- }else{
383
- return true;
384
- }
385
- }
386
- function change_title($admin_title, $title){
387
- //return get_bloginfo('name').' - '.$title;
388
- if(get_option('agca_custom_title')!=""){
389
- $blog = get_bloginfo('name');
390
- $page = $title;
391
- $customTitle = get_option('agca_custom_title');
392
- $customTitle = str_replace('%BLOG%',$blog,$customTitle);
393
- $customTitle = str_replace('%PAGE%',$page,$customTitle);
394
- return $customTitle;
395
- }else{
396
- return $admin_title;
397
- }
398
- }
399
- function agca_get_includes() {
400
- ?>
401
- <script type="text/javascript">
402
- <?php
403
- //AGCA GLOBALS
404
- echo "var agca_global_plugin_url = '".$this->pluginUrl()."';";
405
- ?>
406
- </script>
407
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
408
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>" />
409
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
410
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
411
-
412
- <?php
413
- if($this->context == "login"){
414
- ?>
415
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/login.min.css" />
416
- <?php
417
- }else{
418
- ?>
419
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/admin.min.css" />
420
- <?php
421
- }
422
- ?>
423
- <?php
424
- echo $this->templateCustomizations;
425
-
426
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
427
- ?>
428
- <style type="text/css">
429
- <?php
430
- echo get_option('agca_custom_css');
431
- ?>
432
- </style>
433
- <script type="text/javascript">
434
- try{
435
- eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
436
- }catch(e){
437
- alert('AGCA: <?php _e('There is an error in your custom JS script. Please fix it:', 'ag-custom-admin'); ?> \n\n' + e + '\n\n (<?php _e('AGCA -> Advanced -> Custom JavaScript', 'ag-custom-admin'); ?>)');
438
- console.log(e);
439
- }
440
- </script>
441
- <?php
442
- }
443
- }
444
-
445
- function agca_enqueue_scripts() {
446
- wp_enqueue_script('jquery');
447
- //TODO: Use this instead of manually adding scripts
448
- //wp_enqueue_script('agca-script', __FILE__.'/script/ag_script.js', array('jquery'),$this->agca_version );
449
- }
450
-
451
- function WPSPluginIsLoginPage(){
452
- $WPSPluginName = 'wps-hide-login/wps-hide-login.php';
453
- if(is_multisite()){
454
- if ( ! function_exists( 'is_plugin_active_for_network' ) ){
455
- $pluginPhpFilePath = $this->filePath('wp-admin/includes/plugins.php');
456
- if(!file_exists($pluginPhpFilePath)){
457
- return '';
458
- }
459
- require_once($pluginPhpFilePath);
460
- }
461
-
462
- if(!$this->isPluginActiveForNetwork($WPSPluginName)){
463
- return '';
464
- }
465
- }else{
466
- if(!$this->isPluginActive($WPSPluginName)){
467
- return '';
468
- }
469
- }
470
-
471
- if ( $slug = get_option( 'whl_page' ) ) {
472
- return $slug;
473
- } else if ( ( is_multisite() && $this->isPluginActiveForNetwork($WPSPluginName) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
474
- return $slug;
475
- } else if ( $slug = 'login' ) {
476
- return $slug;
477
- }
478
- $requestURI = $_SERVER['REQUEST_URI'];
479
- return $this->startsWith('/'.$slug.'/', $requestURI);
480
- }
481
-
482
- function reloadScript(){
483
- $isAdmin = false;
484
- if(defined('WP_ADMIN') && WP_ADMIN == 1){
485
- $isAdmin = true;
486
- }
487
- if($isAdmin || $this->WPSPluginIsLoginPage()){
488
- $this->agca_enqueue_scripts();
489
- }
490
- }
491
-
492
- function agca_register_settings() {
493
- register_setting( 'agca-options-group', 'agca_role_allbutadmin' );
494
- register_setting( 'agca-options-group', 'agca_screen_options_menu' );
495
- register_setting( 'agca-options-group', 'agca_help_menu' );
496
- register_setting( 'agca-options-group', 'agca_logout' );
497
- register_setting( 'agca-options-group', 'agca_remove_your_profile' );
498
- register_setting( 'agca-options-group', 'agca_logout_only' );
499
- register_setting( 'agca-options-group', 'agca_custom_title' );
500
- register_setting( 'agca-options-group', 'agca_howdy' );
501
- register_setting( 'agca-options-group', 'agca_header' );
502
- register_setting( 'agca-options-group', 'agca_header_show_logout' );
503
- register_setting( 'agca-options-group', 'agca_footer' );
504
- register_setting( 'agca-options-group', 'agca_privacy_options' );
505
- register_setting( 'agca-options-group', 'agca_header_logo' );
506
- register_setting( 'agca-options-group', 'agca_header_logo_custom' );
507
- register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
508
- register_setting( 'agca-options-group', 'agca_remove_site_link' );
509
- register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
510
- register_setting( 'agca-options-group', 'agca_profile_color_scheme' );
511
-
512
- register_setting( 'agca-options-group', 'agca_site_heading' );
513
- register_setting( 'agca-options-group', 'agca_custom_site_heading' );
514
- register_setting( 'agca-options-group', 'agca_update_bar' );
515
-
516
- register_setting( 'agca-options-group', 'agca_footer_left' );
517
- register_setting( 'agca-options-group', 'agca_footer_left_hide' );
518
- register_setting( 'agca-options-group', 'agca_footer_right' );
519
- register_setting( 'agca-options-group', 'agca_footer_right_hide' );
520
-
521
- register_setting( 'agca-options-group', 'agca_login_banner' );
522
- register_setting( 'agca-options-group', 'agca_login_banner_text' );
523
- register_setting( 'agca-options-group', 'agca_login_photo_remove' );
524
- register_setting( 'agca-options-group', 'agca_login_photo_url' );
525
- register_setting( 'agca-options-group', 'agca_login_photo_href' );
526
- register_setting( 'agca-options-group', 'agca_login_round_box' );
527
- register_setting( 'agca-options-group', 'agca_login_round_box_size' );
528
-
529
- register_setting( 'agca-options-group', 'agca_dashboard_icon' );
530
- register_setting( 'agca-options-group', 'agca_dashboard_text' );
531
- register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
532
- register_setting( 'agca-options-group', 'agca_dashboard_widget_welcome' );
533
- register_setting( 'agca-options-group', 'agca_dashboard_widget_activity' );
534
- register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
535
- register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
536
- register_setting( 'agca-options-group', 'agca_dashboard_widget_qp' );
537
- register_setting( 'agca-options-group', 'agca_dashboard_widget_rn' );
538
- register_setting( 'agca-options-group', 'agca_dashboard_widget_rd' );
539
- register_setting( 'agca-options-group', 'agca_dashboard_widget_primary' );
540
- register_setting( 'agca-options-group', 'agca_dashboard_widget_secondary' );
541
-
542
- //WP3.3
543
- register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
544
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
545
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_post' );
546
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_link' );
547
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_page' );
548
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_user' );
549
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_media' );
550
- register_setting( 'agca-options-group', 'agca_admin_bar_update_notifications' );
551
- register_setting( 'agca-options-group', 'agca_admin_bar_admin_themes' );
552
- register_setting( 'agca-options-group', 'agca_remove_top_bar_dropdowns' );
553
- register_setting( 'agca-options-group', 'agca_admin_bar_frontend' );
554
- register_setting( 'agca-options-group', 'agca_admin_bar_frontend_hide' );
555
- register_setting( 'agca-options-group', 'agca_login_register_remove' );
556
- register_setting( 'agca-options-group', 'agca_login_register_href' );
557
- register_setting( 'agca-options-group', 'agca_login_lostpassword_remove' );
558
- register_setting( 'agca-options-group', 'agca_admin_capability' );
559
- register_setting( 'agca-options-group', 'agca_disablewarning' );
560
- register_setting( 'agca-template-group', 'agca_selected_template' );
561
- register_setting( 'agca-template-group', 'agca_templates' );
562
- //delete_option( 'agca_templates' );
563
-
564
-
565
- /*Admin menu*/
566
- register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
567
- register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
568
- register_setting( 'agca-options-group', 'agca_admin_menu_separators' );
569
- register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
570
- register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
571
- register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
572
- register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round' );
573
- register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round_size' );
574
- register_setting( 'agca-options-group', 'agca_admin_menu_brand' );
575
- register_setting( 'agca-options-group', 'agca_admin_menu_brand_link' );
576
- register_setting( 'agca-options-group', 'agca_admin_menu_autofold' );
577
- register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
578
- register_setting( 'agca-options-group', 'ag_edit_adminmenu_json_new' );
579
- register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
580
- register_setting( 'agca-options-group', 'ag_colorizer_json' );
581
- register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
582
-
583
- register_setting( 'agca-options-group', 'agca_custom_js' );
584
- register_setting( 'agca-options-group', 'agca_custom_css' );
585
- register_setting( 'agca-options-group', 'agca_disable_postver' );
586
- register_setting( 'agca-options-group', 'agca_menu_remove_client_profile' );
587
- register_setting( 'agca-options-group', 'agca_menu_remove_customize_button' );
588
-
589
-
590
- if(!empty($_POST)){
591
- if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
592
- $this->verifyPostRequest();
593
- if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
594
- if($_FILES["settings_import_file"]["error"] > 0){
595
- }else{
596
- $file = $_FILES['settings_import_file'];
597
- if($this->startsWith($file['name'],'AGCA_Settings')){
598
- if (file_exists($file['tmp_name'])) {
599
- $fh = fopen($file['tmp_name'], 'r');
600
- $theData = "";
601
- if(filesize($file['tmp_name']) > 0){
602
- $theData = fread($fh,filesize($file['tmp_name']));
603
- }
604
- fclose($fh);
605
- $this->importSettings($theData);
606
- }
607
- }
608
- }
609
- }
610
- }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
611
- $this->verifyPostRequest();
612
- $this->exportSettings();
613
- }
614
- }
615
-
616
- if(isset($_GET['agca_action'])){
617
- if($_GET['agca_action'] == "disablewarning"){
618
- update_option('agca_disablewarning', true);
619
- }
620
- }
621
- }
622
-
623
- function agca_deactivate() {
624
-
625
- }
626
-
627
- function getOptions(){
628
- return Array(
629
- 'agca_role_allbutadmin',
630
- 'agca_admin_bar_frontend',
631
- 'agca_admin_bar_frontend_hide',
632
- 'agca_login_register_remove',
633
- 'agca_login_register_href',
634
- 'agca_login_lostpassword_remove',
635
- 'agca_admin_capability',
636
- 'agca_screen_options_menu',
637
- 'agca_help_menu',
638
- 'agca_logout',
639
- 'agca_remove_your_profile',
640
- 'agca_logout_only',
641
- 'agca_custom_title',
642
- 'agca_howdy',
643
- 'agca_header',
644
- 'agca_header_show_logout',
645
- 'agca_footer',
646
- 'agca_privacy_options',
647
- 'agca_header_logo',
648
- 'agca_header_logo_custom',
649
- 'agca_remove_site_link',
650
- 'agca_wp_logo_custom',
651
- 'agca_wp_logo_custom_link',
652
- 'agca_profile_color_scheme',
653
- 'agca_site_heading',
654
- 'agca_custom_site_heading',
655
- 'agca_update_bar',
656
- 'agca_footer_left',
657
- 'agca_footer_left_hide',
658
- 'agca_footer_right',
659
- 'agca_footer_right_hide',
660
- 'agca_login_banner',
661
- 'agca_login_banner_text',
662
- 'agca_login_photo_remove',
663
- 'agca_login_photo_url',
664
- 'agca_login_photo_href',
665
- 'agca_login_round_box',
666
- 'agca_login_round_box_size',
667
- 'agca_dashboard_icon',
668
- 'agca_dashboard_text',
669
- 'agca_dashboard_text_paragraph',
670
- 'agca_dashboard_widget_welcome',
671
- 'agca_dashboard_widget_activity',
672
- 'agca_dashboard_widget_il',
673
- 'agca_dashboard_widget_plugins',
674
- 'agca_dashboard_widget_qp',
675
- 'agca_dashboard_widget_rn',
676
- 'agca_dashboard_widget_rd',
677
- 'agca_dashboard_widget_primary',
678
- 'agca_dashboard_widget_secondary',
679
- 'agca_admin_bar_comments',
680
- 'agca_admin_bar_new_content',
681
- 'agca_admin_bar_new_content_post',
682
- 'agca_admin_bar_new_content_link',
683
- 'agca_admin_bar_new_content_page',
684
- 'agca_admin_bar_new_content_user',
685
- 'agca_admin_bar_new_content_media',
686
- 'agca_admin_bar_update_notifications',
687
- 'agca_admin_bar_admin_themes',
688
- 'agca_remove_top_bar_dropdowns',
689
- 'agca_admin_menu_turnonoff',
690
- 'agca_admin_menu_agca_button_only',
691
- 'agca_admin_menu_separators',
692
- 'agca_admin_menu_icons',
693
- 'agca_admin_menu_arrow',
694
- 'agca_admin_menu_submenu_round',
695
- 'agca_admin_menu_submenu_round_size',
696
- 'agca_admin_menu_brand',
697
- 'agca_admin_menu_brand_link',
698
- 'agca_admin_menu_autofold',
699
- 'agca_admin_menu_collapse_button',
700
- 'ag_edit_adminmenu_json',
701
- 'ag_edit_adminmenu_json_new',
702
- 'ag_add_adminmenu_json',
703
- 'ag_colorizer_json',
704
- 'agca_colorizer_turnonof',
705
- 'agca_custom_js',
706
- 'agca_custom_css',
707
- 'agca_colorizer_turnonoff',
708
- 'agca_disablewarning',
709
- 'agca_disable_postver',
710
- 'agca_menu_remove_client_profile',
711
- 'agca_menu_remove_customize_button',
712
- 'agca_selected_template',
713
- 'agca_templates',
714
- );
715
- }
716
-
717
- function getTextEditor($name){
718
- $settings = array(
719
- 'textarea_name' => $name,
720
- 'media_buttons' => true,
721
- 'tinymce' => array(
722
- 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
723
- 'bullist,blockquote,|,justifyleft,justifycenter' .
724
- ',justifyright,justifyfull,|,link,unlink,|' .
725
- ',spellchecker,wp_fullscreen,wp_adv'
726
- )
727
- );
728
- wp_editor( get_option($name), $name, $settings );
729
- }
730
-
731
- function importSettings($settings){
732
- $exploaded = explode("|^|^|", $settings);
733
- // $str = "EEE: ";
734
- $str = '';
735
-
736
- $savedOptions = array();
737
-
738
- foreach ($exploaded as $setting){
739
-
740
- $key = current(explode(':', $setting));
741
- $value = substr($setting, strlen($key)+1);
742
- $cleanedValue = str_replace('|^|^|','',$value);
743
- $savedOptions[$key] = $cleanedValue;
744
- }
745
-
746
- // print_r($savedOptions);
747
-
748
- $optionNames = $this->getOptions();
749
-
750
- foreach ($optionNames as $optionName){
751
- $optionValue = "";
752
- $optionValue = $savedOptions[$optionName];
753
-
754
- if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
755
- $optionValue = str_replace("\\\"", "\"", $optionValue);
756
- $optionValue = str_replace("\\\'", "\'", $optionValue);
757
- }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
758
- //fb($optionValue);
759
- $optionValue = htmlspecialchars_decode($optionValue);
760
- $optionValue = str_replace("\'", '"', $optionValue);
761
- $optionValue = str_replace('\"', "'", $optionValue);
762
- //fb($optionValue);
763
- }else{
764
-
765
- }
766
- update_option($optionName, $optionValue);
767
- $str.="/".$optionName."/".$optionValue."\n";
768
- }
769
-
770
- //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
771
- //agca_script_css
772
- //
773
- // fb($savedOptions);
774
- if($savedOptions['agca_script_css'] != null){
775
- $optionValue = "";
776
- $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
777
- $optionValue = str_replace('\"', "'", $optionValue);
778
- update_option('agca_custom_css', $optionValue);
779
- }
780
- if($savedOptions['agca_script_js'] != null){
781
- $optionValue = "";
782
- $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
783
- $optionValue = str_replace('\"', "'", $optionValue);
784
- update_option('agca_custom_js', $optionValue);
785
- }
786
-
787
- //echo $str;
788
-
789
- //save imported settings
790
- $this->saveAfterImport = true;
791
- }
792
-
793
- function exportSettings(){
794
- $str = "";
795
-
796
- $include_menu_settings = false;
797
- if(isset($_POST['export_settings_include_admin_menu'])){
798
- if($_POST['export_settings_include_admin_menu'] == 'on'){
799
- $include_menu_settings = true;
800
- }
801
- }
802
-
803
- foreach ($_POST as $key => $value) {
804
- if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
805
- if($this->startsWith($key,'ag_edit_adminmenu')){
806
- if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
807
- }else{
808
- $str .=$key. ":".$value."|^|^|";
809
- }
810
- }
811
- }
812
-
813
- $filename = __('AGCA_Settings', 'ag-custom-admin').'_'.date("Y-M-d_H-i-s").'.agca';
814
- header("Cache-Control: public");
815
- header("Content-Description: File Transfer");
816
- header("Content-Disposition: attachment; filename=$filename");
817
- header("Content-Type: text/plain; ");
818
- header("Content-Transfer-Encoding: binary");
819
- echo $str;
820
- die();
821
- }
822
-
823
- function startsWith($haystack, $needle)
824
- {
825
- $length = strlen($needle);
826
- return (substr($haystack, 0, $length) === $needle);
827
- }
828
-
829
-
830
-
831
- function agca_create_menu() {
832
- add_management_page('AGCA', 'AGCA', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
833
- }
834
-
835
- function agca_create_admin_button($name,$arr) {
836
-
837
- $href = $arr["value"];
838
- $target =$arr["target"];
839
- $button ="<li class=\"wp-not-current-submenu menu-top menu-top-last\" id=\"menu-$name\"><a href=\"$href\" target=\"$target\" class=\"wp-not-current-submenu menu-top\"><div class=\"wp-menu-arrow\"><div></div></div><div class=\"wp-menu-image dashicons-before dashicons-admin-$name\" style=\"width:15px\"><br></div><div class=\"wp-menu-name\">$name</div></a></li>";
840
-
841
- return $button;
842
- }
843
- function agca_decode($code){
844
- $code = str_replace("{","",$code);
845
- $code = str_replace("}","",$code);
846
- $code = str_replace("\", \"","\"|||\"",$code);
847
- $elements = explode("|||",$code);
848
-
849
- return $elements;
850
- }
851
-
852
- function jsonMenuArray($json,$type){
853
- $arr = explode("|",$json);
854
- $elements = "";
855
- $array ="";
856
- $first = true;
857
- //print_r($json);
858
- if($type == "colorizer"){
859
- $elements = json_decode($arr[0],true);
860
- if($elements !=""){
861
- return $elements;
862
- }
863
- }else if($type == "buttons"){
864
- $elements = json_decode($arr[0],true);
865
- if($elements !=""){
866
- foreach($elements as $k => $v){
867
- $array.=$this->agca_create_admin_button($k,$v);
868
- }
869
- }
870
- }else if($type == "buttonsJq"){
871
- $elements = json_decode($arr[0],true);
872
- if($elements !=""){
873
- foreach($elements as $k => $v){
874
- $array.='<tr><td colspan="2"><button target="'.$v['target'].'" title="'.$v['value'].'" type="button">'.$k.'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>';
875
- }
876
- }
877
- }else{
878
- if(isset($arr[$type])){
879
- $elements = $this->agca_decode($arr[$type]);
880
- }
881
-
882
- if($elements !=""){
883
- foreach($elements as $element){
884
- if(!$first){
885
- $array .=",";
886
- }
887
- $parts = explode(" : ",$element);
888
- if(isset($parts[0]) && isset($parts[1])){
889
- $array.="[".$parts[0].", ".$parts[1]."]";
890
- }
891
- $first=false;
892
- }
893
- }
894
- }
895
-
896
- return $array;
897
- }
898
-
899
- function remove_dashboard_widget($widget,$side)
900
- {
901
- //side can be 'normal' or 'side'
902
- global $wp_meta_boxes;
903
- remove_meta_box($widget, 'dashboard', $side);
904
- }
905
-
906
- function get_wp_version(){
907
- global $wp_version;
908
- $array = explode('-', $wp_version);
909
- $version = $array[0];
910
- return $version;
911
- }
912
-
913
- function print_page()
914
- {
915
- if($this->isGuest() && get_option('agca_admin_bar_frontend_hide') or $this->isCusminActive()){
916
- return false;
917
- }
918
- if(!$this->isGuest()){
919
- ?><style type="text/css">
920
- <?php
921
- echo get_option('agca_custom_css');
922
- if(get_option('agca_menu_remove_customize_button')){
923
- echo '#wp-admin-bar-customize{display:none;}';
924
- }
925
- ?>
926
- </style><?php
927
- }
928
-
929
- if(get_option('agca_admin_bar_frontend_hide')==true){
930
- add_filter( 'show_admin_bar', '__return_false' );
931
- ?>
932
- <style type="text/css">
933
- #wpadminbar{
934
- display: none;
935
- }
936
- </style>
937
- <script type="text/javascript">
938
- window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
939
- </script>
940
- <?php
941
- }
942
- if(get_option('agca_admin_bar_frontend')!=true && is_user_logged_in()){
943
-
944
- $this->context = "page";
945
- //$wpversion = $this->get_wp_version();
946
- ?>
947
- <script type="text/javascript">
948
- var agca_version = "<?php echo $this->agca_version; ?>";
949
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
950
- var jQueryScriptOutputted = false;
951
- var agca_context = "page";
952
- var agca_orig_admin_menu = [];
953
- function initJQuery() {
954
- //if the jQuery object isn't available
955
- if (typeof(jQuery) == 'undefined') {
956
- if (! jQueryScriptOutputted) {
957
- //only output the script once..
958
- jQueryScriptOutputted = true;
959
- //output the script (load it from google api)
960
- document.write("<scr" + "ipt type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js\"></scr" + "ipt>");
961
- }
962
- setTimeout("initJQuery()", 50);
963
- } else {
964
- jQuery(function() {
965
- try
966
- {
967
- <?php if(get_option('agca_header')!=true){ ?>
968
- jQuery('#wpadminbar').show();
969
- <?php } ?>
970
-
971
- <?php $this->print_admin_bar_scripts(); ?>
972
- }catch(ex){}
973
- });
974
- }
975
- }
976
- initJQuery();
977
- </script>
978
- <script type="text/javascript">
979
- <?php echo "var agca_global_plugin_url = '".$this->pluginUrl()."';"; ?>
980
- </script>
981
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
982
- <script type="text/javascript">
983
- jQuery(document).ready(function(){
984
- <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
985
- foreach($this->colorizer as $k => $v){
986
- if(($k !="") and ($v !="")){
987
- if(
988
- $k == "color_header" ||
989
- $k == "color_font_header"
990
- ){
991
- ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
992
- }
993
-
994
- }
995
- }
996
- ?>
997
-
998
- <?php
999
- }
1000
- ?>
1001
- });
1002
- </script>
1003
- <?php
1004
- }
1005
-
1006
- }
1007
-
1008
- function print_admin_bar_scripts(){
1009
- ?>
1010
- <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
1011
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
1012
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
1013
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
1014
-
1015
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1016
- jQuery(".new_content_header_submenu").hide();
1017
- <?php } ?>
1018
-
1019
- <?php } ?>
1020
-
1021
- <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
1022
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
1023
- <?php } ?>
1024
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1025
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
1026
- <?php } ?>
1027
- <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
1028
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
1029
- <?php } ?>
1030
- <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
1031
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
1032
- <?php } ?>
1033
- <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
1034
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
1035
- <?php } ?>
1036
- <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
1037
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
1038
- <?php } ?>
1039
- <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
1040
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
1041
- <?php } ?>
1042
- <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
1043
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
1044
- <?php } ?>
1045
- <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
1046
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
1047
- <?php } ?>
1048
-
1049
-
1050
-
1051
- <?php if(get_option('agca_header_logo')==true){ ?>
1052
- jQuery("#wphead #header-logo").css("display","none");
1053
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
1054
-
1055
- <?php } ?>
1056
- <?php if(get_option('agca_header_logo_custom')!=""){ ?>
1057
-
1058
- var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
1059
-
1060
- advanced_url = img_url;
1061
- image = jQuery("<img id=\"admin-top-branding-logo\" style='max-width:98%;position:relative;'/>").attr("src",advanced_url);
1062
- jQuery(image).load(function() {
1063
- jQuery("#wpbody-content").prepend(image);
1064
- });
1065
-
1066
- <?php } ?>
1067
- <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
1068
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon")
1069
- .html("<img style=\"height:32px;margin-top:0\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />")
1070
- .css('background-image','none')
1071
- .css('width','auto');
1072
- jQuery("li#wp-admin-bar-wp-logo > a.ab-item")
1073
- .attr('href',"<?php echo get_bloginfo('wpurl'); ?>")
1074
- .css('padding', 0);
1075
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
1076
- jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
1077
- jQuery("#wp-admin-bar-wp-logo").show();
1078
- <?php }?>
1079
- <?php if(get_option('agca_remove_site_link')==true){ ?>
1080
- jQuery("#wp-admin-bar-site-name").css("display","none");
1081
-
1082
- <?php } ?>
1083
- <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
1084
- var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
1085
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1086
- if(href == "%SWITCH%"){
1087
- href = "<?php echo get_bloginfo('wpurl'); ?>";
1088
- <?php if($this->context == "page"){
1089
- ?>href+="/wp-admin";<?php
1090
- }
1091
- ?>
1092
- }
1093
- jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
1094
-
1095
- <?php }?>
1096
- <?php if(get_option('agca_site_heading')==true){ ?>
1097
- jQuery("#wphead #site-heading").css("display","none");
1098
- <?php } ?>
1099
- <?php if(get_option('agca_custom_site_heading')!=""){ ?>
1100
- jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
1101
- jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
1102
-
1103
- <?php } ?>
1104
- <?php if(get_option('agca_header')==true && $this->context =='admin'){
1105
- ?>
1106
- jQuery("#wpadminbar").css("display","none");
1107
- jQuery("body.admin-bar").css("padding-top","0");
1108
- jQuery("#wphead").css("display","none");
1109
- jQuery('html.wp-toolbar').css("padding-top","0");
1110
-
1111
- <?php } ?>
1112
- <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
1113
- <?php
1114
- $agca_logout_text = ((get_option('agca_logout')=="")?__("Log Out", 'ag-custom-admin'):get_option('agca_logout'));
1115
- ?>
1116
- jQuery("#wpbody-content").prepend('<a href="<?php echo wp_logout_url(); ?>" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
1117
-
1118
-
1119
- <?php } ?>
1120
- <?php
1121
- if(get_option('agca_custom_title')!=""){
1122
- //add_filter('admin_title', '$this->change_title', 10, 2);
1123
-
1124
- }
1125
- ?>
1126
- <?php if(get_option('agca_logout')!=""){ ?>
1127
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1128
- <?php } ?>
1129
- <?php if(get_option('agca_remove_your_profile')==true){ ?>
1130
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1131
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1132
- jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1133
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1134
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1135
- <?php } ?>
1136
- <?php if(get_option('agca_logout_only')==true){ ?>
1137
- var logout_content = jQuery("li#wp-admin-bar-logout").html();
1138
- jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout" style="display:block;">'+ logout_content +'</li>');
1139
- jQuery("#wp-admin-bar-logout a").css('padding','0 8px');
1140
-
1141
-
1142
- <?php } ?>
1143
-
1144
- <?php
1145
-
1146
-
1147
- }
1148
-
1149
- function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
1150
- if(get_option('agca_howdy')!=""){
1151
- $user_id = get_current_user_id();
1152
- $current_user = wp_get_current_user();
1153
- $profile_url = get_edit_profile_url( $user_id );
1154
-
1155
- if ( 0 != $user_id ) {
1156
- /* Add the "My Account" menu */
1157
- $avatar = get_avatar( $user_id, 28 );
1158
- $howdy = sprintf( __(get_option('agca_howdy').', %1$s'), $current_user->display_name );
1159
- $class = empty( $avatar ) ? '' : 'with-avatar';
1160
-
1161
- $wp_admin_bar->add_menu( array(
1162
- 'id' => 'my-account',
1163
- 'parent' => 'top-secondary',
1164
- 'title' => $howdy . $avatar,
1165
- 'href' => $profile_url,
1166
- 'meta' => array(
1167
- 'class' => $class,
1168
- ),
1169
- ) );
1170
-
1171
- }
1172
- }
1173
- }
1174
-
1175
- function updateAllColors(){
1176
-
1177
- ?>
1178
- function updateAllColors(){
1179
- <?php
1180
- foreach($this->colorizer as $k => $v){
1181
- if(($k !="") and ($v !="")){
1182
- ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1183
- }
1184
- }
1185
- ?>
1186
- jQuery('.color_picker').each(function(){
1187
- updateColor(jQuery(this).attr('id'),jQuery(this).val())
1188
- });
1189
- jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1190
- jQuery('#adminmenu li.wp-menu-open').css('border','none');
1191
- jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1192
- }<?php
1193
-
1194
- }
1195
- function admin_capabilities(){
1196
- global $wp_roles;
1197
- $capabs = $wp_roles->roles['administrator']['capabilities'];
1198
- $capabilitySelector = "";
1199
-
1200
- $selectedValue = get_option('agca_admin_capability');
1201
- if($selectedValue == ""){
1202
- $selectedValue = "edit_dashboard";
1203
- }
1204
- /*echo $selectedValue;
1205
- die;*/
1206
- ksort($capabs);
1207
- foreach($capabs as $k=>$v){
1208
- $selected = "";
1209
- if($this->startsWith($k, 'level_')) continue;
1210
- if($selectedValue == $k){
1211
- $selected = " selected=\"selected\" ";
1212
- }
1213
- $capabilitySelector .="<option value=\"$k\" $selected >".ucwords(str_replace('_', ' ', $k))."</option>\n";
1214
- }
1215
-
1216
- $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
1217
- }
1218
-
1219
- function admin_capability(){
1220
- $selectedValue = get_option('agca_admin_capability');
1221
- if($selectedValue == ""){
1222
- $selectedValue = "edit_dashboard";
1223
- }
1224
- return $selectedValue;
1225
- }
1226
-
1227
- function JSPrintAGCATemplateSettingsVar($settings){
1228
- echo "\n<script type=\"text/javascript\">\n";
1229
- echo "var agca_template_settings = ".preg_replace('#<script(.*?)>(.*?)</script>#is', '', $settings).";\n"; //TODO: think about this
1230
- echo "</script>";
1231
- }
1232
-
1233
- function appendSettingsToAGCATemplateCustomizations($customizations, $settings){
1234
- $template_settings = json_decode($settings);
1235
- //print_r($template_settings);
1236
- foreach($template_settings as $sett){
1237
- $key = $sett->code;
1238
-
1239
- //use default value if user's value is not set
1240
- $value="";
1241
- if($sett->value != ""){
1242
- $value = $sett->value;
1243
- }else{
1244
- $value = $sett->default_value;
1245
- }
1246
-
1247
- //Prepare settings
1248
- if($sett->type == 6){
1249
- if($value !== null && (strtolower($value) == "on" || $value == "1")){
1250
- $value = "true";
1251
- }else{
1252
- $value = "false";
1253
- }
1254
- }
1255
- $customizations = str_replace("%".$key."%",$value, $customizations);
1256
- }
1257
- return $customizations;
1258
- }
1259
-
1260
- function enableSpecificWPVersionCustomizations($customizations){
1261
- /*enable special CSS for this WP version*/
1262
- $ver = $this->get_wp_version();
1263
- $customizations = str_replace("/*".$ver," ", $customizations);
1264
- $customizations = str_replace($ver."*/"," ", $customizations);
1265
- return $customizations;
1266
- }
1267
-
1268
- function removeCSSComments($customizations){
1269
- $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
1270
- return $customizations;
1271
- }
1272
-
1273
- function prepareAGCAAdminTemplates(){
1274
- if(get_option( 'agca_templates' ) != ""){
1275
- //print_r(get_option( 'agca_templates' ));
1276
- $themes = get_option( 'agca_templates' );
1277
- $selectedTheme = get_option('agca_selected_template');
1278
- if(isset($themes[$selectedTheme])){
1279
- $theme = $themes[$selectedTheme];
1280
- add_filter('get_user_option_admin_color', array(&$this,'change_admin_color'));
1281
-
1282
- echo (stripslashes($theme['common']));
1283
- echo "<!--AGCAIMAGES: ".$theme['images']."-->";
1284
-
1285
- //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1286
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
1287
- if($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
1288
- //print_r($templdata);
1289
-
1290
- $this->JSPrintAGCATemplateSettingsVar($theme['settings']);
1291
-
1292
- $admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
1293
- $admindata = $this->enableSpecificWPVersionCustomizations($admindata);
1294
- $admindata = $this->removeCSSComments($admindata);
1295
-
1296
- //echo $admindata;
1297
- //REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
1298
- $this->templateCustomizations = $admindata;
1299
- }
1300
- //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1301
- }
1302
- }
1303
- }
1304
-
1305
- function agcaAdminSession(){
1306
- $agcaTemplatesSession = array();
1307
-
1308
- //session_destroy();
1309
- //session_unset();
1310
-
1311
- /*if(!session_id()){
1312
- session_start();
1313
- }*/
1314
-
1315
- if(!isset($_SESSION["AGCA"])){
1316
- $_SESSION["AGCA"] = array();
1317
- $_SESSION["AGCA"]["Templates"] = array();
1318
- }
1319
- //print_r($_SESSION);
1320
-
1321
- if(isset($_SESSION["AGCA"])){
1322
- if(isset($_SESSION["AGCA"]["Templates"])){
1323
- //print_r($_SESSION["AGCA"]["Templates"]);
1324
- $agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
1325
- }
1326
- }
1327
-
1328
-
1329
- if($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"'){
1330
- $agcaTemplatesSession = array();
1331
- }
1332
-
1333
-
1334
- return $agcaTemplatesSession;
1335
-
1336
- }
1337
-
1338
- function getAGCAColor($name){
1339
- if(isset($this->colorizer[$name])){
1340
- echo htmlspecialchars($this->colorizer[$name]);
1341
- }
1342
- }
1343
-
1344
- function prepareAGCALoginTemplates(){
1345
- if(get_option( 'agca_templates' ) != ""){
1346
- //print_r(get_option( 'agca_templates' ));
1347
- $templates = get_option( 'agca_templates' );
1348
- foreach($templates as $templname=>$templdata){
1349
- if($templname == get_option('agca_selected_template')){
1350
- echo (stripslashes($templdata['common']));
1351
-
1352
- if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
1353
- $this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
1354
-
1355
- $logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
1356
- $logindata = $this->enableSpecificWPVersionCustomizations($logindata);
1357
- $logindata = $this->removeCSSComments($logindata);
1358
-
1359
- echo($logindata);
1360
- break;
1361
- }
1362
- }
1363
- }
1364
- }
1365
-
1366
- function agca_error_check(){
1367
- ?>
1368
- <script type="text/javascript">
1369
- function AGCAErrorPage(msg, url, line){
1370
- var agca_error_details = "___________________________________________________<br/>";
1371
- agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1372
- agca_error_details += "___________________________________________________<br/>";
1373
- window.agca_error_details_text = agca_error_details + '<br/><?php _e('This JavaScript error can stop AGCA plugin to work properly. If everything still works, you can ignore this notification.', 'ag-custom-admin'); ?> <br/><br/><?php _e('Possible solutions', 'ag-custom-admin'); ?>:<br/><br/>1) <?php _e('Make sure to have everything up to date: WordPress site, plugins and themes.', 'ag-custom-admin'); ?><br/><br/>2) <?php _e('Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.', 'ag-custom-admin'); ?><br/><br/>3) <?php _e('Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.', 'ag-custom-admin'); ?><br/><br/>4) <?php _e('If it\\\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support.', 'ag-custom-admin'); ?> <br/><br/>5) <?php _e('Try activating default WordPress theme instead of your current theme.', 'ag-custom-admin'); ?><br/><br/>6) <?php _e('Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.', 'ag-custom-admin') ?><br/><br/>7) <?php _e('Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AGCA plugin, or something unexpected happens, please report that on our', 'ag-custom-admin'); ?> <a href="https://wordpress.org/support/plugin/ag-custom-admin/" target="_blank"><?php _e('SUPPORT PAGE', 'ag-custom-admin'); ?></a>';
1374
- document.getElementsByTagName('html')[0].style.visibility = "visible";
1375
- var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
1376
- <?php _e('AGCA plugin caught an error on your site!', 'ag-custom-admin'); ?>&nbsp;<a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(<?php _e('show/hide more...', 'ag-custom-admin'); ?>)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">'+agca_error_details_text+'</div></div>';
1377
-
1378
- var ph = document.getElementById('agca_error_placeholder');
1379
- ph.innerHTML = errorDivHtml;
1380
- document.getElementById('agca_news').style.visibility = "hidden";
1381
- }
1382
- window.onerror = function(msg, url, line) {
1383
- window.onload = function() {
1384
- AGCAErrorPage(msg, url, line);
1385
- }
1386
- return true;
1387
- };
1388
- </script>
1389
- <?php
1390
- }
1391
- function error_check(){
1392
- ?>
1393
- <script type="text/javascript">
1394
- function AGCAErrorOtherPages(msg, url, line){
1395
- var agca_error_details = "___________________________________________________\n";
1396
- agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
1397
-
1398
- document.getElementsByTagName('html')[0].style.visibility = "visible";
1399
-
1400
- if(typeof window.console === "object"){
1401
- console.log("___________________________________________________");
1402
- console.log("<?php _e('AGCA plugin caught a JavaScript on your site', 'ag-custom-admin'); ?>:");
1403
- console.log(agca_error_details);
1404
- }
1405
- }
1406
- window.onerror = function(msg, url, line) {
1407
- window.onload = function() {
1408
- AGCAErrorOtherPages(msg, url, line);
1409
- }
1410
- return true;
1411
- };
1412
- </script>
1413
- <?php
1414
- }
1415
-
1416
- function menu_item_cleartext($name){
1417
- if(strpos($name,' <span') !== false){
1418
- $parts = explode(' <span', $name);
1419
- $name = $parts[0];
1420
- }
1421
- $name = trim($name);
1422
- return $name;
1423
- }
1424
-
1425
- /**
1426
- * Loops through all original menu items, and creates customizations array
1427
- * applies previous customizations if set
1428
- * @return array|mixed|object
1429
- */
1430
- function get_menu_customizations(){
1431
- global $menu;
1432
- global $submenu;
1433
-
1434
- //var_dump($menu); die;
1435
- $previousCustomizations = json_decode(get_option('ag_edit_adminmenu_json_new'), true);
1436
-
1437
- $customizationsSet = true;
1438
- if($previousCustomizations == null){
1439
- $customizationsSet = false;
1440
- }
1441
-
1442
- //set default menu configuration
1443
- //and apply previously saved customizations
1444
- $m = array();
1445
- foreach($menu as $top){
1446
- $name = $top[0];
1447
- $url = $top[2];
1448
- $cls = isset($top[5])?$top[5]:"";
1449
- $remove = false;
1450
- if($name == '') continue;
1451
- $pc = null;
1452
- $name = $this->menu_item_cleartext($name);
1453
-
1454
- //apply previous submenu customizations
1455
- if($customizationsSet && isset($previousCustomizations[$url])){
1456
- $pc = $previousCustomizations[$url];
1457
- }
1458
-
1459
- //get submenu
1460
- $s = array();
1461
- if(isset($submenu[$url])){
1462
- $sitems = $submenu[$url];
1463
- foreach($sitems as $key=>$sub){
1464
- $nameSub = $sub[0];
1465
- $urlSub = $sub[2];
1466
- $removeSub = false;
1467
- $nameSub = $this->menu_item_cleartext($nameSub);
1468
- $s[$key]=array(
1469
- 'name'=>$nameSub,
1470
- 'new'=>'',
1471
- 'remove'=>$removeSub,
1472
- 'url'=>$urlSub
1473
- );
1474
-
1475
- if(isset($pc['submenus'][$key])){
1476
- $s[$key]['new'] = $pc['submenus'][$key]['new'];
1477
- $s[$key]['remove'] = $pc['submenus'][$key]['remove'];
1478
-
1479
- if($s[$key]['new'] == null){
1480
- $s[$key]['new'] = '';
1481
- }
1482
- if($s[$key]['remove'] == null){
1483
- $s[$key]['remove'] = false;
1484
- }
1485
- }
1486
- }
1487
- }
1488
-
1489
- $m[$url]=array(
1490
- 'name'=>$name,
1491
- 'remove'=>$remove,
1492
- 'new'=>'',
1493
- 'url'=>$url,
1494
- 'cls'=>$cls,
1495
- 'submenus'=>$s
1496
- );
1497
-
1498
- //apply previous top menu customizations
1499
- if($customizationsSet && isset($previousCustomizations[$url])){
1500
- $pc = $previousCustomizations[$url];
1501
- if(isset($pc)){
1502
- $m[$url]['remove'] = $pc['remove'];
1503
- $m[$url]['new'] = $pc['new'];
1504
- }
1505
- }
1506
- }
1507
- return $m;
1508
- }
1509
-
1510
- /**
1511
- * Applies customizations to admin menu
1512
- */
1513
- function customized_menu(){
1514
- $customizations = $this->get_menu_customizations();
1515
- global $menu;
1516
- global $submenu;
1517
-
1518
- //print_r($submenu);die;
1519
- //apply customizations to original admin menu
1520
- foreach($menu as $key=>$top){
1521
- $url = $top[2];
1522
- if(isset($customizations[$url])){
1523
- $topCustomized = $customizations[$url];
1524
- if($topCustomized['new']) {
1525
- $menu[$key][0] = $topCustomized['new'];
1526
- }
1527
- if($topCustomized['remove']){
1528
- unset($menu[$key]);
1529
- }
1530
- }
1531
- }
1532
- foreach($submenu as $topkey=>$subs){
1533
- foreach($subs as $subkey=>$sub){
1534
- if(isset($customizations[$topkey]['submenus'][$subkey])){
1535
- $cs = $customizations[$topkey]['submenus'][$subkey];
1536
- if($cs['new']) {
1537
- $submenu[$topkey][$subkey][0] = preg_replace("/".$cs['name']."/",$cs['new'], $submenu[$topkey][$subkey][0],1);
1538
- }
1539
- if($cs['remove']){
1540
- unset($submenu[$topkey][$subkey]);
1541
- }
1542
- }
1543
- }
1544
- }
1545
- }
1546
-
1547
- /**
1548
- * Used only for removing admin menu customizations to AGCA 1.5 version or later
1549
- * @param $checkboxes
1550
- * @param $textboxes
1551
- */
1552
- function migrate_menu_customizations($checkboxes, $textboxes){
1553
- $customizations = $this->get_menu_customizations();
1554
- global $menu;
1555
- /*print_r($menu);
1556
- print_r($customizations);
1557
- print_r($textboxes);*/
1558
-
1559
- $oldTopValue = "";
1560
-
1561
-
1562
- //Migrate checkboxes
1563
- foreach($checkboxes as $key=>$value){
1564
- $isTop = false;
1565
- $oldSubValue = "";
1566
- if (strpos($key,'<-TOP->') !== false) {
1567
- $oldTopValue = str_replace('<-TOP->','',$key);
1568
- $isTop = true;
1569
- }else{
1570
- $oldSubValue = $key;
1571
- }
1572
- if($value == 'checked'){
1573
- $topIndex = "";
1574
- foreach($customizations as $k=>$c){
1575
- if($c['cls'] == $oldTopValue){
1576
- $topIndex = $k;
1577
- break;
1578
- }
1579
- }
1580
- if($topIndex == "") continue;
1581
- if($isTop){
1582
- $customizations[$topIndex]['remove'] = true;
1583
- }else{
1584
- if(is_array($customizations[$topIndex]['submenus'])){
1585
- foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1586
- if($sval['name'] == $oldSubValue){
1587
- $customizations[$topIndex]['submenus'][$skey]['remove'] = true;
1588
- }
1589
- }
1590
- }
1591
- }
1592
- }
1593
- }
1594
-
1595
- //Migrate textboxes
1596
- foreach($textboxes as $key=>$value){
1597
- $isTop = false;
1598
- $oldSubValue = "";
1599
- if (strpos($key,'<-TOP->') !== false) {
1600
- $oldTopValue = str_replace('<-TOP->','',$key);
1601
- $isTop = true;
1602
- }else{
1603
- $oldSubValue = $key;
1604
- }
1605
- if($value != ''){
1606
- $topIndex = "";
1607
- foreach($customizations as $k=>$c){
1608
- if($c['cls'] == $oldTopValue){
1609
- $topIndex = $k;
1610
- break;
1611
- }
1612
- }
1613
- if($topIndex == "") continue;
1614
- if($isTop){
1615
- $customizations[$topIndex]['new'] = $value;
1616
- }else{
1617
- if(is_array($customizations[$topIndex]['submenus'])){
1618
- foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1619
- if($sval['name'] == $oldSubValue){
1620
- if($customizations[$topIndex]['submenus'][$skey]['name'] != $value){
1621
- $customizations[$topIndex]['submenus'][$skey]['new'] = $value;
1622
- }
1623
- }
1624
- }
1625
- }
1626
- }
1627
- }
1628
- }
1629
- update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1630
- update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1631
- }
1632
- function isCusminActive(){
1633
- return $this->isPluginActive('cusmin/cusmin.php');
1634
- }
1635
- function isPluginActive($plugin){
1636
- if(!is_admin()){
1637
- return false;
1638
- }
1639
- return is_plugin_active($plugin);
1640
- }
1641
- function isPluginActiveForNetwork($plugin){
1642
- return is_plugin_active_for_network($plugin);
1643
- }
1644
- function print_admin_css()
1645
- {
1646
- $agcaTemplateSession = $this->agcaAdminSession();
1647
- $wpversion = $this->get_wp_version();
1648
- $this->context = "admin";
1649
- $this->error_check();
1650
- $currentScreen = get_current_screen();
1651
- ?>
1652
- <script type="text/javascript">
1653
- var wpversion = "<?php echo $wpversion; ?>";
1654
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1655
- var agca_version = "<?php echo $this->agca_version; ?>";
1656
- var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1657
- var errors = false;
1658
- var isSettingsImport = false;
1659
- var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
1660
- var agca_context = "admin";
1661
- var roundedSidberSize = 0;
1662
- var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
1663
- var agca_admin_menu = <?php echo json_encode($this->get_menu_customizations()) ?>;
1664
- var agca_string = {
1665
- file_imp_not_sel: '<?php _e('File for import is not selected!', 'ag-custom-admin'); ?>',
1666
- menu_general: '<?php _e('General', 'ag-custom-admin'); ?>',
1667
- menu_admin_bar: '<?php _e('Admin Bar', 'ag-custom-admin'); ?>',
1668
- menu_footer: '<?php _e('Footer', 'ag-custom-admin'); ?>',
1669
- menu_dashb: '<?php _e('Dashboard', 'ag-custom-admin'); ?>',
1670
- menu_login: '<?php _e('Login Page', 'ag-custom-admin'); ?>',
1671
- menu_admin_menu: '<?php _e('Admin Menu', 'ag-custom-admin'); ?>',
1672
- menu_colorizer: '<?php _e('Colorizer', 'ag-custom-admin'); ?>',
1673
- menu_themes: '<?php _e('Themes', 'ag-custom-admin'); ?>',
1674
- menu_upgrade: '<?php _e('Upgrade', 'ag-custom-admin'); ?>',
1675
- menu_advanced: '<?php _e('Advanced', 'ag-custom-admin'); ?>',
1676
- remove: '<?php _e('Remove', 'ag-custom-admin'); ?>',
1677
- frommenu:'<?php _e('from menu', 'ag-custom-admin'); ?>',
1678
- rename:'<?php _e('Rename', 'ag-custom-admin'); ?>',
1679
- withthisvalue:'<?php _e('with this value', 'ag-custom-admin'); ?>',
1680
- submenuitem:'<?php _e('sub-menu item', 'ag-custom-admin'); ?>',
1681
- open:'<?php _e('open', 'ag-custom-admin'); ?>',
1682
- 'delete':'<?php _e('Delete', 'ag-custom-admin'); ?>',
1683
- 'in':'<?php _e('in', 'ag-custom-admin'); ?>',
1684
- save_changes: '<?php _e('Save changes', 'ag-custom-admin'); ?>'
1685
- };
1686
- </script>
1687
- <?php
1688
- $this->prepareAGCAAdminTemplates();
1689
- $this->agca_get_includes();
1690
- $this->admin_capabilities();
1691
- wp_get_current_user() ;
1692
- ?>
1693
- <?php
1694
- //in case that javaScript is disabled only admin can access admin menu
1695
- if(!current_user_can($this->admin_capability())){
1696
- ?>
1697
- <style type="text/css">
1698
- #adminmenu{display:none;}
1699
- </style>
1700
- <?php
1701
- }
1702
- ?>
1703
- <script type="text/javascript">
1704
- document.write('<style type="text/css">html{visibility:hidden;}</style>');
1705
- <?php
1706
- if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1707
- echo 'isSettingsImport = true;';
1708
- }
1709
- ?>
1710
- </script>
1711
- <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1712
- <style type="text/css">
1713
- .wp-has-current-submenu:after{border:none !important;}
1714
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1715
- </style>
1716
- <?php }
1717
-
1718
- if($currentScreen->id == 'tools_page_ag-custom-admin/plugin'){
1719
- ?>
1720
- <div id="fb-root"></div>
1721
- <script>(function(d, s, id) {
1722
- var js, fjs = d.getElementsByTagName(s)[0];
1723
- if (d.getElementById(id)) return;
1724
- js = d.createElement(s); js.id = id;
1725
- js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=765552763482314";
1726
- fjs.parentNode.insertBefore(js, fjs);
1727
- }(document, 'script', 'facebook-jssdk'));</script>
1728
- <?php
1729
- }
1730
-
1731
- if(get_option('agca_menu_remove_client_profile')){
1732
- remove_menu_page('profile.php');
1733
- }
1734
- ?>
1735
- <script type="text/javascript">
1736
- /* <![CDATA[ */
1737
- jQuery(document).ready(function() {
1738
- try
1739
- {
1740
-
1741
- <?php /*CHECK OTHER PLUGINS*/
1742
- if($this->isPluginActive('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')){
1743
- ?>
1744
- jQuery('ul#adminmenu').css('display','none');
1745
- jQuery('#footer-ozh-oam').css('display','none');
1746
- jQuery('#ag_main_menu li').each(function(){
1747
- if(jQuery(this).text() == "Admin Menu"){
1748
- jQuery(this).hide();
1749
- }
1750
- });
1751
- <?php
1752
- }
1753
- ?>
1754
-
1755
-
1756
- //get saved onfigurations
1757
-
1758
- <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1759
- var buttons = '<?php echo $buttons; ?>';
1760
-
1761
- <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
1762
- var buttonsJq = '<?php echo $buttonsJq; ?>';
1763
-
1764
- createEditMenuPageNew(agca_admin_menu);
1765
- //createEditMenuPageV32(checkboxes, textboxes);
1766
-
1767
- <?php
1768
- //if admin, and option to hide settings for admin is set
1769
- if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability()) or $this->isCusminActive()){
1770
- ?>
1771
- <?php } else{ ?>
1772
- <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1773
- additionalStyles = ' style="margin-bottom:-4px" ';
1774
- jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1775
- <?php } ?>
1776
- <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1777
-
1778
- var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1779
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1780
-
1781
- jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1782
- jQuery("#sidebar_adminmenu_logo").attr('title',href);
1783
-
1784
- <?php }else{ ?>
1785
- href = "<?php echo get_bloginfo('wpurl'); ?>";
1786
- jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1787
- jQuery("#sidebar_adminmenu_logo").attr('title',href);
1788
- <?php } ?>
1789
-
1790
- <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1791
- jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1792
- jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1793
- <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1794
- roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1795
-
1796
-
1797
- <?php } ?>
1798
- <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1799
- jQuery("body").addClass("auto-fold");
1800
- <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1801
- jQuery("body").removeClass("auto-fold");
1802
- <?php } ?>
1803
-
1804
- <?php $this->print_admin_bar_scripts(); ?>
1805
-
1806
- <?php if(get_option('agca_screen_options_menu')==true){ ?>
1807
- jQuery("#screen-options-link-wrap").css("display","none");
1808
- <?php } ?>
1809
- <?php if(get_option('agca_help_menu')==true){ ?>
1810
- jQuery("#contextual-help-link-wrap").css("display","none");
1811
- jQuery("#contextual-help-link").css("display","none");
1812
- <?php } ?>
1813
- <?php if(get_option('agca_privacy_options')==true){ ?>
1814
- jQuery("#privacy-on-link").css("display","none");
1815
- <?php } ?>
1816
-
1817
- <?php if(get_option('agca_update_bar')==true){ ?>
1818
- <?php
1819
- if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1820
- function c2c_no_update_nag() {
1821
- remove_action( 'admin_notices', 'update_nag', 3 );
1822
- }
1823
- endif;
1824
- add_action( 'admin_init', 'c2c_no_update_nag' );
1825
- ?>
1826
- jQuery("#update-nag").css("display","none");
1827
- jQuery(".update-nag").css("display","none");
1828
- <?php } ?>
1829
-
1830
- <?php if(get_option('agca_footer')==true){ ?>
1831
- jQuery("#footer,#wpfooter").css("display","none");
1832
- <?php } ?>
1833
-
1834
- <?php if(get_option('agca_footer_left')!=""){ ?>
1835
- jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1836
- <?php } ?>
1837
- <?php if(get_option('agca_footer_left_hide')==true){ ?>
1838
- jQuery("#footer-left").css("display","none");
1839
- <?php } ?>
1840
- <?php if(get_option('agca_footer_right')!=""){ ?>
1841
- jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1842
- <?php } ?>
1843
- <?php if(get_option('agca_footer_right_hide')==true){ ?>
1844
- jQuery("#footer-upgrade").css("display","none");
1845
- <?php } ?>
1846
-
1847
- <?php if(get_option('agca_language_bar')==true){ ?>
1848
- jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1849
- <?php } ?>
1850
- <?php if(get_option('agca_dashboard_icon')==true){ ?>
1851
- var className = jQuery("#icon-index").attr("class");
1852
- if(className=='icon32'){
1853
- jQuery("#icon-index").attr("id","icon-index-removed");
1854
- }
1855
- <?php } ?>
1856
- <?php if(get_option('agca_dashboard_text')!=""){ ?>
1857
- jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1858
- <?php } ?>
1859
- <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1860
- require_once($this->filePath('wp-includes/formatting.php'));
1861
- ?>
1862
- jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1863
-
1864
- jQuery("#agca_custom_dashboard_content").html('<br /><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(wpautop(do_shortcode(get_option('agca_dashboard_text_paragraph'))))); ?>');
1865
- <?php } ?>
1866
-
1867
- <?php /*Remove Dashboard widgets*/ ?>
1868
- <?php
1869
-
1870
- if(get_option('agca_dashboard_widget_welcome')==true){
1871
- ?>jQuery("#welcome-panel").css("display","none");<?php
1872
- }else{
1873
- ?>jQuery("#welcome-panel").css("display","block");<?php
1874
- }
1875
- if(get_option('agca_dashboard_widget_il')==true){
1876
- $this->remove_dashboard_widget('dashboard_incoming_links','normal');
1877
- }else{
1878
- ?>jQuery("#dashboard_incoming_links").css("display","block");<?php
1879
- }
1880
- if(get_option('agca_dashboard_widget_plugins')==true){
1881
- $this->remove_dashboard_widget('dashboard_plugins','normal');
1882
- }else{
1883
- ?>jQuery("#dashboard_plugins").css("display","block");<?php
1884
- }
1885
- if(get_option('agca_dashboard_widget_qp')==true){
1886
- $this->remove_dashboard_widget('dashboard_quick_press','side');
1887
- }else{
1888
- ?>jQuery("#dashboard_quick_press").css("display","block");<?php
1889
- }
1890
- if(get_option('agca_dashboard_widget_rn')==true){
1891
- $this->remove_dashboard_widget('dashboard_right_now','normal');
1892
- }else{
1893
- ?>jQuery("#dashboard_right_now").css("display","block");<?php
1894
- }
1895
- if(get_option('agca_dashboard_widget_rd')==true){
1896
- $this->remove_dashboard_widget('dashboard_recent_drafts','side');
1897
- }else{
1898
- ?>jQuery("#dashboard_recent_drafts").css("display","block");<?php
1899
- }
1900
- if(get_option('agca_dashboard_widget_primary')==true){
1901
- $this->remove_dashboard_widget('dashboard_primary','side');
1902
- }else{
1903
- ?>jQuery("#dashboard_primary").css("display","block");<?php
1904
- }
1905
- if(get_option('agca_dashboard_widget_secondary')==true){
1906
- $this->remove_dashboard_widget('dashboard_secondary','side');
1907
- }else{
1908
- ?>jQuery("#dashboard_secondary").css("display","block");<?php
1909
- }
1910
- if(get_option('agca_dashboard_widget_activity')==true){
1911
- remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
1912
- }else{
1913
- ?>jQuery("#dashboard_activity").css("display","block");<?php
1914
- }
1915
-
1916
- ?>
1917
-
1918
- <?php /*ADMIN MENU*/ ?>
1919
-
1920
- <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1921
- jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1922
- <?php } ?>
1923
- <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1924
- jQuery(".wp-menu-image").each(function(){
1925
- jQuery(this).css("display","none");
1926
- });
1927
- jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1928
- <?php } ?>
1929
- <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1930
- jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1931
-
1932
- <?php } ?>
1933
- <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1934
-
1935
- <?php /*If Turned on*/ ?>
1936
-
1937
- <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1938
- jQuery('#adminmenu > li').each(function(){
1939
- if(!jQuery(this).hasClass('agca_button_only')){
1940
- jQuery(this).addClass('noclass');
1941
- }
1942
- });
1943
- <?php /*Only admin see button*/
1944
- if (current_user_can($this->admin_capability())){ ?>
1945
- jQuery('#adminmenu').append('<?php echo $this->agca_create_admin_button('AGCA',array('value'=>'tools.php?page=ag-custom-admin/plugin.php#general-settings','target'=>'_self')); ?>');
1946
- <?php } ?>
1947
- <?php } ?>
1948
-
1949
-
1950
- <?php /*EDIT MENU ITEMS*/?>
1951
- <?php if(get_option('ag_edit_adminmenu_json')!=""){
1952
-
1953
- $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1954
-
1955
- $checkboxes = json_decode($arr[0]);
1956
- $textboxes = json_decode($arr[1]);
1957
-
1958
- $this->migrate_menu_customizations($checkboxes, $textboxes);
1959
-
1960
- } ?>
1961
-
1962
- <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1963
- $this->customized_menu();
1964
- } ?>
1965
-
1966
-
1967
-
1968
-
1969
- /*Add user buttons*/
1970
- jQuery('#adminmenu').append(buttons);
1971
-
1972
- <?php /*END If Turned on*/ ?>
1973
- <?php } else{ ?>
1974
- jQuery("#adminmenu").removeClass("noclass");
1975
- <?php } ?>
1976
-
1977
- reloadRemoveButtonEvents();
1978
-
1979
- <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1980
- //remove collapse menu button
1981
- jQuery('#collapse-menu').remove();
1982
- <?php } ?>
1983
-
1984
- <?php //COLORIZER ?>
1985
- updateAllColors();
1986
- <?php //COLORIZER END ?>
1987
- <?php } //end of apply for any user except admin ?>
1988
- /*Add user buttons*/
1989
- jQuery('#ag_add_adminmenu').append(buttonsJq);
1990
-
1991
-
1992
- }catch(err){
1993
- errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
1994
- console.log(errors);
1995
- }finally{
1996
- jQuery('html').css('visibility','visible');
1997
- }
1998
- <?php
1999
- if($this->saveAfterImport == true){
2000
- ?>savePluginSettings();<?php
2001
- }
2002
- ?>
2003
-
2004
- });
2005
-
2006
- <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
2007
- $this->updateAllColors();
2008
- }else{
2009
- ?>function updateAllColors(){}; <?php
2010
- } ?>
2011
-
2012
-
2013
- /* ]]> */
2014
- </script>
2015
- <style type="text/css">
2016
- .underline_text{
2017
- text-decoration:underline;
2018
- }
2019
- .form-table th{
2020
- width:300px;
2021
- }
2022
-
2023
- #dashboard-widgets div.empty-container{
2024
- border:none;
2025
- }
2026
- </style>
2027
- <?php
2028
- }
2029
-
2030
- function print_login_head(){
2031
- if($this->isCusminActive()){
2032
- return false;
2033
- }
2034
-
2035
- $this->context = "login";
2036
- $this->error_check();
2037
- //$wpversion = $this->get_wp_version();
2038
-
2039
- ?>
2040
- <script type="text/javascript">
2041
- document.write('<style type="text/css">html{visibility:hidden;}</style>');
2042
- var agca_version = "<?php echo $this->agca_version; ?>";
2043
- <?php //var wpversion = "echo $wpversion; ?>
2044
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
2045
- var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
2046
- var isSettingsImport = false;
2047
- var agca_context = "login";
2048
- </script>
2049
- <?php
2050
- $this->prepareAGCALoginTemplates();
2051
- $this->agca_get_includes();
2052
-
2053
- ?>
2054
-
2055
- <script type="text/javascript">
2056
-
2057
-
2058
- /* <![CDATA[ */
2059
- jQuery(document).ready(function() {
2060
- try{
2061
- <?php if(get_option('agca_login_round_box')==true){ ?>
2062
- jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2063
- jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2064
- jQuery("#login h1 a").css("margin-bottom",'10px');
2065
- jQuery("#login h1 a").css("padding-bottom",'0');
2066
- jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2067
- <?php } ?>
2068
- <?php if(get_option('agca_login_banner')==true){ ?>
2069
- jQuery("#backtoblog").css("display","none");
2070
- <?php } ?>
2071
- <?php if(get_option('agca_login_banner_text')==true){ ?>
2072
- jQuery("#backtoblog a").html('<?php echo "← " . addslashes(get_option('agca_login_banner_text')); ?>');
2073
- <?php } ?>
2074
- <?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
2075
- advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
2076
- var $url = "url(" + advanced_url + ")";
2077
- jQuery("#login h1 a").css("background",$url+' no-repeat');
2078
- jQuery("#login h1 a").hide();
2079
- image = jQuery("<img />").attr("src",advanced_url);
2080
- jQuery(image).load(function() {
2081
- var originalWidth = 326;
2082
- var widthDiff = this.width - originalWidth;
2083
- jQuery("#login h1 a").height(this.height);
2084
- jQuery("#login h1 a").width(this.width);
2085
- jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
2086
-
2087
- var loginWidth = jQuery('#login').width();
2088
- var originalLoginWidth = 320;
2089
- var photoWidth = this.width;
2090
-
2091
- if(loginWidth > photoWidth){
2092
- jQuery("#login h1 a").css('margin','auto');
2093
- }else{
2094
- jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
2095
- }
2096
-
2097
- jQuery("#login h1 a").show();
2098
- });
2099
- <?php } ?>
2100
- <?php if(get_option('agca_login_photo_href')==true){ ?>
2101
- var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
2102
- $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
2103
-
2104
- jQuery("#login h1 a").attr("href",$href);
2105
- <?php } ?>
2106
- <?php if(get_option('agca_login_photo_remove')==true){ ?>
2107
- jQuery("#login h1 a").css("display","none");
2108
- <?php } ?>
2109
-
2110
- jQuery("#login h1 a").attr("title","");
2111
-
2112
- <?php if(get_option('agca_login_register_remove')==true){ ?>
2113
- if(jQuery('p#nav').size() > 0){
2114
- jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2115
- }
2116
- jQuery('p#nav a').each(function(){
2117
- if(jQuery(this).attr('href').indexOf('register') != -1){
2118
- jQuery(this).remove();
2119
- }
2120
- });
2121
-
2122
- <?php } ?>
2123
- <?php if(get_option('agca_login_register_href')!=""){ ?>
2124
- jQuery('p#nav a').each(function(){
2125
- if(jQuery(this).attr('href').indexOf('register') != -1){
2126
- jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
2127
- }
2128
- });
2129
-
2130
- <?php } ?>
2131
-
2132
- <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
2133
- if(jQuery('p#nav').size() > 0){
2134
- jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2135
- }
2136
- jQuery('p#nav a').each(function(){
2137
- if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
2138
- jQuery(this).remove();
2139
- }
2140
- });
2141
-
2142
- <?php } ?>
2143
-
2144
-
2145
- <?php //COLORIZER ?>
2146
- <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
2147
- jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
2148
- jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
2149
-
2150
-
2151
- <?php
2152
-
2153
-
2154
- } ?>
2155
- <?php //COLORIZER END ?>
2156
- }catch(err){
2157
- console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
2158
- }finally{
2159
- jQuery('html').show();
2160
- jQuery('html').css('visibility','visible');
2161
- }
2162
- });
2163
- /* ]]> */
2164
-
2165
- </script>
2166
- <?php
2167
- }
2168
-
2169
- function pluginUrl(){
2170
- return trailingslashit(plugins_url(basename(dirname(__FILE__))));
2171
- }
2172
-
2173
- function agca_admin_page() {
2174
-
2175
- $wpversion = $this->get_wp_version();
2176
- $this->agca_error_check();
2177
- ?>
2178
- <?php //includes ?>
2179
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
2180
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2181
-
2182
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
2183
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2184
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
2185
- <script type="text/javascript">
2186
- var templates_ep = "<?php echo $this->templates_ep; ?>";
2187
- var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
2188
- </script>
2189
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
2190
- <?php //includes ?>
2191
- <div class="wrap">
2192
- <h1 id="agca-title"><img src="<?php echo plugins_url( 'images/agca.png', __FILE__ ) ?>" /><span class="title">Absolutely Glamorous Custom Admin</span> <span class="version">(v<?php echo $this->agca_version; ?>)</span></h1>
2193
- <div id="agca-social" style="float:right; margin-top: -23px;">
2194
- <div class="fb-like" data-href="https://www.facebook.com/AG-Custom-Admin-892218404232342/timeline" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div>
2195
- </div>
2196
- <div id="agca_error_placeholder"></div>
2197
- <div id="agca_news">&nbsp;</div><br />
2198
- <form method="post" id="agca_form" action="options.php">
2199
- <?php wp_nonce_field('agca_form','_agca_token'); ?>
2200
- <?php settings_fields( 'agca-options-group' ); ?>
2201
- <div id="agca-your-feedback">
2202
- <strong>
2203
- <span style="color:#005B69">Your feedback:</span>
2204
- </strong>
2205
- <a class="feedback positive" target="_blank" title="<?php _e('POSITIVE FEEDBACK: I like this plugin!', 'ag-custom-admin'); ?>" href="https://wordpress.org/support/plugin/ag-custom-admin/reviews/">
2206
- <span class="dashicons dashicons-thumbs-up"></span>
2207
- </a>
2208
- <a class="feedback negative" target="_blank" title="<?php _e('NEGATIVE FEEDBACK: I don\'t like this plugin.', 'ag-custom-admin'); ?>" href="https://wordpress.org/support/plugin/ag-custom-admin/reviews/">
2209
- <span class="dashicons dashicons-thumbs-down"></span>
2210
- </a>
2211
- </div>
2212
- <br />
2213
- <ul id="ag_main_menu" style="<?php echo $this->isCusminActive()?'display:none':''; ?>">
2214
- <li class="selected" style="border-top-left-radius: 10px; "><a href="#general-settings" title="<?php _e('General Settings', 'ag-custom-admin')?>" ><?php _e('General', 'ag-custom-admin')?></a></li>
2215
- <li class="normal"><a href="#admin-bar-settings" title="<?php _e('Settings for admin bar', 'ag-custom-admin')?>" ><?php _e('Admin Bar', 'ag-custom-admin')?></a></li>
2216
- <li class="normal"><a href="#admin-footer-settings" title="<?php _e('Settings for admin footer', 'ag-custom-admin')?>" ><?php _e('Footer', 'ag-custom-admin')?></a></li>
2217
- <li class="normal"><a href="#dashboad-page-settings" title="<?php _e('Settings for Dashboard page', 'ag-custom-admin')?>"><?php _e('Dashboard', 'ag-custom-admin')?></a></li>
2218
- <li class="normal"><a href="#login-page-settings" title="<?php _e('Settings for Login page', 'ag-custom-admin')?>"><?php _e('Login Page', 'ag-custom-admin')?></a></li>
2219
- <li class="normal" ><a href="#admin-menu-settings" title="<?php _e('Settings for main admin menu', 'ag-custom-admin')?>"><?php _e('Admin Menu', 'ag-custom-admin')?></a></li>
2220
- <li class="normal"><a href="#ag-colorizer-settings" title="<?php _e('Colorizer settings', 'ag-custom-admin')?>"><?php _e('Colorizer', 'ag-custom-admin')?></a></li>
2221
- <li class="normal"><a href="#ag-advanced" title="<?php _e('My custom scripts', 'ag-custom-admin')?>"><?php _e('Advanced', 'ag-custom-admin')?></a></li>
2222
- <?php if(defined('AGCA_THEMES')){ ?>
2223
- <li class="normal" style=""><a href="#ag-templates" title="<?php _e('AGCA Themes', 'ag-custom-admin')?>"><?php _e('Themes', 'ag-custom-admin')?></a></li>
2224
- <?php } ?>
2225
- <li class="normal upgrade"><a href="https://cusmin.com/upgrade-to-cusmin?ref=menu" target="_blank" title="<?php _e('Upgrade to Cusmin', 'ag-custom-admin')?>"><img src="<?php echo plugins_url( 'images/cusminlogo.png', __FILE__ ) ?>" /><?php _e('Upgrade', 'ag-custom-admin')?></a></li>
2226
-
2227
- <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" target="_blank" style="margin-left:8px" title="<?php _e('Enjoying AGCA? Help us further develop it and support it!', 'ag-custom-admin')?> " href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development"><img alt="<?php _e('Donate', 'ag-custom-admin')?>" src="<?php echo $this->pluginUrl(); ?>images/donate-btn.png" /></a>
2228
- </li>
2229
- <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2230
- </ul>
2231
- <div id="agca_advertising">
2232
- <ul>
2233
- <li style="min-height:105px;display: block">
2234
- <a href="https://cusmin.com?ref=agca-ad" target="_blank"><img src="<?php echo $this->pluginUrl(); ?>images/advertising.jpg" /></a>
2235
- </li>
2236
- </ul>
2237
- </div>
2238
- <div class="agca-clear"></div>
2239
- <div id="section-cusmin" style="display:none;"><?php _e('All AGCA plugin\'s settings, except admin themes, are disabled. Please use', 'ag-custom-admin')?> <a href="options-general.php?page=cusmin">Cusmin</a> <?php _e('plugin to manage these settings.', 'ag-custom-admin')?></div>
2240
- <div id="section_general" style="display:none" class="ag_section">
2241
- <h2 class="section_title"><?php _e('General Settings', 'ag-custom-admin')?></h2>
2242
- <?php $this->show_save_button_upper(); ?>
2243
- <p tabindex="0" class="agca-clear agca-tip"><i><?php _e('<strong>Tip: </strong>Move mouse cursor over the option label to see more information about an option', 'ag-custom-admin')?></i></p>
2244
- <table class="agca-clear form-table" width="500px">
2245
- <?php
2246
-
2247
- $this->print_checkbox(array(
2248
- 'name'=>'agca_role_allbutadmin',
2249
- 'label'=>__('Exclude AGCA admin from customizations', 'ag-custom-admin'),
2250
- 'title'=>__('<h3>Applying customizations</h3><br><strong>Checked</strong> - apply to all users, except admin<br><strong>Not checked</strong> - apply to everyone</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>General -> Security -> AGCA admin capability</i> and change capability option to define administrators. Only the users with selected capability will be AGCA administrators.</br>', 'ag-custom-admin')
2251
- ));
2252
-
2253
- $this->print_options_h3(__('Pages', 'ag-custom-admin'));
2254
-
2255
- $this->print_checkbox(array(
2256
- 'hide'=>true,
2257
- 'name'=>'agca_screen_options_menu',
2258
- 'label'=>__('Hide "Screen Options" menu', 'ag-custom-admin'),
2259
- 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2260
- ));
2261
-
2262
- $this->print_checkbox(array(
2263
- 'hide'=>true,
2264
- 'name'=>'agca_help_menu',
2265
- 'label'=>__('Hide "Help" menu', 'ag-custom-admin'),
2266
- 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2267
- ));
2268
-
2269
- $this->print_checkbox(array(
2270
- 'title'=>__('Hides colors scheme on profile page', 'ag-custom-admin'),
2271
- 'name'=>'agca_profile_color_scheme',
2272
- 'hide'=>true,
2273
- 'label'=>__('Hide User\'s Profile Color Scheme', 'ag-custom-admin')
2274
- ));
2275
-
2276
- $this->print_options_h3(__('Security', 'ag-custom-admin'));
2277
-
2278
- ?>
2279
-
2280
- <tr valign="center">
2281
- <th scope="row">
2282
- <label title="<?php _e('Choose which WordPress capability will be used to distinguish AGCA admin users from other users.</br>AGCA admin users have access to AGCA settings. AGCA administrators can be excluded from customizations if that option is checked', 'ag-custom-admin'); ?>" for="agca_admin_capability"><?php _e('AGCA admin capability', 'ag-custom-admin'); ?>:</label>
2283
- </th>
2284
- <td><?php echo $this->admin_capabilities; ?>&nbsp;&nbsp;<i>(<?php _e('default:&nbsp;<strong>edit_dashboard</strong>', 'ag-custom-admin'); ?>)</i>
2285
- <p style="margin-left:5px;"><i><?php _e('Find more information about', 'ag-custom-admin'); ?> <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank"><?php _e('WordPress capabilities', 'ag-custom-admin'); ?></a></i></p>
2286
- </td>
2287
- <td>
2288
- </td>
2289
- </tr>
2290
- <?php
2291
- $this->print_options_h3(__('Feedback and Support', 'ag-custom-admin'));
2292
-
2293
- ?>
2294
- <tr valign="center">
2295
- <td colspan="2">
2296
- <div class="agca-feedback-and-support">
2297
- <?php /*<ul>
2298
- <li><a href="https://wordpressadminpanel.com/agca-support/contact/?type=feature" target="_blank"><span class="dashicons dashicons-lightbulb"></span>&nbsp;&nbsp;<?php _e('Idea for improvement', 'ag-custom-admin'); ?></a> - <?php _e('submit your idea for improvement', 'ag-custom-admin'); ?> </li>
2299
- </ul>*/
2300
- ?>
2301
- <ul>
2302
- <li><a href="https://wordpress.org/support/plugin/ag-custom-admin" target="_blank"><span class="dashicons dashicons-megaphone"></span>&nbsp;&nbsp;<?php _e('Report an issue', 'ag-custom-admin'); ?></a> - <?php _e('If plugin does not work as expected', 'ag-custom-admin'); ?> </li>
2303
- </ul>
2304
- <?php /*<ul>
2305
- <li><a href="https://wordpressadminpanel.com/agca-support/contact/?type=theme" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;<?php _e('Idea for admin theme', 'ag-custom-admin'); ?></a> - <?php _e('submit your idea for admin theme', 'ag-custom-admin'); ?> </li>
2306
- </ul>*/
2307
- ?>
2308
- <ul>
2309
- <li><a href="https://wordpress.org/support/view/plugin-reviews/ag-custom-admin" target="_blank"><span class="dashicons dashicons-awards"></span>&nbsp;&nbsp;<?php _e('Add a review on WordPress.org', 'ag-custom-admin'); ?></a> - <?php _e('add your review and rate us on WordPress.org', 'ag-custom-admin'); ?> </li>
2310
- </ul>
2311
- <?php /*<ul>
2312
- <li><a href="https://wordpressadminpanel.com/agca-support/" target="_blank"><span class="dashicons dashicons-shield-alt"></span>&nbsp;&nbsp;<?php _e('Visit our support site', 'ag-custom-admin'); ?></a> - <?php _e('for any other questions, feel free to contact us', 'ag-custom-admin'); ?> </li>
2313
- </ul>*/
2314
- ?>
2315
- <ul>
2316
- <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development" target="_blank"><span class="dashicons dashicons-palmtree"></span>&nbsp;&nbsp;<?php _e('Donate', 'ag-custom-admin'); ?></a> - <?php _e('if you find this plugin helpful for your needs', 'ag-custom-admin'); ?> </li>
2317
- </ul>
2318
- <ul class="upgrade">
2319
- <li><a href="https://cusmin.com/upgrade-to-cusmin?ref=page" target="_blank">
2320
- <img src="<?php echo plugins_url( 'images/cusminlogo.png', __FILE__ ) ?>" />
2321
- &nbsp;&nbsp;<span><?php _e('Upgrade to Cusmin', 'ag-custom-admin'); ?></span></a><span><?php _e('&nbsp;- unlock the ultimate branding experience', 'ag-custom-admin'); ?></span></li>
2322
- </ul>
2323
- </div>
2324
- </td>
2325
- <td></td>
2326
- </tr>
2327
- </table>
2328
- </div>
2329
- <div id="section_admin_bar" style="display:none" class="ag_section">
2330
- <h2 class="section_title"><?php _e('Admin Bar Settings', 'ag-custom-admin'); ?></h2>
2331
- <?php $this->show_save_button_upper(); ?>
2332
- <table class="form-table" width="500px">
2333
-
2334
- <?php
2335
- $this->print_checkbox(array(
2336
- 'attributes'=>array(
2337
- 'class'=>'ag_table_major_options',
2338
- ),
2339
- 'hide'=>true,
2340
- 'title'=>__('Hides admin bar completely from the admin panel', 'ag-custom-admin'),
2341
- 'name'=>'agca_header',
2342
- 'label'=>__('<strong>Hide Admin bar</strong>', 'ag-custom-admin'),
2343
- 'input-attributes'=>'data-dependant="#agca_header_show_logout_content"',
2344
- 'input-class'=>'has-dependant',
2345
- ));
2346
-
2347
- $this->print_checkbox(array(
2348
- 'attributes'=>array(
2349
- 'class'=>'ag_table_major_options',
2350
- 'style'=> ((get_option('agca_header')!='true')?'display:none':''),
2351
- 'id'=>'agca_header_show_logout_content',
2352
- ),
2353
- 'title'=>__('Check this if you want to show Log Out button in top right corner of the admin page', 'ag-custom-admin'),
2354
- 'name'=>'agca_header_show_logout',
2355
- 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2356
- 'label'=>__('<strong>(but show Log Out button)</strong>', 'ag-custom-admin')
2357
- ));
2358
-
2359
- $this->print_checkbox(array(
2360
- 'title'=>__('Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.', 'ag-custom-admin'),
2361
- 'name'=>'agca_admin_bar_frontend',
2362
- 'hide'=>true,
2363
- 'label'=>__('Site pages: Do not apply Admin bar customizations', 'ag-custom-admin')
2364
- ));
2365
-
2366
- $this->print_checkbox(array(
2367
- 'title'=>__('Hides admin bar completely for authenticated users on site pages.', 'ag-custom-admin'),
2368
- 'name'=>'agca_admin_bar_frontend_hide',
2369
- 'hide'=>true,
2370
- 'label'=>__('Site pages: Hide Admin bar', 'ag-custom-admin')
2371
- ));
2372
-
2373
- $this->print_options_h3(__('Left Side', 'ag-custom-admin'));
2374
-
2375
- $this->print_input(array(
2376
- 'title'=>__('Change default WordPress logo with custom image.', 'ag-custom-admin'),
2377
- 'name'=>'agca_wp_logo_custom',
2378
- 'label'=>__('Admin bar logo', 'ag-custom-admin'),
2379
- 'hint' =>__('Image URL', 'ag-custom-admin')
2380
- ));
2381
-
2382
- $this->print_input(array(
2383
- 'title'=>__('Custom link on admin bar logo.', 'ag-custom-admin').'</br></br>Use:</br><strong>%BLOG%</strong> - '.__('for blog URL.', 'ag-custom-admin').'</br><strong>%SWITCH%</strong> - '.__('to switch betweent admin and site area', 'ag-custom-admin'),
2384
- 'name'=>'agca_wp_logo_custom_link',
2385
- 'label'=>__('Admin bar logo link', 'ag-custom-admin'),
2386
- 'hint' =>__('Link', 'ag-custom-admin')
2387
- ));
2388
-
2389
- $this->print_input(array(
2390
- 'title'=>__('Customize WordPress title using custom title template.</br></br>Examples', 'ag-custom-admin').':</br><strong>%BLOG% -- %PAGE%</strong> '.'('.__('will be', 'ag-custom-admin').')'.' <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> ('.__('will be', 'ag-custom-admin').') <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> ('.__('will be', 'ag-custom-admin').') <i>My Company > My Blog > Tools</i>',
2391
- 'name'=>'agca_custom_title',
2392
- 'label'=>__('Page title template', 'ag-custom-admin'),
2393
- 'hint' =>__('Please use', 'ag-custom-admin').' <strong>%BLOG%</strong> '.__('and', 'ag-custom-admin'). ' <strong>%PAGE%</strong> '.__('in your title template.', 'ag-custom-admin')
2394
- ));
2395
-
2396
- $this->print_input(array(
2397
- 'title'=>__('Add custom image on the top of the admin content.', 'ag-custom-admin'),
2398
- 'name'=>'agca_header_logo_custom',
2399
- 'label'=>__('Header image', 'ag-custom-admin'),
2400
- 'hint' =>__('Image URL', 'ag-custom-admin')
2401
- ));
2402
-
2403
-
2404
- $this->print_checkbox(array(
2405
- 'hide'=>true,
2406
- 'title'=>__('Hides small Wordpress logo or custom logo from the admin bar', 'ag-custom-admin'),
2407
- 'name'=>'agca_header_logo',
2408
- 'label'=>__('Hide Admin bar logo', 'ag-custom-admin')
2409
- ));
2410
-
2411
- $this->print_checkbox(array(
2412
- 'hide'=>true,
2413
- 'title'=>__('Hides WordPress context menu on admin bar logo from admin bar', 'ag-custom-admin'),
2414
- 'name'=>'agca_remove_top_bar_dropdowns',
2415
- 'label'=>__('Hide Admin bar logo context menu', 'ag-custom-admin')
2416
- ));
2417
-
2418
- $this->print_checkbox(array(
2419
- 'hide'=>true,
2420
- 'title'=>__('Hides site name link from the admin bar', 'ag-custom-admin'),
2421
- 'name'=>'agca_remove_site_link',
2422
- 'label'=>__('Hide Site name', 'ag-custom-admin')
2423
- ));
2424
-
2425
- $this->print_checkbox(array(
2426
- 'hide'=>true,
2427
- 'title'=>__('Hides update notifications from admin bar', 'ag-custom-admin'),
2428
- 'name'=>'agca_admin_bar_update_notifications',
2429
- 'label'=>__('Remove update notifications', 'ag-custom-admin')
2430
- ));
2431
-
2432
- $this->print_checkbox(array(
2433
- 'hide'=>true,
2434
- 'title'=>__('Hides comments block from admin bar', 'ag-custom-admin'),
2435
- 'name'=>'agca_admin_bar_comments',
2436
- 'label'=>__('Hide "Comments" block', 'ag-custom-admin')
2437
- ));
2438
-
2439
- $this->print_checkbox(array(
2440
- 'hide'=>true,
2441
- 'attributes'=>array(
2442
- 'style'=>'margin-top:20px;'
2443
- ),
2444
- 'title'=>__('Hides "+ New" block and its context menu from admin bar', 'ag-custom-admin'),
2445
- 'name'=>'agca_admin_bar_new_content',
2446
- 'label'=>__('Hide "+ New" block', 'ag-custom-admin'),
2447
- 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2448
- 'input-class'=>'has-dependant dependant-opposite'
2449
- ));
2450
-
2451
- $this->print_checkbox(array(
2452
- 'hide'=>true,
2453
- 'attributes'=>array(
2454
- 'class'=>'new_content_header_submenu'
2455
- ),
2456
- 'title'=>__('Hides "Post" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2457
- 'name'=>'agca_admin_bar_new_content_post',
2458
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Post sub-menu', 'ag-custom-admin')
2459
- ));
2460
-
2461
- $this->print_checkbox(array(
2462
- 'hide'=>true,
2463
- 'attributes'=>array(
2464
- 'class'=>'new_content_header_submenu'
2465
- ),
2466
- 'title'=>__('Hides "Link" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2467
- 'name'=>'agca_admin_bar_new_content_link',
2468
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Link sub-menu', 'ag-custom-admin')
2469
- ));
2470
-
2471
- $this->print_checkbox(array(
2472
- 'hide'=>true,
2473
- 'attributes'=>array(
2474
- 'class'=>'new_content_header_submenu'
2475
- ),
2476
- 'title'=>__('Hides "Page" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2477
- 'name'=>'agca_admin_bar_new_content_page',
2478
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Page sub-menu', 'ag-custom-admin')
2479
- ));
2480
-
2481
- $this->print_checkbox(array(
2482
- 'hide'=>true,
2483
- 'attributes'=>array(
2484
- 'class'=>'new_content_header_submenu'
2485
- ),
2486
- 'title'=>__('Hides "User" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2487
- 'name'=>'agca_admin_bar_new_content_user',
2488
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> User sub-menu', 'ag-custom-admin')
2489
- ));
2490
-
2491
- $this->print_checkbox(array(
2492
- 'hide'=>true,
2493
- 'attributes'=>array(
2494
- 'class'=>'new_content_header_submenu'
2495
- ),
2496
- 'title'=>__('Hides "Media" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2497
- 'name'=>'agca_admin_bar_new_content_media',
2498
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Media sub-menu', 'ag-custom-admin')
2499
- ));
2500
-
2501
- /* $this->print_checkbox(array(
2502
- 'hide'=>true,
2503
- 'title'=>__('Hides "Admin themes" from admin bar', 'ag-custom-admin'),
2504
- 'name'=>'agca_admin_bar_admin_themes',
2505
- 'label'=>__('"Admin themes"', 'ag-custom-admin')
2506
- ));*/
2507
-
2508
- $this->print_input(array(
2509
- 'title'=>__('Adds custom text in admin top bar.', 'ag-custom-admin'),
2510
- 'name'=>'agca_custom_site_heading',
2511
- 'label'=>__('Custom blog heading', 'ag-custom-admin'),
2512
- 'hint'=>__('<strong>Tip: </strong>You can use HTML tags like', 'ag-custom-admin')." &lt;h1&gt; ".__('or', 'ag-custom-admin')." &lt;a&gt;"
2513
- ));
2514
-
2515
-
2516
- $this->print_checkbox(array(
2517
- 'hide'=>true,
2518
- 'title'=>__('Hides the yellow bar with the information about the new WordPress release', 'ag-custom-admin'),
2519
- 'name'=>'agca_update_bar',
2520
- 'label'=>__('Hide WordPress update notification', 'ag-custom-admin')
2521
- ));
2522
-
2523
- $this->print_options_h3(__('Right Side', 'ag-custom-admin'));
2524
-
2525
- $this->print_input(array(
2526
- 'name'=>'agca_howdy',
2527
- 'label'=>__('Change Howdy text', 'ag-custom-admin'),
2528
- ));
2529
-
2530
- $this->print_input(array(
2531
- 'title'=>__('Put \'Exit\', for example', 'ag-custom-admin'),
2532
- 'name'=>'agca_logout',
2533
- 'label'=>__('Change Log out text', 'ag-custom-admin'),
2534
- ));
2535
-
2536
- $this->print_checkbox(array(
2537
- 'hide'=>true,
2538
- 'name'=>'agca_remove_your_profile',
2539
- 'label'=>__('Hide "Edit My Profile" link', 'ag-custom-admin'),
2540
- ));
2541
-
2542
- $this->print_checkbox(array(
2543
- 'title'=>__('If selected, hides all elements in top right corner, except Log Out button', 'ag-custom-admin'),
2544
- 'name'=>'agca_logout_only',
2545
- 'label'=>__('Log out only', 'ag-custom-admin')
2546
- ));
2547
-
2548
- ?>
2549
-
2550
- </table>
2551
- </div>
2552
-
2553
- <div id="section_admin_footer" style="display:none" class="ag_section">
2554
- <h2 class="section_title"><?php _e('Admin Footer Settings', 'ag-custom-admin'); ?></h2>
2555
- <?php $this->show_save_button_upper(); ?>
2556
- <table class="form-table" width="500px">
2557
- <?php
2558
- $this->print_checkbox(array(
2559
- 'hide'=>true,
2560
- 'attributes'=>array(
2561
- 'class'=>'ag_table_major_options'
2562
- ),
2563
- 'title'=>__('Hides footer with all elements', 'ag-custom-admin'),
2564
- 'name'=>'agca_footer',
2565
- 'label'=>__('<strong>Hide footer</strong>', 'ag-custom-admin')
2566
- ));
2567
-
2568
- $this->print_options_h3(__('Footer Options', 'ag-custom-admin'));
2569
-
2570
- $this->print_checkbox(array(
2571
- 'hide'=>true,
2572
- 'title'=>__('Hides default text in footer', 'ag-custom-admin'),
2573
- 'name'=>'agca_footer_left_hide',
2574
- 'label'=>__('Hide footer text', 'ag-custom-admin')
2575
- ));
2576
-
2577
- $this->print_textarea(array(
2578
- 'title'=>__('Replaces text \'Thank you for creating with WordPress\' with custom text', 'ag-custom-admin'),
2579
- 'name'=>'agca_footer_left',
2580
- 'class' => 'one-line',
2581
- 'label'=>__('Change footer text', 'ag-custom-admin')
2582
- ));
2583
-
2584
- $this->print_checkbox(array(
2585
- 'hide'=>true,
2586
- 'title'=>__('Hides text \'Get Version ...\' on right', 'ag-custom-admin'),
2587
- 'name'=>'agca_footer_right_hide',
2588
- 'label'=>__('Hide version text', 'ag-custom-admin')
2589
- ));
2590
-
2591
- $this->print_textarea(array(
2592
- 'title'=>__('Replaces text \'Get Version ...\' with custom text', 'ag-custom-admin'),
2593
- 'name'=>'agca_footer_right',
2594
- 'class' => 'one-line',
2595
- 'label'=>__('Change version text', 'ag-custom-admin')
2596
- ));
2597
-
2598
- ?>
2599
-
2600
- </table>
2601
- </div>
2602
- <div id="section_dashboard_page" style="display:none" class="ag_section">
2603
- <h2 class="section_title"><?php _e('Dashboard Settings', 'ag-custom-admin'); ?></h2>
2604
- <?php $this->show_save_button_upper(); ?>
2605
- <table class="form-table" width="500px">
2606
- <?php
2607
-
2608
- $this->print_options_h3(__('Dashboard Options', 'ag-custom-admin'));
2609
-
2610
- $this->print_input(array(
2611
- 'title'=>__('Main heading (\'Dashboard\') on Dashboard page', 'ag-custom-admin'),
2612
- 'name'=>'agca_dashboard_text',
2613
- 'label'=>__('Change Dashboard heading text', 'ag-custom-admin'),
2614
- ));
2615
-
2616
- ?>
2617
- <tr valign="center">
2618
- <th scope="row">
2619
- <label title="<?php _e('Adds custom text (or HTML) between heading and widgets area on Dashboard page', 'ag-custom-admin'); ?>" for="agca_dashboard_text_paragraph"><?php _e('Add custom Dashboard content<br> <em>(text or HTML content)', 'ag-custom-admin'); ?></em></label>
2620
- </th>
2621
- <td class="agca_editor">
2622
- <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2623
- </td>
2624
- </tr>
2625
- <?php
2626
-
2627
- $this->print_options_h3(__('Dashboard Widgets Options', 'ag-custom-admin'));
2628
-
2629
- ?>
2630
- <tr>
2631
- <td colspan="2">
2632
- <p tabindex="0" class="agca-tip"><i><strong><?php _e('Note', 'ag-custom-admin'); ?>:</strong> <?php _e('These settings will override settings configured in the Screen options on Dashboard page.', 'ag-custom-admin'); ?></i></p>
2633
- </td>
2634
- </tr>
2635
- <?php
2636
- $this->print_checkbox(array(
2637
- 'hide'=>true,
2638
- 'title'=>__('Hides Welcome WordPress widget', 'ag-custom-admin'),
2639
- 'name'=>'agca_dashboard_widget_welcome',
2640
- 'label'=>__('Hide "Welcome" widget', 'ag-custom-admin')
2641
- ));
2642
-
2643
- $this->print_checkbox(array(
2644
- 'hide'=>true,
2645
- 'title'=>__('Hides Activity dashboard widget', 'ag-custom-admin'),
2646
- 'name'=>'agca_dashboard_widget_activity',
2647
- 'label'=>__('Hide "Activity" widget', 'ag-custom-admin')
2648
- ));
2649
-
2650
- $this->print_checkbox(array(
2651
- 'hide'=>true,
2652
- 'title'=>__('Hides Quick Draft dashboard widget', 'ag-custom-admin'),
2653
- 'name'=>'agca_dashboard_widget_qp',
2654
- 'label'=>__('Hide "Quick Draft" widget', 'ag-custom-admin')
2655
- ));
2656
-
2657
- $this->print_checkbox(array(
2658
- 'hide'=>true,
2659
- 'title'=>__('Hides At a Glance dashboard widget', 'ag-custom-admin'),
2660
- 'name'=>'agca_dashboard_widget_rn',
2661
- 'label'=>__('Hide "At a Glance" widget', 'ag-custom-admin')
2662
- ));
2663
-
2664
- $this->print_checkbox(array(
2665
- 'hide'=>true,
2666
- 'name'=>'agca_dashboard_widget_primary',
2667
- 'title'=>__('This is \'WordPress News\' or \'WordPress Development Blog\' widget in older WordPress versions', 'ag-custom-admin'),
2668
- 'label'=>__('Hide "WordPress News" widget', 'ag-custom-admin')
2669
- ));
2670
-
2671
- $this->print_checkbox(array(
2672
- 'hide'=>true,
2673
- 'name'=>'agca_dashboard_widget_secondary',
2674
- 'title'=>__('This is \'Other WordPress News\' widget by default', 'ag-custom-admin'),
2675
- 'label'=>__('Hide secondary widget area', 'ag-custom-admin')
2676
- ));
2677
-
2678
- ?>
2679
- </table>
2680
- </div>
2681
- <div id="section_login_page" style="display:none" class="ag_section">
2682
- <h2 class="section_title"><?php _e('Login Page Settings', 'ag-custom-admin'); ?></h2>
2683
- <?php $this->show_save_button_upper(); ?>
2684
- <table class="form-table" width="500px">
2685
- <?php
2686
-
2687
- $this->print_options_h3(__('Login Page Options', 'ag-custom-admin'));
2688
-
2689
- $this->print_checkbox(array(
2690
- 'hide'=>true,
2691
- 'name'=>'agca_login_banner',
2692
- 'title'=>__('Hide back to blog block', 'ag-custom-admin'),
2693
- 'label'=>__('Hide "Back to blog" text', 'ag-custom-admin')
2694
- ));
2695
-
2696
- $this->print_input(array(
2697
- 'name'=>'agca_login_banner_text',
2698
- 'title'=>__('Changes \'<- Back to ...\' text in top bar on Login page', 'ag-custom-admin'),
2699
- 'label'=>__('Change back to blog text', 'ag-custom-admin')
2700
- ));
2701
-
2702
- $this->print_input(array(
2703
- 'title'=>__('If this field is not empty, image from provided url will be visible on Login page', 'ag-custom-admin'),
2704
- 'name'=>'agca_login_photo_url',
2705
- 'label'=>__('Change Login header image', 'ag-custom-admin'),
2706
- 'hint'=>__('Image URL', 'ag-custom-admin')
2707
- ));
2708
-
2709
- $this->print_input(array(
2710
- 'title'=>__('Put here custom link to a web location, that will be triggered on image click', 'ag-custom-admin'),
2711
- 'name'=>'agca_login_photo_href',
2712
- 'label'=>__('Change link on login image', 'ag-custom-admin'),
2713
- 'hint'=>__('For blog URL use', 'ag-custom-admin').' %BLOG%'
2714
- ));
2715
-
2716
- $this->print_checkbox(array(
2717
- 'hide'=>true,
2718
- 'title'=>__('Hides login image completely', 'ag-custom-admin'),
2719
- 'name'=>'agca_login_photo_remove',
2720
- 'label'=>__('Hide login header image', 'ag-custom-admin'),
2721
- ));
2722
-
2723
- $this->print_checkbox(array(
2724
- 'title'=>__('Rounds box on login page', 'ag-custom-admin'),
2725
- 'name'=>'agca_login_round_box',
2726
- 'label'=>'Round box corners',
2727
- 'input-class'=>'has-dependant',
2728
- 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2729
- ));
2730
-
2731
- $this->print_input(array(
2732
- 'attributes'=>array(
2733
- 'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2734
- 'id'=>'agca_login_round_box_size_block'
2735
- ),
2736
- 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2737
- 'name'=>'agca_login_round_box_size',
2738
- 'label'=>__('Round box corners - size', 'ag-custom-admin'),
2739
- 'input-class'=>'validateNumber',
2740
- 'hint'=>__('(Size in px)', 'ag-custom-admin')
2741
- ));
2742
-
2743
- $this->print_checkbox(array(
2744
- 'hide'=>true,
2745
- 'title'=>__('Hides register link on login page', 'ag-custom-admin'),
2746
- 'name'=>'agca_login_register_remove',
2747
- 'label'=>__('Hide "Register" link', 'ag-custom-admin'),
2748
- 'input-class'=>'has-dependant dependant-opposite',
2749
- 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2750
- ));
2751
-
2752
- $this->print_input(array(
2753
- 'attributes'=>array(
2754
- 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2755
- 'id'=>'agca_login_register_href_block'
2756
- ),
2757
- 'title'=>__('Change register link on login page to point to your custom registration page.', 'ag-custom-admin'),
2758
- 'name'=>'agca_login_register_href',
2759
- 'label'=>__('Change register link', 'ag-custom-admin'),
2760
- 'hint'=>__('Link to new registration page', 'ag-custom-admin')
2761
- ));
2762
-
2763
- $this->print_checkbox(array(
2764
- 'hide'=>true,
2765
- 'title'=>__('Hides lost password link on login page', 'ag-custom-admin'),
2766
- 'name'=>'agca_login_lostpassword_remove',
2767
- 'label'=>__('Hide "Lost password" link', 'ag-custom-admin'),
2768
- ));
2769
- ?>
2770
- </table>
2771
- </div>
2772
- <?php
2773
- /*ADMIN MENU*/
2774
- ?>
2775
- <div id="section_admin_menu" style="display:none" class="ag_section">
2776
- <h2 class="section_title"><?php _e('Admin Menu Settings', 'ag-custom-admin'); ?></h2>
2777
- <?php $this->show_save_button_upper(); ?>
2778
- <table class="form-table" width="500px">
2779
- <tr valign="center" class="ag_table_major_options">
2780
- <td><label for="agca_admin_menu_turnonoff"><strong><?php _e('Apply admin menu customizations', 'ag-custom-admin'); ?></strong></label></td>
2781
- <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_turnonoff" title="<?php _e('Hides admin menu completely (administrator can see \'AGCA\' button)', 'ag-custom-admin'); ?>" value="on" <?php if (get_option('agca_admin_menu_turnonoff')==true) echo 'checked="checked" '; ?> /></td>
2782
- </tr>
2783
- <tr valign="center" class="ag_table_major_options">
2784
- <td><label for="agca_admin_menu_agca_button_only"><strong><?php _e('Admin menu', 'ag-custom-admin'); ?></strong></label></td>
2785
- <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_agca_button_only" title="<?php _e('Hides admin menu completely (administrator can see \'AGCA\' button)', 'ag-custom-admin'); ?>" value="true" <?php if (get_option('agca_admin_menu_agca_button_only')==true) echo 'checked="checked" '; ?> /></td>
2786
- </tr>
2787
- <?php
2788
- $this->print_options_h3(__('Edit / Remove Menu Items', 'ag-custom-admin'));
2789
- ?>
2790
- <tr>
2791
- <td colspan="2">
2792
- <input type="button" class="agca_button" id="ag_edit_adminmenu_reset_button" title="<?php _e('Reset menu settings to default values', 'ag-custom-admin'); ?>" name="ag_edit_adminmenu_reset_button" value="<?php _e('Reset to default settings', 'ag-custom-admin'); ?>" /><br />
2793
- <p tabindex="0"><em>(<?php _e('click on the top menu item to show its sub-menus', 'ag-custom-admin'); ?>)</em></p>
2794
- <table id="ag_edit_adminmenu">
2795
- <tr style="background-color:#816c64;">
2796
- <td width="300px"><div style="float:left;color:#fff;"><h3><?php _e('Item', 'ag-custom-admin'); ?></h3></div><div style="float:right;color:#fff;"><h3><?php _e('Hide?', 'ag-custom-admin'); ?></h3></div></td><td width="300px" style="color:#fff;" ><h3><?php _e('Change Text', 'ag-custom-admin'); ?></h3>
2797
- </td>
2798
- </tr>
2799
- </table>
2800
- <input type="hidden" size="47" id="ag_edit_adminmenu_json" name="ag_edit_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_edit_adminmenu_json')); ?>" />
2801
- <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2802
- </td>
2803
- <td></td>
2804
- </tr>
2805
- <?php
2806
- $this->print_checkbox(array(
2807
- 'title'=>__('Removes Profile menu item for non-admin users.', 'ag-custom-admin'),
2808
- 'hide'=>true,
2809
- 'name'=>'agca_menu_remove_client_profile',
2810
- 'label'=>__('Remove Profile button from user menu', 'ag-custom-admin'),
2811
- ));
2812
- $this->print_checkbox(array(
2813
- 'title'=>__('Removes Customize button on front end for authenticated users.', 'ag-custom-admin'),
2814
- 'hide'=>true,
2815
- 'name'=>'agca_menu_remove_customize_button',
2816
- 'label'=>__('Front end: Remove Customize button', 'ag-custom-admin'),
2817
- ));
2818
- ?>
2819
-
2820
- <?php
2821
- $this->print_options_h3(__('Add New Menu Items', 'ag-custom-admin'));
2822
- ?>
2823
- <tr>
2824
- <td colspan="2">
2825
- <table id="ag_add_adminmenu">
2826
- <tr>
2827
- <td colspan="2">
2828
- <?php _e('name', 'ag-custom-admin'); ?>:<input type="text" size="47" title="<?php _e('New button visible name', 'ag-custom-admin'); ?>" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
2829
- <?php _e('url', 'ag-custom-admin'); ?>:<input type="text" size="47" title="<?php _e('New button link', 'ag-custom-admin'); ?>" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
2830
- <?php _e('open in', 'ag-custom-admin'); ?>:&nbsp;<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:auto;">
2831
- <option value="_self" selected><?php _e('the same tab', 'ag-custom-admin'); ?></option>
2832
- <option value="_blank" ><?php _e('a new tab', 'ag-custom-admin'); ?></option>
2833
- </select>
2834
- <input type="button" id="ag_add_adminmenu_button" class="agca_button" title="<?php _e('Add new item button" name="ag_add_adminmenu_button', 'ag-custom-admin'); ?>" value="<?php _e('Add new item', 'ag-custom-admin'); ?>" />
2835
- </td><td></td>
2836
- </tr>
2837
- </table>
2838
- <input type="hidden" size="47" id="ag_add_adminmenu_json" name="ag_add_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_add_adminmenu_json')); ?>" />
2839
- </td>
2840
- <td>
2841
- </td>
2842
- </tr>
2843
- <?php
2844
- $this->print_options_h3(__('Admin Menu Settings', 'ag-custom-admin'));
2845
- ?>
2846
- <tr valign="center">
2847
- <th scope="row">
2848
- <label title="<?php _e('Choose how admin menu should behave on mobile devices / small screens', 'ag-custom-admin'); ?>" for="agca_admin_menu_autofold"><?php _e('Admin menu auto folding', 'ag-custom-admin'); ?></label>
2849
- </th>
2850
- <td>
2851
- <select title="<?php _e('General', 'ag-custom-admin'); ?>Choose how admin menu should behave on mobile devices / small screens" class="agca-selectbox" name="agca_admin_menu_autofold" >
2852
- <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> ><?php _e('Default', 'ag-custom-admin'); ?></option>
2853
- <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> ><?php _e('Force admin menu auto-folding', 'ag-custom-admin'); ?></option>
2854
- <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> ><?php _e('Disable admin menu auto-folding', 'ag-custom-admin'); ?></option>
2855
- </select>
2856
- </td>
2857
- </tr>
2858
- <?php
2859
-
2860
- $this->print_checkbox(array(
2861
- 'hide'=>true,
2862
- 'title'=>__('Removes empty space between some top menu items', 'ag-custom-admin'),
2863
- 'name'=>'agca_admin_menu_separators',
2864
- 'label'=>__('Hide menu items separators', 'ag-custom-admin'),
2865
- ));
2866
-
2867
- $this->print_checkbox(array(
2868
- 'hide'=>true,
2869
- 'title'=>__('Removes icons from dmin menu buttons', 'ag-custom-admin'),
2870
- 'name'=>'agca_admin_menu_icons',
2871
- 'label'=>__('Hide menu icons', 'ag-custom-admin'),
2872
- ));
2873
-
2874
- $this->print_checkbox(array(
2875
- 'hide'=>true,
2876
- 'title'=>__('Removes small arrow that appears on the top button hover', 'ag-custom-admin'),
2877
- 'name'=>'agca_admin_menu_arrow',
2878
- 'label'=>__('Hide sub-menu arrow', 'ag-custom-admin'),
2879
- ));
2880
-
2881
- $this->print_checkbox(array(
2882
- 'hide'=>true,
2883
- 'title'=>__('Removes collapse button at the end of admin menu', 'ag-custom-admin'),
2884
- 'name'=>'agca_admin_menu_collapse_button',
2885
- 'label'=>__('Hide "Collapse menu" button', 'ag-custom-admin'),
2886
- ));
2887
-
2888
- $this->print_checkbox(array(
2889
- 'title'=>__('Rounds submenu pop-up box', 'ag-custom-admin'),
2890
- 'name'=>'agca_admin_menu_submenu_round',
2891
- 'label'=>__('Round sub-menu pop-up box', 'ag-custom-admin'),
2892
- 'input-attributes'=>'data-dependant="#agca_admin_menu_submenu_round_size"',
2893
- 'input-class'=>'has-dependant',
2894
- ));
2895
-
2896
- $this->print_input(array(
2897
- 'attributes'=>array(
2898
- 'style'=> ((get_option('agca_admin_menu_submenu_round')!='true')?'display:none':''),
2899
- 'id'=>'agca_admin_menu_submenu_round_size'
2900
- ),
2901
- 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2902
- 'name'=>'agca_admin_menu_submenu_round_size',
2903
- 'label'=>__('Round sub-menu pop-up box - size', 'ag-custom-admin'),
2904
- 'input-class'=>'validateNumber',
2905
- 'hint'=>__('(Size in px)', 'ag-custom-admin')
2906
- ));
2907
-
2908
- $this->print_input(array(
2909
- 'title'=>__('Adds custom logo above the admin menu', 'ag-custom-admin'),
2910
- 'name'=>'agca_admin_menu_brand',
2911
- 'label'=>__('Admin menu branding logo', 'ag-custom-admin'),
2912
- 'hint'=>__('Image URL', 'ag-custom-admin')
2913
- ));
2914
-
2915
- $this->print_input(array(
2916
- 'title'=>__('Change branding logo link</br></br>Use:', 'ag-custom-admin').'</br><strong>%BLOG%</strong> - '. __('for blog URL', 'ag-custom-admin'),
2917
- 'name'=>'agca_admin_menu_brand_link',
2918
- 'label'=>__('Branding logo link', 'ag-custom-admin'),
2919
- 'hint'=>__('Branding image URL', 'ag-custom-admin')
2920
- ));
2921
- ?>
2922
- </table>
2923
- </div>
2924
- <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2925
- <h2 class="section_title"><?php _e('Colorizer Page', 'ag-custom-admin'); ?></h2>
2926
- <?php $this->show_save_button_upper(); ?>
2927
- <table class="form-table" width="500px">
2928
- <tr valign="center" class="ag_table_major_options">
2929
- <td><label for="agca_colorizer_turnonoff"><strong><?php _e('Apply Colorizer customizations', 'ag-custom-admin'); ?></strong></label></td>
2930
- <td><input class="agca-checkbox visibility" type="checkbox" name="agca_colorizer_turnonoff" value="on" <?php if (get_option('agca_colorizer_turnonoff')==true) echo 'checked="checked" '; ?> /></td>
2931
- </tr>
2932
- <?php
2933
- $this->print_options_h3(__('Global Color Options', 'ag-custom-admin'));
2934
-
2935
- $this->print_color('color_background',__('Background:', 'ag-custom-admin'),__('Change admin page background color', 'ag-custom-admin'));
2936
- $this->print_color('login_color_background',__('Login page background:', 'ag-custom-admin'),__('Change login page background color', 'ag-custom-admin'));
2937
- $this->print_color('color_header',__('Admin bar:', 'ag-custom-admin'),__('Change admin bar (on top) color in admin panel', 'ag-custom-admin'));
2938
-
2939
- $this->print_options_h3(__('Admin Menu Color Options', 'ag-custom-admin'));
2940
-
2941
- $this->print_color('color_admin_menu_top_button_background',__('Button background:', 'ag-custom-admin'),__('Change button background color', 'ag-custom-admin'));
2942
- $this->print_color('color_admin_menu_font',__('Button text:', 'ag-custom-admin'),__('Change button text color', 'ag-custom-admin'));
2943
- $this->print_color('color_admin_menu_top_button_current_background',__('Selected button background:', 'ag-custom-admin'),__('Change button background color for current button', 'ag-custom-admin'));
2944
- $this->print_color('color_admin_menu_top_button_hover_background',__('Hover button background:', 'ag-custom-admin'),__('Change button background color on mouseover', 'ag-custom-admin'));
2945
- $this->print_color('color_admin_menu_submenu_background',__('Sub-menu button background:', 'ag-custom-admin'),__('Change submenu item background color', 'ag-custom-admin'));
2946
- $this->print_color('color_admin_menu_submenu_background_hover',__('Sub-menu hover button background:', 'ag-custom-admin'),__('Change submenu item background color on mouseover', 'ag-custom-admin'));
2947
- $this->print_color('color_admin_submenu_font',__('Sub-menu text:', 'ag-custom-admin'),__('Sub-menu text color', 'ag-custom-admin'));
2948
- $this->print_color('color_admin_menu_behind_background',__('Wrapper background:', 'ag-custom-admin'),__('Change background color of element behind admin menu', 'ag-custom-admin'));
2949
-
2950
- $this->print_options_h3(__('Font Color Options', 'ag-custom-admin'));
2951
-
2952
- $this->print_color('color_font_content',__('Content text:', 'ag-custom-admin'),__('Change color in content text', 'ag-custom-admin'));
2953
- $this->print_color('color_font_header',__('Admin bar text:', 'ag-custom-admin'),__('Change color of admin bar text', 'ag-custom-admin'));
2954
- $this->print_color('color_font_footer',__('Footer text:', 'ag-custom-admin'),__('Change color in footer text', 'ag-custom-admin'));
2955
-
2956
- $this->print_options_h3(__('Widgets Color Options', 'ag-custom-admin'));
2957
-
2958
- $this->print_color('color_widget_bar',__('Title bar background:', 'ag-custom-admin'),__('Change color in header text', 'ag-custom-admin'));
2959
- $this->print_color('color_widget_background',__('Background:', 'ag-custom-admin'),__('Change widget background color', 'ag-custom-admin'));
2960
-
2961
- ?>
2962
- </table>
2963
- <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
2964
- <div id="picker"></div>
2965
- </div>
2966
- <?php if(defined('AGCA_THEMES')){ ?>
2967
- <div id="section_templates" style="display:none" class="ag_section">
2968
- <h2 class="section_title"><span style="float:left"><?php _e('Admin Themes', 'ag-custom-admin'); ?></span></h2>
2969
- <table class="form-table" width="500px">
2970
- <tr valign="center">
2971
- <td>
2972
- <p style="color: red; font-size:15px;font-weight:bold;margin-bottom:20px;">Note: AGCA Themes will be discontinued soon!</p>
2973
- <div id="agca_templates"></div>
2974
- </td>
2975
- </tr>
2976
- <tr>
2977
- <td>
2978
- <div id="advanced_template_options" style="display:none">
2979
- <div class="agca-feedback-and-support">
2980
- <ul>
2981
- <?php /* <li><a href="https://wordpressadminpanel.com/agca-support/contact/?type=theme" title="<?php _e('If you have any ideas for theme improvements, or you have new themes requests, please feel free to send us a message', 'ag-custom-admin'); ?>" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;<?php _e('Submit your admin themes ideas', 'ag-custom-admin'); ?></a></li>*/ ?>
2982
- <li><a style="background: #f08080;color:#fff;" href="javascript:agca_removeAllTemplates();" title="<?php _e('WARNING: All installed themes will be removed. To activate them again, you would need to install theme and activate using valid license keys. Free themes can be installed again.', 'ag-custom-admin'); ?>"><span style="color:#fff" class="dashicons dashicons-trash"></span>&nbsp;&nbsp;<?php _e('Uninstall all installed themes', 'ag-custom-admin'); ?></a></li>
2983
- </ul>
2984
- </div>
2985
- </div>
2986
- </td>
2987
- </tr>
2988
- </table>
2989
- </div>
2990
- <?php } ?>
2991
- <div id="section_advanced" style="display:none" class="ag_section">
2992
- <h2 class="section_title"><?php _e('Advanced', 'ag-custom-admin'); ?></h2>
2993
- <?php $this->show_save_button_upper(); ?>
2994
- <table class="form-table" width="500px">
2995
- <tr valign="center">
2996
- <td colspan="2">
2997
- <p class="agca-tip"><i><?php _e('<strong>Note: </strong>These options will override existing customizations', 'ag-custom-admin'); ?></i></p>
2998
- </td><td></td>
2999
- </tr>
3000
- <tr valign="center">
3001
- <th scope="row">
3002
- <label title="<?php _e('Add custom CSS script to override existing styles', 'ag-custom-admin'); ?>" for="agca_script_css"><?php _e('Custom CSS script', 'ag-custom-admin'); ?></em></label>
3003
- </th>
3004
- <td>
3005
- <textarea style="width:100%;height:200px" title="<?php _e('Add custom CSS script to override existing styles', 'ag-custom-admin'); ?>" rows="5" id="agca_custom_css" name="agca_custom_css" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_css')); ?></textarea>
3006
- </td>
3007
- </tr>
3008
- <tr valign="center">
3009
- <th scope="row">
3010
- <label title="<?php _e('Add additional custom JavaScript', 'ag-custom-admin'); ?>" for="agca_custom_js"><?php _e('Custom JavaScript', 'ag-custom-admin'); ?></label>
3011
- </th>
3012
- <td>
3013
- <textarea style="width:100%;height:200px" title="<?php _e('Add additional custom JavaScript', 'ag-custom-admin'); ?>" rows="5" name="agca_custom_js" id="agca_custom_js" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_js')); ?></textarea>
3014
- </td>
3015
- </tr>
3016
- <?php
3017
- $this->print_checkbox(array(
3018
- 'title'=>__('Temporary enable this option if you are experiencing any problems with saving AGCA options. Please turn it off after you are done with your customizations.', 'ag-custom-admin'),
3019
- 'name'=>'agca_disable_postver',
3020
- 'label'=>__('Temporary disable POST verification', 'ag-custom-admin'),
3021
- ));
3022
- ?>
3023
- <tr valign="center">
3024
- <th scope="row">
3025
- <label title="<?php _e('Export / import settings', 'ag-custom-admin'); ?>" for="agca_export_import"><?php _e('Export / import settings', 'ag-custom-admin'); ?></label>
3026
- </th>
3027
- <td id="import_file_area">
3028
- <input class="agca_button" type="button" name="agca_export_settings" value="<?php _e('Export Settings', 'ag-custom-admin'); ?>" onclick="exportSettings();"/></br>
3029
- <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
3030
- <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
3031
- <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
3032
- <input class="agca_button" type="button" name="agca_import_settings" value="<?php _e('Import Settings', 'ag-custom-admin'); ?>" onclick="importSettings();"/>
3033
- </td>
3034
- </tr>
3035
- </table>
3036
- </div>
3037
- <?php $this->show_save_button(); ?>
3038
- </form>
3039
- <form id="agca_templates_form" name="agca_templates_form" action="<?php echo get_site_url().$_SERVER['PHP_SELF'];?>?page=ag-custom-admin/plugin.php" method="post">
3040
- <?php wp_nonce_field('agca_form','_agca_token'); ?>
3041
- <input type="hidden" name="_agca_save_template" value="true" />
3042
- <input type="hidden" id="templates_data" name="templates_data" value="" />
3043
- <input type="hidden" id="templates_name" name="templates_name" value="" />
3044
- </form>
3045
- </div>
3046
- <?php
3047
- }
3048
-
3049
- #region PRIVATE METHODS
3050
- function show_save_button_upper(){
3051
- ?>
3052
- <div class="save-button-upper">
3053
- <?php $this->show_save_button() ?>
3054
- </div>
3055
- <?php
3056
- }
3057
- function show_save_button(){
3058
- ?>
3059
- <p class="submit agca-clear">
3060
- <input type="button" id="save_plugin_settings" style="padding:0px" title="<?php _e('Save AGCA configuration', 'ag-custom-admin'); ?>" class="button-primary" value="<?php _e('Save Changes') ?>" onClick="savePluginSettings()" />
3061
- </p>
3062
- <?php
3063
- }
3064
-
3065
- function print_checkbox($data){
3066
- $strAttributes = '';
3067
- $strOnchange = '';
3068
- $strInputClass='';
3069
- $strInputAttributes='';
3070
- $isChecked = false;
3071
-
3072
- if(isset($data['attributes'])){
3073
- foreach($data['attributes'] as $key=>$val){
3074
- $strAttributes.=' '.$key.'="'.$val.'"';
3075
- }
3076
- }
3077
- if(isset($data['input-class'])){
3078
- $strInputClass = $data['input-class'];
3079
- }
3080
- if(isset($data['hide'])){
3081
- $strInputClass .= " visibility";
3082
- }
3083
- if(isset($data['input-attributes'])){
3084
- $strInputAttributes = $data['input-attributes'];
3085
- }
3086
- if(isset($data['onchange'])){
3087
- $strOnchange = $data['onchange'];
3088
- }
3089
- if(!isset($data['title'])){
3090
- $data['title'] = $data['label'];
3091
- }
3092
- if(isset($data['checked'])){
3093
- $isChecked = $data['checked'];
3094
- }else{
3095
- //use default check with the option
3096
- $isChecked = get_option($data['name'])==true;
3097
- }
3098
- ?>
3099
- <tr valign="center" <?php echo $strAttributes ?> >
3100
- <th>
3101
- <label tabindex="0" title='<?php echo $data['title'] ?>' for="<?php echo $data['name'] ?>" ><?php echo $data['label'] ?></label>
3102
- </th>
3103
- <td>
3104
- <input type="checkbox" class="agca-checkbox <?php echo $strInputClass ?> " <?php echo $strOnchange ?> <?php echo $strInputAttributes ?> title='<?php _e('Toggle on/off', 'ag-custom-admin'); ?>' name="<?php echo $data['name'] ?>" value="true" <?php echo ($isChecked)?' checked="checked"':'' ?> />
3105
- </td>
3106
- </tr>
3107
- <?php
3108
- }
3109
- function print_input($data){
3110
- $strHint = '';
3111
- $suffix ='';
3112
- $strAttributes = '';
3113
- $parentAttr = '';
3114
- if(isset($data['hint'])){
3115
- $strHint = '&nbsp;<p><i>'.$data['hint'].'</i></p>';
3116
- }
3117
- if(!isset($data['title'])){
3118
- $data['title'] = $data['label'];
3119
- }
3120
- if(isset($data['suffix'])){
3121
- $suffix = $data['suffix'];
3122
- }
3123
- if(isset($data['attributes'])){
3124
- foreach($data['attributes'] as $key=>$val){
3125
- $strAttributes.=' '.$key.'="'.$val.'"';
3126
- }
3127
- }
3128
- ?>
3129
- <tr valign="center" <?php echo $strAttributes ?> >
3130
- <th >
3131
- <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3132
- </th>
3133
- <td>
3134
- <input id="<?php echo $data['name'] ?>" title="<?php echo $data['title'] ?>" type="text" size="47" name="<?php echo $data['name'] ?>" value="<?php echo get_option($data['name']); ?>" />
3135
- <a title="<?php _e('Clear', 'ag-custom-admin'); ?>" class="agca_button clear" onClick="jQuery('#<?php echo $data['name'] ?>').val('');"><span class="dashicons clear dashicons-no-alt"></span></a><?php echo $suffix ?>
3136
- <?php echo $strHint ?>
3137
- </td>
3138
- </tr>
3139
- <?php
3140
- }
3141
- function print_textarea($data){
3142
- $strHint = '';
3143
- $strClass = '';
3144
- if(isset($data['hint'])){
3145
- $strHint = '&nbsp;<p><i>'.$data['hint'].'</i>.</p>';
3146
- }
3147
- if(!isset($data['title'])){
3148
- $data['title'] = $data['label'];
3149
- }
3150
- if(isset($data['class'])){
3151
- $strClass = $data['class'];
3152
- }
3153
- ?>
3154
- <tr valign="center">
3155
- <th scope="row">
3156
- <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3157
- </th>
3158
- <td>
3159
- <textarea <?php echo !empty($strClass)?'class="'.$strClass.'"':''; ?> title="<?php echo $data['title'] ?>" rows="5" name="<?php echo $data['name'] ?>" cols="40"><?php echo htmlspecialchars(get_option($data['name'])); ?></textarea>
3160
- <?php echo $strHint ?>
3161
- </td>
3162
- </tr>
3163
- <?php
3164
- }
3165
- function print_color($name, $label, $title){
3166
- ?>
3167
- <tr valign="center" class="color">
3168
- <th><label title="<?php echo $title ?>" for="<?php echo $name ?>"><?php echo $label ?></label></th>
3169
- <td><input type="text" placeholder="#" id="<?php echo $name ?>" name="<?php echo $name ?>" class="color_picker" value="<?php echo $this->getAGCAColor($name); ?>" />
3170
- <a title="<?php _e('Pick Color', 'ag-custom-admin'); ?>" alt="<?php echo $name ?>" class="pick_color_button agca_button"><span class="dashicons dashicons-art"></span></a>
3171
- <a title="<?php _e('Clear', 'ag-custom-admin'); ?>" alt="<?php echo $name ?>" class="pick_color_button_clear agca_button" ><span class="dashicons clear dashicons-no-alt"></span></a>
3172
- </td>
3173
- </tr>
3174
- <?php
3175
- }
3176
- function print_options_h3($title){
3177
- ?>
3178
- <tr valign="center">
3179
- <td colspan="2">
3180
- <div class="ag_table_heading"><h3 tabindex="0"><?php echo $title ?></h3></div>
3181
- </td>
3182
- <td></td>
3183
- </tr>
3184
- <?php
3185
- }
3186
- function print_option_tr(){
3187
- ?>
3188
-
3189
- <tr valign="center">
3190
- <th><label title="<?php _e('Change submenu item background color', 'ag-custom-admin'); ?>" for="color_admin_menu_submenu_background"><?php _e('Submenu button background color:', 'ag-custom-admin'); ?></label></th>
3191
- <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_background'); ?>" />
3192
- <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button agca_button" value="<?php _e('Pick color', 'ag-custom-admin'); ?>" />
3193
- <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear agca_button" value="<?php _e('Clear', 'ag-custom-admin'); ?>" />
3194
- </td>
3195
- </tr>
3196
- <?php
3197
- }
3198
- #endregion
3199
-
3200
- }
3201
  //TODO: Add log out button to the admin menu
1
+ <?php
2
+ /*
3
+ Plugin Name: Absolutely Glamorous Custom Admin
4
+ Plugin URI: https://wordpressadminpanel.com/ag-custom-admin/
5
+ Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes.
6
+ Author: Cusmin
7
+ Version: 6.5.3
8
+ Text Domain: ag-custom-admin
9
+ Domain Path: /languages
10
+ Author URI: https://cusmin.com
11
+
12
+ Copyright 2017. WAP (email : info@wordpressadminpanel.com)
13
+
14
+ This program is free software: you can redistribute it and/or modify
15
+ it under the terms of the GNU General Public License as published by
16
+ the Free Software Foundation, either version 3 of the License, or
17
+ (at your option) any later version.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
26
+ */
27
+
28
+ $agca = new AGCA();
29
+
30
+ class AGCA{
31
+ private $colorizer="";
32
+ private $agca_version;
33
+ private $agca_debug = false;
34
+ private $admin_capabilities;
35
+ private $context = "";
36
+ private $saveAfterImport = false;
37
+ private $templateCustomizations = "";
38
+ private $templates_ep = "https://wordpressadminpanel.com/configuration.php";
39
+
40
+ public function __construct()
41
+ {
42
+ add_action('init', array(&$this,'init'));
43
+ }
44
+
45
+ function init(){
46
+ $this->reloadScript();
47
+ $this->checkPOST();
48
+ $this->checkGET();
49
+
50
+ if(function_exists("add_filter")){
51
+ add_filter('admin_title', array(&$this,'change_title'), 10, 2);
52
+ add_filter('plugin_row_meta', array(&$this,'jk_filter_plugin_links'), 10, 2);
53
+ }
54
+
55
+ add_action('admin_init', array(&$this,'admin_init'));
56
+ add_action('login_init', array(&$this,'login_init'));
57
+ add_action('admin_head', array(&$this,'print_admin_css'));
58
+ add_action('login_head', array(&$this,'print_login_head'));
59
+ add_action('admin_menu', array(&$this,'agca_create_menu'));
60
+ add_action('wp_head', array(&$this,'print_page'));
61
+ //add_action( 'wp_before_admin_bar_render', array(&$this,'admin_bar_changes') );
62
+ add_action( 'plugins_loaded', array(&$this,'load_plugin_textdomain') );
63
+ register_deactivation_hook(__FILE__, array(&$this,'agca_deactivate'));
64
+
65
+ add_action( 'customize_controls_enqueue_scripts', array(&$this,'agca_customizer_php') );
66
+
67
+ add_action( 'admin_bar_menu', array(&$this,'wp_admin_bar_my_custom_account_menu'), 11 );
68
+
69
+ /* wp_localize_script(
70
+ 'agca-script',//use agca enqueued script
71
+ 'agca_string',
72
+ $this->get_language_strings()
73
+ );*/
74
+
75
+ /*Initialize properties*/
76
+ $this->colorizer = $this->jsonMenuArray(get_option('ag_colorizer_json'),'colorizer');
77
+
78
+ $this->agca_version = "6.5.3";
79
+ }
80
+
81
+ function load_plugin_textdomain() {
82
+ load_plugin_textdomain( 'ag-custom-admin', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
83
+ }
84
+
85
+ // Add donate and support information
86
+ function jk_filter_plugin_links($links, $file)
87
+ {
88
+ if ( $file == plugin_basename(__FILE__) )
89
+ {
90
+ if(!is_network_admin()){
91
+ $links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php#general-settings">' . __('Settings', 'ag-custom-admin') . '</a>';
92
+ //$links[] = '<a href="tools.php?page=ag-custom-admin/plugin.php#ag-templates">' . __('Admin Themes', 'ag-custom-admin') . '</a>';
93
+ }
94
+ $links[] = '<a target="_blank" href="https://wordpress.org/support/plugin/ag-custom-admin">' . __('Support', 'ag-custom-admin') . '</a>';
95
+ $links[] = '<a target="_blank" href="https://cusmin.com/upgrade-to-cusmin?ref=plugins">' . __('Upgrade', 'ag-custom-admin') . '</a>';
96
+ $links[] = '<a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development">' . __('Donate', 'ag-custom-admin') . '</a>';
97
+ }
98
+ return $links;
99
+ }
100
+
101
+
102
+ function filePath($url){
103
+ $absPath = ABSPATH;
104
+ $absPath = rtrim($absPath, '/');
105
+ $url = ltrim($url, '/');
106
+ return $absPath.'/'.$url;
107
+ }
108
+
109
+ function change_admin_color(){
110
+ return 'default';
111
+ }
112
+
113
+ function agca_customizer_php(){
114
+ $this->agca_get_includes();
115
+ }
116
+
117
+ function admin_init(){
118
+ $this->agca_register_settings();
119
+ $this->agca_init_session();
120
+ $isAdminUser = current_user_can($this->admin_capability());
121
+ if(!$isAdminUser || ($isAdminUser && !get_option('agca_role_allbutadmin'))){
122
+ if(get_option('agca_profile_color_scheme')){
123
+ remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
124
+ }
125
+ }
126
+ }
127
+
128
+ function login_init(){
129
+ $this->agca_enqueue_scripts();
130
+ }
131
+
132
+ function agca_init_session(){
133
+ if (!session_id())
134
+ session_start();
135
+ }
136
+
137
+ function checkGET(){
138
+ if(isset($_GET['agca_action'])){
139
+ if($_GET['agca_action'] =="remove_templates"){
140
+ $this->delete_template_images_all();
141
+ update_option('agca_templates', "");
142
+ update_option('agca_selected_template', "");
143
+ }
144
+ }
145
+ if(isset($_GET['agca_debug'])){
146
+ if($_GET['agca_debug'] =="true"){
147
+ $this->agca_debug = true;
148
+ }else{
149
+ $this->agca_debug = false;
150
+ }
151
+ }
152
+ }
153
+
154
+ function checkPOST(){
155
+ if(isset($_POST['_agca_save_template'])){
156
+ $this->verifyPostRequest();
157
+ //print_r($_POST);
158
+ $data = $_POST['templates_data'];
159
+ $parts = explode("|||",$data);
160
+
161
+ $common_data = $parts [0];
162
+ $admin_js = $parts [1];
163
+ $admin_css = $parts [2];
164
+ $login_js = $parts [3];
165
+ $login_css = $parts [4];
166
+ $settings = $parts [5];
167
+ $images = $parts [6];
168
+
169
+ $template_name = $_POST['templates_name'];
170
+
171
+ update_option('agca_selected_template', $template_name);
172
+
173
+ $templates = get_option( 'agca_templates' );
174
+ if($templates == ""){
175
+ $templates = array();
176
+ }
177
+
178
+ $templates[$template_name] = array(
179
+ 'common'=>$common_data,
180
+ 'admin'=>"",
181
+ 'adminjs'=>$admin_js,
182
+ 'admincss'=>$admin_css,
183
+ 'login'=>"",
184
+ 'loginjs'=>$login_js,
185
+ 'logincss'=>$login_css,
186
+ 'images'=>$images,
187
+ 'settings'=>$settings
188
+ );
189
+ update_option('agca_templates', $templates);
190
+
191
+ $_POST = array();
192
+
193
+ }else if(isset($_POST['_agca_templates_session'])){
194
+ $this->verifyPostRequest();
195
+ $this->agcaAdminSession();
196
+ if($_POST['template'] !="")
197
+ $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
198
+
199
+ //print_r($_SESSION);
200
+ echo "_agca_templates_session:OK";
201
+ exit;
202
+ }else if(isset($_POST['_agca_templates_session_remove_license'])){
203
+ $this->verifyPostRequest();
204
+ $this->agcaAdminSession();
205
+ if($_POST['template'] !="")
206
+ $_SESSION["AGCA"]["Templates"][$_POST['template']] = null;
207
+ print_r($_SESSION);
208
+ echo "_agca_templates_session_remove_license:OK";
209
+ exit;
210
+ }else if(isset($_POST['_agca_get_templates'])){
211
+ $this->verifyPostRequest();
212
+ $templates = get_option( 'agca_templates' );
213
+ if($templates == "") $templates = array();
214
+ $results = array();
215
+ foreach($templates as $key=>$val){
216
+ $results[]=$key;
217
+ }
218
+ echo json_encode($results);
219
+ exit;
220
+ }else if(isset($_POST['_agca_activate_template'])){
221
+ $this->verifyPostRequest();
222
+ update_option('agca_selected_template', $_POST['_agca_activate_template']);
223
+ $_POST = array();
224
+ //unset($_POST);
225
+ exit;
226
+ }else if(isset($_POST['_agca_template_settings'])){
227
+ $this->verifyPostRequest();
228
+ $settings = $_POST['_agca_template_settings'];
229
+
230
+ $templates = get_option( 'agca_templates' );
231
+ if($templates == ""){
232
+ $templates = array();
233
+ }
234
+ $template_name = $_POST["_agca_current_template"];
235
+
236
+ $templates[$template_name]["settings"] = $settings;
237
+ update_option('agca_templates', $templates);
238
+
239
+ $_POST = array();
240
+ //print_r($templates);
241
+ exit;
242
+ }else if(isset($_POST['_agca_upload_image'])){
243
+ $this->verifyPostRequest();
244
+ function my_sideload_image() {
245
+ $remoteurl = $_POST['_agca_upload_image'];
246
+ $file = media_sideload_image( $remoteurl, 0 ,__("Absolutely Glamorous Custom Admin theme image (do not delete)", 'ag-custom-admin'));
247
+ try{
248
+ $fileparts = explode("src='", $file);
249
+ $url=explode("'",$fileparts[1]);
250
+ echo $url[0];
251
+ }catch (\Exception $e){}
252
+ exit;
253
+ }
254
+ add_action( 'admin_init', 'my_sideload_image' );
255
+
256
+ }else if(isset($_POST['_agca_remove_template_images'])){
257
+ $this->verifyPostRequest();
258
+ $this->delete_template_images($_POST['_agca_remove_template_images']);
259
+ exit;
260
+ }
261
+ }
262
+
263
+ function verifyPostRequest(){
264
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
265
+ if (!is_admin()) {
266
+ _e('Not allowed. This action is allowed exclusively in admin panel', 'ag-custom-admin');
267
+ exit;
268
+ }
269
+ //In case of problems with saving AGCA settings on MS disable verification temporary
270
+ if(get_option('agca_disable_postver')){
271
+ return;
272
+ }
273
+ if (is_multisite()) {
274
+ $blog_id = get_current_blog_id();
275
+ $user_id = get_current_user_id();
276
+ $msError = __('Please try temporary disabling POST verification. Go to Absolutely Glamorous Custom Admin -> Advanced -> Temporary disable POST verification. Do not forget to un-check this option once you are done with customizations.', 'ag-custom-admin');
277
+ if (is_user_member_of_blog($user_id, $blog_id)) {
278
+ if (!current_user_can('manage_options')) {
279
+ _e('Multi-site: Current user is not recognized as administrator.', 'ag-custom-admin');
280
+ echo ' '.$msError;
281
+ exit;
282
+ }
283
+ } else {
284
+ printf(
285
+ /*translators: 1: User Id 2: Blog Id*/
286
+ __('Multi-site: User (%1$s) does not have access to this blog (%2$s).', 'ag-custom-admin'),
287
+ $user_id,
288
+ $blog_id
289
+ );
290
+ echo ' '. $msError;
291
+ exit;
292
+ }
293
+ } else {
294
+ include_once($this->filePath('wp-includes/pluggable.php'));
295
+ if (!is_user_logged_in() || !current_user_can('manage_options')) {
296
+ echo !is_user_logged_in() ? __('User is not logged in.', 'ag-custom-admin').' ' : '';
297
+ echo !current_user_can('manage_options') ? __('User can not manage options.', 'ag-custom-admin').' ' : '';
298
+ exit;
299
+ }
300
+ }
301
+ if (!wp_verify_nonce($_POST['_agca_token'], 'agca_form')) {
302
+ echo __('Nonce verification failed.', 'ag-custom-admin');
303
+ exit;
304
+ }
305
+ }
306
+ }
307
+
308
+ function get_language_strings() {
309
+ $strings = array(
310
+
311
+ );
312
+ return $strings;
313
+ }
314
+
315
+ function admin_bar_changes(){
316
+ if( current_user_can( 'manage_options' )){
317
+ global $wp_admin_bar;
318
+ if(!is_network_admin()){
319
+ $wp_admin_bar->add_menu( array(
320
+ 'id' => 'agca-admin-themes',
321
+ 'title' => '<span class="ab-icon"></span>'.__( 'Admin Themes', 'ag-custom-admin' ),
322
+ 'href' => 'tools.php?page=ag-custom-admin/plugin.php#ag-templates'
323
+ ));
324
+ }
325
+ }
326
+ }
327
+
328
+ function delete_template_images_all(){
329
+ $templates = get_option('agca_templates');
330
+ if($templates != null && $templates != ""){
331
+ foreach($templates as $template){
332
+ if($template != null && $template['images'] != null && $template['images'] != ""){
333
+ //print_r($template['images']);
334
+ $imgs = explode(',',$template['images']);
335
+ foreach($imgs as $imageSrc){
336
+ $this->delete_attachment_by_src($imageSrc);
337
+ }
338
+ //print_r($imgs);
339
+ }
340
+ }
341
+ }
342
+ //print_r($templates);
343
+ }
344
+
345
+ function delete_template_images($template_name){
346
+ $templates = get_option('agca_templates');
347
+ if($templates != null && $templates != ""){
348
+ $template = $templates[$template_name];
349
+ if($template != null && $template['images'] != null && $template['images'] != ""){
350
+ //print_r($template['images']); exit;
351
+ $imgs = explode(',',$template['images']);
352
+ foreach($imgs as $imageSrc){
353
+ $this->delete_attachment_by_src($imageSrc);
354
+ }
355
+ //print_r($imgs);
356
+ }
357
+ }
358
+ //print_r($templates);
359
+ }
360
+
361
+ function delete_attachment_by_src ($image_src) {
362
+ global $wpdb;
363
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
364
+ $id = $wpdb->get_var($query);
365
+ wp_delete_attachment( $id, $true );
366
+ }
367
+
368
+ function get_installed_agca_templates(){
369
+ $templates = get_option( 'agca_templates' );
370
+ if($templates == "")return '[]';
371
+ $results = array();
372
+ foreach($templates as $key=>$val){
373
+ $results[]=$key;
374
+ }
375
+ return json_encode($results);
376
+ }
377
+
378
+ function isGuest(){
379
+ global $user_login;
380
+ if($user_login) {
381
+ return false;
382
+ }else{
383
+ return true;
384
+ }
385
+ }
386
+ function change_title($admin_title, $title){
387
+ //return get_bloginfo('name').' - '.$title;
388
+ if(get_option('agca_custom_title')!=""){
389
+ $blog = get_bloginfo('name');
390
+ $page = $title;
391
+ $customTitle = get_option('agca_custom_title');
392
+ $customTitle = str_replace('%BLOG%',$blog,$customTitle);
393
+ $customTitle = str_replace('%PAGE%',$page,$customTitle);
394
+ return $customTitle;
395
+ }else{
396
+ return $admin_title;
397
+ }
398
+ }
399
+ function agca_get_includes() {
400
+ ?>
401
+ <script type="text/javascript">
402
+ <?php
403
+ //AGCA GLOBALS
404
+ echo "var agca_global_plugin_url = '".$this->pluginUrl()."';";
405
+ ?>
406
+ </script>
407
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
408
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>require/dynamic.php?type=css&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>" />
409
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
410
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>require/dynamic.php?type=js&context=<?php echo $this->context; ?>&ver=<?php echo "changed_theme"; ?>"></script>
411
+
412
+ <?php
413
+ if($this->context == "login"){
414
+ ?>
415
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/login.min.css" />
416
+ <?php
417
+ }else{
418
+ ?>
419
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/admin.min.css" />
420
+ <?php
421
+ }
422
+ ?>
423
+ <?php
424
+ echo $this->templateCustomizations;
425
+
426
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
427
+ ?>
428
+ <style type="text/css">
429
+ <?php
430
+ echo get_option('agca_custom_css');
431
+ ?>
432
+ </style>
433
+ <script type="text/javascript">
434
+ try{
435
+ eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
436
+ }catch(e){
437
+ alert('AGCA: <?php _e('There is an error in your custom JS script. Please fix it:', 'ag-custom-admin'); ?> \n\n' + e + '\n\n (<?php _e('AGCA -> Advanced -> Custom JavaScript', 'ag-custom-admin'); ?>)');
438
+ console.log(e);
439
+ }
440
+ </script>
441
+ <?php
442
+ }
443
+ }
444
+
445
+ function agca_enqueue_scripts() {
446
+ wp_enqueue_script('jquery');
447
+ //TODO: Use this instead of manually adding scripts
448
+ //wp_enqueue_script('agca-script', __FILE__.'/script/ag_script.js', array('jquery'),$this->agca_version );
449
+ }
450
+
451
+ function WPSPluginIsLoginPage(){
452
+ $WPSPluginName = 'wps-hide-login/wps-hide-login.php';
453
+ if(is_multisite()){
454
+ if ( ! function_exists( 'is_plugin_active_for_network' ) ){
455
+ $pluginPhpFilePath = $this->filePath('wp-admin/includes/plugins.php');
456
+ if(!file_exists($pluginPhpFilePath)){
457
+ return '';
458
+ }
459
+ require_once($pluginPhpFilePath);
460
+ }
461
+
462
+ if(!$this->isPluginActiveForNetwork($WPSPluginName)){
463
+ return '';
464
+ }
465
+ }else{
466
+ if(!$this->isPluginActive($WPSPluginName)){
467
+ return '';
468
+ }
469
+ }
470
+
471
+ if ( $slug = get_option( 'whl_page' ) ) {
472
+ return $slug;
473
+ } else if ( ( is_multisite() && $this->isPluginActiveForNetwork($WPSPluginName) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
474
+ return $slug;
475
+ } else if ( $slug = 'login' ) {
476
+ return $slug;
477
+ }
478
+ $requestURI = $_SERVER['REQUEST_URI'];
479
+ return $this->startsWith('/'.$slug.'/', $requestURI);
480
+ }
481
+
482
+ function reloadScript(){
483
+ $isAdmin = false;
484
+ if(defined('WP_ADMIN') && WP_ADMIN == 1){
485
+ $isAdmin = true;
486
+ }
487
+ if($isAdmin || $this->WPSPluginIsLoginPage()){
488
+ $this->agca_enqueue_scripts();
489
+ }
490
+ }
491
+
492
+ function agca_register_settings() {
493
+ register_setting( 'agca-options-group', 'agca_role_allbutadmin' );
494
+ register_setting( 'agca-options-group', 'agca_screen_options_menu' );
495
+ register_setting( 'agca-options-group', 'agca_help_menu' );
496
+ register_setting( 'agca-options-group', 'agca_logout' );
497
+ register_setting( 'agca-options-group', 'agca_remove_your_profile' );
498
+ register_setting( 'agca-options-group', 'agca_logout_only' );
499
+ register_setting( 'agca-options-group', 'agca_custom_title' );
500
+ register_setting( 'agca-options-group', 'agca_howdy' );
501
+ register_setting( 'agca-options-group', 'agca_header' );
502
+ register_setting( 'agca-options-group', 'agca_header_show_logout' );
503
+ register_setting( 'agca-options-group', 'agca_footer' );
504
+ register_setting( 'agca-options-group', 'agca_privacy_options' );
505
+ register_setting( 'agca-options-group', 'agca_header_logo' );
506
+ register_setting( 'agca-options-group', 'agca_header_logo_custom' );
507
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
508
+ register_setting( 'agca-options-group', 'agca_remove_site_link' );
509
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
510
+ register_setting( 'agca-options-group', 'agca_profile_color_scheme' );
511
+
512
+ register_setting( 'agca-options-group', 'agca_site_heading' );
513
+ register_setting( 'agca-options-group', 'agca_custom_site_heading' );
514
+ register_setting( 'agca-options-group', 'agca_update_bar' );
515
+
516
+ register_setting( 'agca-options-group', 'agca_footer_left' );
517
+ register_setting( 'agca-options-group', 'agca_footer_left_hide' );
518
+ register_setting( 'agca-options-group', 'agca_footer_right' );
519
+ register_setting( 'agca-options-group', 'agca_footer_right_hide' );
520
+
521
+ register_setting( 'agca-options-group', 'agca_login_banner' );
522
+ register_setting( 'agca-options-group', 'agca_login_banner_text' );
523
+ register_setting( 'agca-options-group', 'agca_login_photo_remove' );
524
+ register_setting( 'agca-options-group', 'agca_login_photo_url' );
525
+ register_setting( 'agca-options-group', 'agca_login_photo_href' );
526
+ register_setting( 'agca-options-group', 'agca_login_round_box' );
527
+ register_setting( 'agca-options-group', 'agca_login_round_box_size' );
528
+
529
+ register_setting( 'agca-options-group', 'agca_dashboard_icon' );
530
+ register_setting( 'agca-options-group', 'agca_dashboard_text' );
531
+ register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
532
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_welcome' );
533
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_activity' );
534
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
535
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
536
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_qp' );
537
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_rn' );
538
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_rd' );
539
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_primary' );
540
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_secondary' );
541
+
542
+ //WP3.3
543
+ register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
544
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
545
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_post' );
546
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_link' );
547
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_page' );
548
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_user' );
549
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_media' );
550
+ register_setting( 'agca-options-group', 'agca_admin_bar_update_notifications' );
551
+ register_setting( 'agca-options-group', 'agca_admin_bar_admin_themes' );
552
+ register_setting( 'agca-options-group', 'agca_remove_top_bar_dropdowns' );
553
+ register_setting( 'agca-options-group', 'agca_admin_bar_frontend' );
554
+ register_setting( 'agca-options-group', 'agca_admin_bar_frontend_hide' );
555
+ register_setting( 'agca-options-group', 'agca_login_register_remove' );
556
+ register_setting( 'agca-options-group', 'agca_login_register_href' );
557
+ register_setting( 'agca-options-group', 'agca_login_lostpassword_remove' );
558
+ register_setting( 'agca-options-group', 'agca_admin_capability' );
559
+ register_setting( 'agca-options-group', 'agca_disablewarning' );
560
+ register_setting( 'agca-template-group', 'agca_selected_template' );
561
+ register_setting( 'agca-template-group', 'agca_templates' );
562
+ //delete_option( 'agca_templates' );
563
+
564
+
565
+ /*Admin menu*/
566
+ register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
567
+ register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
568
+ register_setting( 'agca-options-group', 'agca_admin_menu_separators' );
569
+ register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
570
+ register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
571
+ register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
572
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round' );
573
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round_size' );
574
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand' );
575
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand_link' );
576
+ register_setting( 'agca-options-group', 'agca_admin_menu_autofold' );
577
+ register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
578
+ register_setting( 'agca-options-group', 'ag_edit_adminmenu_json_new' );
579
+ register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
580
+ register_setting( 'agca-options-group', 'ag_colorizer_json' );
581
+ register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
582
+
583
+ register_setting( 'agca-options-group', 'agca_custom_js' );
584
+ register_setting( 'agca-options-group', 'agca_custom_css' );
585
+ register_setting( 'agca-options-group', 'agca_disable_postver' );
586
+ register_setting( 'agca-options-group', 'agca_menu_remove_client_profile' );
587
+ register_setting( 'agca-options-group', 'agca_menu_remove_customize_button' );
588
+
589
+
590
+ if(!empty($_POST)){
591
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
592
+ $this->verifyPostRequest();
593
+ if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
594
+ if($_FILES["settings_import_file"]["error"] > 0){
595
+ }else{
596
+ $file = $_FILES['settings_import_file'];
597
+ if($this->startsWith($file['name'],'AGCA_Settings')){
598
+ if (file_exists($file['tmp_name'])) {
599
+ $fh = fopen($file['tmp_name'], 'r');
600
+ $theData = "";
601
+ if(filesize($file['tmp_name']) > 0){
602
+ $theData = fread($fh,filesize($file['tmp_name']));
603
+ }
604
+ fclose($fh);
605
+ $this->importSettings($theData);
606
+ }
607
+ }
608
+ }
609
+ }
610
+ }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
611
+ $this->verifyPostRequest();
612
+ $this->exportSettings();
613
+ }
614
+ }
615
+
616
+ if(isset($_GET['agca_action'])){
617
+ if($_GET['agca_action'] == "disablewarning"){
618
+ update_option('agca_disablewarning', true);
619
+ }
620
+ }
621
+ }
622
+
623
+ function agca_deactivate() {
624
+
625
+ }
626
+
627
+ function getOptions(){
628
+ return Array(
629
+ 'agca_role_allbutadmin',
630
+ 'agca_admin_bar_frontend',
631
+ 'agca_admin_bar_frontend_hide',
632
+ 'agca_login_register_remove',
633
+ 'agca_login_register_href',
634
+ 'agca_login_lostpassword_remove',
635
+ 'agca_admin_capability',
636
+ 'agca_screen_options_menu',
637
+ 'agca_help_menu',
638
+ 'agca_logout',
639
+ 'agca_remove_your_profile',
640
+ 'agca_logout_only',
641
+ 'agca_custom_title',
642
+ 'agca_howdy',
643
+ 'agca_header',
644
+ 'agca_header_show_logout',
645
+ 'agca_footer',
646
+ 'agca_privacy_options',
647
+ 'agca_header_logo',
648
+ 'agca_header_logo_custom',
649
+ 'agca_remove_site_link',
650
+ 'agca_wp_logo_custom',
651
+ 'agca_wp_logo_custom_link',
652
+ 'agca_profile_color_scheme',
653
+ 'agca_site_heading',
654
+ 'agca_custom_site_heading',
655
+ 'agca_update_bar',
656
+ 'agca_footer_left',
657
+ 'agca_footer_left_hide',
658
+ 'agca_footer_right',
659
+ 'agca_footer_right_hide',
660
+ 'agca_login_banner',
661
+ 'agca_login_banner_text',
662
+ 'agca_login_photo_remove',
663
+ 'agca_login_photo_url',
664
+ 'agca_login_photo_href',
665
+ 'agca_login_round_box',
666
+ 'agca_login_round_box_size',
667
+ 'agca_dashboard_icon',
668
+ 'agca_dashboard_text',
669
+ 'agca_dashboard_text_paragraph',
670
+ 'agca_dashboard_widget_welcome',
671
+ 'agca_dashboard_widget_activity',
672
+ 'agca_dashboard_widget_il',
673
+ 'agca_dashboard_widget_plugins',
674
+ 'agca_dashboard_widget_qp',
675
+ 'agca_dashboard_widget_rn',
676
+ 'agca_dashboard_widget_rd',
677
+ 'agca_dashboard_widget_primary',
678
+ 'agca_dashboard_widget_secondary',
679
+ 'agca_admin_bar_comments',
680
+ 'agca_admin_bar_new_content',
681
+ 'agca_admin_bar_new_content_post',
682
+ 'agca_admin_bar_new_content_link',
683
+ 'agca_admin_bar_new_content_page',
684
+ 'agca_admin_bar_new_content_user',
685
+ 'agca_admin_bar_new_content_media',
686
+ 'agca_admin_bar_update_notifications',
687
+ 'agca_admin_bar_admin_themes',
688
+ 'agca_remove_top_bar_dropdowns',
689
+ 'agca_admin_menu_turnonoff',
690
+ 'agca_admin_menu_agca_button_only',
691
+ 'agca_admin_menu_separators',
692
+ 'agca_admin_menu_icons',
693
+ 'agca_admin_menu_arrow',
694
+ 'agca_admin_menu_submenu_round',
695
+ 'agca_admin_menu_submenu_round_size',
696
+ 'agca_admin_menu_brand',
697
+ 'agca_admin_menu_brand_link',
698
+ 'agca_admin_menu_autofold',
699
+ 'agca_admin_menu_collapse_button',
700
+ 'ag_edit_adminmenu_json',
701
+ 'ag_edit_adminmenu_json_new',
702
+ 'ag_add_adminmenu_json',
703
+ 'ag_colorizer_json',
704
+ 'agca_colorizer_turnonof',
705
+ 'agca_custom_js',
706
+ 'agca_custom_css',
707
+ 'agca_colorizer_turnonoff',
708
+ 'agca_disablewarning',
709
+ 'agca_disable_postver',
710
+ 'agca_menu_remove_client_profile',
711
+ 'agca_menu_remove_customize_button',
712
+ 'agca_selected_template',
713
+ 'agca_templates',
714
+ );
715
+ }
716
+
717
+ function getTextEditor($name){
718
+ $settings = array(
719
+ 'textarea_name' => $name,
720
+ 'media_buttons' => true,
721
+ 'tinymce' => array(
722
+ 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
723
+ 'bullist,blockquote,|,justifyleft,justifycenter' .
724
+ ',justifyright,justifyfull,|,link,unlink,|' .
725
+ ',spellchecker,wp_fullscreen,wp_adv'
726
+ )
727
+ );
728
+ wp_editor( get_option($name), $name, $settings );
729
+ }
730
+
731
+ function importSettings($settings){
732
+ $exploaded = explode("|^|^|", $settings);
733
+ // $str = "EEE: ";
734
+ $str = '';
735
+
736
+ $savedOptions = array();
737
+
738
+ foreach ($exploaded as $setting){
739
+
740
+ $key = current(explode(':', $setting));
741
+ $value = substr($setting, strlen($key)+1);
742
+ $cleanedValue = str_replace('|^|^|','',$value);
743
+ $savedOptions[$key] = $cleanedValue;
744
+ }
745
+
746
+ // print_r($savedOptions);
747
+
748
+ $optionNames = $this->getOptions();
749
+
750
+ foreach ($optionNames as $optionName){
751
+ $optionValue = "";
752
+ $optionValue = $savedOptions[$optionName];
753
+
754
+ if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
755
+ $optionValue = str_replace("\\\"", "\"", $optionValue);
756
+ $optionValue = str_replace("\\\'", "\'", $optionValue);
757
+ }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
758
+ //fb($optionValue);
759
+ $optionValue = htmlspecialchars_decode($optionValue);
760
+ $optionValue = str_replace("\'", '"', $optionValue);
761
+ $optionValue = str_replace('\"', "'", $optionValue);
762
+ //fb($optionValue);
763
+ }else{
764
+
765
+ }
766
+ update_option($optionName, $optionValue);
767
+ $str.="/".$optionName."/".$optionValue."\n";
768
+ }
769
+
770
+ //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
771
+ //agca_script_css
772
+ //
773
+ // fb($savedOptions);
774
+ if($savedOptions['agca_script_css'] != null){
775
+ $optionValue = "";
776
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
777
+ $optionValue = str_replace('\"', "'", $optionValue);
778
+ update_option('agca_custom_css', $optionValue);
779
+ }
780
+ if($savedOptions['agca_script_js'] != null){
781
+ $optionValue = "";
782
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
783
+ $optionValue = str_replace('\"', "'", $optionValue);
784
+ update_option('agca_custom_js', $optionValue);
785
+ }
786
+
787
+ //echo $str;
788
+
789
+ //save imported settings
790
+ $this->saveAfterImport = true;
791
+ }
792
+
793
+ function exportSettings(){
794
+ $str = "";
795
+
796
+ $include_menu_settings = false;
797
+ if(isset($_POST['export_settings_include_admin_menu'])){
798
+ if($_POST['export_settings_include_admin_menu'] == 'on'){
799
+ $include_menu_settings = true;
800
+ }
801
+ }
802
+
803
+ foreach ($_POST as $key => $value) {
804
+ if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
805
+ if($this->startsWith($key,'ag_edit_adminmenu')){
806
+ if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
807
+ }else{
808
+ $str .=$key. ":".$value."|^|^|";
809
+ }
810
+ }
811
+ }
812
+
813
+ $filename = __('AGCA_Settings', 'ag-custom-admin').'_'.date("Y-M-d_H-i-s").'.agca';
814
+ header("Cache-Control: public");
815
+ header("Content-Description: File Transfer");
816
+ header("Content-Disposition: attachment; filename=$filename");
817
+ header("Content-Type: text/plain; ");
818
+ header("Content-Transfer-Encoding: binary");
819
+ echo $str;
820
+ die();
821
+ }
822
+
823
+ function startsWith($haystack, $needle)
824
+ {
825
+ $length = strlen($needle);
826
+ return (substr($haystack, 0, $length) === $needle);
827
+ }
828
+
829
+
830
+
831
+ function agca_create_menu() {
832
+ add_management_page('AGCA', 'AGCA', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
833
+ }
834
+
835
+ function agca_create_admin_button($name,$arr) {
836
+
837
+ $href = $arr["value"];
838
+ $target =$arr["target"];
839
+ $button ="<li class=\"wp-not-current-submenu menu-top menu-top-last\" id=\"menu-$name\"><a href=\"$href\" target=\"$target\" class=\"wp-not-current-submenu menu-top\"><div class=\"wp-menu-arrow\"><div></div></div><div class=\"wp-menu-image dashicons-before dashicons-admin-$name\" style=\"width:15px\"><br></div><div class=\"wp-menu-name\">$name</div></a></li>";
840
+
841
+ return $button;
842
+ }
843
+ function agca_decode($code){
844
+ $code = str_replace("{","",$code);
845
+ $code = str_replace("}","",$code);
846
+ $code = str_replace("\", \"","\"|||\"",$code);
847
+ $elements = explode("|||",$code);
848
+
849
+ return $elements;
850
+ }
851
+
852
+ function jsonMenuArray($json,$type){
853
+ $arr = explode("|",$json);
854
+ $elements = "";
855
+ $array ="";
856
+ $first = true;
857
+ //print_r($json);
858
+ if($type == "colorizer"){
859
+ $elements = json_decode($arr[0],true);
860
+ if($elements !=""){
861
+ return $elements;
862
+ }
863
+ }else if($type == "buttons"){
864
+ $elements = json_decode($arr[0],true);
865
+ if($elements !=""){
866
+ foreach($elements as $k => $v){
867
+ $array.=$this->agca_create_admin_button($k,$v);
868
+ }
869
+ }
870
+ }else if($type == "buttonsJq"){
871
+ $elements = json_decode($arr[0],true);
872
+ if($elements !=""){
873
+ foreach($elements as $k => $v){
874
+ $array.='<tr><td colspan="2"><button target="'.$v['target'].'" title="'.$v['value'].'" type="button">'.$k.'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="Delete" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>';
875
+ }
876
+ }
877
+ }else{
878
+ if(isset($arr[$type])){
879
+ $elements = $this->agca_decode($arr[$type]);
880
+ }
881
+
882
+ if($elements !=""){
883
+ foreach($elements as $element){
884
+ if(!$first){
885
+ $array .=",";
886
+ }
887
+ $parts = explode(" : ",$element);
888
+ if(isset($parts[0]) && isset($parts[1])){
889
+ $array.="[".$parts[0].", ".$parts[1]."]";
890
+ }
891
+ $first=false;
892
+ }
893
+ }
894
+ }
895
+
896
+ return $array;
897
+ }
898
+
899
+ function remove_dashboard_widget($widget,$side)
900
+ {
901
+ //side can be 'normal' or 'side'
902
+ global $wp_meta_boxes;
903
+ remove_meta_box($widget, 'dashboard', $side);
904
+ }
905
+
906
+ function get_wp_version(){
907
+ global $wp_version;
908
+ $array = explode('-', $wp_version);
909
+ $version = $array[0];
910
+ return $version;
911
+ }
912
+
913
+ function print_page()
914
+ {
915
+ if($this->isGuest() && get_option('agca_admin_bar_frontend_hide') or $this->isCusminActive()){
916
+ return false;
917
+ }
918
+ if(!$this->isGuest()){
919
+ ?><style type="text/css">
920
+ <?php
921
+ echo get_option('agca_custom_css');
922
+ if(get_option('agca_menu_remove_customize_button')){
923
+ echo '#wp-admin-bar-customize{display:none;}';
924
+ }
925
+ ?>
926
+ </style><?php
927
+ }
928
+
929
+ if(get_option('agca_admin_bar_frontend_hide')==true){
930
+ add_filter( 'show_admin_bar', '__return_false' );
931
+ ?>
932
+ <style type="text/css">
933
+ #wpadminbar{
934
+ display: none;
935
+ }
936
+ </style>
937
+ <script type="text/javascript">
938
+ window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
939
+ </script>
940
+ <?php
941
+ }
942
+ if(get_option('agca_admin_bar_frontend')!=true && is_user_logged_in()){
943
+
944
+ $this->context = "page";
945
+ //$wpversion = $this->get_wp_version();
946
+ ?>
947
+ <script type="text/javascript">
948
+ var agca_version = "<?php echo $this->agca_version; ?>";
949
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
950
+ var jQueryScriptOutputted = false;
951
+ var agca_context = "page";
952
+ var agca_orig_admin_menu = [];
953
+ function initJQuery() {
954
+ //if the jQuery object isn't available
955
+ if (typeof(jQuery) == 'undefined') {
956
+ if (! jQueryScriptOutputted) {
957
+ //only output the script once..
958
+ jQueryScriptOutputted = true;
959
+ //output the script (load it from google api)
960
+ document.write("<scr" + "ipt type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js\"></scr" + "ipt>");
961
+ }
962
+ setTimeout("initJQuery()", 50);
963
+ } else {
964
+ jQuery(function() {
965
+ try
966
+ {
967
+ <?php if(get_option('agca_header')!=true){ ?>
968
+ jQuery('#wpadminbar').show();
969
+ <?php } ?>
970
+
971
+ <?php $this->print_admin_bar_scripts(); ?>
972
+ }catch(ex){}
973
+ });
974
+ }
975
+ }
976
+ initJQuery();
977
+ </script>
978
+ <script type="text/javascript">
979
+ <?php echo "var agca_global_plugin_url = '".$this->pluginUrl()."';"; ?>
980
+ </script>
981
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
982
+ <script type="text/javascript">
983
+ jQuery(document).ready(function(){
984
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
985
+ foreach($this->colorizer as $k => $v){
986
+ if(($k !="") and ($v !="")){
987
+ if(
988
+ $k == "color_header" ||
989
+ $k == "color_font_header"
990
+ ){
991
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
992
+ }
993
+
994
+ }
995
+ }
996
+ ?>
997
+
998
+ <?php
999
+ }
1000
+ ?>
1001
+ });
1002
+ </script>
1003
+ <?php
1004
+ }
1005
+
1006
+ }
1007
+
1008
+ function print_admin_bar_scripts(){
1009
+ ?>
1010
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
1011
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
1012
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
1013
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
1014
+
1015
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1016
+ jQuery(".new_content_header_submenu").hide();
1017
+ <?php } ?>
1018
+
1019
+ <?php } ?>
1020
+
1021
+ <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
1022
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
1023
+ <?php } ?>
1024
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1025
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
1026
+ <?php } ?>
1027
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
1028
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
1029
+ <?php } ?>
1030
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
1031
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
1032
+ <?php } ?>
1033
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
1034
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
1035
+ <?php } ?>
1036
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
1037
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
1038
+ <?php } ?>
1039
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
1040
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
1041
+ <?php } ?>
1042
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
1043
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
1044
+ <?php } ?>
1045
+ <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
1046
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
1047
+ <?php } ?>
1048
+
1049
+
1050
+
1051
+ <?php if(get_option('agca_header_logo')==true){ ?>
1052
+ jQuery("#wphead #header-logo").css("display","none");
1053
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
1054
+
1055
+ <?php } ?>
1056
+ <?php if(get_option('agca_header_logo_custom')!=""){ ?>
1057
+
1058
+ var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
1059
+
1060
+ advanced_url = img_url;
1061
+ image = jQuery("<img id=\"admin-top-branding-logo\" style='max-width:98%;position:relative;'/>").attr("src",advanced_url);
1062
+ jQuery(image).load(function() {
1063
+ jQuery("#wpbody-content").prepend(image);
1064
+ });
1065
+
1066
+ <?php } ?>
1067
+ <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
1068
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon")
1069
+ .html("<img style=\"height:32px;margin-top:0\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />")
1070
+ .css('background-image','none')
1071
+ .css('width','auto');
1072
+ jQuery("li#wp-admin-bar-wp-logo > a.ab-item")
1073
+ .attr('href',"<?php echo get_bloginfo('wpurl'); ?>")
1074
+ .css('padding', 0);
1075
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
1076
+ jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
1077
+ jQuery("#wp-admin-bar-wp-logo").show();
1078
+ <?php }?>
1079
+ <?php if(get_option('agca_remove_site_link')==true){ ?>
1080
+ jQuery("#wp-admin-bar-site-name").css("display","none");
1081
+
1082
+ <?php } ?>
1083
+ <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
1084
+ var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
1085
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1086
+ if(href == "%SWITCH%"){
1087
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
1088
+ <?php if($this->context == "page"){
1089
+ ?>href+="/wp-admin";<?php
1090
+ }
1091
+ ?>
1092
+ }
1093
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
1094
+
1095
+ <?php }?>
1096
+ <?php if(get_option('agca_site_heading')==true){ ?>
1097
+ jQuery("#wphead #site-heading").css("display","none");
1098
+ <?php } ?>
1099
+ <?php if(get_option('agca_custom_site_heading')!=""){ ?>
1100
+ jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
1101
+ jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
1102
+
1103
+ <?php } ?>
1104
+ <?php if(get_option('agca_header')==true && $this->context =='admin'){
1105
+ ?>
1106
+ jQuery("#wpadminbar").css("display","none");
1107
+ jQuery("body.admin-bar").css("padding-top","0");
1108
+ jQuery("#wphead").css("display","none");
1109
+ jQuery('html.wp-toolbar').css("padding-top","0");
1110
+
1111
+ <?php } ?>
1112
+ <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
1113
+ <?php
1114
+ $agca_logout_text = ((get_option('agca_logout')=="")?__("Log Out", 'ag-custom-admin'):get_option('agca_logout'));
1115
+ ?>
1116
+ jQuery("#wpbody-content").prepend('<a href="<?php echo wp_logout_url(); ?>" tabindex="10" style="float:right;margin-right:20px" class="ab-item agca_logout_button"><?php echo $agca_logout_text; ?></a>');
1117
+
1118
+
1119
+ <?php } ?>
1120
+ <?php
1121
+ if(get_option('agca_custom_title')!=""){
1122
+ //add_filter('admin_title', '$this->change_title', 10, 2);
1123
+
1124
+ }
1125
+ ?>
1126
+ <?php if(get_option('agca_logout')!=""){ ?>
1127
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1128
+ <?php } ?>
1129
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
1130
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1131
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1132
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1133
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1134
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1135
+ <?php } ?>
1136
+ <?php if(get_option('agca_logout_only')==true){ ?>
1137
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
1138
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout" style="display:block;">'+ logout_content +'</li>');
1139
+ jQuery("#wp-admin-bar-logout a").css('padding','0 8px');
1140
+
1141
+
1142
+ <?php } ?>
1143
+
1144
+ <?php
1145
+
1146
+
1147
+ }
1148
+
1149
+ function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
1150
+ if(get_option('agca_howdy')!=""){
1151
+ $user_id = get_current_user_id();
1152
+ $current_user = wp_get_current_user();
1153
+ $profile_url = get_edit_profile_url( $user_id );
1154
+
1155
+ if ( 0 != $user_id ) {
1156
+ /* Add the "My Account" menu */
1157
+ $avatar = get_avatar( $user_id, 28 );
1158
+ $howdy = sprintf( __(get_option('agca_howdy').', %1$s'), $current_user->display_name );
1159
+ $class = empty( $avatar ) ? '' : 'with-avatar';
1160
+
1161
+ $wp_admin_bar->add_menu( array(
1162
+ 'id' => 'my-account',
1163
+ 'parent' => 'top-secondary',
1164
+ 'title' => $howdy . $avatar,
1165
+ 'href' => $profile_url,
1166
+ 'meta' => array(
1167
+ 'class' => $class,
1168
+ ),
1169
+ ) );
1170
+
1171
+ }
1172
+ }
1173
+ }
1174
+
1175
+ function updateAllColors(){
1176
+
1177
+ ?>
1178
+ function updateAllColors(){
1179
+ <?php
1180
+ foreach($this->colorizer as $k => $v){
1181
+ if(($k !="") and ($v !="")){
1182
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1183
+ }
1184
+ }
1185
+ ?>
1186
+ jQuery('.color_picker').each(function(){
1187
+ updateColor(jQuery(this).attr('id'),jQuery(this).val())
1188
+ });
1189
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1190
+ jQuery('#adminmenu li.wp-menu-open').css('border','none');
1191
+ jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1192
+ }<?php
1193
+
1194
+ }
1195
+ function admin_capabilities(){
1196
+ global $wp_roles;
1197
+ $capabs = $wp_roles->roles['administrator']['capabilities'];
1198
+ $capabilitySelector = "";
1199
+
1200
+ $selectedValue = get_option('agca_admin_capability');
1201
+ if($selectedValue == ""){
1202
+ $selectedValue = "edit_dashboard";
1203
+ }
1204
+ /*echo $selectedValue;
1205
+ die;*/
1206
+ ksort($capabs);
1207
+ foreach($capabs as $k=>$v){
1208
+ $selected = "";
1209
+ if($this->startsWith($k, 'level_')) continue;
1210
+ if($selectedValue == $k){
1211
+ $selected = " selected=\"selected\" ";
1212
+ }
1213
+ $capabilitySelector .="<option value=\"$k\" $selected >".ucwords(str_replace('_', ' ', $k))."</option>\n";
1214
+ }
1215
+
1216
+ $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
1217
+ }
1218
+
1219
+ function admin_capability(){
1220
+ $selectedValue = get_option('agca_admin_capability');
1221
+ if($selectedValue == ""){
1222
+ $selectedValue = "edit_dashboard";
1223
+ }
1224
+ return $selectedValue;
1225
+ }
1226
+
1227
+ function JSPrintAGCATemplateSettingsVar($settings){
1228
+ echo "\n<script type=\"text/javascript\">\n";
1229
+ echo "var agca_template_settings = ".preg_replace('#<script(.*?)>(.*?)</script>#is', '', $settings).";\n"; //TODO: think about this
1230
+ echo "</script>";
1231
+ }
1232
+
1233
+ function appendSettingsToAGCATemplateCustomizations($customizations, $settings){
1234
+ $template_settings = json_decode($settings);
1235
+ //print_r($template_settings);
1236
+ foreach($template_settings as $sett){
1237
+ $key = $sett->code;
1238
+
1239
+ //use default value if user's value is not set
1240
+ $value="";
1241
+ if($sett->value != ""){
1242
+ $value = $sett->value;
1243
+ }else{
1244
+ $value = $sett->default_value;
1245
+ }
1246
+
1247
+ //Prepare settings
1248
+ if($sett->type == 6){
1249
+ if($value !== null && (strtolower($value) == "on" || $value == "1")){
1250
+ $value = "true";
1251
+ }else{
1252
+ $value = "false";
1253
+ }
1254
+ }
1255
+ $customizations = str_replace("%".$key."%",$value, $customizations);
1256
+ }
1257
+ return $customizations;
1258
+ }
1259
+
1260
+ function enableSpecificWPVersionCustomizations($customizations){
1261
+ /*enable special CSS for this WP version*/
1262
+ $ver = $this->get_wp_version();
1263
+ $customizations = str_replace("/*".$ver," ", $customizations);
1264
+ $customizations = str_replace($ver."*/"," ", $customizations);
1265
+ return $customizations;
1266
+ }
1267
+
1268
+ function removeCSSComments($customizations){
1269
+ $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
1270
+ return $customizations;
1271
+ }
1272
+
1273
+ function prepareAGCAAdminTemplates(){
1274
+ if(get_option( 'agca_templates' ) != ""){
1275
+ //print_r(get_option( 'agca_templates' ));
1276
+ $themes = get_option( 'agca_templates' );
1277
+ $selectedTheme = get_option('agca_selected_template');
1278
+ if(isset($themes[$selectedTheme])){
1279
+ $theme = $themes[$selectedTheme];
1280
+ add_filter('get_user_option_admin_color', array(&$this,'change_admin_color'));
1281
+
1282
+ echo (stripslashes($theme['common']));
1283
+ echo "<!--AGCAIMAGES: ".$theme['images']."-->";
1284
+
1285
+ //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1286
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
1287
+ if($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
1288
+ //print_r($templdata);
1289
+
1290
+ $this->JSPrintAGCATemplateSettingsVar($theme['settings']);
1291
+
1292
+ $admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
1293
+ $admindata = $this->enableSpecificWPVersionCustomizations($admindata);
1294
+ $admindata = $this->removeCSSComments($admindata);
1295
+
1296
+ //echo $admindata;
1297
+ //REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
1298
+ $this->templateCustomizations = $admindata;
1299
+ }
1300
+ //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1301
+ }
1302
+ }
1303
+ }
1304
+
1305
+ function agcaAdminSession(){
1306
+ $agcaTemplatesSession = array();
1307
+
1308
+ //session_destroy();
1309
+ //session_unset();
1310
+
1311
+ /*if(!session_id()){
1312
+ session_start();
1313
+ }*/
1314
+
1315
+ if(!isset($_SESSION["AGCA"])){
1316
+ $_SESSION["AGCA"] = array();
1317
+ $_SESSION["AGCA"]["Templates"] = array();
1318
+ }
1319
+ //print_r($_SESSION);
1320
+
1321
+ if(isset($_SESSION["AGCA"])){
1322
+ if(isset($_SESSION["AGCA"]["Templates"])){
1323
+ //print_r($_SESSION["AGCA"]["Templates"]);
1324
+ $agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
1325
+ }
1326
+ }
1327
+
1328
+
1329
+ if($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"'){
1330
+ $agcaTemplatesSession = array();
1331
+ }
1332
+
1333
+
1334
+ return $agcaTemplatesSession;
1335
+
1336
+ }
1337
+
1338
+ function getAGCAColor($name){
1339
+ if(isset($this->colorizer[$name])){
1340
+ echo htmlspecialchars($this->colorizer[$name]);
1341
+ }
1342
+ }
1343
+
1344
+ function prepareAGCALoginTemplates(){
1345
+ if(get_option( 'agca_templates' ) != ""){
1346
+ //print_r(get_option( 'agca_templates' ));
1347
+ $templates = get_option( 'agca_templates' );
1348
+ foreach($templates as $templname=>$templdata){
1349
+ if($templname == get_option('agca_selected_template')){
1350
+ echo (stripslashes($templdata['common']));
1351
+
1352
+ if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
1353
+ $this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
1354
+
1355
+ $logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
1356
+ $logindata = $this->enableSpecificWPVersionCustomizations($logindata);
1357
+ $logindata = $this->removeCSSComments($logindata);
1358
+
1359
+ echo($logindata);
1360
+ break;
1361
+ }
1362
+ }
1363
+ }
1364
+ }
1365
+
1366
+ function agca_error_check(){
1367
+ ?>
1368
+ <script type="text/javascript">
1369
+ function AGCAErrorPage(msg, url, line){
1370
+ var agca_error_details = "___________________________________________________<br/>";
1371
+ agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1372
+ agca_error_details += "___________________________________________________<br/>";
1373
+ window.agca_error_details_text = agca_error_details + '<br/><?php _e('This JavaScript error can stop AGCA plugin to work properly. If everything still works, you can ignore this notification.', 'ag-custom-admin'); ?> <br/><br/><?php _e('Possible solutions', 'ag-custom-admin'); ?>:<br/><br/>1) <?php _e('Make sure to have everything up to date: WordPress site, plugins and themes.', 'ag-custom-admin'); ?><br/><br/>2) <?php _e('Try disabling plugins one by one to see if problem can be resolved this way. If so, one of disabled plugins caused this error.', 'ag-custom-admin'); ?><br/><br/>3) <?php _e('Check "source" path of this error. This could be indicator of the plugin/theme that caused the error.', 'ag-custom-admin'); ?><br/><br/>4) <?php _e('If it\\\'s obvious that error is thrown from a particular plugin/theme, please report this error to their support.', 'ag-custom-admin'); ?> <br/><br/>5) <?php _e('Try activating default WordPress theme instead of your current theme.', 'ag-custom-admin'); ?><br/><br/>6) <?php _e('Advanced: Try fixing this issue manually: Navigate to the link above in your browser and open the source of the page (right click -> view page source) and find the line in code where it fails. You should access this file via FTP and try to fix this error on that line.', 'ag-custom-admin') ?><br/><br/>7) <?php _e('Contact us if nothing above helps. Please do not post errors that are caused by other plugins/themes to our support page. Contact their support instead. If you think that error is somehow related to AGCA plugin, or something unexpected happens, please report that on our', 'ag-custom-admin'); ?> <a href="https://wordpress.org/support/plugin/ag-custom-admin/" target="_blank"><?php _e('SUPPORT PAGE', 'ag-custom-admin'); ?></a>';
1374
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1375
+ var errorDivHtml = '<div style="background: #f08080;border-radius: 3px;color: #ffffff;height: auto; margin-right: 13px;padding: 6px 14px;width: 450px;z-index: 99999; position:absolute;">\
1376
+ <?php _e('AGCA plugin caught an error on your site!', 'ag-custom-admin'); ?>&nbsp;<a target="_blank" href="#" onclick="var aedt = document.getElementById(\'agca_error_details_text\'); if(aedt.style.display !== \'block\') {aedt.style.display = \'block\';} else{aedt.style.display = \'none\';} return false;" style="color: #ffffff !important;float:right;font-weight: bold;text-decoration: none;">(<?php _e('show/hide more...', 'ag-custom-admin'); ?>)</a><div id="agca_error_details_text" style="display:none;margin: 10px 0;background:#ffffff;border-radius: 5px;padding:8px;color: #777;">'+agca_error_details_text+'</div></div>';
1377
+
1378
+ var ph = document.getElementById('agca_error_placeholder');
1379
+ ph.innerHTML = errorDivHtml;
1380
+ document.getElementById('agca_news').style.visibility = "hidden";
1381
+ }
1382
+ window.onerror = function(msg, url, line) {
1383
+ window.onload = function() {
1384
+ AGCAErrorPage(msg, url, line);
1385
+ }
1386
+ return true;
1387
+ };
1388
+ </script>
1389
+ <?php
1390
+ }
1391
+ function error_check(){
1392
+ ?>
1393
+ <script type="text/javascript">
1394
+ function AGCAErrorOtherPages(msg, url, line){
1395
+ var agca_error_details = "___________________________________________________\n";
1396
+ agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
1397
+
1398
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1399
+
1400
+ if(typeof window.console === "object"){
1401
+ console.log("___________________________________________________");
1402
+ console.log("<?php _e('AGCA plugin caught a JavaScript on your site', 'ag-custom-admin'); ?>:");
1403
+ console.log(agca_error_details);
1404
+ }
1405
+ }
1406
+ window.onerror = function(msg, url, line) {
1407
+ window.onload = function() {
1408
+ AGCAErrorOtherPages(msg, url, line);
1409
+ }
1410
+ return true;
1411
+ };
1412
+ </script>
1413
+ <?php
1414
+ }
1415
+
1416
+ function menu_item_cleartext($name){
1417
+ if(strpos($name,' <span') !== false){
1418
+ $parts = explode(' <span', $name);
1419
+ $name = $parts[0];
1420
+ }
1421
+ $name = trim($name);
1422
+ return $name;
1423
+ }
1424
+
1425
+ /**
1426
+ * Loops through all original menu items, and creates customizations array
1427
+ * applies previous customizations if set
1428
+ * @return array|mixed|object
1429
+ */
1430
+ function get_menu_customizations(){
1431
+ global $menu;
1432
+ global $submenu;
1433
+
1434
+ //var_dump($menu); die;
1435
+ $previousCustomizations = json_decode(get_option('ag_edit_adminmenu_json_new'), true);
1436
+
1437
+ $customizationsSet = true;
1438
+ if($previousCustomizations == null){
1439
+ $customizationsSet = false;
1440
+ }
1441
+
1442
+ //set default menu configuration
1443
+ //and apply previously saved customizations
1444
+ $m = array();
1445
+ foreach($menu as $top){
1446
+ $name = $top[0];
1447
+ $url = $top[2];
1448
+ $cls = isset($top[5])?$top[5]:"";
1449
+ $remove = false;
1450
+ if($name == '') continue;
1451
+ $pc = null;
1452
+ $name = $this->menu_item_cleartext($name);
1453
+
1454
+ //apply previous submenu customizations
1455
+ if($customizationsSet && isset($previousCustomizations[$url])){
1456
+ $pc = $previousCustomizations[$url];
1457
+ }
1458
+
1459
+ //get submenu
1460
+ $s = array();
1461
+ if(isset($submenu[$url])){
1462
+ $sitems = $submenu[$url];
1463
+ foreach($sitems as $key=>$sub){
1464
+ $nameSub = $sub[0];
1465
+ $urlSub = $sub[2];
1466
+ $removeSub = false;
1467
+ $nameSub = $this->menu_item_cleartext($nameSub);
1468
+ $s[$key]=array(
1469
+ 'name'=>$nameSub,
1470
+ 'new'=>'',
1471
+ 'remove'=>$removeSub,
1472
+ 'url'=>$urlSub
1473
+ );
1474
+
1475
+ if(isset($pc['submenus'][$key])){
1476
+ $s[$key]['new'] = $pc['submenus'][$key]['new'];
1477
+ $s[$key]['remove'] = $pc['submenus'][$key]['remove'];
1478
+
1479
+ if($s[$key]['new'] == null){
1480
+ $s[$key]['new'] = '';
1481
+ }
1482
+ if($s[$key]['remove'] == null){
1483
+ $s[$key]['remove'] = false;
1484
+ }
1485
+ }
1486
+ }
1487
+ }
1488
+
1489
+ $m[$url]=array(
1490
+ 'name'=>$name,
1491
+ 'remove'=>$remove,
1492
+ 'new'=>'',
1493
+ 'url'=>$url,
1494
+ 'cls'=>$cls,
1495
+ 'submenus'=>$s
1496
+ );
1497
+
1498
+ //apply previous top menu customizations
1499
+ if($customizationsSet && isset($previousCustomizations[$url])){
1500
+ $pc = $previousCustomizations[$url];
1501
+ if(isset($pc)){
1502
+ $m[$url]['remove'] = $pc['remove'];
1503
+ $m[$url]['new'] = $pc['new'];
1504
+ }
1505
+ }
1506
+ }
1507
+ return $m;
1508
+ }
1509
+
1510
+ /**
1511
+ * Applies customizations to admin menu
1512
+ */
1513
+ function customized_menu(){
1514
+ $customizations = $this->get_menu_customizations();
1515
+ global $menu;
1516
+ global $submenu;
1517
+
1518
+ //print_r($submenu);die;
1519
+ //apply customizations to original admin menu
1520
+ foreach($menu as $key=>$top){
1521
+ $url = $top[2];
1522
+ if(isset($customizations[$url])){
1523
+ $topCustomized = $customizations[$url];
1524
+ if($topCustomized['new']) {
1525
+ $menu[$key][0] = $topCustomized['new'];
1526
+ }
1527
+ if($topCustomized['remove']){
1528
+ unset($menu[$key]);
1529
+ }
1530
+ }
1531
+ }
1532
+ foreach($submenu as $topkey=>$subs){
1533
+ foreach($subs as $subkey=>$sub){
1534
+ if(isset($customizations[$topkey]['submenus'][$subkey])){
1535
+ $cs = $customizations[$topkey]['submenus'][$subkey];
1536
+ if($cs['new']) {
1537
+ $submenu[$topkey][$subkey][0] = preg_replace("/".$cs['name']."/",$cs['new'], $submenu[$topkey][$subkey][0],1);
1538
+ }
1539
+ if($cs['remove']){
1540
+ unset($submenu[$topkey][$subkey]);
1541
+ }
1542
+ }
1543
+ }
1544
+ }
1545
+ }
1546
+
1547
+ /**
1548
+ * Used only for removing admin menu customizations to AGCA 1.5 version or later
1549
+ * @param $checkboxes
1550
+ * @param $textboxes
1551
+ */
1552
+ function migrate_menu_customizations($checkboxes, $textboxes){
1553
+ $customizations = $this->get_menu_customizations();
1554
+ global $menu;
1555
+ /*print_r($menu);
1556
+ print_r($customizations);
1557
+ print_r($textboxes);*/
1558
+
1559
+ $oldTopValue = "";
1560
+
1561
+
1562
+ //Migrate checkboxes
1563
+ foreach($checkboxes as $key=>$value){
1564
+ $isTop = false;
1565
+ $oldSubValue = "";
1566
+ if (strpos($key,'<-TOP->') !== false) {
1567
+ $oldTopValue = str_replace('<-TOP->','',$key);
1568
+ $isTop = true;
1569
+ }else{
1570
+ $oldSubValue = $key;
1571
+ }
1572
+ if($value == 'checked'){
1573
+ $topIndex = "";
1574
+ foreach($customizations as $k=>$c){
1575
+ if($c['cls'] == $oldTopValue){
1576
+ $topIndex = $k;
1577
+ break;
1578
+ }
1579
+ }
1580
+ if($topIndex == "") continue;
1581
+ if($isTop){
1582
+ $customizations[$topIndex]['remove'] = true;
1583
+ }else{
1584
+ if(is_array($customizations[$topIndex]['submenus'])){
1585
+ foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1586
+ if($sval['name'] == $oldSubValue){
1587
+ $customizations[$topIndex]['submenus'][$skey]['remove'] = true;
1588
+ }
1589
+ }
1590
+ }
1591
+ }
1592
+ }
1593
+ }
1594
+
1595
+ //Migrate textboxes
1596
+ foreach($textboxes as $key=>$value){
1597
+ $isTop = false;
1598
+ $oldSubValue = "";
1599
+ if (strpos($key,'<-TOP->') !== false) {
1600
+ $oldTopValue = str_replace('<-TOP->','',$key);
1601
+ $isTop = true;
1602
+ }else{
1603
+ $oldSubValue = $key;
1604
+ }
1605
+ if($value != ''){
1606
+ $topIndex = "";
1607
+ foreach($customizations as $k=>$c){
1608
+ if($c['cls'] == $oldTopValue){
1609
+ $topIndex = $k;
1610
+ break;
1611
+ }
1612
+ }
1613
+ if($topIndex == "") continue;
1614
+ if($isTop){
1615
+ $customizations[$topIndex]['new'] = $value;
1616
+ }else{
1617
+ if(is_array($customizations[$topIndex]['submenus'])){
1618
+ foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1619
+ if($sval['name'] == $oldSubValue){
1620
+ if($customizations[$topIndex]['submenus'][$skey]['name'] != $value){
1621
+ $customizations[$topIndex]['submenus'][$skey]['new'] = $value;
1622
+ }
1623
+ }
1624
+ }
1625
+ }
1626
+ }
1627
+ }
1628
+ }
1629
+ update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1630
+ update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1631
+ }
1632
+ function isCusminActive(){
1633
+ return $this->isPluginActive('cusmin/cusmin.php');
1634
+ }
1635
+ function isPluginActive($plugin){
1636
+ if(!is_admin()){
1637
+ return false;
1638
+ }
1639
+ return is_plugin_active($plugin);
1640
+ }
1641
+ function isPluginActiveForNetwork($plugin){
1642
+ return is_plugin_active_for_network($plugin);
1643
+ }
1644
+ function print_admin_css()
1645
+ {
1646
+ $agcaTemplateSession = $this->agcaAdminSession();
1647
+ $wpversion = $this->get_wp_version();
1648
+ $this->context = "admin";
1649
+ $this->error_check();
1650
+ $currentScreen = get_current_screen();
1651
+ ?>
1652
+ <script type="text/javascript">
1653
+ var wpversion = "<?php echo $wpversion; ?>";
1654
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1655
+ var agca_version = "<?php echo $this->agca_version; ?>";
1656
+ var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1657
+ var errors = false;
1658
+ var isSettingsImport = false;
1659
+ var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
1660
+ var agca_context = "admin";
1661
+ var roundedSidberSize = 0;
1662
+ var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
1663
+ var agca_admin_menu = <?php echo json_encode($this->get_menu_customizations()) ?>;
1664
+ var agca_string = {
1665
+ file_imp_not_sel: '<?php _e('File for import is not selected!', 'ag-custom-admin'); ?>',
1666
+ menu_general: '<?php _e('General', 'ag-custom-admin'); ?>',
1667
+ menu_admin_bar: '<?php _e('Admin Bar', 'ag-custom-admin'); ?>',
1668
+ menu_footer: '<?php _e('Footer', 'ag-custom-admin'); ?>',
1669
+ menu_dashb: '<?php _e('Dashboard', 'ag-custom-admin'); ?>',
1670
+ menu_login: '<?php _e('Login Page', 'ag-custom-admin'); ?>',
1671
+ menu_admin_menu: '<?php _e('Admin Menu', 'ag-custom-admin'); ?>',
1672
+ menu_colorizer: '<?php _e('Colorizer', 'ag-custom-admin'); ?>',
1673
+ menu_themes: '<?php _e('Themes', 'ag-custom-admin'); ?>',
1674
+ menu_upgrade: '<?php _e('Upgrade', 'ag-custom-admin'); ?>',
1675
+ menu_advanced: '<?php _e('Advanced', 'ag-custom-admin'); ?>',
1676
+ remove: '<?php _e('Remove', 'ag-custom-admin'); ?>',
1677
+ frommenu:'<?php _e('from menu', 'ag-custom-admin'); ?>',
1678
+ rename:'<?php _e('Rename', 'ag-custom-admin'); ?>',
1679
+ withthisvalue:'<?php _e('with this value', 'ag-custom-admin'); ?>',
1680
+ submenuitem:'<?php _e('sub-menu item', 'ag-custom-admin'); ?>',
1681
+ open:'<?php _e('open', 'ag-custom-admin'); ?>',
1682
+ 'delete':'<?php _e('Delete', 'ag-custom-admin'); ?>',
1683
+ 'in':'<?php _e('in', 'ag-custom-admin'); ?>',
1684
+ save_changes: '<?php _e('Save changes', 'ag-custom-admin'); ?>'
1685
+ };
1686
+ </script>
1687
+ <?php
1688
+ $this->prepareAGCAAdminTemplates();
1689
+ $this->agca_get_includes();
1690
+ $this->admin_capabilities();
1691
+ wp_get_current_user() ;
1692
+ ?>
1693
+ <?php
1694
+ //in case that javaScript is disabled only admin can access admin menu
1695
+ if(!current_user_can($this->admin_capability())){
1696
+ ?>
1697
+ <style type="text/css">
1698
+ #adminmenu{display:none;}
1699
+ </style>
1700
+ <?php
1701
+ }
1702
+ ?>
1703
+ <script type="text/javascript">
1704
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
1705
+ <?php
1706
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1707
+ echo 'isSettingsImport = true;';
1708
+ }
1709
+ ?>
1710
+ </script>
1711
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1712
+ <style type="text/css">
1713
+ .wp-has-current-submenu:after{border:none !important;}
1714
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1715
+ </style>
1716
+ <?php }
1717
+
1718
+ if($currentScreen->id == 'tools_page_ag-custom-admin/plugin'){
1719
+ ?>
1720
+ <div id="fb-root"></div>
1721
+ <script>(function(d, s, id) {
1722
+ var js, fjs = d.getElementsByTagName(s)[0];
1723
+ if (d.getElementById(id)) return;
1724
+ js = d.createElement(s); js.id = id;
1725
+ js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=765552763482314";
1726
+ fjs.parentNode.insertBefore(js, fjs);
1727
+ }(document, 'script', 'facebook-jssdk'));</script>
1728
+ <?php
1729
+ }
1730
+
1731
+ if(get_option('agca_menu_remove_client_profile')){
1732
+ remove_menu_page('profile.php');
1733
+ }
1734
+ ?>
1735
+ <script type="text/javascript">
1736
+ /* <![CDATA[ */
1737
+ jQuery(document).ready(function() {
1738
+ try
1739
+ {
1740
+
1741
+ <?php /*CHECK OTHER PLUGINS*/
1742
+ if($this->isPluginActive('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')){
1743
+ ?>
1744
+ jQuery('ul#adminmenu').css('display','none');
1745
+ jQuery('#footer-ozh-oam').css('display','none');
1746
+ jQuery('#ag_main_menu li').each(function(){
1747
+ if(jQuery(this).text() == "Admin Menu"){
1748
+ jQuery(this).hide();
1749
+ }
1750
+ });
1751
+ <?php
1752
+ }
1753
+ ?>
1754
+
1755
+
1756
+ //get saved onfigurations
1757
+
1758
+ <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1759
+ var buttons = '<?php echo $buttons; ?>';
1760
+
1761
+ <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
1762
+ var buttonsJq = '<?php echo $buttonsJq; ?>';
1763
+
1764
+ createEditMenuPageNew(agca_admin_menu);
1765
+ //createEditMenuPageV32(checkboxes, textboxes);
1766
+
1767
+ <?php
1768
+ //if admin, and option to hide settings for admin is set
1769
+ if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability()) or $this->isCusminActive()){
1770
+ ?>
1771
+ <?php } else{ ?>
1772
+ <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1773
+ additionalStyles = ' style="margin-bottom:-4px" ';
1774
+ jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1775
+ <?php } ?>
1776
+ <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1777
+
1778
+ var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1779
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1780
+
1781
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1782
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1783
+
1784
+ <?php }else{ ?>
1785
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
1786
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1787
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1788
+ <?php } ?>
1789
+
1790
+ <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1791
+ jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1792
+ jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1793
+ <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1794
+ roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1795
+
1796
+
1797
+ <?php } ?>
1798
+ <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1799
+ jQuery("body").addClass("auto-fold");
1800
+ <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1801
+ jQuery("body").removeClass("auto-fold");
1802
+ <?php } ?>
1803
+
1804
+ <?php $this->print_admin_bar_scripts(); ?>
1805
+
1806
+ <?php if(get_option('agca_screen_options_menu')==true){ ?>
1807
+ jQuery("#screen-options-link-wrap").css("display","none");
1808
+ <?php } ?>
1809
+ <?php if(get_option('agca_help_menu')==true){ ?>
1810
+ jQuery("#contextual-help-link-wrap").css("display","none");
1811
+ jQuery("#contextual-help-link").css("display","none");
1812
+ <?php } ?>
1813
+ <?php if(get_option('agca_privacy_options')==true){ ?>
1814
+ jQuery("#privacy-on-link").css("display","none");
1815
+ <?php } ?>
1816
+
1817
+ <?php if(get_option('agca_update_bar')==true){ ?>
1818
+ <?php
1819
+ if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1820
+ function c2c_no_update_nag() {
1821
+ remove_action( 'admin_notices', 'update_nag', 3 );
1822
+ }
1823
+ endif;
1824
+ add_action( 'admin_init', 'c2c_no_update_nag' );
1825
+ ?>
1826
+ jQuery("#update-nag").css("display","none");
1827
+ jQuery(".update-nag").css("display","none");
1828
+ <?php } ?>
1829
+
1830
+ <?php if(get_option('agca_footer')==true){ ?>
1831
+ jQuery("#footer,#wpfooter").css("display","none");
1832
+ <?php } ?>
1833
+
1834
+ <?php if(get_option('agca_footer_left')!=""){ ?>
1835
+ jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1836
+ <?php } ?>
1837
+ <?php if(get_option('agca_footer_left_hide')==true){ ?>
1838
+ jQuery("#footer-left").css("display","none");
1839
+ <?php } ?>
1840
+ <?php if(get_option('agca_footer_right')!=""){ ?>
1841
+ jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1842
+ <?php } ?>
1843
+ <?php if(get_option('agca_footer_right_hide')==true){ ?>
1844
+ jQuery("#footer-upgrade").css("display","none");
1845
+ <?php } ?>
1846
+
1847
+ <?php if(get_option('agca_language_bar')==true){ ?>
1848
+ jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1849
+ <?php } ?>
1850
+ <?php if(get_option('agca_dashboard_icon')==true){ ?>
1851
+ var className = jQuery("#icon-index").attr("class");
1852
+ if(className=='icon32'){
1853
+ jQuery("#icon-index").attr("id","icon-index-removed");
1854
+ }
1855
+ <?php } ?>
1856
+ <?php if(get_option('agca_dashboard_text')!=""){ ?>
1857
+ jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1858
+ <?php } ?>
1859
+ <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1860
+ require_once($this->filePath('wp-includes/formatting.php'));
1861
+ ?>
1862
+ jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1863
+
1864
+ jQuery("#agca_custom_dashboard_content").html('<br /><?php echo preg_replace('/(\r\n|\r|\n)/', '\n', addslashes(wpautop(do_shortcode(get_option('agca_dashboard_text_paragraph'))))); ?>');
1865
+ <?php } ?>
1866
+
1867
+ <?php /*Remove Dashboard widgets*/ ?>
1868
+ <?php
1869
+
1870
+ if(get_option('agca_dashboard_widget_welcome')==true){
1871
+ ?>jQuery("#welcome-panel").css("display","none");<?php
1872
+ }else{
1873
+ ?>jQuery("#welcome-panel").css("display","block");<?php
1874
+ }
1875
+ if(get_option('agca_dashboard_widget_il')==true){
1876
+ $this->remove_dashboard_widget('dashboard_incoming_links','normal');
1877
+ }else{
1878
+ ?>jQuery("#dashboard_incoming_links").css("display","block");<?php
1879
+ }
1880
+ if(get_option('agca_dashboard_widget_plugins')==true){
1881
+ $this->remove_dashboard_widget('dashboard_plugins','normal');
1882
+ }else{
1883
+ ?>jQuery("#dashboard_plugins").css("display","block");<?php
1884
+ }
1885
+ if(get_option('agca_dashboard_widget_qp')==true){
1886
+ $this->remove_dashboard_widget('dashboard_quick_press','side');
1887
+ }else{
1888
+ ?>jQuery("#dashboard_quick_press").css("display","block");<?php
1889
+ }
1890
+ if(get_option('agca_dashboard_widget_rn')==true){
1891
+ $this->remove_dashboard_widget('dashboard_right_now','normal');
1892
+ }else{
1893
+ ?>jQuery("#dashboard_right_now").css("display","block");<?php
1894
+ }
1895
+ if(get_option('agca_dashboard_widget_rd')==true){
1896
+ $this->remove_dashboard_widget('dashboard_recent_drafts','side');
1897
+ }else{
1898
+ ?>jQuery("#dashboard_recent_drafts").css("display","block");<?php
1899
+ }
1900
+ if(get_option('agca_dashboard_widget_primary')==true){
1901
+ $this->remove_dashboard_widget('dashboard_primary','side');
1902
+ }else{
1903
+ ?>jQuery("#dashboard_primary").css("display","block");<?php
1904
+ }
1905
+ if(get_option('agca_dashboard_widget_secondary')==true){
1906
+ $this->remove_dashboard_widget('dashboard_secondary','side');
1907
+ }else{
1908
+ ?>jQuery("#dashboard_secondary").css("display","block");<?php
1909
+ }
1910
+ if(get_option('agca_dashboard_widget_activity')==true){
1911
+ remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
1912
+ }else{
1913
+ ?>jQuery("#dashboard_activity").css("display","block");<?php
1914
+ }
1915
+
1916
+ ?>
1917
+
1918
+ <?php /*ADMIN MENU*/ ?>
1919
+
1920
+ <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1921
+ jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1922
+ <?php } ?>
1923
+ <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1924
+ jQuery(".wp-menu-image").each(function(){
1925
+ jQuery(this).css("display","none");
1926
+ });
1927
+ jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1928
+ <?php } ?>
1929
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1930
+ jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1931
+
1932
+ <?php } ?>
1933
+ <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1934
+
1935
+ <?php /*If Turned on*/ ?>
1936
+
1937
+ <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1938
+ jQuery('#adminmenu > li').each(function(){
1939
+ if(!jQuery(this).hasClass('agca_button_only')){
1940
+ jQuery(this).addClass('noclass');
1941
+ }
1942
+ });
1943
+ <?php /*Only admin see button*/
1944
+ if (current_user_can($this->admin_capability())){ ?>
1945
+ jQuery('#adminmenu').append('<?php echo $this->agca_create_admin_button('AGCA',array('value'=>'tools.php?page=ag-custom-admin/plugin.php#general-settings','target'=>'_self')); ?>');
1946
+ <?php } ?>
1947
+ <?php } ?>
1948
+
1949
+
1950
+ <?php /*EDIT MENU ITEMS*/?>
1951
+ <?php if(get_option('ag_edit_adminmenu_json')!=""){
1952
+
1953
+ $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1954
+
1955
+ $checkboxes = json_decode($arr[0]);
1956
+ $textboxes = json_decode($arr[1]);
1957
+
1958
+ $this->migrate_menu_customizations($checkboxes, $textboxes);
1959
+
1960
+ } ?>
1961
+
1962
+ <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1963
+ $this->customized_menu();
1964
+ } ?>
1965
+
1966
+
1967
+
1968
+
1969
+ /*Add user buttons*/
1970
+ jQuery('#adminmenu').append(buttons);
1971
+
1972
+ <?php /*END If Turned on*/ ?>
1973
+ <?php } else{ ?>
1974
+ jQuery("#adminmenu").removeClass("noclass");
1975
+ <?php } ?>
1976
+
1977
+ reloadRemoveButtonEvents();
1978
+
1979
+ <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1980
+ //remove collapse menu button
1981
+ jQuery('#collapse-menu').remove();
1982
+ <?php } ?>
1983
+
1984
+ <?php //COLORIZER ?>
1985
+ updateAllColors();
1986
+ <?php //COLORIZER END ?>
1987
+ <?php } //end of apply for any user except admin ?>
1988
+ /*Add user buttons*/
1989
+ jQuery('#ag_add_adminmenu').append(buttonsJq);
1990
+
1991
+
1992
+ }catch(err){
1993
+ errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
1994
+ console.log(errors);
1995
+ }finally{
1996
+ jQuery('html').css('visibility','visible');
1997
+ }
1998
+ <?php
1999
+ if($this->saveAfterImport == true){
2000
+ ?>savePluginSettings();<?php
2001
+ }
2002
+ ?>
2003
+
2004
+ });
2005
+
2006
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
2007
+ $this->updateAllColors();
2008
+ }else{
2009
+ ?>function updateAllColors(){}; <?php
2010
+ } ?>
2011
+
2012
+
2013
+ /* ]]> */
2014
+ </script>
2015
+ <style type="text/css">
2016
+ .underline_text{
2017
+ text-decoration:underline;
2018
+ }
2019
+ .form-table th{
2020
+ width:300px;
2021
+ }
2022
+
2023
+ #dashboard-widgets div.empty-container{
2024
+ border:none;
2025
+ }
2026
+ </style>
2027
+ <?php
2028
+ }
2029
+
2030
+ function print_login_head(){
2031
+ if($this->isCusminActive()){
2032
+ return false;
2033
+ }
2034
+
2035
+ $this->context = "login";
2036
+ $this->error_check();
2037
+ //$wpversion = $this->get_wp_version();
2038
+
2039
+ ?>
2040
+ <script type="text/javascript">
2041
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
2042
+ var agca_version = "<?php echo $this->agca_version; ?>";
2043
+ <?php //var wpversion = "echo $wpversion; ?>
2044
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
2045
+ var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
2046
+ var isSettingsImport = false;
2047
+ var agca_context = "login";
2048
+ </script>
2049
+ <?php
2050
+ $this->prepareAGCALoginTemplates();
2051
+ $this->agca_get_includes();
2052
+
2053
+ ?>
2054
+
2055
+ <script type="text/javascript">
2056
+
2057
+
2058
+ /* <![CDATA[ */
2059
+ jQuery(document).ready(function() {
2060
+ try{
2061
+ <?php if(get_option('agca_login_round_box')==true){ ?>
2062
+ jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2063
+ jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2064
+ jQuery("#login h1 a").css("margin-bottom",'10px');
2065
+ jQuery("#login h1 a").css("padding-bottom",'0');
2066
+ jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2067
+ <?php } ?>
2068
+ <?php if(get_option('agca_login_banner')==true){ ?>
2069
+ jQuery("#backtoblog").css("display","none");
2070
+ <?php } ?>
2071
+ <?php if(get_option('agca_login_banner_text')==true){ ?>
2072
+ jQuery("#backtoblog a").html('<?php echo "← " . addslashes(get_option('agca_login_banner_text')); ?>');
2073
+ <?php } ?>
2074
+ <?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
2075
+ advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
2076
+ var $url = "url(" + advanced_url + ")";
2077
+ jQuery("#login h1 a").css("background",$url+' no-repeat');
2078
+ jQuery("#login h1 a").hide();
2079
+ image = jQuery("<img />").attr("src",advanced_url);
2080
+ jQuery(image).load(function() {
2081
+ var originalWidth = 326;
2082
+ var widthDiff = this.width - originalWidth;
2083
+ jQuery("#login h1 a").height(this.height);
2084
+ jQuery("#login h1 a").width(this.width);
2085
+ jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
2086
+
2087
+ var loginWidth = jQuery('#login').width();
2088
+ var originalLoginWidth = 320;
2089
+ var photoWidth = this.width;
2090
+
2091
+ if(loginWidth > photoWidth){
2092
+ jQuery("#login h1 a").css('margin','auto');
2093
+ }else{
2094
+ jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
2095
+ }
2096
+
2097
+ jQuery("#login h1 a").show();
2098
+ });
2099
+ <?php } ?>
2100
+ <?php if(get_option('agca_login_photo_href')==true){ ?>
2101
+ var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
2102
+ $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
2103
+
2104
+ jQuery("#login h1 a").attr("href",$href);
2105
+ <?php } ?>
2106
+ <?php if(get_option('agca_login_photo_remove')==true){ ?>
2107
+ jQuery("#login h1 a").css("display","none");
2108
+ <?php } ?>
2109
+
2110
+ jQuery("#login h1 a").attr("title","");
2111
+
2112
+ <?php if(get_option('agca_login_register_remove')==true){ ?>
2113
+ if(jQuery('p#nav').size() > 0){
2114
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2115
+ }
2116
+ jQuery('p#nav a').each(function(){
2117
+ if(jQuery(this).attr('href').indexOf('register') != -1){
2118
+ jQuery(this).remove();
2119
+ }
2120
+ });
2121
+
2122
+ <?php } ?>
2123
+ <?php if(get_option('agca_login_register_href')!=""){ ?>
2124
+ jQuery('p#nav a').each(function(){
2125
+ if(jQuery(this).attr('href').indexOf('register') != -1){
2126
+ jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
2127
+ }
2128
+ });
2129
+
2130
+ <?php } ?>
2131
+
2132
+ <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
2133
+ if(jQuery('p#nav').size() > 0){
2134
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2135
+ }
2136
+ jQuery('p#nav a').each(function(){
2137
+ if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
2138
+ jQuery(this).remove();
2139
+ }
2140
+ });
2141
+
2142
+ <?php } ?>
2143
+
2144
+
2145
+ <?php //COLORIZER ?>
2146
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
2147
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
2148
+ jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
2149
+
2150
+
2151
+ <?php
2152
+
2153
+
2154
+ } ?>
2155
+ <?php //COLORIZER END ?>
2156
+ }catch(err){
2157
+ console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
2158
+ }finally{
2159
+ jQuery('html').show();
2160
+ jQuery('html').css('visibility','visible');
2161
+ }
2162
+ });
2163
+ /* ]]> */
2164
+
2165
+ </script>
2166
+ <?php
2167
+ }
2168
+
2169
+ function pluginUrl(){
2170
+ return trailingslashit(plugins_url(basename(dirname(__FILE__))));
2171
+ }
2172
+
2173
+ function agca_admin_page() {
2174
+
2175
+ $wpversion = $this->get_wp_version();
2176
+ $this->agca_error_check();
2177
+ ?>
2178
+ <?php //includes ?>
2179
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
2180
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2181
+
2182
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
2183
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2184
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
2185
+ <script type="text/javascript">
2186
+ var templates_ep = "<?php echo $this->templates_ep; ?>";
2187
+ var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
2188
+ </script>
2189
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
2190
+ <?php //includes ?>
2191
+ <div class="wrap">
2192
+ <h1 id="agca-title"><img src="<?php echo plugins_url( 'images/agca.png', __FILE__ ) ?>" /><span class="title">Absolutely Glamorous Custom Admin</span> <span class="version">(v<?php echo $this->agca_version; ?>)</span></h1>
2193
+ <div id="agca-social" style="float:right; margin-top: -23px;">
2194
+ <div class="fb-like" data-href="https://www.facebook.com/AG-Custom-Admin-892218404232342/timeline" data-layout="button" data-action="like" data-show-faces="true" data-share="true"></div>
2195
+ </div>
2196
+ <div id="agca_error_placeholder"></div>
2197
+ <div id="agca_news">&nbsp;</div><br />
2198
+ <form method="post" id="agca_form" action="options.php">
2199
+ <?php wp_nonce_field('agca_form','_agca_token'); ?>
2200
+ <?php settings_fields( 'agca-options-group' ); ?>
2201
+ <div id="agca-your-feedback">
2202
+ <strong>
2203
+ <span style="color:#005B69">Your feedback:</span>
2204
+ </strong>
2205
+ <a class="feedback positive" target="_blank" title="<?php _e('POSITIVE FEEDBACK: I like this plugin!', 'ag-custom-admin'); ?>" href="https://wordpress.org/support/plugin/ag-custom-admin/reviews/">
2206
+ <span class="dashicons dashicons-thumbs-up"></span>
2207
+ </a>
2208
+ <a class="feedback negative" target="_blank" title="<?php _e('NEGATIVE FEEDBACK: I don\'t like this plugin.', 'ag-custom-admin'); ?>" href="https://wordpress.org/support/plugin/ag-custom-admin/reviews/">
2209
+ <span class="dashicons dashicons-thumbs-down"></span>
2210
+ </a>
2211
+ </div>
2212
+ <br />
2213
+ <ul id="ag_main_menu" style="<?php echo $this->isCusminActive()?'display:none':''; ?>">
2214
+ <li class="selected" style="border-top-left-radius: 10px; "><a href="#general-settings" title="<?php _e('General Settings', 'ag-custom-admin')?>" ><?php _e('General', 'ag-custom-admin')?></a></li>
2215
+ <li class="normal"><a href="#admin-bar-settings" title="<?php _e('Settings for admin bar', 'ag-custom-admin')?>" ><?php _e('Admin Bar', 'ag-custom-admin')?></a></li>
2216
+ <li class="normal"><a href="#admin-footer-settings" title="<?php _e('Settings for admin footer', 'ag-custom-admin')?>" ><?php _e('Footer', 'ag-custom-admin')?></a></li>
2217
+ <li class="normal"><a href="#dashboad-page-settings" title="<?php _e('Settings for Dashboard page', 'ag-custom-admin')?>"><?php _e('Dashboard', 'ag-custom-admin')?></a></li>
2218
+ <li class="normal"><a href="#login-page-settings" title="<?php _e('Settings for Login page', 'ag-custom-admin')?>"><?php _e('Login Page', 'ag-custom-admin')?></a></li>
2219
+ <li class="normal" ><a href="#admin-menu-settings" title="<?php _e('Settings for main admin menu', 'ag-custom-admin')?>"><?php _e('Admin Menu', 'ag-custom-admin')?></a></li>
2220
+ <li class="normal"><a href="#ag-colorizer-settings" title="<?php _e('Colorizer settings', 'ag-custom-admin')?>"><?php _e('Colorizer', 'ag-custom-admin')?></a></li>
2221
+ <li class="normal"><a href="#ag-advanced" title="<?php _e('My custom scripts', 'ag-custom-admin')?>"><?php _e('Advanced', 'ag-custom-admin')?></a></li>
2222
+ <?php if(defined('AGCA_THEMES')){ ?>
2223
+ <li class="normal" style=""><a href="#ag-templates" title="<?php _e('AGCA Themes', 'ag-custom-admin')?>"><?php _e('Themes', 'ag-custom-admin')?></a></li>
2224
+ <?php } ?>
2225
+ <li class="normal upgrade"><a href="https://cusmin.com/upgrade-to-cusmin?ref=menu" target="_blank" title="<?php _e('Upgrade to Cusmin', 'ag-custom-admin')?>"><img src="<?php echo plugins_url( 'images/cusminlogo.png', __FILE__ ) ?>" /><?php _e('Upgrade', 'ag-custom-admin')?></a></li>
2226
+
2227
+ <li style="background:none;border:none;padding:0;"><a id="agca_donate_button" target="_blank" style="margin-left:8px" title="<?php _e('Enjoying AGCA? Help us further develop it and support it!', 'ag-custom-admin')?> " href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development"><img alt="<?php _e('Donate', 'ag-custom-admin')?>" src="<?php echo $this->pluginUrl(); ?>images/donate-btn.png" /></a>
2228
+ </li>
2229
+ <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2230
+ </ul>
2231
+ <div id="agca_advertising">
2232
+ <ul>
2233
+ <li style="min-height:105px;display: block">
2234
+ <a href="https://cusmin.com?ref=agca-ad" target="_blank"><img src="<?php echo $this->pluginUrl(); ?>images/advertising.jpg" /></a>
2235
+ </li>
2236
+ </ul>
2237
+ </div>
2238
+ <div class="agca-clear"></div>
2239
+ <div id="section-cusmin" style="display:none;"><?php _e('All AGCA plugin\'s settings, except admin themes, are disabled. Please use', 'ag-custom-admin')?> <a href="options-general.php?page=cusmin">Cusmin</a> <?php _e('plugin to manage these settings.', 'ag-custom-admin')?></div>
2240
+ <div id="section_general" style="display:none" class="ag_section">
2241
+ <h2 class="section_title"><?php _e('General Settings', 'ag-custom-admin')?></h2>
2242
+ <?php $this->show_save_button_upper(); ?>
2243
+ <p tabindex="0" class="agca-clear agca-tip"><i><?php _e('<strong>Tip: </strong>Move mouse cursor over the option label to see more information about an option', 'ag-custom-admin')?></i></p>
2244
+ <table class="agca-clear form-table" width="500px">
2245
+ <?php
2246
+
2247
+ $this->print_checkbox(array(
2248
+ 'name'=>'agca_role_allbutadmin',
2249
+ 'label'=>__('Exclude AGCA admin from customizations', 'ag-custom-admin'),
2250
+ 'title'=>__('<h3>Applying customizations</h3><br><strong>Checked</strong> - apply to all users, except admin<br><strong>Not checked</strong> - apply to everyone</br></br><strong>Q</strong>: Who is AGCA administrator?</br><strong>A</strong>: Go to <i>General -> Security -> AGCA admin capability</i> and change capability option to define administrators. Only the users with selected capability will be AGCA administrators.</br>', 'ag-custom-admin')
2251
+ ));
2252
+
2253
+ $this->print_options_h3(__('Pages', 'ag-custom-admin'));
2254
+
2255
+ $this->print_checkbox(array(
2256
+ 'hide'=>true,
2257
+ 'name'=>'agca_screen_options_menu',
2258
+ 'label'=>__('Hide "Screen Options" menu', 'ag-custom-admin'),
2259
+ 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2260
+ ));
2261
+
2262
+ $this->print_checkbox(array(
2263
+ 'hide'=>true,
2264
+ 'name'=>'agca_help_menu',
2265
+ 'label'=>__('Hide "Help" menu', 'ag-custom-admin'),
2266
+ 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2267
+ ));
2268
+
2269
+ $this->print_checkbox(array(
2270
+ 'title'=>__('Hides colors scheme on profile page', 'ag-custom-admin'),
2271
+ 'name'=>'agca_profile_color_scheme',
2272
+ 'hide'=>true,
2273
+ 'label'=>__('Hide User\'s Profile Color Scheme', 'ag-custom-admin')
2274
+ ));
2275
+
2276
+ $this->print_options_h3(__('Security', 'ag-custom-admin'));
2277
+
2278
+ ?>
2279
+
2280
+ <tr valign="center">
2281
+ <th scope="row">
2282
+ <label title="<?php _e('Choose which WordPress capability will be used to distinguish AGCA admin users from other users.</br>AGCA admin users have access to AGCA settings. AGCA administrators can be excluded from customizations if that option is checked', 'ag-custom-admin'); ?>" for="agca_admin_capability"><?php _e('AGCA admin capability', 'ag-custom-admin'); ?>:</label>
2283
+ </th>
2284
+ <td><?php echo $this->admin_capabilities; ?>&nbsp;&nbsp;<i>(<?php _e('default:&nbsp;<strong>edit_dashboard</strong>', 'ag-custom-admin'); ?>)</i>
2285
+ <p style="margin-left:5px;"><i><?php _e('Find more information about', 'ag-custom-admin'); ?> <a href="https://codex.wordpress.org/Roles_and_Capabilities" target="_blank"><?php _e('WordPress capabilities', 'ag-custom-admin'); ?></a></i></p>
2286
+ </td>
2287
+ <td>
2288
+ </td>
2289
+ </tr>
2290
+ <?php
2291
+ $this->print_options_h3(__('Feedback and Support', 'ag-custom-admin'));
2292
+
2293
+ ?>
2294
+ <tr valign="center">
2295
+ <td colspan="2">
2296
+ <div class="agca-feedback-and-support">
2297
+ <?php /*<ul>
2298
+ <li><a href="https://wordpressadminpanel.com/agca-support/contact/?type=feature" target="_blank"><span class="dashicons dashicons-lightbulb"></span>&nbsp;&nbsp;<?php _e('Idea for improvement', 'ag-custom-admin'); ?></a> - <?php _e('submit your idea for improvement', 'ag-custom-admin'); ?> </li>
2299
+ </ul>*/
2300
+ ?>
2301
+ <ul>
2302
+ <li><a href="https://wordpress.org/support/plugin/ag-custom-admin" target="_blank"><span class="dashicons dashicons-megaphone"></span>&nbsp;&nbsp;<?php _e('Report an issue', 'ag-custom-admin'); ?></a> - <?php _e('If plugin does not work as expected', 'ag-custom-admin'); ?> </li>
2303
+ </ul>
2304
+ <?php /*<ul>
2305
+ <li><a href="https://wordpressadminpanel.com/agca-support/contact/?type=theme" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;<?php _e('Idea for admin theme', 'ag-custom-admin'); ?></a> - <?php _e('submit your idea for admin theme', 'ag-custom-admin'); ?> </li>
2306
+ </ul>*/
2307
+ ?>
2308
+ <ul>
2309
+ <li><a href="https://wordpress.org/support/view/plugin-reviews/ag-custom-admin" target="_blank"><span class="dashicons dashicons-awards"></span>&nbsp;&nbsp;<?php _e('Add a review on WordPress.org', 'ag-custom-admin'); ?></a> - <?php _e('add your review and rate us on WordPress.org', 'ag-custom-admin'); ?> </li>
2310
+ </ul>
2311
+ <?php /*<ul>
2312
+ <li><a href="https://wordpressadminpanel.com/agca-support/" target="_blank"><span class="dashicons dashicons-shield-alt"></span>&nbsp;&nbsp;<?php _e('Visit our support site', 'ag-custom-admin'); ?></a> - <?php _e('for any other questions, feel free to contact us', 'ag-custom-admin'); ?> </li>
2313
+ </ul>*/
2314
+ ?>
2315
+ <ul>
2316
+ <li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development" target="_blank"><span class="dashicons dashicons-palmtree"></span>&nbsp;&nbsp;<?php _e('Donate', 'ag-custom-admin'); ?></a> - <?php _e('if you find this plugin helpful for your needs', 'ag-custom-admin'); ?> </li>
2317
+ </ul>
2318
+ <ul class="upgrade">
2319
+ <li><a href="https://cusmin.com/upgrade-to-cusmin?ref=page" target="_blank">
2320
+ <img src="<?php echo plugins_url( 'images/cusminlogo.png', __FILE__ ) ?>" />
2321
+ &nbsp;&nbsp;<span><?php _e('Upgrade to Cusmin', 'ag-custom-admin'); ?></span></a><span><?php _e('&nbsp;- unlock the ultimate branding experience', 'ag-custom-admin'); ?></span></li>
2322
+ </ul>
2323
+ </div>
2324
+ </td>
2325
+ <td></td>
2326
+ </tr>
2327
+ </table>
2328
+ </div>
2329
+ <div id="section_admin_bar" style="display:none" class="ag_section">
2330
+ <h2 class="section_title"><?php _e('Admin Bar Settings', 'ag-custom-admin'); ?></h2>
2331
+ <?php $this->show_save_button_upper(); ?>
2332
+ <table class="form-table" width="500px">
2333
+
2334
+ <?php
2335
+ $this->print_checkbox(array(
2336
+ 'attributes'=>array(
2337
+ 'class'=>'ag_table_major_options',
2338
+ ),
2339
+ 'hide'=>true,
2340
+ 'title'=>__('Hides admin bar completely from the admin panel', 'ag-custom-admin'),
2341
+ 'name'=>'agca_header',
2342
+ 'label'=>__('<strong>Hide Admin bar</strong>', 'ag-custom-admin'),
2343
+ 'input-attributes'=>'data-dependant="#agca_header_show_logout_content"',
2344
+ 'input-class'=>'has-dependant',
2345
+ ));
2346
+
2347
+ $this->print_checkbox(array(
2348
+ 'attributes'=>array(
2349
+ 'class'=>'ag_table_major_options',
2350
+ 'style'=> ((get_option('agca_header')!='true')?'display:none':''),
2351
+ 'id'=>'agca_header_show_logout_content',
2352
+ ),
2353
+ 'title'=>__('Check this if you want to show Log Out button in top right corner of the admin page', 'ag-custom-admin'),
2354
+ 'name'=>'agca_header_show_logout',
2355
+ 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2356
+ 'label'=>__('<strong>(but show Log Out button)</strong>', 'ag-custom-admin')
2357
+ ));
2358
+
2359
+ $this->print_checkbox(array(
2360
+ 'title'=>__('Removes admin bar customizations for authenticated users on site pages.</br>This option can be useful if you want to remove AGCA scripts (styles, JavaScript) on your website for any reason.', 'ag-custom-admin'),
2361
+ 'name'=>'agca_admin_bar_frontend',
2362
+ 'hide'=>true,
2363
+ 'label'=>__('Site pages: Do not apply Admin bar customizations', 'ag-custom-admin')
2364
+ ));
2365
+
2366
+ $this->print_checkbox(array(
2367
+ 'title'=>__('Hides admin bar completely for authenticated users on site pages.', 'ag-custom-admin'),
2368
+ 'name'=>'agca_admin_bar_frontend_hide',
2369
+ 'hide'=>true,
2370
+ 'label'=>__('Site pages: Hide Admin bar', 'ag-custom-admin')
2371
+ ));
2372
+
2373
+ $this->print_options_h3(__('Left Side', 'ag-custom-admin'));
2374
+
2375
+ $this->print_input(array(
2376
+ 'title'=>__('Change default WordPress logo with custom image.', 'ag-custom-admin'),
2377
+ 'name'=>'agca_wp_logo_custom',
2378
+ 'label'=>__('Admin bar logo', 'ag-custom-admin'),
2379
+ 'hint' =>__('Image URL', 'ag-custom-admin')
2380
+ ));
2381
+
2382
+ $this->print_input(array(
2383
+ 'title'=>__('Custom link on admin bar logo.', 'ag-custom-admin').'</br></br>Use:</br><strong>%BLOG%</strong> - '.__('for blog URL.', 'ag-custom-admin').'</br><strong>%SWITCH%</strong> - '.__('to switch betweent admin and site area', 'ag-custom-admin'),
2384
+ 'name'=>'agca_wp_logo_custom_link',
2385
+ 'label'=>__('Admin bar logo link', 'ag-custom-admin'),
2386
+ 'hint' =>__('Link', 'ag-custom-admin')
2387
+ ));
2388
+
2389
+ $this->print_input(array(
2390
+ 'title'=>__('Customize WordPress title using custom title template.</br></br>Examples', 'ag-custom-admin').':</br><strong>%BLOG% -- %PAGE%</strong> '.'('.__('will be', 'ag-custom-admin').')'.' <i>My Blog -- Add New Post</i></br><strong>%BLOG%</strong> ('.__('will be', 'ag-custom-admin').') <i>My Blog</i></br><strong>My Company > %BLOG% > %PAGE%</strong> ('.__('will be', 'ag-custom-admin').') <i>My Company > My Blog > Tools</i>',
2391
+ 'name'=>'agca_custom_title',
2392
+ 'label'=>__('Page title template', 'ag-custom-admin'),
2393
+ 'hint' =>__('Please use', 'ag-custom-admin').' <strong>%BLOG%</strong> '.__('and', 'ag-custom-admin'). ' <strong>%PAGE%</strong> '.__('in your title template.', 'ag-custom-admin')
2394
+ ));
2395
+
2396
+ $this->print_input(array(
2397
+ 'title'=>__('Add custom image on the top of the admin content.', 'ag-custom-admin'),
2398
+ 'name'=>'agca_header_logo_custom',
2399
+ 'label'=>__('Header image', 'ag-custom-admin'),
2400
+ 'hint' =>__('Image URL', 'ag-custom-admin')
2401
+ ));
2402
+
2403
+
2404
+ $this->print_checkbox(array(
2405
+ 'hide'=>true,
2406
+ 'title'=>__('Hides small Wordpress logo or custom logo from the admin bar', 'ag-custom-admin'),
2407
+ 'name'=>'agca_header_logo',
2408
+ 'label'=>__('Hide Admin bar logo', 'ag-custom-admin')
2409
+ ));
2410
+
2411
+ $this->print_checkbox(array(
2412
+ 'hide'=>true,
2413
+ 'title'=>__('Hides WordPress context menu on admin bar logo from admin bar', 'ag-custom-admin'),
2414
+ 'name'=>'agca_remove_top_bar_dropdowns',
2415
+ 'label'=>__('Hide Admin bar logo context menu', 'ag-custom-admin')
2416
+ ));
2417
+
2418
+ $this->print_checkbox(array(
2419
+ 'hide'=>true,
2420
+ 'title'=>__('Hides site name link from the admin bar', 'ag-custom-admin'),
2421
+ 'name'=>'agca_remove_site_link',
2422
+ 'label'=>__('Hide Site name', 'ag-custom-admin')
2423
+ ));
2424
+
2425
+ $this->print_checkbox(array(
2426
+ 'hide'=>true,
2427
+ 'title'=>__('Hides update notifications from admin bar', 'ag-custom-admin'),
2428
+ 'name'=>'agca_admin_bar_update_notifications',
2429
+ 'label'=>__('Remove update notifications', 'ag-custom-admin')
2430
+ ));
2431
+
2432
+ $this->print_checkbox(array(
2433
+ 'hide'=>true,
2434
+ 'title'=>__('Hides comments block from admin bar', 'ag-custom-admin'),
2435
+ 'name'=>'agca_admin_bar_comments',
2436
+ 'label'=>__('Hide "Comments" block', 'ag-custom-admin')
2437
+ ));
2438
+
2439
+ $this->print_checkbox(array(
2440
+ 'hide'=>true,
2441
+ 'attributes'=>array(
2442
+ 'style'=>'margin-top:20px;'
2443
+ ),
2444
+ 'title'=>__('Hides "+ New" block and its context menu from admin bar', 'ag-custom-admin'),
2445
+ 'name'=>'agca_admin_bar_new_content',
2446
+ 'label'=>__('Hide "+ New" block', 'ag-custom-admin'),
2447
+ 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2448
+ 'input-class'=>'has-dependant dependant-opposite'
2449
+ ));
2450
+
2451
+ $this->print_checkbox(array(
2452
+ 'hide'=>true,
2453
+ 'attributes'=>array(
2454
+ 'class'=>'new_content_header_submenu'
2455
+ ),
2456
+ 'title'=>__('Hides "Post" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2457
+ 'name'=>'agca_admin_bar_new_content_post',
2458
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Post sub-menu', 'ag-custom-admin')
2459
+ ));
2460
+
2461
+ $this->print_checkbox(array(
2462
+ 'hide'=>true,
2463
+ 'attributes'=>array(
2464
+ 'class'=>'new_content_header_submenu'
2465
+ ),
2466
+ 'title'=>__('Hides "Link" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2467
+ 'name'=>'agca_admin_bar_new_content_link',
2468
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Link sub-menu', 'ag-custom-admin')
2469
+ ));
2470
+
2471
+ $this->print_checkbox(array(
2472
+ 'hide'=>true,
2473
+ 'attributes'=>array(
2474
+ 'class'=>'new_content_header_submenu'
2475
+ ),
2476
+ 'title'=>__('Hides "Page" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2477
+ 'name'=>'agca_admin_bar_new_content_page',
2478
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Page sub-menu', 'ag-custom-admin')
2479
+ ));
2480
+
2481
+ $this->print_checkbox(array(
2482
+ 'hide'=>true,
2483
+ 'attributes'=>array(
2484
+ 'class'=>'new_content_header_submenu'
2485
+ ),
2486
+ 'title'=>__('Hides "User" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2487
+ 'name'=>'agca_admin_bar_new_content_user',
2488
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> User sub-menu', 'ag-custom-admin')
2489
+ ));
2490
+
2491
+ $this->print_checkbox(array(
2492
+ 'hide'=>true,
2493
+ 'attributes'=>array(
2494
+ 'class'=>'new_content_header_submenu'
2495
+ ),
2496
+ 'title'=>__('Hides "Media" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2497
+ 'name'=>'agca_admin_bar_new_content_media',
2498
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Media sub-menu', 'ag-custom-admin')
2499
+ ));
2500
+
2501
+ /* $this->print_checkbox(array(
2502
+ 'hide'=>true,
2503
+ 'title'=>__('Hides "Admin themes" from admin bar', 'ag-custom-admin'),
2504
+ 'name'=>'agca_admin_bar_admin_themes',
2505
+ 'label'=>__('"Admin themes"', 'ag-custom-admin')
2506
+ ));*/
2507
+
2508
+ $this->print_input(array(
2509
+ 'title'=>__('Adds custom text in admin top bar.', 'ag-custom-admin'),
2510
+ 'name'=>'agca_custom_site_heading',
2511
+ 'label'=>__('Custom blog heading', 'ag-custom-admin'),
2512
+ 'hint'=>__('<strong>Tip: </strong>You can use HTML tags like', 'ag-custom-admin')." &lt;h1&gt; ".__('or', 'ag-custom-admin')." &lt;a&gt;"
2513
+ ));
2514
+
2515
+
2516
+ $this->print_checkbox(array(
2517
+ 'hide'=>true,
2518
+ 'title'=>__('Hides the yellow bar with the information about the new WordPress release', 'ag-custom-admin'),
2519
+ 'name'=>'agca_update_bar',
2520
+ 'label'=>__('Hide WordPress update notification', 'ag-custom-admin')
2521
+ ));
2522
+
2523
+ $this->print_options_h3(__('Right Side', 'ag-custom-admin'));
2524
+
2525
+ $this->print_input(array(
2526
+ 'name'=>'agca_howdy',
2527
+ 'label'=>__('Change Howdy text', 'ag-custom-admin'),
2528
+ ));
2529
+
2530
+ $this->print_input(array(
2531
+ 'title'=>__('Put \'Exit\', for example', 'ag-custom-admin'),
2532
+ 'name'=>'agca_logout',
2533
+ 'label'=>__('Change Log out text', 'ag-custom-admin'),
2534
+ ));
2535
+
2536
+ $this->print_checkbox(array(
2537
+ 'hide'=>true,
2538
+ 'name'=>'agca_remove_your_profile',
2539
+ 'label'=>__('Hide "Edit My Profile" link', 'ag-custom-admin'),
2540
+ ));
2541
+
2542
+ $this->print_checkbox(array(
2543
+ 'title'=>__('If selected, hides all elements in top right corner, except Log Out button', 'ag-custom-admin'),
2544
+ 'name'=>'agca_logout_only',
2545
+ 'label'=>__('Log out only', 'ag-custom-admin')
2546
+ ));
2547
+
2548
+ ?>
2549
+
2550
+ </table>
2551
+ </div>
2552
+
2553
+ <div id="section_admin_footer" style="display:none" class="ag_section">
2554
+ <h2 class="section_title"><?php _e('Admin Footer Settings', 'ag-custom-admin'); ?></h2>
2555
+ <?php $this->show_save_button_upper(); ?>
2556
+ <table class="form-table" width="500px">
2557
+ <?php
2558
+ $this->print_checkbox(array(
2559
+ 'hide'=>true,
2560
+ 'attributes'=>array(
2561
+ 'class'=>'ag_table_major_options'
2562
+ ),
2563
+ 'title'=>__('Hides footer with all elements', 'ag-custom-admin'),
2564
+ 'name'=>'agca_footer',
2565
+ 'label'=>__('<strong>Hide footer</strong>', 'ag-custom-admin')
2566
+ ));
2567
+
2568
+ $this->print_options_h3(__('Footer Options', 'ag-custom-admin'));
2569
+
2570
+ $this->print_checkbox(array(
2571
+ 'hide'=>true,
2572
+ 'title'=>__('Hides default text in footer', 'ag-custom-admin'),
2573
+ 'name'=>'agca_footer_left_hide',
2574
+ 'label'=>__('Hide footer text', 'ag-custom-admin')
2575
+ ));
2576
+
2577
+ $this->print_textarea(array(
2578
+ 'title'=>__('Replaces text \'Thank you for creating with WordPress\' with custom text', 'ag-custom-admin'),
2579
+ 'name'=>'agca_footer_left',
2580
+ 'class' => 'one-line',
2581
+ 'label'=>__('Change footer text', 'ag-custom-admin')
2582
+ ));
2583
+
2584
+ $this->print_checkbox(array(
2585
+ 'hide'=>true,
2586
+ 'title'=>__('Hides text \'Get Version ...\' on right', 'ag-custom-admin'),
2587
+ 'name'=>'agca_footer_right_hide',
2588
+ 'label'=>__('Hide version text', 'ag-custom-admin')
2589
+ ));
2590
+
2591
+ $this->print_textarea(array(
2592
+ 'title'=>__('Replaces text \'Get Version ...\' with custom text', 'ag-custom-admin'),
2593
+ 'name'=>'agca_footer_right',
2594
+ 'class' => 'one-line',
2595
+ 'label'=>__('Change version text', 'ag-custom-admin')
2596
+ ));
2597
+
2598
+ ?>
2599
+
2600
+ </table>
2601
+ </div>
2602
+ <div id="section_dashboard_page" style="display:none" class="ag_section">
2603
+ <h2 class="section_title"><?php _e('Dashboard Settings', 'ag-custom-admin'); ?></h2>
2604
+ <?php $this->show_save_button_upper(); ?>
2605
+ <table class="form-table" width="500px">
2606
+ <?php
2607
+
2608
+ $this->print_options_h3(__('Dashboard Options', 'ag-custom-admin'));
2609
+
2610
+ $this->print_input(array(
2611
+ 'title'=>__('Main heading (\'Dashboard\') on Dashboard page', 'ag-custom-admin'),
2612
+ 'name'=>'agca_dashboard_text',
2613
+ 'label'=>__('Change Dashboard heading text', 'ag-custom-admin'),
2614
+ ));
2615
+
2616
+ ?>
2617
+ <tr valign="center">
2618
+ <th scope="row">
2619
+ <label title="<?php _e('Adds custom text (or HTML) between heading and widgets area on Dashboard page', 'ag-custom-admin'); ?>" for="agca_dashboard_text_paragraph"><?php _e('Add custom Dashboard content<br> <em>(text or HTML content)', 'ag-custom-admin'); ?></em></label>
2620
+ </th>
2621
+ <td class="agca_editor">
2622
+ <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2623
+ </td>
2624
+ </tr>
2625
+ <?php
2626
+
2627
+ $this->print_options_h3(__('Dashboard Widgets Options', 'ag-custom-admin'));
2628
+
2629
+ ?>
2630
+ <tr>
2631
+ <td colspan="2">
2632
+ <p tabindex="0" class="agca-tip"><i><strong><?php _e('Note', 'ag-custom-admin'); ?>:</strong> <?php _e('These settings will override settings configured in the Screen options on Dashboard page.', 'ag-custom-admin'); ?></i></p>
2633
+ </td>
2634
+ </tr>
2635
+ <?php
2636
+ $this->print_checkbox(array(
2637
+ 'hide'=>true,
2638
+ 'title'=>__('Hides Welcome WordPress widget', 'ag-custom-admin'),
2639
+ 'name'=>'agca_dashboard_widget_welcome',
2640
+ 'label'=>__('Hide "Welcome" widget', 'ag-custom-admin')
2641
+ ));
2642
+
2643
+ $this->print_checkbox(array(
2644
+ 'hide'=>true,
2645
+ 'title'=>__('Hides Activity dashboard widget', 'ag-custom-admin'),
2646
+ 'name'=>'agca_dashboard_widget_activity',
2647
+ 'label'=>__('Hide "Activity" widget', 'ag-custom-admin')
2648
+ ));
2649
+
2650
+ $this->print_checkbox(array(
2651
+ 'hide'=>true,
2652
+ 'title'=>__('Hides Quick Draft dashboard widget', 'ag-custom-admin'),
2653
+ 'name'=>'agca_dashboard_widget_qp',
2654
+ 'label'=>__('Hide "Quick Draft" widget', 'ag-custom-admin')
2655
+ ));
2656
+
2657
+ $this->print_checkbox(array(
2658
+ 'hide'=>true,
2659
+ 'title'=>__('Hides At a Glance dashboard widget', 'ag-custom-admin'),
2660
+ 'name'=>'agca_dashboard_widget_rn',
2661
+ 'label'=>__('Hide "At a Glance" widget', 'ag-custom-admin')
2662
+ ));
2663
+
2664
+ $this->print_checkbox(array(
2665
+ 'hide'=>true,
2666
+ 'name'=>'agca_dashboard_widget_primary',
2667
+ 'title'=>__('This is \'WordPress News\' or \'WordPress Development Blog\' widget in older WordPress versions', 'ag-custom-admin'),
2668
+ 'label'=>__('Hide "WordPress News" widget', 'ag-custom-admin')
2669
+ ));
2670
+
2671
+ $this->print_checkbox(array(
2672
+ 'hide'=>true,
2673
+ 'name'=>'agca_dashboard_widget_secondary',
2674
+ 'title'=>__('This is \'Other WordPress News\' widget by default', 'ag-custom-admin'),
2675
+ 'label'=>__('Hide secondary widget area', 'ag-custom-admin')
2676
+ ));
2677
+
2678
+ ?>
2679
+ </table>
2680
+ </div>
2681
+ <div id="section_login_page" style="display:none" class="ag_section">
2682
+ <h2 class="section_title"><?php _e('Login Page Settings', 'ag-custom-admin'); ?></h2>
2683
+ <?php $this->show_save_button_upper(); ?>
2684
+ <table class="form-table" width="500px">
2685
+ <?php
2686
+
2687
+ $this->print_options_h3(__('Login Page Options', 'ag-custom-admin'));
2688
+
2689
+ $this->print_checkbox(array(
2690
+ 'hide'=>true,
2691
+ 'name'=>'agca_login_banner',
2692
+ 'title'=>__('Hide back to blog block', 'ag-custom-admin'),
2693
+ 'label'=>__('Hide "Back to blog" text', 'ag-custom-admin')
2694
+ ));
2695
+
2696
+ $this->print_input(array(
2697
+ 'name'=>'agca_login_banner_text',
2698
+ 'title'=>__('Changes \'<- Back to ...\' text in top bar on Login page', 'ag-custom-admin'),
2699
+ 'label'=>__('Change back to blog text', 'ag-custom-admin')
2700
+ ));
2701
+
2702
+ $this->print_input(array(
2703
+ 'title'=>__('If this field is not empty, image from provided url will be visible on Login page', 'ag-custom-admin'),
2704
+ 'name'=>'agca_login_photo_url',
2705
+ 'label'=>__('Change Login header image', 'ag-custom-admin'),
2706
+ 'hint'=>__('Image URL', 'ag-custom-admin')
2707
+ ));
2708
+
2709
+ $this->print_input(array(
2710
+ 'title'=>__('Put here custom link to a web location, that will be triggered on image click', 'ag-custom-admin'),
2711
+ 'name'=>'agca_login_photo_href',
2712
+ 'label'=>__('Change link on login image', 'ag-custom-admin'),
2713
+ 'hint'=>__('For blog URL use', 'ag-custom-admin').' %BLOG%'
2714
+ ));
2715
+
2716
+ $this->print_checkbox(array(
2717
+ 'hide'=>true,
2718
+ 'title'=>__('Hides login image completely', 'ag-custom-admin'),
2719
+ 'name'=>'agca_login_photo_remove',
2720
+ 'label'=>__('Hide login header image', 'ag-custom-admin'),
2721
+ ));
2722
+
2723
+ $this->print_checkbox(array(
2724
+ 'title'=>__('Rounds box on login page', 'ag-custom-admin'),
2725
+ 'name'=>'agca_login_round_box',
2726
+ 'label'=>'Round box corners',
2727
+ 'input-class'=>'has-dependant',
2728
+ 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block"'
2729
+ ));
2730
+
2731
+ $this->print_input(array(
2732
+ 'attributes'=>array(
2733
+ 'style'=> ((get_option('agca_login_round_box')=='true')?'display:none':''),
2734
+ 'id'=>'agca_login_round_box_size_block'
2735
+ ),
2736
+ 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2737
+ 'name'=>'agca_login_round_box_size',
2738
+ 'label'=>__('Round box corners - size', 'ag-custom-admin'),
2739
+ 'input-class'=>'validateNumber',
2740
+ 'hint'=>__('(Size in px)', 'ag-custom-admin')
2741
+ ));
2742
+
2743
+ $this->print_checkbox(array(
2744
+ 'hide'=>true,
2745
+ 'title'=>__('Hides register link on login page', 'ag-custom-admin'),
2746
+ 'name'=>'agca_login_register_remove',
2747
+ 'label'=>__('Hide "Register" link', 'ag-custom-admin'),
2748
+ 'input-class'=>'has-dependant dependant-opposite',
2749
+ 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2750
+ ));
2751
+
2752
+ $this->print_input(array(
2753
+ 'attributes'=>array(
2754
+ 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2755
+ 'id'=>'agca_login_register_href_block'
2756
+ ),
2757
+ 'title'=>__('Change register link on login page to point to your custom registration page.', 'ag-custom-admin'),
2758
+ 'name'=>'agca_login_register_href',
2759
+ 'label'=>__('Change register link', 'ag-custom-admin'),
2760
+ 'hint'=>__('Link to new registration page', 'ag-custom-admin')
2761
+ ));
2762
+
2763
+ $this->print_checkbox(array(
2764
+ 'hide'=>true,
2765
+ 'title'=>__('Hides lost password link on login page', 'ag-custom-admin'),
2766
+ 'name'=>'agca_login_lostpassword_remove',
2767
+ 'label'=>__('Hide "Lost password" link', 'ag-custom-admin'),
2768
+ ));
2769
+ ?>
2770
+ </table>
2771
+ </div>
2772
+ <?php
2773
+ /*ADMIN MENU*/
2774
+ ?>
2775
+ <div id="section_admin_menu" style="display:none" class="ag_section">
2776
+ <h2 class="section_title"><?php _e('Admin Menu Settings', 'ag-custom-admin'); ?></h2>
2777
+ <?php $this->show_save_button_upper(); ?>
2778
+ <table class="form-table" width="500px">
2779
+ <tr valign="center" class="ag_table_major_options">
2780
+ <td><label for="agca_admin_menu_turnonoff"><strong><?php _e('Apply admin menu customizations', 'ag-custom-admin'); ?></strong></label></td>
2781
+ <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_turnonoff" title="<?php _e('Hides admin menu completely (administrator can see \'AGCA\' button)', 'ag-custom-admin'); ?>" value="on" <?php if (get_option('agca_admin_menu_turnonoff')==true) echo 'checked="checked" '; ?> /></td>
2782
+ </tr>
2783
+ <tr valign="center" class="ag_table_major_options">
2784
+ <td><label for="agca_admin_menu_agca_button_only"><strong><?php _e('Admin menu', 'ag-custom-admin'); ?></strong></label></td>
2785
+ <td><input class="agca-checkbox visibility" type="checkbox" name="agca_admin_menu_agca_button_only" title="<?php _e('Hides admin menu completely (administrator can see \'AGCA\' button)', 'ag-custom-admin'); ?>" value="true" <?php if (get_option('agca_admin_menu_agca_button_only')==true) echo 'checked="checked" '; ?> /></td>
2786
+ </tr>
2787
+ <?php
2788
+ $this->print_options_h3(__('Edit / Remove Menu Items', 'ag-custom-admin'));
2789
+ ?>
2790
+ <tr>
2791
+ <td colspan="2">
2792
+ <input type="button" class="agca_button" id="ag_edit_adminmenu_reset_button" title="<?php _e('Reset menu settings to default values', 'ag-custom-admin'); ?>" name="ag_edit_adminmenu_reset_button" value="<?php _e('Reset to default settings', 'ag-custom-admin'); ?>" /><br />
2793
+ <p tabindex="0"><em>(<?php _e('click on the top menu item to show its sub-menus', 'ag-custom-admin'); ?>)</em></p>
2794
+ <table id="ag_edit_adminmenu">
2795
+ <tr style="background-color:#816c64;">
2796
+ <td width="300px"><div style="float:left;color:#fff;"><h3><?php _e('Item', 'ag-custom-admin'); ?></h3></div><div style="float:right;color:#fff;"><h3><?php _e('Hide?', 'ag-custom-admin'); ?></h3></div></td><td width="300px" style="color:#fff;" ><h3><?php _e('Change Text', 'ag-custom-admin'); ?></h3>
2797
+ </td>
2798
+ </tr>
2799
+ </table>
2800
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json" name="ag_edit_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_edit_adminmenu_json')); ?>" />
2801
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2802
+ </td>
2803
+ <td></td>
2804
+ </tr>
2805
+ <?php
2806
+ $this->print_checkbox(array(
2807
+ 'title'=>__('Removes Profile menu item for non-admin users.', 'ag-custom-admin'),
2808
+ 'hide'=>true,
2809
+ 'name'=>'agca_menu_remove_client_profile',
2810
+ 'label'=>__('Remove Profile button from user menu', 'ag-custom-admin'),
2811
+ ));
2812
+ $this->print_checkbox(array(
2813
+ 'title'=>__('Removes Customize button on front end for authenticated users.', 'ag-custom-admin'),
2814
+ 'hide'=>true,
2815
+ 'name'=>'agca_menu_remove_customize_button',
2816
+ 'label'=>__('Front end: Remove Customize button', 'ag-custom-admin'),
2817
+ ));
2818
+ ?>
2819
+
2820
+ <?php
2821
+ $this->print_options_h3(__('Add New Menu Items', 'ag-custom-admin'));
2822
+ ?>
2823
+ <tr>
2824
+ <td colspan="2">
2825
+ <table id="ag_add_adminmenu">
2826
+ <tr>
2827
+ <td colspan="2">
2828
+ <?php _e('name', 'ag-custom-admin'); ?>:<input type="text" size="47" title="<?php _e('New button visible name', 'ag-custom-admin'); ?>" id="ag_add_adminmenu_name" name="ag_add_adminmenu_name" />
2829
+ <?php _e('url', 'ag-custom-admin'); ?>:<input type="text" size="47" title="<?php _e('New button link', 'ag-custom-admin'); ?>" id="ag_add_adminmenu_url" name="ag_add_adminmenu_url" />
2830
+ <?php _e('open in', 'ag-custom-admin'); ?>:&nbsp;<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:auto;">
2831
+ <option value="_self" selected><?php _e('the same tab', 'ag-custom-admin'); ?></option>
2832
+ <option value="_blank" ><?php _e('a new tab', 'ag-custom-admin'); ?></option>
2833
+ </select>
2834
+ <input type="button" id="ag_add_adminmenu_button" class="agca_button" title="<?php _e('Add new item button" name="ag_add_adminmenu_button', 'ag-custom-admin'); ?>" value="<?php _e('Add new item', 'ag-custom-admin'); ?>" />
2835
+ </td><td></td>
2836
+ </tr>
2837
+ </table>
2838
+ <input type="hidden" size="47" id="ag_add_adminmenu_json" name="ag_add_adminmenu_json" value="<?php echo htmlspecialchars(get_option('ag_add_adminmenu_json')); ?>" />
2839
+ </td>
2840
+ <td>
2841
+ </td>
2842
+ </tr>
2843
+ <?php
2844
+ $this->print_options_h3(__('Admin Menu Settings', 'ag-custom-admin'));
2845
+ ?>
2846
+ <tr valign="center">
2847
+ <th scope="row">
2848
+ <label title="<?php _e('Choose how admin menu should behave on mobile devices / small screens', 'ag-custom-admin'); ?>" for="agca_admin_menu_autofold"><?php _e('Admin menu auto folding', 'ag-custom-admin'); ?></label>
2849
+ </th>
2850
+ <td>
2851
+ <select title="<?php _e('General', 'ag-custom-admin'); ?>Choose how admin menu should behave on mobile devices / small screens" class="agca-selectbox" name="agca_admin_menu_autofold" >
2852
+ <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> ><?php _e('Default', 'ag-custom-admin'); ?></option>
2853
+ <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> ><?php _e('Force admin menu auto-folding', 'ag-custom-admin'); ?></option>
2854
+ <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> ><?php _e('Disable admin menu auto-folding', 'ag-custom-admin'); ?></option>
2855
+ </select>
2856
+ </td>
2857
+ </tr>
2858
+ <?php
2859
+
2860
+ $this->print_checkbox(array(
2861
+ 'hide'=>true,
2862
+ 'title'=>__('Removes empty space between some top menu items', 'ag-custom-admin'),
2863
+ 'name'=>'agca_admin_menu_separators',
2864
+ 'label'=>__('Hide menu items separators', 'ag-custom-admin'),
2865
+ ));
2866
+
2867
+ $this->print_checkbox(array(
2868
+ 'hide'=>true,
2869
+ 'title'=>__('Removes icons from dmin menu buttons', 'ag-custom-admin'),
2870
+ 'name'=>'agca_admin_menu_icons',
2871
+ 'label'=>__('Hide menu icons', 'ag-custom-admin'),
2872
+ ));
2873
+
2874
+ $this->print_checkbox(array(
2875
+ 'hide'=>true,
2876
+ 'title'=>__('Removes small arrow that appears on the top button hover', 'ag-custom-admin'),
2877
+ 'name'=>'agca_admin_menu_arrow',
2878
+ 'label'=>__('Hide sub-menu arrow', 'ag-custom-admin'),
2879
+ ));
2880
+
2881
+ $this->print_checkbox(array(
2882
+ 'hide'=>true,
2883
+ 'title'=>__('Removes collapse button at the end of admin menu', 'ag-custom-admin'),
2884
+ 'name'=>'agca_admin_menu_collapse_button',
2885
+ 'label'=>__('Hide "Collapse menu" button', 'ag-custom-admin'),
2886
+ ));
2887
+
2888
+ $this->print_checkbox(array(
2889
+ 'title'=>__('Rounds submenu pop-up box', 'ag-custom-admin'),
2890
+ 'name'=>'agca_admin_menu_submenu_round',
2891
+ 'label'=>__('Round sub-menu pop-up box', 'ag-custom-admin'),
2892
+ 'input-attributes'=>'data-dependant="#agca_admin_menu_submenu_round_size"',
2893
+ 'input-class'=>'has-dependant',
2894
+ ));
2895
+
2896
+ $this->print_input(array(
2897
+ 'attributes'=>array(
2898
+ 'style'=> ((get_option('agca_admin_menu_submenu_round')!='true')?'display:none':''),
2899
+ 'id'=>'agca_admin_menu_submenu_round_size'
2900
+ ),
2901
+ 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2902
+ 'name'=>'agca_admin_menu_submenu_round_size',
2903
+ 'label'=>__('Round sub-menu pop-up box - size', 'ag-custom-admin'),
2904
+ 'input-class'=>'validateNumber',
2905
+ 'hint'=>__('(Size in px)', 'ag-custom-admin')
2906
+ ));
2907
+
2908
+ $this->print_input(array(
2909
+ 'title'=>__('Adds custom logo above the admin menu', 'ag-custom-admin'),
2910
+ 'name'=>'agca_admin_menu_brand',
2911
+ 'label'=>__('Admin menu branding logo', 'ag-custom-admin'),
2912
+ 'hint'=>__('Image URL', 'ag-custom-admin')
2913
+ ));
2914
+
2915
+ $this->print_input(array(
2916
+ 'title'=>__('Change branding logo link</br></br>Use:', 'ag-custom-admin').'</br><strong>%BLOG%</strong> - '. __('for blog URL', 'ag-custom-admin'),
2917
+ 'name'=>'agca_admin_menu_brand_link',
2918
+ 'label'=>__('Branding logo link', 'ag-custom-admin'),
2919
+ 'hint'=>__('Branding image URL', 'ag-custom-admin')
2920
+ ));
2921
+ ?>
2922
+ </table>
2923
+ </div>
2924
+ <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2925
+ <h2 class="section_title"><?php _e('Colorizer Page', 'ag-custom-admin'); ?></h2>
2926
+ <?php $this->show_save_button_upper(); ?>
2927
+ <table class="form-table" width="500px">
2928
+ <tr valign="center" class="ag_table_major_options">
2929
+ <td><label for="agca_colorizer_turnonoff"><strong><?php _e('Apply Colorizer customizations', 'ag-custom-admin'); ?></strong></label></td>
2930
+ <td><input class="agca-checkbox visibility" type="checkbox" name="agca_colorizer_turnonoff" value="on" <?php if (get_option('agca_colorizer_turnonoff')==true) echo 'checked="checked" '; ?> /></td>
2931
+ </tr>
2932
+ <?php
2933
+ $this->print_options_h3(__('Global Color Options', 'ag-custom-admin'));
2934
+
2935
+ $this->print_color('color_background',__('Background:', 'ag-custom-admin'),__('Change admin page background color', 'ag-custom-admin'));
2936
+ $this->print_color('login_color_background',__('Login page background:', 'ag-custom-admin'),__('Change login page background color', 'ag-custom-admin'));
2937
+ $this->print_color('color_header',__('Admin bar:', 'ag-custom-admin'),__('Change admin bar (on top) color in admin panel', 'ag-custom-admin'));
2938
+
2939
+ $this->print_options_h3(__('Admin Menu Color Options', 'ag-custom-admin'));
2940
+
2941
+ $this->print_color('color_admin_menu_top_button_background',__('Button background:', 'ag-custom-admin'),__('Change button background color', 'ag-custom-admin'));
2942
+ $this->print_color('color_admin_menu_font',__('Button text:', 'ag-custom-admin'),__('Change button text color', 'ag-custom-admin'));
2943
+ $this->print_color('color_admin_menu_top_button_current_background',__('Selected button background:', 'ag-custom-admin'),__('Change button background color for current button', 'ag-custom-admin'));
2944
+ $this->print_color('color_admin_menu_top_button_hover_background',__('Hover button background:', 'ag-custom-admin'),__('Change button background color on mouseover', 'ag-custom-admin'));
2945
+ $this->print_color('color_admin_menu_submenu_background',__('Sub-menu button background:', 'ag-custom-admin'),__('Change submenu item background color', 'ag-custom-admin'));
2946
+ $this->print_color('color_admin_menu_submenu_background_hover',__('Sub-menu hover button background:', 'ag-custom-admin'),__('Change submenu item background color on mouseover', 'ag-custom-admin'));
2947
+ $this->print_color('color_admin_submenu_font',__('Sub-menu text:', 'ag-custom-admin'),__('Sub-menu text color', 'ag-custom-admin'));
2948
+ $this->print_color('color_admin_menu_behind_background',__('Wrapper background:', 'ag-custom-admin'),__('Change background color of element behind admin menu', 'ag-custom-admin'));
2949
+
2950
+ $this->print_options_h3(__('Font Color Options', 'ag-custom-admin'));
2951
+
2952
+ $this->print_color('color_font_content',__('Content text:', 'ag-custom-admin'),__('Change color in content text', 'ag-custom-admin'));
2953
+ $this->print_color('color_font_header',__('Admin bar text:', 'ag-custom-admin'),__('Change color of admin bar text', 'ag-custom-admin'));
2954
+ $this->print_color('color_font_footer',__('Footer text:', 'ag-custom-admin'),__('Change color in footer text', 'ag-custom-admin'));
2955
+
2956
+ $this->print_options_h3(__('Widgets Color Options', 'ag-custom-admin'));
2957
+
2958
+ $this->print_color('color_widget_bar',__('Title bar background:', 'ag-custom-admin'),__('Change color in header text', 'ag-custom-admin'));
2959
+ $this->print_color('color_widget_background',__('Background:', 'ag-custom-admin'),__('Change widget background color', 'ag-custom-admin'));
2960
+
2961
+ ?>
2962
+ </table>
2963
+ <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
2964
+ <div id="picker"></div>
2965
+ </div>
2966
+ <?php if(defined('AGCA_THEMES')){ ?>
2967
+ <div id="section_templates" style="display:none" class="ag_section">
2968
+ <h2 class="section_title"><span style="float:left"><?php _e('Admin Themes', 'ag-custom-admin'); ?></span></h2>
2969
+ <table class="form-table" width="500px">
2970
+ <tr valign="center">
2971
+ <td>
2972
+ <p style="color: red; font-size:15px;font-weight:bold;margin-bottom:20px;">Note: AGCA Themes will be discontinued soon!</p>
2973
+ <div id="agca_templates"></div>
2974
+ </td>
2975
+ </tr>
2976
+ <tr>
2977
+ <td>
2978
+ <div id="advanced_template_options" style="display:none">
2979
+ <div class="agca-feedback-and-support">
2980
+ <ul>
2981
+ <?php /* <li><a href="https://wordpressadminpanel.com/agca-support/contact/?type=theme" title="<?php _e('If you have any ideas for theme improvements, or you have new themes requests, please feel free to send us a message', 'ag-custom-admin'); ?>" target="_blank"><span class="dashicons dashicons-art"></span>&nbsp;&nbsp;<?php _e('Submit your admin themes ideas', 'ag-custom-admin'); ?></a></li>*/ ?>
2982
+ <li><a style="background: #f08080;color:#fff;" href="javascript:agca_removeAllTemplates();" title="<?php _e('WARNING: All installed themes will be removed. To activate them again, you would need to install theme and activate using valid license keys. Free themes can be installed again.', 'ag-custom-admin'); ?>"><span style="color:#fff" class="dashicons dashicons-trash"></span>&nbsp;&nbsp;<?php _e('Uninstall all installed themes', 'ag-custom-admin'); ?></a></li>
2983
+ </ul>
2984
+ </div>
2985
+ </div>
2986
+ </td>
2987
+ </tr>
2988
+ </table>
2989
+ </div>
2990
+ <?php } ?>
2991
+ <div id="section_advanced" style="display:none" class="ag_section">
2992
+ <h2 class="section_title"><?php _e('Advanced', 'ag-custom-admin'); ?></h2>
2993
+ <?php $this->show_save_button_upper(); ?>
2994
+ <table class="form-table" width="500px">
2995
+ <tr valign="center">
2996
+ <td colspan="2">
2997
+ <p class="agca-tip"><i><?php _e('<strong>Note: </strong>These options will override existing customizations', 'ag-custom-admin'); ?></i></p>
2998
+ </td><td></td>
2999
+ </tr>
3000
+ <tr valign="center">
3001
+ <th scope="row">
3002
+ <label title="<?php _e('Add custom CSS script to override existing styles', 'ag-custom-admin'); ?>" for="agca_script_css"><?php _e('Custom CSS script', 'ag-custom-admin'); ?></em></label>
3003
+ </th>
3004
+ <td>
3005
+ <textarea style="width:100%;height:200px" title="<?php _e('Add custom CSS script to override existing styles', 'ag-custom-admin'); ?>" rows="5" id="agca_custom_css" name="agca_custom_css" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_css')); ?></textarea>
3006
+ </td>
3007
+ </tr>
3008
+ <tr valign="center">
3009
+ <th scope="row">
3010
+ <label title="<?php _e('Add additional custom JavaScript', 'ag-custom-admin'); ?>" for="agca_custom_js"><?php _e('Custom JavaScript', 'ag-custom-admin'); ?></label>
3011
+ </th>
3012
+ <td>
3013
+ <textarea style="width:100%;height:200px" title="<?php _e('Add additional custom JavaScript', 'ag-custom-admin'); ?>" rows="5" name="agca_custom_js" id="agca_custom_js" cols="40"><?php echo htmlspecialchars(get_option('agca_custom_js')); ?></textarea>
3014
+ </td>
3015
+ </tr>
3016
+ <?php
3017
+ $this->print_checkbox(array(
3018
+ 'title'=>__('Temporary enable this option if you are experiencing any problems with saving AGCA options. Please turn it off after you are done with your customizations.', 'ag-custom-admin'),
3019
+ 'name'=>'agca_disable_postver',
3020
+ 'label'=>__('Temporary disable POST verification', 'ag-custom-admin'),
3021
+ ));
3022
+ ?>
3023
+ <tr valign="center">
3024
+ <th scope="row">
3025
+ <label title="<?php _e('Export / import settings', 'ag-custom-admin'); ?>" for="agca_export_import"><?php _e('Export / import settings', 'ag-custom-admin'); ?></label>
3026
+ </th>
3027
+ <td id="import_file_area">
3028
+ <input class="agca_button" type="button" name="agca_export_settings" value="<?php _e('Export Settings', 'ag-custom-admin'); ?>" onclick="exportSettings();"/></br>
3029
+ <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
3030
+ <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
3031
+ <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
3032
+ <input class="agca_button" type="button" name="agca_import_settings" value="<?php _e('Import Settings', 'ag-custom-admin'); ?>" onclick="importSettings();"/>
3033
+ </td>
3034
+ </tr>
3035
+ </table>
3036
+ </div>
3037
+ <?php $this->show_save_button(); ?>
3038
+ </form>
3039
+ <form id="agca_templates_form" name="agca_templates_form" action="<?php echo get_site_url().$_SERVER['PHP_SELF'];?>?page=ag-custom-admin/plugin.php" method="post">
3040
+ <?php wp_nonce_field('agca_form','_agca_token'); ?>
3041
+ <input type="hidden" name="_agca_save_template" value="true" />
3042
+ <input type="hidden" id="templates_data" name="templates_data" value="" />
3043
+ <input type="hidden" id="templates_name" name="templates_name" value="" />
3044
+ </form>
3045
+ </div>
3046
+ <?php
3047
+ }
3048
+
3049
+ #region PRIVATE METHODS
3050
+ function show_save_button_upper(){
3051
+ ?>
3052
+ <div class="save-button-upper">
3053
+ <?php $this->show_save_button() ?>
3054
+ </div>
3055
+ <?php
3056
+ }
3057
+ function show_save_button(){
3058
+ ?>
3059
+ <p class="submit agca-clear">
3060
+ <input type="button" id="save_plugin_settings" style="padding:0px" title="<?php _e('Save AGCA configuration', 'ag-custom-admin'); ?>" class="button-primary" value="<?php _e('Save Changes') ?>" onClick="savePluginSettings()" />
3061
+ </p>
3062
+ <?php
3063
+ }
3064
+
3065
+ function print_checkbox($data){
3066
+ $strAttributes = '';
3067
+ $strOnchange = '';
3068
+ $strInputClass='';
3069
+ $strInputAttributes='';
3070
+ $isChecked = false;
3071
+
3072
+ if(isset($data['attributes'])){
3073
+ foreach($data['attributes'] as $key=>$val){
3074
+ $strAttributes.=' '.$key.'="'.$val.'"';
3075
+ }
3076
+ }
3077
+ if(isset($data['input-class'])){
3078
+ $strInputClass = $data['input-class'];
3079
+ }
3080
+ if(isset($data['hide'])){
3081
+ $strInputClass .= " visibility";
3082
+ }
3083
+ if(isset($data['input-attributes'])){
3084
+ $strInputAttributes = $data['input-attributes'];
3085
+ }
3086
+ if(isset($data['onchange'])){
3087
+ $strOnchange = $data['onchange'];
3088
+ }
3089
+ if(!isset($data['title'])){
3090
+ $data['title'] = $data['label'];
3091
+ }
3092
+ if(isset($data['checked'])){
3093
+ $isChecked = $data['checked'];
3094
+ }else{
3095
+ //use default check with the option
3096
+ $isChecked = get_option($data['name'])==true;
3097
+ }
3098
+ ?>
3099
+ <tr valign="center" <?php echo $strAttributes ?> >
3100
+ <th>
3101
+ <label tabindex="0" title='<?php echo $data['title'] ?>' for="<?php echo $data['name'] ?>" ><?php echo $data['label'] ?></label>
3102
+ </th>
3103
+ <td>
3104
+ <input type="checkbox" class="agca-checkbox <?php echo $strInputClass ?> " <?php echo $strOnchange ?> <?php echo $strInputAttributes ?> title='<?php _e('Toggle on/off', 'ag-custom-admin'); ?>' name="<?php echo $data['name'] ?>" value="true" <?php echo ($isChecked)?' checked="checked"':'' ?> />
3105
+ </td>
3106
+ </tr>
3107
+ <?php
3108
+ }
3109
+ function print_input($data){
3110
+ $strHint = '';
3111
+ $suffix ='';
3112
+ $strAttributes = '';
3113
+ $parentAttr = '';
3114
+ if(isset($data['hint'])){
3115
+ $strHint = '&nbsp;<p><i>'.$data['hint'].'</i></p>';
3116
+ }
3117
+ if(!isset($data['title'])){
3118
+ $data['title'] = $data['label'];
3119
+ }
3120
+ if(isset($data['suffix'])){
3121
+ $suffix = $data['suffix'];
3122
+ }
3123
+ if(isset($data['attributes'])){
3124
+ foreach($data['attributes'] as $key=>$val){
3125
+ $strAttributes.=' '.$key.'="'.$val.'"';
3126
+ }
3127
+ }
3128
+ ?>
3129
+ <tr valign="center" <?php echo $strAttributes ?> >
3130
+ <th >
3131
+ <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3132
+ </th>
3133
+ <td>
3134
+ <input id="<?php echo $data['name'] ?>" title="<?php echo $data['title'] ?>" type="text" size="47" name="<?php echo $data['name'] ?>" value="<?php echo get_option($data['name']); ?>" />
3135
+ <a title="<?php _e('Clear', 'ag-custom-admin'); ?>" class="agca_button clear" onClick="jQuery('#<?php echo $data['name'] ?>').val('');"><span class="dashicons clear dashicons-no-alt"></span></a><?php echo $suffix ?>
3136
+ <?php echo $strHint ?>
3137
+ </td>
3138
+ </tr>
3139
+ <?php
3140
+ }
3141
+ function print_textarea($data){
3142
+ $strHint = '';
3143
+ $strClass = '';
3144
+ if(isset($data['hint'])){
3145
+ $strHint = '&nbsp;<p><i>'.$data['hint'].'</i>.</p>';
3146
+ }
3147
+ if(!isset($data['title'])){
3148
+ $data['title'] = $data['label'];
3149
+ }
3150
+ if(isset($data['class'])){
3151
+ $strClass = $data['class'];
3152
+ }
3153
+ ?>
3154
+ <tr valign="center">
3155
+ <th scope="row">
3156
+ <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3157
+ </th>
3158
+ <td>
3159
+ <textarea <?php echo !empty($strClass)?'class="'.$strClass.'"':''; ?> title="<?php echo $data['title'] ?>" rows="5" name="<?php echo $data['name'] ?>" cols="40"><?php echo htmlspecialchars(get_option($data['name'])); ?></textarea>
3160
+ <?php echo $strHint ?>
3161
+ </td>
3162
+ </tr>
3163
+ <?php
3164
+ }
3165
+ function print_color($name, $label, $title){
3166
+ ?>
3167
+ <tr valign="center" class="color">
3168
+ <th><label title="<?php echo $title ?>" for="<?php echo $name ?>"><?php echo $label ?></label></th>
3169
+ <td><input type="text" placeholder="#" id="<?php echo $name ?>" name="<?php echo $name ?>" class="color_picker" value="<?php echo $this->getAGCAColor($name); ?>" />
3170
+ <a title="<?php _e('Pick Color', 'ag-custom-admin'); ?>" alt="<?php echo $name ?>" class="pick_color_button agca_button"><span class="dashicons dashicons-art"></span></a>
3171
+ <a title="<?php _e('Clear', 'ag-custom-admin'); ?>" alt="<?php echo $name ?>" class="pick_color_button_clear agca_button" ><span class="dashicons clear dashicons-no-alt"></span></a>
3172
+ </td>
3173
+ </tr>
3174
+ <?php
3175
+ }
3176
+ function print_options_h3($title){
3177
+ ?>
3178
+ <tr valign="center">
3179
+ <td colspan="2">
3180
+ <div class="ag_table_heading"><h3 tabindex="0"><?php echo $title ?></h3></div>
3181
+ </td>
3182
+ <td></td>
3183
+ </tr>
3184
+ <?php
3185
+ }
3186
+ function print_option_tr(){
3187
+ ?>
3188
+
3189
+ <tr valign="center">
3190
+ <th><label title="<?php _e('Change submenu item background color', 'ag-custom-admin'); ?>" for="color_admin_menu_submenu_background"><?php _e('Submenu button background color:', 'ag-custom-admin'); ?></label></th>
3191
+ <td><input type="text" id="color_admin_menu_submenu_background" name="color_admin_menu_submenu_background" class="color_picker" value="<?php echo $this->getAGCAColor('color_admin_menu_submenu_background'); ?>" />
3192
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button agca_button" value="<?php _e('Pick color', 'ag-custom-admin'); ?>" />
3193
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear agca_button" value="<?php _e('Clear', 'ag-custom-admin'); ?>" />
3194
+ </td>
3195
+ </tr>
3196
+ <?php
3197
+ }
3198
+ #endregion
3199
+
3200
+ }
3201
  //TODO: Add log out button to the admin menu
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: cusmin
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
- Tested up to: 5.1.1
7
- Stable tag: 6.5.2
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
@@ -148,6 +148,9 @@ If you have the latest WordPress and plugin versions and you still experience so
148
 
149
  == Change Log ==
150
 
 
 
 
151
  = 6.5.2 =
152
  * Compatibility w/ 5.1.1
153
 
@@ -557,6 +560,9 @@ If you have the latest WordPress and plugin versions and you still experience so
557
 
558
  == Upgrade Notice ==
559
 
 
 
 
560
  = 6.5.2 =
561
  * Compatibility w/ 5.1.1
562
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development
4
  Tags: admin, customize, hide, change admin, themes, admin themes, admin bar, login page
5
  Requires at least: 3.0
6
+ Tested up to: 5.2.3
7
+ Stable tag: 6.5.3
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
148
 
149
  == Change Log ==
150
 
151
+ = 6.5.3 =
152
+ * Compatibility w/ 5.2.3
153
+
154
  = 6.5.2 =
155
  * Compatibility w/ 5.1.1
156
 
560
 
561
  == Upgrade Notice ==
562
 
563
+ = 6.5.3 =
564
+ * Compatibility w/ 5.2.3
565
+
566
  = 6.5.2 =
567
  * Compatibility w/ 5.1.1
568
 
require/dynamic.php CHANGED
@@ -1,95 +1,95 @@
1
- <?php
2
- require '../../../../wp-load.php';
3
-
4
- $themes = get_option('agca_templates');
5
- $selectedTheme = get_option('agca_selected_template');
6
- $type = "";
7
- $optionName = "";
8
- $agcaContext = "";
9
-
10
- if(isset($_GET["type"])){
11
- $type = $_GET["type"];
12
- }
13
- if(isset($_GET["context"])){
14
- $agcaContext = $_GET["context"];
15
- }
16
-
17
- if ( $agcaContext != "login" && !is_user_logged_in()) {
18
- die();
19
- }
20
-
21
- if($type == "css"){
22
- header('Content-type: text/css');
23
- $optionName = ($agcaContext == "login")? "logincss":"admincss";
24
-
25
- }else if($type == "js"){
26
- header('Content-type: application/javascript');
27
- $optionName = ($agcaContext == "login")? "loginjs":"adminjs";
28
- }
29
- if($type == "css" || $type == "js"){
30
- if(isset($themes[$selectedTheme])){
31
- $theme = $themes[$selectedTheme];
32
- $admin_capability = get_option('agca_admin_capability');
33
- if($admin_capability == ""){
34
- $admin_capability = "edit_dashboard";
35
- }
36
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($admin_capability )))){
37
- $adminscript = $theme[$optionName];
38
- $settings = $theme['settings'];
39
- if($settings == "" || $settings == " ") $settings = "{}";
40
- $adminscript = agcaAppendSettingsToAGCATemplateCustomizations($adminscript, $settings);
41
- $admindata = agcaEnableSpecificWPVersionCustomizations($admindata);
42
- $admindata = agcaRemoveCSSComments($admindata);
43
-
44
- echo $adminscript;
45
- }
46
- }
47
- }
48
-
49
- //print_r($themes); print_r($selectedTheme); die;
50
- die;
51
-
52
-
53
- function agcaEnableSpecificWPVersionCustomizations($customizations){
54
- /*enable special CSS for this WP version*/
55
- $ver = agcat_get_wp_version();
56
- $customizations = str_replace("/*".$ver," ", $customizations);
57
- $customizations = str_replace($ver."*/"," ", $customizations);
58
- return $customizations;
59
- }
60
- function agcat_get_wp_version(){
61
- global $wp_version;
62
- $array = explode('-', $wp_version);
63
- $version = $array[0];
64
- return $version;
65
- }
66
- function agcaAppendSettingsToAGCATemplateCustomizations($customizations, $settings){
67
- $template_settings = json_decode($settings);
68
- //print_r($template_settings);
69
- foreach($template_settings as $sett){
70
- $key = $sett->code;
71
-
72
- //use default value if user's value is not set
73
- $value="";
74
- if($sett->value != ""){
75
- $value = $sett->value;
76
- }else{
77
- $value = $sett->default_value;
78
- }
79
-
80
- //Prepare settings
81
- if($sett->type == 6){
82
- if($value !== null && (strtolower($value) == "on" || $value == "1")){
83
- $value = "true";
84
- }else{
85
- $value = "false";
86
- }
87
- }
88
- $customizations = str_replace("%".$key."%",$value, $customizations);
89
- }
90
- return $customizations;
91
- }
92
- function agcaRemoveCSSComments($customizations){
93
- $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
94
- return $customizations;
95
  }
1
+ <?php
2
+ require '../../../../wp-load.php';
3
+
4
+ $themes = get_option('agca_templates');
5
+ $selectedTheme = get_option('agca_selected_template');
6
+ $type = "";
7
+ $optionName = "";
8
+ $agcaContext = "";
9
+
10
+ if(isset($_GET["type"])){
11
+ $type = $_GET["type"];
12
+ }
13
+ if(isset($_GET["context"])){
14
+ $agcaContext = $_GET["context"];
15
+ }
16
+
17
+ if ( $agcaContext != "login" && !is_user_logged_in()) {
18
+ die();
19
+ }
20
+
21
+ if($type == "css"){
22
+ header('Content-type: text/css');
23
+ $optionName = ($agcaContext == "login")? "logincss":"admincss";
24
+
25
+ }else if($type == "js"){
26
+ header('Content-type: application/javascript');
27
+ $optionName = ($agcaContext == "login")? "loginjs":"adminjs";
28
+ }
29
+ if($type == "css" || $type == "js"){
30
+ if(isset($themes[$selectedTheme])){
31
+ $theme = $themes[$selectedTheme];
32
+ $admin_capability = get_option('agca_admin_capability');
33
+ if($admin_capability == ""){
34
+ $admin_capability = "edit_dashboard";
35
+ }
36
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($admin_capability )))){
37
+ $adminscript = $theme[$optionName];
38
+ $settings = $theme['settings'];
39
+ if($settings == "" || $settings == " ") $settings = "{}";
40
+ $adminscript = agcaAppendSettingsToAGCATemplateCustomizations($adminscript, $settings);
41
+ $admindata = agcaEnableSpecificWPVersionCustomizations($admindata);
42
+ $admindata = agcaRemoveCSSComments($admindata);
43
+
44
+ echo $adminscript;
45
+ }
46
+ }
47
+ }
48
+
49
+ //print_r($themes); print_r($selectedTheme); die;
50
+ die;
51
+
52
+
53
+ function agcaEnableSpecificWPVersionCustomizations($customizations){
54
+ /*enable special CSS for this WP version*/
55
+ $ver = agcat_get_wp_version();
56
+ $customizations = str_replace("/*".$ver," ", $customizations);
57
+ $customizations = str_replace($ver."*/"," ", $customizations);
58
+ return $customizations;
59
+ }
60
+ function agcat_get_wp_version(){
61
+ global $wp_version;
62
+ $array = explode('-', $wp_version);
63
+ $version = $array[0];
64
+ return $version;
65
+ }
66
+ function agcaAppendSettingsToAGCATemplateCustomizations($customizations, $settings){
67
+ $template_settings = json_decode($settings);
68
+ //print_r($template_settings);
69
+ foreach($template_settings as $sett){
70
+ $key = $sett->code;
71
+
72
+ //use default value if user's value is not set
73
+ $value="";
74
+ if($sett->value != ""){
75
+ $value = $sett->value;
76
+ }else{
77
+ $value = $sett->default_value;
78
+ }
79
+
80
+ //Prepare settings
81
+ if($sett->type == 6){
82
+ if($value !== null && (strtolower($value) == "on" || $value == "1")){
83
+ $value = "true";
84
+ }else{
85
+ $value = "false";
86
+ }
87
+ }
88
+ $customizations = str_replace("%".$key."%",$value, $customizations);
89
+ }
90
+ return $customizations;
91
+ }
92
+ function agcaRemoveCSSComments($customizations){
93
+ $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
94
+ return $customizations;
95
  }
script/ag_script.js CHANGED
@@ -1,942 +1,942 @@
1
- var afterFormClickCreateJson = true;
2
- var editingButtonNow = false;
3
- var agca_ajax_url = agca_global_plugin_url + "ajax.php";
4
- function booleanToChecked(bool){
5
- if(bool == 'true'){
6
- return 'checked="checked"';
7
- }else if(bool == 'checked'){
8
- return 'checked="checked"';
9
- }
10
- }
11
-
12
- function agcaLog(text){
13
- console.log(text);
14
- }
15
-
16
- function agcaDebug(text){
17
- if(agca_debug){
18
- console.log('- '+text);
19
- }
20
- }
21
-
22
- function agcaDebugObj(obj){
23
- if(agca_debug){
24
- console.log(obj);
25
- }
26
- }
27
-
28
- /*use only on agca page*/
29
- if(window.location.href.indexOf(encodeURIComponent('ag-custom-admin/plugin.php')) !== -1 || window.location.href.indexOf('ag-custom-admin/plugin.php') !== -1){
30
- jQuery(function(){
31
- if(!isLocalStorageNameSupported()){
32
- return false;
33
- }
34
- var agcapage = localStorage.getItem('agca-page');
35
- if(!agcapage){
36
- var hash = window.location.hash || 'general-settings';
37
- localStorage.setItem('agca-page', hash);
38
- agcapage = localStorage.getItem('agca-page');
39
- }
40
- window.location.hash = window.location.hash || agcapage;
41
- localStorage.setItem('agca-page', window.location.hash);
42
- });
43
- window.onhashchange = function(){
44
- if(!isLocalStorageNameSupported()){
45
- return false;
46
- }
47
- localStorage.setItem('agca-page', window.location.hash);
48
- if(jQuery('#ag_main_menu a.selected').attr('href') !== window.location.hash){
49
- if(window.location.hash !== ""){
50
- // jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click');
51
- }
52
- }
53
- };
54
- }
55
-
56
- function isLocalStorageNameSupported()
57
- {
58
- var testKey = 'test-storage', storage = window.localStorage;
59
- try
60
- {
61
- storage.setItem(testKey, '1');
62
- storage.removeItem(testKey);
63
- return true;
64
- }
65
- catch (error)
66
- {
67
- return false;
68
- }
69
- }
70
-
71
- function hideShowSubmenus(index){
72
- var finish = false;
73
- var found = false;
74
- jQuery('#ag_edit_adminmenu td').each(function(){
75
- if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
76
- // jQuery(this).find('.agcaMenuEditorPlusMinus').show();
77
- var caller = jQuery('#ag_edit_adminmenu td:eq(' + index + ')');
78
- jQuery(caller).find('.agcaMenuEditorPlusMinus .minus').toggle();
79
- jQuery(caller).find('.agcaMenuEditorPlusMinus .plus').toggle();
80
- if(jQuery(this).hasClass('ag_admin_menu_child')){
81
- jQuery(this).parent().toggleClass('noclass');
82
- found = true;
83
- }
84
- if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
85
- finish = true;
86
- }
87
- }
88
- });
89
- /*FOCUS*/
90
- if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
91
- jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
92
- };
93
- }
94
-
95
- /*
96
- Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
97
- */
98
- function prettyEditMenuPage(){
99
- jQuery('#ag_edit_adminmenu td').each(function(){
100
- if(jQuery(this).hasClass('ag_admin_menu_child')){
101
- jQuery(this).parent().addClass('noclass');
102
- };
103
- });
104
- jQuery('#ag_edit_adminmenu td').each(function(){
105
- if(jQuery(this).hasClass('ag_admin_menu_parent')){
106
- jQuery(this).parent().css('background-color','#d8eAd8');
107
- jQuery(this).bind('click',function(evt){
108
- if(evt.target.className == 'ag_admin_menu_parent'){
109
- hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
110
- }
111
- });
112
- };
113
- });
114
- jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
115
- jQuery(this).parent().click();
116
- //jQuery(this).parent().focus();
117
- });
118
- };
119
- function editMenuRow(url, originalName, newName, removed){
120
- return '<tr class="top" data-url="'+url+'" ><td class="ag_admin_menu_parent"><br><span class=\"agcaMenuEditorPlusMinus\"><span class="dashicons plus dashicons-arrow-down-alt2"></span><span class="dashicons minus dashicons-arrow-up-alt2"></span></span><a tabindex="0" href="javascript:void(0)">'+originalName+'</a><div style="float:right"><input title="Remove Home from menu" class=" agca-checkbox visibility" type="checkbox" '+(removed?' checked=\"checked\" ':'')+' name="ag_edit_adminmenu_item_top_2" style="display: none;"><div onclick="agcaCheckBoxOnClick(jQuery(this));" class="agca-checkbox-box" title="'+agca_string.remove+' '+originalName+' '+agca_string.frommenu+'"><div></div></div></div></td><td class="ag_admin_menu_parent2"><input title="'+agca_string.rename+' '+originalName+' '+agca_string.withthisvalue+'" type="text" class="undefined" size="47" value="'+newName+'" name="ag_edit_adminmenu_item_top_2"></td></tr>';
121
- }
122
- function editMenuSubrow(index, parentName, parentIndex, url, originalName, newName, removed){
123
- return '<tr class="sub" data-index="'+index+'" data-parent="'+parentIndex+'" data-name="'+originalName+'" data-url="'+url+'"><td class="ag_admin_menu_child"><div style="float:left"><a tabindex="-1" href="javascript:void(0)" style="font-weight:bold;" title="Dashboard submenu: '+originalName+'"><span style="font-weight:normal"> </span>'+originalName+'</a></div><div style="float:right"><input type="checkbox" title="'+agca_string.remove+' '+parentName+' submenu: '+originalName+' from menu" class="Home agca-checkbox visibility" '+(removed?' checked=\"checked\" ':'')+' name="ag_edit_adminmenu_item_sub_1" style="display: none;"><div onclick="agcaCheckBoxOnClick(jQuery(this));" class="agca-checkbox-box" title="'+agca_string.remove+' '+parentName+' sub-menu: '+originalName+' from menu"><div></div></div></div></td><td class="ag_admin_menu_child2"><input type="text" title="'+agca_string.rename+' '+agca_string.submenuitem+' '+originalName+' '+agca_string.withthisvalue+'" class="'+originalName+'" size="47" value="'+newName+'" name="ag_edit_adminmenu_item_sub_1"></td></tr>';
124
- }
125
- function createEditMenuPageNew(agca_menu){
126
- for(var url in agca_menu){
127
- jQuery('#ag_edit_adminmenu').append(editMenuRow(url, agca_menu[url]['name'], agca_menu[url]['new'], agca_menu[url]['remove']));
128
- //console.log(agca_menu[url]['name'],agca_menu[url]['new']);
129
-
130
- //submenus
131
- var subs = agca_menu[url]['submenus'];
132
- if(subs){
133
- for(var ind in subs){
134
- //console.log('--- '+ subs[ind]['name'], subs[ind]['new']);
135
- jQuery('#ag_edit_adminmenu').append(editMenuSubrow(ind, agca_menu[url]['name'],url, subs[ind]['url'], subs[ind]['name'], subs[ind]['new'], subs[ind]['remove']));
136
- }
137
- }
138
- }
139
-
140
- prettyEditMenuPage();
141
- hideShowSubmenus();
142
-
143
- var parent = null;
144
- var subs = 0;
145
- jQuery('#ag_edit_adminmenu tr').each(function(){
146
- if(jQuery(this).find('td').hasClass('ag_admin_menu_parent')){
147
- //jQuery(this).css('color','#ffffff');
148
- if(parent != null){
149
- if(subs == 0){
150
- jQuery(parent).find('.agcaMenuEditorPlusMinus').html('<span>&nbsp;&nbsp;&nbsp;</span>');
151
- }
152
- }
153
- subs = 0;
154
- parent = jQuery(this);
155
- }else{
156
- subs++;
157
- }
158
-
159
- });
160
- agcaChangeCheckBoxStyles();
161
- }
162
-
163
- function applyAdminMenuCustomizations(){
164
- jQuery('ul#adminmenu > li').each(function() {
165
- var $o = jQuery(this);
166
- if (!$o.hasClass("wp-menu-separator") && !$o.hasClass("wp-menu-separator-last") && $o.attr('id') !== 'collapse-menu') {
167
- var topUrl = $o.find('a:first').attr('href');
168
- var t = agca_admin_menu[topUrl];
169
- if(t){
170
- if(t.remove){
171
- $o.remove();
172
- } else if(c.new){
173
- $o.find('a:first .wp-menu-name').text(c.new);
174
- }
175
- var s = t.submenu;
176
- if(s){
177
- for(var ind in s){
178
- var cs = s[ind];
179
- var subUrl = cs.url;
180
- var $s = $o.find('.wp-submenu a[href="'+subUrl+'"]:first');
181
- if(cs.remove){
182
- $s.remove();
183
- } else if(cs.new){
184
- $s.text(cs.new);
185
- }
186
- }
187
- }
188
-
189
- }
190
- console.log(topUrl);
191
- }
192
- });
193
- }
194
-
195
- function showHideSection(text) {
196
- switch(text)
197
- {
198
- case agca_string.menu_general:
199
- jQuery('#section_general').show();
200
- jQuery('#section_general .section_title').trigger('focus');
201
- break;
202
- case agca_string.menu_admin_bar:
203
- jQuery('#section_admin_bar').show();
204
- jQuery('#section_admin_bar .section_title').trigger('focus');
205
- break;
206
- case agca_string.menu_footer:
207
- jQuery('#section_admin_footer').show();
208
- jQuery('#section_admin_footer .section_title').trigger('focus');
209
- break;
210
- case agca_string.menu_dashb:
211
- jQuery('#section_dashboard_page').show();
212
- jQuery('#section_dashboard_page .section_title').trigger('focus');
213
- break;
214
- case agca_string.menu_login:
215
- jQuery('#section_login_page').show();
216
- jQuery('#section_login_page .section_title').trigger('focus');
217
- break;
218
- case agca_string.menu_admin_menu:
219
- jQuery('#section_admin_menu').show();
220
- jQuery('#section_admin_menu .section_title').trigger('focus');
221
- break;
222
- case agca_string.menu_colorizer:
223
- jQuery('#section_ag_colorizer_settings').show();
224
- jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
225
- break;
226
- case agca_string.menu_themes:
227
- if(!jQuery('#section_templates').hasClass("loaded")){
228
- jQuery('#section_templates').addClass('loaded');
229
- agca_client_init();
230
- }
231
- jQuery('#section_templates').show();
232
- jQuery('#section_templates .section_title').trigger('focus');
233
- break;
234
- case agca_string.menu_advanced:
235
- jQuery('#section_advanced').show();
236
- jQuery('#section_advanced .section_title').trigger('focus');
237
- break;
238
- default:
239
- jQuery('#section_admin_bar').show();
240
- jQuery('#section_admin_bar .section_title').trigger('focus');
241
- }
242
- }
243
-
244
- function hideAllSections(){
245
- jQuery('#ag_main_menu li').each(function(){
246
- jQuery(this).addClass("normal").removeClass("selected");
247
- });
248
- jQuery('.ag_section').each(function(){
249
- jQuery(this).hide();
250
- });
251
- }
252
- function reloadRemoveButtonEvents(){
253
- }
254
- function createTargetCombo(target,clas){
255
-
256
- var combo = ""
257
-
258
- combo+= "&nbsp;"+agca_string.open+"&nbsp;"+agca_string.in+":<select";
259
- if( clas != null){
260
- combo+=" class=\"editTarget\" ";
261
- }
262
- combo+= ">";
263
- combo+= "<option value=\"_self\"";
264
- if(target === "_self"){
265
- combo+= " selected ";
266
- }
267
- combo+= ">same tab</option>";
268
- combo+= "<option value=\"_blank\"";
269
- if(target === "_blank"){
270
- combo+= " selected ";
271
- }
272
- combo+= ">new tab</option>";
273
- combo+= "</select>";
274
- return combo;
275
- }
276
-
277
- function exportSettings(){
278
- jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
279
- jQuery('#agca_form #_agca_import_settings').val("false");
280
- jQuery('#agca_form #_agca_export_settings').val("true");
281
-
282
-
283
- jQuery('#ag_add_adminmenu_json').val('');
284
- jQuery('#ag_edit_adminmenu_json').val('');
285
- jQuery('#ag_edit_adminmenu_json_new').val('');
286
-
287
-
288
- jQuery('#agca_form').submit();
289
- }
290
-
291
- function importSettings(){
292
- if(jQuery('#settings_import_file').css("display") == "none"){
293
- jQuery('#settings_import_file').show("slide");
294
- }else{
295
- jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
296
- if(jQuery('#settings_import_file').val() !=""){
297
- jQuery('#agca_form #_agca_import_settings').val("true");
298
- jQuery('#agca_form #_agca_export_settings').val("false");
299
- jQuery('#agca_form').attr('enctype','multipart/form-data');
300
- jQuery('#agca_form').submit();
301
- }else{
302
- alert(agca_string.file_imp_not_sel);
303
- }
304
- }
305
-
306
- }
307
-
308
- function savePluginSettings(){
309
- jQuery('#import_file_area').remove();
310
- jQuery('#agca_form').submit();
311
- }
312
-
313
- jQuery(document).ready(function(){
314
- jQuery('#ag_add_adminmenu').on("click", 'a.button_remove', function(){
315
- jQuery(this).parent().parent().remove();
316
- });
317
- jQuery('#ag_add_adminmenu').on('click', 'a.button_edit', function(){
318
- if(editingButtonNow == false){
319
- var name = jQuery(this).parent().find('button').text();
320
- var url = jQuery(this).parent().find('button').attr('title');
321
- var target = jQuery(this).parent().find('button').attr('target');
322
- //console.log(target);
323
- editingButtonNow = name;
324
- jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" />' + createTargetCombo(target,"edit")+ '<input type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit" value="'+agca_string.save_changes+'" /></div>');
325
- reloadRemoveButtonEvents();
326
- }
327
- });/*Save editing changes*/
328
- jQuery('#ag_add_adminmenu').on("click", '#ag_add_adminmenu_button_edit', function(){
329
- //alert(jQuery(this).parent().html());
330
- var name = jQuery('#ag_add_adminmenu_name_edit').val();
331
- var url = jQuery('#ag_add_adminmenu_url_edit').val();
332
- var target = jQuery('select.editTarget').val();
333
- //var target = jQuery(this).parent().find('button').attr('target');
334
- name = name.replace(/["']{1}/gi,"");
335
- url = url.replace(/["']{1}/gi,"");
336
- jQuery('#temporary_button_edit').remove();
337
-
338
- var element = 0;
339
- jQuery('#ag_add_adminmenu :button').each(function(){
340
- //dont use first button for adding new buttons
341
- if(element > 0){
342
- if(jQuery(this).html() == editingButtonNow){
343
- jQuery(this).attr('title',url);
344
- jQuery(this).attr('target',target);
345
- jQuery(this).html(name);
346
- }
347
- }
348
- element++;
349
- });
350
- editingButtonNow = false;
351
- });
352
-
353
- setTimeout(function(){
354
- jQuery('#agca_advertising').show(),700
355
- });
356
- });
357
- /*ToolTip*/
358
- function agcaApplyTooltip(){
359
- if(jQuery(this).attr('title') != ""){
360
- jQuery(this).hover(function(e) {
361
- if(jQuery(this).hasClass('feedback')){
362
- jQuery(this).mousemove(function(e) {
363
- var tipY = e.pageY + 16;
364
- var tipX = e.pageX - 236;
365
- var type = '#f08080';
366
- if(jQuery(this).hasClass('positive')) {
367
- type = '#ACC491';
368
- }
369
- jQuery("#AGToolTipDiv").css({
370
- 'top': tipY,
371
- 'left': tipX,
372
- 'background': type,
373
- 'border': 'none',
374
- 'padding': '10px',
375
- 'color':'#fff',
376
- 'font-weight':'bold',
377
- 'border-radius': '5px'
378
- });
379
- });
380
- }else{
381
- jQuery(this).mousemove(function(e) {
382
- var tipY = e.pageY + 16;
383
- var tipX = e.pageX + 16;
384
- jQuery("#AGToolTipDiv").css({
385
- 'top': tipY,
386
- 'left': tipX,
387
- 'background': '#efefef',
388
- 'border': '1px solid #826c63'
389
- });
390
- });
391
- }
392
- jQuery("#AGToolTipDiv")
393
- .html(jQuery(this).attr('title'))
394
- .stop(true,true)
395
- .fadeIn("fast");
396
- jQuery(this).removeAttr('title');
397
- }, function() {
398
- jQuery("#AGToolTipDiv")
399
- .stop(true,true)
400
- .fadeOut("fast", function(){
401
- jQuery(this).css({
402
- 'color': '',
403
- 'border': '',
404
- 'font-weight':''
405
- });
406
- })
407
-
408
- jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
409
- });
410
- }
411
- }
412
-
413
- jQuery(document).ready(function(){
414
- /*Add click handler on main buttons*/
415
- jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(e){
416
- if(jQuery(e.target).is('li')){
417
- var hash = jQuery(this).find('a:first').attr('href');
418
- document.location.hash = hash;
419
- };
420
- hideAllSections();
421
- var text = jQuery(this).text();
422
- jQuery(this).removeClass('normal').addClass("selected");
423
- showHideSection(text);
424
- });
425
-
426
- /*Admin Menu Reset all setings button*/
427
- jQuery('#ag_edit_adminmenu_reset_button').click(function(){
428
- afterFormClickCreateJson = false;
429
- jQuery('#agca_form').submit();
430
- });
431
-
432
- /*Add new menu item button - creates new HTMl button elements*/
433
- jQuery('#ag_add_adminmenu_button').click(function(){
434
- var name = jQuery('#ag_add_adminmenu_name').val();
435
- var url = jQuery('#ag_add_adminmenu_url').val();
436
- var target = jQuery('#ag_add_adminmenu_target').val();
437
- name = name.replace(/["']{1}/gi,"");
438
- url = url.replace(/["']{1}/gi,"");
439
- jQuery('#ag_add_adminmenu_name').val("");
440
- jQuery('#ag_add_adminmenu_url').val("");
441
- jQuery('#ag_add_adminmenu_target').val("_self");
442
- jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="'+agca_string.delete+'" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>');
443
- reloadRemoveButtonEvents();
444
- });
445
-
446
- /*Add tooltip box*/
447
- jQuery("body").append("<div id='AGToolTipDiv'></div>");
448
-
449
- /*ToolTip*/
450
- jQuery("label[title],#agca_donate_button, a.feedback").each(agcaApplyTooltip);
451
-
452
- /*SECTION FOCUS*/
453
- jQuery('.section_title').focus(function(){
454
- });
455
-
456
-
457
- //check hashtag
458
- if(document.location.hash !== ""){
459
- jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click')
460
- };
461
-
462
- if(typeof isCusminActive !== 'undefined' && isCusminActive){
463
- hideAllSections();
464
- jQuery('#section_templates, #section-cusmin').show();
465
- if(typeof agca_client_init === 'function'){
466
- agca_client_init();
467
- }
468
- }
469
-
470
- });
471
-
472
- jQuery(function($){
473
- /*Admin menu*/
474
- jQuery('#adminmenu').css('display','block');
475
-
476
- /*FORM SUBMITTED*/
477
- jQuery('#agca_form').submit(function(){
478
- processData();
479
- return true;
480
- });
481
-
482
- //on radio button text click
483
- jQuery('.agca-radio-text').on('click', function(){
484
- var $o = jQuery(this);
485
- var type = 'off';
486
- if($o.hasClass('on')){
487
- type='on';
488
- }
489
- $o.parent().find('.agca-radiobox[value='+type+']').trigger('click');
490
- });
491
-
492
- //Colorizer update input text colors
493
- colorizerColorizeTextboxes();
494
- });
495
-
496
-
497
- function processEditAdminMenu(){
498
- var array = {};
499
-
500
- //top menus
501
- jQuery('#ag_edit_adminmenu tr.top').each(function(){
502
- var $tr = jQuery(this);
503
- var originalText = $tr.find('.ag_admin_menu_parent a').text();
504
- var newText = $tr.find('.ag_admin_menu_parent2 input').val();
505
- var remove = $tr.find('.agca-checkbox').is(':checked');
506
- var url = $tr.data('url');
507
- array[url]={
508
- 'name': originalText,
509
- 'new': newText || "",
510
- 'remove':remove,
511
- 'url':url,
512
- 'submenus':{}
513
- };
514
- });
515
-
516
- //submenus
517
- jQuery('#ag_edit_adminmenu tr.sub').each(function(){
518
- var $tr = jQuery(this);
519
- var newText = $tr.find('.ag_admin_menu_child2 input').val();
520
- var remove = $tr.find('.agca-checkbox').is(':checked');
521
- var url = $tr.data('url');
522
- var index = $tr.data('index');
523
- var parentIndex = $tr.data('parent');
524
- var originalName = $tr.data('name');
525
- array[parentIndex]['submenus'][index]={
526
- 'name': originalName,
527
- 'new': newText || "",
528
- 'remove':remove,
529
- 'url':url
530
- };
531
- });
532
- return array;
533
- }
534
-
535
- function processData(){
536
-
537
- //serialize admin menu edit configuration
538
- var array = processEditAdminMenu();
539
- if(afterFormClickCreateJson == true){
540
- jQuery('#ag_edit_adminmenu_json_new').val(JSON.stringify(array));
541
- }else{
542
- jQuery('#ag_edit_adminmenu_json_new').val('');
543
- }
544
-
545
- //serialize buttons
546
- array = "{";
547
- var element = 0;
548
- jQuery('#ag_add_adminmenu :button').each(function(){
549
- //console.log(jQuery(this).html()+jQuery(this).attr('title'));
550
- if(element > 0){
551
- if(element > 1){
552
- array += ", ";
553
- }
554
- array += "\"" + jQuery(this).html() + "\" : {";
555
- array += " \"value\" : ";
556
- array += "\"" + jQuery(this).attr('title') + "\"";
557
- array += ", \"target\" : ";
558
- array += "\"" + jQuery(this).attr('target') + "\"}";
559
- }
560
- element++;
561
- });
562
- array += "}";
563
- if(element == 1){
564
- array="";
565
- }
566
- jQuery('#ag_add_adminmenu_json').val(array);
567
-
568
-
569
-
570
- /*Serialize colors*/
571
- var array = "{";
572
- var firstElement = true;
573
- var topMarker = "";
574
- jQuery('input.color_picker').each(function(){
575
- if(firstElement != true){
576
- array += ", ";
577
- }
578
- array += "\"" + jQuery(this).attr('id') + "\" : ";
579
- array += "\"" + jQuery(this).val() + "\"";
580
- firstElement = false;
581
- });
582
- array += "}";
583
-
584
- if(!isSettingsImport){
585
- jQuery('#ag_colorizer_json').val(array);
586
- }
587
- }
588
-
589
- function agca_escapeHTMLChars(str){
590
- return str
591
- .replace(/&/g, '&amp;')
592
- .replace(/'/g, '&#39;')
593
- .replace(/"/g, '&quot;');
594
- }
595
-
596
- function agca_escapeChars(str){
597
- return str.replace(/[\/\\\"\']/g, "\\$&");
598
- //return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
599
- }
600
-
601
- /*C O L O R I Z E R*/
602
- function updateTargetColor(id, color){
603
- switch(id)
604
- {
605
- case 'color_background':
606
- jQuery('html, .wp-dialog, #wpwrap').css({
607
- 'background-color':color
608
- });
609
- break;
610
- case 'login_color_background':
611
- jQuery('body.login').css({
612
- 'background-color':color
613
- });
614
- break;
615
-
616
- case 'color_header':
617
- jQuery('#wphead').css({
618
- 'background':color
619
- });
620
-
621
- //wp > 3.3
622
- jQuery('#wpadminbar').css({'background':color});
623
- jQuery('#wpadminbar .ab-top-menu').css({'background':color});
624
- jQuery('#wphead').css({
625
- 'margin':'0',
626
- 'margin-left':'-14px',
627
- 'padding-left':'15px'
628
- });
629
- jQuery("#backtoblog").attr("style","");
630
- break;
631
- case 'color_admin_menu_top_button_background':
632
- jQuery('#adminmenu a.menu-top').css({
633
- 'background':color
634
- });
635
- jQuery('#adminmenu li.menu-top').css({
636
- 'background':color
637
- });
638
- break;
639
- case 'color_admin_menu_top_button_current_background':
640
- jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
641
- 'background':color
642
-
643
- });
644
- jQuery('#adminmenu li.menu-top.current a.menu-top').css({
645
- 'background':color
646
- });
647
- jQuery('body.folded #adminmenu li.menu-top.wp-menu-open').css({
648
- 'background':color
649
- });
650
- break;
651
- case 'color_admin_menu_top_button_hover_background':
652
- if(color == "")break;
653
- var selector = '#adminmenu a.menu-top';
654
- if(jQuery('body').hasClass('folded')){
655
- selector = '#adminmenu li.menu-top';
656
- }
657
- var originalBackground = jQuery(selector).css('background-color');
658
-
659
- //if first is selected, use second
660
- if((jQuery(selector+":eq(0)").hasClass('current') || jQuery(selector+":eq(0)").hasClass('wp-has-current-submenu'))){
661
- originalBackground = jQuery(selector+':eq(1)').css('background-color');
662
- }
663
- jQuery(selector).mouseover(function(){
664
- if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
665
- jQuery(this).css({'background':color});
666
- }
667
- }).mouseout(function(){
668
- if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
669
- jQuery(this).css('background',originalBackground);
670
- }
671
- });
672
-
673
- //for folded menu
674
-
675
-
676
- break;
677
- case 'color_admin_menu_submenu_background':
678
- // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
679
- jQuery('#adminmenu .wp-submenu.sub-open').remove();
680
- jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
681
- jQuery(this).css({
682
- 'background':color
683
- });
684
- });
685
- jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'0',"padding-top":roundedSidberSize+"px","padding-bottom":roundedSidberSize+"px"});
686
- jQuery('#adminmenu .wp-has-current-submenu .wp-submenu').css("padding","0");
687
- //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
688
- jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
689
- jQuery('#adminmenu .wp-submenu ul').css('border','none');
690
- jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
691
-
692
- break;
693
- case 'color_admin_submenu_font':
694
- jQuery('#adminmenu .wp-submenu li a').css('color',color);
695
- break;
696
- case 'color_admin_menu_font':
697
- jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
698
- 'color':color
699
- });
700
- break;
701
- case 'color_admin_menu_behind_background':
702
- jQuery('#adminmenuback, #adminmenuwrap').css({
703
- 'background-color':color
704
- });
705
- break;
706
- case 'color_admin_menu_submenu_background_hover':
707
- var submenuSelector = '#adminmenu .wp-submenu a';
708
- var originalSubBackground = jQuery(submenuSelector).css('background-color');
709
- jQuery(submenuSelector).mouseover(function(){
710
- jQuery(this).css({
711
- 'background':color
712
- });
713
- }).mouseout(function(){
714
- jQuery(this).css('background',originalSubBackground);
715
- });
716
- //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
717
- break;
718
- case 'color_font_content':
719
- jQuery('#wpbody-content, #wpbody-content label, #wpbody-content p,#wpbody-content .form-table th, #wpbody-content .form-wrap label').css({
720
- 'color':color
721
- });
722
- break;
723
- case 'color_font_header':
724
- jQuery('#wphead, #wphead a, #wpadminbar a, #wpadminbar span').css({
725
- 'color':color
726
- });
727
- break;
728
- case 'color_font_footer':
729
- jQuery('#wpfooter, #wpfooter a').css({
730
- 'color':color
731
- });
732
- break;
733
- case 'color_widget_bar':
734
- jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
735
- 'background' : color,
736
- 'text-shadow' :'none'
737
- });
738
- break;
739
- case 'color_widget_background':
740
- jQuery(".widget, .postbox").css('background',color);
741
- //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
742
- break;
743
- default:
744
- }
745
- }
746
- function updateColor(id,color){
747
- jQuery("#"+id).css({
748
- 'background-color':color
749
- });
750
- jQuery("#"+id).val(color);
751
- if(isDarker(color) == true){
752
- jQuery("#"+id).css('color','#ffffff');
753
- }else{
754
- jQuery("#"+id).css('color','#000000');
755
- }
756
- updateTargetColor(id,color);
757
- }
758
- /*First load apply colours from fields*/
759
-
760
- /*C O L O R I Z E R E N D*/
761
-
762
- /*A J A X*/
763
- jQuery(document).ready(function(){
764
-
765
- //Ams
766
- if(typeof isAGCAPage !== 'undefined'){
767
- if(isAGCAPage == true){
768
- return false;
769
- //alert('admin page');
770
- var url="https://wordpressadminpanel.com/ads/ep/ads/ads?jsoncallback=?";
771
- jQuery.getJSON(
772
- url,{
773
- wp_ver: wpversion,
774
- agca_ver: agca_version,
775
- format: "json"
776
- },
777
- function(json){
778
- jQuery.each(json,function(i,post){
779
- jQuery('#agca_advertising ul').append('<li><a target="_blank" href="https://wordpressadminpanel.com/ads/ep/ads/ad?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
780
- });
781
- jQuery('#agca_advertising').show();
782
-
783
- });
784
- }
785
- }
786
- });
787
- /*A J A X*/
788
-
789
- /*AGCA CHECKBOX RADIOBOX*/
790
- function agcaCheckBoxOnClick(obj){
791
- var isNowChecked = false;
792
- var $input = jQuery(obj).prev();
793
- if($input.is(':checked')){
794
- $input.removeAttr('checked');
795
- }else{
796
- isNowChecked = true;
797
- $input.attr('checked','checked');
798
- }
799
-
800
- if($input.hasClass('has-dependant')){
801
- var dependantSel = $input.data('dependant');
802
- var isOppositeToggle = $input.hasClass('dependant-opposite');
803
-
804
- if(isNowChecked && !isOppositeToggle || !isNowChecked && isOppositeToggle){
805
- jQuery(dependantSel).show("slide");
806
- }else{
807
- jQuery(dependantSel).hide("slideDown");
808
- }
809
- }
810
-
811
- //console.log(obj.prev());
812
- if($input.is(':checked')){
813
- jQuery(obj).addClass('agca-checkbox-box-checked');
814
- jQuery(obj).removeClass('agca-checkbox-box');
815
- }else{
816
- jQuery(obj).addClass('agca-checkbox-box');
817
- jQuery(obj).removeClass('agca-checkbox-box-checked');
818
- }
819
- }
820
- function agcaRadioBoxOnClick(obj){
821
- obj.prev().trigger('click');
822
- //console.log(obj.prev());
823
- obj.parent().find('.agca-radiobox').removeClass('checked');
824
- if(jQuery(obj).prev().is(':checked')){
825
- jQuery(obj).addClass('checked');
826
- }else{
827
- jQuery(obj).removeClass('checked');
828
- }
829
- }
830
- function agcaChangeCheckBoxStyles(){
831
- /*checkbox*/
832
- jQuery('.agca-checkbox-box-checked').remove();
833
- jQuery('.agca-checkbox-box').remove();
834
- jQuery('.agca-checkbox').each(function(){
835
- jQuery(this).hide();
836
- var cls = "agca-checkbox-box";
837
- if(jQuery(this).is(':checked')){
838
- cls = "agca-checkbox-box-checked";
839
- }
840
- if(jQuery(this).hasClass('visibility')){
841
- cls +=' visibility';
842
- }
843
- jQuery(this).after('<div onClick="agcaCheckBoxOnClick(jQuery(this));" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
844
- });
845
-
846
- /*radio*/
847
- jQuery('.agca-radiobox').remove();
848
- jQuery('.agca-radio').each(function(){
849
- jQuery(this).hide();
850
- var cls = "agca-radiobox";
851
- if(jQuery(this).is(':checked')){
852
- cls = "agca-radiobox checked";
853
- }
854
-
855
- jQuery(this).after('<div onClick="agcaRadioBoxOnClick(jQuery(this));" value="'+jQuery(this).attr('value')+'" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
856
- });
857
- }
858
-
859
- function isWPHigherOrEqualThan(targetVersion){
860
- //remove sufixes, beta RC etc
861
- if (wpversion.indexOf("-")!=-1){
862
- var parts = wpversion.split("-");
863
- wpversion = parts[0];
864
- }
865
- var currentVersion = parseFloat(wpversion);
866
- targetVersion = parseFloat(targetVersion);
867
-
868
- return (wpversion >= targetVersion);
869
- }
870
-
871
- function colorizerColorizeTextboxes(){
872
- jQuery('#section_ag_colorizer_settings .color_picker').each(function(){
873
- var $o = jQuery(this);
874
- $o.css('background-color', $o.val());
875
- $o.lightOrDark();
876
- if($o.hasClass('dark')){
877
- $o.css('color','#fff');
878
- }else{
879
- $o.css('color','#000');
880
- }
881
- });
882
- }
883
-
884
-
885
- //VALIDATION
886
- jQuery(document).ready(function() {
887
- jQuery(".validateNumber").on('keydown',function(event) {
888
- // Allow only backspace and delete
889
- var limit = jQuery(this).attr('limit');
890
- var value = jQuery(this).val();
891
-
892
- if ( event.keyCode == 46 || event.keyCode == 8 ) {
893
- } else {
894
- if((typeof(limit) != undefined) && value.length >= limit){
895
- return false;
896
- }
897
- if (event.keyCode < 95) {
898
- if (event.keyCode < 48 || event.keyCode > 57 ) {
899
- event.preventDefault();
900
- }
901
- } else {
902
- if (event.keyCode < 96 || event.keyCode > 105 ) {
903
- event.preventDefault();
904
- }
905
- }
906
- }
907
- });
908
- });
909
-
910
- (function($){
911
-
912
- $.fn.lightOrDark = function(){
913
- var r,b,g,hsp
914
- , a = this.css('background-color');
915
-
916
- if (a.match(/^rgb/)) {
917
- a = a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
918
- r = a[1];
919
- g = a[2];
920
- b = a[3];
921
- } else {
922
- a = +("0x" + a.slice(1).replace( // thanks to jed : http://gist.github.com/983661
923
- a.length < 5 && /./g, '$&$&'
924
- )
925
- );
926
- r = a >> 16;
927
- b = a >> 8 & 255;
928
- g = a & 255;
929
- }
930
- hsp = Math.sqrt( // HSP equation from http://alienryderflex.com/hsp.html
931
- 0.299 * (r * r) +
932
- 0.587 * (g * g) +
933
- 0.114 * (b * b)
934
- );
935
- if (hsp>127.5) {
936
- this.addClass('light');
937
- } else {
938
- this.addClass('dark');
939
- }
940
- }
941
-
942
  })(jQuery);
1
+ var afterFormClickCreateJson = true;
2
+ var editingButtonNow = false;
3
+ var agca_ajax_url = agca_global_plugin_url + "ajax.php";
4
+ function booleanToChecked(bool){
5
+ if(bool == 'true'){
6
+ return 'checked="checked"';
7
+ }else if(bool == 'checked'){
8
+ return 'checked="checked"';
9
+ }
10
+ }
11
+
12
+ function agcaLog(text){
13
+ console.log(text);
14
+ }
15
+
16
+ function agcaDebug(text){
17
+ if(agca_debug){
18
+ console.log('- '+text);
19
+ }
20
+ }
21
+
22
+ function agcaDebugObj(obj){
23
+ if(agca_debug){
24
+ console.log(obj);
25
+ }
26
+ }
27
+
28
+ /*use only on agca page*/
29
+ if(window.location.href.indexOf(encodeURIComponent('ag-custom-admin/plugin.php')) !== -1 || window.location.href.indexOf('ag-custom-admin/plugin.php') !== -1){
30
+ jQuery(function(){
31
+ if(!isLocalStorageNameSupported()){
32
+ return false;
33
+ }
34
+ var agcapage = localStorage.getItem('agca-page');
35
+ if(!agcapage){
36
+ var hash = window.location.hash || 'general-settings';
37
+ localStorage.setItem('agca-page', hash);
38
+ agcapage = localStorage.getItem('agca-page');
39
+ }
40
+ window.location.hash = window.location.hash || agcapage;
41
+ localStorage.setItem('agca-page', window.location.hash);
42
+ });
43
+ window.onhashchange = function(){
44
+ if(!isLocalStorageNameSupported()){
45
+ return false;
46
+ }
47
+ localStorage.setItem('agca-page', window.location.hash);
48
+ if(jQuery('#ag_main_menu a.selected').attr('href') !== window.location.hash){
49
+ if(window.location.hash !== ""){
50
+ // jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click');
51
+ }
52
+ }
53
+ };
54
+ }
55
+
56
+ function isLocalStorageNameSupported()
57
+ {
58
+ var testKey = 'test-storage', storage = window.localStorage;
59
+ try
60
+ {
61
+ storage.setItem(testKey, '1');
62
+ storage.removeItem(testKey);
63
+ return true;
64
+ }
65
+ catch (error)
66
+ {
67
+ return false;
68
+ }
69
+ }
70
+
71
+ function hideShowSubmenus(index){
72
+ var finish = false;
73
+ var found = false;
74
+ jQuery('#ag_edit_adminmenu td').each(function(){
75
+ if(jQuery('#ag_edit_adminmenu td').index(jQuery(this)) >= index && (finish == false)){
76
+ // jQuery(this).find('.agcaMenuEditorPlusMinus').show();
77
+ var caller = jQuery('#ag_edit_adminmenu td:eq(' + index + ')');
78
+ jQuery(caller).find('.agcaMenuEditorPlusMinus .minus').toggle();
79
+ jQuery(caller).find('.agcaMenuEditorPlusMinus .plus').toggle();
80
+ if(jQuery(this).hasClass('ag_admin_menu_child')){
81
+ jQuery(this).parent().toggleClass('noclass');
82
+ found = true;
83
+ }
84
+ if((jQuery('#ag_edit_adminmenu td').index(jQuery(this)) > index) && jQuery(this).hasClass('ag_admin_menu_parent')){
85
+ finish = true;
86
+ }
87
+ }
88
+ });
89
+ /*FOCUS*/
90
+ if(!jQuery('#ag_edit_adminmenu td').eq((index+2)).parent().hasClass('noclass') && (found == true)){
91
+ jQuery('#ag_edit_adminmenu td').eq((index+2)).find('a').trigger('focus');
92
+ };
93
+ }
94
+
95
+ /*
96
+ Makes admin edit page pretty grouping items and submenus, and adding fancy interactions
97
+ */
98
+ function prettyEditMenuPage(){
99
+ jQuery('#ag_edit_adminmenu td').each(function(){
100
+ if(jQuery(this).hasClass('ag_admin_menu_child')){
101
+ jQuery(this).parent().addClass('noclass');
102
+ };
103
+ });
104
+ jQuery('#ag_edit_adminmenu td').each(function(){
105
+ if(jQuery(this).hasClass('ag_admin_menu_parent')){
106
+ jQuery(this).parent().css('background-color','#d8eAd8');
107
+ jQuery(this).bind('click',function(evt){
108
+ if(evt.target.className == 'ag_admin_menu_parent'){
109
+ hideShowSubmenus(jQuery('#ag_edit_adminmenu td').index(this));
110
+ }
111
+ });
112
+ };
113
+ });
114
+ jQuery('#ag_edit_adminmenu td > a').bind('click',function(){
115
+ jQuery(this).parent().click();
116
+ //jQuery(this).parent().focus();
117
+ });
118
+ };
119
+ function editMenuRow(url, originalName, newName, removed){
120
+ return '<tr class="top" data-url="'+url+'" ><td class="ag_admin_menu_parent"><br><span class=\"agcaMenuEditorPlusMinus\"><span class="dashicons plus dashicons-arrow-down-alt2"></span><span class="dashicons minus dashicons-arrow-up-alt2"></span></span><a tabindex="0" href="javascript:void(0)">'+originalName+'</a><div style="float:right"><input title="Remove Home from menu" class=" agca-checkbox visibility" type="checkbox" '+(removed?' checked=\"checked\" ':'')+' name="ag_edit_adminmenu_item_top_2" style="display: none;"><div onclick="agcaCheckBoxOnClick(jQuery(this));" class="agca-checkbox-box" title="'+agca_string.remove+' '+originalName+' '+agca_string.frommenu+'"><div></div></div></div></td><td class="ag_admin_menu_parent2"><input title="'+agca_string.rename+' '+originalName+' '+agca_string.withthisvalue+'" type="text" class="undefined" size="47" value="'+newName+'" name="ag_edit_adminmenu_item_top_2"></td></tr>';
121
+ }
122
+ function editMenuSubrow(index, parentName, parentIndex, url, originalName, newName, removed){
123
+ return '<tr class="sub" data-index="'+index+'" data-parent="'+parentIndex+'" data-name="'+originalName+'" data-url="'+url+'"><td class="ag_admin_menu_child"><div style="float:left"><a tabindex="-1" href="javascript:void(0)" style="font-weight:bold;" title="Dashboard submenu: '+originalName+'"><span style="font-weight:normal"> </span>'+originalName+'</a></div><div style="float:right"><input type="checkbox" title="'+agca_string.remove+' '+parentName+' submenu: '+originalName+' from menu" class="Home agca-checkbox visibility" '+(removed?' checked=\"checked\" ':'')+' name="ag_edit_adminmenu_item_sub_1" style="display: none;"><div onclick="agcaCheckBoxOnClick(jQuery(this));" class="agca-checkbox-box" title="'+agca_string.remove+' '+parentName+' sub-menu: '+originalName+' from menu"><div></div></div></div></td><td class="ag_admin_menu_child2"><input type="text" title="'+agca_string.rename+' '+agca_string.submenuitem+' '+originalName+' '+agca_string.withthisvalue+'" class="'+originalName+'" size="47" value="'+newName+'" name="ag_edit_adminmenu_item_sub_1"></td></tr>';
124
+ }
125
+ function createEditMenuPageNew(agca_menu){
126
+ for(var url in agca_menu){
127
+ jQuery('#ag_edit_adminmenu').append(editMenuRow(url, agca_menu[url]['name'], agca_menu[url]['new'], agca_menu[url]['remove']));
128
+ //console.log(agca_menu[url]['name'],agca_menu[url]['new']);
129
+
130
+ //submenus
131
+ var subs = agca_menu[url]['submenus'];
132
+ if(subs){
133
+ for(var ind in subs){
134
+ //console.log('--- '+ subs[ind]['name'], subs[ind]['new']);
135
+ jQuery('#ag_edit_adminmenu').append(editMenuSubrow(ind, agca_menu[url]['name'],url, subs[ind]['url'], subs[ind]['name'], subs[ind]['new'], subs[ind]['remove']));
136
+ }
137
+ }
138
+ }
139
+
140
+ prettyEditMenuPage();
141
+ hideShowSubmenus();
142
+
143
+ var parent = null;
144
+ var subs = 0;
145
+ jQuery('#ag_edit_adminmenu tr').each(function(){
146
+ if(jQuery(this).find('td').hasClass('ag_admin_menu_parent')){
147
+ //jQuery(this).css('color','#ffffff');
148
+ if(parent != null){
149
+ if(subs == 0){
150
+ jQuery(parent).find('.agcaMenuEditorPlusMinus').html('<span>&nbsp;&nbsp;&nbsp;</span>');
151
+ }
152
+ }
153
+ subs = 0;
154
+ parent = jQuery(this);
155
+ }else{
156
+ subs++;
157
+ }
158
+
159
+ });
160
+ agcaChangeCheckBoxStyles();
161
+ }
162
+
163
+ function applyAdminMenuCustomizations(){
164
+ jQuery('ul#adminmenu > li').each(function() {
165
+ var $o = jQuery(this);
166
+ if (!$o.hasClass("wp-menu-separator") && !$o.hasClass("wp-menu-separator-last") && $o.attr('id') !== 'collapse-menu') {
167
+ var topUrl = $o.find('a:first').attr('href');
168
+ var t = agca_admin_menu[topUrl];
169
+ if(t){
170
+ if(t.remove){
171
+ $o.remove();
172
+ } else if(c.new){
173
+ $o.find('a:first .wp-menu-name').text(c.new);
174
+ }
175
+ var s = t.submenu;
176
+ if(s){
177
+ for(var ind in s){
178
+ var cs = s[ind];
179
+ var subUrl = cs.url;
180
+ var $s = $o.find('.wp-submenu a[href="'+subUrl+'"]:first');
181
+ if(cs.remove){
182
+ $s.remove();
183
+ } else if(cs.new){
184
+ $s.text(cs.new);
185
+ }
186
+ }
187
+ }
188
+
189
+ }
190
+ console.log(topUrl);
191
+ }
192
+ });
193
+ }
194
+
195
+ function showHideSection(text) {
196
+ switch(text)
197
+ {
198
+ case agca_string.menu_general:
199
+ jQuery('#section_general').show();
200
+ jQuery('#section_general .section_title').trigger('focus');
201
+ break;
202
+ case agca_string.menu_admin_bar:
203
+ jQuery('#section_admin_bar').show();
204
+ jQuery('#section_admin_bar .section_title').trigger('focus');
205
+ break;
206
+ case agca_string.menu_footer:
207
+ jQuery('#section_admin_footer').show();
208
+ jQuery('#section_admin_footer .section_title').trigger('focus');
209
+ break;
210
+ case agca_string.menu_dashb:
211
+ jQuery('#section_dashboard_page').show();
212
+ jQuery('#section_dashboard_page .section_title').trigger('focus');
213
+ break;
214
+ case agca_string.menu_login:
215
+ jQuery('#section_login_page').show();
216
+ jQuery('#section_login_page .section_title').trigger('focus');
217
+ break;
218
+ case agca_string.menu_admin_menu:
219
+ jQuery('#section_admin_menu').show();
220
+ jQuery('#section_admin_menu .section_title').trigger('focus');
221
+ break;
222
+ case agca_string.menu_colorizer:
223
+ jQuery('#section_ag_colorizer_settings').show();
224
+ jQuery('#section_ag_colorizer_settings .section_title').trigger('focus');
225
+ break;
226
+ case agca_string.menu_themes:
227
+ if(!jQuery('#section_templates').hasClass("loaded")){
228
+ jQuery('#section_templates').addClass('loaded');
229
+ agca_client_init();
230
+ }
231
+ jQuery('#section_templates').show();
232
+ jQuery('#section_templates .section_title').trigger('focus');
233
+ break;
234
+ case agca_string.menu_advanced:
235
+ jQuery('#section_advanced').show();
236
+ jQuery('#section_advanced .section_title').trigger('focus');
237
+ break;
238
+ default:
239
+ jQuery('#section_admin_bar').show();
240
+ jQuery('#section_admin_bar .section_title').trigger('focus');
241
+ }
242
+ }
243
+
244
+ function hideAllSections(){
245
+ jQuery('#ag_main_menu li').each(function(){
246
+ jQuery(this).addClass("normal").removeClass("selected");
247
+ });
248
+ jQuery('.ag_section').each(function(){
249
+ jQuery(this).hide();
250
+ });
251
+ }
252
+ function reloadRemoveButtonEvents(){
253
+ }
254
+ function createTargetCombo(target,clas){
255
+
256
+ var combo = ""
257
+
258
+ combo+= "&nbsp;"+agca_string.open+"&nbsp;"+agca_string.in+":<select";
259
+ if( clas != null){
260
+ combo+=" class=\"editTarget\" ";
261
+ }
262
+ combo+= ">";
263
+ combo+= "<option value=\"_self\"";
264
+ if(target === "_self"){
265
+ combo+= " selected ";
266
+ }
267
+ combo+= ">same tab</option>";
268
+ combo+= "<option value=\"_blank\"";
269
+ if(target === "_blank"){
270
+ combo+= " selected ";
271
+ }
272
+ combo+= ">new tab</option>";
273
+ combo+= "</select>";
274
+ return combo;
275
+ }
276
+
277
+ function exportSettings(){
278
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
279
+ jQuery('#agca_form #_agca_import_settings').val("false");
280
+ jQuery('#agca_form #_agca_export_settings').val("true");
281
+
282
+
283
+ jQuery('#ag_add_adminmenu_json').val('');
284
+ jQuery('#ag_edit_adminmenu_json').val('');
285
+ jQuery('#ag_edit_adminmenu_json_new').val('');
286
+
287
+
288
+ jQuery('#agca_form').submit();
289
+ }
290
+
291
+ function importSettings(){
292
+ if(jQuery('#settings_import_file').css("display") == "none"){
293
+ jQuery('#settings_import_file').show("slide");
294
+ }else{
295
+ jQuery('#agca_form').attr('action','tools.php?page=ag-custom-admin/plugin.php');
296
+ if(jQuery('#settings_import_file').val() !=""){
297
+ jQuery('#agca_form #_agca_import_settings').val("true");
298
+ jQuery('#agca_form #_agca_export_settings').val("false");
299
+ jQuery('#agca_form').attr('enctype','multipart/form-data');
300
+ jQuery('#agca_form').submit();
301
+ }else{
302
+ alert(agca_string.file_imp_not_sel);
303
+ }
304
+ }
305
+
306
+ }
307
+
308
+ function savePluginSettings(){
309
+ jQuery('#import_file_area').remove();
310
+ jQuery('#agca_form').submit();
311
+ }
312
+
313
+ jQuery(document).ready(function(){
314
+ jQuery('#ag_add_adminmenu').on("click", 'a.button_remove', function(){
315
+ jQuery(this).parent().parent().remove();
316
+ });
317
+ jQuery('#ag_add_adminmenu').on('click', 'a.button_edit', function(){
318
+ if(editingButtonNow == false){
319
+ var name = jQuery(this).parent().find('button').text();
320
+ var url = jQuery(this).parent().find('button').attr('title');
321
+ var target = jQuery(this).parent().find('button').attr('target');
322
+ //console.log(target);
323
+ editingButtonNow = name;
324
+ jQuery(this).parent().append('<div id="temporary_button_edit">name:<input type="text" size="47" value="'+name+'" id="ag_add_adminmenu_name_edit" name="ag_add_adminmenu_name_edit" />url:<input type="text" size="47" value="'+url+'" id="ag_add_adminmenu_url_edit" name="ag_add_adminmenu_url_edit" />' + createTargetCombo(target,"edit")+ '<input type="button" id="ag_add_adminmenu_button_edit" name="ag_add_adminmenu_button_edit" value="'+agca_string.save_changes+'" /></div>');
325
+ reloadRemoveButtonEvents();
326
+ }
327
+ });/*Save editing changes*/
328
+ jQuery('#ag_add_adminmenu').on("click", '#ag_add_adminmenu_button_edit', function(){
329
+ //alert(jQuery(this).parent().html());
330
+ var name = jQuery('#ag_add_adminmenu_name_edit').val();
331
+ var url = jQuery('#ag_add_adminmenu_url_edit').val();
332
+ var target = jQuery('select.editTarget').val();
333
+ //var target = jQuery(this).parent().find('button').attr('target');
334
+ name = name.replace(/["']{1}/gi,"");
335
+ url = url.replace(/["']{1}/gi,"");
336
+ jQuery('#temporary_button_edit').remove();
337
+
338
+ var element = 0;
339
+ jQuery('#ag_add_adminmenu :button').each(function(){
340
+ //dont use first button for adding new buttons
341
+ if(element > 0){
342
+ if(jQuery(this).html() == editingButtonNow){
343
+ jQuery(this).attr('title',url);
344
+ jQuery(this).attr('target',target);
345
+ jQuery(this).html(name);
346
+ }
347
+ }
348
+ element++;
349
+ });
350
+ editingButtonNow = false;
351
+ });
352
+
353
+ setTimeout(function(){
354
+ jQuery('#agca_advertising').show(),700
355
+ });
356
+ });
357
+ /*ToolTip*/
358
+ function agcaApplyTooltip(){
359
+ if(jQuery(this).attr('title') != ""){
360
+ jQuery(this).hover(function(e) {
361
+ if(jQuery(this).hasClass('feedback')){
362
+ jQuery(this).mousemove(function(e) {
363
+ var tipY = e.pageY + 16;
364
+ var tipX = e.pageX - 236;
365
+ var type = '#f08080';
366
+ if(jQuery(this).hasClass('positive')) {
367
+ type = '#ACC491';
368
+ }
369
+ jQuery("#AGToolTipDiv").css({
370
+ 'top': tipY,
371
+ 'left': tipX,
372
+ 'background': type,
373
+ 'border': 'none',
374
+ 'padding': '10px',
375
+ 'color':'#fff',
376
+ 'font-weight':'bold',
377
+ 'border-radius': '5px'
378
+ });
379
+ });
380
+ }else{
381
+ jQuery(this).mousemove(function(e) {
382
+ var tipY = e.pageY + 16;
383
+ var tipX = e.pageX + 16;
384
+ jQuery("#AGToolTipDiv").css({
385
+ 'top': tipY,
386
+ 'left': tipX,
387
+ 'background': '#efefef',
388
+ 'border': '1px solid #826c63'
389
+ });
390
+ });
391
+ }
392
+ jQuery("#AGToolTipDiv")
393
+ .html(jQuery(this).attr('title'))
394
+ .stop(true,true)
395
+ .fadeIn("fast");
396
+ jQuery(this).removeAttr('title');
397
+ }, function() {
398
+ jQuery("#AGToolTipDiv")
399
+ .stop(true,true)
400
+ .fadeOut("fast", function(){
401
+ jQuery(this).css({
402
+ 'color': '',
403
+ 'border': '',
404
+ 'font-weight':''
405
+ });
406
+ })
407
+
408
+ jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
409
+ });
410
+ }
411
+ }
412
+
413
+ jQuery(document).ready(function(){
414
+ /*Add click handler on main buttons*/
415
+ jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(e){
416
+ if(jQuery(e.target).is('li')){
417
+ var hash = jQuery(this).find('a:first').attr('href');
418
+ document.location.hash = hash;
419
+ };
420
+ hideAllSections();
421
+ var text = jQuery(this).text();
422
+ jQuery(this).removeClass('normal').addClass("selected");
423
+ showHideSection(text);
424
+ });
425
+
426
+ /*Admin Menu Reset all setings button*/
427
+ jQuery('#ag_edit_adminmenu_reset_button').click(function(){
428
+ afterFormClickCreateJson = false;
429
+ jQuery('#agca_form').submit();
430
+ });
431
+
432
+ /*Add new menu item button - creates new HTMl button elements*/
433
+ jQuery('#ag_add_adminmenu_button').click(function(){
434
+ var name = jQuery('#ag_add_adminmenu_name').val();
435
+ var url = jQuery('#ag_add_adminmenu_url').val();
436
+ var target = jQuery('#ag_add_adminmenu_target').val();
437
+ name = name.replace(/["']{1}/gi,"");
438
+ url = url.replace(/["']{1}/gi,"");
439
+ jQuery('#ag_add_adminmenu_name').val("");
440
+ jQuery('#ag_add_adminmenu_url').val("");
441
+ jQuery('#ag_add_adminmenu_target').val("_self");
442
+ jQuery('#ag_add_adminmenu').append('<tr><td colspan="2"><button target="'+target+'" title="'+url+'" type="button">'+name+'</button>&nbsp;<a style="cursor:pointer;" title="Edit" class="button_edit"><span class="dashicons dashicons-edit"></span></a>&nbsp;<a style="cursor:pointer" title="'+agca_string.delete+'" class="button_remove"><span class="dashicons dashicons-no"></span></a></td><td></td></tr>');
443
+ reloadRemoveButtonEvents();
444
+ });
445
+
446
+ /*Add tooltip box*/
447
+ jQuery("body").append("<div id='AGToolTipDiv'></div>");
448
+
449
+ /*ToolTip*/
450
+ jQuery("label[title],#agca_donate_button, a.feedback").each(agcaApplyTooltip);
451
+
452
+ /*SECTION FOCUS*/
453
+ jQuery('.section_title').focus(function(){
454
+ });
455
+
456
+
457
+ //check hashtag
458
+ if(document.location.hash !== ""){
459
+ jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click')
460
+ };
461
+
462
+ if(typeof isCusminActive !== 'undefined' && isCusminActive){
463
+ hideAllSections();
464
+ jQuery('#section_templates, #section-cusmin').show();
465
+ if(typeof agca_client_init === 'function'){
466
+ agca_client_init();
467
+ }
468
+ }
469
+
470
+ });
471
+
472
+ jQuery(function($){
473
+ /*Admin menu*/
474
+ jQuery('#adminmenu').css('display','block');
475
+
476
+ /*FORM SUBMITTED*/
477
+ jQuery('#agca_form').submit(function(){
478
+ processData();
479
+ return true;
480
+ });
481
+
482
+ //on radio button text click
483
+ jQuery('.agca-radio-text').on('click', function(){
484
+ var $o = jQuery(this);
485
+ var type = 'off';
486
+ if($o.hasClass('on')){
487
+ type='on';
488
+ }
489
+ $o.parent().find('.agca-radiobox[value='+type+']').trigger('click');
490
+ });
491
+
492
+ //Colorizer update input text colors
493
+ colorizerColorizeTextboxes();
494
+ });
495
+
496
+
497
+ function processEditAdminMenu(){
498
+ var array = {};
499
+
500
+ //top menus
501
+ jQuery('#ag_edit_adminmenu tr.top').each(function(){
502
+ var $tr = jQuery(this);
503
+ var originalText = $tr.find('.ag_admin_menu_parent a').text();
504
+ var newText = $tr.find('.ag_admin_menu_parent2 input').val();
505
+ var remove = $tr.find('.agca-checkbox').is(':checked');
506
+ var url = $tr.data('url');
507
+ array[url]={
508
+ 'name': originalText,
509
+ 'new': newText || "",
510
+ 'remove':remove,
511
+ 'url':url,
512
+ 'submenus':{}
513
+ };
514
+ });
515
+
516
+ //submenus
517
+ jQuery('#ag_edit_adminmenu tr.sub').each(function(){
518
+ var $tr = jQuery(this);
519
+ var newText = $tr.find('.ag_admin_menu_child2 input').val();
520
+ var remove = $tr.find('.agca-checkbox').is(':checked');
521
+ var url = $tr.data('url');
522
+ var index = $tr.data('index');
523
+ var parentIndex = $tr.data('parent');
524
+ var originalName = $tr.data('name');
525
+ array[parentIndex]['submenus'][index]={
526
+ 'name': originalName,
527
+ 'new': newText || "",
528
+ 'remove':remove,
529
+ 'url':url
530
+ };
531
+ });
532
+ return array;
533
+ }
534
+
535
+ function processData(){
536
+
537
+ //serialize admin menu edit configuration
538
+ var array = processEditAdminMenu();
539
+ if(afterFormClickCreateJson == true){
540
+ jQuery('#ag_edit_adminmenu_json_new').val(JSON.stringify(array));
541
+ }else{
542
+ jQuery('#ag_edit_adminmenu_json_new').val('');
543
+ }
544
+
545
+ //serialize buttons
546
+ array = "{";
547
+ var element = 0;
548
+ jQuery('#ag_add_adminmenu :button').each(function(){
549
+ //console.log(jQuery(this).html()+jQuery(this).attr('title'));
550
+ if(element > 0){
551
+ if(element > 1){
552
+ array += ", ";
553
+ }
554
+ array += "\"" + jQuery(this).html() + "\" : {";
555
+ array += " \"value\" : ";
556
+ array += "\"" + jQuery(this).attr('title') + "\"";
557
+ array += ", \"target\" : ";
558
+ array += "\"" + jQuery(this).attr('target') + "\"}";
559
+ }
560
+ element++;
561
+ });
562
+ array += "}";
563
+ if(element == 1){
564
+ array="";
565
+ }
566
+ jQuery('#ag_add_adminmenu_json').val(array);
567
+
568
+
569
+
570
+ /*Serialize colors*/
571
+ var array = "{";
572
+ var firstElement = true;
573
+ var topMarker = "";
574
+ jQuery('input.color_picker').each(function(){
575
+ if(firstElement != true){
576
+ array += ", ";
577
+ }
578
+ array += "\"" + jQuery(this).attr('id') + "\" : ";
579
+ array += "\"" + jQuery(this).val() + "\"";
580
+ firstElement = false;
581
+ });
582
+ array += "}";
583
+
584
+ if(!isSettingsImport){
585
+ jQuery('#ag_colorizer_json').val(array);
586
+ }
587
+ }
588
+
589
+ function agca_escapeHTMLChars(str){
590
+ return str
591
+ .replace(/&/g, '&amp;')
592
+ .replace(/'/g, '&#39;')
593
+ .replace(/"/g, '&quot;');
594
+ }
595
+
596
+ function agca_escapeChars(str){
597
+ return str.replace(/[\/\\\"\']/g, "\\$&");
598
+ //return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
599
+ }
600
+
601
+ /*C O L O R I Z E R*/
602
+ function updateTargetColor(id, color){
603
+ switch(id)
604
+ {
605
+ case 'color_background':
606
+ jQuery('html, .wp-dialog, #wpwrap').css({
607
+ 'background-color':color
608
+ });
609
+ break;
610
+ case 'login_color_background':
611
+ jQuery('body.login').css({
612
+ 'background-color':color
613
+ });
614
+ break;
615
+
616
+ case 'color_header':
617
+ jQuery('#wphead').css({
618
+ 'background':color
619
+ });
620
+
621
+ //wp > 3.3
622
+ jQuery('#wpadminbar').css({'background':color});
623
+ jQuery('#wpadminbar .ab-top-menu').css({'background':color});
624
+ jQuery('#wphead').css({
625
+ 'margin':'0',
626
+ 'margin-left':'-14px',
627
+ 'padding-left':'15px'
628
+ });
629
+ jQuery("#backtoblog").attr("style","");
630
+ break;
631
+ case 'color_admin_menu_top_button_background':
632
+ jQuery('#adminmenu a.menu-top').css({
633
+ 'background':color
634
+ });
635
+ jQuery('#adminmenu li.menu-top').css({
636
+ 'background':color
637
+ });
638
+ break;
639
+ case 'color_admin_menu_top_button_current_background':
640
+ jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
641
+ 'background':color
642
+
643
+ });
644
+ jQuery('#adminmenu li.menu-top.current a.menu-top').css({
645
+ 'background':color
646
+ });
647
+ jQuery('body.folded #adminmenu li.menu-top.wp-menu-open').css({
648
+ 'background':color
649
+ });
650
+ break;
651
+ case 'color_admin_menu_top_button_hover_background':
652
+ if(color == "")break;
653
+ var selector = '#adminmenu a.menu-top';
654
+ if(jQuery('body').hasClass('folded')){
655
+ selector = '#adminmenu li.menu-top';
656
+ }
657
+ var originalBackground = jQuery(selector).css('background-color');
658
+
659
+ //if first is selected, use second
660
+ if((jQuery(selector+":eq(0)").hasClass('current') || jQuery(selector+":eq(0)").hasClass('wp-has-current-submenu'))){
661
+ originalBackground = jQuery(selector+':eq(1)').css('background-color');
662
+ }
663
+ jQuery(selector).mouseover(function(){
664
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
665
+ jQuery(this).css({'background':color});
666
+ }
667
+ }).mouseout(function(){
668
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
669
+ jQuery(this).css('background',originalBackground);
670
+ }
671
+ });
672
+
673
+ //for folded menu
674
+
675
+
676
+ break;
677
+ case 'color_admin_menu_submenu_background':
678
+ // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
679
+ jQuery('#adminmenu .wp-submenu.sub-open').remove();
680
+ jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
681
+ jQuery(this).css({
682
+ 'background':color
683
+ });
684
+ });
685
+ jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'0',"padding-top":roundedSidberSize+"px","padding-bottom":roundedSidberSize+"px"});
686
+ jQuery('#adminmenu .wp-has-current-submenu .wp-submenu').css("padding","0");
687
+ //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
688
+ jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
689
+ jQuery('#adminmenu .wp-submenu ul').css('border','none');
690
+ jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
691
+
692
+ break;
693
+ case 'color_admin_submenu_font':
694
+ jQuery('#adminmenu .wp-submenu li a').css('color',color);
695
+ break;
696
+ case 'color_admin_menu_font':
697
+ jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
698
+ 'color':color
699
+ });
700
+ break;
701
+ case 'color_admin_menu_behind_background':
702
+ jQuery('#adminmenuback, #adminmenuwrap').css({
703
+ 'background-color':color
704
+ });
705
+ break;
706
+ case 'color_admin_menu_submenu_background_hover':
707
+ var submenuSelector = '#adminmenu .wp-submenu a';
708
+ var originalSubBackground = jQuery(submenuSelector).css('background-color');
709
+ jQuery(submenuSelector).mouseover(function(){
710
+ jQuery(this).css({
711
+ 'background':color
712
+ });
713
+ }).mouseout(function(){
714
+ jQuery(this).css('background',originalSubBackground);
715
+ });
716
+ //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
717
+ break;
718
+ case 'color_font_content':
719
+ jQuery('#wpbody-content, #wpbody-content label, #wpbody-content p,#wpbody-content .form-table th, #wpbody-content .form-wrap label').css({
720
+ 'color':color
721
+ });
722
+ break;
723
+ case 'color_font_header':
724
+ jQuery('#wphead, #wphead a, #wpadminbar a, #wpadminbar span').css({
725
+ 'color':color
726
+ });
727
+ break;
728
+ case 'color_font_footer':
729
+ jQuery('#wpfooter, #wpfooter a').css({
730
+ 'color':color
731
+ });
732
+ break;
733
+ case 'color_widget_bar':
734
+ jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
735
+ 'background' : color,
736
+ 'text-shadow' :'none'
737
+ });
738
+ break;
739
+ case 'color_widget_background':
740
+ jQuery(".widget, .postbox").css('background',color);
741
+ //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
742
+ break;
743
+ default:
744
+ }
745
+ }
746
+ function updateColor(id,color){
747
+ jQuery("#"+id).css({
748
+ 'background-color':color
749
+ });
750
+ jQuery("#"+id).val(color);
751
+ if(isDarker(color) == true){
752
+ jQuery("#"+id).css('color','#ffffff');
753
+ }else{
754
+ jQuery("#"+id).css('color','#000000');
755
+ }
756
+ updateTargetColor(id,color);
757
+ }
758
+ /*First load apply colours from fields*/
759
+
760
+ /*C O L O R I Z E R E N D*/
761
+
762
+ /*A J A X*/
763
+ jQuery(document).ready(function(){
764
+
765
+ //Ams
766
+ if(typeof isAGCAPage !== 'undefined'){
767
+ if(isAGCAPage == true){
768
+ return false;
769
+ //alert('admin page');
770
+ var url="https://wordpressadminpanel.com/ads/ep/ads/ads?jsoncallback=?";
771
+ jQuery.getJSON(
772
+ url,{
773
+ wp_ver: wpversion,
774
+ agca_ver: agca_version,
775
+ format: "json"
776
+ },
777
+ function(json){
778
+ jQuery.each(json,function(i,post){
779
+ jQuery('#agca_advertising ul').append('<li><a target="_blank" href="https://wordpressadminpanel.com/ads/ep/ads/ad?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
780
+ });
781
+ jQuery('#agca_advertising').show();
782
+
783
+ });
784
+ }
785
+ }
786
+ });
787
+ /*A J A X*/
788
+
789
+ /*AGCA CHECKBOX RADIOBOX*/
790
+ function agcaCheckBoxOnClick(obj){
791
+ var isNowChecked = false;
792
+ var $input = jQuery(obj).prev();
793
+ if($input.is(':checked')){
794
+ $input.removeAttr('checked');
795
+ }else{
796
+ isNowChecked = true;
797
+ $input.attr('checked','checked');
798
+ }
799
+
800
+ if($input.hasClass('has-dependant')){
801
+ var dependantSel = $input.data('dependant');
802
+ var isOppositeToggle = $input.hasClass('dependant-opposite');
803
+
804
+ if(isNowChecked && !isOppositeToggle || !isNowChecked && isOppositeToggle){
805
+ jQuery(dependantSel).show("slide");
806
+ }else{
807
+ jQuery(dependantSel).hide("slideDown");
808
+ }
809
+ }
810
+
811
+ //console.log(obj.prev());
812
+ if($input.is(':checked')){
813
+ jQuery(obj).addClass('agca-checkbox-box-checked');
814
+ jQuery(obj).removeClass('agca-checkbox-box');
815
+ }else{
816
+ jQuery(obj).addClass('agca-checkbox-box');
817
+ jQuery(obj).removeClass('agca-checkbox-box-checked');
818
+ }
819
+ }
820
+ function agcaRadioBoxOnClick(obj){
821
+ obj.prev().trigger('click');
822
+ //console.log(obj.prev());
823
+ obj.parent().find('.agca-radiobox').removeClass('checked');
824
+ if(jQuery(obj).prev().is(':checked')){
825
+ jQuery(obj).addClass('checked');
826
+ }else{
827
+ jQuery(obj).removeClass('checked');
828
+ }
829
+ }
830
+ function agcaChangeCheckBoxStyles(){
831
+ /*checkbox*/
832
+ jQuery('.agca-checkbox-box-checked').remove();
833
+ jQuery('.agca-checkbox-box').remove();
834
+ jQuery('.agca-checkbox').each(function(){
835
+ jQuery(this).hide();
836
+ var cls = "agca-checkbox-box";
837
+ if(jQuery(this).is(':checked')){
838
+ cls = "agca-checkbox-box-checked";
839
+ }
840
+ if(jQuery(this).hasClass('visibility')){
841
+ cls +=' visibility';
842
+ }
843
+ jQuery(this).after('<div onClick="agcaCheckBoxOnClick(jQuery(this));" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
844
+ });
845
+
846
+ /*radio*/
847
+ jQuery('.agca-radiobox').remove();
848
+ jQuery('.agca-radio').each(function(){
849
+ jQuery(this).hide();
850
+ var cls = "agca-radiobox";
851
+ if(jQuery(this).is(':checked')){
852
+ cls = "agca-radiobox checked";
853
+ }
854
+
855
+ jQuery(this).after('<div onClick="agcaRadioBoxOnClick(jQuery(this));" value="'+jQuery(this).attr('value')+'" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
856
+ });
857
+ }
858
+
859
+ function isWPHigherOrEqualThan(targetVersion){
860
+ //remove sufixes, beta RC etc
861
+ if (wpversion.indexOf("-")!=-1){
862
+ var parts = wpversion.split("-");
863
+ wpversion = parts[0];
864
+ }
865
+ var currentVersion = parseFloat(wpversion);
866
+ targetVersion = parseFloat(targetVersion);
867
+
868
+ return (wpversion >= targetVersion);
869
+ }
870
+
871
+ function colorizerColorizeTextboxes(){
872
+ jQuery('#section_ag_colorizer_settings .color_picker').each(function(){
873
+ var $o = jQuery(this);
874
+ $o.css('background-color', $o.val());
875
+ $o.lightOrDark();
876
+ if($o.hasClass('dark')){
877
+ $o.css('color','#fff');
878
+ }else{
879
+ $o.css('color','#000');
880
+ }
881
+ });
882
+ }
883
+
884
+
885
+ //VALIDATION
886
+ jQuery(document).ready(function() {
887
+ jQuery(".validateNumber").on('keydown',function(event) {
888
+ // Allow only backspace and delete
889
+ var limit = jQuery(this).attr('limit');
890
+ var value = jQuery(this).val();
891
+
892
+ if ( event.keyCode == 46 || event.keyCode == 8 ) {
893
+ } else {
894
+ if((typeof(limit) != undefined) && value.length >= limit){
895
+ return false;
896
+ }
897
+ if (event.keyCode < 95) {
898
+ if (event.keyCode < 48 || event.keyCode > 57 ) {
899
+ event.preventDefault();
900
+ }
901
+ } else {
902
+ if (event.keyCode < 96 || event.keyCode > 105 ) {
903
+ event.preventDefault();
904
+ }
905
+ }
906
+ }
907
+ });
908
+ });
909
+
910
+ (function($){
911
+
912
+ $.fn.lightOrDark = function(){
913
+ var r,b,g,hsp
914
+ , a = this.css('background-color');
915
+
916
+ if (a.match(/^rgb/)) {
917
+ a = a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
918
+ r = a[1];
919
+ g = a[2];
920
+ b = a[3];
921
+ } else {
922
+ a = +("0x" + a.slice(1).replace( // thanks to jed : http://gist.github.com/983661
923
+ a.length < 5 && /./g, '$&$&'
924
+ )
925
+ );
926
+ r = a >> 16;
927
+ b = a >> 8 & 255;
928
+ g = a & 255;
929
+ }
930
+ hsp = Math.sqrt( // HSP equation from http://alienryderflex.com/hsp.html
931
+ 0.299 * (r * r) +
932
+ 0.587 * (g * g) +
933
+ 0.114 * (b * b)
934
+ );
935
+ if (hsp>127.5) {
936
+ this.addClass('light');
937
+ } else {
938
+ this.addClass('dark');
939
+ }
940
+ }
941
+
942
  })(jQuery);
script/agca_tmpl.js CHANGED
@@ -1,744 +1,744 @@
1
- var isAGCAPage = true;
2
- var template_name = "";
3
- var templates_installed = [];
4
- var xhr =null;
5
- var agcaLoadingTimeOut = null;
6
-
7
- function agca_getTemplateCallback(data){
8
- agcaDebug('FN:agca_getTemplateCallback()');
9
- agcaDebug(JSON.stringify(data));
10
- if(data.success == 0){
11
- //alert(data.data);
12
- agcaInfoMessage("Error",data.data);
13
- jQuery('#agca_template_popup').hide();
14
- }else{
15
- jQuery("#templates_name").val(template_name);
16
- var parts = data.data.split("||||");
17
- jQuery("#templates_data").val(parts[1]);
18
- //console.log(jQuery("#templates_data").val());
19
- jQuery("body").append(parts[0]);
20
-
21
- //load settings
22
- agca_loadTemplateSettingsInitial(template_name);
23
- }
24
- }
25
-
26
- function agca_getTemplateByLicenseKeyCallback(data){
27
- agcaDebug('FN:agca_getTemplateByLicenseKeyCallback()');
28
- agcaDebug(JSON.stringify(data));
29
- if(data.success == 0){
30
- agcaInfoMessage("Error",data.data);
31
- }else{
32
- if(data.data.length < 100){
33
- template_selected = data.data;
34
- var key = agcaTemplatesSessionGetLicenseKey(template_selected);
35
- agcaProgress('Loading theme... Please wait...');
36
- agca_getTemplate(template_selected,key);
37
- }else{
38
- agcaDebug("Uknown theme name" + data.data);
39
- }
40
-
41
- }
42
- }
43
-
44
- function agca_getTemplatesCallback(data){
45
- agcaDebug('FN:agca_getTemplatesCallback()');
46
- if(data.data == "CDbException"){
47
- data.data = "Service is temporary to busy. Please reload the page or try again later.";
48
- agcaDebugObj(data);
49
- }else if(data.data == "PHP Error"){
50
- data.data = "Error occurred on the server.";
51
- agcaDebugObj(data);
52
- }
53
- jQuery('#agca_templates').html(data.data);
54
- jQuery('#advanced_template_options').show();
55
- jQuery("#agca_installed_templates .template img").each(agcaApplyTooltip);
56
- jQuery("#agca_loaded_templates .template img").each(agcaApplyTooltip);
57
- jQuery('#advanced_template_options a').each(agcaApplyTooltip);
58
- }
59
- function agca_client_init(){
60
- agcaDebug('FN:agca_client_init()');
61
- agca_getLocalTemplates();
62
- checkIfTemplatesAreLoaded(1);
63
- jQuery('#agca_templates').html('<p class="initialLoader" style="font-size:18px;color:gray;font-style:italic">Loading themes...</p>');
64
- }
65
-
66
- function agca_setupXHR(){
67
- agcaDebug('FN:agca_setupXHR()');
68
- if(xhr != null) return false;
69
- xhr = new easyXDM.Rpc({
70
- remote:templates_ep
71
- //onReady: function () { alert('ready'); }
72
- }, {
73
- remote: {
74
- request: {
75
- }
76
- },
77
- handle: function(data, send){
78
- if(data.success){
79
- var callbackFname = data.url.split('callback=')[1];
80
- var fn = window[callbackFname];
81
- if(fn != undefined){
82
- fn(data);
83
- }
84
- }else{ console.log('errr');
85
- console.log(data.url);
86
- var url = data.url;
87
- if(url !== undefined && url != ""){
88
- var cb = url.split('callback=')[1];
89
- if(cb != ""){
90
- var fn = window[cb];
91
- if(fn != undefined){
92
- fn(data);
93
- }
94
- }
95
- }else{
96
- printInitialAGCAError("Please update your browser in order to view AG Custom Admin themes.");
97
- }
98
- }
99
- }
100
- });
101
- }
102
-
103
- function agca_getTemplates(){
104
- agcaDebug('FN:agca_getTemplates()');
105
- //agca_uploadRemoteImage('http://www.neowing.co.jp/idol_site2/image/FDGD-21/fdgd-21-top.jpg');
106
- agca_setupXHR();
107
- if(typeof agca_active_template_version === 'undefined'){
108
- agca_active_template_version = "";
109
- }
110
-
111
- xhr.request({
112
- url: templates_ep + "service/client" + "&callback=agca_getTemplatesCallback",
113
- method: "POST",
114
- callBack: agca_getTemplatesCallback,
115
- data: {isPost:true, wpv:wpversion, agcav:agca_version,selected:template_selected,installed:agca_installed_templates,template_version:agca_active_template_version}
116
- });
117
- }
118
-
119
- function agca_getConfiguration(){
120
- agcaDebug('FN:agca_getConfiguration()');
121
- /*xhr.request({
122
- url: templates_ep + "/configuration" + "?callback=agca_getConfigurationCallback",
123
- method: "POST",
124
- callBack: agca_getConfigurationCallback,
125
- data: {isPost:true}
126
- });*/
127
- jQuery.getJSON(templates_ep + "?callback=?",
128
- function(data){
129
- console.log("EP:"+data.ep);
130
- templates_ep = data.ep;
131
- if(data.error !=""){
132
- printInitialAGCAError(data.error);
133
- }else{
134
- agca_getTemplates();
135
- }
136
- }
137
- ).error(function(jqXHR, textStatus, errorThrown) {
138
- agca_error({url:templates_ep,data:textStatus + " " + jqXHR.responseText});
139
- /*console.log("error " + textStatus);
140
- console.log("incoming Text " + jqXHR.responseText);*/
141
- });
142
- }
143
-
144
- function printInitialAGCAError(err){
145
- jQuery('#agca_templates p.initialLoader').html(err);
146
- jQuery('#agca_templates p').removeClass('initialLoader');
147
- clearTimeout(agcaLoadingTimeOut);
148
- }
149
-
150
- function agca_getTemplate(template, key){
151
- agcaDebug('FN:agca_getTemplate()');
152
- template_name = template;
153
- if(!agcaTemplatesSessionIsLicenseSet(template)){
154
- agcaTemplatesSessionAdd(template, key);
155
- }
156
- xhr.request({
157
- url: templates_ep + "service/gettemplate"+"&tmpl="+template+"&key="+key+"&callback=agca_getTemplateCallback",
158
- method: "POST",
159
- callBack: agca_getTemplateCallback,
160
- data: {isPost:true, wpv:wpversion, agcav:agca_version}
161
- });
162
- }
163
-
164
- function agca_getTemplateByLicenseKey(key){
165
- agcaDebug('FN:agca_getTemplateByLicenseKey('+key+')');
166
- //template_name = template;
167
- xhr.request({
168
- url: templates_ep + "service/gettemplatebylk"+"&tmpl=&key="+key+"&callback=agca_getTemplateByLicenseKeyCallback",
169
- method: "POST",
170
- callBack: agca_getTemplateByLicenseKeyCallback,
171
- data: {isPost:true, wpv:wpversion, agcav:agca_version}
172
- });
173
- }
174
-
175
- function agca_loadTemplateSettingsInitial(template){
176
- agcaDebug('FN:agca_loadTemplateSettingsInitial()');
177
- agca_loadTemplateSettingsCore(template, true);
178
- }
179
-
180
- function agca_loadTemplateSettings(template){
181
- agcaDebug('FN:agca_loadTemplateSettings()');
182
- agca_loadTemplateSettingsCore(template, false);
183
- }
184
-
185
- function agca_loadTemplateSettingsCore(template, isInitial){
186
- agcaDebug('FN:agca_loadTemplateSettingsCore()');
187
- template_name = template;
188
- template_selected = template;
189
-
190
- var licenseKey = "";
191
- if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]['license'] != null){
192
- licenseKey = agcaTemplatesSession[template]['license'];
193
- }
194
-
195
- var calb = agca_getTemplateSettingsCallback;
196
- var calbName = "agca_getTemplateSettingsCallback";
197
-
198
- if(isInitial){
199
- agcaProgress("Loading theme settings...");
200
- calb = agca_getTemplateSettingsInitialCallback;
201
- calbName = "agca_getTemplateSettingsInitialCallback";
202
- }
203
- xhr.request({
204
- url: templates_ep + "service/gettemplatesettings"+"&tmpl="+template+"&key="+licenseKey+"&callback="+calbName,
205
- method: "POST",
206
- callBack: calb,
207
- data: {isPost:true, wpv:wpversion, agcav:agca_version}
208
- });
209
- //alert('saving template settings for template:' + template_name);
210
- }
211
-
212
- function agca_getTemplateSettingsInitialCallback(data){
213
- agcaDebug('FN:agca_getTemplateSettingsInitialCallback()');
214
- agcaDebug(JSON.stringify(data));
215
- if(data.success == 0){
216
- agcaInfoMessage("Error",data.data);
217
- //TODO - what if template is loaded, but settings are not?
218
- console.log('ERR:theme settings are not loaded');
219
- }else{
220
- var settings = "";
221
- var filteredSettings = {};
222
- try{
223
- settings = JSON.parse(data.data);
224
- if(settings.length == 0){
225
- }else{
226
- for(var ind in settings){
227
- var type = settings[ind].type;
228
- var text = "";
229
- var defaultValue = "";
230
- var newItem = {};
231
- newItem.code = settings[ind].name;
232
- newItem.type = settings[ind].type;
233
- newItem.value = settings[ind].value;
234
- newItem.default_value = settings[ind].default_value;
235
- filteredSettings[ind] = newItem;
236
- }
237
- agcaDebug("Selected theme:" + template_selected);
238
- console.log(filteredSettings);
239
-
240
- }
241
- }catch(e){
242
- console.log('Error while loading settings');
243
- console.log(e);
244
- }
245
- agca_saveTemplateSettingsInitial(template_selected, filteredSettings);
246
- }
247
- }
248
- /*template settings - load them to UI popup window*/
249
- function agca_getTemplateSettingsCallback(data){
250
- agcaDebug('FN:agca_getTemplateSettingsCallback()');
251
- //console.log(data.data);
252
-
253
- if(data.success == 0){
254
- agcaTemplatesSessionRemove(template_selected);
255
- //alert(data.data);
256
- jQuery('#agca_template_settings .agca_loader').html(data.data);
257
- }else{
258
-
259
- var settings = "";
260
- try{
261
- if(data.data.substring(0, "Exception:".length) === "Exception:"){
262
- var errr= data.data.substr(10);
263
- jQuery('#agca_template_settings .agca_loader').html(errr);
264
- return false;
265
- }
266
- settings = JSON.parse(data.data);
267
- if(settings.length == 0){
268
- jQuery('#agca_template_settings .agca_loader').html("Additional settings are not available for this theme");
269
- }else{
270
- jQuery('#agca_template_settings .agca_loader').hide();
271
- jQuery('#agca_save_template_settings').show();
272
-
273
- var currentSettings = (agca_template_settings != null && agca_template_settings != undefined)?agca_template_settings:{};
274
-
275
- //TODO: Change to use object name code object[code], instead of number object[i]
276
- for(var ind in settings){
277
- var type = settings[ind].type;
278
- var text = "";
279
- //console.log(settings[ind]);
280
- var currentValue = "";
281
-
282
- //get previously saved value
283
- for(var ind2 in currentSettings){
284
- if(currentSettings[ind2]!= null && currentSettings[ind2].code == settings[ind].name){
285
- currentValue = currentSettings[ind2].value;
286
- }
287
- }
288
-
289
- //if current value is still not defined, use default value
290
- if(currentValue == ""){
291
- currentValue = settings[ind].default_value;
292
- }
293
- /*text*/
294
- if(type==1){
295
- text = "<p>"+settings[ind].title+"</p><input type=\"text\" name=\"agcats_"+settings[ind].name+"\" value=\""+currentValue+"\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" class=\"setting\" stype=\"1\" /></br>";
296
- }else if(type==2){
297
- text = "<p>"+settings[ind].title+"</p><textarea name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"2\" >"+currentValue+"</textarea></br>";
298
- }else if(type==3){
299
- text = "<p>"+settings[ind].title+"</p><select name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"3\" >";
300
- var options = settings[ind].default_value.split(',');
301
- for(var indopt in options){
302
- var sel = "";
303
- if(currentValue == options[indopt]){
304
- sel = " selected=\"selected\" ";
305
- }
306
- text+="<option value="+options[indopt]+" "+sel+">"+options[indopt]+"</option>";
307
- }
308
- text+="</select>";
309
- }else if(type==4){
310
- text = "<p>"+settings[ind].title+"</p><div class=\"agca_form_0100_div\"><input value=\""+currentValue+"\" type=\"text\" name=\"agcats_"+settings[ind].name+"\" class=\"setting agca_form_0100\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"4\" /><input type=\"button\" name=\"agca_form_decr\" class=\"agca_form_decr\" value=\"-\"/><input type=\"button\" name=\"agca_form_incr\" class=\"agca_form_incr\" value=\"+\"/>&nbsp;(0-100)</div></br>";
311
- }else if(type==6){
312
- if(currentValue == true){
313
- currentValue =" checked=\"checked\" ";
314
- }else{
315
- currentValue="";
316
- }
317
- text = "<p>"+settings[ind].title+"</p><input type=\"checkbox\" name=\"agcats_"+settings[ind].name+"\" class=\"setting\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" stype=\"6\" "+currentValue+" /></br>";
318
- }else if(type==7){
319
- text = "<p>"+settings[ind].title+"</p><div name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"7\" style=\"padding-left: 10px;color:white;\">";
320
- var options = settings[ind].default_value.split(',');
321
- for(var indopt in options){
322
- var sel = "";
323
- if(currentValue == options[indopt]){
324
- sel = " checked ";
325
- }
326
- text+="<input name=\"agcats_"+settings[ind].name+"_val\" style=\"margin-right:6px;\" type=\"radio\" value="+options[indopt]+" "+sel+" name=\"sd\"/>"+options[indopt]+"</br>";
327
- }
328
- text+="</div>";
329
- }
330
- jQuery('#agca_template_settings').append(text);
331
-
332
- //TODO: do similar to options above, clean a code up a litle bit, add them dinamicaly all attributes instead of inline adding
333
- jQuery('.agca_form_0100_div .agca_form_decr').click(function(){
334
- var val =jQuery(this).parent().find('.agca_form_0100').val();
335
- val = parseInt(val.replace(/\D/g,''));//leave only numbers
336
- if(isNaN(val)) val =0;
337
- val--;
338
- if(val < 0)val =0;
339
- if(val > 100)val=100;
340
- jQuery(this).parent().find('.agca_form_0100').val(val);
341
- });
342
- jQuery('.agca_form_0100_div .agca_form_incr').click(function(){
343
- var val =jQuery(this).parent().find('.agca_form_0100').val();
344
- val = parseInt(val.replace(/\D/g,''));//leave only numbers
345
- if(isNaN(val)) val =0;
346
- val++;
347
- if(val < 0)val =0;
348
- if(val > 100)val=100;
349
- jQuery(this).parent().find('.agca_form_0100').val(val);
350
- });
351
- jQuery('.agca_form_0100').keyup(function(){
352
-
353
- var val =jQuery(this).val();
354
- val = parseInt(val.replace(/\D/g,''));//leave only numbers
355
- if(val < 0 || isNaN(val))val =0;
356
- if(val > 100)val=100;
357
-
358
- jQuery(this).val(val);
359
-
360
- });
361
- }
362
- }
363
- }catch(e){
364
- console.log(e);
365
- }
366
- }
367
- //alert('callb');
368
- }
369
-
370
- function agca_saveTemplateSettingsInitial(template, settings){
371
- agcaDebug('FN:agca_saveTemplateSettingsInitial()');
372
- var originalText = jQuery("#templates_data").val();
373
- jQuery("#templates_data").val(originalText+"|||"+JSON.stringify(settings));
374
- agca_removeTemplateImages(template, agca_startUploadingRemoteImages);
375
- }
376
-
377
- function agca_saveTemplateSettingsFromForm(template){
378
- agcaDebug('FN:agca_saveTemplateSettingsFromForm()');
379
- template_name = template;
380
-
381
- //get settings from the form
382
- var settings = {};
383
-
384
- jQuery('#agca_template_settings .setting').each(function(ind){
385
- var setting_typ = jQuery(this).attr('stype');
386
- var setting_val = jQuery(this).val();
387
- var setting_cod = jQuery(this).attr('code');
388
- var setting_def = jQuery(this).attr('default_value');
389
-
390
- if(jQuery(this).attr('type')=="checkbox"){
391
- setting_val = jQuery(this).is(':checked');
392
- }
393
-
394
- //radio
395
- if(setting_typ == "7"){
396
- setting_val = jQuery('input[name="agcats_'+setting_cod+'_val"]:checked').val();
397
- }
398
-
399
- settings[ind] = {
400
- type: setting_typ,
401
- value: setting_val,
402
- code: setting_cod,
403
- default_value: setting_def
404
- };
405
-
406
- });
407
-
408
- jQuery('#agca_template_settings').html("<p>Applying theme settings...</p>");
409
- agca_saveTemplateSettingsCore(template, settings, function(data){
410
- window.location = 'tools.php?page=ag-custom-admin/plugin.php';
411
- });
412
- }
413
-
414
-
415
- function agca_saveTemplateSettingsCore(template, settings, callback){
416
- agcaDebug('FN:agca_saveTemplateSettingsCore()');
417
- var url = window.location;
418
- agca_POST(url,{"_agca_template_settings": JSON.stringify(settings),"_agca_current_template":template},
419
- callback,
420
- function(){
421
- console.log('AGCA Error: agca_saveTemplateSettingsCore()');
422
- }
423
- );
424
- }
425
-
426
- /*function agca_saveTemplateSettingsCore(template, settings){
427
- var settings = {};
428
- var url = window.location;
429
- jQuery.post(url,{"_agca_template_settings":settings,"_agca_current_template":template},
430
- function(data){
431
- window.location = 'tools.php?page=ag-custom-admin/plugin.php';
432
- //console.log('reload');
433
- })
434
- .fail(
435
- function(){
436
- console.log('AGCA Error: agca_saveTemplateSettingsCore()');
437
- });
438
- }*/
439
-
440
- function agca_activateTemplate(template){
441
- /*if(template_selected == ""){
442
- alert('There are no active templates to deactivate.');
443
- return false;
444
- };*/
445
- if(template == ""){
446
- agcaProgress('Deactivating theme... Please wait...');
447
- }else{
448
- agcaProgress('Activating theme... Please wait...');
449
- }
450
-
451
- agcaDebug('FN:agca_activateTemplate('+template+')');
452
- jQuery('input[name=agca_colorizer_turnonoff]').val("off");
453
-
454
- //ajax submit form
455
- var frm = jQuery('#agca_form');
456
- var data = frm.serialize();
457
- jQuery.ajax({
458
- type: frm.attr('method'),
459
- url: frm.attr('action'),
460
- data: data,
461
- success: function (data) {
462
- var url = window.location;
463
- agca_POST(url, {"_agca_activate_template":template},
464
- function(data){
465
- window.location = 'tools.php?page=ag-custom-admin/plugin.php';
466
- },
467
- function(){
468
- console.log('AGCA Error: agca_activateTemplate()');
469
- });
470
- }
471
- });
472
- }
473
-
474
- function agca_removeAllTemplates(){
475
- agcaDebug('FN:agca_removeAllTemplates()');
476
- yesnoPopup("Confirm","All installed themes will be uninstalled completely. You would need to re-activate your purchased themes with valid license keys in order to install them again. Are you sure?",agca_removeAllTemplatesConfirmed);
477
- }
478
-
479
- function agca_removeAllTemplatesConfirmed(){
480
- agcaDebug('FN:agca_removeAllTemplatesConfirmed()');
481
- agcaProgress('Removing all themes... Please wait...');
482
- window.setTimeout(function(){
483
- window.location = 'tools.php?page=ag-custom-admin/plugin.php&agca_action=remove_templates';
484
- },2000);
485
- }
486
-
487
- function handleLocalyStoredImages(){
488
- agcaDebug('FN:handleLocalyStoredImages()');
489
- agcaDebug(jQuery("#templates_data").val());
490
- var originalText = jQuery("#templates_data").val();
491
- var serializedImages = "";
492
- for(var tag in agca_local_images){
493
- if(tag != ""){
494
- if(serializedImages !=""){
495
- serializedImages+=",";
496
- }
497
- serializedImages+=agca_local_images[tag];
498
- originalText = originalText.replace(new RegExp(tag, 'g'), agca_local_images[tag]);
499
- }
500
- }
501
- jQuery("#templates_data").val(originalText+"|||"+serializedImages);
502
- //console.log(jQuery("#templates_data").val());
503
-
504
- //SAVE FINALY
505
- jQuery("#agca_templates_form").submit();
506
- }
507
-
508
- function agca_updateInstallProgress(){
509
- agcaDebug('FN:agca_updateInstallProgress()');
510
- agca_local_images_count++;
511
- var current = agca_remote_images_count - agca_local_images_count;
512
- var proc= (agca_local_images_count / (parseInt(agca_remote_images_count)-1)).toFixed(2) * 100;
513
-
514
- agcaProgress('Installing ('+proc+'%) ...');
515
- }
516
- function agca_removeTemplateImages(template_name, callBack){
517
- agcaDebug('FN:agca_removeTemplateImages()');
518
- var url = window.location;
519
- agca_POST(url,{"_agca_remove_template_images":template_name},
520
- function(data){
521
- console.log(data);
522
- if(callBack != null){
523
- callBack();
524
- }
525
- },
526
- function(e){
527
- console.log('AGCA Error: agca_removeTemplateImages()');
528
- console.log(e);
529
- if(callBack != null){
530
- callBack();
531
- }
532
- });
533
- }
534
- function agca_startUploadingRemoteImages(){
535
- agcaDebug('FN:agca_startUploadingRemoteImages()');
536
-
537
- //agcaDebug('templates data');
538
- //agcaDebug(jQuery("#templates_data").val());
539
- //upload remote images on callback
540
- if(typeof agca_remote_images != 'undefined'){
541
- agca_uploadRemoteImages();
542
- }else{
543
- jQuery("#templates_data").val(jQuery("#templates_data").val()+"|||");
544
-
545
- //SAVE FINALY PAYED
546
- jQuery("#agca_templates_form").submit();
547
- }
548
- }
549
-
550
- function agca_uploadRemoteImages(){
551
- agcaDebug('FN:agca_uploadRemoteImages()');
552
- var found = false;
553
- for(var tag in agca_remote_images){
554
- found = true;
555
- agca_updateInstallProgress();
556
- agca_uploadRemoteImage(agca_remote_images[tag], tag);
557
- break;
558
- }
559
- if(!found){
560
- //jQuery('.agca_content #activating').text('Installation successful. Reloading...');
561
- agcaProgress('Installation successful. Reloading...');
562
- window.setTimeout(handleLocalyStoredImages,2000);
563
- }
564
- }
565
-
566
- function agca_uploadRemoteImage(remoteUrl, tag){
567
- agcaDebug('FN:agca_uploadRemoteImage('+remoteUrl+', '+tag+')');
568
- var url = window.location;
569
- agca_POST(url,{"_agca_upload_image":remoteUrl},
570
- function(data){
571
- console.log(data);
572
- agca_local_images[tag] = data;
573
- delete agca_remote_images[tag];
574
- agca_uploadRemoteImages();
575
- //window.location = 'tools.php?page=ag-custom-admin/plugin.php';
576
- },
577
- function(){
578
- console.log('AGCA Error: agca_activateTemplate()');
579
- });
580
- }
581
-
582
- function agca_getLocalTemplates(){
583
- agcaDebug("FN:agca_getLocalTemplates()");
584
- var url = window.location;
585
- agca_POST(url,{"_agca_get_templates":true},
586
- function(data){
587
- try{
588
- templates_installed = JSON.parse(data);
589
- }catch(e){
590
- templates_installed = [];
591
- };
592
- //agca_getTemplates();
593
- agca_getConfiguration();
594
- },
595
- function(){
596
- console.log('AGCA Error: agca_getLocalTemplates()');
597
- });
598
- }
599
- function agca_error(data){
600
- agcaDebug("FN:agca_error()");
601
- clearTimeout(agcaLoadingTimeOut);
602
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
603
- jQuery('#agca_templates p:first').text('Unable to load themes. Please submit this error to AGCA support. Thank you!');
604
- }
605
- alert('AG CUSTOM ADMIN TEMPLATE - ERROR\n\nError occured while loading configuration:\n'+data.url+'\n\n'+data.data);
606
- }
607
-
608
- //check if templates loaded
609
- function checkIfTemplatesAreLoaded(pass){
610
- agcaDebug('FN:checkIfTemplatesAreLoaded('+pass+')');
611
- if(pass == 1){
612
- agcaLoadingTimeOut = window.setTimeout(function(){
613
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
614
- jQuery('#agca_templates p:first').text('Loading, please wait...');
615
- checkIfTemplatesAreLoaded(2);
616
- }
617
- },6000);
618
-
619
- }else if(pass == 2){
620
- agcaLoadingTimeOut = window.setTimeout(function(){
621
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
622
- jQuery('#agca_templates p:first').text('Ready in a few moments...');
623
- checkIfTemplatesAreLoaded(3);
624
- }
625
- },6000);
626
-
627
- }
628
- else if(pass == 3){
629
- agcaLoadingTimeOut = window.setTimeout(function(){
630
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
631
- jQuery('#agca_templates p:first').text('This takes a bit longer than usual, please wait...');
632
- checkIfTemplatesAreLoaded(4);
633
- }
634
- },7000);
635
- }
636
- else if(pass == 4){
637
- agcaLoadingTimeOut = window.setTimeout(function(){
638
- if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
639
- jQuery('#agca_templates p:first').html('Sorry, unable to load themes right now. Please try again later.');
640
- agcaDebug('ERR:Unable to load themes');
641
- }
642
- },10000);
643
- }
644
- }
645
-
646
- function agcaTemplatesSessionIsLicenseSet(template){
647
- agcaDebug("FN:agcaTemplatesSessionIsLicenseSet(" + template + ")");
648
- if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]["license"] != null){
649
- return true;
650
- }
651
- return false;
652
- }
653
-
654
- function agcaTemplatesSessionGetLicenseKey(template){
655
- agcaDebug("FN:agcaTemplatesSessionGetLicenseKey(" + template + ")");
656
- if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]["license"] != null){
657
- return agcaTemplatesSession[template]["license"];
658
- }
659
- return "";
660
- }
661
-
662
- function agcaTemplatesSessionAdd(template, license, callback){
663
- agcaDebug("FN:agcaTemplatesSessionAdd(" + template + ", " + license + ", callback)");
664
- if(callback == null){
665
- callback = function(data){
666
- };
667
- }
668
- agcaTemplatesSession[template] = {};
669
- agcaTemplatesSession[template]["license"] = license;
670
- agca_POST(window.location, {
671
- "_agca_templates_session" : "true",
672
- "template":template,
673
- "license":license
674
- }, callback);
675
- }
676
-
677
- function agcaTemplatesSessionRemove(template, callback){
678
- agcaDebug("FN:agcaTemplatesSessionRemove(" + template + ", callback)");
679
- if(callback == null){
680
- callback = function(){};
681
- }
682
- agcaTemplatesSession[template]["license"] = null;
683
- agca_POST(window.location,{
684
- "_agca_templates_session_remove_license" : "true",
685
- "template":template
686
- }, callback);
687
- }
688
-
689
- function agca_POST(url, data, onSuccess, onError){
690
- data['_agca_token'] = jQuery('[name=_agca_token]').val();
691
- data['_wp_http_referer'] = jQuery('[name=_wp_http_referer]').val();
692
- jQuery.post(url, data,
693
- function(data){
694
- if(onSuccess){
695
- onSuccess(data);
696
- }
697
- })
698
- .fail(
699
- function(a,b,c){
700
- if(onError){
701
- onError(a,b,c);
702
- }
703
- });
704
- }
705
-
706
-
707
- /*FAQ: Invalid template license key: reopen browser and add key again,
708
- Wrong or expired license key. You can still use your template, but updates are not available any more.(1): reopen broeser
709
- */
710
-
711
- /*countdown*/
712
- function agcaCountDownTimer(now, expire, id)
713
- {
714
- var _second = 1;
715
- var _minute = _second * 60;
716
- var _hour = _minute * 60;
717
- var _day = _hour * 24;
718
- var _year = _day * 365;
719
-
720
- var nowParts = now.split('-');
721
- var expireParts = expire.split('-');
722
- var timer;
723
- var diff = expire - now;
724
-
725
- function showRemaining(df) {
726
- diff = diff-1;
727
- //console.log(diff);
728
-
729
- var days = Math.floor((diff % _year) / _day);
730
- var hours = Math.floor((diff % _day) / _hour);
731
- var minutes = Math.floor((diff % _hour) / _minute);
732
- var seconds = Math.floor((diff % _minute) / _second);
733
- var str = days +"d " + hours +"h "+ minutes +"min "+ seconds+"sec";
734
- jQuery(id+" .countdown").html("Available only for:</br>" + str);
735
- if (diff < 0) {
736
- clearInterval(timer);
737
- jQuery(id+" .countdown").html("</br>About to expire...");
738
- return;
739
- }
740
- }
741
- timer = setInterval(function(){
742
- showRemaining(diff);
743
- }, 1000);
744
  }
1
+ var isAGCAPage = true;
2
+ var template_name = "";
3
+ var templates_installed = [];
4
+ var xhr =null;
5
+ var agcaLoadingTimeOut = null;
6
+
7
+ function agca_getTemplateCallback(data){
8
+ agcaDebug('FN:agca_getTemplateCallback()');
9
+ agcaDebug(JSON.stringify(data));
10
+ if(data.success == 0){
11
+ //alert(data.data);
12
+ agcaInfoMessage("Error",data.data);
13
+ jQuery('#agca_template_popup').hide();
14
+ }else{
15
+ jQuery("#templates_name").val(template_name);
16
+ var parts = data.data.split("||||");
17
+ jQuery("#templates_data").val(parts[1]);
18
+ //console.log(jQuery("#templates_data").val());
19
+ jQuery("body").append(parts[0]);
20
+
21
+ //load settings
22
+ agca_loadTemplateSettingsInitial(template_name);
23
+ }
24
+ }
25
+
26
+ function agca_getTemplateByLicenseKeyCallback(data){
27
+ agcaDebug('FN:agca_getTemplateByLicenseKeyCallback()');
28
+ agcaDebug(JSON.stringify(data));
29
+ if(data.success == 0){
30
+ agcaInfoMessage("Error",data.data);
31
+ }else{
32
+ if(data.data.length < 100){
33
+ template_selected = data.data;
34
+ var key = agcaTemplatesSessionGetLicenseKey(template_selected);
35
+ agcaProgress('Loading theme... Please wait...');
36
+ agca_getTemplate(template_selected,key);
37
+ }else{
38
+ agcaDebug("Uknown theme name" + data.data);
39
+ }
40
+
41
+ }
42
+ }
43
+
44
+ function agca_getTemplatesCallback(data){
45
+ agcaDebug('FN:agca_getTemplatesCallback()');
46
+ if(data.data == "CDbException"){
47
+ data.data = "Service is temporary to busy. Please reload the page or try again later.";
48
+ agcaDebugObj(data);
49
+ }else if(data.data == "PHP Error"){
50
+ data.data = "Error occurred on the server.";
51
+ agcaDebugObj(data);
52
+ }
53
+ jQuery('#agca_templates').html(data.data);
54
+ jQuery('#advanced_template_options').show();
55
+ jQuery("#agca_installed_templates .template img").each(agcaApplyTooltip);
56
+ jQuery("#agca_loaded_templates .template img").each(agcaApplyTooltip);
57
+ jQuery('#advanced_template_options a').each(agcaApplyTooltip);
58
+ }
59
+ function agca_client_init(){
60
+ agcaDebug('FN:agca_client_init()');
61
+ agca_getLocalTemplates();
62
+ checkIfTemplatesAreLoaded(1);
63
+ jQuery('#agca_templates').html('<p class="initialLoader" style="font-size:18px;color:gray;font-style:italic">Loading themes...</p>');
64
+ }
65
+
66
+ function agca_setupXHR(){
67
+ agcaDebug('FN:agca_setupXHR()');
68
+ if(xhr != null) return false;
69
+ xhr = new easyXDM.Rpc({
70
+ remote:templates_ep
71
+ //onReady: function () { alert('ready'); }
72
+ }, {
73
+ remote: {
74
+ request: {
75
+ }
76
+ },
77
+ handle: function(data, send){
78
+ if(data.success){
79
+ var callbackFname = data.url.split('callback=')[1];
80
+ var fn = window[callbackFname];
81
+ if(fn != undefined){
82
+ fn(data);
83
+ }
84
+ }else{ console.log('errr');
85
+ console.log(data.url);
86
+ var url = data.url;
87
+ if(url !== undefined && url != ""){
88
+ var cb = url.split('callback=')[1];
89
+ if(cb != ""){
90
+ var fn = window[cb];
91
+ if(fn != undefined){
92
+ fn(data);
93
+ }
94
+ }
95
+ }else{
96
+ printInitialAGCAError("Please update your browser in order to view AG Custom Admin themes.");
97
+ }
98
+ }
99
+ }
100
+ });
101
+ }
102
+
103
+ function agca_getTemplates(){
104
+ agcaDebug('FN:agca_getTemplates()');
105
+ //agca_uploadRemoteImage('http://www.neowing.co.jp/idol_site2/image/FDGD-21/fdgd-21-top.jpg');
106
+ agca_setupXHR();
107
+ if(typeof agca_active_template_version === 'undefined'){
108
+ agca_active_template_version = "";
109
+ }
110
+
111
+ xhr.request({
112
+ url: templates_ep + "service/client" + "&callback=agca_getTemplatesCallback",
113
+ method: "POST",
114
+ callBack: agca_getTemplatesCallback,
115
+ data: {isPost:true, wpv:wpversion, agcav:agca_version,selected:template_selected,installed:agca_installed_templates,template_version:agca_active_template_version}
116
+ });
117
+ }
118
+
119
+ function agca_getConfiguration(){
120
+ agcaDebug('FN:agca_getConfiguration()');
121
+ /*xhr.request({
122
+ url: templates_ep + "/configuration" + "?callback=agca_getConfigurationCallback",
123
+ method: "POST",
124
+ callBack: agca_getConfigurationCallback,
125
+ data: {isPost:true}
126
+ });*/
127
+ jQuery.getJSON(templates_ep + "?callback=?",
128
+ function(data){
129
+ console.log("EP:"+data.ep);
130
+ templates_ep = data.ep;
131
+ if(data.error !=""){
132
+ printInitialAGCAError(data.error);
133
+ }else{
134
+ agca_getTemplates();
135
+ }
136
+ }
137
+ ).error(function(jqXHR, textStatus, errorThrown) {
138
+ agca_error({url:templates_ep,data:textStatus + " " + jqXHR.responseText});
139
+ /*console.log("error " + textStatus);
140
+ console.log("incoming Text " + jqXHR.responseText);*/
141
+ });
142
+ }
143
+
144
+ function printInitialAGCAError(err){
145
+ jQuery('#agca_templates p.initialLoader').html(err);
146
+ jQuery('#agca_templates p').removeClass('initialLoader');
147
+ clearTimeout(agcaLoadingTimeOut);
148
+ }
149
+
150
+ function agca_getTemplate(template, key){
151
+ agcaDebug('FN:agca_getTemplate()');
152
+ template_name = template;
153
+ if(!agcaTemplatesSessionIsLicenseSet(template)){
154
+ agcaTemplatesSessionAdd(template, key);
155
+ }
156
+ xhr.request({
157
+ url: templates_ep + "service/gettemplate"+"&tmpl="+template+"&key="+key+"&callback=agca_getTemplateCallback",
158
+ method: "POST",
159
+ callBack: agca_getTemplateCallback,
160
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
161
+ });
162
+ }
163
+
164
+ function agca_getTemplateByLicenseKey(key){
165
+ agcaDebug('FN:agca_getTemplateByLicenseKey('+key+')');
166
+ //template_name = template;
167
+ xhr.request({
168
+ url: templates_ep + "service/gettemplatebylk"+"&tmpl=&key="+key+"&callback=agca_getTemplateByLicenseKeyCallback",
169
+ method: "POST",
170
+ callBack: agca_getTemplateByLicenseKeyCallback,
171
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
172
+ });
173
+ }
174
+
175
+ function agca_loadTemplateSettingsInitial(template){
176
+ agcaDebug('FN:agca_loadTemplateSettingsInitial()');
177
+ agca_loadTemplateSettingsCore(template, true);
178
+ }
179
+
180
+ function agca_loadTemplateSettings(template){
181
+ agcaDebug('FN:agca_loadTemplateSettings()');
182
+ agca_loadTemplateSettingsCore(template, false);
183
+ }
184
+
185
+ function agca_loadTemplateSettingsCore(template, isInitial){
186
+ agcaDebug('FN:agca_loadTemplateSettingsCore()');
187
+ template_name = template;
188
+ template_selected = template;
189
+
190
+ var licenseKey = "";
191
+ if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]['license'] != null){
192
+ licenseKey = agcaTemplatesSession[template]['license'];
193
+ }
194
+
195
+ var calb = agca_getTemplateSettingsCallback;
196
+ var calbName = "agca_getTemplateSettingsCallback";
197
+
198
+ if(isInitial){
199
+ agcaProgress("Loading theme settings...");
200
+ calb = agca_getTemplateSettingsInitialCallback;
201
+ calbName = "agca_getTemplateSettingsInitialCallback";
202
+ }
203
+ xhr.request({
204
+ url: templates_ep + "service/gettemplatesettings"+"&tmpl="+template+"&key="+licenseKey+"&callback="+calbName,
205
+ method: "POST",
206
+ callBack: calb,
207
+ data: {isPost:true, wpv:wpversion, agcav:agca_version}
208
+ });
209
+ //alert('saving template settings for template:' + template_name);
210
+ }
211
+
212
+ function agca_getTemplateSettingsInitialCallback(data){
213
+ agcaDebug('FN:agca_getTemplateSettingsInitialCallback()');
214
+ agcaDebug(JSON.stringify(data));
215
+ if(data.success == 0){
216
+ agcaInfoMessage("Error",data.data);
217
+ //TODO - what if template is loaded, but settings are not?
218
+ console.log('ERR:theme settings are not loaded');
219
+ }else{
220
+ var settings = "";
221
+ var filteredSettings = {};
222
+ try{
223
+ settings = JSON.parse(data.data);
224
+ if(settings.length == 0){
225
+ }else{
226
+ for(var ind in settings){
227
+ var type = settings[ind].type;
228
+ var text = "";
229
+ var defaultValue = "";
230
+ var newItem = {};
231
+ newItem.code = settings[ind].name;
232
+ newItem.type = settings[ind].type;
233
+ newItem.value = settings[ind].value;
234
+ newItem.default_value = settings[ind].default_value;
235
+ filteredSettings[ind] = newItem;
236
+ }
237
+ agcaDebug("Selected theme:" + template_selected);
238
+ console.log(filteredSettings);
239
+
240
+ }
241
+ }catch(e){
242
+ console.log('Error while loading settings');
243
+ console.log(e);
244
+ }
245
+ agca_saveTemplateSettingsInitial(template_selected, filteredSettings);
246
+ }
247
+ }
248
+ /*template settings - load them to UI popup window*/
249
+ function agca_getTemplateSettingsCallback(data){
250
+ agcaDebug('FN:agca_getTemplateSettingsCallback()');
251
+ //console.log(data.data);
252
+
253
+ if(data.success == 0){
254
+ agcaTemplatesSessionRemove(template_selected);
255
+ //alert(data.data);
256
+ jQuery('#agca_template_settings .agca_loader').html(data.data);
257
+ }else{
258
+
259
+ var settings = "";
260
+ try{
261
+ if(data.data.substring(0, "Exception:".length) === "Exception:"){
262
+ var errr= data.data.substr(10);
263
+ jQuery('#agca_template_settings .agca_loader').html(errr);
264
+ return false;
265
+ }
266
+ settings = JSON.parse(data.data);
267
+ if(settings.length == 0){
268
+ jQuery('#agca_template_settings .agca_loader').html("Additional settings are not available for this theme");
269
+ }else{
270
+ jQuery('#agca_template_settings .agca_loader').hide();
271
+ jQuery('#agca_save_template_settings').show();
272
+
273
+ var currentSettings = (agca_template_settings != null && agca_template_settings != undefined)?agca_template_settings:{};
274
+
275
+ //TODO: Change to use object name code object[code], instead of number object[i]
276
+ for(var ind in settings){
277
+ var type = settings[ind].type;
278
+ var text = "";
279
+ //console.log(settings[ind]);
280
+ var currentValue = "";
281
+
282
+ //get previously saved value
283
+ for(var ind2 in currentSettings){
284
+ if(currentSettings[ind2]!= null && currentSettings[ind2].code == settings[ind].name){
285
+ currentValue = currentSettings[ind2].value;
286
+ }
287
+ }
288
+
289
+ //if current value is still not defined, use default value
290
+ if(currentValue == ""){
291
+ currentValue = settings[ind].default_value;
292
+ }
293
+ /*text*/
294
+ if(type==1){
295
+ text = "<p>"+settings[ind].title+"</p><input type=\"text\" name=\"agcats_"+settings[ind].name+"\" value=\""+currentValue+"\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" class=\"setting\" stype=\"1\" /></br>";
296
+ }else if(type==2){
297
+ text = "<p>"+settings[ind].title+"</p><textarea name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"2\" >"+currentValue+"</textarea></br>";
298
+ }else if(type==3){
299
+ text = "<p>"+settings[ind].title+"</p><select name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"3\" >";
300
+ var options = settings[ind].default_value.split(',');
301
+ for(var indopt in options){
302
+ var sel = "";
303
+ if(currentValue == options[indopt]){
304
+ sel = " selected=\"selected\" ";
305
+ }
306
+ text+="<option value="+options[indopt]+" "+sel+">"+options[indopt]+"</option>";
307
+ }
308
+ text+="</select>";
309
+ }else if(type==4){
310
+ text = "<p>"+settings[ind].title+"</p><div class=\"agca_form_0100_div\"><input value=\""+currentValue+"\" type=\"text\" name=\"agcats_"+settings[ind].name+"\" class=\"setting agca_form_0100\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"4\" /><input type=\"button\" name=\"agca_form_decr\" class=\"agca_form_decr\" value=\"-\"/><input type=\"button\" name=\"agca_form_incr\" class=\"agca_form_incr\" value=\"+\"/>&nbsp;(0-100)</div></br>";
311
+ }else if(type==6){
312
+ if(currentValue == true){
313
+ currentValue =" checked=\"checked\" ";
314
+ }else{
315
+ currentValue="";
316
+ }
317
+ text = "<p>"+settings[ind].title+"</p><input type=\"checkbox\" name=\"agcats_"+settings[ind].name+"\" class=\"setting\" default_value=\""+settings[ind].default_value+"\" code=\""+settings[ind].name+"\" stype=\"6\" "+currentValue+" /></br>";
318
+ }else if(type==7){
319
+ text = "<p>"+settings[ind].title+"</p><div name=\"agcats_"+settings[ind].name+"\" class=\"setting\" code=\""+settings[ind].name+"\" default_value=\""+settings[ind].default_value+"\" stype=\"7\" style=\"padding-left: 10px;color:white;\">";
320
+ var options = settings[ind].default_value.split(',');
321
+ for(var indopt in options){
322
+ var sel = "";
323
+ if(currentValue == options[indopt]){
324
+ sel = " checked ";
325
+ }
326
+ text+="<input name=\"agcats_"+settings[ind].name+"_val\" style=\"margin-right:6px;\" type=\"radio\" value="+options[indopt]+" "+sel+" name=\"sd\"/>"+options[indopt]+"</br>";
327
+ }
328
+ text+="</div>";
329
+ }
330
+ jQuery('#agca_template_settings').append(text);
331
+
332
+ //TODO: do similar to options above, clean a code up a litle bit, add them dinamicaly all attributes instead of inline adding
333
+ jQuery('.agca_form_0100_div .agca_form_decr').click(function(){
334
+ var val =jQuery(this).parent().find('.agca_form_0100').val();
335
+ val = parseInt(val.replace(/\D/g,''));//leave only numbers
336
+ if(isNaN(val)) val =0;
337
+ val--;
338
+ if(val < 0)val =0;
339
+ if(val > 100)val=100;
340
+ jQuery(this).parent().find('.agca_form_0100').val(val);
341
+ });
342
+ jQuery('.agca_form_0100_div .agca_form_incr').click(function(){
343
+ var val =jQuery(this).parent().find('.agca_form_0100').val();
344
+ val = parseInt(val.replace(/\D/g,''));//leave only numbers
345
+ if(isNaN(val)) val =0;
346
+ val++;
347
+ if(val < 0)val =0;
348
+ if(val > 100)val=100;
349
+ jQuery(this).parent().find('.agca_form_0100').val(val);
350
+ });
351
+ jQuery('.agca_form_0100').keyup(function(){
352
+
353
+ var val =jQuery(this).val();
354
+ val = parseInt(val.replace(/\D/g,''));//leave only numbers
355
+ if(val < 0 || isNaN(val))val =0;
356
+ if(val > 100)val=100;
357
+
358
+ jQuery(this).val(val);
359
+
360
+ });
361
+ }
362
+ }
363
+ }catch(e){
364
+ console.log(e);
365
+ }
366
+ }
367
+ //alert('callb');
368
+ }
369
+
370
+ function agca_saveTemplateSettingsInitial(template, settings){
371
+ agcaDebug('FN:agca_saveTemplateSettingsInitial()');
372
+ var originalText = jQuery("#templates_data").val();
373
+ jQuery("#templates_data").val(originalText+"|||"+JSON.stringify(settings));
374
+ agca_removeTemplateImages(template, agca_startUploadingRemoteImages);
375
+ }
376
+
377
+ function agca_saveTemplateSettingsFromForm(template){
378
+ agcaDebug('FN:agca_saveTemplateSettingsFromForm()');
379
+ template_name = template;
380
+
381
+ //get settings from the form
382
+ var settings = {};
383
+
384
+ jQuery('#agca_template_settings .setting').each(function(ind){
385
+ var setting_typ = jQuery(this).attr('stype');
386
+ var setting_val = jQuery(this).val();
387
+ var setting_cod = jQuery(this).attr('code');
388
+ var setting_def = jQuery(this).attr('default_value');
389
+
390
+ if(jQuery(this).attr('type')=="checkbox"){
391
+ setting_val = jQuery(this).is(':checked');
392
+ }
393
+
394
+ //radio
395
+ if(setting_typ == "7"){
396
+ setting_val = jQuery('input[name="agcats_'+setting_cod+'_val"]:checked').val();
397
+ }
398
+
399
+ settings[ind] = {
400
+ type: setting_typ,
401
+ value: setting_val,
402
+ code: setting_cod,
403
+ default_value: setting_def
404
+ };
405
+
406
+ });
407
+
408
+ jQuery('#agca_template_settings').html("<p>Applying theme settings...</p>");
409
+ agca_saveTemplateSettingsCore(template, settings, function(data){
410
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
411
+ });
412
+ }
413
+
414
+
415
+ function agca_saveTemplateSettingsCore(template, settings, callback){
416
+ agcaDebug('FN:agca_saveTemplateSettingsCore()');
417
+ var url = window.location;
418
+ agca_POST(url,{"_agca_template_settings": JSON.stringify(settings),"_agca_current_template":template},
419
+ callback,
420
+ function(){
421
+ console.log('AGCA Error: agca_saveTemplateSettingsCore()');
422
+ }
423
+ );
424
+ }
425
+
426
+ /*function agca_saveTemplateSettingsCore(template, settings){
427
+ var settings = {};
428
+ var url = window.location;
429
+ jQuery.post(url,{"_agca_template_settings":settings,"_agca_current_template":template},
430
+ function(data){
431
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
432
+ //console.log('reload');
433
+ })
434
+ .fail(
435
+ function(){
436
+ console.log('AGCA Error: agca_saveTemplateSettingsCore()');
437
+ });
438
+ }*/
439
+
440
+ function agca_activateTemplate(template){
441
+ /*if(template_selected == ""){
442
+ alert('There are no active templates to deactivate.');
443
+ return false;
444
+ };*/
445
+ if(template == ""){
446
+ agcaProgress('Deactivating theme... Please wait...');
447
+ }else{
448
+ agcaProgress('Activating theme... Please wait...');
449
+ }
450
+
451
+ agcaDebug('FN:agca_activateTemplate('+template+')');
452
+ jQuery('input[name=agca_colorizer_turnonoff]').val("off");
453
+
454
+ //ajax submit form
455
+ var frm = jQuery('#agca_form');
456
+ var data = frm.serialize();
457
+ jQuery.ajax({
458
+ type: frm.attr('method'),
459
+ url: frm.attr('action'),
460
+ data: data,
461
+ success: function (data) {
462
+ var url = window.location;
463
+ agca_POST(url, {"_agca_activate_template":template},
464
+ function(data){
465
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php';
466
+ },
467
+ function(){
468
+ console.log('AGCA Error: agca_activateTemplate()');
469
+ });
470
+ }
471
+ });
472
+ }
473
+
474
+ function agca_removeAllTemplates(){
475
+ agcaDebug('FN:agca_removeAllTemplates()');
476
+ yesnoPopup("Confirm","All installed themes will be uninstalled completely. You would need to re-activate your purchased themes with valid license keys in order to install them again. Are you sure?",agca_removeAllTemplatesConfirmed);
477
+ }
478
+
479
+ function agca_removeAllTemplatesConfirmed(){
480
+ agcaDebug('FN:agca_removeAllTemplatesConfirmed()');
481
+ agcaProgress('Removing all themes... Please wait...');
482
+ window.setTimeout(function(){
483
+ window.location = 'tools.php?page=ag-custom-admin/plugin.php&agca_action=remove_templates';
484
+ },2000);
485
+ }
486
+
487
+ function handleLocalyStoredImages(){
488
+ agcaDebug('FN:handleLocalyStoredImages()');
489
+ agcaDebug(jQuery("#templates_data").val());
490
+ var originalText = jQuery("#templates_data").val();
491
+ var serializedImages = "";
492
+ for(var tag in agca_local_images){
493
+ if(tag != ""){
494
+ if(serializedImages !=""){
495
+ serializedImages+=",";
496
+ }
497
+ serializedImages+=agca_local_images[tag];
498
+ originalText = originalText.replace(new RegExp(tag, 'g'), agca_local_images[tag]);
499
+ }
500
+ }
501
+ jQuery("#templates_data").val(originalText+"|||"+serializedImages);
502
+ //console.log(jQuery("#templates_data").val());
503
+
504
+ //SAVE FINALY
505
+ jQuery("#agca_templates_form").submit();
506
+ }
507
+
508
+ function agca_updateInstallProgress(){
509
+ agcaDebug('FN:agca_updateInstallProgress()');
510
+ agca_local_images_count++;
511
+ var current = agca_remote_images_count - agca_local_images_count;
512
+ var proc= (agca_local_images_count / (parseInt(agca_remote_images_count)-1)).toFixed(2) * 100;
513
+
514
+ agcaProgress('Installing ('+proc+'%) ...');
515
+ }
516
+ function agca_removeTemplateImages(template_name, callBack){
517
+ agcaDebug('FN:agca_removeTemplateImages()');
518
+ var url = window.location;
519
+ agca_POST(url,{"_agca_remove_template_images":template_name},
520
+ function(data){
521
+ console.log(data);
522
+ if(callBack != null){
523
+ callBack();
524
+ }
525
+ },
526
+ function(e){
527
+ console.log('AGCA Error: agca_removeTemplateImages()');
528
+ console.log(e);
529
+ if(callBack != null){
530
+ callBack();
531
+ }
532
+ });
533
+ }
534
+ function agca_startUploadingRemoteImages(){
535
+ agcaDebug('FN:agca_startUploadingRemoteImages()');
536
+
537
+ //agcaDebug('templates data');
538
+ //agcaDebug(jQuery("#templates_data").val());
539
+ //upload remote images on callback
540
+ if(typeof agca_remote_images != 'undefined'){
541
+ agca_uploadRemoteImages();
542
+ }else{
543
+ jQuery("#templates_data").val(jQuery("#templates_data").val()+"|||");
544
+
545
+ //SAVE FINALY PAYED
546
+ jQuery("#agca_templates_form").submit();
547
+ }
548
+ }
549
+
550
+ function agca_uploadRemoteImages(){
551
+ agcaDebug('FN:agca_uploadRemoteImages()');
552
+ var found = false;
553
+ for(var tag in agca_remote_images){
554
+ found = true;
555
+ agca_updateInstallProgress();
556
+ agca_uploadRemoteImage(agca_remote_images[tag], tag);
557
+ break;
558
+ }
559
+ if(!found){
560
+ //jQuery('.agca_content #activating').text('Installation successful. Reloading...');
561
+ agcaProgress('Installation successful. Reloading...');
562
+ window.setTimeout(handleLocalyStoredImages,2000);
563
+ }
564
+ }
565
+
566
+ function agca_uploadRemoteImage(remoteUrl, tag){
567
+ agcaDebug('FN:agca_uploadRemoteImage('+remoteUrl+', '+tag+')');
568
+ var url = window.location;
569
+ agca_POST(url,{"_agca_upload_image":remoteUrl},
570
+ function(data){
571
+ console.log(data);
572
+ agca_local_images[tag] = data;
573
+ delete agca_remote_images[tag];
574
+ agca_uploadRemoteImages();
575
+ //window.location = 'tools.php?page=ag-custom-admin/plugin.php';
576
+ },
577
+ function(){
578
+ console.log('AGCA Error: agca_activateTemplate()');
579
+ });
580
+ }
581
+
582
+ function agca_getLocalTemplates(){
583
+ agcaDebug("FN:agca_getLocalTemplates()");
584
+ var url = window.location;
585
+ agca_POST(url,{"_agca_get_templates":true},
586
+ function(data){
587
+ try{
588
+ templates_installed = JSON.parse(data);
589
+ }catch(e){
590
+ templates_installed = [];
591
+ };
592
+ //agca_getTemplates();
593
+ agca_getConfiguration();
594
+ },
595
+ function(){
596
+ console.log('AGCA Error: agca_getLocalTemplates()');
597
+ });
598
+ }
599
+ function agca_error(data){
600
+ agcaDebug("FN:agca_error()");
601
+ clearTimeout(agcaLoadingTimeOut);
602
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
603
+ jQuery('#agca_templates p:first').text('Unable to load themes. Please submit this error to AGCA support. Thank you!');
604
+ }
605
+ alert('AG CUSTOM ADMIN TEMPLATE - ERROR\n\nError occured while loading configuration:\n'+data.url+'\n\n'+data.data);
606
+ }
607
+
608
+ //check if templates loaded
609
+ function checkIfTemplatesAreLoaded(pass){
610
+ agcaDebug('FN:checkIfTemplatesAreLoaded('+pass+')');
611
+ if(pass == 1){
612
+ agcaLoadingTimeOut = window.setTimeout(function(){
613
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
614
+ jQuery('#agca_templates p:first').text('Loading, please wait...');
615
+ checkIfTemplatesAreLoaded(2);
616
+ }
617
+ },6000);
618
+
619
+ }else if(pass == 2){
620
+ agcaLoadingTimeOut = window.setTimeout(function(){
621
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
622
+ jQuery('#agca_templates p:first').text('Ready in a few moments...');
623
+ checkIfTemplatesAreLoaded(3);
624
+ }
625
+ },6000);
626
+
627
+ }
628
+ else if(pass == 3){
629
+ agcaLoadingTimeOut = window.setTimeout(function(){
630
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
631
+ jQuery('#agca_templates p:first').text('This takes a bit longer than usual, please wait...');
632
+ checkIfTemplatesAreLoaded(4);
633
+ }
634
+ },7000);
635
+ }
636
+ else if(pass == 4){
637
+ agcaLoadingTimeOut = window.setTimeout(function(){
638
+ if(jQuery('#agca_templates p:first').hasClass('initialLoader')){
639
+ jQuery('#agca_templates p:first').html('Sorry, unable to load themes right now. Please try again later.');
640
+ agcaDebug('ERR:Unable to load themes');
641
+ }
642
+ },10000);
643
+ }
644
+ }
645
+
646
+ function agcaTemplatesSessionIsLicenseSet(template){
647
+ agcaDebug("FN:agcaTemplatesSessionIsLicenseSet(" + template + ")");
648
+ if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]["license"] != null){
649
+ return true;
650
+ }
651
+ return false;
652
+ }
653
+
654
+ function agcaTemplatesSessionGetLicenseKey(template){
655
+ agcaDebug("FN:agcaTemplatesSessionGetLicenseKey(" + template + ")");
656
+ if(agcaTemplatesSession[template] != null && agcaTemplatesSession[template]["license"] != null){
657
+ return agcaTemplatesSession[template]["license"];
658
+ }
659
+ return "";
660
+ }
661
+
662
+ function agcaTemplatesSessionAdd(template, license, callback){
663
+ agcaDebug("FN:agcaTemplatesSessionAdd(" + template + ", " + license + ", callback)");
664
+ if(callback == null){
665
+ callback = function(data){
666
+ };
667
+ }
668
+ agcaTemplatesSession[template] = {};
669
+ agcaTemplatesSession[template]["license"] = license;
670
+ agca_POST(window.location, {
671
+ "_agca_templates_session" : "true",
672
+ "template":template,
673
+ "license":license
674
+ }, callback);
675
+ }
676
+
677
+ function agcaTemplatesSessionRemove(template, callback){
678
+ agcaDebug("FN:agcaTemplatesSessionRemove(" + template + ", callback)");
679
+ if(callback == null){
680
+ callback = function(){};
681
+ }
682
+ agcaTemplatesSession[template]["license"] = null;
683
+ agca_POST(window.location,{
684
+ "_agca_templates_session_remove_license" : "true",
685
+ "template":template
686
+ }, callback);
687
+ }
688
+
689
+ function agca_POST(url, data, onSuccess, onError){
690
+ data['_agca_token'] = jQuery('[name=_agca_token]').val();
691
+ data['_wp_http_referer'] = jQuery('[name=_wp_http_referer]').val();
692
+ jQuery.post(url, data,
693
+ function(data){
694
+ if(onSuccess){
695
+ onSuccess(data);
696
+ }
697
+ })
698
+ .fail(
699
+ function(a,b,c){
700
+ if(onError){
701
+ onError(a,b,c);
702
+ }
703
+ });
704
+ }
705
+
706
+
707
+ /*FAQ: Invalid template license key: reopen browser and add key again,
708
+ Wrong or expired license key. You can still use your template, but updates are not available any more.(1): reopen broeser
709
+ */
710
+
711
+ /*countdown*/
712
+ function agcaCountDownTimer(now, expire, id)
713
+ {
714
+ var _second = 1;
715
+ var _minute = _second * 60;
716
+ var _hour = _minute * 60;
717
+ var _day = _hour * 24;
718
+ var _year = _day * 365;
719
+
720
+ var nowParts = now.split('-');
721
+ var expireParts = expire.split('-');
722
+ var timer;
723
+ var diff = expire - now;
724
+
725
+ function showRemaining(df) {
726
+ diff = diff-1;
727
+ //console.log(diff);
728
+
729
+ var days = Math.floor((diff % _year) / _day);
730
+ var hours = Math.floor((diff % _day) / _hour);
731
+ var minutes = Math.floor((diff % _hour) / _minute);
732
+ var seconds = Math.floor((diff % _minute) / _second);
733
+ var str = days +"d " + hours +"h "+ minutes +"min "+ seconds+"sec";
734
+ jQuery(id+" .countdown").html("Available only for:</br>" + str);
735
+ if (diff < 0) {
736
+ clearInterval(timer);
737
+ jQuery(id+" .countdown").html("</br>About to expire...");
738
+ return;
739
+ }
740
+ }
741
+ timer = setInterval(function(){
742
+ showRemaining(diff);
743
+ }, 1000);
744
  }
style/ag_style.css CHANGED
@@ -1,880 +1,880 @@
1
- @import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,700');
2
- /*color scheme*/
3
- /*
4
- -main
5
- #ACC491
6
- #DEF7C3
7
-
8
- -lighter
9
- #eef9d5
10
-
11
- -blue
12
- #005B69
13
- */
14
- .agca-clear {
15
- clear: both;
16
- }
17
-
18
- .agca-tip {
19
- padding-left: 20px;
20
- }
21
-
22
- h1#agca-title {
23
- color: #826c63;
24
- font-weight: bold;
25
- font-size: 30px;
26
- }
27
- h1#agca-title .title{
28
- float:left;
29
- padding: 10px;
30
- font-family: 'Open Sans', sans-serif;
31
- font-weight: 300;
32
- }
33
- h1#agca-title img{
34
- width: 128px;
35
- float: left;
36
- margin-top: -40px;
37
- }
38
- h1#agca-title .version{
39
- font-size: 15px;
40
- margin-top: 12px;
41
- display: inline-block;
42
- }
43
-
44
- table .agca-tip {
45
- padding-left: 10px;
46
- }
47
-
48
- #ag_main_menu {
49
- display: block;
50
- height: 34px;
51
- border-bottom: 3px solid #826c63;
52
- margin-top: 10px;
53
- }
54
- #ag_main_menu li a:hover{
55
- color: #fff;
56
- }
57
- #ag_main_menu li.upgrade{
58
- background-color:#fff;
59
- border-top-right-radius: 10px;
60
- border-bottom: 2px solid #826c63;
61
- }
62
- #ag_main_menu li.upgrade:hover{
63
- background: #fff !important;
64
- }
65
- #ag_main_menu li.upgrade:hover a{
66
- color:#e85e3a;
67
- }
68
- #ag_main_menu li.upgrade a{
69
- color: #826c63;
70
- padding-left: 20px;
71
- font-weight:bolder;
72
- }
73
- #ag_main_menu li.upgrade img{
74
- width: 30px;
75
- position: absolute;
76
- margin-top: -8px;
77
- margin-left: -28px;
78
- }
79
-
80
- .ag_section {
81
- background: transparent;
82
- }
83
-
84
- #agca_form #section-cusmin {
85
- font-size: 15px;
86
- padding: 10px;
87
- border: 2px solid #999;
88
- background: #fff;
89
- margin-bottom: 5px;
90
- border-radius: 6px;
91
- font-weight: bold;
92
- color: #999;
93
- }
94
-
95
-
96
- #ag_main_menu li {
97
- display: block;
98
- background-color: #826c63;
99
- float: left;
100
- color: #fff;
101
- padding: 15px;
102
- padding-top: 8px;
103
- padding-bottom: 8px;
104
- font-weight: bold;
105
- border-bottom: 3px solid #826c63;
106
- }
107
-
108
- #ag_main_menu li.selected {
109
- background-color: #efefef;
110
- color: #826c63;
111
- cursor: default;
112
- }
113
- #ag_main_menu li.selected a{
114
- color: #6d6764;
115
- }
116
-
117
- #ag_main_menu li.normal:hover {
118
- background-color: #6d6764;
119
- cursor: pointer;
120
- }
121
-
122
- #ag_main_menu a:focus {
123
- outline: none;
124
- border: 0;
125
- }
126
-
127
- #ag_main_menu li a {
128
- text-decoration: none;
129
- color: #fff;
130
- outline: none;
131
- border: 0;
132
- }
133
-
134
- .ag_table_heading {
135
- background: none;
136
- display: block;
137
- height: 25px;
138
- padding: 5px;
139
- padding-top: 0px;
140
- padding-bottom: 1px;
141
- margin-top: 20px;
142
- margin-bottom: 24px;
143
- margin-left: -10px;
144
- margin-right: -10px;
145
- }
146
-
147
- .ag_table_heading h3 {
148
- color: #826c63;
149
- background: #efefef;
150
- margin-left: -15px;
151
- padding: 5px 15px;
152
- border: none;
153
- border: 3px #826c63 solid;
154
- border-radius: 6px;
155
- font-size: 15px;
156
- }
157
-
158
- .ag_table_major_options {
159
- background-color: #f9f8f8;
160
- width: 500px;
161
- margin-bottom: 2px;
162
- }
163
-
164
- #agca_form .form-table .ag_table_major_options td {
165
- padding-left: 20px;
166
- }
167
-
168
- div#AGToolTipDiv {
169
- position: absolute;
170
- top: 100px;
171
- left: 200px;
172
- height: auto;
173
- border: 1px solid #FFFF00;
174
- background-color: #efefef;
175
- color: #826c63;
176
- display: none;
177
- padding: 5px 10px;
178
- border-radius: 3px;
179
- }
180
-
181
- td.ag_admin_menu_parent {
182
- font-size: 16px;
183
- font-weight: bold;
184
- }
185
-
186
- td.ag_admin_menu_parent:hover {
187
- background-color: #ddd;
188
- }
189
-
190
- #ag_edit_adminmenu h3 {
191
- color: #ffffff;
192
- }
193
-
194
- #ag_edit_adminmenu tr {
195
- margin: 0;
196
- padding: 0;
197
- background-color: #E8FAE8;
198
- }
199
-
200
- #ag_edit_adminmenu td.ag_admin_menu_child {
201
- margin: 0;
202
- padding: 15px;
203
- padding-top: 0;
204
- padding-bottom: 0;
205
- }
206
-
207
- #ag_edit_adminmenu th h2 {
208
- color: #fff;
209
- }
210
-
211
- #ag_edit_adminmenu a {
212
- text-decoration: none;
213
- color: #444;
214
- }
215
-
216
- .noclass {
217
- display: none;
218
- }
219
-
220
- #agca_footer_support_info {
221
- font-size: 12px;
222
- font-weight: bold;
223
- background: #acc491;
224
- color: #ffffff;
225
- border: none;
226
- padding: 20px;
227
- }
228
-
229
- #agca_footer_support_info a {
230
- color: #005b69;
231
- text-decoration: none;
232
- font-size: 18px;
233
- }
234
-
235
- #agca_news {
236
- height: 20px;
237
- clear: both;
238
- position: absolute;
239
- margin-top: -22px;
240
- color: #005B69;
241
- display: none;
242
- }
243
-
244
- #agca_news a {
245
- color: #005B69;
246
- }
247
-
248
- #agca_advertising {
249
- display: block;
250
- width: 900px;
251
- height: 100px;
252
- /*background-color: #cccccc;*/
253
- padding: 0;
254
- margin: 0;
255
- }
256
-
257
- #agca_advertising ul {
258
- padding: 0;
259
- margin: 0;
260
- padding-right: 5px;
261
- }
262
-
263
- #agca_advertising > ul > li {
264
- float: left;
265
- margin-right: 6px;
266
- cursor: pointer;
267
- }
268
-
269
- #agca_form {
270
- min-width: 835px; /*used for agca menu lineup*/
271
- }
272
-
273
- #agca_form .section_title {
274
- font-weight: bold;
275
- background: transparent;
276
- border-bottom-right-radius: 15px;
277
- color: #e85e3a;
278
- float: left;
279
- font-size: 40px;
280
- padding: 20px 11px;
281
- position: relative;
282
- text-decoration: none;
283
- text-shadow: none;
284
- width: 50%;
285
- display: block;
286
- margin-top: 0;
287
- }
288
-
289
- #agca_form select{
290
- border:3px #826c63 solid;
291
- color: #826c63;
292
- display: inline-block;
293
- font-weight: bold;
294
- height: 35px !important;
295
- width: auto;
296
- }
297
- #agca_form a{
298
- font-weight: bold;
299
- color: #826c63;
300
- }
301
- #agca_form a:hover{
302
- color: #6d6764;
303
- }
304
- #agca_form h2.section_title {
305
-
306
- }
307
-
308
- #agca_form h2.section_title {
309
- font-weight: bold;
310
- font-size: 45px;
311
- line-height: 1em;
312
- }
313
-
314
- #agca_form h2.section_title {
315
- color: #e85e3a;
316
- }
317
-
318
- /* Don't show shadows when selecting text */
319
- #agca_form h2.section_title::-moz-selection {
320
- background: #5af;
321
- color: #fff;
322
- text-shadow: none;
323
- }
324
-
325
- #agca_form h2.section_title::selection {
326
- background: #5af;
327
- color: #fff;
328
- text-shadow: none;
329
- }
330
-
331
- #agca_form #templates_head_buttons input[type=button] {
332
- background: #826c63;
333
- color: white;
334
- font-weight: bold;
335
- }
336
-
337
- #agca_form #templates_head_buttons input[type=button]:hover {
338
- background: white;
339
- color: #6d6764;
340
- }
341
-
342
- .ag-custom-button {
343
-
344
- /* margin-bottom:-4px !important;*/
345
- }
346
-
347
- #sidebar_adminmenu_logo {
348
- margin-bottom: -33px;
349
- min-height: 28px;
350
- cursor: pointer;
351
- }
352
-
353
- .agcaMenuEditorPlusMinus .plus {
354
- padding-right: 4px;
355
- display: inline;
356
- }
357
-
358
- .agcaMenuEditorPlusMinus .minus {
359
- padding-right: 4px;
360
- display: none;
361
- }
362
-
363
- .agcaMenuEditorPlusMinus .dashicons:before {
364
- font-size: 25px;
365
- line-height: 22px;
366
- display: inline-block;
367
- }
368
-
369
- .agcaMenuEditorPlusMinus {
370
- float: left;
371
- margin-right: 18px;
372
- cursor: default;
373
- width: 10px;
374
- color: #816c64;
375
- margin-top: -19px;
376
- padding-top: 9px;
377
- }
378
-
379
- /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
380
- padding: 3px 10px;
381
- background-color:#ffffff;
382
- } */
383
- #agca_form .agca_button.clear span{
384
- margin-top: 5px;
385
- }
386
- #agca_form .agca_button.clear span:before {
387
- color: #826c63;
388
- cursor: pointer;
389
- font-size: 30px;
390
- }
391
-
392
- #agca_form .agca_button.clear span:hover:before {
393
- color: red;
394
- }
395
-
396
- #agca_form input[type=button], button {
397
- background: #826c63;
398
- border: 1px solid #826c63;
399
- border-radius: 3px;
400
- color: #FFFFFF;
401
- padding: 5px 10px;
402
- }
403
-
404
- #agca_form input[type=button]:hover {
405
- background-color: #6d6764;
406
- border: 1px solid #6d6764;
407
- color: #fff;
408
- cursor: pointer;
409
- }
410
-
411
- #agca_form input[type=text] {
412
- height: 28px;
413
- width: 400px;
414
- border: 3px solid #eee;
415
- box-shadow: none;
416
- padding: 15px 10px;
417
- background: #f5f2f2;
418
- color: #816c64;
419
- font-weight: bold;
420
- border-radius: 5px;
421
- }
422
-
423
- #agca_form input.color_picker {
424
- width: 88px;
425
- }
426
-
427
- #agca_form input.color_picker:placeholder-shown + .pick_color_button + .pick_color_button_clear{
428
- display: none !important;
429
- }
430
-
431
- #agca_form input[type=text]:focus{
432
- background-color: transparent;
433
- border: 3px solid #826c63;
434
- }
435
-
436
- #agca_form textarea {
437
- width: 400px;
438
- background: #f5f2f2;
439
- border: 3px solid #eee;
440
- color: #816c64;
441
- font-weight: bold;
442
- padding: 5px;
443
- }
444
- #agca_form textarea.one-line{
445
- height: 35px;
446
- }
447
-
448
- #agca_form textarea.wp-editor-area {
449
- width: 100%;
450
- }
451
-
452
- #agca_form textarea:focus {
453
- background-color: transparent;
454
- border: 3px solid #826c63;
455
- }
456
-
457
- #agca_form #ag_edit_adminmenu tr td{
458
- line-height: 0;
459
- }
460
-
461
- #agca_form #ag_add_adminmenu input[type=text] {
462
- width: 300px;
463
- }
464
-
465
- #agca_form #ag_add_adminmenu .button_edit span,
466
- #agca_form #ag_add_adminmenu .button_remove span {
467
- font-size: 25px;
468
- color: #826c63;
469
- }
470
-
471
- #agca_form #ag_add_adminmenu .button_remove span {
472
- color: red;
473
- }
474
-
475
- #agca_form input#save_plugin_settings {
476
- background: #826c63;
477
- font-weight: bold;
478
- height: 39px;
479
- padding: 4px;
480
- width: 100%;
481
- border: 1px solid #826c63 !important;
482
- text-shadow: none !important;
483
- box-shadow: none !important;
484
- font-size: 16px;
485
- color: #fff !important;
486
- }
487
-
488
- #agca_form input#save_plugin_settings:hover {
489
- background-color: #6d6764 !important;
490
- }
491
-
492
- #agca_form input#save_plugin_settings[type="button"]:hover {
493
- background-color: #ffffff;
494
- color: #ffffff;
495
- }
496
-
497
- /*editor style fix*/
498
- #agca_form .agca_editor input[type="button"], button {
499
- color: black;
500
- }
501
-
502
- #agca_form .agca_editor textarea {
503
- width: 100%;
504
- }
505
-
506
- .agca_editor {
507
- width: 600px;
508
- }
509
-
510
- /*templates*/
511
- #agca_templates .error {
512
- padding: 8px;
513
- font-size: 14px;
514
- }
515
-
516
- .agca_template {
517
- display: block;
518
- float: left;
519
- border: 3px solid #aaa;
520
- margin: 10px;
521
- margin-top: 15px;
522
- cursor: pointer;
523
- }
524
-
525
- .agca_template:hover {
526
- border: 3px solid green;
527
- }
528
-
529
- .agca_template h3 {
530
- text-align: center;
531
- color: green;
532
- }
533
-
534
- .agca_template h3 span {
535
- color: #555;
536
- font-size: 16px;
537
- }
538
-
539
- .agca_template img {
540
- width: 250px;
541
- }
542
-
543
- .agca_logout_button {
544
- background: none repeat scroll 0 0 #dddddd;
545
- float: right;
546
- font-size: 15px;
547
- font-weight: bold;
548
- margin-right: 20px;
549
- padding: 10px;
550
- text-decoration: none;
551
- border-radius: 0 0 3px 3px;
552
- border: 1px solid #BBBBBB;
553
- border-top: none;
554
- margin-left: 6px;
555
- margin-right: 20px;
556
- padding: 6px 10px;
557
- }
558
-
559
- #ag_add_adminmenu button {
560
- border: medium none;
561
- border-radius: 4px;
562
- color: #FFFFFF;
563
- padding: 6px 9px;
564
- min-width: 150px;
565
- }
566
-
567
- .wp-admin.folded #sidebar_adminmenu_logo {
568
- display: none;
569
- }
570
-
571
- .agca-selectbox {
572
- width: 405px;
573
- padding: 4px !important;
574
- height: 28px !important;
575
- }
576
-
577
- .agca-selectbox:hover {
578
- background-color: #eee;
579
- }
580
-
581
- #agca_form .agca-checkbox-box {
582
- cursor: pointer;
583
- display: block;
584
- width: 28px;
585
- height: 28px;
586
- position: relative;
587
- float: left;
588
- }
589
-
590
- #agca_form .agca-checkbox-box:before {
591
- content: "●";
592
- font-size: 45px;
593
- line-height: 25px;
594
- color: #ccc;
595
- }
596
-
597
- #agca_form .agca-checkbox-box-checked {
598
- cursor: pointer;
599
- display: block;
600
- width: 28px;
601
- height: 28px;
602
- position: relative;
603
- float: left;
604
- }
605
-
606
- #agca_form .agca-checkbox-box-checked:before {
607
- content: "●";
608
- font-size: 45px;
609
- line-height: 25px;
610
- color: #826c63;
611
- }
612
-
613
- #agca_form .agca-checkbox-box-checked.visibility:before {
614
- }
615
-
616
- #agca_form .agca-checkbox-box-checked:hover:before,
617
- #agca_form .agca-checkbox-box:hover:before {
618
- color: #999;
619
- }
620
-
621
- #agca_form label {
622
- font-size: 15px;
623
- color: #777777;
624
- }
625
-
626
- #agca_form .form-table th {
627
- width: 350px;
628
- padding: 10px;
629
- }
630
- #agca_form .form-table th label{
631
- font-weight: normal;
632
- }
633
- #agca_form .form-table td {
634
- padding: 10px;
635
- }
636
- #agca_form .form-table td p{
637
- color: #9c8a8a;
638
- }
639
- .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box {
640
- margin-top: -15px;
641
- }
642
-
643
- #agca_form input[type=radio] {
644
- display: block;
645
- float: left;
646
- }
647
-
648
- #agca_form .agca-radiobox {
649
- cursor: pointer;
650
- display: block;
651
- width: 28px;
652
- height: 28px;
653
- position: relative;
654
- float: left;
655
- }
656
-
657
- #agca_form .agca-radio-text {
658
- display: block;
659
- float: left;
660
- font-size: 17px;
661
- font-weight: bold;
662
- margin: 4px 25px 4px 4px;
663
- cursor: pointer;
664
- }
665
-
666
- #agca_form .agca-radio-text.on {
667
- color: #ccc;
668
- }
669
-
670
- #agca_form .agca-radio-text.off {
671
- color: #ccc;
672
- }
673
-
674
- #agca_form .agca-radiobox:before {
675
- font-family: Dashicons;
676
- content: "\f159";
677
- font-size: 30px;
678
- line-height: 30px;
679
- }
680
-
681
- #agca_form .agca-radiobox.checked:before {
682
- content: "\f502";
683
- }
684
-
685
- #agca_form .agca-radiobox.checked[value=off]:before {
686
- content: "\f153";
687
- }
688
-
689
- #agca_form .agca-radiobox[value=on]:before {
690
- color: #ACC491;
691
- }
692
-
693
- #agca_form .agca-radiobox[value=off]:before {
694
- color: #ccc;
695
- }
696
-
697
- #agca_form #section_templates {
698
- background: transparent;
699
- }
700
-
701
- #wp-admin-bar-agca-admin-themes a {
702
- color: #def7c3 !important;
703
- }
704
-
705
- #wp-admin-bar-agca-admin-themes .ab-icon:before {
706
- font-family: "dashicons";
707
- content: "\f100";
708
- margin-top: 2px;
709
- display: block;
710
- color: #eef9d5 !important;
711
- }
712
-
713
- .agca-feedback-and-support a {
714
- border: medium none;
715
- border-radius: 4px;
716
- color: #FFFFFF !important;
717
- padding: 6px 20px;
718
- min-width: 240px;
719
- background: #826c63;
720
- display: inline-block;
721
- font-weight: normal !important;
722
- text-decoration: none;
723
- }
724
-
725
- .agca-feedback-and-support .upgrade a{
726
- background: #f9f9f9;
727
- color: #826c63 !important;
728
- float: left;
729
- border: 1px solid #826c63;
730
- padding: 5px 30px 5px 9px;
731
- }
732
- .agca-feedback-and-support .upgrade span{
733
- display: block;
734
- float: left;
735
- margin-top: 20px;
736
- }
737
- .agca-feedback-and-support .upgrade img{
738
- width: 50px;
739
- height: auto;
740
- float: left;
741
- display: inline-block;
742
- margin-left: -5px;
743
- }
744
-
745
- .agca-feedback-and-support a:hover {
746
- background-color: #6d6764;
747
- }
748
- .agca-feedback-and-support .upgrade a:hover{
749
- background-color: #fff;
750
- color: #826c63;
751
- box-shadow: 1px 1px 1px #ddd;
752
- }
753
- #agca-your-feedback {
754
- float: right;
755
- width: 160px;
756
- margin-top: -10px;
757
- display: none;
758
- }
759
-
760
- #agca-your-feedback .dashicons {
761
- font-size: 24px;
762
- padding: 0 3px;
763
- line-height: 18px;
764
- }
765
-
766
- #agca-your-feedback a {
767
- text-decoration: none;
768
- }
769
-
770
- #agca-your-feedback a {
771
- text-decoration: none;
772
- }
773
-
774
- #agca-your-feedback .feedback.negative {
775
- color: #f08080;
776
- }
777
-
778
- #agca-your-feedback .feedback.negative:hover {
779
- color: red;
780
- }
781
-
782
- #agca-your-feedback .feedback.positive {
783
- color: #ACC491;
784
- }
785
-
786
- #agca-your-feedback .feedback.positive:hover {
787
- color: green;
788
- }
789
-
790
- #agca_donate_button {
791
- margin-left: 5px;
792
- margin-top: 3px;
793
- display: inline-block;
794
- }
795
- #agca_donate_button img{
796
- width: 125px;
797
- margin-top: -8px;
798
- }
799
-
800
- #section_ag_colorizer_settings .color input {
801
- border-radius: 5px;
802
- }
803
-
804
- #section_ag_colorizer_settings .color .agca_button {
805
- cursor: pointer;
806
- }
807
-
808
- #section_ag_colorizer_settings .color .agca_button span {
809
- font-size: 35px;
810
- padding: 0 6px;
811
- color: #826c63;
812
- }
813
-
814
- #section_ag_colorizer_settings .color .agca_button span:hover {
815
- color: #6d6764;
816
- }
817
-
818
- #section_ag_colorizer_settings .color .agca_button span.clear {
819
- color: #826c63;
820
- }
821
-
822
- #section_ag_colorizer_settings .color .agca_button span.clear:hover {
823
- color: red;
824
- }
825
- /*Hide dashboard empty box containers*/
826
- #dashboard-widgets div.empty-container{
827
- display: none;
828
- }
829
-
830
- .tools_page_ag-custom-admin-plugin #wpwrap{
831
- background: #fff;
832
-
833
- }
834
- .tools_page_ag-custom-admin-plugin #agca_form{
835
- font-family: 'Open Sans', sans-serif;
836
- font-weight: 300;
837
- }
838
-
839
- .tools_page_ag-custom-admin-plugin #agca_form *:focus {
840
- outline: none !important;
841
- box-shadow: none !important;
842
- }
843
-
844
- .agca_template_block h3,
845
- .agca_template_block span.price,
846
- .agca_template_block a{
847
- color: inherit !important;
848
- }
849
- #agca_template_popup .agca_content{
850
- background: #bbb !important;
851
- }
852
-
853
- .agca_template_block .template img{
854
- box-shadow: none !important;
855
- }
856
-
857
- #agca_form #ag_edit_adminmenu tr.top td{
858
- background: #f9f8f8;
859
- padding-top: 10px;
860
- padding-bottom: 0;
861
- }
862
- #agca_form #ag_edit_adminmenu tr.top td.ag_admin_menu_parent2{
863
- padding-top: 2px;
864
- }
865
- #agca_form #ag_edit_adminmenu tr.top:nth-child(odd) td{
866
- background: #f3f3f3;
867
- }
868
- #agca_form #ag_edit_adminmenu tr.sub td{
869
- background: #fff;
870
- padding: 0;
871
- padding-left: 10px;
872
- }
873
- #agca_form #ag_edit_adminmenu tr.sub td div a{
874
- padding: 17px;
875
- display: inline-block;
876
- }
877
-
878
- #agca_form #ag_edit_adminmenu tr:first-child td{
879
- background: #826c63;
880
  }
1
+ @import url('https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,700');
2
+ /*color scheme*/
3
+ /*
4
+ -main
5
+ #ACC491
6
+ #DEF7C3
7
+
8
+ -lighter
9
+ #eef9d5
10
+
11
+ -blue
12
+ #005B69
13
+ */
14
+ .agca-clear {
15
+ clear: both;
16
+ }
17
+
18
+ .agca-tip {
19
+ padding-left: 20px;
20
+ }
21
+
22
+ h1#agca-title {
23
+ color: #826c63;
24
+ font-weight: bold;
25
+ font-size: 30px;
26
+ }
27
+ h1#agca-title .title{
28
+ float:left;
29
+ padding: 10px;
30
+ font-family: 'Open Sans', sans-serif;
31
+ font-weight: 300;
32
+ }
33
+ h1#agca-title img{
34
+ width: 128px;
35
+ float: left;
36
+ margin-top: -40px;
37
+ }
38
+ h1#agca-title .version{
39
+ font-size: 15px;
40
+ margin-top: 12px;
41
+ display: inline-block;
42
+ }
43
+
44
+ table .agca-tip {
45
+ padding-left: 10px;
46
+ }
47
+
48
+ #ag_main_menu {
49
+ display: block;
50
+ height: 34px;
51
+ border-bottom: 3px solid #826c63;
52
+ margin-top: 10px;
53
+ }
54
+ #ag_main_menu li a:hover{
55
+ color: #fff;
56
+ }
57
+ #ag_main_menu li.upgrade{
58
+ background-color:#fff;
59
+ border-top-right-radius: 10px;
60
+ border-bottom: 2px solid #826c63;
61
+ }
62
+ #ag_main_menu li.upgrade:hover{
63
+ background: #fff !important;
64
+ }
65
+ #ag_main_menu li.upgrade:hover a{
66
+ color:#e85e3a;
67
+ }
68
+ #ag_main_menu li.upgrade a{
69
+ color: #826c63;
70
+ padding-left: 20px;
71
+ font-weight:bolder;
72
+ }
73
+ #ag_main_menu li.upgrade img{
74
+ width: 30px;
75
+ position: absolute;
76
+ margin-top: -8px;
77
+ margin-left: -28px;
78
+ }
79
+
80
+ .ag_section {
81
+ background: transparent;
82
+ }
83
+
84
+ #agca_form #section-cusmin {
85
+ font-size: 15px;
86
+ padding: 10px;
87
+ border: 2px solid #999;
88
+ background: #fff;
89
+ margin-bottom: 5px;
90
+ border-radius: 6px;
91
+ font-weight: bold;
92
+ color: #999;
93
+ }
94
+
95
+
96
+ #ag_main_menu li {
97
+ display: block;
98
+ background-color: #826c63;
99
+ float: left;
100
+ color: #fff;
101
+ padding: 15px;
102
+ padding-top: 8px;
103
+ padding-bottom: 8px;
104
+ font-weight: bold;
105
+ border-bottom: 3px solid #826c63;
106
+ }
107
+
108
+ #ag_main_menu li.selected {
109
+ background-color: #efefef;
110
+ color: #826c63;
111
+ cursor: default;
112
+ }
113
+ #ag_main_menu li.selected a{
114
+ color: #6d6764;
115
+ }
116
+
117
+ #ag_main_menu li.normal:hover {
118
+ background-color: #6d6764;
119
+ cursor: pointer;
120
+ }
121
+
122
+ #ag_main_menu a:focus {
123
+ outline: none;
124
+ border: 0;
125
+ }
126
+
127
+ #ag_main_menu li a {
128
+ text-decoration: none;
129
+ color: #fff;
130
+ outline: none;
131
+ border: 0;
132
+ }
133
+
134
+ .ag_table_heading {
135
+ background: none;
136
+ display: block;
137
+ height: 25px;
138
+ padding: 5px;
139
+ padding-top: 0px;
140
+ padding-bottom: 1px;
141
+ margin-top: 20px;
142
+ margin-bottom: 24px;
143
+ margin-left: -10px;
144
+ margin-right: -10px;
145
+ }
146
+
147
+ .ag_table_heading h3 {
148
+ color: #826c63;
149
+ background: #efefef;
150
+ margin-left: -15px;
151
+ padding: 5px 15px;
152
+ border: none;
153
+ border: 3px #826c63 solid;
154
+ border-radius: 6px;
155
+ font-size: 15px;
156
+ }
157
+
158
+ .ag_table_major_options {
159
+ background-color: #f9f8f8;
160
+ width: 500px;
161
+ margin-bottom: 2px;
162
+ }
163
+
164
+ #agca_form .form-table .ag_table_major_options td {
165
+ padding-left: 20px;
166
+ }
167
+
168
+ div#AGToolTipDiv {
169
+ position: absolute;
170
+ top: 100px;
171
+ left: 200px;
172
+ height: auto;
173
+ border: 1px solid #FFFF00;
174
+ background-color: #efefef;
175
+ color: #826c63;
176
+ display: none;
177
+ padding: 5px 10px;
178
+ border-radius: 3px;
179
+ }
180
+
181
+ td.ag_admin_menu_parent {
182
+ font-size: 16px;
183
+ font-weight: bold;
184
+ }
185
+
186
+ td.ag_admin_menu_parent:hover {
187
+ background-color: #ddd;
188
+ }
189
+
190
+ #ag_edit_adminmenu h3 {
191
+ color: #ffffff;
192
+ }
193
+
194
+ #ag_edit_adminmenu tr {
195
+ margin: 0;
196
+ padding: 0;
197
+ background-color: #E8FAE8;
198
+ }
199
+
200
+ #ag_edit_adminmenu td.ag_admin_menu_child {
201
+ margin: 0;
202
+ padding: 15px;
203
+ padding-top: 0;
204
+ padding-bottom: 0;
205
+ }
206
+
207
+ #ag_edit_adminmenu th h2 {
208
+ color: #fff;
209
+ }
210
+
211
+ #ag_edit_adminmenu a {
212
+ text-decoration: none;
213
+ color: #444;
214
+ }
215
+
216
+ .noclass {
217
+ display: none;
218
+ }
219
+
220
+ #agca_footer_support_info {
221
+ font-size: 12px;
222
+ font-weight: bold;
223
+ background: #acc491;
224
+ color: #ffffff;
225
+ border: none;
226
+ padding: 20px;
227
+ }
228
+
229
+ #agca_footer_support_info a {
230
+ color: #005b69;
231
+ text-decoration: none;
232
+ font-size: 18px;
233
+ }
234
+
235
+ #agca_news {
236
+ height: 20px;
237
+ clear: both;
238
+ position: absolute;
239
+ margin-top: -22px;
240
+ color: #005B69;
241
+ display: none;
242
+ }
243
+
244
+ #agca_news a {
245
+ color: #005B69;
246
+ }
247
+
248
+ #agca_advertising {
249
+ display: block;
250
+ width: 900px;
251
+ height: 100px;
252
+ /*background-color: #cccccc;*/
253
+ padding: 0;
254
+ margin: 0;
255
+ }
256
+
257
+ #agca_advertising ul {
258
+ padding: 0;
259
+ margin: 0;
260
+ padding-right: 5px;
261
+ }
262
+
263
+ #agca_advertising > ul > li {
264
+ float: left;
265
+ margin-right: 6px;
266
+ cursor: pointer;
267
+ }
268
+
269
+ #agca_form {
270
+ min-width: 835px; /*used for agca menu lineup*/
271
+ }
272
+
273
+ #agca_form .section_title {
274
+ font-weight: bold;
275
+ background: transparent;
276
+ border-bottom-right-radius: 15px;
277
+ color: #e85e3a;
278
+ float: left;
279
+ font-size: 40px;
280
+ padding: 20px 11px;
281
+ position: relative;
282
+ text-decoration: none;
283
+ text-shadow: none;
284
+ width: 50%;
285
+ display: block;
286
+ margin-top: 0;
287
+ }
288
+
289
+ #agca_form select{
290
+ border:3px #826c63 solid;
291
+ color: #826c63;
292
+ display: inline-block;
293
+ font-weight: bold;
294
+ height: 35px !important;
295
+ width: auto;
296
+ }
297
+ #agca_form a{
298
+ font-weight: bold;
299
+ color: #826c63;
300
+ }
301
+ #agca_form a:hover{
302
+ color: #6d6764;
303
+ }
304
+ #agca_form h2.section_title {
305
+
306
+ }
307
+
308
+ #agca_form h2.section_title {
309
+ font-weight: bold;
310
+ font-size: 45px;
311
+ line-height: 1em;
312
+ }
313
+
314
+ #agca_form h2.section_title {
315
+ color: #e85e3a;
316
+ }
317
+
318
+ /* Don't show shadows when selecting text */
319
+ #agca_form h2.section_title::-moz-selection {
320
+ background: #5af;
321
+ color: #fff;
322
+ text-shadow: none;
323
+ }
324
+
325
+ #agca_form h2.section_title::selection {
326
+ background: #5af;
327
+ color: #fff;
328
+ text-shadow: none;
329
+ }
330
+
331
+ #agca_form #templates_head_buttons input[type=button] {
332
+ background: #826c63;
333
+ color: white;
334
+ font-weight: bold;
335
+ }
336
+
337
+ #agca_form #templates_head_buttons input[type=button]:hover {
338
+ background: white;
339
+ color: #6d6764;
340
+ }
341
+
342
+ .ag-custom-button {
343
+
344
+ /* margin-bottom:-4px !important;*/
345
+ }
346
+
347
+ #sidebar_adminmenu_logo {
348
+ margin-bottom: -33px;
349
+ min-height: 28px;
350
+ cursor: pointer;
351
+ }
352
+
353
+ .agcaMenuEditorPlusMinus .plus {
354
+ padding-right: 4px;
355
+ display: inline;
356
+ }
357
+
358
+ .agcaMenuEditorPlusMinus .minus {
359
+ padding-right: 4px;
360
+ display: none;
361
+ }
362
+
363
+ .agcaMenuEditorPlusMinus .dashicons:before {
364
+ font-size: 25px;
365
+ line-height: 22px;
366
+ display: inline-block;
367
+ }
368
+
369
+ .agcaMenuEditorPlusMinus {
370
+ float: left;
371
+ margin-right: 18px;
372
+ cursor: default;
373
+ width: 10px;
374
+ color: #816c64;
375
+ margin-top: -19px;
376
+ padding-top: 9px;
377
+ }
378
+
379
+ /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
380
+ padding: 3px 10px;
381
+ background-color:#ffffff;
382
+ } */
383
+ #agca_form .agca_button.clear span{
384
+ margin-top: 5px;
385
+ }
386
+ #agca_form .agca_button.clear span:before {
387
+ color: #826c63;
388
+ cursor: pointer;
389
+ font-size: 30px;
390
+ }
391
+
392
+ #agca_form .agca_button.clear span:hover:before {
393
+ color: red;
394
+ }
395
+
396
+ #agca_form input[type=button], button {
397
+ background: #826c63;
398
+ border: 1px solid #826c63;
399
+ border-radius: 3px;
400
+ color: #FFFFFF;
401
+ padding: 5px 10px;
402
+ }
403
+
404
+ #agca_form input[type=button]:hover {
405
+ background-color: #6d6764;
406
+ border: 1px solid #6d6764;
407
+ color: #fff;
408
+ cursor: pointer;
409
+ }
410
+
411
+ #agca_form input[type=text] {
412
+ height: 28px;
413
+ width: 400px;
414
+ border: 3px solid #eee;
415
+ box-shadow: none;
416
+ padding: 15px 10px;
417
+ background: #f5f2f2;
418
+ color: #816c64;
419
+ font-weight: bold;
420
+ border-radius: 5px;
421
+ }
422
+
423
+ #agca_form input.color_picker {
424
+ width: 88px;
425
+ }
426
+
427
+ #agca_form input.color_picker:placeholder-shown + .pick_color_button + .pick_color_button_clear{
428
+ display: none !important;
429
+ }
430
+
431
+ #agca_form input[type=text]:focus{
432
+ background-color: transparent;
433
+ border: 3px solid #826c63;
434
+ }
435
+
436
+ #agca_form textarea {
437
+ width: 400px;
438
+ background: #f5f2f2;
439
+ border: 3px solid #eee;
440
+ color: #816c64;
441
+ font-weight: bold;
442
+ padding: 5px;
443
+ }
444
+ #agca_form textarea.one-line{
445
+ height: 35px;
446
+ }
447
+
448
+ #agca_form textarea.wp-editor-area {
449
+ width: 100%;
450
+ }
451
+
452
+ #agca_form textarea:focus {
453
+ background-color: transparent;
454
+ border: 3px solid #826c63;
455
+ }
456
+
457
+ #agca_form #ag_edit_adminmenu tr td{
458
+ line-height: 0;
459
+ }
460
+
461
+ #agca_form #ag_add_adminmenu input[type=text] {
462
+ width: 300px;
463
+ }
464
+
465
+ #agca_form #ag_add_adminmenu .button_edit span,
466
+ #agca_form #ag_add_adminmenu .button_remove span {
467
+ font-size: 25px;
468
+ color: #826c63;
469
+ }
470
+
471
+ #agca_form #ag_add_adminmenu .button_remove span {
472
+ color: red;
473
+ }
474
+
475
+ #agca_form input#save_plugin_settings {
476
+ background: #826c63;
477
+ font-weight: bold;
478
+ height: 39px;
479
+ padding: 4px;
480
+ width: 100%;
481
+ border: 1px solid #826c63 !important;
482
+ text-shadow: none !important;
483
+ box-shadow: none !important;
484
+ font-size: 16px;
485
+ color: #fff !important;
486
+ }
487
+
488
+ #agca_form input#save_plugin_settings:hover {
489
+ background-color: #6d6764 !important;
490
+ }
491
+
492
+ #agca_form input#save_plugin_settings[type="button"]:hover {
493
+ background-color: #ffffff;
494
+ color: #ffffff;
495
+ }
496
+
497
+ /*editor style fix*/
498
+ #agca_form .agca_editor input[type="button"], button {
499
+ color: black;
500
+ }
501
+
502
+ #agca_form .agca_editor textarea {
503
+ width: 100%;
504
+ }
505
+
506
+ .agca_editor {
507
+ width: 600px;
508
+ }
509
+
510
+ /*templates*/
511
+ #agca_templates .error {
512
+ padding: 8px;
513
+ font-size: 14px;
514
+ }
515
+
516
+ .agca_template {
517
+ display: block;
518
+ float: left;
519
+ border: 3px solid #aaa;
520
+ margin: 10px;
521
+ margin-top: 15px;
522
+ cursor: pointer;
523
+ }
524
+
525
+ .agca_template:hover {
526
+ border: 3px solid green;
527
+ }
528
+
529
+ .agca_template h3 {
530
+ text-align: center;
531
+ color: green;
532
+ }
533
+
534
+ .agca_template h3 span {
535
+ color: #555;
536
+ font-size: 16px;
537
+ }
538
+
539
+ .agca_template img {
540
+ width: 250px;
541
+ }
542
+
543
+ .agca_logout_button {
544
+ background: none repeat scroll 0 0 #dddddd;
545
+ float: right;
546
+ font-size: 15px;
547
+ font-weight: bold;
548
+ margin-right: 20px;
549
+ padding: 10px;
550
+ text-decoration: none;
551
+ border-radius: 0 0 3px 3px;
552
+ border: 1px solid #BBBBBB;
553
+ border-top: none;
554
+ margin-left: 6px;
555
+ margin-right: 20px;
556
+ padding: 6px 10px;
557
+ }
558
+
559
+ #ag_add_adminmenu button {
560
+ border: medium none;
561
+ border-radius: 4px;
562
+ color: #FFFFFF;
563
+ padding: 6px 9px;
564
+ min-width: 150px;
565
+ }
566
+
567
+ .wp-admin.folded #sidebar_adminmenu_logo {
568
+ display: none;
569
+ }
570
+
571
+ .agca-selectbox {
572
+ width: 405px;
573
+ padding: 4px !important;
574
+ height: 28px !important;
575
+ }
576
+
577
+ .agca-selectbox:hover {
578
+ background-color: #eee;
579
+ }
580
+
581
+ #agca_form .agca-checkbox-box {
582
+ cursor: pointer;
583
+ display: block;
584
+ width: 28px;
585
+ height: 28px;
586
+ position: relative;
587
+ float: left;
588
+ }
589
+
590
+ #agca_form .agca-checkbox-box:before {
591
+ content: "●";
592
+ font-size: 45px;
593
+ line-height: 25px;
594
+ color: #ccc;
595
+ }
596
+
597
+ #agca_form .agca-checkbox-box-checked {
598
+ cursor: pointer;
599
+ display: block;
600
+ width: 28px;
601
+ height: 28px;
602
+ position: relative;
603
+ float: left;
604
+ }
605
+
606
+ #agca_form .agca-checkbox-box-checked:before {
607
+ content: "●";
608
+ font-size: 45px;
609
+ line-height: 25px;
610
+ color: #826c63;
611
+ }
612
+
613
+ #agca_form .agca-checkbox-box-checked.visibility:before {
614
+ }
615
+
616
+ #agca_form .agca-checkbox-box-checked:hover:before,
617
+ #agca_form .agca-checkbox-box:hover:before {
618
+ color: #999;
619
+ }
620
+
621
+ #agca_form label {
622
+ font-size: 15px;
623
+ color: #777777;
624
+ }
625
+
626
+ #agca_form .form-table th {
627
+ width: 350px;
628
+ padding: 10px;
629
+ }
630
+ #agca_form .form-table th label{
631
+ font-weight: normal;
632
+ }
633
+ #agca_form .form-table td {
634
+ padding: 10px;
635
+ }
636
+ #agca_form .form-table td p{
637
+ color: #9c8a8a;
638
+ }
639
+ .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box {
640
+ margin-top: -15px;
641
+ }
642
+
643
+ #agca_form input[type=radio] {
644
+ display: block;
645
+ float: left;
646
+ }
647
+
648
+ #agca_form .agca-radiobox {
649
+ cursor: pointer;
650
+ display: block;
651
+ width: 28px;
652
+ height: 28px;
653
+ position: relative;
654
+ float: left;
655
+ }
656
+
657
+ #agca_form .agca-radio-text {
658
+ display: block;
659
+ float: left;
660
+ font-size: 17px;
661
+ font-weight: bold;
662
+ margin: 4px 25px 4px 4px;
663
+ cursor: pointer;
664
+ }
665
+
666
+ #agca_form .agca-radio-text.on {
667
+ color: #ccc;
668
+ }
669
+
670
+ #agca_form .agca-radio-text.off {
671
+ color: #ccc;
672
+ }
673
+
674
+ #agca_form .agca-radiobox:before {
675
+ font-family: Dashicons;
676
+ content: "\f159";
677
+ font-size: 30px;
678
+ line-height: 30px;
679
+ }
680
+
681
+ #agca_form .agca-radiobox.checked:before {
682
+ content: "\f502";
683
+ }
684
+
685
+ #agca_form .agca-radiobox.checked[value=off]:before {
686
+ content: "\f153";
687
+ }
688
+
689
+ #agca_form .agca-radiobox[value=on]:before {
690
+ color: #ACC491;
691
+ }
692
+
693
+ #agca_form .agca-radiobox[value=off]:before {
694
+ color: #ccc;
695
+ }
696
+
697
+ #agca_form #section_templates {
698
+ background: transparent;
699
+ }
700
+
701
+ #wp-admin-bar-agca-admin-themes a {
702
+ color: #def7c3 !important;
703
+ }
704
+
705
+ #wp-admin-bar-agca-admin-themes .ab-icon:before {
706
+ font-family: "dashicons";
707
+ content: "\f100";
708
+ margin-top: 2px;
709
+ display: block;
710
+ color: #eef9d5 !important;
711
+ }
712
+
713
+ .agca-feedback-and-support a {
714
+ border: medium none;
715
+ border-radius: 4px;
716
+ color: #FFFFFF !important;
717
+ padding: 6px 20px;
718
+ min-width: 240px;
719
+ background: #826c63;
720
+ display: inline-block;
721
+ font-weight: normal !important;
722
+ text-decoration: none;
723
+ }
724
+
725
+ .agca-feedback-and-support .upgrade a{
726
+ background: #f9f9f9;
727
+ color: #826c63 !important;
728
+ float: left;
729
+ border: 1px solid #826c63;
730
+ padding: 5px 30px 5px 9px;
731
+ }
732
+ .agca-feedback-and-support .upgrade span{
733
+ display: block;
734
+ float: left;
735
+ margin-top: 20px;
736
+ }
737
+ .agca-feedback-and-support .upgrade img{
738
+ width: 50px;
739
+ height: auto;
740
+ float: left;
741
+ display: inline-block;
742
+ margin-left: -5px;
743
+ }
744
+
745
+ .agca-feedback-and-support a:hover {
746
+ background-color: #6d6764;
747
+ }
748
+ .agca-feedback-and-support .upgrade a:hover{
749
+ background-color: #fff;
750
+ color: #826c63;
751
+ box-shadow: 1px 1px 1px #ddd;
752
+ }
753
+ #agca-your-feedback {
754
+ float: right;
755
+ width: 160px;
756
+ margin-top: -10px;
757
+ display: none;
758
+ }
759
+
760
+ #agca-your-feedback .dashicons {
761
+ font-size: 24px;
762
+ padding: 0 3px;
763
+ line-height: 18px;
764
+ }
765
+
766
+ #agca-your-feedback a {
767
+ text-decoration: none;
768
+ }
769
+
770
+ #agca-your-feedback a {
771
+ text-decoration: none;
772
+ }
773
+
774
+ #agca-your-feedback .feedback.negative {
775
+ color: #f08080;
776
+ }
777
+
778
+ #agca-your-feedback .feedback.negative:hover {
779
+ color: red;
780
+ }
781
+
782
+ #agca-your-feedback .feedback.positive {
783
+ color: #ACC491;
784
+ }
785
+
786
+ #agca-your-feedback .feedback.positive:hover {
787
+ color: green;
788
+ }
789
+
790
+ #agca_donate_button {
791
+ margin-left: 5px;
792
+ margin-top: 3px;
793
+ display: inline-block;
794
+ }
795
+ #agca_donate_button img{
796
+ width: 125px;
797
+ margin-top: -8px;
798
+ }
799
+
800
+ #section_ag_colorizer_settings .color input {
801
+ border-radius: 5px;
802
+ }
803
+
804
+ #section_ag_colorizer_settings .color .agca_button {
805
+ cursor: pointer;
806
+ }
807
+
808
+ #section_ag_colorizer_settings .color .agca_button span {
809
+ font-size: 35px;
810
+ padding: 0 6px;
811
+ color: #826c63;
812
+ }
813
+
814
+ #section_ag_colorizer_settings .color .agca_button span:hover {
815
+ color: #6d6764;
816
+ }
817
+
818
+ #section_ag_colorizer_settings .color .agca_button span.clear {
819
+ color: #826c63;
820
+ }
821
+
822
+ #section_ag_colorizer_settings .color .agca_button span.clear:hover {
823
+ color: red;
824
+ }
825
+ /*Hide dashboard empty box containers*/
826
+ #dashboard-widgets div.empty-container{
827
+ display: none;
828
+ }
829
+
830
+ .tools_page_ag-custom-admin-plugin #wpwrap{
831
+ background: #fff;
832
+
833
+ }
834
+ .tools_page_ag-custom-admin-plugin #agca_form{
835
+ font-family: 'Open Sans', sans-serif;
836
+ font-weight: 300;
837
+ }
838
+
839
+ .tools_page_ag-custom-admin-plugin #agca_form *:focus {
840
+ outline: none !important;
841
+ box-shadow: none !important;
842
+ }
843
+
844
+ .agca_template_block h3,
845
+ .agca_template_block span.price,
846
+ .agca_template_block a{
847
+ color: inherit !important;
848
+ }
849
+ #agca_template_popup .agca_content{
850
+ background: #bbb !important;
851
+ }
852
+
853
+ .agca_template_block .template img{
854
+ box-shadow: none !important;
855
+ }
856
+
857
+ #agca_form #ag_edit_adminmenu tr.top td{
858
+ background: #f9f8f8;
859
+ padding-top: 10px;
860
+ padding-bottom: 0;
861
+ }
862
+ #agca_form #ag_edit_adminmenu tr.top td.ag_admin_menu_parent2{
863
+ padding-top: 2px;
864
+ }
865
+ #agca_form #ag_edit_adminmenu tr.top:nth-child(odd) td{
866
+ background: #f3f3f3;
867
+ }
868
+ #agca_form #ag_edit_adminmenu tr.sub td{
869
+ background: #fff;
870
+ padding: 0;
871
+ padding-left: 10px;
872
+ }
873
+ #agca_form #ag_edit_adminmenu tr.sub td div a{
874
+ padding: 17px;
875
+ display: inline-block;
876
+ }
877
+
878
+ #agca_form #ag_edit_adminmenu tr:first-child td{
879
+ background: #826c63;
880
  }
uninstall.php CHANGED
@@ -1,90 +1,90 @@
1
- <?php
2
- // die if not uninstalling
3
- if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
- exit ();
5
-
6
- delete_option( 'agca_role_allbutadmin' );
7
- delete_option( 'agca_screen_options_menu' );
8
- delete_option( 'agca_help_menu' );
9
- delete_option( 'agca_logout' );
10
- delete_option( 'agca_remove_your_profile' );
11
- delete_option( 'agca_logout_only' );
12
- delete_option( 'agca_options_menu' ); //obsolete from 1.5
13
- delete_option( 'agca_howdy' );
14
- delete_option( 'agca_header' );
15
- delete_option( 'agca_header_show_logout' );
16
- delete_option( 'agca_footer' );
17
- delete_option( 'agca_privacy_options' );
18
- delete_option( 'agca_header_logo' );
19
- delete_option( 'agca_header_logo_custom' );
20
- delete_option( 'agca_wp_logo_custom' );
21
- delete_option( 'agca_wp_logo_custom_link' );
22
- delete_option( 'agca_site_heading' );
23
- delete_option( 'agca_custom_site_heading' );
24
- delete_option( 'agca_update_bar' );
25
-
26
- delete_option( 'agca_footer_left' );
27
- delete_option( 'agca_footer_left_hide' );
28
- delete_option( 'agca_footer_right' );
29
- delete_option( 'agca_footer_right_hide' );
30
-
31
- delete_option( 'agca_login_banner' );
32
- delete_option( 'agca_login_banner_text' );
33
- delete_option( 'agca_login_photo_remove' );
34
- delete_option( 'agca_login_photo_url' );
35
- delete_option( 'agca_login_photo_href' );
36
- delete_option( 'agca_login_round_box' );
37
- delete_option( 'agca_login_round_box_size' );
38
-
39
- delete_option( 'agca_dashboard_icon' );
40
- delete_option( 'agca_dashboard_text' );
41
- delete_option( 'agca_dashboard_text_paragraph' );
42
- delete_option( 'agca_dashboard_widget_welcome' );
43
- delete_option( 'agca_dashboard_widget_il' );
44
- delete_option( 'agca_dashboard_widget_plugins' );
45
- delete_option( 'agca_dashboard_widget_qp' );
46
- delete_option( 'agca_dashboard_widget_rn' );
47
- delete_option( 'agca_dashboard_widget_rd' );
48
- delete_option( 'agca_dashboard_widget_primary' );
49
- delete_option( 'agca_dashboard_widget_secondary' );
50
- delete_option( 'agca_dashboard_widget_activity' );
51
-
52
- //WP3.3
53
- delete_option( 'agca_admin_bar_comments' );
54
- delete_option( 'agca_admin_bar_new_content' );
55
- delete_option( 'agca_admin_bar_new_content_post' );
56
- delete_option( 'agca_admin_bar_new_content_link' );
57
- delete_option( 'agca_admin_bar_new_content_page' );
58
- delete_option( 'agca_admin_bar_new_content_user' );
59
- delete_option( 'agca_admin_bar_new_content_media' );
60
- delete_option( 'agca_admin_bar_update_notifications' );
61
- delete_option( 'agca_admin_bar_admin_themes' );
62
- delete_option( 'agca_remove_top_bar_dropdowns' );
63
-
64
- /*Admin menu*/
65
- delete_option( 'agca_admin_menu_turnonoff' );
66
- delete_option( 'agca_admin_menu_agca_button_only' );
67
- delete_option( 'agca_admin_menu_separator_first' );
68
- delete_option( 'agca_admin_menu_separator_second' );
69
- delete_option( 'agca_admin_menu_icons' );
70
- delete_option( 'agca_admin_menu_arrow' );
71
- delete_option( 'agca_admin_menu_submenu_round' );
72
- delete_option( 'agca_admin_menu_submenu_round_size' );
73
- delete_option( 'agca_admin_menu_brand' );
74
- delete_option( 'agca_admin_menu_brand_link' );
75
- delete_option( 'agca_admin_menu_autofold' );
76
- delete_option( 'ag_edit_adminmenu_json' );
77
- delete_option( 'ag_edit_adminmenu_json_new' );
78
- delete_option( 'ag_add_adminmenu_json' );
79
- delete_option( 'ag_colorizer_json' );
80
- delete_option( 'agca_colorizer_turnonoff' );
81
-
82
- delete_option( 'agca_custom_js' );
83
- delete_option( 'agca_custom_css' );
84
-
85
- delete_option( 'agca_selected_template' );
86
- delete_option( 'agca_templates' );
87
- delete_option( 'agca_disablewarning' );
88
- delete_option( 'agca_disable_postver' );
89
- delete_option( 'agca_menu_remove_client_profile' );
90
  ?>
1
+ <?php
2
+ // die if not uninstalling
3
+ if( !defined( 'WP_UNINSTALL_PLUGIN' ) )
4
+ exit ();
5
+
6
+ delete_option( 'agca_role_allbutadmin' );
7
+ delete_option( 'agca_screen_options_menu' );
8
+ delete_option( 'agca_help_menu' );
9
+ delete_option( 'agca_logout' );
10
+ delete_option( 'agca_remove_your_profile' );
11
+ delete_option( 'agca_logout_only' );
12
+ delete_option( 'agca_options_menu' ); //obsolete from 1.5
13
+ delete_option( 'agca_howdy' );
14
+ delete_option( 'agca_header' );
15
+ delete_option( 'agca_header_show_logout' );
16
+ delete_option( 'agca_footer' );
17
+ delete_option( 'agca_privacy_options' );
18
+ delete_option( 'agca_header_logo' );
19
+ delete_option( 'agca_header_logo_custom' );
20
+ delete_option( 'agca_wp_logo_custom' );
21
+ delete_option( 'agca_wp_logo_custom_link' );
22
+ delete_option( 'agca_site_heading' );
23
+ delete_option( 'agca_custom_site_heading' );
24
+ delete_option( 'agca_update_bar' );
25
+
26
+ delete_option( 'agca_footer_left' );
27
+ delete_option( 'agca_footer_left_hide' );
28
+ delete_option( 'agca_footer_right' );
29
+ delete_option( 'agca_footer_right_hide' );
30
+
31
+ delete_option( 'agca_login_banner' );
32
+ delete_option( 'agca_login_banner_text' );
33
+ delete_option( 'agca_login_photo_remove' );
34
+ delete_option( 'agca_login_photo_url' );
35
+ delete_option( 'agca_login_photo_href' );
36
+ delete_option( 'agca_login_round_box' );
37
+ delete_option( 'agca_login_round_box_size' );
38
+
39
+ delete_option( 'agca_dashboard_icon' );
40
+ delete_option( 'agca_dashboard_text' );
41
+ delete_option( 'agca_dashboard_text_paragraph' );
42
+ delete_option( 'agca_dashboard_widget_welcome' );
43
+ delete_option( 'agca_dashboard_widget_il' );
44
+ delete_option( 'agca_dashboard_widget_plugins' );
45
+ delete_option( 'agca_dashboard_widget_qp' );
46
+ delete_option( 'agca_dashboard_widget_rn' );
47
+ delete_option( 'agca_dashboard_widget_rd' );
48
+ delete_option( 'agca_dashboard_widget_primary' );
49
+ delete_option( 'agca_dashboard_widget_secondary' );
50
+ delete_option( 'agca_dashboard_widget_activity' );
51
+
52
+ //WP3.3
53
+ delete_option( 'agca_admin_bar_comments' );
54
+ delete_option( 'agca_admin_bar_new_content' );
55
+ delete_option( 'agca_admin_bar_new_content_post' );
56
+ delete_option( 'agca_admin_bar_new_content_link' );
57
+ delete_option( 'agca_admin_bar_new_content_page' );
58
+ delete_option( 'agca_admin_bar_new_content_user' );
59
+ delete_option( 'agca_admin_bar_new_content_media' );
60
+ delete_option( 'agca_admin_bar_update_notifications' );
61
+ delete_option( 'agca_admin_bar_admin_themes' );
62
+ delete_option( 'agca_remove_top_bar_dropdowns' );
63
+
64
+ /*Admin menu*/
65
+ delete_option( 'agca_admin_menu_turnonoff' );
66
+ delete_option( 'agca_admin_menu_agca_button_only' );
67
+ delete_option( 'agca_admin_menu_separator_first' );
68
+ delete_option( 'agca_admin_menu_separator_second' );
69
+ delete_option( 'agca_admin_menu_icons' );
70
+ delete_option( 'agca_admin_menu_arrow' );
71
+ delete_option( 'agca_admin_menu_submenu_round' );
72
+ delete_option( 'agca_admin_menu_submenu_round_size' );
73
+ delete_option( 'agca_admin_menu_brand' );
74
+ delete_option( 'agca_admin_menu_brand_link' );
75
+ delete_option( 'agca_admin_menu_autofold' );
76
+ delete_option( 'ag_edit_adminmenu_json' );
77
+ delete_option( 'ag_edit_adminmenu_json_new' );
78
+ delete_option( 'ag_add_adminmenu_json' );
79
+ delete_option( 'ag_colorizer_json' );
80
+ delete_option( 'agca_colorizer_turnonoff' );
81
+
82
+ delete_option( 'agca_custom_js' );
83
+ delete_option( 'agca_custom_css' );
84
+
85
+ delete_option( 'agca_selected_template' );
86
+ delete_option( 'agca_templates' );
87
+ delete_option( 'agca_disablewarning' );
88
+ delete_option( 'agca_disable_postver' );
89
+ delete_option( 'agca_menu_remove_client_profile' );
90
  ?>