Absolutely Glamorous Custom Admin - Version 6.7

Version Description

  • WP 5.7 compatibility
  • New AGCA brand
  • Improved admin UX
Download this release

Release Info

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

Code changes from version 6.6.3 to 6.7

.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
1
+ /vendor
2
+ tests/_output/*
ag-custom-admin.html CHANGED
@@ -1,91 +1,91 @@
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="https://cusmin.com">Upgrade</a></h1>
84
- <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>
85
- </br>
86
- <h1><a href="http://wordpressadminpanel.com/agca-support/">Support</a></h1>
87
- <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>
88
- <p>Happy blogging!</p>
89
- </br>
90
- </body>
91
  </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="https://cusmin.com">Upgrade</a></h1>
84
+ <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>
85
+ </br>
86
+ <h1><a href="https://cusmin.com/agca">Support</a></h1>
87
+ <p>Feel free to check our <a href="https://cusmin.com/agca">support page</a> in case you have found any issues with your AGCA or AGCA themes features.</p>
88
+ <p>Happy blogging!</p>
89
+ </br>
90
+ </body>
91
  </html>
images/advertising.jpg DELETED
Binary file
images/agca-background.png ADDED
Binary file
images/agca-logo.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="498.154" height="180.081" viewBox="0 0 498.154 180.081"><g transform="translate(-206.387 -561.565)"><path d="M424,725l2,.5-2,1Z" transform="translate(85.25 15.146)" fill="rgba(90,193,189,0.97)"/><path d="M13.815,51.044a11.145,11.145,0,0,1-5.5-1.681,22.886,22.886,0,0,1-4.7-3.7C1.28,43.319-.205,40.952.023,40.4a.189.189,0,0,1,.193-.115.545.545,0,0,1,.157.025H.735c3.623,0,7.63-.116,9.327-1.5a3.078,3.078,0,0,0,1.168-2.268c.167-2.3-1.672-5.049-2.361-5.789a15.91,15.91,0,0,1-2.923-4.477,16.842,16.842,0,0,1-1.358-5.3,15.88,15.88,0,0,1,.476-5.555,15.207,15.207,0,0,1,2.584-5.255,21.339,21.339,0,0,1,7.105-5.5A43.911,43.911,0,0,1,28.693.506,60.461,60.461,0,0,1,37.036,0,131.07,131.07,0,0,1,57.589,1.8,106.137,106.137,0,0,1,93.278,14.537a68.656,68.656,0,0,1,13.713,10.358,37.408,37.408,0,0,1,8.479,12.194A59.333,59.333,0,0,0,99.42,23.115a58.186,58.186,0,0,0-19.572-7.2,9.122,9.122,0,0,0-.22-.977,8.479,8.479,0,0,0-3.123-4.505A8.633,8.633,0,0,0,71.4,8.738a8.558,8.558,0,0,0-8.31,6.534,59.169,59.169,0,0,0-8.571,1.4,8.36,8.36,0,0,0-3.056-9.022,8.451,8.451,0,0,0-5-1.657,8.372,8.372,0,0,0-4.657,15.331c-1.106.556-2.213,1.157-3.29,1.788A59.2,59.2,0,0,0,16.985,45.068a61.454,61.454,0,0,0-2.943,5.972l-.058,0h-.01Zm8.153-41.2a9.61,9.61,0,1,0,5.725,1.9A9.582,9.582,0,0,0,21.968,9.843Z" transform="translate(206.387 561.565)" fill="#c5cecc"/><path d="M53.127,154.221a61.7,61.7,0,0,1-25.573-5.551A54.775,54.775,0,0,1,7.035,132.417a8.509,8.509,0,0,1-1.857-6.937,8.871,8.871,0,0,1,3.811-5.748,9.215,9.215,0,0,1,5.458-1.776,9.316,9.316,0,0,1,1.869.19,9.9,9.9,0,0,1,6.156,3.964,36.3,36.3,0,0,0,13.288,10.506,42.234,42.234,0,0,0,17.45,3.772c.261,0,.5,0,.724-.006H54.2a34.113,34.113,0,0,0,17.026-4.56,32.524,32.524,0,0,0,12.6-13.477,40.434,40.434,0,0,0,3.993-12.474A57.992,57.992,0,0,0,105.9,86.042c.622-1.135,1.217-2.307,1.769-3.482V97.929a59.36,59.36,0,0,1-6.839,28.444,52.6,52.6,0,0,1-19.053,20.315,49.217,49.217,0,0,1-13.166,5.648,58.564,58.564,0,0,1-15.071,1.883ZM10.176,89.751v0a49.318,49.318,0,0,1-3.726-6.19,55.281,55.281,0,0,1-4.837-13.3A68.7,68.7,0,0,1,0,55.115,65.053,65.053,0,0,1,1.734,39.83a52.7,52.7,0,0,1,5.2-13.354c.418-.758.862-1.517,1.321-2.257.087.556.193,1.139.317,1.734a15.978,15.978,0,0,0,6.485,9.179A13.477,13.477,0,0,0,22.676,37.8,40.709,40.709,0,0,0,19.15,55.115a39.962,39.962,0,0,0,4.495,19.226c.353.669.735,1.336,1.135,1.982a13.186,13.186,0,0,0-8.534,3.12,15.277,15.277,0,0,0-4.027,4.475,16.09,16.09,0,0,0-2.043,5.83Z" transform="translate(351.419 582.6)" fill="#23395b"/><path d="M370.093,460.051c-9.768.171-21.051-2.448-29.5-7.352a51.9,51.9,0,0,1-19.149-19.623,56.411,56.411,0,0,1-6.936-28.046,58.422,58.422,0,0,1,6.839-28.541,50.17,50.17,0,0,1,18.758-19.524,52.781,52.781,0,0,1,27.355-7.036c7.276-.088,16.411,1.107,23.031,4.132,6.631,3.165,12.9,6.83,16.48,11.406,1.707,1.713,1.228,6.471.741,8.842a10.342,10.342,0,0,1-4.3,5.946,7.344,7.344,0,0,1-6.057,1.289c-2.322-.523-2.9-2.008-5.188-3.906-6.072-6.736-15.642-10.062-24.707-9.87a37.916,37.916,0,0,0-17.158,4.777,32.824,32.824,0,0,0-12.249,12.939,42,42,0,0,0-4.4,19.546,40.126,40.126,0,0,0,4.4,19.027A33.131,33.131,0,0,0,368.438,442.1,39.12,39.12,0,0,0,380.422,440a27.727,27.727,0,0,0,9.349-5.14,11.879,11.879,0,0,1,6.609-2.577,7.62,7.62,0,0,1,5.862,1.882,9.509,9.509,0,0,1,3.713,6.244c.253,2.335.244,5.938-1.483,7.53C394.751,457.084,382.279,460.271,370.093,460.051Z" transform="translate(166.781 232.681)" fill="#23395b"/><path d="M352.577,460.051c9.768.171,21.053-2.448,29.5-7.352a51.9,51.9,0,0,0,19.15-19.623,56.408,56.408,0,0,0,6.937-28.046,58.42,58.42,0,0,0-6.84-28.541,50.173,50.173,0,0,0-18.76-19.524,52.789,52.789,0,0,0-27.358-7.036c-7.277-.088-16.413,1.107-23.033,4.132-6.631,3.165-12.9,6.83-16.481,11.406-1.708,1.713-1.228,6.471-.741,8.842a10.343,10.343,0,0,0,4.3,5.946,7.345,7.345,0,0,0,6.058,1.289c2.322-.523,2.9-2.008,5.188-3.906,6.072-6.736,15.644-10.062,24.71-9.87a37.921,37.921,0,0,1,17.159,4.777,32.827,32.827,0,0,1,12.25,12.939,42,42,0,0,1,4.4,19.546,40.124,40.124,0,0,1-4.4,19.027A33.135,33.135,0,0,1,354.232,442.1,39.126,39.126,0,0,1,342.247,440a27.727,27.727,0,0,1-9.349-5.14,11.881,11.881,0,0,0-6.61-2.577,7.621,7.621,0,0,0-5.862,1.882,9.509,9.509,0,0,0-3.713,6.244c-.253,2.335-.244,5.938,1.483,7.53C327.916,457.084,340.39,460.271,352.577,460.051Z" transform="translate(50.833 232.681)" fill="#bec5d0"/><path d="M50.035,110.011c-.22,0-.444,0-.663,0a46.477,46.477,0,0,1-24.936-7.24A51.182,51.182,0,0,1,6.555,83.153,59.078,59.078,0,0,1,.008,55.107,55.759,55.759,0,0,1,7.141,26.962,52.756,52.756,0,0,1,53.182,0c.253,0,.509,0,.761,0s.536-.006.8-.006A52.36,52.36,0,0,1,81.3,7.241a53.482,53.482,0,0,1,19.248,19.721,55.822,55.822,0,0,1,7.133,28.146h0v44.2a9.882,9.882,0,0,1-2.833,7.234,10.288,10.288,0,0,1-14.265,0,9.879,9.879,0,0,1-2.834-7.234V91.958a51.173,51.173,0,0,1-12.115,10.817,46.487,46.487,0,0,1-24.936,7.24C50.477,110.015,50.253,110.014,50.035,110.011Zm3.908-17.839c.188,0,.366.006.545.006a33,33,0,0,0,17.238-4.861,34.353,34.353,0,0,0,12.311-13.28,39.712,39.712,0,0,0,4.495-18.928,40.154,40.154,0,0,0-4.495-19.127A34.369,34.369,0,0,0,71.726,22.7a33,33,0,0,0-17.238-4.86c-.181,0-.364,0-.545,0l-.411,0A33.117,33.117,0,0,0,36.258,22.7a34.818,34.818,0,0,0-12.507,13.28,39.374,39.374,0,0,0-4.592,19.127,38.956,38.956,0,0,0,4.592,18.928A34.815,34.815,0,0,0,36.258,87.315a33.127,33.127,0,0,0,17.275,4.859Zm0,0,0,0Z" transform="translate(221.46 582.609)" fill="#23395b"/><path d="M64.076,5.045h0a54.914,54.914,0,0,0-6.787-.423c-.3,0-.581,0-.841.006s-.528-.005-.8-.005c-.636,0-1.281.011-1.917.033a5.556,5.556,0,0,1,10.342.387Z" transform="translate(218.96 571.987)" fill="#f01212"/><path d="M34.769,11.915h0A5.376,5.376,0,1,1,40,10.065c-1.767.527-3.527,1.15-5.233,1.851Z" transform="translate(217.005 569.287)" fill="#3dce3d"/><path d="M6.595,0A6.595,6.595,0,1,1,0,6.595,6.595,6.595,0,0,1,6.595,0Z" transform="translate(220.201 576.482) rotate(-16)" fill="#0f0fc7"/><path d="M57.654,110.012c-.22,0-.443.005-.663.005a46.5,46.5,0,0,1-24.936-7.24A51.174,51.174,0,0,1,19.94,91.959v7.35a9.882,9.882,0,0,1-2.833,7.235,9.609,9.609,0,0,1-7.133,2.874,9.608,9.608,0,0,1-7.133-2.876A9.886,9.886,0,0,1,.007,99.309v-44.2h0A55.808,55.808,0,0,1,7.139,26.964,53.464,53.464,0,0,1,26.387,7.241,52.355,52.355,0,0,1,52.943,0c.266,0,.536,0,.8.006S54.253,0,54.506,0a52.76,52.76,0,0,1,46.042,26.961,55.765,55.765,0,0,1,7.132,28.146,59.084,59.084,0,0,1-6.547,28.046,51.176,51.176,0,0,1-17.88,19.623,46.482,46.482,0,0,1-24.936,7.24C58.1,110.017,57.874,110.015,57.654,110.012ZM35.963,22.7a34.352,34.352,0,0,0-12.311,13.28,40.136,40.136,0,0,0-4.495,19.127,39.694,39.694,0,0,0,4.495,18.929A34.353,34.353,0,0,0,35.963,87.316a33,33,0,0,0,17.242,4.862c.178,0,.355,0,.54-.005l.41,0a33.127,33.127,0,0,0,17.275-4.859A34.833,34.833,0,0,0,83.938,74.037a38.957,38.957,0,0,0,4.592-18.929,39.37,39.37,0,0,0-4.592-19.127A34.834,34.834,0,0,0,71.431,22.7a33.119,33.119,0,0,0-17.275-4.858l-.411,0c-.179,0-.361,0-.54,0A33,33,0,0,0,35.963,22.7ZM53.745,92.173l0,0,0,0Z" transform="translate(596.851 582.607)" fill="#bec5d0"/></g></svg>
images/agca.png DELETED
Binary file
images/cusmin-logo.svg ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ width="630px" height="628px" viewBox="14.5 144.5 630 628" enable-background="new 14.5 144.5 630 628" xml:space="preserve">
5
+ <path fill="#826C63" d="M22.176,459.569c0.107-148.292,106.659-276.429,252.468-301.53c101.109-17.405,189.839,9.909,265.619,79.105
6
+ c5.025,4.589,4.95,4.665,0.091,9.579c-18.987,19.195-38.03,38.336-56.895,57.652c-2.589,2.65-3.854,2.698-6.607,0.109
7
+ c-38.229-35.942-83.52-55.73-135.988-58.721c-108.471-6.182-204.786,70.362-223.026,177.18
8
+ C98.713,534.93,167.717,641.846,278.021,668.18c75.265,17.971,142.093-0.697,199.206-53.114c2.839-2.605,4.145-2.731,6.898,0.027
9
+ c19.542,19.582,39.208,39.043,59.031,58.341c2.954,2.875,2.54,4.254-0.163,6.838c-48.604,46.447-106.005,74.789-172.692,83.896
10
+ c-134.173,18.317-263.947-53.306-320.47-176.729C31.691,547.824,22.144,503.681,22.176,459.569z"/>
11
+ <path fill="#E75E3B" d="M189.743,461.675c0.279-35.251,12.118-66.052,35.46-92.509c2.796-3.168,4.471-3.993,7.98-0.455
12
+ c16.776,16.912,33.846,33.536,50.943,50.126c2.379,2.31,2.683,3.532,0.358,6.258c-15.772,18.497-17.97,44.327-5.852,65.258
13
+ c11.934,20.611,36.038,31.74,59.191,27.327c23.854-4.546,42.271-23.073,45.867-46.882c2.533-16.788-1.412-32.14-12.478-45.267
14
+ c-2.104-2.496-1.872-3.759,0.312-5.96c17.13-17.27,34.182-34.615,51.098-52.093c2.524-2.607,3.854-2.453,6.129,0.156
15
+ c35.967,41.242,46.969,88.324,28.796,139.929c-17.878,50.769-55,81.611-108.243,90.352
16
+ c-77.521,12.724-147.786-40.599-158.557-118.765C189.948,473.336,189.98,467.527,189.743,461.675z"/>
17
+ </svg>
languages/ag-custom-admin-fr_FR.po CHANGED
@@ -1517,8 +1517,8 @@ msgstr "Odaberite boju"
1517
  #~ msgid "AG Custom Admin"
1518
  #~ msgstr "AG Custom Admin"
1519
 
1520
- #~ msgid "http://wordpressadminpanel.com/ag-custom-admin/"
1521
- #~ msgstr "http://wordpressadminpanel.com/ag-custom-admin/"
1522
 
1523
  #~ msgid ""
1524
  #~ "All-in-one tool for admin panel customization. Change almost everything: "
@@ -1533,5 +1533,5 @@ msgstr "Odaberite boju"
1533
  #~ msgid "WAP"
1534
  #~ msgstr "WAP"
1535
 
1536
- #~ msgid "http://www.wordpressadminpanel.com/"
1537
- #~ msgstr "http://www.wordpressadminpanel.com/"
1517
  #~ msgid "AG Custom Admin"
1518
  #~ msgstr "AG Custom Admin"
1519
 
1520
+ #~ msgid "https://cusmin.com/agca"
1521
+ #~ msgstr "https://cusmin.com/agca"
1522
 
1523
  #~ msgid ""
1524
  #~ "All-in-one tool for admin panel customization. Change almost everything: "
1533
  #~ msgid "WAP"
1534
  #~ msgstr "WAP"
1535
 
1536
+ #~ msgid "https://cusmin.com/"
1537
+ #~ msgstr "https://cusmin.com/"
languages/ag-custom-admin-hr.po CHANGED
@@ -1280,8 +1280,8 @@ msgid "AG Custom Admin"
1280
  msgstr "AG Custom Admin"
1281
 
1282
  #. Plugin URI of the plugin/theme
1283
- msgid "http://wordpressadminpanel.com/ag-custom-admin/"
1284
- msgstr "http://wordpressadminpanel.com/ag-custom-admin/"
1285
 
1286
  #. Description of the plugin/theme
1287
  msgid "All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes."
@@ -1292,5 +1292,5 @@ msgid "WAP"
1292
  msgstr "WAP"
1293
 
1294
  #. Author URI of the plugin/theme
1295
- msgid "http://www.wordpressadminpanel.com/"
1296
- msgstr "http://www.wordpressadminpanel.com/"
1280
  msgstr "AG Custom Admin"
1281
 
1282
  #. Plugin URI of the plugin/theme
1283
+ msgid "https://cusmin.com/agca"
1284
+ msgstr "https://cusmin.com/agca"
1285
 
1286
  #. Description of the plugin/theme
1287
  msgid "All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar etc. Apply admin panel themes."
1292
  msgstr "WAP"
1293
 
1294
  #. Author URI of the plugin/theme
1295
+ msgid "https://cusmin.com"
1296
+ msgstr "https://cusmin.com"
plugin.php CHANGED
@@ -1,3247 +1,3259 @@
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.6.3
8
- Text Domain: ag-custom-admin
9
- Domain Path: /languages
10
- Author URI: https://cusmin.com
11
-
12
- Copyright 2021. Cusmin (email : info@cusmin.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.6.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
- 'read_and_close' => true,
136
- ]);
137
- }
138
- }
139
-
140
- function checkGET(){
141
- if(isset($_GET['agca_action'])){
142
- if($_GET['agca_action'] =="remove_templates"){
143
- $this->delete_template_images_all();
144
- update_option('agca_templates', "");
145
- update_option('agca_selected_template', "");
146
- }
147
- }
148
- if(isset($_GET['agca_debug'])){
149
- if($_GET['agca_debug'] =="true"){
150
- $this->agca_debug = true;
151
- }else{
152
- $this->agca_debug = false;
153
- }
154
- }
155
- }
156
-
157
- function checkPOST(){
158
- if(isset($_POST['_agca_save_template'])){
159
- $this->verifyPostRequest();
160
- //print_r($_POST);
161
- $data = $_POST['templates_data'];
162
- $parts = explode("|||",$data);
163
-
164
- $common_data = $parts [0];
165
- $admin_js = $parts [1];
166
- $admin_css = $parts [2];
167
- $login_js = $parts [3];
168
- $login_css = $parts [4];
169
- $settings = $parts [5];
170
- $images = $parts [6];
171
-
172
- $template_name = $_POST['templates_name'];
173
-
174
- update_option('agca_selected_template', $template_name);
175
-
176
- $templates = get_option( 'agca_templates' );
177
- if($templates == ""){
178
- $templates = array();
179
- }
180
-
181
- $templates[$template_name] = array(
182
- 'common'=>$common_data,
183
- 'admin'=>"",
184
- 'adminjs'=>$admin_js,
185
- 'admincss'=>$admin_css,
186
- 'login'=>"",
187
- 'loginjs'=>$login_js,
188
- 'logincss'=>$login_css,
189
- 'images'=>$images,
190
- 'settings'=>$settings
191
- );
192
- update_option('agca_templates', $templates);
193
-
194
- $_POST = array();
195
-
196
- }else if(isset($_POST['_agca_templates_session'])){
197
- $this->verifyPostRequest();
198
- $this->agcaAdminSession();
199
- if($_POST['template'] !="")
200
- $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
201
-
202
- //print_r($_SESSION);
203
- echo "_agca_templates_session:OK";
204
- exit;
205
- }else if(isset($_POST['_agca_templates_session_remove_license'])){
206
- $this->verifyPostRequest();
207
- $this->agcaAdminSession();
208
- if($_POST['template'] !="")
209
- $_SESSION["AGCA"]["Templates"][$_POST['template']] = null;
210
- print_r($_SESSION);
211
- echo "_agca_templates_session_remove_license:OK";
212
- exit;
213
- }else if(isset($_POST['_agca_get_templates'])){
214
- $this->verifyPostRequest();
215
- $templates = get_option( 'agca_templates' );
216
- if($templates == "") $templates = array();
217
- $results = array();
218
- foreach($templates as $key=>$val){
219
- $results[]=$key;
220
- }
221
- echo json_encode($results);
222
- exit;
223
- }else if(isset($_POST['_agca_activate_template'])){
224
- $this->verifyPostRequest();
225
- update_option('agca_selected_template', $_POST['_agca_activate_template']);
226
- $_POST = array();
227
- //unset($_POST);
228
- exit;
229
- }else if(isset($_POST['_agca_template_settings'])){
230
- $this->verifyPostRequest();
231
- $settings = $_POST['_agca_template_settings'];
232
-
233
- $templates = get_option( 'agca_templates' );
234
- if($templates == ""){
235
- $templates = array();
236
- }
237
- $template_name = $_POST["_agca_current_template"];
238
-
239
- $templates[$template_name]["settings"] = $settings;
240
- update_option('agca_templates', $templates);
241
-
242
- $_POST = array();
243
- //print_r($templates);
244
- exit;
245
- }else if(isset($_POST['_agca_upload_image'])){
246
- $this->verifyPostRequest();
247
- function my_sideload_image() {
248
- $remoteurl = $_POST['_agca_upload_image'];
249
- $file = media_sideload_image( $remoteurl, 0 ,__("Absolutely Glamorous Custom Admin theme image (do not delete)", 'ag-custom-admin'));
250
- try{
251
- $fileparts = explode("src='", $file);
252
- $url=explode("'",$fileparts[1]);
253
- echo $url[0];
254
- }catch (\Exception $e){}
255
- exit;
256
- }
257
- add_action( 'admin_init', 'my_sideload_image' );
258
-
259
- }else if(isset($_POST['_agca_remove_template_images'])){
260
- $this->verifyPostRequest();
261
- $this->delete_template_images($_POST['_agca_remove_template_images']);
262
- exit;
263
- }
264
- }
265
-
266
- function verifyPostRequest(){
267
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
268
- if (!is_admin()) {
269
- _e('Not allowed. This action is allowed exclusively in admin panel', 'ag-custom-admin');
270
- exit;
271
- }
272
- //In case of problems with saving AGCA settings on MS disable verification temporary
273
- if(get_option('agca_disable_postver')){
274
- return;
275
- }
276
- if (is_multisite()) {
277
- $blog_id = get_current_blog_id();
278
- $user_id = get_current_user_id();
279
- $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');
280
- if (is_user_member_of_blog($user_id, $blog_id)) {
281
- if (!current_user_can('manage_options')) {
282
- _e('Multi-site: Current user is not recognized as administrator.', 'ag-custom-admin');
283
- echo ' '.$msError;
284
- exit;
285
- }
286
- } else {
287
- printf(
288
- /*translators: 1: User Id 2: Blog Id*/
289
- __('Multi-site: User (%1$s) does not have access to this blog (%2$s).', 'ag-custom-admin'),
290
- $user_id,
291
- $blog_id
292
- );
293
- echo ' '. $msError;
294
- exit;
295
- }
296
- } else {
297
- include_once($this->filePath('wp-includes/pluggable.php'));
298
- if (!is_user_logged_in() || !current_user_can('manage_options')) {
299
- echo !is_user_logged_in() ? __('User is not logged in.', 'ag-custom-admin').' ' : '';
300
- echo !current_user_can('manage_options') ? __('User can not manage options.', 'ag-custom-admin').' ' : '';
301
- exit;
302
- }
303
- }
304
- if (!wp_verify_nonce($_POST['_agca_token'], 'agca_form')) {
305
- echo __('Nonce verification failed.', 'ag-custom-admin');
306
- exit;
307
- }
308
- }
309
- }
310
-
311
- function get_language_strings() {
312
- $strings = array(
313
-
314
- );
315
- return $strings;
316
- }
317
-
318
- function admin_bar_changes(){
319
- if( current_user_can( 'manage_options' )){
320
- global $wp_admin_bar;
321
- if(!is_network_admin()){
322
- $wp_admin_bar->add_menu( array(
323
- 'id' => 'agca-admin-themes',
324
- 'title' => '<span class="ab-icon"></span>'.__( 'Admin Themes', 'ag-custom-admin' ),
325
- 'href' => 'tools.php?page=ag-custom-admin/plugin.php#ag-templates'
326
- ));
327
- }
328
- }
329
- }
330
-
331
- function delete_template_images_all(){
332
- $templates = get_option('agca_templates');
333
- if($templates != null && $templates != ""){
334
- foreach($templates as $template){
335
- if($template != null && $template['images'] != null && $template['images'] != ""){
336
- //print_r($template['images']);
337
- $imgs = explode(',',$template['images']);
338
- foreach($imgs as $imageSrc){
339
- $this->delete_attachment_by_src($imageSrc);
340
- }
341
- //print_r($imgs);
342
- }
343
- }
344
- }
345
- //print_r($templates);
346
- }
347
-
348
- function delete_template_images($template_name){
349
- $templates = get_option('agca_templates');
350
- if($templates != null && $templates != ""){
351
- $template = $templates[$template_name];
352
- if($template != null && $template['images'] != null && $template['images'] != ""){
353
- //print_r($template['images']); exit;
354
- $imgs = explode(',',$template['images']);
355
- foreach($imgs as $imageSrc){
356
- $this->delete_attachment_by_src($imageSrc);
357
- }
358
- //print_r($imgs);
359
- }
360
- }
361
- //print_r($templates);
362
- }
363
-
364
- function delete_attachment_by_src ($image_src) {
365
- global $wpdb;
366
- $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
367
- $id = $wpdb->get_var($query);
368
- wp_delete_attachment( $id, $true );
369
- }
370
-
371
- function get_installed_agca_templates(){
372
- $templates = get_option( 'agca_templates' );
373
- if($templates == "")return '[]';
374
- $results = array();
375
- foreach($templates as $key=>$val){
376
- $results[]=$key;
377
- }
378
- return json_encode($results);
379
- }
380
-
381
- function isGuest(){
382
- global $user_login;
383
- if($user_login) {
384
- return false;
385
- }else{
386
- return true;
387
- }
388
- }
389
- function change_title($admin_title, $title){
390
- //return get_bloginfo('name').' - '.$title;
391
- if(get_option('agca_custom_title')!=""){
392
- $blog = get_bloginfo('name');
393
- $page = $title;
394
- $customTitle = get_option('agca_custom_title');
395
- $customTitle = str_replace('%BLOG%',$blog,$customTitle);
396
- $customTitle = str_replace('%PAGE%',$page,$customTitle);
397
- return $customTitle;
398
- }else{
399
- return $admin_title;
400
- }
401
- }
402
- function agca_get_includes() {
403
- ?>
404
- <script type="text/javascript">
405
- <?php
406
- //AGCA GLOBALS
407
- echo "var agca_global_plugin_url = '".$this->pluginUrl()."';";
408
- ?>
409
- </script>
410
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
411
- <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"; ?>" />
412
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
413
- <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>
414
-
415
- <?php
416
- if($this->context == "login"){
417
- ?>
418
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/login.min.css" />
419
- <?php
420
- }else{
421
- ?>
422
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/admin.min.css" />
423
- <?php
424
- }
425
- ?>
426
- <?php
427
- echo $this->templateCustomizations;
428
-
429
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
430
- ?>
431
- <style type="text/css">
432
- <?php
433
- echo get_option('agca_custom_css');
434
- ?>
435
- </style>
436
- <script type="text/javascript">
437
- try{
438
- eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
439
- }catch(e){
440
- 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'); ?>)');
441
- console.log(e);
442
- }
443
- </script>
444
- <?php
445
- }
446
- }
447
-
448
- function agca_enqueue_scripts() {
449
- wp_enqueue_script('jquery');
450
- //TODO: Use this instead of manually adding scripts
451
- //wp_enqueue_script('agca-script', __FILE__.'/script/ag_script.js', array('jquery'),$this->agca_version );
452
- }
453
-
454
- function WPSPluginIsLoginPage(){
455
- $WPSPluginName = 'wps-hide-login/wps-hide-login.php';
456
- if(is_multisite()){
457
- if ( ! function_exists( 'is_plugin_active_for_network' ) ){
458
- $pluginPhpFilePath = $this->filePath('wp-admin/includes/plugins.php');
459
- if(!file_exists($pluginPhpFilePath)){
460
- return '';
461
- }
462
- require_once($pluginPhpFilePath);
463
- }
464
-
465
- if(!$this->isPluginActiveForNetwork($WPSPluginName)){
466
- return '';
467
- }
468
- }else{
469
- if(!$this->isPluginActive($WPSPluginName)){
470
- return '';
471
- }
472
- }
473
-
474
- if ( $slug = get_option( 'whl_page' ) ) {
475
- return $slug;
476
- } else if ( ( is_multisite() && $this->isPluginActiveForNetwork($WPSPluginName) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
477
- return $slug;
478
- } else if ( $slug = 'login' ) {
479
- return $slug;
480
- }
481
- $requestURI = $_SERVER['REQUEST_URI'];
482
- return $this->startsWith('/'.$slug.'/', $requestURI);
483
- }
484
-
485
- function reloadScript(){
486
- $isAdmin = false;
487
- if(defined('WP_ADMIN') && WP_ADMIN == 1){
488
- $isAdmin = true;
489
- }
490
- if($isAdmin || $this->WPSPluginIsLoginPage()){
491
- $this->agca_enqueue_scripts();
492
- }
493
- }
494
-
495
- function agca_register_settings() {
496
- register_setting( 'agca-options-group', 'agca_role_allbutadmin' );
497
- register_setting( 'agca-options-group', 'agca_screen_options_menu' );
498
- register_setting( 'agca-options-group', 'agca_help_menu' );
499
- register_setting( 'agca-options-group', 'agca_logout' );
500
- register_setting( 'agca-options-group', 'agca_remove_your_profile' );
501
- register_setting( 'agca-options-group', 'agca_logout_only' );
502
- register_setting( 'agca-options-group', 'agca_custom_title' );
503
- register_setting( 'agca-options-group', 'agca_howdy' );
504
- register_setting( 'agca-options-group', 'agca_header' );
505
- register_setting( 'agca-options-group', 'agca_header_show_logout' );
506
- register_setting( 'agca-options-group', 'agca_footer' );
507
- register_setting( 'agca-options-group', 'agca_privacy_options' );
508
- register_setting( 'agca-options-group', 'agca_header_logo' );
509
- register_setting( 'agca-options-group', 'agca_header_logo_custom' );
510
- register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
511
- register_setting( 'agca-options-group', 'agca_remove_site_link' );
512
- register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
513
- register_setting( 'agca-options-group', 'agca_profile_color_scheme' );
514
-
515
- register_setting( 'agca-options-group', 'agca_site_heading' );
516
- register_setting( 'agca-options-group', 'agca_custom_site_heading' );
517
- register_setting( 'agca-options-group', 'agca_update_bar' );
518
-
519
- register_setting( 'agca-options-group', 'agca_footer_left' );
520
- register_setting( 'agca-options-group', 'agca_footer_left_hide' );
521
- register_setting( 'agca-options-group', 'agca_footer_right' );
522
- register_setting( 'agca-options-group', 'agca_footer_right_hide' );
523
-
524
- register_setting( 'agca-options-group', 'agca_login_banner' );
525
- register_setting( 'agca-options-group', 'agca_login_banner_text' );
526
- register_setting( 'agca-options-group', 'agca_login_photo_remove' );
527
- register_setting( 'agca-options-group', 'agca_login_photo_url' );
528
- register_setting( 'agca-options-group', 'agca_login_photo_href' );
529
- register_setting( 'agca-options-group', 'agca_login_round_box' );
530
- register_setting( 'agca-options-group', 'agca_login_round_box_size' );
531
- register_setting( 'agca-options-group', 'agca_login_round_box_skip_logo' );
532
-
533
-
534
- register_setting( 'agca-options-group', 'agca_dashboard_icon' );
535
- register_setting( 'agca-options-group', 'agca_dashboard_text' );
536
- register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
537
- register_setting( 'agca-options-group', 'agca_dashboard_widget_welcome' );
538
- register_setting( 'agca-options-group', 'agca_dashboard_widget_activity' );
539
- register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
540
- register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
541
- register_setting( 'agca-options-group', 'agca_dashboard_widget_qp' );
542
- register_setting( 'agca-options-group', 'agca_dashboard_widget_rn' );
543
- register_setting( 'agca-options-group', 'agca_dashboard_widget_rd' );
544
- register_setting( 'agca-options-group', 'agca_dashboard_widget_primary' );
545
- register_setting( 'agca-options-group', 'agca_dashboard_widget_secondary' );
546
-
547
- //WP3.3
548
- register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
549
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
550
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_post' );
551
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_link' );
552
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_page' );
553
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_user' );
554
- register_setting( 'agca-options-group', 'agca_admin_bar_new_content_media' );
555
- register_setting( 'agca-options-group', 'agca_admin_bar_update_notifications' );
556
- register_setting( 'agca-options-group', 'agca_admin_bar_admin_themes' );
557
- register_setting( 'agca-options-group', 'agca_remove_top_bar_dropdowns' );
558
- register_setting( 'agca-options-group', 'agca_admin_bar_frontend' );
559
- register_setting( 'agca-options-group', 'agca_admin_bar_frontend_hide' );
560
- register_setting( 'agca-options-group', 'agca_login_register_remove' );
561
- register_setting( 'agca-options-group', 'agca_login_register_href' );
562
- register_setting( 'agca-options-group', 'agca_login_lostpassword_remove' );
563
- register_setting( 'agca-options-group', 'agca_admin_capability' );
564
- register_setting( 'agca-options-group', 'agca_disablewarning' );
565
- register_setting( 'agca-template-group', 'agca_selected_template' );
566
- register_setting( 'agca-template-group', 'agca_templates' );
567
- //delete_option( 'agca_templates' );
568
-
569
-
570
- /*Admin menu*/
571
- register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
572
- register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
573
- register_setting( 'agca-options-group', 'agca_admin_menu_separators' );
574
- register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
575
- register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
576
- register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
577
- register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round' );
578
- register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round_size' );
579
- register_setting( 'agca-options-group', 'agca_admin_menu_brand' );
580
- register_setting( 'agca-options-group', 'agca_admin_menu_brand_link' );
581
- register_setting( 'agca-options-group', 'agca_admin_menu_autofold' );
582
- register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
583
- register_setting( 'agca-options-group', 'ag_edit_adminmenu_json_new' );
584
- register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
585
- register_setting( 'agca-options-group', 'ag_colorizer_json' );
586
- register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
587
-
588
- register_setting( 'agca-options-group', 'agca_custom_js' );
589
- register_setting( 'agca-options-group', 'agca_custom_css' );
590
- register_setting( 'agca-options-group', 'agca_disable_postver' );
591
- register_setting( 'agca-options-group', 'agca_menu_remove_client_profile' );
592
- register_setting( 'agca-options-group', 'agca_menu_remove_customize_button' );
593
-
594
-
595
- if(!empty($_POST)){
596
- if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
597
- $this->verifyPostRequest();
598
- if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
599
- if($_FILES["settings_import_file"]["error"] > 0){
600
- }else{
601
- $file = $_FILES['settings_import_file'];
602
- if($this->startsWith($file['name'],'AGCA_Settings')){
603
- if (file_exists($file['tmp_name'])) {
604
- $fh = fopen($file['tmp_name'], 'r');
605
- $theData = "";
606
- if(filesize($file['tmp_name']) > 0){
607
- $theData = fread($fh,filesize($file['tmp_name']));
608
- }
609
- fclose($fh);
610
- $this->importSettings($theData);
611
- }
612
- }
613
- }
614
- }
615
- }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
616
- $this->verifyPostRequest();
617
- $this->exportSettings();
618
- }
619
- }
620
-
621
- if(isset($_GET['agca_action'])){
622
- if($_GET['agca_action'] == "disablewarning"){
623
- update_option('agca_disablewarning', true);
624
- }
625
- }
626
- }
627
-
628
- function agca_deactivate() {
629
-
630
- }
631
-
632
- function getOptions(){
633
- return Array(
634
- 'agca_role_allbutadmin',
635
- 'agca_admin_bar_frontend',
636
- 'agca_admin_bar_frontend_hide',
637
- 'agca_login_register_remove',
638
- 'agca_login_register_href',
639
- 'agca_login_lostpassword_remove',
640
- 'agca_admin_capability',
641
- 'agca_screen_options_menu',
642
- 'agca_help_menu',
643
- 'agca_logout',
644
- 'agca_remove_your_profile',
645
- 'agca_logout_only',
646
- 'agca_custom_title',
647
- 'agca_howdy',
648
- 'agca_header',
649
- 'agca_header_show_logout',
650
- 'agca_footer',
651
- 'agca_privacy_options',
652
- 'agca_header_logo',
653
- 'agca_header_logo_custom',
654
- 'agca_remove_site_link',
655
- 'agca_wp_logo_custom',
656
- 'agca_wp_logo_custom_link',
657
- 'agca_profile_color_scheme',
658
- 'agca_site_heading',
659
- 'agca_custom_site_heading',
660
- 'agca_update_bar',
661
- 'agca_footer_left',
662
- 'agca_footer_left_hide',
663
- 'agca_footer_right',
664
- 'agca_footer_right_hide',
665
- 'agca_login_banner',
666
- 'agca_login_banner_text',
667
- 'agca_login_photo_remove',
668
- 'agca_login_photo_url',
669
- 'agca_login_photo_href',
670
- 'agca_login_round_box',
671
- 'agca_login_round_box_size',
672
- 'agca_login_round_box_skip_logo',
673
- 'agca_dashboard_icon',
674
- 'agca_dashboard_text',
675
- 'agca_dashboard_text_paragraph',
676
- 'agca_dashboard_widget_welcome',
677
- 'agca_dashboard_widget_activity',
678
- 'agca_dashboard_widget_il',
679
- 'agca_dashboard_widget_plugins',
680
- 'agca_dashboard_widget_qp',
681
- 'agca_dashboard_widget_rn',
682
- 'agca_dashboard_widget_rd',
683
- 'agca_dashboard_widget_primary',
684
- 'agca_dashboard_widget_secondary',
685
- 'agca_admin_bar_comments',
686
- 'agca_admin_bar_new_content',
687
- 'agca_admin_bar_new_content_post',
688
- 'agca_admin_bar_new_content_link',
689
- 'agca_admin_bar_new_content_page',
690
- 'agca_admin_bar_new_content_user',
691
- 'agca_admin_bar_new_content_media',
692
- 'agca_admin_bar_update_notifications',
693
- 'agca_admin_bar_admin_themes',
694
- 'agca_remove_top_bar_dropdowns',
695
- 'agca_admin_menu_turnonoff',
696
- 'agca_admin_menu_agca_button_only',
697
- 'agca_admin_menu_separators',
698
- 'agca_admin_menu_icons',
699
- 'agca_admin_menu_arrow',
700
- 'agca_admin_menu_submenu_round',
701
- 'agca_admin_menu_submenu_round_size',
702
- 'agca_admin_menu_brand',
703
- 'agca_admin_menu_brand_link',
704
- 'agca_admin_menu_autofold',
705
- 'agca_admin_menu_collapse_button',
706
- 'ag_edit_adminmenu_json',
707
- 'ag_edit_adminmenu_json_new',
708
- 'ag_add_adminmenu_json',
709
- 'ag_colorizer_json',
710
- 'agca_colorizer_turnonof',
711
- 'agca_custom_js',
712
- 'agca_custom_css',
713
- 'agca_colorizer_turnonoff',
714
- 'agca_disablewarning',
715
- 'agca_disable_postver',
716
- 'agca_menu_remove_client_profile',
717
- 'agca_menu_remove_customize_button',
718
- 'agca_selected_template',
719
- 'agca_templates',
720
- );
721
- }
722
-
723
- function getTextEditor($name){
724
- $settings = array(
725
- 'textarea_name' => $name,
726
- 'media_buttons' => true,
727
- 'tinymce' => array(
728
- 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
729
- 'bullist,blockquote,|,justifyleft,justifycenter' .
730
- ',justifyright,justifyfull,|,link,unlink,|' .
731
- ',spellchecker,wp_fullscreen,wp_adv'
732
- )
733
- );
734
- wp_editor( get_option($name), $name, $settings );
735
- }
736
-
737
- function importSettings($settings){
738
- $exploaded = explode("|^|^|", $settings);
739
- // $str = "EEE: ";
740
- $str = '';
741
-
742
- $savedOptions = array();
743
-
744
- foreach ($exploaded as $setting){
745
-
746
- $key = current(explode(':', $setting));
747
- $value = substr($setting, strlen($key)+1);
748
- $cleanedValue = str_replace('|^|^|','',$value);
749
- $savedOptions[$key] = $cleanedValue;
750
- }
751
-
752
- // print_r($savedOptions);
753
-
754
- $optionNames = $this->getOptions();
755
-
756
- foreach ($optionNames as $optionName){
757
- $optionValue = "";
758
- $optionValue = $savedOptions[$optionName];
759
-
760
- if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
761
- $optionValue = str_replace("\\\"", "\"", $optionValue);
762
- $optionValue = str_replace("\\\'", "\'", $optionValue);
763
- }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
764
- //fb($optionValue);
765
- $optionValue = htmlspecialchars_decode($optionValue);
766
- $optionValue = str_replace("\'", '"', $optionValue);
767
- $optionValue = str_replace('\"', "'", $optionValue);
768
- //fb($optionValue);
769
- }else{
770
-
771
- }
772
- update_option($optionName, $optionValue);
773
- $str.="/".$optionName."/".$optionValue."\n";
774
- }
775
-
776
- //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
777
- //agca_script_css
778
- //
779
- // fb($savedOptions);
780
- if($savedOptions['agca_script_css'] != null){
781
- $optionValue = "";
782
- $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
783
- $optionValue = str_replace('\"', "'", $optionValue);
784
- update_option('agca_custom_css', $optionValue);
785
- }
786
- if($savedOptions['agca_script_js'] != null){
787
- $optionValue = "";
788
- $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
789
- $optionValue = str_replace('\"', "'", $optionValue);
790
- update_option('agca_custom_js', $optionValue);
791
- }
792
-
793
- //echo $str;
794
-
795
- //save imported settings
796
- $this->saveAfterImport = true;
797
- }
798
-
799
- function exportSettings(){
800
- $str = "";
801
-
802
- $include_menu_settings = false;
803
- if(isset($_POST['export_settings_include_admin_menu'])){
804
- if($_POST['export_settings_include_admin_menu'] == 'on'){
805
- $include_menu_settings = true;
806
- }
807
- }
808
-
809
- foreach ($_POST as $key => $value) {
810
- if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
811
- if($this->startsWith($key,'ag_edit_adminmenu')){
812
- if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
813
- }else{
814
- $str .=$key. ":".$value."|^|^|";
815
- }
816
- }
817
- }
818
-
819
- $filename = __('AGCA_Settings', 'ag-custom-admin').'_'.date("Y-M-d_H-i-s").'.agca';
820
- header("Cache-Control: public");
821
- header("Content-Description: File Transfer");
822
- header("Content-Disposition: attachment; filename=$filename");
823
- header("Content-Type: text/plain; ");
824
- header("Content-Transfer-Encoding: binary");
825
- echo $str;
826
- die();
827
- }
828
-
829
- function startsWith($haystack, $needle)
830
- {
831
- $length = strlen($needle);
832
- return (substr($haystack, 0, $length) === $needle);
833
- }
834
-
835
-
836
-
837
- function agca_create_menu() {
838
- add_management_page('AGCA', 'AGCA', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
839
- }
840
-
841
- function agca_create_admin_button($name,$arr) {
842
-
843
- $href = $arr["value"];
844
- $target =$arr["target"];
845
- $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>";
846
-
847
- return $button;
848
- }
849
- function agca_decode($code){
850
- $code = str_replace("{","",$code);
851
- $code = str_replace("}","",$code);
852
- $code = str_replace("\", \"","\"|||\"",$code);
853
- $elements = explode("|||",$code);
854
-
855
- return $elements;
856
- }
857
-
858
- function jsonMenuArray($json,$type){
859
- $arr = explode("|",$json);
860
- $elements = "";
861
- $array ="";
862
- $first = true;
863
- //print_r($json);
864
- if($type == "colorizer"){
865
- $elements = json_decode($arr[0],true);
866
- if($elements !=""){
867
- return $elements;
868
- }
869
- }else if($type == "buttons"){
870
- $elements = json_decode($arr[0],true);
871
- if($elements !=""){
872
- foreach($elements as $k => $v){
873
- $array.=$this->agca_create_admin_button($k,$v);
874
- }
875
- }
876
- }else if($type == "buttonsJq"){
877
- $elements = json_decode($arr[0],true);
878
- if($elements !=""){
879
- foreach($elements as $k => $v){
880
- $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>';
881
- }
882
- }
883
- }else{
884
- if(isset($arr[$type])){
885
- $elements = $this->agca_decode($arr[$type]);
886
- }
887
-
888
- if($elements !=""){
889
- foreach($elements as $element){
890
- if(!$first){
891
- $array .=",";
892
- }
893
- $parts = explode(" : ",$element);
894
- if(isset($parts[0]) && isset($parts[1])){
895
- $array.="[".$parts[0].", ".$parts[1]."]";
896
- }
897
- $first=false;
898
- }
899
- }
900
- }
901
-
902
- return $array;
903
- }
904
-
905
- function remove_dashboard_widget($widget,$side)
906
- {
907
- //side can be 'normal' or 'side'
908
- global $wp_meta_boxes;
909
- remove_meta_box($widget, 'dashboard', $side);
910
- }
911
-
912
- function get_wp_version(){
913
- global $wp_version;
914
- $array = explode('-', $wp_version);
915
- $version = $array[0];
916
- return $version;
917
- }
918
-
919
- function print_page()
920
- {
921
- if($this->isGuest() && get_option('agca_admin_bar_frontend_hide') or $this->isCusminActive()){
922
- return false;
923
- }
924
- if(!$this->isGuest()){
925
- ?><style type="text/css">
926
- <?php
927
- echo get_option('agca_custom_css');
928
- if(get_option('agca_menu_remove_customize_button')){
929
- echo '#wp-admin-bar-customize{display:none;}';
930
- }
931
- ?>
932
- </style><?php
933
- }
934
-
935
- if(get_option('agca_admin_bar_frontend_hide')==true){
936
- add_filter( 'show_admin_bar', '__return_false' );
937
- ?>
938
- <style type="text/css">
939
- #wpadminbar{
940
- display: none;
941
- }
942
- </style>
943
- <script type="text/javascript">
944
- window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
945
- </script>
946
- <?php
947
- }
948
- if(get_option('agca_admin_bar_frontend')!=true && is_user_logged_in()){
949
-
950
- $this->context = "page";
951
- //$wpversion = $this->get_wp_version();
952
- ?>
953
- <script type="text/javascript">
954
- var agca_version = "<?php echo $this->agca_version; ?>";
955
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
956
- var jQueryScriptOutputted = false;
957
- var agca_context = "page";
958
- var agca_orig_admin_menu = [];
959
- function initJQuery() {
960
- //if the jQuery object isn't available
961
- if (typeof(jQuery) == 'undefined') {
962
- if (! jQueryScriptOutputted) {
963
- //only output the script once..
964
- jQueryScriptOutputted = true;
965
- //output the script (load it from google api)
966
- document.write("<scr" + "ipt type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js\"></scr" + "ipt>");
967
- }
968
- setTimeout("initJQuery()", 50);
969
- } else {
970
- jQuery(function() {
971
- try
972
- {
973
- <?php if(get_option('agca_header')!=true){ ?>
974
- jQuery('#wpadminbar').show();
975
- <?php } ?>
976
-
977
- <?php $this->print_admin_bar_scripts(); ?>
978
- }catch(ex){}
979
- });
980
- }
981
- }
982
- initJQuery();
983
- </script>
984
- <script type="text/javascript">
985
- <?php echo "var agca_global_plugin_url = '".$this->pluginUrl()."';"; ?>
986
- </script>
987
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
988
- <script type="text/javascript">
989
- jQuery(document).ready(function(){
990
- <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
991
- foreach($this->colorizer as $k => $v){
992
- if(($k !="") and ($v !="")){
993
- if(
994
- $k == "color_header" ||
995
- $k == "color_font_header"
996
- ){
997
- ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
998
- }
999
-
1000
- }
1001
- }
1002
- ?>
1003
-
1004
- <?php
1005
- }
1006
- ?>
1007
- });
1008
- </script>
1009
- <?php
1010
- }
1011
-
1012
- }
1013
-
1014
- function print_admin_bar_scripts(){
1015
- ?>
1016
- <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
1017
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
1018
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
1019
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
1020
-
1021
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1022
- jQuery(".new_content_header_submenu").hide();
1023
- <?php } ?>
1024
-
1025
- <?php } ?>
1026
-
1027
- <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
1028
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
1029
- <?php } ?>
1030
- <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1031
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
1032
- <?php } ?>
1033
- <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
1034
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
1035
- <?php } ?>
1036
- <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
1037
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
1038
- <?php } ?>
1039
- <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
1040
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
1041
- <?php } ?>
1042
- <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
1043
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
1044
- <?php } ?>
1045
- <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
1046
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
1047
- <?php } ?>
1048
- <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
1049
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
1050
- <?php } ?>
1051
- <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
1052
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
1053
- <?php } ?>
1054
-
1055
-
1056
-
1057
- <?php if(get_option('agca_header_logo')==true){ ?>
1058
- jQuery("#wphead #header-logo").css("display","none");
1059
- jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
1060
-
1061
- <?php } ?>
1062
- <?php if(get_option('agca_header_logo_custom')!=""){ ?>
1063
-
1064
- var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
1065
-
1066
- advanced_url = img_url;
1067
- image = jQuery("<img id=\"admin-top-branding-logo\" style='max-width:98%;position:relative;'/>").attr("src",advanced_url);
1068
- jQuery(image).load(function() {
1069
- jQuery("#wpbody-content").prepend(image);
1070
- });
1071
-
1072
- <?php } ?>
1073
- <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
1074
- jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon")
1075
- .html("<img style=\"height:32px;margin-top:0\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />")
1076
- .css('background-image','none')
1077
- .css('width','auto');
1078
- jQuery("li#wp-admin-bar-wp-logo > a.ab-item")
1079
- .attr('href',"<?php echo get_bloginfo('wpurl'); ?>")
1080
- .css('padding', 0);
1081
- jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
1082
- jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
1083
- jQuery("#wp-admin-bar-wp-logo").show();
1084
- <?php }?>
1085
- <?php if(get_option('agca_remove_site_link')==true){ ?>
1086
- jQuery("#wp-admin-bar-site-name").css("display","none");
1087
-
1088
- <?php } ?>
1089
- <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
1090
- var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
1091
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1092
- if(href == "%SWITCH%"){
1093
- href = "<?php echo get_bloginfo('wpurl'); ?>";
1094
- <?php if($this->context == "page"){
1095
- ?>href+="/wp-admin";<?php
1096
- }
1097
- ?>
1098
- }
1099
- jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
1100
-
1101
- <?php }?>
1102
- <?php if(get_option('agca_site_heading')==true){ ?>
1103
- jQuery("#wphead #site-heading").css("display","none");
1104
- <?php } ?>
1105
- <?php if(get_option('agca_custom_site_heading')!=""){ ?>
1106
- jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
1107
- jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
1108
-
1109
- <?php } ?>
1110
- <?php if(get_option('agca_header')==true && $this->context =='admin'){
1111
- ?>
1112
- jQuery("#wpadminbar").css("display","none");
1113
- jQuery("body.admin-bar").css("padding-top","0");
1114
- jQuery("#wphead").css("display","none");
1115
- jQuery('html.wp-toolbar').css("padding-top","0");
1116
-
1117
- <?php } ?>
1118
- <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
1119
- <?php
1120
- $agca_logout_text = ((get_option('agca_logout')=="")?__("Log Out", 'ag-custom-admin'):get_option('agca_logout'));
1121
- ?>
1122
- 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>');
1123
-
1124
-
1125
- <?php } ?>
1126
- <?php
1127
- if(get_option('agca_custom_title')!=""){
1128
- //add_filter('admin_title', '$this->change_title', 10, 2);
1129
-
1130
- }
1131
- ?>
1132
- <?php if(get_option('agca_logout')!=""){ ?>
1133
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1134
- <?php } ?>
1135
- <?php if(get_option('agca_remove_your_profile')==true){ ?>
1136
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1137
- jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1138
- jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1139
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1140
- jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1141
- <?php } ?>
1142
- <?php if(get_option('agca_logout_only')==true){ ?>
1143
- var logout_content = jQuery("li#wp-admin-bar-logout").html();
1144
- jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout" style="display:block;">'+ logout_content +'</li>');
1145
- jQuery("#wp-admin-bar-logout a").css('padding','0 8px');
1146
-
1147
-
1148
- <?php } ?>
1149
-
1150
- <?php
1151
-
1152
-
1153
- }
1154
-
1155
- function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
1156
- if(get_option('agca_howdy')!=""){
1157
- $user_id = get_current_user_id();
1158
- $current_user = wp_get_current_user();
1159
- $profile_url = get_edit_profile_url( $user_id );
1160
-
1161
- if ( 0 != $user_id ) {
1162
- /* Add the "My Account" menu */
1163
- $avatar = get_avatar( $user_id, 28 );
1164
- $howdy = sprintf( __(get_option('agca_howdy').', %1$s'), $current_user->display_name );
1165
- $class = empty( $avatar ) ? '' : 'with-avatar';
1166
-
1167
- $wp_admin_bar->add_menu( array(
1168
- 'id' => 'my-account',
1169
- 'parent' => 'top-secondary',
1170
- 'title' => $howdy . $avatar,
1171
- 'href' => $profile_url,
1172
- 'meta' => array(
1173
- 'class' => $class,
1174
- ),
1175
- ) );
1176
-
1177
- }
1178
- }
1179
- }
1180
-
1181
- function updateAllColors(){
1182
-
1183
- ?>
1184
- function updateAllColors(){
1185
- <?php
1186
- foreach($this->colorizer as $k => $v){
1187
- if(($k !="") and ($v !="")){
1188
- ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1189
- }
1190
- }
1191
- ?>
1192
- jQuery('.color_picker').each(function(){
1193
- updateColor(jQuery(this).attr('id'),jQuery(this).val())
1194
- });
1195
- jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1196
- jQuery('#adminmenu li.wp-menu-open').css('border','none');
1197
- jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1198
- }<?php
1199
-
1200
- }
1201
- function admin_capabilities(){
1202
- global $wp_roles;
1203
- $capabs = $wp_roles->roles['administrator']['capabilities'];
1204
- $capabilitySelector = "";
1205
-
1206
- $selectedValue = get_option('agca_admin_capability');
1207
- if($selectedValue == ""){
1208
- $selectedValue = "edit_dashboard";
1209
- }
1210
- /*echo $selectedValue;
1211
- die;*/
1212
- ksort($capabs);
1213
- foreach($capabs as $k=>$v){
1214
- $selected = "";
1215
- if($this->startsWith($k, 'level_')) continue;
1216
- if($selectedValue == $k){
1217
- $selected = " selected=\"selected\" ";
1218
- }
1219
- $capabilitySelector .="<option value=\"$k\" $selected >".ucwords(str_replace('_', ' ', $k))."</option>\n";
1220
- }
1221
-
1222
- $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
1223
- }
1224
-
1225
- function admin_capability(){
1226
- $selectedValue = get_option('agca_admin_capability');
1227
- if($selectedValue == ""){
1228
- $selectedValue = "edit_dashboard";
1229
- }
1230
- return $selectedValue;
1231
- }
1232
-
1233
- function JSPrintAGCATemplateSettingsVar($settings){
1234
- echo "\n<script type=\"text/javascript\">\n";
1235
- echo "var agca_template_settings = ".preg_replace('#<script(.*?)>(.*?)</script>#is', '', $settings).";\n"; //TODO: think about this
1236
- echo "</script>";
1237
- }
1238
-
1239
- function appendSettingsToAGCATemplateCustomizations($customizations, $settings){
1240
- $template_settings = json_decode($settings);
1241
- //print_r($template_settings);
1242
- foreach($template_settings as $sett){
1243
- $key = $sett->code;
1244
-
1245
- //use default value if user's value is not set
1246
- $value="";
1247
- if($sett->value != ""){
1248
- $value = $sett->value;
1249
- }else{
1250
- $value = $sett->default_value;
1251
- }
1252
-
1253
- //Prepare settings
1254
- if($sett->type == 6){
1255
- if($value !== null && (strtolower($value) == "on" || $value == "1")){
1256
- $value = "true";
1257
- }else{
1258
- $value = "false";
1259
- }
1260
- }
1261
- $customizations = str_replace("%".$key."%",$value, $customizations);
1262
- }
1263
- return $customizations;
1264
- }
1265
-
1266
- function enableSpecificWPVersionCustomizations($customizations){
1267
- /*enable special CSS for this WP version*/
1268
- $ver = $this->get_wp_version();
1269
- $customizations = str_replace("/*".$ver," ", $customizations);
1270
- $customizations = str_replace($ver."*/"," ", $customizations);
1271
- return $customizations;
1272
- }
1273
-
1274
- function removeCSSComments($customizations){
1275
- $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
1276
- return $customizations;
1277
- }
1278
-
1279
- function prepareAGCAAdminTemplates(){
1280
- if(get_option( 'agca_templates' ) != ""){
1281
- //print_r(get_option( 'agca_templates' ));
1282
- $themes = get_option( 'agca_templates' );
1283
- $selectedTheme = get_option('agca_selected_template');
1284
- if(isset($themes[$selectedTheme])){
1285
- $theme = $themes[$selectedTheme];
1286
- add_filter('get_user_option_admin_color', array(&$this,'change_admin_color'));
1287
-
1288
- echo (stripslashes($theme['common']));
1289
- echo "<!--AGCAIMAGES: ".$theme['images']."-->";
1290
-
1291
- //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1292
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
1293
- if($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
1294
- //print_r($templdata);
1295
-
1296
- $this->JSPrintAGCATemplateSettingsVar($theme['settings']);
1297
-
1298
- $admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
1299
- $admindata = $this->enableSpecificWPVersionCustomizations($admindata);
1300
- $admindata = $this->removeCSSComments($admindata);
1301
-
1302
- //echo $admindata;
1303
- //REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
1304
- $this->templateCustomizations = $admindata;
1305
- }
1306
- //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1307
- }
1308
- }
1309
- }
1310
-
1311
- function agcaAdminSession(){
1312
- $agcaTemplatesSession = array();
1313
-
1314
- //session_destroy();
1315
- //session_unset();
1316
-
1317
- /*if(!session_id()){
1318
- session_start();
1319
- }*/
1320
-
1321
- if(!isset($_SESSION["AGCA"])){
1322
- $_SESSION["AGCA"] = array();
1323
- $_SESSION["AGCA"]["Templates"] = array();
1324
- }
1325
- //print_r($_SESSION);
1326
-
1327
- if(isset($_SESSION["AGCA"])){
1328
- if(isset($_SESSION["AGCA"]["Templates"])){
1329
- //print_r($_SESSION["AGCA"]["Templates"]);
1330
- $agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
1331
- }
1332
- }
1333
-
1334
-
1335
- if($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"'){
1336
- $agcaTemplatesSession = array();
1337
- }
1338
-
1339
-
1340
- return $agcaTemplatesSession;
1341
-
1342
- }
1343
-
1344
- function getAGCAColor($name){
1345
- if(isset($this->colorizer[$name])){
1346
- echo htmlspecialchars($this->colorizer[$name]);
1347
- }
1348
- }
1349
-
1350
- function prepareAGCALoginTemplates(){
1351
- if(get_option( 'agca_templates' ) != ""){
1352
- //print_r(get_option( 'agca_templates' ));
1353
- $templates = get_option( 'agca_templates' );
1354
- foreach($templates as $templname=>$templdata){
1355
- if($templname == get_option('agca_selected_template')){
1356
- echo (stripslashes($templdata['common']));
1357
-
1358
- if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
1359
- $this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
1360
-
1361
- $logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
1362
- $logindata = $this->enableSpecificWPVersionCustomizations($logindata);
1363
- $logindata = $this->removeCSSComments($logindata);
1364
-
1365
- echo($logindata);
1366
- break;
1367
- }
1368
- }
1369
- }
1370
- }
1371
-
1372
- function agca_error_check(){
1373
- ?>
1374
- <script type="text/javascript">
1375
- function AGCAErrorPage(msg, url, line){
1376
- var agca_error_details = "___________________________________________________<br/>";
1377
- agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1378
- agca_error_details += "___________________________________________________<br/>";
1379
- 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>';
1380
- document.getElementsByTagName('html')[0].style.visibility = "visible";
1381
- 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;">\
1382
- <?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>';
1383
-
1384
- var ph = document.getElementById('agca_error_placeholder');
1385
- ph.innerHTML = errorDivHtml;
1386
- document.getElementById('agca_news').style.visibility = "hidden";
1387
- }
1388
- window.onerror = function(msg, url, line) {
1389
- window.onload = function() {
1390
- AGCAErrorPage(msg, url, line);
1391
- }
1392
- return true;
1393
- };
1394
- </script>
1395
- <?php
1396
- }
1397
- function error_check(){
1398
- ?>
1399
- <script type="text/javascript">
1400
- function AGCAErrorOtherPages(msg, url, line){
1401
- var agca_error_details = "___________________________________________________\n";
1402
- agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
1403
-
1404
- document.getElementsByTagName('html')[0].style.visibility = "visible";
1405
-
1406
- if(typeof window.console === "object"){
1407
- console.log("___________________________________________________");
1408
- console.log("<?php _e('AGCA plugin caught a JavaScript on your site', 'ag-custom-admin'); ?>:");
1409
- console.log(agca_error_details);
1410
- }
1411
- }
1412
- window.onerror = function(msg, url, line) {
1413
- window.onload = function() {
1414
- AGCAErrorOtherPages(msg, url, line);
1415
- }
1416
- return true;
1417
- };
1418
- </script>
1419
- <?php
1420
- }
1421
-
1422
- function menu_item_cleartext($name){
1423
- if(strpos($name,' <span') !== false){
1424
- $parts = explode(' <span', $name);
1425
- $name = $parts[0];
1426
- }
1427
- $name = trim($name);
1428
- return $name;
1429
- }
1430
-
1431
- /**
1432
- * Loops through all original menu items, and creates customizations array
1433
- * applies previous customizations if set
1434
- * @return array|mixed|object
1435
- */
1436
- function get_menu_customizations(){
1437
- global $menu;
1438
- global $submenu;
1439
-
1440
- //var_dump($menu); die;
1441
- $previousCustomizations = json_decode(get_option('ag_edit_adminmenu_json_new'), true);
1442
-
1443
- $customizationsSet = true;
1444
- if($previousCustomizations == null){
1445
- $customizationsSet = false;
1446
- }
1447
-
1448
- //set default menu configuration
1449
- //and apply previously saved customizations
1450
- $m = array();
1451
- foreach($menu as $top){
1452
- $name = $top[0];
1453
- $url = $top[2];
1454
- $cls = isset($top[5])?$top[5]:"";
1455
- $remove = false;
1456
- if($name == '') continue;
1457
- $pc = null;
1458
- $name = $this->menu_item_cleartext($name);
1459
-
1460
- //apply previous submenu customizations
1461
- if($customizationsSet && isset($previousCustomizations[$url])){
1462
- $pc = $previousCustomizations[$url];
1463
- }
1464
-
1465
- //get submenu
1466
- $s = array();
1467
- if(isset($submenu[$url])){
1468
- $sitems = $submenu[$url];
1469
- foreach($sitems as $key=>$sub){
1470
- $nameSub = $sub[0];
1471
- $urlSub = $sub[2];
1472
- $removeSub = false;
1473
- $nameSub = $this->menu_item_cleartext($nameSub);
1474
- $s[$key]=array(
1475
- 'name'=>$nameSub,
1476
- 'new'=>'',
1477
- 'remove'=>$removeSub,
1478
- 'url'=>$urlSub
1479
- );
1480
-
1481
- if(isset($pc['submenus'][$key])){
1482
- $s[$key]['new'] = $pc['submenus'][$key]['new'];
1483
- $s[$key]['remove'] = $pc['submenus'][$key]['remove'];
1484
-
1485
- if($s[$key]['new'] == null){
1486
- $s[$key]['new'] = '';
1487
- }
1488
- if($s[$key]['remove'] == null){
1489
- $s[$key]['remove'] = false;
1490
- }
1491
- }
1492
- }
1493
- }
1494
-
1495
- $m[$url]=array(
1496
- 'name'=>$name,
1497
- 'remove'=>$remove,
1498
- 'new'=>'',
1499
- 'url'=>$url,
1500
- 'cls'=>$cls,
1501
- 'submenus'=>$s
1502
- );
1503
-
1504
- //apply previous top menu customizations
1505
- if($customizationsSet && isset($previousCustomizations[$url])){
1506
- $pc = $previousCustomizations[$url];
1507
- if(isset($pc)){
1508
- $m[$url]['remove'] = $pc['remove'];
1509
- $m[$url]['new'] = $pc['new'];
1510
- }
1511
- }
1512
- }
1513
- return $m;
1514
- }
1515
-
1516
- /**
1517
- * Applies customizations to admin menu
1518
- */
1519
- function customized_menu(){
1520
- $customizations = $this->get_menu_customizations();
1521
- global $menu;
1522
- global $submenu;
1523
-
1524
- //print_r($submenu);die;
1525
- //apply customizations to original admin menu
1526
- foreach($menu as $key=>$top){
1527
- $url = $top[2];
1528
- if(isset($customizations[$url])){
1529
- $topCustomized = $customizations[$url];
1530
- if($topCustomized['new']) {
1531
- $menu[$key][0] = $topCustomized['new'];
1532
- }
1533
- if($topCustomized['remove']){
1534
- unset($menu[$key]);
1535
- }
1536
- }
1537
- }
1538
- foreach($submenu as $topkey=>$subs){
1539
- foreach($subs as $subkey=>$sub){
1540
- if(isset($customizations[$topkey]['submenus'][$subkey])){
1541
- $cs = $customizations[$topkey]['submenus'][$subkey];
1542
- if($cs['new']) {
1543
- $submenu[$topkey][$subkey][0] = preg_replace("/".$cs['name']."/",$cs['new'], $submenu[$topkey][$subkey][0],1);
1544
- }
1545
- if($cs['remove']){
1546
- unset($submenu[$topkey][$subkey]);
1547
- }
1548
- }
1549
- }
1550
- }
1551
- }
1552
-
1553
- /**
1554
- * Used only for removing admin menu customizations to AGCA 1.5 version or later
1555
- * @param $checkboxes
1556
- * @param $textboxes
1557
- */
1558
- function migrate_menu_customizations($checkboxes, $textboxes){
1559
- $customizations = $this->get_menu_customizations();
1560
- global $menu;
1561
- /*print_r($menu);
1562
- print_r($customizations);
1563
- print_r($textboxes);*/
1564
-
1565
- $oldTopValue = "";
1566
-
1567
-
1568
- //Migrate checkboxes
1569
- foreach($checkboxes as $key=>$value){
1570
- $isTop = false;
1571
- $oldSubValue = "";
1572
- if (strpos($key,'<-TOP->') !== false) {
1573
- $oldTopValue = str_replace('<-TOP->','',$key);
1574
- $isTop = true;
1575
- }else{
1576
- $oldSubValue = $key;
1577
- }
1578
- if($value == 'checked'){
1579
- $topIndex = "";
1580
- foreach($customizations as $k=>$c){
1581
- if($c['cls'] == $oldTopValue){
1582
- $topIndex = $k;
1583
- break;
1584
- }
1585
- }
1586
- if($topIndex == "") continue;
1587
- if($isTop){
1588
- $customizations[$topIndex]['remove'] = true;
1589
- }else{
1590
- if(is_array($customizations[$topIndex]['submenus'])){
1591
- foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1592
- if($sval['name'] == $oldSubValue){
1593
- $customizations[$topIndex]['submenus'][$skey]['remove'] = true;
1594
- }
1595
- }
1596
- }
1597
- }
1598
- }
1599
- }
1600
-
1601
- //Migrate textboxes
1602
- foreach($textboxes as $key=>$value){
1603
- $isTop = false;
1604
- $oldSubValue = "";
1605
- if (strpos($key,'<-TOP->') !== false) {
1606
- $oldTopValue = str_replace('<-TOP->','',$key);
1607
- $isTop = true;
1608
- }else{
1609
- $oldSubValue = $key;
1610
- }
1611
- if($value != ''){
1612
- $topIndex = "";
1613
- foreach($customizations as $k=>$c){
1614
- if($c['cls'] == $oldTopValue){
1615
- $topIndex = $k;
1616
- break;
1617
- }
1618
- }
1619
- if($topIndex == "") continue;
1620
- if($isTop){
1621
- $customizations[$topIndex]['new'] = $value;
1622
- }else{
1623
- if(is_array($customizations[$topIndex]['submenus'])){
1624
- foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1625
- if($sval['name'] == $oldSubValue){
1626
- if($customizations[$topIndex]['submenus'][$skey]['name'] != $value){
1627
- $customizations[$topIndex]['submenus'][$skey]['new'] = $value;
1628
- }
1629
- }
1630
- }
1631
- }
1632
- }
1633
- }
1634
- }
1635
- update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1636
- update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1637
- }
1638
- function isCusminActive(){
1639
- return $this->isPluginActive('cusmin/cusmin.php');
1640
- }
1641
- function isPluginActive($plugin){
1642
- if(!is_admin()){
1643
- return false;
1644
- }
1645
- return is_plugin_active($plugin);
1646
- }
1647
- function isPluginActiveForNetwork($plugin){
1648
- return is_plugin_active_for_network($plugin);
1649
- }
1650
- function print_admin_css()
1651
- {
1652
- $agcaTemplateSession = $this->agcaAdminSession();
1653
- $wpversion = $this->get_wp_version();
1654
- $this->context = "admin";
1655
- $this->error_check();
1656
- $currentScreen = get_current_screen();
1657
- ?>
1658
- <script type="text/javascript">
1659
- var wpversion = "<?php echo $wpversion; ?>";
1660
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1661
- var agca_version = "<?php echo $this->agca_version; ?>";
1662
- var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1663
- var errors = false;
1664
- var isSettingsImport = false;
1665
- var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
1666
- var agca_context = "admin";
1667
- var roundedSidberSize = 0;
1668
- var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
1669
- var agca_admin_menu = <?php echo json_encode($this->get_menu_customizations()) ?>;
1670
- var agca_string = {
1671
- file_imp_not_sel: '<?php _e('File for import is not selected!', 'ag-custom-admin'); ?>',
1672
- menu_general: '<?php _e('General', 'ag-custom-admin'); ?>',
1673
- menu_admin_bar: '<?php _e('Admin Bar', 'ag-custom-admin'); ?>',
1674
- menu_footer: '<?php _e('Footer', 'ag-custom-admin'); ?>',
1675
- menu_dashb: '<?php _e('Dashboard', 'ag-custom-admin'); ?>',
1676
- menu_login: '<?php _e('Login Page', 'ag-custom-admin'); ?>',
1677
- menu_admin_menu: '<?php _e('Admin Menu', 'ag-custom-admin'); ?>',
1678
- menu_colorizer: '<?php _e('Colorizer', 'ag-custom-admin'); ?>',
1679
- menu_themes: '<?php _e('Themes', 'ag-custom-admin'); ?>',
1680
- menu_upgrade: '<?php _e('Upgrade', 'ag-custom-admin'); ?>',
1681
- menu_advanced: '<?php _e('Advanced', 'ag-custom-admin'); ?>',
1682
- remove: '<?php _e('Remove', 'ag-custom-admin'); ?>',
1683
- frommenu:'<?php _e('from menu', 'ag-custom-admin'); ?>',
1684
- rename:'<?php _e('Rename', 'ag-custom-admin'); ?>',
1685
- withthisvalue:'<?php _e('with this value', 'ag-custom-admin'); ?>',
1686
- submenuitem:'<?php _e('sub-menu item', 'ag-custom-admin'); ?>',
1687
- open:'<?php _e('open', 'ag-custom-admin'); ?>',
1688
- 'delete':'<?php _e('Delete', 'ag-custom-admin'); ?>',
1689
- 'in':'<?php _e('in', 'ag-custom-admin'); ?>',
1690
- save_changes: '<?php _e('Save changes', 'ag-custom-admin'); ?>'
1691
- };
1692
- </script>
1693
- <?php
1694
- $this->prepareAGCAAdminTemplates();
1695
- $this->agca_get_includes();
1696
- $this->admin_capabilities();
1697
- wp_get_current_user() ;
1698
- ?>
1699
- <?php
1700
- //in case that javaScript is disabled only admin can access admin menu
1701
- if(!current_user_can($this->admin_capability())){
1702
- ?>
1703
- <style type="text/css">
1704
- #adminmenu{display:none;}
1705
- </style>
1706
- <?php
1707
- }
1708
- ?>
1709
- <script type="text/javascript">
1710
- document.write('<style type="text/css">html{visibility:hidden;}</style>');
1711
- <?php
1712
- if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1713
- echo 'isSettingsImport = true;';
1714
- }
1715
- ?>
1716
- </script>
1717
- <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1718
- <style type="text/css">
1719
- .wp-has-current-submenu:after{border:none !important;}
1720
- #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1721
- </style>
1722
- <?php }
1723
-
1724
- if($currentScreen->id == 'tools_page_ag-custom-admin/plugin'){
1725
- ?>
1726
- <div id="fb-root"></div>
1727
- <script>(function(d, s, id) {
1728
- var js, fjs = d.getElementsByTagName(s)[0];
1729
- if (d.getElementById(id)) return;
1730
- js = d.createElement(s); js.id = id;
1731
- js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=765552763482314";
1732
- fjs.parentNode.insertBefore(js, fjs);
1733
- }(document, 'script', 'facebook-jssdk'));</script>
1734
- <?php
1735
- }
1736
-
1737
- if(get_option('agca_menu_remove_client_profile')){
1738
- remove_menu_page('profile.php');
1739
- }
1740
- ?>
1741
- <script type="text/javascript">
1742
- /* <![CDATA[ */
1743
- jQuery(document).ready(function() {
1744
- try
1745
- {
1746
-
1747
- <?php /*CHECK OTHER PLUGINS*/
1748
- if($this->isPluginActive('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')){
1749
- ?>
1750
- jQuery('ul#adminmenu').css('display','none');
1751
- jQuery('#footer-ozh-oam').css('display','none');
1752
- jQuery('#ag_main_menu li').each(function(){
1753
- if(jQuery(this).text() == "Admin Menu"){
1754
- jQuery(this).hide();
1755
- }
1756
- });
1757
- <?php
1758
- }
1759
- ?>
1760
-
1761
-
1762
- //get saved onfigurations
1763
-
1764
- <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1765
- var buttons = '<?php echo $buttons; ?>';
1766
-
1767
- <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
1768
- var buttonsJq = '<?php echo $buttonsJq; ?>';
1769
-
1770
- createEditMenuPageNew(agca_admin_menu);
1771
- //createEditMenuPageV32(checkboxes, textboxes);
1772
-
1773
- <?php
1774
- //if admin, and option to hide settings for admin is set
1775
- if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability()) or $this->isCusminActive()){
1776
- ?>
1777
- <?php } else{ ?>
1778
- <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1779
- additionalStyles = ' style="margin-bottom:-4px" ';
1780
- jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1781
- <?php } ?>
1782
- <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1783
-
1784
- var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1785
- href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1786
-
1787
- jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1788
- jQuery("#sidebar_adminmenu_logo").attr('title',href);
1789
-
1790
- <?php }else{ ?>
1791
- href = "<?php echo get_bloginfo('wpurl'); ?>";
1792
- jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1793
- jQuery("#sidebar_adminmenu_logo").attr('title',href);
1794
- <?php } ?>
1795
-
1796
- <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1797
- jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1798
- jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1799
- <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1800
- roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1801
-
1802
-
1803
- <?php } ?>
1804
- <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1805
- jQuery("body").addClass("auto-fold");
1806
- <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1807
- jQuery("body").removeClass("auto-fold");
1808
- <?php } ?>
1809
-
1810
- <?php $this->print_admin_bar_scripts(); ?>
1811
-
1812
- <?php if(get_option('agca_screen_options_menu')==true){ ?>
1813
- jQuery("#screen-options-link-wrap").css("display","none");
1814
- <?php } ?>
1815
- <?php if(get_option('agca_help_menu')==true){ ?>
1816
- jQuery("#contextual-help-link-wrap").css("display","none");
1817
- jQuery("#contextual-help-link").css("display","none");
1818
- <?php } ?>
1819
- <?php if(get_option('agca_privacy_options')==true){ ?>
1820
- jQuery("#privacy-on-link").css("display","none");
1821
- <?php } ?>
1822
-
1823
- <?php if(get_option('agca_update_bar')==true){ ?>
1824
- <?php
1825
- if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1826
- function c2c_no_update_nag() {
1827
- remove_action( 'admin_notices', 'update_nag', 3 );
1828
- }
1829
- endif;
1830
- add_action( 'admin_init', 'c2c_no_update_nag' );
1831
- ?>
1832
- jQuery("#update-nag").css("display","none");
1833
- jQuery(".update-nag").css("display","none");
1834
- <?php } ?>
1835
-
1836
- <?php if(get_option('agca_footer')==true){ ?>
1837
- jQuery("#footer,#wpfooter").css("display","none");
1838
- <?php } ?>
1839
-
1840
- <?php if(get_option('agca_footer_left')!=""){ ?>
1841
- jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1842
- <?php } ?>
1843
- <?php if(get_option('agca_footer_left_hide')==true){ ?>
1844
- jQuery("#footer-left").css("display","none");
1845
- <?php } ?>
1846
- <?php if(get_option('agca_footer_right')!=""){ ?>
1847
- jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1848
- <?php } ?>
1849
- <?php if(get_option('agca_footer_right_hide')==true){ ?>
1850
- jQuery("#footer-upgrade").css("display","none");
1851
- <?php } ?>
1852
-
1853
- <?php if(get_option('agca_language_bar')==true){ ?>
1854
- jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1855
- <?php } ?>
1856
- <?php if(get_option('agca_dashboard_icon')==true){ ?>
1857
- var className = jQuery("#icon-index").attr("class");
1858
- if(className=='icon32'){
1859
- jQuery("#icon-index").attr("id","icon-index-removed");
1860
- }
1861
- <?php } ?>
1862
- <?php if(get_option('agca_dashboard_text')!=""){ ?>
1863
- jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1864
- <?php } ?>
1865
- <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1866
- require_once($this->filePath('wp-includes/formatting.php'));
1867
- ?>
1868
- jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1869
-
1870
- 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'))))); ?>');
1871
- <?php } ?>
1872
-
1873
- <?php /*Remove Dashboard widgets*/ ?>
1874
- <?php
1875
-
1876
- if(get_option('agca_dashboard_widget_welcome')==true){
1877
- ?>jQuery("#welcome-panel").css("display","none");<?php
1878
- }else{
1879
- ?>jQuery("#welcome-panel").css("display","block");<?php
1880
- }
1881
- if(get_option('agca_dashboard_widget_il')==true){
1882
- $this->remove_dashboard_widget('dashboard_incoming_links','normal');
1883
- }else{
1884
- ?>jQuery("#dashboard_incoming_links").css("display","block");<?php
1885
- }
1886
- if(get_option('agca_dashboard_widget_plugins')==true){
1887
- $this->remove_dashboard_widget('dashboard_plugins','normal');
1888
- }else{
1889
- ?>jQuery("#dashboard_plugins").css("display","block");<?php
1890
- }
1891
- if(get_option('agca_dashboard_widget_qp')==true){
1892
- $this->remove_dashboard_widget('dashboard_quick_press','side');
1893
- }else{
1894
- ?>jQuery("#dashboard_quick_press").css("display","block");<?php
1895
- }
1896
- if(get_option('agca_dashboard_widget_rn')==true){
1897
- $this->remove_dashboard_widget('dashboard_right_now','normal');
1898
- }else{
1899
- ?>jQuery("#dashboard_right_now").css("display","block");<?php
1900
- }
1901
- if(get_option('agca_dashboard_widget_rd')==true){
1902
- $this->remove_dashboard_widget('dashboard_recent_drafts','side');
1903
- }else{
1904
- ?>jQuery("#dashboard_recent_drafts").css("display","block");<?php
1905
- }
1906
- if(get_option('agca_dashboard_widget_primary')==true){
1907
- $this->remove_dashboard_widget('dashboard_primary','side');
1908
- }else{
1909
- ?>jQuery("#dashboard_primary").css("display","block");<?php
1910
- }
1911
- if(get_option('agca_dashboard_widget_secondary')==true){
1912
- $this->remove_dashboard_widget('dashboard_secondary','side');
1913
- }else{
1914
- ?>jQuery("#dashboard_secondary").css("display","block");<?php
1915
- }
1916
- if(get_option('agca_dashboard_widget_activity')==true){
1917
- remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
1918
- }else{
1919
- ?>jQuery("#dashboard_activity").css("display","block");<?php
1920
- }
1921
-
1922
- ?>
1923
-
1924
- <?php /*ADMIN MENU*/ ?>
1925
-
1926
- <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1927
- jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1928
- <?php } ?>
1929
- <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1930
- jQuery(".wp-menu-image").each(function(){
1931
- jQuery(this).css("display","none");
1932
- });
1933
- jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1934
- <?php } ?>
1935
- <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1936
- jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1937
-
1938
- <?php } ?>
1939
- <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1940
-
1941
- <?php /*If Turned on*/ ?>
1942
-
1943
- <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1944
- jQuery('#adminmenu > li').each(function(){
1945
- if(!jQuery(this).hasClass('agca_button_only')){
1946
- jQuery(this).addClass('noclass');
1947
- }
1948
- });
1949
- <?php /*Only admin see button*/
1950
- if (current_user_can($this->admin_capability())){ ?>
1951
- 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')); ?>');
1952
- <?php } ?>
1953
- <?php } ?>
1954
-
1955
-
1956
- <?php /*EDIT MENU ITEMS*/?>
1957
- <?php if(get_option('ag_edit_adminmenu_json')!=""){
1958
-
1959
- $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1960
-
1961
- $checkboxes = json_decode($arr[0]);
1962
- $textboxes = json_decode($arr[1]);
1963
-
1964
- $this->migrate_menu_customizations($checkboxes, $textboxes);
1965
-
1966
- } ?>
1967
-
1968
- <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1969
- $this->customized_menu();
1970
- } ?>
1971
-
1972
-
1973
-
1974
-
1975
- /*Add user buttons*/
1976
- jQuery('#adminmenu').append(buttons);
1977
-
1978
- <?php /*END If Turned on*/ ?>
1979
- <?php } else{ ?>
1980
- jQuery("#adminmenu").removeClass("noclass");
1981
- <?php } ?>
1982
-
1983
- reloadRemoveButtonEvents();
1984
-
1985
- <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1986
- //remove collapse menu button
1987
- jQuery('#collapse-menu').remove();
1988
- <?php } ?>
1989
-
1990
- <?php //COLORIZER ?>
1991
- updateAllColors();
1992
- <?php //COLORIZER END ?>
1993
- <?php } //end of apply for any user except admin ?>
1994
- /*Add user buttons*/
1995
- jQuery('#ag_add_adminmenu').append(buttonsJq);
1996
-
1997
-
1998
- }catch(err){
1999
- errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
2000
- console.log(errors);
2001
- }finally{
2002
- jQuery('html').css('visibility','visible');
2003
- }
2004
- <?php
2005
- if($this->saveAfterImport == true){
2006
- ?>savePluginSettings();<?php
2007
- }
2008
- ?>
2009
-
2010
- });
2011
-
2012
- <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
2013
- $this->updateAllColors();
2014
- }else{
2015
- ?>function updateAllColors(){}; <?php
2016
- } ?>
2017
-
2018
-
2019
- /* ]]> */
2020
- </script>
2021
- <style type="text/css">
2022
- .underline_text{
2023
- text-decoration:underline;
2024
- }
2025
- .form-table th{
2026
- width:300px;
2027
- }
2028
-
2029
- #dashboard-widgets div.empty-container{
2030
- border:none;
2031
- }
2032
- </style>
2033
- <?php
2034
- }
2035
-
2036
- function print_login_head(){
2037
- if($this->isCusminActive()){
2038
- return false;
2039
- }
2040
-
2041
- $this->context = "login";
2042
- $this->error_check();
2043
- //$wpversion = $this->get_wp_version();
2044
-
2045
- ?>
2046
- <script type="text/javascript">
2047
- document.write('<style type="text/css">html{visibility:hidden;}</style>');
2048
- var agca_version = "<?php echo $this->agca_version; ?>";
2049
- <?php //var wpversion = "echo $wpversion; ?>
2050
- var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
2051
- var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
2052
- var isSettingsImport = false;
2053
- var agca_context = "login";
2054
- </script>
2055
- <?php
2056
- $this->prepareAGCALoginTemplates();
2057
- $this->agca_get_includes();
2058
-
2059
- ?>
2060
-
2061
- <script type="text/javascript">
2062
-
2063
-
2064
- /* <![CDATA[ */
2065
- jQuery(document).ready(function() {
2066
- try{
2067
- <?php if(get_option('agca_login_round_box')==true){ ?>
2068
- jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2069
- <?php if(!get_option('agca_login_round_box_skip_logo')){ ?>
2070
- jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2071
- jQuery("#login h1 a").css("margin-bottom",'10px');
2072
- jQuery("#login h1 a").css("padding-bottom",'0');
2073
- <?php } ?>
2074
- jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2075
- <?php } ?>
2076
- <?php if(get_option('agca_login_banner')==true){ ?>
2077
- jQuery("#backtoblog").css("display","none");
2078
- <?php } ?>
2079
- <?php if(get_option('agca_login_banner_text')==true){ ?>
2080
- jQuery("#backtoblog a").html('<?php echo "← " . addslashes(get_option('agca_login_banner_text')); ?>');
2081
- <?php } ?>
2082
- <?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
2083
- advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
2084
- var $url = "url(" + advanced_url + ")";
2085
- jQuery("#login h1 a").css("background",$url+' no-repeat');
2086
- jQuery("#login h1 a").hide();
2087
- image = jQuery("<img />").attr("src",advanced_url);
2088
- jQuery(image).load(function() {
2089
- var originalWidth = 326;
2090
- var widthDiff = this.width - originalWidth;
2091
- jQuery("#login h1 a").height(this.height);
2092
- jQuery("#login h1 a").width(this.width);
2093
- jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
2094
-
2095
- var loginWidth = jQuery('#login').width();
2096
- var originalLoginWidth = 320;
2097
- var photoWidth = this.width;
2098
-
2099
- if(loginWidth > photoWidth){
2100
- jQuery("#login h1 a").css('margin','auto');
2101
- }else{
2102
- jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
2103
- }
2104
-
2105
- jQuery("#login h1 a").show();
2106
- });
2107
- <?php } ?>
2108
- <?php if(get_option('agca_login_photo_href')==true){ ?>
2109
- var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
2110
- $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
2111
-
2112
- jQuery("#login h1 a").attr("href",$href);
2113
- <?php } ?>
2114
- <?php if(get_option('agca_login_photo_remove')==true){ ?>
2115
- jQuery("#login h1 a").css("display","none");
2116
- <?php } ?>
2117
-
2118
- jQuery("#login h1 a").attr("title","");
2119
-
2120
- <?php if(get_option('agca_login_register_remove')==true){ ?>
2121
- if(jQuery('p#nav').size() > 0){
2122
- jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2123
- }
2124
- jQuery('p#nav a').each(function(){
2125
- if(jQuery(this).attr('href').indexOf('register') != -1){
2126
- jQuery(this).remove();
2127
- }
2128
- });
2129
-
2130
- <?php } ?>
2131
- <?php if(get_option('agca_login_register_href')!=""){ ?>
2132
- jQuery('p#nav a').each(function(){
2133
- if(jQuery(this).attr('href').indexOf('register') != -1){
2134
- jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
2135
- }
2136
- });
2137
-
2138
- <?php } ?>
2139
-
2140
- <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
2141
- if(jQuery('p#nav').size() > 0){
2142
- jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2143
- }
2144
- jQuery('p#nav a').each(function(){
2145
- if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
2146
- jQuery(this).remove();
2147
- }
2148
- });
2149
-
2150
- <?php } ?>
2151
-
2152
-
2153
- <?php //COLORIZER ?>
2154
- <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
2155
- jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
2156
- jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
2157
-
2158
-
2159
- <?php
2160
-
2161
-
2162
- } ?>
2163
- <?php //COLORIZER END ?>
2164
- }catch(err){
2165
- console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
2166
- }finally{
2167
- jQuery('html').show();
2168
- jQuery('html').css('visibility','visible');
2169
- }
2170
- });
2171
- /* ]]> */
2172
-
2173
- </script>
2174
- <?php
2175
- }
2176
-
2177
- function pluginUrl(){
2178
- return trailingslashit(plugins_url(basename(dirname(__FILE__))));
2179
- }
2180
-
2181
- function agca_admin_page() {
2182
-
2183
- $wpversion = $this->get_wp_version();
2184
- $this->agca_error_check();
2185
- ?>
2186
- <?php //includes ?>
2187
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
2188
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2189
-
2190
- <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
2191
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2192
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
2193
- <script type="text/javascript">
2194
- var templates_ep = "<?php echo $this->templates_ep; ?>";
2195
- var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
2196
- </script>
2197
- <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
2198
- <?php //includes ?>
2199
- <div class="wrap">
2200
- <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>
2201
- <div id="agca-social" style="float:right; margin-top: -23px;">
2202
- <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>
2203
- </div>
2204
- <div id="agca_error_placeholder"></div>
2205
- <div id="agca_news">&nbsp;</div><br />
2206
- <form method="post" id="agca_form" action="options.php">
2207
- <?php wp_nonce_field('agca_form','_agca_token'); ?>
2208
- <?php settings_fields( 'agca-options-group' ); ?>
2209
- <div id="agca-your-feedback">
2210
- <strong>
2211
- <span style="color:#005B69">Your feedback:</span>
2212
- </strong>
2213
- <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/">
2214
- <span class="dashicons dashicons-thumbs-up"></span>
2215
- </a>
2216
- <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/">
2217
- <span class="dashicons dashicons-thumbs-down"></span>
2218
- </a>
2219
- </div>
2220
- <br />
2221
- <ul id="ag_main_menu" style="<?php echo $this->isCusminActive()?'display:none':''; ?>">
2222
- <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>
2223
- <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>
2224
- <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>
2225
- <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>
2226
- <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>
2227
- <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>
2228
- <li class="normal"><a href="#ag-colorizer-settings" title="<?php _e('Colorizer settings', 'ag-custom-admin')?>"><?php _e('Colorizer', 'ag-custom-admin')?></a></li>
2229
- <li class="normal"><a href="#ag-advanced" title="<?php _e('My custom scripts', 'ag-custom-admin')?>"><?php _e('Advanced', 'ag-custom-admin')?></a></li>
2230
- <?php if(defined('AGCA_THEMES')){ ?>
2231
- <li class="normal" style=""><a href="#ag-templates" title="<?php _e('AGCA Themes', 'ag-custom-admin')?>"><?php _e('Themes', 'ag-custom-admin')?></a></li>
2232
- <?php } ?>
2233
- <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>
2234
-
2235
- <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>
2236
- </li>
2237
- <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2238
- </ul>
2239
- <div id="agca_advertising">
2240
- <ul>
2241
- <li style="min-height:105px;display: block">
2242
- <a href="https://cusmin.com?ref=agca-ad" target="_blank"><img src="<?php echo $this->pluginUrl(); ?>images/advertising.jpg" /></a>
2243
- </li>
2244
- </ul>
2245
- </div>
2246
- <div class="agca-clear"></div>
2247
- <div id="section-cusmin" style="display:none;"><?php _e('All AGCA plugin\'s settings 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>
2248
- <div id="section_general" style="display:none" class="ag_section">
2249
- <h2 class="section_title"><?php _e('General Settings', 'ag-custom-admin')?></h2>
2250
- <?php $this->show_save_button_upper(); ?>
2251
- <p tabindex="0" class="agca-clear agca-tip"><i><?php _e('<strong>Tip: </strong>Move the cursor over an option label to see the more information about the option', 'ag-custom-admin')?></i></p>
2252
- <table class="agca-clear form-table" width="500px">
2253
- <?php
2254
-
2255
- $this->print_checkbox(array(
2256
- 'name'=>'agca_role_allbutadmin',
2257
- 'label'=>__('Exclude the AGCA admin from the customizations', 'ag-custom-admin'),
2258
- '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')
2259
- ));
2260
-
2261
- $this->print_options_h3(__('Pages', 'ag-custom-admin'));
2262
-
2263
- $this->print_checkbox(array(
2264
- 'hide'=>true,
2265
- 'name'=>'agca_screen_options_menu',
2266
- 'label'=>__('Hide "Screen Options" menu', 'ag-custom-admin'),
2267
- 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2268
- ));
2269
-
2270
- $this->print_checkbox(array(
2271
- 'hide'=>true,
2272
- 'name'=>'agca_help_menu',
2273
- 'label'=>__('Hide "Help" menu', 'ag-custom-admin'),
2274
- 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2275
- ));
2276
-
2277
- $this->print_checkbox(array(
2278
- 'title'=>__('Hides colors scheme on profile page', 'ag-custom-admin'),
2279
- 'name'=>'agca_profile_color_scheme',
2280
- 'hide'=>true,
2281
- 'label'=>__('Hide User\'s Profile Color Scheme', 'ag-custom-admin')
2282
- ));
2283
-
2284
- $this->print_options_h3(__('Security', 'ag-custom-admin'));
2285
-
2286
- ?>
2287
-
2288
- <tr valign="center">
2289
- <th scope="row">
2290
- <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>
2291
- </th>
2292
- <td><?php echo $this->admin_capabilities; ?>&nbsp;&nbsp;<i>(<?php _e('default:&nbsp;<strong>Edit Dashboard</strong>', 'ag-custom-admin'); ?>)</i>
2293
- <p style="margin-left:5px;"><i><?php _e('Find more information about', 'ag-custom-admin'); ?> <a href="https://wordpress.org/support/article/roles-and-capabilities/" target="_blank"><?php _e('WordPress capabilities', 'ag-custom-admin'); ?></a></i></p>
2294
- </td>
2295
- <td>
2296
- </td>
2297
- </tr>
2298
- <tr>
2299
- <td>
2300
- <p>Need to apply multiple configurations to multiple user groups/roles? <a href="https://cusmin.com/docs/general/configuration-management?ref=agca" target="_blank">Upgrade to Cusmin</a></p>
2301
- </td>
2302
- </tr>
2303
- <?php
2304
- $this->print_options_h3(__('Feedback and Support', 'ag-custom-admin'));
2305
-
2306
- ?>
2307
- <tr valign="center">
2308
- <td colspan="2">
2309
- <div class="agca-feedback-and-support">
2310
- <?php /*<ul>
2311
- <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>
2312
- </ul>*/
2313
- ?>
2314
- <ul>
2315
- <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>
2316
- </ul>
2317
- <?php /*<ul>
2318
- <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>
2319
- </ul>*/
2320
- ?>
2321
- <ul>
2322
- <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>
2323
- </ul>
2324
- <?php /*<ul>
2325
- <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>
2326
- </ul>*/
2327
- ?>
2328
- <ul>
2329
- <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>
2330
- </ul>
2331
- <ul class="upgrade">
2332
- <li><a href="https://cusmin.com/upgrade-to-cusmin?ref=page" target="_blank">
2333
- <img src="<?php echo plugins_url( 'images/cusminlogo.png', __FILE__ ) ?>" />
2334
- &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>
2335
- </ul>
2336
- </div>
2337
- </td>
2338
- <td></td>
2339
- </tr>
2340
- </table>
2341
- </div>
2342
- <div id="section_admin_bar" style="display:none" class="ag_section">
2343
- <h2 class="section_title"><?php _e('Admin Bar Settings', 'ag-custom-admin'); ?></h2>
2344
- <?php $this->show_save_button_upper(); ?>
2345
- <table class="form-table" width="500px">
2346
-
2347
- <?php
2348
- $this->print_checkbox(array(
2349
- 'attributes'=>array(
2350
- 'class'=>'ag_table_major_options',
2351
- ),
2352
- 'hide'=>true,
2353
- 'title'=>__('Hides the admin bar completely from the admin panel', 'ag-custom-admin'),
2354
- 'name'=>'agca_header',
2355
- 'label'=>__('<strong>Hide Admin bar</strong>', 'ag-custom-admin'),
2356
- 'input-attributes'=>'data-dependant="#agca_header_show_logout_content"',
2357
- 'input-class'=>'has-dependant',
2358
- ));
2359
-
2360
- $this->print_checkbox(array(
2361
- 'attributes'=>array(
2362
- 'class'=>'ag_table_major_options',
2363
- 'style'=> ((get_option('agca_header')!='true')?'display:none':''),
2364
- 'id'=>'agca_header_show_logout_content',
2365
- ),
2366
- 'title'=>__('Check this if you want to show Log Out button in top right corner of the admin page', 'ag-custom-admin'),
2367
- 'name'=>'agca_header_show_logout',
2368
- 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2369
- 'label'=>__('<strong>(but show Log Out button)</strong>', 'ag-custom-admin')
2370
- ));
2371
-
2372
- $this->print_checkbox(array(
2373
- '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'),
2374
- 'name'=>'agca_admin_bar_frontend',
2375
- 'hide'=>true,
2376
- 'label'=>__('Site pages: Do not apply Admin bar customizations', 'ag-custom-admin')
2377
- ));
2378
-
2379
- $this->print_checkbox(array(
2380
- 'title'=>__('Hides admin bar completely for authenticated users on site pages.', 'ag-custom-admin'),
2381
- 'name'=>'agca_admin_bar_frontend_hide',
2382
- 'hide'=>true,
2383
- 'label'=>__('Site pages: Hide Admin bar', 'ag-custom-admin')
2384
- ));
2385
-
2386
- $this->print_options_h3(__('Left Side', 'ag-custom-admin'));
2387
-
2388
- $this->print_input(array(
2389
- 'title'=>__('Change default WordPress logo with custom image.', 'ag-custom-admin'),
2390
- 'name'=>'agca_wp_logo_custom',
2391
- 'label'=>__('Admin bar logo', 'ag-custom-admin'),
2392
- 'hint' =>__('Image URL', 'ag-custom-admin')
2393
- ));
2394
-
2395
- $this->print_input(array(
2396
- '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'),
2397
- 'name'=>'agca_wp_logo_custom_link',
2398
- 'label'=>__('Admin bar logo link', 'ag-custom-admin'),
2399
- 'hint' =>__('Link', 'ag-custom-admin')
2400
- ));
2401
-
2402
- $this->print_input(array(
2403
- '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>',
2404
- 'name'=>'agca_custom_title',
2405
- 'label'=>__('Page title template', 'ag-custom-admin'),
2406
- 'hint' =>__('Please use', 'ag-custom-admin').' <strong>%BLOG%</strong> '.__('and', 'ag-custom-admin'). ' <strong>%PAGE%</strong> '.__('in your title template.', 'ag-custom-admin')
2407
- ));
2408
-
2409
- $this->print_input(array(
2410
- 'title'=>__('Add custom image on the top of the admin content.', 'ag-custom-admin'),
2411
- 'name'=>'agca_header_logo_custom',
2412
- 'label'=>__('Header image', 'ag-custom-admin'),
2413
- 'hint' =>__('Image URL', 'ag-custom-admin')
2414
- ));
2415
-
2416
-
2417
- $this->print_checkbox(array(
2418
- 'hide'=>true,
2419
- 'title'=>__('Hides small Wordpress logo or custom logo from the admin bar', 'ag-custom-admin'),
2420
- 'name'=>'agca_header_logo',
2421
- 'label'=>__('Hide Admin bar logo', 'ag-custom-admin')
2422
- ));
2423
-
2424
- $this->print_checkbox(array(
2425
- 'hide'=>true,
2426
- 'title'=>__('Hides WordPress context menu on admin bar logo from admin bar', 'ag-custom-admin'),
2427
- 'name'=>'agca_remove_top_bar_dropdowns',
2428
- 'label'=>__('Hide Admin bar logo context menu', 'ag-custom-admin')
2429
- ));
2430
-
2431
- $this->print_checkbox(array(
2432
- 'hide'=>true,
2433
- 'title'=>__('Hides site name link from the admin bar', 'ag-custom-admin'),
2434
- 'name'=>'agca_remove_site_link',
2435
- 'label'=>__('Hide Site name', 'ag-custom-admin')
2436
- ));
2437
-
2438
- $this->print_checkbox(array(
2439
- 'hide'=>true,
2440
- 'title'=>__('Hides update notifications from admin bar', 'ag-custom-admin'),
2441
- 'name'=>'agca_admin_bar_update_notifications',
2442
- 'label'=>__('Remove update notifications', 'ag-custom-admin')
2443
- ));
2444
-
2445
- $this->print_checkbox(array(
2446
- 'hide'=>true,
2447
- 'title'=>__('Hides comments block from admin bar', 'ag-custom-admin'),
2448
- 'name'=>'agca_admin_bar_comments',
2449
- 'label'=>__('Hide "Comments" block', 'ag-custom-admin')
2450
- ));
2451
-
2452
- $this->print_checkbox(array(
2453
- 'hide'=>true,
2454
- 'attributes'=>array(
2455
- 'style'=>'margin-top:20px;'
2456
- ),
2457
- 'title'=>__('Hides "+ New" block and its context menu from admin bar', 'ag-custom-admin'),
2458
- 'name'=>'agca_admin_bar_new_content',
2459
- 'label'=>__('Hide "+ New" block', 'ag-custom-admin'),
2460
- 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2461
- 'input-class'=>'has-dependant dependant-opposite'
2462
- ));
2463
-
2464
- $this->print_checkbox(array(
2465
- 'hide'=>true,
2466
- 'attributes'=>array(
2467
- 'class'=>'new_content_header_submenu'
2468
- ),
2469
- 'title'=>__('Hides "Post" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2470
- 'name'=>'agca_admin_bar_new_content_post',
2471
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Post sub-menu', 'ag-custom-admin')
2472
- ));
2473
-
2474
- $this->print_checkbox(array(
2475
- 'hide'=>true,
2476
- 'attributes'=>array(
2477
- 'class'=>'new_content_header_submenu'
2478
- ),
2479
- 'title'=>__('Hides "Link" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2480
- 'name'=>'agca_admin_bar_new_content_link',
2481
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Link sub-menu', 'ag-custom-admin')
2482
- ));
2483
-
2484
- $this->print_checkbox(array(
2485
- 'hide'=>true,
2486
- 'attributes'=>array(
2487
- 'class'=>'new_content_header_submenu'
2488
- ),
2489
- 'title'=>__('Hides "Page" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2490
- 'name'=>'agca_admin_bar_new_content_page',
2491
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Page sub-menu', 'ag-custom-admin')
2492
- ));
2493
-
2494
- $this->print_checkbox(array(
2495
- 'hide'=>true,
2496
- 'attributes'=>array(
2497
- 'class'=>'new_content_header_submenu'
2498
- ),
2499
- 'title'=>__('Hides "User" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2500
- 'name'=>'agca_admin_bar_new_content_user',
2501
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> User sub-menu', 'ag-custom-admin')
2502
- ));
2503
-
2504
- $this->print_checkbox(array(
2505
- 'hide'=>true,
2506
- 'attributes'=>array(
2507
- 'class'=>'new_content_header_submenu'
2508
- ),
2509
- 'title'=>__('Hides "Media" sub-menu from "+ New" block on admin bar', 'ag-custom-admin'),
2510
- 'name'=>'agca_admin_bar_new_content_media',
2511
- 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide "+ New" -> Media sub-menu', 'ag-custom-admin')
2512
- ));
2513
-
2514
- /* $this->print_checkbox(array(
2515
- 'hide'=>true,
2516
- 'title'=>__('Hides "Admin themes" from admin bar', 'ag-custom-admin'),
2517
- 'name'=>'agca_admin_bar_admin_themes',
2518
- 'label'=>__('"Admin themes"', 'ag-custom-admin')
2519
- ));*/
2520
-
2521
- $this->print_input(array(
2522
- 'title'=>__('Adds custom text in admin top bar.', 'ag-custom-admin'),
2523
- 'name'=>'agca_custom_site_heading',
2524
- 'label'=>__('Custom blog heading', 'ag-custom-admin'),
2525
- 'hint'=>__('<strong>Tip: </strong>You can use HTML tags like', 'ag-custom-admin')." &lt;h1&gt; ".__('or', 'ag-custom-admin')." &lt;a&gt;"
2526
- ));
2527
-
2528
-
2529
- $this->print_checkbox(array(
2530
- 'hide'=>true,
2531
- 'title'=>__('Hides the yellow bar with the information about the new WordPress release', 'ag-custom-admin'),
2532
- 'name'=>'agca_update_bar',
2533
- 'label'=>__('Hide WordPress update notification', 'ag-custom-admin')
2534
- ));
2535
-
2536
- $this->print_options_h3(__('Right Side', 'ag-custom-admin'));
2537
-
2538
- $this->print_input(array(
2539
- 'name'=>'agca_howdy',
2540
- 'label'=>__('Change Howdy text', 'ag-custom-admin'),
2541
- ));
2542
-
2543
- $this->print_input(array(
2544
- 'title'=>__('Put \'Exit\', for example', 'ag-custom-admin'),
2545
- 'name'=>'agca_logout',
2546
- 'label'=>__('Change Log out text', 'ag-custom-admin'),
2547
- ));
2548
-
2549
- $this->print_checkbox(array(
2550
- 'hide'=>true,
2551
- 'name'=>'agca_remove_your_profile',
2552
- 'label'=>__('Hide "Edit My Profile" link', 'ag-custom-admin'),
2553
- ));
2554
-
2555
- $this->print_checkbox(array(
2556
- 'title'=>__('If selected, hides all elements in top right corner, except Log Out button', 'ag-custom-admin'),
2557
- 'name'=>'agca_logout_only',
2558
- 'label'=>__('Log out only', 'ag-custom-admin')
2559
- ));
2560
-
2561
- ?>
2562
-
2563
- <tr>
2564
- <td>
2565
- <p>Try the Cusmin admin bar editor instead: <a href="https://cusmin.com/docs/admin-bar/admin-bar-editor?ref=admin-bar" target="_blank"><br>Upgrade to Cusmin</a></p>
2566
- </td>
2567
- </tr>
2568
- </table>
2569
- </div>
2570
-
2571
- <div id="section_admin_footer" style="display:none" class="ag_section">
2572
- <h2 class="section_title"><?php _e('Admin Footer Settings', 'ag-custom-admin'); ?></h2>
2573
- <?php $this->show_save_button_upper(); ?>
2574
- <table class="form-table" width="500px">
2575
- <?php
2576
- $this->print_checkbox(array(
2577
- 'hide'=>true,
2578
- 'attributes'=>array(
2579
- 'class'=>'ag_table_major_options'
2580
- ),
2581
- 'title'=>__('Hides footer with all elements', 'ag-custom-admin'),
2582
- 'name'=>'agca_footer',
2583
- 'label'=>__('<strong>Hide footer</strong>', 'ag-custom-admin')
2584
- ));
2585
-
2586
- $this->print_options_h3(__('Footer Options', 'ag-custom-admin'));
2587
-
2588
- $this->print_checkbox(array(
2589
- 'hide'=>true,
2590
- 'title'=>__('Hides default text in footer', 'ag-custom-admin'),
2591
- 'name'=>'agca_footer_left_hide',
2592
- 'label'=>__('Hide footer text', 'ag-custom-admin')
2593
- ));
2594
-
2595
- $this->print_textarea(array(
2596
- 'title'=>__('Replaces text \'Thank you for creating with WordPress\' with custom text', 'ag-custom-admin'),
2597
- 'name'=>'agca_footer_left',
2598
- 'class' => 'one-line',
2599
- 'label'=>__('Change footer text', 'ag-custom-admin')
2600
- ));
2601
-
2602
- $this->print_checkbox(array(
2603
- 'hide'=>true,
2604
- 'title'=>__('Hides text \'Get Version ...\' on right', 'ag-custom-admin'),
2605
- 'name'=>'agca_footer_right_hide',
2606
- 'label'=>__('Hide version text', 'ag-custom-admin')
2607
- ));
2608
-
2609
- $this->print_textarea(array(
2610
- 'title'=>__('Replaces text \'Get Version ...\' with custom text', 'ag-custom-admin'),
2611
- 'name'=>'agca_footer_right',
2612
- 'class' => 'one-line',
2613
- 'label'=>__('Change version text', 'ag-custom-admin')
2614
- ));
2615
-
2616
- ?>
2617
-
2618
- </table>
2619
- </div>
2620
- <div id="section_dashboard_page" style="display:none" class="ag_section">
2621
- <h2 class="section_title"><?php _e('Dashboard Settings', 'ag-custom-admin'); ?></h2>
2622
- <?php $this->show_save_button_upper(); ?>
2623
- <table class="form-table" width="500px">
2624
- <?php
2625
-
2626
- $this->print_options_h3(__('Dashboard Options', 'ag-custom-admin'));
2627
-
2628
- $this->print_input(array(
2629
- 'title'=>__('Main heading (\'Dashboard\') on Dashboard page', 'ag-custom-admin'),
2630
- 'name'=>'agca_dashboard_text',
2631
- 'label'=>__('Change Dashboard heading text', 'ag-custom-admin'),
2632
- ));
2633
-
2634
- ?>
2635
- <tr valign="center">
2636
- <th scope="row">
2637
- <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>
2638
- </th>
2639
- <td class="agca_editor">
2640
- <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2641
- </td>
2642
- </tr>
2643
- <?php
2644
-
2645
- $this->print_options_h3(__('Dashboard Widgets Options', 'ag-custom-admin'));
2646
-
2647
- ?>
2648
- <tr>
2649
- <td colspan="2">
2650
- <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>
2651
- </td>
2652
- </tr>
2653
- <?php
2654
- $this->print_checkbox(array(
2655
- 'hide'=>true,
2656
- 'title'=>__('Hides Welcome WordPress widget', 'ag-custom-admin'),
2657
- 'name'=>'agca_dashboard_widget_welcome',
2658
- 'label'=>__('Hide "Welcome" widget', 'ag-custom-admin')
2659
- ));
2660
-
2661
- $this->print_checkbox(array(
2662
- 'hide'=>true,
2663
- 'title'=>__('Hides Activity dashboard widget', 'ag-custom-admin'),
2664
- 'name'=>'agca_dashboard_widget_activity',
2665
- 'label'=>__('Hide "Activity" widget', 'ag-custom-admin')
2666
- ));
2667
-
2668
- $this->print_checkbox(array(
2669
- 'hide'=>true,
2670
- 'title'=>__('Hides Quick Draft dashboard widget', 'ag-custom-admin'),
2671
- 'name'=>'agca_dashboard_widget_qp',
2672
- 'label'=>__('Hide "Quick Draft" widget', 'ag-custom-admin')
2673
- ));
2674
-
2675
- $this->print_checkbox(array(
2676
- 'hide'=>true,
2677
- 'title'=>__('Hides At a Glance dashboard widget', 'ag-custom-admin'),
2678
- 'name'=>'agca_dashboard_widget_rn',
2679
- 'label'=>__('Hide "At a Glance" widget', 'ag-custom-admin')
2680
- ));
2681
-
2682
- $this->print_checkbox(array(
2683
- 'hide'=>true,
2684
- 'name'=>'agca_dashboard_widget_primary',
2685
- 'title'=>__('This is \'WordPress News\' or \'WordPress Development Blog\' widget in older WordPress versions', 'ag-custom-admin'),
2686
- 'label'=>__('Hide "WordPress News" widget', 'ag-custom-admin')
2687
- ));
2688
-
2689
- $this->print_checkbox(array(
2690
- 'hide'=>true,
2691
- 'name'=>'agca_dashboard_widget_secondary',
2692
- 'title'=>__('This is \'Other WordPress News\' widget by default', 'ag-custom-admin'),
2693
- 'label'=>__('Hide secondary widget area', 'ag-custom-admin')
2694
- ));
2695
-
2696
- ?>
2697
- <tr>
2698
- <td>
2699
- <p>Create custom Dashboard Widgets<br><a href="https://cusmin.com/docs/dashboard/my-dashboard-widgets?ref=agca" target="_blank">Upgrade to Cusmin</a></p>
2700
- </td>
2701
- </tr>
2702
- </table>
2703
- </div>
2704
- <div id="section_login_page" style="display:none" class="ag_section">
2705
- <h2 class="section_title"><?php _e('Login Page Settings', 'ag-custom-admin'); ?></h2>
2706
- <?php $this->show_save_button_upper(); ?>
2707
- <table class="form-table" width="500px">
2708
- <?php
2709
-
2710
- $this->print_options_h3(__('Login Page Options', 'ag-custom-admin'));
2711
-
2712
- $this->print_checkbox(array(
2713
- 'hide'=>true,
2714
- 'name'=>'agca_login_banner',
2715
- 'title'=>__('Hide back to blog block', 'ag-custom-admin'),
2716
- 'label'=>__('Hide "Back to blog" text', 'ag-custom-admin')
2717
- ));
2718
-
2719
- $this->print_input(array(
2720
- 'name'=>'agca_login_banner_text',
2721
- 'title'=>__('Changes \'<- Back to ...\' text in top bar on Login page', 'ag-custom-admin'),
2722
- 'label'=>__('Change back to blog text', 'ag-custom-admin')
2723
- ));
2724
-
2725
- $this->print_input(array(
2726
- 'title'=>__('If this field is not empty, image from provided url will be visible on Login page', 'ag-custom-admin'),
2727
- 'name'=>'agca_login_photo_url',
2728
- 'label'=>__('Change Login header image', 'ag-custom-admin'),
2729
- 'hint'=>__('Image URL', 'ag-custom-admin')
2730
- ));
2731
-
2732
- $this->print_input(array(
2733
- 'title'=>__('Put here custom link to a web location, that will be triggered on image click', 'ag-custom-admin'),
2734
- 'name'=>'agca_login_photo_href',
2735
- 'label'=>__('Change link on login image', 'ag-custom-admin'),
2736
- 'hint'=>__('For blog URL use', 'ag-custom-admin').' %BLOG%'
2737
- ));
2738
-
2739
- $this->print_checkbox(array(
2740
- 'hide'=>true,
2741
- 'title'=>__('Hides login image completely', 'ag-custom-admin'),
2742
- 'name'=>'agca_login_photo_remove',
2743
- 'label'=>__('Hide login header image', 'ag-custom-admin'),
2744
- ));
2745
-
2746
- $this->print_checkbox(array(
2747
- 'title'=>__('Rounds box on login page', 'ag-custom-admin'),
2748
- 'name'=>'agca_login_round_box',
2749
- 'label'=>'Round box corners',
2750
- 'input-class'=>'has-dependant',
2751
- 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block, #agca_login_round_box_skip_logo"'
2752
- ));
2753
-
2754
- $this->print_input(array(
2755
- 'attributes'=>array(
2756
- 'style'=> ((get_option('agca_login_round_box') !== 'true' )?'display:none':''),
2757
- 'id'=>'agca_login_round_box_size_block'
2758
- ),
2759
- 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2760
- 'name'=>'agca_login_round_box_size',
2761
- 'label'=>__('Round box corners - size', 'ag-custom-admin'),
2762
- 'input-class'=>'validateNumber',
2763
- 'hint'=>__('(Size in px)', 'ag-custom-admin')
2764
- ));
2765
-
2766
- $this->print_checkbox(array(
2767
- 'attributes'=>array(
2768
- 'style'=> ((get_option('agca_login_round_box') !== 'true' )?'display:none':''),
2769
- 'id'=>'agca_login_round_box_skip_logo'
2770
- ),
2771
- //'hide'=>true,
2772
- 'title'=>__('Skip rounding logo on the login page', 'ag-custom-admin'),
2773
- 'name'=>'agca_login_round_box_skip_logo',
2774
- 'label'=>__('Don\'t round logo', 'ag-custom-admin'),
2775
- 'input-class'=>'',
2776
- ));
2777
-
2778
- $this->print_checkbox(array(
2779
- 'hide'=>true,
2780
- 'title'=>__('Hides register link on login page', 'ag-custom-admin'),
2781
- 'name'=>'agca_login_register_remove',
2782
- 'label'=>__('Hide "Register" link', 'ag-custom-admin'),
2783
- 'input-class'=>'has-dependant dependant-opposite',
2784
- 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2785
- ));
2786
-
2787
- $this->print_input(array(
2788
- 'attributes'=>array(
2789
- 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2790
- 'id'=>'agca_login_register_href_block'
2791
- ),
2792
- 'title'=>__('Change register link on login page to point to your custom registration page.', 'ag-custom-admin'),
2793
- 'name'=>'agca_login_register_href',
2794
- 'label'=>__('Change register link', 'ag-custom-admin'),
2795
- 'hint'=>__('Link to new registration page', 'ag-custom-admin')
2796
- ));
2797
-
2798
- $this->print_checkbox(array(
2799
- 'hide'=>true,
2800
- 'title'=>__('Hides lost password link on login page', 'ag-custom-admin'),
2801
- 'name'=>'agca_login_lostpassword_remove',
2802
- 'label'=>__('Hide "Lost password" link', 'ag-custom-admin'),
2803
- ));
2804
- ?>
2805
- <tr>
2806
- <td>
2807
- <p>Add a custom login background image and apply more login page options: <a href="https://cusmin.com/docs/login-page?ref=login-page" target="_blank">Upgrade to Cusmin</a></p>
2808
- </td>
2809
- </tr>
2810
- </table>
2811
- </div>
2812
- <?php
2813
- /*ADMIN MENU*/
2814
- ?>
2815
- <div id="section_admin_menu" style="display:none" class="ag_section">
2816
- <h2 class="section_title"><?php _e('Admin Menu Settings', 'ag-custom-admin'); ?></h2>
2817
- <?php $this->show_save_button_upper(); ?>
2818
- <table class="form-table" width="500px">
2819
- <tr valign="center" class="ag_table_major_options">
2820
- <td><label for="agca_admin_menu_turnonoff"><strong><?php _e('Apply admin menu customizations', 'ag-custom-admin'); ?></strong></label></td>
2821
- <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>
2822
- </tr>
2823
- <tr valign="center" class="ag_table_major_options">
2824
- <td><label for="agca_admin_menu_agca_button_only"><strong><?php _e('Admin menu', 'ag-custom-admin'); ?></strong></label></td>
2825
- <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>
2826
- </tr>
2827
- <?php
2828
- $this->print_options_h3(__('Edit / Remove Menu Items', 'ag-custom-admin'));
2829
- ?>
2830
- <tr>
2831
- <td colspan="2">
2832
- <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 />
2833
- <p tabindex="0"><em>(<?php _e('click on the top menu item to show its sub-menus', 'ag-custom-admin'); ?>)</em></p>
2834
- <table id="ag_edit_adminmenu">
2835
- <tr style="background-color:#816c64;">
2836
- <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>
2837
- </td>
2838
- </tr>
2839
- </table>
2840
- <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')); ?>" />
2841
- <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2842
- </td>
2843
- <td></td>
2844
- </tr>
2845
- <?php
2846
- $this->print_checkbox(array(
2847
- 'title'=>__('Removes Profile menu item for non-admin users.', 'ag-custom-admin'),
2848
- 'hide'=>true,
2849
- 'name'=>'agca_menu_remove_client_profile',
2850
- 'label'=>__('Remove Profile button from user menu', 'ag-custom-admin'),
2851
- ));
2852
- $this->print_checkbox(array(
2853
- 'title'=>__('Removes Customize button on front end for authenticated users.', 'ag-custom-admin'),
2854
- 'hide'=>true,
2855
- 'name'=>'agca_menu_remove_customize_button',
2856
- 'label'=>__('Front end: Remove Customize button', 'ag-custom-admin'),
2857
- ));
2858
- ?>
2859
- <tr>
2860
- <td>
2861
- <p>Try the Cusmin admin menu editor instead: <a href="https://cusmin.com/docs/admin-menu/admin-menu-editor?ref=admin-menu-editor" target="_blank"><br>Upgrade to Cusmin</a></p>
2862
- </td>
2863
- </tr>
2864
-
2865
- <?php
2866
- $this->print_options_h3(__('Add New Menu Items', 'ag-custom-admin'));
2867
- ?>
2868
- <tr>
2869
- <td colspan="2">
2870
- <table id="ag_add_adminmenu">
2871
- <tr>
2872
- <td colspan="2">
2873
- <?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" />
2874
- <?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" />
2875
- <?php _e('open in', 'ag-custom-admin'); ?>:&nbsp;<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:auto;">
2876
- <option value="_self" selected><?php _e('the same tab', 'ag-custom-admin'); ?></option>
2877
- <option value="_blank" ><?php _e('a new tab', 'ag-custom-admin'); ?></option>
2878
- </select>
2879
- <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'); ?>" />
2880
- </td><td></td>
2881
- </tr>
2882
- </table>
2883
- <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')); ?>" />
2884
- </td>
2885
- <td>
2886
- </td>
2887
- </tr>
2888
- <?php
2889
- $this->print_options_h3(__('Admin Menu Settings', 'ag-custom-admin'));
2890
- ?>
2891
- <tr valign="center">
2892
- <th scope="row">
2893
- <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>
2894
- </th>
2895
- <td>
2896
- <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" >
2897
- <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> ><?php _e('Default', 'ag-custom-admin'); ?></option>
2898
- <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> ><?php _e('Force admin menu auto-folding', 'ag-custom-admin'); ?></option>
2899
- <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> ><?php _e('Disable admin menu auto-folding', 'ag-custom-admin'); ?></option>
2900
- </select>
2901
- </td>
2902
- </tr>
2903
- <?php
2904
-
2905
- $this->print_checkbox(array(
2906
- 'hide'=>true,
2907
- 'title'=>__('Removes empty space between some top menu items', 'ag-custom-admin'),
2908
- 'name'=>'agca_admin_menu_separators',
2909
- 'label'=>__('Hide menu items separators', 'ag-custom-admin'),
2910
- ));
2911
-
2912
- $this->print_checkbox(array(
2913
- 'hide'=>true,
2914
- 'title'=>__('Removes icons from dmin menu buttons', 'ag-custom-admin'),
2915
- 'name'=>'agca_admin_menu_icons',
2916
- 'label'=>__('Hide menu icons', 'ag-custom-admin'),
2917
- ));
2918
-
2919
- $this->print_checkbox(array(
2920
- 'hide'=>true,
2921
- 'title'=>__('Removes small arrow that appears on the top button hover', 'ag-custom-admin'),
2922
- 'name'=>'agca_admin_menu_arrow',
2923
- 'label'=>__('Hide sub-menu arrow', 'ag-custom-admin'),
2924
- ));
2925
-
2926
- $this->print_checkbox(array(
2927
- 'hide'=>true,
2928
- 'title'=>__('Removes collapse button at the end of admin menu', 'ag-custom-admin'),
2929
- 'name'=>'agca_admin_menu_collapse_button',
2930
- 'label'=>__('Hide "Collapse menu" button', 'ag-custom-admin'),
2931
- ));
2932
-
2933
- $this->print_checkbox(array(
2934
- 'title'=>__('Rounds submenu pop-up box', 'ag-custom-admin'),
2935
- 'name'=>'agca_admin_menu_submenu_round',
2936
- 'label'=>__('Round sub-menu pop-up box', 'ag-custom-admin'),
2937
- 'input-attributes'=>'data-dependant="#agca_admin_menu_submenu_round_size"',
2938
- 'input-class'=>'has-dependant',
2939
- ));
2940
-
2941
- $this->print_input(array(
2942
- 'attributes'=>array(
2943
- 'style'=> ((get_option('agca_admin_menu_submenu_round')!=='true')?'display:none':''),
2944
- 'id'=>'agca_admin_menu_submenu_round_size'
2945
- ),
2946
- 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2947
- 'name'=>'agca_admin_menu_submenu_round_size',
2948
- 'label'=>__('Round sub-menu pop-up box - size', 'ag-custom-admin'),
2949
- 'input-class'=>'validateNumber',
2950
- 'hint'=>__('(Size in px)', 'ag-custom-admin')
2951
- ));
2952
-
2953
- $this->print_input(array(
2954
- 'title'=>__('Adds custom logo above the admin menu', 'ag-custom-admin'),
2955
- 'name'=>'agca_admin_menu_brand',
2956
- 'label'=>__('Admin menu branding logo', 'ag-custom-admin'),
2957
- 'hint'=>__('Image URL', 'ag-custom-admin')
2958
- ));
2959
-
2960
- $this->print_input(array(
2961
- 'title'=>__('Change branding logo link</br></br>Use:', 'ag-custom-admin').'</br><strong>%BLOG%</strong> - '. __('for blog URL', 'ag-custom-admin'),
2962
- 'name'=>'agca_admin_menu_brand_link',
2963
- 'label'=>__('Branding logo link', 'ag-custom-admin'),
2964
- 'hint'=>__('Branding image URL', 'ag-custom-admin')
2965
- ));
2966
- ?>
2967
- </table>
2968
- </div>
2969
- <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2970
- <h2 class="section_title"><?php _e('Colorizer Page', 'ag-custom-admin'); ?></h2>
2971
- <?php $this->show_save_button_upper(); ?>
2972
- <table class="form-table" width="500px">
2973
- <tr valign="center" class="ag_table_major_options">
2974
- <td><label for="agca_colorizer_turnonoff"><strong><?php _e('Apply Colorizer customizations', 'ag-custom-admin'); ?></strong></label></td>
2975
- <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>
2976
- </tr>
2977
- <?php
2978
- $this->print_options_h3(__('Global Color Options', 'ag-custom-admin'));
2979
-
2980
- $this->print_color('color_background',__('Background:', 'ag-custom-admin'),__('Change admin page background color', 'ag-custom-admin'));
2981
- $this->print_color('login_color_background',__('Login page background:', 'ag-custom-admin'),__('Change login page background color', 'ag-custom-admin'));
2982
- $this->print_color('color_header',__('Admin bar:', 'ag-custom-admin'),__('Change admin bar (on top) color in admin panel', 'ag-custom-admin'));
2983
-
2984
- $this->print_options_h3(__('Admin Menu Color Options', 'ag-custom-admin'));
2985
-
2986
- $this->print_color('color_admin_menu_top_button_background',__('Button background:', 'ag-custom-admin'),__('Change button background color', 'ag-custom-admin'));
2987
- $this->print_color('color_admin_menu_font',__('Button text:', 'ag-custom-admin'),__('Change button text color', 'ag-custom-admin'));
2988
- $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'));
2989
- $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'));
2990
- $this->print_color('color_admin_menu_submenu_background',__('Sub-menu button background:', 'ag-custom-admin'),__('Change submenu item background color', 'ag-custom-admin'));
2991
- $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'));
2992
- $this->print_color('color_admin_submenu_font',__('Sub-menu text:', 'ag-custom-admin'),__('Sub-menu text color', 'ag-custom-admin'));
2993
- $this->print_color('color_admin_menu_behind_background',__('Wrapper background:', 'ag-custom-admin'),__('Change background color of element behind admin menu', 'ag-custom-admin'));
2994
-
2995
- $this->print_options_h3(__('Font Color Options', 'ag-custom-admin'));
2996
-
2997
- $this->print_color('color_font_content',__('Content text:', 'ag-custom-admin'),__('Change color in content text', 'ag-custom-admin'));
2998
- $this->print_color('color_font_header',__('Admin bar text:', 'ag-custom-admin'),__('Change color of admin bar text', 'ag-custom-admin'));
2999
- $this->print_color('color_font_footer',__('Footer text:', 'ag-custom-admin'),__('Change color in footer text', 'ag-custom-admin'));
3000
-
3001
- $this->print_options_h3(__('Widgets Color Options', 'ag-custom-admin'));
3002
-
3003
- $this->print_color('color_widget_bar',__('Title bar background:', 'ag-custom-admin'),__('Change color in header text', 'ag-custom-admin'));
3004
- $this->print_color('color_widget_background',__('Background:', 'ag-custom-admin'),__('Change widget background color', 'ag-custom-admin'));
3005
- ?>
3006
-
3007
- </table>
3008
- <p>Need more Colorizer options? <a href="https://cusmin.com/docs/colorizer?ref=agca" target="_blank">Upgrade to Cusmin</a></p>
3009
- <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
3010
- <div id="picker"></div>
3011
- </div>
3012
- <?php if(defined('AGCA_THEMES')){ ?>
3013
- <div id="section_templates" style="display:none" class="ag_section">
3014
- <h2 class="section_title"><span style="float:left"><?php _e('Admin Themes', 'ag-custom-admin'); ?></span></h2>
3015
- <table class="form-table" width="500px">
3016
- <tr valign="center">
3017
- <td>
3018
- <p style="color: red; font-size:15px;font-weight:bold;margin-bottom:20px;">Note: AGCA Themes will be discontinued soon!</p>
3019
- <div id="agca_templates"></div>
3020
- </td>
3021
- </tr>
3022
- <tr>
3023
- <td>
3024
- <div id="advanced_template_options" style="display:none">
3025
- <div class="agca-feedback-and-support">
3026
- <ul>
3027
- <?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>*/ ?>
3028
- <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>
3029
- </ul>
3030
- </div>
3031
- </div>
3032
- </td>
3033
- </tr>
3034
- </table>
3035
- </div>
3036
- <?php } ?>
3037
- <div id="section_advanced" style="display:none" class="ag_section">
3038
- <h2 class="section_title"><?php _e('Advanced', 'ag-custom-admin'); ?></h2>
3039
- <?php $this->show_save_button_upper(); ?>
3040
- <table class="form-table" width="500px">
3041
- <tr valign="center">
3042
- <td colspan="2">
3043
- <p class="agca-tip"><i><?php _e('<strong>Note: </strong>These options will override existing customizations', 'ag-custom-admin'); ?></i></p>
3044
- </td><td></td>
3045
- </tr>
3046
- <tr valign="center">
3047
- <th scope="row">
3048
- <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>
3049
- </th>
3050
- <td>
3051
- <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>
3052
- </td>
3053
- </tr>
3054
- <tr valign="center">
3055
- <th scope="row">
3056
- <label title="<?php _e('Add additional custom JavaScript', 'ag-custom-admin'); ?>" for="agca_custom_js"><?php _e('Custom JavaScript', 'ag-custom-admin'); ?></label>
3057
- </th>
3058
- <td>
3059
- <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>
3060
- </td>
3061
- </tr>
3062
- <?php
3063
- $this->print_checkbox(array(
3064
- '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'),
3065
- 'name'=>'agca_disable_postver',
3066
- 'label'=>__('Temporary disable POST verification', 'ag-custom-admin'),
3067
- ));
3068
- ?>
3069
- <tr valign="center">
3070
- <th scope="row">
3071
- <label title="<?php _e('Export / import settings', 'ag-custom-admin'); ?>" for="agca_export_import"><?php _e('Export / import settings', 'ag-custom-admin'); ?></label>
3072
- </th>
3073
- <td id="import_file_area">
3074
- <input class="agca_button" type="button" name="agca_export_settings" value="<?php _e('Export Settings', 'ag-custom-admin'); ?>" onclick="exportSettings();"/></br>
3075
- <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
3076
- <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
3077
- <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
3078
- <input class="agca_button" type="button" name="agca_import_settings" value="<?php _e('Import Settings', 'ag-custom-admin'); ?>" onclick="importSettings();"/>
3079
- </td>
3080
- </tr>
3081
- </table>
3082
- </div>
3083
- <?php $this->show_save_button(); ?>
3084
- </form>
3085
- <form id="agca_templates_form" name="agca_templates_form" action="<?php echo htmlentities(get_site_url().$_SERVER['PHP_SELF']);?>?page=ag-custom-admin/plugin.php" method="post">
3086
- <?php wp_nonce_field('agca_form','_agca_token'); ?>
3087
- <input type="hidden" name="_agca_save_template" value="true" />
3088
- <input type="hidden" id="templates_data" name="templates_data" value="" />
3089
- <input type="hidden" id="templates_name" name="templates_name" value="" />
3090
- </form>
3091
- </div>
3092
- <?php
3093
- }
3094
-
3095
- #region PRIVATE METHODS
3096
- function show_save_button_upper(){
3097
- ?>
3098
- <div class="save-button-upper">
3099
- <?php $this->show_save_button() ?>
3100
- </div>
3101
- <?php
3102
- }
3103
- function show_save_button(){
3104
- ?>
3105
- <p class="submit agca-clear">
3106
- <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()" />
3107
- </p>
3108
- <?php
3109
- }
3110
-
3111
- function print_checkbox($data){
3112
- $strAttributes = '';
3113
- $strOnchange = '';
3114
- $strInputClass='';
3115
- $strInputAttributes='';
3116
- $isChecked = false;
3117
-
3118
- if(isset($data['attributes'])){
3119
- foreach($data['attributes'] as $key=>$val){
3120
- $strAttributes.=' '.$key.'="'.$val.'"';
3121
- }
3122
- }
3123
- if(isset($data['input-class'])){
3124
- $strInputClass = $data['input-class'];
3125
- }
3126
- if(isset($data['hide'])){
3127
- $strInputClass .= " visibility";
3128
- }
3129
- if(isset($data['input-attributes'])){
3130
- $strInputAttributes = $data['input-attributes'];
3131
- }
3132
- if(isset($data['onchange'])){
3133
- $strOnchange = $data['onchange'];
3134
- }
3135
- if(!isset($data['title'])){
3136
- $data['title'] = $data['label'];
3137
- }
3138
- if(isset($data['checked'])){
3139
- $isChecked = $data['checked'];
3140
- }else{
3141
- //use default check with the option
3142
- $isChecked = get_option($data['name'])==true;
3143
- }
3144
- ?>
3145
- <tr valign="center" <?php echo $strAttributes ?> >
3146
- <th>
3147
- <label tabindex="0" title='<?php echo $data['title'] ?>' for="<?php echo $data['name'] ?>" ><?php echo $data['label'] ?></label>
3148
- </th>
3149
- <td>
3150
- <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"':'' ?> />
3151
- </td>
3152
- </tr>
3153
- <?php
3154
- }
3155
- function print_input($data){
3156
- $strHint = '';
3157
- $suffix ='';
3158
- $strAttributes = '';
3159
- $parentAttr = '';
3160
- if(isset($data['hint'])){
3161
- $strHint = '&nbsp;<p><i>'.$data['hint'].'</i></p>';
3162
- }
3163
- if(!isset($data['title'])){
3164
- $data['title'] = $data['label'];
3165
- }
3166
- if(isset($data['suffix'])){
3167
- $suffix = $data['suffix'];
3168
- }
3169
- if(isset($data['attributes'])){
3170
- foreach($data['attributes'] as $key=>$val){
3171
- $strAttributes.=' '.$key.'="'.$val.'"';
3172
- }
3173
- }
3174
- ?>
3175
- <tr valign="center" <?php echo $strAttributes ?> >
3176
- <th >
3177
- <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3178
- </th>
3179
- <td>
3180
- <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']); ?>" />
3181
- <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 ?>
3182
- <?php echo $strHint ?>
3183
- </td>
3184
- </tr>
3185
- <?php
3186
- }
3187
- function print_textarea($data){
3188
- $strHint = '';
3189
- $strClass = '';
3190
- if(isset($data['hint'])){
3191
- $strHint = '&nbsp;<p><i>'.$data['hint'].'</i>.</p>';
3192
- }
3193
- if(!isset($data['title'])){
3194
- $data['title'] = $data['label'];
3195
- }
3196
- if(isset($data['class'])){
3197
- $strClass = $data['class'];
3198
- }
3199
- ?>
3200
- <tr valign="center">
3201
- <th scope="row">
3202
- <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3203
- </th>
3204
- <td>
3205
- <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>
3206
- <?php echo $strHint ?>
3207
- </td>
3208
- </tr>
3209
- <?php
3210
- }
3211
- function print_color($name, $label, $title){
3212
- ?>
3213
- <tr valign="center" class="color">
3214
- <th><label title="<?php echo $title ?>" for="<?php echo $name ?>"><?php echo $label ?></label></th>
3215
- <td><input type="text" placeholder="#" id="<?php echo $name ?>" name="<?php echo $name ?>" class="color_picker" value="<?php echo $this->getAGCAColor($name); ?>" />
3216
- <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>
3217
- <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>
3218
- </td>
3219
- </tr>
3220
- <?php
3221
- }
3222
- function print_options_h3($title){
3223
- ?>
3224
- <tr valign="center">
3225
- <td colspan="2">
3226
- <div class="ag_table_heading"><h3 tabindex="0"><?php echo $title ?></h3></div>
3227
- </td>
3228
- <td></td>
3229
- </tr>
3230
- <?php
3231
- }
3232
- function print_option_tr(){
3233
- ?>
3234
-
3235
- <tr valign="center">
3236
- <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>
3237
- <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'); ?>" />
3238
- <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button agca_button" value="<?php _e('Pick color', 'ag-custom-admin'); ?>" />
3239
- <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear agca_button" value="<?php _e('Clear', 'ag-custom-admin'); ?>" />
3240
- </td>
3241
- </tr>
3242
- <?php
3243
- }
3244
- #endregion
3245
-
3246
- }
 
 
 
 
 
 
 
 
 
 
 
 
3247
  //TODO: Add log out button to the admin menu
1
+ <?php
2
+ /*
3
+ Plugin Name: Absolutely Glamorous Custom Admin
4
+ Plugin URI: https://cusmin.com/agca
5
+ Description: All-in-one tool for admin panel customization. Change almost everything: admin menu, dashboard, login page, admin bar and much more.
6
+ Author: Cusmin
7
+ Version: 6.7
8
+ Text Domain: ag-custom-admin
9
+ Domain Path: /languages
10
+ Author URI: https://cusmin.com
11
+
12
+ Copyright 2021. Cusmin (email : info@cusmin.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 = "";
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.7";
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
+ 'read_and_close' => true,
136
+ ]);
137
+ }
138
+ }
139
+
140
+ function checkGET(){
141
+ if(isset($_GET['agca_action'])){
142
+ if($_GET['agca_action'] =="remove_templates"){
143
+ $this->delete_template_images_all();
144
+ update_option('agca_templates', "");
145
+ update_option('agca_selected_template', "");
146
+ }
147
+ }
148
+ if(isset($_GET['agca_debug'])){
149
+ if($_GET['agca_debug'] =="true"){
150
+ $this->agca_debug = true;
151
+ }else{
152
+ $this->agca_debug = false;
153
+ }
154
+ }
155
+ }
156
+
157
+ function checkPOST(){
158
+ if(isset($_POST['_agca_save_template'])){
159
+ $this->verifyPostRequest();
160
+ //print_r($_POST);
161
+ $data = $_POST['templates_data'];
162
+ $parts = explode("|||",$data);
163
+
164
+ $common_data = $parts [0];
165
+ $admin_js = $parts [1];
166
+ $admin_css = $parts [2];
167
+ $login_js = $parts [3];
168
+ $login_css = $parts [4];
169
+ $settings = $parts [5];
170
+ $images = $parts [6];
171
+
172
+ $template_name = $_POST['templates_name'];
173
+
174
+ update_option('agca_selected_template', $template_name);
175
+
176
+ $templates = get_option( 'agca_templates' );
177
+ if($templates == ""){
178
+ $templates = array();
179
+ }
180
+
181
+ $templates[$template_name] = array(
182
+ 'common'=>$common_data,
183
+ 'admin'=>"",
184
+ 'adminjs'=>$admin_js,
185
+ 'admincss'=>$admin_css,
186
+ 'login'=>"",
187
+ 'loginjs'=>$login_js,
188
+ 'logincss'=>$login_css,
189
+ 'images'=>$images,
190
+ 'settings'=>$settings
191
+ );
192
+ update_option('agca_templates', $templates);
193
+
194
+ $_POST = array();
195
+
196
+ }else if(isset($_POST['_agca_templates_session'])){
197
+ $this->verifyPostRequest();
198
+ $this->agcaAdminSession();
199
+ if($_POST['template'] !="")
200
+ $_SESSION["AGCA"]["Templates"][$_POST['template']] = array("license"=>$_POST['license']);
201
+
202
+ //print_r($_SESSION);
203
+ echo "_agca_templates_session:OK";
204
+ exit;
205
+ }else if(isset($_POST['_agca_templates_session_remove_license'])){
206
+ $this->verifyPostRequest();
207
+ $this->agcaAdminSession();
208
+ if($_POST['template'] !="")
209
+ $_SESSION["AGCA"]["Templates"][$_POST['template']] = null;
210
+ print_r($_SESSION);
211
+ echo "_agca_templates_session_remove_license:OK";
212
+ exit;
213
+ }else if(isset($_POST['_agca_get_templates'])){
214
+ $this->verifyPostRequest();
215
+ $templates = get_option( 'agca_templates' );
216
+ if($templates == "") $templates = array();
217
+ $results = array();
218
+ foreach($templates as $key=>$val){
219
+ $results[]=$key;
220
+ }
221
+ echo json_encode($results);
222
+ exit;
223
+ }else if(isset($_POST['_agca_activate_template'])){
224
+ $this->verifyPostRequest();
225
+ update_option('agca_selected_template', $_POST['_agca_activate_template']);
226
+ $_POST = array();
227
+ //unset($_POST);
228
+ exit;
229
+ }else if(isset($_POST['_agca_template_settings'])){
230
+ $this->verifyPostRequest();
231
+ $settings = $_POST['_agca_template_settings'];
232
+
233
+ $templates = get_option( 'agca_templates' );
234
+ if($templates == ""){
235
+ $templates = array();
236
+ }
237
+ $template_name = $_POST["_agca_current_template"];
238
+
239
+ $templates[$template_name]["settings"] = $settings;
240
+ update_option('agca_templates', $templates);
241
+
242
+ $_POST = array();
243
+ //print_r($templates);
244
+ exit;
245
+ }else if(isset($_POST['_agca_upload_image'])){
246
+ $this->verifyPostRequest();
247
+ function my_sideload_image() {
248
+ $remoteurl = $_POST['_agca_upload_image'];
249
+ $file = media_sideload_image( $remoteurl, 0 ,__("Absolutely Glamorous Custom Admin theme image (do not delete)", 'ag-custom-admin'));
250
+ try{
251
+ $fileparts = explode("src='", $file);
252
+ $url=explode("'",$fileparts[1]);
253
+ echo $url[0];
254
+ }catch (\Exception $e){}
255
+ exit;
256
+ }
257
+ add_action( 'admin_init', 'my_sideload_image' );
258
+
259
+ }else if(isset($_POST['_agca_remove_template_images'])){
260
+ $this->verifyPostRequest();
261
+ $this->delete_template_images($_POST['_agca_remove_template_images']);
262
+ exit;
263
+ }
264
+ }
265
+
266
+ function verifyPostRequest(){
267
+ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
268
+ if (!is_admin()) {
269
+ _e('Not allowed. This action is allowed exclusively in admin panel', 'ag-custom-admin');
270
+ exit;
271
+ }
272
+ //In case of problems with saving AGCA settings on MS disable verification temporary
273
+ if(get_option('agca_disable_postver')){
274
+ return;
275
+ }
276
+ if (is_multisite()) {
277
+ $blog_id = get_current_blog_id();
278
+ $user_id = get_current_user_id();
279
+ $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');
280
+ if (is_user_member_of_blog($user_id, $blog_id)) {
281
+ if (!current_user_can('manage_options')) {
282
+ _e('Multi-site: Current user is not recognized as administrator.', 'ag-custom-admin');
283
+ echo ' '.$msError;
284
+ exit;
285
+ }
286
+ } else {
287
+ printf(
288
+ /*translators: 1: User Id 2: Blog Id*/
289
+ __('Multi-site: User (%1$s) does not have access to this blog (%2$s).', 'ag-custom-admin'),
290
+ $user_id,
291
+ $blog_id
292
+ );
293
+ echo ' '. $msError;
294
+ exit;
295
+ }
296
+ } else {
297
+ include_once($this->filePath('wp-includes/pluggable.php'));
298
+ if (!is_user_logged_in() || !current_user_can('manage_options')) {
299
+ echo !is_user_logged_in() ? __('User is not logged in.', 'ag-custom-admin').' ' : '';
300
+ echo !current_user_can('manage_options') ? __('User can not manage options.', 'ag-custom-admin').' ' : '';
301
+ exit;
302
+ }
303
+ }
304
+ if (!wp_verify_nonce($_POST['_agca_token'], 'agca_form')) {
305
+ echo __('Nonce verification failed.', 'ag-custom-admin');
306
+ exit;
307
+ }
308
+ }
309
+ }
310
+
311
+ function get_language_strings() {
312
+ $strings = array(
313
+
314
+ );
315
+ return $strings;
316
+ }
317
+
318
+ function admin_bar_changes(){
319
+ if( current_user_can( 'manage_options' )){
320
+ global $wp_admin_bar;
321
+ if(!is_network_admin()){
322
+ $wp_admin_bar->add_menu( array(
323
+ 'id' => 'agca-admin-themes',
324
+ 'title' => '<span class="ab-icon"></span>'.__( 'Admin Themes', 'ag-custom-admin' ),
325
+ 'href' => 'tools.php?page=ag-custom-admin/plugin.php#ag-templates'
326
+ ));
327
+ }
328
+ }
329
+ }
330
+
331
+ function delete_template_images_all(){
332
+ $templates = get_option('agca_templates');
333
+ if($templates != null && $templates != ""){
334
+ foreach($templates as $template){
335
+ if($template != null && $template['images'] != null && $template['images'] != ""){
336
+ //print_r($template['images']);
337
+ $imgs = explode(',',$template['images']);
338
+ foreach($imgs as $imageSrc){
339
+ $this->delete_attachment_by_src($imageSrc);
340
+ }
341
+ //print_r($imgs);
342
+ }
343
+ }
344
+ }
345
+ //print_r($templates);
346
+ }
347
+
348
+ function delete_template_images($template_name){
349
+ $templates = get_option('agca_templates');
350
+ if($templates != null && $templates != ""){
351
+ $template = $templates[$template_name];
352
+ if($template != null && $template['images'] != null && $template['images'] != ""){
353
+ //print_r($template['images']); exit;
354
+ $imgs = explode(',',$template['images']);
355
+ foreach($imgs as $imageSrc){
356
+ $this->delete_attachment_by_src($imageSrc);
357
+ }
358
+ //print_r($imgs);
359
+ }
360
+ }
361
+ //print_r($templates);
362
+ }
363
+
364
+ function delete_attachment_by_src ($image_src) {
365
+ global $wpdb;
366
+ $query = "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'";
367
+ $id = $wpdb->get_var($query);
368
+ wp_delete_attachment( $id, $true );
369
+ }
370
+
371
+ function get_installed_agca_templates(){
372
+ $templates = get_option( 'agca_templates' );
373
+ if($templates == "")return '[]';
374
+ $results = array();
375
+ foreach($templates as $key=>$val){
376
+ $results[]=$key;
377
+ }
378
+ return json_encode($results);
379
+ }
380
+
381
+ function isGuest(){
382
+ global $user_login;
383
+ if($user_login) {
384
+ return false;
385
+ }else{
386
+ return true;
387
+ }
388
+ }
389
+ function change_title($admin_title, $title){
390
+ //return get_bloginfo('name').' - '.$title;
391
+ if(get_option('agca_custom_title')!=""){
392
+ $blog = get_bloginfo('name');
393
+ $page = $title;
394
+ $customTitle = get_option('agca_custom_title');
395
+ $customTitle = str_replace('%BLOG%',$blog,$customTitle);
396
+ $customTitle = str_replace('%PAGE%',$page,$customTitle);
397
+ return $customTitle;
398
+ }else{
399
+ return $admin_title;
400
+ }
401
+ }
402
+ function agca_get_includes() {
403
+ ?>
404
+ <script type="text/javascript">
405
+ <?php
406
+ //AGCA GLOBALS
407
+ echo "var agca_global_plugin_url = '".$this->pluginUrl()."';";
408
+ ?>
409
+ </script>
410
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/ag_style.css?ver=<?php echo $this->agca_version; ?>" />
411
+ <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"; ?>" />
412
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
413
+ <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>
414
+
415
+ <?php
416
+ if($this->context == "login"){
417
+ ?>
418
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/login.min.css" />
419
+ <?php
420
+ }else{
421
+ ?>
422
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/admin.min.css" />
423
+ <?php
424
+ }
425
+ ?>
426
+ <?php
427
+ echo $this->templateCustomizations;
428
+
429
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
430
+ ?>
431
+ <style type="text/css">
432
+ <?php
433
+ echo get_option('agca_custom_css');
434
+ ?>
435
+ </style>
436
+ <script type="text/javascript">
437
+ try{
438
+ eval("<?php echo str_replace(array("\r\n", "\n", "\r"), ' ', get_option('agca_custom_js')); ?>");
439
+ }catch(e){
440
+ 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'); ?>)');
441
+ console.log(e);
442
+ }
443
+ </script>
444
+ <?php
445
+ }
446
+ }
447
+
448
+ function agca_enqueue_scripts() {
449
+ wp_enqueue_script('jquery');
450
+ //TODO: Use this instead of manually adding scripts
451
+ //wp_enqueue_script('agca-script', __FILE__.'/script/ag_script.js', array('jquery'),$this->agca_version );
452
+ }
453
+
454
+ function WPSPluginIsLoginPage(){
455
+ $WPSPluginName = 'wps-hide-login/wps-hide-login.php';
456
+ if(is_multisite()){
457
+ if ( ! function_exists( 'is_plugin_active_for_network' ) ){
458
+ $pluginPhpFilePath = $this->filePath('wp-admin/includes/plugins.php');
459
+ if(!file_exists($pluginPhpFilePath)){
460
+ return '';
461
+ }
462
+ require_once($pluginPhpFilePath);
463
+ }
464
+
465
+ if(!$this->isPluginActiveForNetwork($WPSPluginName)){
466
+ return '';
467
+ }
468
+ }else{
469
+ if(!$this->isPluginActive($WPSPluginName)){
470
+ return '';
471
+ }
472
+ }
473
+
474
+ if ( $slug = get_option( 'whl_page' ) ) {
475
+ return $slug;
476
+ } else if ( ( is_multisite() && $this->isPluginActiveForNetwork($WPSPluginName) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
477
+ return $slug;
478
+ } else if ( $slug = 'login' ) {
479
+ return $slug;
480
+ }
481
+ $requestURI = $_SERVER['REQUEST_URI'];
482
+ return $this->startsWith('/'.$slug.'/', $requestURI);
483
+ }
484
+
485
+ function reloadScript(){
486
+ $isAdmin = false;
487
+ if(defined('WP_ADMIN') && WP_ADMIN == 1){
488
+ $isAdmin = true;
489
+ }
490
+ if($isAdmin || $this->WPSPluginIsLoginPage()){
491
+ $this->agca_enqueue_scripts();
492
+ }
493
+ }
494
+
495
+ function agca_register_settings() {
496
+ register_setting( 'agca-options-group', 'agca_role_allbutadmin' );
497
+ register_setting( 'agca-options-group', 'agca_screen_options_menu' );
498
+ register_setting( 'agca-options-group', 'agca_help_menu' );
499
+ register_setting( 'agca-options-group', 'agca_logout' );
500
+ register_setting( 'agca-options-group', 'agca_remove_your_profile' );
501
+ register_setting( 'agca-options-group', 'agca_logout_only' );
502
+ register_setting( 'agca-options-group', 'agca_custom_title' );
503
+ register_setting( 'agca-options-group', 'agca_howdy' );
504
+ register_setting( 'agca-options-group', 'agca_header' );
505
+ register_setting( 'agca-options-group', 'agca_header_show_logout' );
506
+ register_setting( 'agca-options-group', 'agca_footer' );
507
+ register_setting( 'agca-options-group', 'agca_privacy_options' );
508
+ register_setting( 'agca-options-group', 'agca_header_logo' );
509
+ register_setting( 'agca-options-group', 'agca_header_logo_custom' );
510
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom' );
511
+ register_setting( 'agca-options-group', 'agca_remove_site_link' );
512
+ register_setting( 'agca-options-group', 'agca_wp_logo_custom_link' );
513
+ register_setting( 'agca-options-group', 'agca_profile_color_scheme' );
514
+
515
+ register_setting( 'agca-options-group', 'agca_site_heading' );
516
+ register_setting( 'agca-options-group', 'agca_custom_site_heading' );
517
+ register_setting( 'agca-options-group', 'agca_update_bar' );
518
+
519
+ register_setting( 'agca-options-group', 'agca_footer_left' );
520
+ register_setting( 'agca-options-group', 'agca_footer_left_hide' );
521
+ register_setting( 'agca-options-group', 'agca_footer_right' );
522
+ register_setting( 'agca-options-group', 'agca_footer_right_hide' );
523
+
524
+ register_setting( 'agca-options-group', 'agca_login_banner' );
525
+ register_setting( 'agca-options-group', 'agca_login_banner_text' );
526
+ register_setting( 'agca-options-group', 'agca_login_photo_remove' );
527
+ register_setting( 'agca-options-group', 'agca_login_photo_url' );
528
+ register_setting( 'agca-options-group', 'agca_login_photo_href' );
529
+ register_setting( 'agca-options-group', 'agca_login_round_box' );
530
+ register_setting( 'agca-options-group', 'agca_login_round_box_size' );
531
+ register_setting( 'agca-options-group', 'agca_login_round_box_skip_logo' );
532
+
533
+
534
+ register_setting( 'agca-options-group', 'agca_dashboard_icon' );
535
+ register_setting( 'agca-options-group', 'agca_dashboard_text' );
536
+ register_setting( 'agca-options-group', 'agca_dashboard_text_paragraph' );
537
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_welcome' );
538
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_activity' );
539
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_il' );
540
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_plugins' );
541
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_qp' );
542
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_rn' );
543
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_rd' );
544
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_primary' );
545
+ register_setting( 'agca-options-group', 'agca_dashboard_widget_secondary' );
546
+
547
+ //WP3.3
548
+ register_setting( 'agca-options-group', 'agca_admin_bar_comments' );
549
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content' );
550
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_post' );
551
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_link' );
552
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_page' );
553
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_user' );
554
+ register_setting( 'agca-options-group', 'agca_admin_bar_new_content_media' );
555
+ register_setting( 'agca-options-group', 'agca_admin_bar_update_notifications' );
556
+ register_setting( 'agca-options-group', 'agca_admin_bar_admin_themes' );
557
+ register_setting( 'agca-options-group', 'agca_remove_top_bar_dropdowns' );
558
+ register_setting( 'agca-options-group', 'agca_admin_bar_frontend' );
559
+ register_setting( 'agca-options-group', 'agca_admin_bar_frontend_hide' );
560
+ register_setting( 'agca-options-group', 'agca_login_register_remove' );
561
+ register_setting( 'agca-options-group', 'agca_login_register_href' );
562
+ register_setting( 'agca-options-group', 'agca_login_lostpassword_remove' );
563
+ register_setting( 'agca-options-group', 'agca_admin_capability' );
564
+ register_setting( 'agca-options-group', 'agca_disablewarning' );
565
+ register_setting( 'agca-template-group', 'agca_selected_template' );
566
+ register_setting( 'agca-template-group', 'agca_templates' );
567
+ //delete_option( 'agca_templates' );
568
+
569
+
570
+ /*Admin menu*/
571
+ register_setting( 'agca-options-group', 'agca_admin_menu_turnonoff' );
572
+ register_setting( 'agca-options-group', 'agca_admin_menu_agca_button_only' );
573
+ register_setting( 'agca-options-group', 'agca_admin_menu_separators' );
574
+ register_setting( 'agca-options-group', 'agca_admin_menu_icons' );
575
+ register_setting( 'agca-options-group', 'agca_admin_menu_collapse_button' );
576
+ register_setting( 'agca-options-group', 'agca_admin_menu_arrow' );
577
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round' );
578
+ register_setting( 'agca-options-group', 'agca_admin_menu_submenu_round_size' );
579
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand' );
580
+ register_setting( 'agca-options-group', 'agca_admin_menu_brand_link' );
581
+ register_setting( 'agca-options-group', 'agca_admin_menu_autofold' );
582
+ register_setting( 'agca-options-group', 'ag_edit_adminmenu_json' );
583
+ register_setting( 'agca-options-group', 'ag_edit_adminmenu_json_new' );
584
+ register_setting( 'agca-options-group', 'ag_add_adminmenu_json' );
585
+ register_setting( 'agca-options-group', 'ag_colorizer_json' );
586
+ register_setting( 'agca-options-group', 'agca_colorizer_turnonoff' );
587
+
588
+ register_setting( 'agca-options-group', 'agca_custom_js' );
589
+ register_setting( 'agca-options-group', 'agca_custom_css' );
590
+ register_setting( 'agca-options-group', 'agca_disable_postver' );
591
+ register_setting( 'agca-options-group', 'agca_menu_remove_client_profile' );
592
+ register_setting( 'agca-options-group', 'agca_menu_remove_customize_button' );
593
+
594
+
595
+ if(!empty($_POST)){
596
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=="true"){
597
+ $this->verifyPostRequest();
598
+ if(isset($_FILES) && isset($_FILES['settings_import_file']) ){
599
+ if($_FILES["settings_import_file"]["error"] > 0){
600
+ }else{
601
+ $file = $_FILES['settings_import_file'];
602
+ if($this->startsWith($file['name'],'AGCA_Settings')){
603
+ if (file_exists($file['tmp_name'])) {
604
+ $fh = fopen($file['tmp_name'], 'r');
605
+ $theData = "";
606
+ if(filesize($file['tmp_name']) > 0){
607
+ $theData = fread($fh,filesize($file['tmp_name']));
608
+ }
609
+ fclose($fh);
610
+ $this->importSettings($theData);
611
+ }
612
+ }
613
+ }
614
+ }
615
+ }else if(isset($_POST['_agca_export_settings']) && $_POST['_agca_export_settings']=="true"){
616
+ $this->verifyPostRequest();
617
+ $this->exportSettings();
618
+ }
619
+ }
620
+
621
+ if(isset($_GET['agca_action'])){
622
+ if($_GET['agca_action'] == "disablewarning"){
623
+ update_option('agca_disablewarning', true);
624
+ }
625
+ }
626
+ }
627
+
628
+ function agca_deactivate() {
629
+
630
+ }
631
+
632
+ function getOptions(){
633
+ return Array(
634
+ 'agca_role_allbutadmin',
635
+ 'agca_admin_bar_frontend',
636
+ 'agca_admin_bar_frontend_hide',
637
+ 'agca_login_register_remove',
638
+ 'agca_login_register_href',
639
+ 'agca_login_lostpassword_remove',
640
+ 'agca_admin_capability',
641
+ 'agca_screen_options_menu',
642
+ 'agca_help_menu',
643
+ 'agca_logout',
644
+ 'agca_remove_your_profile',
645
+ 'agca_logout_only',
646
+ 'agca_custom_title',
647
+ 'agca_howdy',
648
+ 'agca_header',
649
+ 'agca_header_show_logout',
650
+ 'agca_footer',
651
+ 'agca_privacy_options',
652
+ 'agca_header_logo',
653
+ 'agca_header_logo_custom',
654
+ 'agca_remove_site_link',
655
+ 'agca_wp_logo_custom',
656
+ 'agca_wp_logo_custom_link',
657
+ 'agca_profile_color_scheme',
658
+ 'agca_site_heading',
659
+ 'agca_custom_site_heading',
660
+ 'agca_update_bar',
661
+ 'agca_footer_left',
662
+ 'agca_footer_left_hide',
663
+ 'agca_footer_right',
664
+ 'agca_footer_right_hide',
665
+ 'agca_login_banner',
666
+ 'agca_login_banner_text',
667
+ 'agca_login_photo_remove',
668
+ 'agca_login_photo_url',
669
+ 'agca_login_photo_href',
670
+ 'agca_login_round_box',
671
+ 'agca_login_round_box_size',
672
+ 'agca_login_round_box_skip_logo',
673
+ 'agca_dashboard_icon',
674
+ 'agca_dashboard_text',
675
+ 'agca_dashboard_text_paragraph',
676
+ 'agca_dashboard_widget_welcome',
677
+ 'agca_dashboard_widget_activity',
678
+ 'agca_dashboard_widget_il',
679
+ 'agca_dashboard_widget_plugins',
680
+ 'agca_dashboard_widget_qp',
681
+ 'agca_dashboard_widget_rn',
682
+ 'agca_dashboard_widget_rd',
683
+ 'agca_dashboard_widget_primary',
684
+ 'agca_dashboard_widget_secondary',
685
+ 'agca_admin_bar_comments',
686
+ 'agca_admin_bar_new_content',
687
+ 'agca_admin_bar_new_content_post',
688
+ 'agca_admin_bar_new_content_link',
689
+ 'agca_admin_bar_new_content_page',
690
+ 'agca_admin_bar_new_content_user',
691
+ 'agca_admin_bar_new_content_media',
692
+ 'agca_admin_bar_update_notifications',
693
+ 'agca_admin_bar_admin_themes',
694
+ 'agca_remove_top_bar_dropdowns',
695
+ 'agca_admin_menu_turnonoff',
696
+ 'agca_admin_menu_agca_button_only',
697
+ 'agca_admin_menu_separators',
698
+ 'agca_admin_menu_icons',
699
+ 'agca_admin_menu_arrow',
700
+ 'agca_admin_menu_submenu_round',
701
+ 'agca_admin_menu_submenu_round_size',
702
+ 'agca_admin_menu_brand',
703
+ 'agca_admin_menu_brand_link',
704
+ 'agca_admin_menu_autofold',
705
+ 'agca_admin_menu_collapse_button',
706
+ 'ag_edit_adminmenu_json',
707
+ 'ag_edit_adminmenu_json_new',
708
+ 'ag_add_adminmenu_json',
709
+ 'ag_colorizer_json',
710
+ 'agca_colorizer_turnonof',
711
+ 'agca_custom_js',
712
+ 'agca_custom_css',
713
+ 'agca_colorizer_turnonoff',
714
+ 'agca_disablewarning',
715
+ 'agca_disable_postver',
716
+ 'agca_menu_remove_client_profile',
717
+ 'agca_menu_remove_customize_button',
718
+ 'agca_selected_template',
719
+ 'agca_templates',
720
+ );
721
+ }
722
+
723
+ function getTextEditor($name){
724
+ $settings = array(
725
+ 'textarea_name' => $name,
726
+ 'media_buttons' => true,
727
+ 'tinymce' => array(
728
+ 'theme_advanced_buttons1' => 'formatselect,|,bold,italic,underline,|,' .
729
+ 'bullist,blockquote,|,justifyleft,justifycenter' .
730
+ ',justifyright,justifyfull,|,link,unlink,|' .
731
+ ',spellchecker,wp_fullscreen,wp_adv'
732
+ )
733
+ );
734
+ wp_editor( get_option($name), $name, $settings );
735
+ }
736
+
737
+ function importSettings($settings){
738
+ $exploaded = explode("|^|^|", $settings);
739
+ // $str = "EEE: ";
740
+ $str = '';
741
+
742
+ $savedOptions = array();
743
+
744
+ foreach ($exploaded as $setting){
745
+
746
+ $key = current(explode(':', $setting));
747
+ $value = substr($setting, strlen($key)+1);
748
+ $cleanedValue = str_replace('|^|^|','',$value);
749
+ $savedOptions[$key] = $cleanedValue;
750
+ }
751
+
752
+ // print_r($savedOptions);
753
+
754
+ $optionNames = $this->getOptions();
755
+
756
+ foreach ($optionNames as $optionName){
757
+ $optionValue = "";
758
+ $optionValue = $savedOptions[$optionName];
759
+
760
+ if($optionName == "ag_edit_adminmenu_json" || "ag_edit_adminmenu_json_new"|| $optionName == "ag_add_adminmenu_json" ||$optionName == "ag_colorizer_json"){
761
+ $optionValue = str_replace("\\\"", "\"", $optionValue);
762
+ $optionValue = str_replace("\\\'", "\'", $optionValue);
763
+ }else if($optionName == "agca_custom_js" || $optionName == "agca_custom_css"){
764
+ //fb($optionValue);
765
+ $optionValue = htmlspecialchars_decode($optionValue);
766
+ $optionValue = str_replace("\'", '"', $optionValue);
767
+ $optionValue = str_replace('\"', "'", $optionValue);
768
+ //fb($optionValue);
769
+ }else{
770
+
771
+ }
772
+ update_option($optionName, $optionValue);
773
+ $str.="/".$optionName."/".$optionValue."\n";
774
+ }
775
+
776
+ //Migration from 1.2.6. to 1.2.5.1 - remove in later versions
777
+ //agca_script_css
778
+ //
779
+ // fb($savedOptions);
780
+ if($savedOptions['agca_script_css'] != null){
781
+ $optionValue = "";
782
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_css']);
783
+ $optionValue = str_replace('\"', "'", $optionValue);
784
+ update_option('agca_custom_css', $optionValue);
785
+ }
786
+ if($savedOptions['agca_script_js'] != null){
787
+ $optionValue = "";
788
+ $optionValue = str_replace("\'", '"', $savedOptions['agca_script_js']);
789
+ $optionValue = str_replace('\"', "'", $optionValue);
790
+ update_option('agca_custom_js', $optionValue);
791
+ }
792
+
793
+ //echo $str;
794
+
795
+ //save imported settings
796
+ $this->saveAfterImport = true;
797
+ }
798
+
799
+ function exportSettings(){
800
+ $str = "";
801
+
802
+ $include_menu_settings = false;
803
+ if(isset($_POST['export_settings_include_admin_menu'])){
804
+ if($_POST['export_settings_include_admin_menu'] == 'on'){
805
+ $include_menu_settings = true;
806
+ }
807
+ }
808
+
809
+ foreach ($_POST as $key => $value) {
810
+ if ($this->startsWith($key,'ag')||$this->startsWith($key,'color')) {
811
+ if($this->startsWith($key,'ag_edit_adminmenu')){
812
+ if($include_menu_settings) $str .=$key. ":".$value."|^|^|";
813
+ }else{
814
+ $str .=$key. ":".$value."|^|^|";
815
+ }
816
+ }
817
+ }
818
+
819
+ $filename = __('AGCA_Settings', 'ag-custom-admin').'_'.date("Y-M-d_H-i-s").'.agca';
820
+ header("Cache-Control: public");
821
+ header("Content-Description: File Transfer");
822
+ header("Content-Disposition: attachment; filename=$filename");
823
+ header("Content-Type: text/plain; ");
824
+ header("Content-Transfer-Encoding: binary");
825
+ echo $str;
826
+ die();
827
+ }
828
+
829
+ function startsWith($haystack, $needle)
830
+ {
831
+ $length = strlen($needle);
832
+ return (substr($haystack, 0, $length) === $needle);
833
+ }
834
+
835
+
836
+
837
+ function agca_create_menu() {
838
+ add_management_page('AGCA', 'AGCA', 'administrator', __FILE__, array(&$this,'agca_admin_page') );
839
+ }
840
+
841
+ function agca_create_admin_button($name,$arr) {
842
+
843
+ $href = $arr["value"];
844
+ $target =$arr["target"];
845
+ $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>";
846
+
847
+ return $button;
848
+ }
849
+ function agca_decode($code){
850
+ $code = str_replace("{","",$code);
851
+ $code = str_replace("}","",$code);
852
+ $code = str_replace("\", \"","\"|||\"",$code);
853
+ $elements = explode("|||",$code);
854
+
855
+ return $elements;
856
+ }
857
+
858
+ function jsonMenuArray($json,$type){
859
+ $arr = explode("|",$json);
860
+ $elements = "";
861
+ $array ="";
862
+ $first = true;
863
+ //print_r($json);
864
+ if($type == "colorizer"){
865
+ $elements = json_decode($arr[0],true);
866
+ if($elements !=""){
867
+ return $elements;
868
+ }
869
+ }else if($type == "buttons"){
870
+ $elements = json_decode($arr[0],true);
871
+ if($elements !=""){
872
+ foreach($elements as $k => $v){
873
+ $array.=$this->agca_create_admin_button($k,$v);
874
+ }
875
+ }
876
+ }else if($type == "buttonsJq"){
877
+ $elements = json_decode($arr[0],true);
878
+ if($elements !=""){
879
+ foreach($elements as $k => $v){
880
+ $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>';
881
+ }
882
+ }
883
+ }else{
884
+ if(isset($arr[$type])){
885
+ $elements = $this->agca_decode($arr[$type]);
886
+ }
887
+
888
+ if($elements !=""){
889
+ foreach($elements as $element){
890
+ if(!$first){
891
+ $array .=",";
892
+ }
893
+ $parts = explode(" : ",$element);
894
+ if(isset($parts[0]) && isset($parts[1])){
895
+ $array.="[".$parts[0].", ".$parts[1]."]";
896
+ }
897
+ $first=false;
898
+ }
899
+ }
900
+ }
901
+
902
+ return $array;
903
+ }
904
+
905
+ function remove_dashboard_widget($widget,$side)
906
+ {
907
+ //side can be 'normal' or 'side'
908
+ global $wp_meta_boxes;
909
+ remove_meta_box($widget, 'dashboard', $side);
910
+ }
911
+
912
+ function get_wp_version(){
913
+ global $wp_version;
914
+ $array = explode('-', $wp_version);
915
+ $version = $array[0];
916
+ return $version;
917
+ }
918
+
919
+ function print_page()
920
+ {
921
+ if($this->isGuest() && get_option('agca_admin_bar_frontend_hide') or $this->isCusminActive()){
922
+ return false;
923
+ }
924
+ if(!$this->isGuest()){
925
+ ?><style type="text/css">
926
+ <?php
927
+ echo get_option('agca_custom_css');
928
+ if(get_option('agca_menu_remove_customize_button')){
929
+ echo '#wp-admin-bar-customize{display:none;}';
930
+ }
931
+ ?>
932
+ </style><?php
933
+ }
934
+
935
+ if(get_option('agca_admin_bar_frontend_hide')==true){
936
+ add_filter( 'show_admin_bar', '__return_false' );
937
+ ?>
938
+ <style type="text/css">
939
+ #wpadminbar{
940
+ display: none;
941
+ }
942
+ </style>
943
+ <script type="text/javascript">
944
+ window.setTimeout(function(){document.getElementsByTagName('html')[0].setAttribute('style',"margin-top:0px !important");},50);
945
+ </script>
946
+ <?php
947
+ }
948
+ if(get_option('agca_admin_bar_frontend')!=true && is_user_logged_in()){
949
+
950
+ $this->context = "page";
951
+ //$wpversion = $this->get_wp_version();
952
+ ?>
953
+ <script type="text/javascript">
954
+ var agca_version = "<?php echo $this->agca_version; ?>";
955
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
956
+ var jQueryScriptOutputted = false;
957
+ var agca_context = "page";
958
+ var agca_orig_admin_menu = [];
959
+ function initJQuery() {
960
+ //if the jQuery object isn't available
961
+ if (typeof(jQuery) == 'undefined') {
962
+ if (! jQueryScriptOutputted) {
963
+ //only output the script once..
964
+ jQueryScriptOutputted = true;
965
+ //output the script (load it from google api)
966
+ document.write("<scr" + "ipt type=\"text/javascript\" src=\"//ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js\"></scr" + "ipt>");
967
+ }
968
+ setTimeout("initJQuery()", 50);
969
+ } else {
970
+ jQuery(function() {
971
+ try
972
+ {
973
+ <?php if(get_option('agca_header')!=true){ ?>
974
+ jQuery('#wpadminbar').show();
975
+ <?php } ?>
976
+
977
+ <?php $this->print_admin_bar_scripts(); ?>
978
+ }catch(ex){}
979
+ });
980
+ }
981
+ }
982
+ initJQuery();
983
+ </script>
984
+ <script type="text/javascript">
985
+ <?php echo "var agca_global_plugin_url = '".$this->pluginUrl()."';"; ?>
986
+ </script>
987
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/ag_script.js?ver=<?php echo $this->agca_version; ?>"></script>
988
+ <script type="text/javascript">
989
+ jQuery(document).ready(function(){
990
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on' && (get_option('agca_admin_bar_frontend_hide')!=true)){
991
+ foreach($this->colorizer as $k => $v){
992
+ if(($k !="") and ($v !="")){
993
+ if(
994
+ $k == "color_header" ||
995
+ $k == "color_font_header"
996
+ ){
997
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
998
+ }
999
+
1000
+ }
1001
+ }
1002
+ ?>
1003
+
1004
+ <?php
1005
+ }
1006
+ ?>
1007
+ });
1008
+ </script>
1009
+ <?php
1010
+ }
1011
+
1012
+ }
1013
+
1014
+ function print_admin_bar_scripts(){
1015
+ ?>
1016
+ <?php if(get_option('agca_remove_top_bar_dropdowns')==true){ ?>
1017
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-sub-wrapper").hide();
1018
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-site-name .ab-sub-wrapper").hide();
1019
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item").attr('title','');
1020
+
1021
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1022
+ jQuery(".new_content_header_submenu").hide();
1023
+ <?php } ?>
1024
+
1025
+ <?php } ?>
1026
+
1027
+ <?php if(get_option('agca_admin_bar_comments')!=""){ ?>
1028
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-comments").css("display","none");
1029
+ <?php } ?>
1030
+ <?php if(get_option('agca_admin_bar_new_content')!=""){ ?>
1031
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content").css("display","none");
1032
+ <?php } ?>
1033
+ <?php if(get_option('agca_admin_bar_new_content_post')!=""){ ?>
1034
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-post").css("display","none");
1035
+ <?php } ?>
1036
+ <?php if(get_option('agca_admin_bar_new_content_link')!=""){ ?>
1037
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-link").css("display","none");
1038
+ <?php } ?>
1039
+ <?php if(get_option('agca_admin_bar_new_content_page')!=""){ ?>
1040
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-page").css("display","none");
1041
+ <?php } ?>
1042
+ <?php if(get_option('agca_admin_bar_new_content_user')!=""){ ?>
1043
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-user").css("display","none");
1044
+ <?php } ?>
1045
+ <?php if(get_option('agca_admin_bar_new_content_media')!=""){ ?>
1046
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-new-content li#wp-admin-bar-new-media").css("display","none");
1047
+ <?php } ?>
1048
+ <?php if(get_option('agca_admin_bar_update_notifications')!=""){ ?>
1049
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-updates").css("display","none");
1050
+ <?php } ?>
1051
+ <?php if(get_option('agca_admin_bar_admin_themes')!=""){ ?>
1052
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-agca-admin-themes").css("display","none");
1053
+ <?php } ?>
1054
+
1055
+
1056
+
1057
+ <?php if(get_option('agca_header_logo')==true){ ?>
1058
+ jQuery("#wphead #header-logo").css("display","none");
1059
+ jQuery("ul#wp-admin-bar-root-default li#wp-admin-bar-wp-logo").css("display","none");
1060
+
1061
+ <?php } ?>
1062
+ <?php if(get_option('agca_header_logo_custom')!=""){ ?>
1063
+
1064
+ var img_url = '<?php echo addslashes(get_option('agca_header_logo_custom')); ?>';
1065
+
1066
+ advanced_url = img_url;
1067
+ image = jQuery("<img id=\"admin-top-branding-logo\" style='max-width:98%;position:relative;'/>").attr("src",advanced_url);
1068
+ jQuery(image).load(function() {
1069
+ jQuery("#wpbody-content").prepend(image);
1070
+ });
1071
+
1072
+ <?php } ?>
1073
+ <?php if(get_option('agca_wp_logo_custom')!=""){ ?>
1074
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item span.ab-icon")
1075
+ .html("<img style=\"height:32px;margin-top:0\" src=\"<?php echo get_option('agca_wp_logo_custom'); ?>\" />")
1076
+ .css('background-image','none')
1077
+ .css('width','auto');
1078
+ jQuery("li#wp-admin-bar-wp-logo > a.ab-item")
1079
+ .attr('href',"<?php echo get_bloginfo('wpurl'); ?>")
1080
+ .css('padding', 0);
1081
+ jQuery("#wpadminbar #wp-admin-bar-root-default > #wp-admin-bar-wp-logo .ab-item:before").attr('title','');
1082
+ jQuery('body #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon').attr('class','ab-icon2');
1083
+ jQuery("#wp-admin-bar-wp-logo").show();
1084
+ <?php }?>
1085
+ <?php if(get_option('agca_remove_site_link')==true){ ?>
1086
+ jQuery("#wp-admin-bar-site-name").css("display","none");
1087
+
1088
+ <?php } ?>
1089
+ <?php if(get_option('agca_wp_logo_custom_link')!=""){ ?>
1090
+ var href = "<?php echo get_option('agca_wp_logo_custom_link'); ?>";
1091
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1092
+ if(href == "%SWITCH%"){
1093
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
1094
+ <?php if($this->context == "page"){
1095
+ ?>href+="/wp-admin";<?php
1096
+ }
1097
+ ?>
1098
+ }
1099
+ jQuery("li#wp-admin-bar-wp-logo a.ab-item").attr('href',href);
1100
+
1101
+ <?php }?>
1102
+ <?php if(get_option('agca_site_heading')==true){ ?>
1103
+ jQuery("#wphead #site-heading").css("display","none");
1104
+ <?php } ?>
1105
+ <?php if(get_option('agca_custom_site_heading')!=""){ ?>
1106
+ jQuery("#wphead #site-heading").after('<h1><?php echo addslashes(get_option('agca_custom_site_heading')); ?></h1>');
1107
+ jQuery("#wp-admin-bar-site-name a:first").html('<?php echo addslashes(get_option('agca_custom_site_heading')); ?>');
1108
+
1109
+ <?php } ?>
1110
+ <?php if(get_option('agca_header')==true && $this->context =='admin'){
1111
+ ?>
1112
+ jQuery("#wpadminbar").css("display","none");
1113
+ jQuery("body.admin-bar").css("padding-top","0");
1114
+ jQuery("#wphead").css("display","none");
1115
+ jQuery('html.wp-toolbar').css("padding-top","0");
1116
+
1117
+ <?php } ?>
1118
+ <?php if((get_option('agca_header')==true)&&(get_option('agca_header_show_logout')==true)){ ?>
1119
+ <?php
1120
+ $agca_logout_text = ((get_option('agca_logout')=="")?__("Log Out", 'ag-custom-admin'):get_option('agca_logout'));
1121
+ ?>
1122
+ 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>');
1123
+
1124
+
1125
+ <?php } ?>
1126
+ <?php
1127
+ if(get_option('agca_custom_title')!=""){
1128
+ //add_filter('admin_title', '$this->change_title', 10, 2);
1129
+
1130
+ }
1131
+ ?>
1132
+ <?php if(get_option('agca_logout')!=""){ ?>
1133
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-logout a").text("<?php echo get_option('agca_logout'); ?>");
1134
+ <?php } ?>
1135
+ <?php if(get_option('agca_remove_your_profile')==true){ ?>
1136
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("visibility","hidden");
1137
+ jQuery("ul#wp-admin-bar-user-actions li#wp-admin-bar-edit-profile").css("height","10px");
1138
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary > #wp-admin-bar-my-account > a').attr('href','#');
1139
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-user-info > a').attr('href','#');
1140
+ jQuery('#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-edit-profile > a').attr('href','#');
1141
+ <?php } ?>
1142
+ <?php if(get_option('agca_logout_only')==true){ ?>
1143
+ var logout_content = jQuery("li#wp-admin-bar-logout").html();
1144
+ jQuery("ul#wp-admin-bar-top-secondary").html('<li id="wp-admin-bar-logout" style="display:block;">'+ logout_content +'</li>');
1145
+ jQuery("#wp-admin-bar-logout a").css('padding','0 8px');
1146
+
1147
+
1148
+ <?php } ?>
1149
+
1150
+ <?php
1151
+
1152
+
1153
+ }
1154
+
1155
+ function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
1156
+ if(get_option('agca_howdy')!=""){
1157
+ $user_id = get_current_user_id();
1158
+ $current_user = wp_get_current_user();
1159
+ $profile_url = get_edit_profile_url( $user_id );
1160
+
1161
+ if ( 0 != $user_id ) {
1162
+ /* Add the "My Account" menu */
1163
+ $avatar = get_avatar( $user_id, 28 );
1164
+ $howdy = sprintf( __(get_option('agca_howdy').', %1$s'), $current_user->display_name );
1165
+ $class = empty( $avatar ) ? '' : 'with-avatar';
1166
+
1167
+ $wp_admin_bar->add_menu( array(
1168
+ 'id' => 'my-account',
1169
+ 'parent' => 'top-secondary',
1170
+ 'title' => $howdy . $avatar,
1171
+ 'href' => $profile_url,
1172
+ 'meta' => array(
1173
+ 'class' => $class,
1174
+ ),
1175
+ ) );
1176
+
1177
+ }
1178
+ }
1179
+ }
1180
+
1181
+ function updateAllColors(){
1182
+
1183
+ ?>
1184
+ function updateAllColors(){
1185
+ <?php
1186
+ foreach($this->colorizer as $k => $v){
1187
+ if(($k !="") and ($v !="")){
1188
+ ?> updateTargetColor("<?php echo $k;?>","<?php echo $v;?>"); <?php
1189
+ }
1190
+ }
1191
+ ?>
1192
+ jQuery('.color_picker').each(function(){
1193
+ updateColor(jQuery(this).attr('id'),jQuery(this).val())
1194
+ });
1195
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
1196
+ jQuery('#adminmenu li.wp-menu-open').css('border','none');
1197
+ jQuery('#adminmenu li.wp-menu-open .wp-submenu').css({'border':'none','margin':'0px','border-radius':'0px'});
1198
+ }<?php
1199
+
1200
+ }
1201
+ function admin_capabilities(){
1202
+ global $wp_roles;
1203
+ $capabs = $wp_roles->roles['administrator']['capabilities'];
1204
+ $capabilitySelector = "";
1205
+
1206
+ $selectedValue = get_option('agca_admin_capability');
1207
+ if($selectedValue == ""){
1208
+ $selectedValue = "edit_dashboard";
1209
+ }
1210
+ /*echo $selectedValue;
1211
+ die;*/
1212
+ ksort($capabs);
1213
+ foreach($capabs as $k=>$v){
1214
+ $selected = "";
1215
+ if($this->startsWith($k, 'level_')) continue;
1216
+ if($selectedValue == $k){
1217
+ $selected = " selected=\"selected\" ";
1218
+ }
1219
+ $capabilitySelector .="<option value=\"$k\" $selected >".ucwords(str_replace('_', ' ', $k))."</option>\n";
1220
+ }
1221
+
1222
+ $this->admin_capabilities = "<select class=\"agca-selectbox\" id=\"agca_admin_capability\" name=\"agca_admin_capability\" val=\"upload_files\">".$capabilitySelector."</select>";
1223
+ }
1224
+
1225
+ function admin_capability(){
1226
+ $selectedValue = get_option('agca_admin_capability');
1227
+ if($selectedValue == ""){
1228
+ $selectedValue = "edit_dashboard";
1229
+ }
1230
+ return $selectedValue;
1231
+ }
1232
+
1233
+ function JSPrintAGCATemplateSettingsVar($settings){
1234
+ echo "\n<script type=\"text/javascript\">\n";
1235
+ echo "var agca_template_settings = ".preg_replace('#<script(.*?)>(.*?)</script>#is', '', $settings).";\n"; //TODO: think about this
1236
+ echo "</script>";
1237
+ }
1238
+
1239
+ function appendSettingsToAGCATemplateCustomizations($customizations, $settings){
1240
+ $template_settings = json_decode($settings);
1241
+ //print_r($template_settings);
1242
+ foreach($template_settings as $sett){
1243
+ $key = $sett->code;
1244
+
1245
+ //use default value if user's value is not set
1246
+ $value="";
1247
+ if($sett->value != ""){
1248
+ $value = $sett->value;
1249
+ }else{
1250
+ $value = $sett->default_value;
1251
+ }
1252
+
1253
+ //Prepare settings
1254
+ if($sett->type == 6){
1255
+ if($value !== null && (strtolower($value) == "on" || $value == "1")){
1256
+ $value = "true";
1257
+ }else{
1258
+ $value = "false";
1259
+ }
1260
+ }
1261
+ $customizations = str_replace("%".$key."%",$value, $customizations);
1262
+ }
1263
+ return $customizations;
1264
+ }
1265
+
1266
+ function enableSpecificWPVersionCustomizations($customizations){
1267
+ /*enable special CSS for this WP version*/
1268
+ $ver = $this->get_wp_version();
1269
+ $customizations = str_replace("/*".$ver," ", $customizations);
1270
+ $customizations = str_replace($ver."*/"," ", $customizations);
1271
+ return $customizations;
1272
+ }
1273
+
1274
+ function removeCSSComments($customizations){
1275
+ $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
1276
+ return $customizations;
1277
+ }
1278
+
1279
+ function prepareAGCAAdminTemplates(){
1280
+ if(get_option( 'agca_templates' ) != ""){
1281
+ //print_r(get_option( 'agca_templates' ));
1282
+ $themes = get_option( 'agca_templates' );
1283
+ $selectedTheme = get_option('agca_selected_template');
1284
+ if(isset($themes[$selectedTheme])){
1285
+ $theme = $themes[$selectedTheme];
1286
+ add_filter('get_user_option_admin_color', array(&$this,'change_admin_color'));
1287
+
1288
+ echo (stripslashes($theme['common']));
1289
+ echo "<!--AGCAIMAGES: ".$theme['images']."-->";
1290
+
1291
+ //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1292
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($this->admin_capability())))){
1293
+ if($theme['settings'] == "" || $theme['settings'] == " ") $theme['settings'] = "{}";
1294
+ //print_r($templdata);
1295
+
1296
+ $this->JSPrintAGCATemplateSettingsVar($theme['settings']);
1297
+
1298
+ $admindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($theme['admin']), $theme['settings']);
1299
+ $admindata = $this->enableSpecificWPVersionCustomizations($admindata);
1300
+ $admindata = $this->removeCSSComments($admindata);
1301
+
1302
+ //echo $admindata;
1303
+ //REPLACE TAGS WITH CUSTOM TEMPLATE SETTINGS
1304
+ $this->templateCustomizations = $admindata;
1305
+ }
1306
+ //KEEP THIS FOR MIGRATION PURPOSE FOR SOME TIME
1307
+ }
1308
+ }
1309
+ }
1310
+
1311
+ function agcaAdminSession(){
1312
+ $agcaTemplatesSession = array();
1313
+
1314
+ //session_destroy();
1315
+ //session_unset();
1316
+
1317
+ /*if(!session_id()){
1318
+ session_start();
1319
+ }*/
1320
+
1321
+ if(!isset($_SESSION["AGCA"])){
1322
+ $_SESSION["AGCA"] = array();
1323
+ $_SESSION["AGCA"]["Templates"] = array();
1324
+ }
1325
+ //print_r($_SESSION);
1326
+
1327
+ if(isset($_SESSION["AGCA"])){
1328
+ if(isset($_SESSION["AGCA"]["Templates"])){
1329
+ //print_r($_SESSION["AGCA"]["Templates"]);
1330
+ $agcaTemplatesSession = json_encode($_SESSION["AGCA"]["Templates"]);
1331
+ }
1332
+ }
1333
+
1334
+
1335
+ if($agcaTemplatesSession == '""' || $agcaTemplatesSession == '"[]"'){
1336
+ $agcaTemplatesSession = array();
1337
+ }
1338
+
1339
+
1340
+ return $agcaTemplatesSession;
1341
+
1342
+ }
1343
+
1344
+ function getAGCAColor($name){
1345
+ if(isset($this->colorizer[$name])){
1346
+ echo htmlspecialchars($this->colorizer[$name]);
1347
+ }
1348
+ }
1349
+
1350
+ function prepareAGCALoginTemplates(){
1351
+ if(get_option( 'agca_templates' ) != ""){
1352
+ //print_r(get_option( 'agca_templates' ));
1353
+ $templates = get_option( 'agca_templates' );
1354
+ foreach($templates as $templname=>$templdata){
1355
+ if($templname == get_option('agca_selected_template')){
1356
+ echo (stripslashes($templdata['common']));
1357
+
1358
+ if($templdata['settings'] == "" || $templdata['settings'] == " ") $templdata['settings'] = "{}";
1359
+ $this->JSPrintAGCATemplateSettingsVar($templdata['settings']);
1360
+
1361
+ $logindata = $this->appendSettingsToAGCATemplateCustomizations(stripslashes($templdata['login']), $templdata['settings']);
1362
+ $logindata = $this->enableSpecificWPVersionCustomizations($logindata);
1363
+ $logindata = $this->removeCSSComments($logindata);
1364
+
1365
+ echo($logindata);
1366
+ break;
1367
+ }
1368
+ }
1369
+ }
1370
+ }
1371
+
1372
+ function agca_error_check(){
1373
+ ?>
1374
+ <script type="text/javascript">
1375
+ function AGCAErrorPage(msg, url, line){
1376
+ var agca_error_details = "___________________________________________________<br/>";
1377
+ agca_error_details += '<br/>' + msg +'<br/>source:' + url + '<br/>line:' + line + '<br/>';
1378
+ agca_error_details += "___________________________________________________<br/>";
1379
+ 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>';
1380
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1381
+ 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;">\
1382
+ <?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>';
1383
+
1384
+ var ph = document.getElementById('agca_error_placeholder');
1385
+ ph.innerHTML = errorDivHtml;
1386
+ document.getElementById('agca_news').style.visibility = "hidden";
1387
+ }
1388
+ window.onerror = function(msg, url, line) {
1389
+ window.onload = function() {
1390
+ AGCAErrorPage(msg, url, line);
1391
+ }
1392
+ return true;
1393
+ };
1394
+ </script>
1395
+ <?php
1396
+ }
1397
+ function error_check(){
1398
+ ?>
1399
+ <script type="text/javascript">
1400
+ function AGCAErrorOtherPages(msg, url, line){
1401
+ var agca_error_details = "___________________________________________________\n";
1402
+ agca_error_details += '\n' + msg +'\nsource:' + url + '\nline:' + line + '\n';
1403
+
1404
+ document.getElementsByTagName('html')[0].style.visibility = "visible";
1405
+
1406
+ if(typeof window.console === "object"){
1407
+ console.log("___________________________________________________");
1408
+ console.log("<?php _e('AGCA plugin caught a JavaScript on your site', 'ag-custom-admin'); ?>:");
1409
+ console.log(agca_error_details);
1410
+ }
1411
+ }
1412
+ window.onerror = function(msg, url, line) {
1413
+ window.onload = function() {
1414
+ AGCAErrorOtherPages(msg, url, line);
1415
+ }
1416
+ return true;
1417
+ };
1418
+ </script>
1419
+ <?php
1420
+ }
1421
+
1422
+ function menu_item_cleartext($name){
1423
+ if(strpos($name,' <span') !== false){
1424
+ $parts = explode(' <span', $name);
1425
+ $name = $parts[0];
1426
+ }
1427
+ $name = trim($name);
1428
+ return $name;
1429
+ }
1430
+
1431
+ /**
1432
+ * Loops through all original menu items, and creates customizations array
1433
+ * applies previous customizations if set
1434
+ * @return array|mixed|object
1435
+ */
1436
+ function get_menu_customizations(){
1437
+ global $menu;
1438
+ global $submenu;
1439
+
1440
+ //var_dump($menu); die;
1441
+ $previousCustomizations = json_decode(get_option('ag_edit_adminmenu_json_new'), true);
1442
+
1443
+ $customizationsSet = true;
1444
+ if($previousCustomizations == null){
1445
+ $customizationsSet = false;
1446
+ }
1447
+
1448
+ //set default menu configuration
1449
+ //and apply previously saved customizations
1450
+ $m = array();
1451
+ foreach($menu as $top){
1452
+ $name = $top[0];
1453
+ $url = $top[2];
1454
+ $cls = isset($top[5])?$top[5]:"";
1455
+ $remove = false;
1456
+ if($name == '') continue;
1457
+ $pc = null;
1458
+ $name = $this->menu_item_cleartext($name);
1459
+
1460
+ //apply previous submenu customizations
1461
+ if($customizationsSet && isset($previousCustomizations[$url])){
1462
+ $pc = $previousCustomizations[$url];
1463
+ }
1464
+
1465
+ //get submenu
1466
+ $s = array();
1467
+ if(isset($submenu[$url])){
1468
+ $sitems = $submenu[$url];
1469
+ foreach($sitems as $key=>$sub){
1470
+ $nameSub = $sub[0];
1471
+ $urlSub = $sub[2];
1472
+ $removeSub = false;
1473
+ $nameSub = $this->menu_item_cleartext($nameSub);
1474
+ $s[$key]=array(
1475
+ 'name'=>$nameSub,
1476
+ 'new'=>'',
1477
+ 'remove'=>$removeSub,
1478
+ 'url'=>$urlSub
1479
+ );
1480
+
1481
+ if(isset($pc['submenus'][$key])){
1482
+ $s[$key]['new'] = $pc['submenus'][$key]['new'];
1483
+ $s[$key]['remove'] = $pc['submenus'][$key]['remove'];
1484
+
1485
+ if($s[$key]['new'] == null){
1486
+ $s[$key]['new'] = '';
1487
+ }
1488
+ if($s[$key]['remove'] == null){
1489
+ $s[$key]['remove'] = false;
1490
+ }
1491
+ }
1492
+ }
1493
+ }
1494
+
1495
+ $m[$url]=array(
1496
+ 'name'=>$name,
1497
+ 'remove'=>$remove,
1498
+ 'new'=>'',
1499
+ 'url'=>$url,
1500
+ 'cls'=>$cls,
1501
+ 'submenus'=>$s
1502
+ );
1503
+
1504
+ //apply previous top menu customizations
1505
+ if($customizationsSet && isset($previousCustomizations[$url])){
1506
+ $pc = $previousCustomizations[$url];
1507
+ if(isset($pc)){
1508
+ $m[$url]['remove'] = $pc['remove'];
1509
+ $m[$url]['new'] = $pc['new'];
1510
+ }
1511
+ }
1512
+ }
1513
+ return $m;
1514
+ }
1515
+
1516
+ /**
1517
+ * Applies customizations to admin menu
1518
+ */
1519
+ function customized_menu(){
1520
+ $customizations = $this->get_menu_customizations();
1521
+ global $menu;
1522
+ global $submenu;
1523
+
1524
+ //print_r($submenu);die;
1525
+ //apply customizations to original admin menu
1526
+ foreach($menu as $key=>$top){
1527
+ $url = $top[2];
1528
+ if(isset($customizations[$url])){
1529
+ $topCustomized = $customizations[$url];
1530
+ if($topCustomized['new']) {
1531
+ $menu[$key][0] = $topCustomized['new'];
1532
+ }
1533
+ if($topCustomized['remove']){
1534
+ unset($menu[$key]);
1535
+ }
1536
+ }
1537
+ }
1538
+ foreach($submenu as $topkey=>$subs){
1539
+ foreach($subs as $subkey=>$sub){
1540
+ if(isset($customizations[$topkey]['submenus'][$subkey])){
1541
+ $cs = $customizations[$topkey]['submenus'][$subkey];
1542
+ if($cs['new']) {
1543
+ $submenu[$topkey][$subkey][0] = preg_replace("/".$cs['name']."/",$cs['new'], $submenu[$topkey][$subkey][0],1);
1544
+ }
1545
+ if($cs['remove']){
1546
+ unset($submenu[$topkey][$subkey]);
1547
+ }
1548
+ }
1549
+ }
1550
+ }
1551
+ }
1552
+
1553
+ /**
1554
+ * Used only for removing admin menu customizations to AGCA 1.5 version or later
1555
+ * @param $checkboxes
1556
+ * @param $textboxes
1557
+ */
1558
+ function migrate_menu_customizations($checkboxes, $textboxes){
1559
+ $customizations = $this->get_menu_customizations();
1560
+ global $menu;
1561
+ /*print_r($menu);
1562
+ print_r($customizations);
1563
+ print_r($textboxes);*/
1564
+
1565
+ $oldTopValue = "";
1566
+
1567
+
1568
+ //Migrate checkboxes
1569
+ foreach($checkboxes as $key=>$value){
1570
+ $isTop = false;
1571
+ $oldSubValue = "";
1572
+ if (strpos($key,'<-TOP->') !== false) {
1573
+ $oldTopValue = str_replace('<-TOP->','',$key);
1574
+ $isTop = true;
1575
+ }else{
1576
+ $oldSubValue = $key;
1577
+ }
1578
+ if($value == 'checked'){
1579
+ $topIndex = "";
1580
+ foreach($customizations as $k=>$c){
1581
+ if($c['cls'] == $oldTopValue){
1582
+ $topIndex = $k;
1583
+ break;
1584
+ }
1585
+ }
1586
+ if($topIndex == "") continue;
1587
+ if($isTop){
1588
+ $customizations[$topIndex]['remove'] = true;
1589
+ }else{
1590
+ if(is_array($customizations[$topIndex]['submenus'])){
1591
+ foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1592
+ if($sval['name'] == $oldSubValue){
1593
+ $customizations[$topIndex]['submenus'][$skey]['remove'] = true;
1594
+ }
1595
+ }
1596
+ }
1597
+ }
1598
+ }
1599
+ }
1600
+
1601
+ //Migrate textboxes
1602
+ foreach($textboxes as $key=>$value){
1603
+ $isTop = false;
1604
+ $oldSubValue = "";
1605
+ if (strpos($key,'<-TOP->') !== false) {
1606
+ $oldTopValue = str_replace('<-TOP->','',$key);
1607
+ $isTop = true;
1608
+ }else{
1609
+ $oldSubValue = $key;
1610
+ }
1611
+ if($value != ''){
1612
+ $topIndex = "";
1613
+ foreach($customizations as $k=>$c){
1614
+ if($c['cls'] == $oldTopValue){
1615
+ $topIndex = $k;
1616
+ break;
1617
+ }
1618
+ }
1619
+ if($topIndex == "") continue;
1620
+ if($isTop){
1621
+ $customizations[$topIndex]['new'] = $value;
1622
+ }else{
1623
+ if(is_array($customizations[$topIndex]['submenus'])){
1624
+ foreach($customizations[$topIndex]['submenus'] as $skey=>$sval){
1625
+ if($sval['name'] == $oldSubValue){
1626
+ if($customizations[$topIndex]['submenus'][$skey]['name'] != $value){
1627
+ $customizations[$topIndex]['submenus'][$skey]['new'] = $value;
1628
+ }
1629
+ }
1630
+ }
1631
+ }
1632
+ }
1633
+ }
1634
+ }
1635
+ update_option('ag_edit_adminmenu_json','');//remove previous admin menu configuration
1636
+ update_option('ag_edit_adminmenu_json_new',json_encode($customizations));
1637
+ }
1638
+ function isCusminActive(){
1639
+ return $this->isPluginActive('cusmin/cusmin.php');
1640
+ }
1641
+ function isPluginActive($plugin){
1642
+ if(!is_admin()){
1643
+ return false;
1644
+ }
1645
+ return is_plugin_active($plugin);
1646
+ }
1647
+ function isPluginActiveForNetwork($plugin){
1648
+ return is_plugin_active_for_network($plugin);
1649
+ }
1650
+ function print_admin_css()
1651
+ {
1652
+ $agcaTemplateSession = $this->agcaAdminSession();
1653
+ $wpversion = $this->get_wp_version();
1654
+ $this->context = "admin";
1655
+ $this->error_check();
1656
+ $currentScreen = get_current_screen();
1657
+ ?>
1658
+ <script type="text/javascript">
1659
+ var wpversion = "<?php echo $wpversion; ?>";
1660
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
1661
+ var agca_version = "<?php echo $this->agca_version; ?>";
1662
+ var agcaTemplatesSession = <?php echo ($agcaTemplateSession==null)?"[]":$agcaTemplateSession; ?>;
1663
+ var errors = false;
1664
+ var isSettingsImport = false;
1665
+ var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
1666
+ var agca_context = "admin";
1667
+ var roundedSidberSize = 0;
1668
+ var agca_installed_templates = <?php echo $this->get_installed_agca_templates(); ?>;
1669
+ var agca_admin_menu = <?php echo json_encode($this->get_menu_customizations()) ?>;
1670
+ var agca_string = {
1671
+ file_imp_not_sel: '<?php _e('File for import is not selected!', 'ag-custom-admin'); ?>',
1672
+ menu_general: '<?php _e('General', 'ag-custom-admin'); ?>',
1673
+ menu_admin_bar: '<?php _e('Admin Bar', 'ag-custom-admin'); ?>',
1674
+ menu_footer: '<?php _e('Footer', 'ag-custom-admin'); ?>',
1675
+ menu_dashb: '<?php _e('Dashboard', 'ag-custom-admin'); ?>',
1676
+ menu_login: '<?php _e('Login Page', 'ag-custom-admin'); ?>',
1677
+ menu_admin_menu: '<?php _e('Admin Menu', 'ag-custom-admin'); ?>',
1678
+ menu_colorizer: '<?php _e('Colorizer', 'ag-custom-admin'); ?>',
1679
+ menu_themes: '<?php _e('Themes', 'ag-custom-admin'); ?>',
1680
+ menu_upgrade: '<?php _e('Upgrade', 'ag-custom-admin'); ?>',
1681
+ menu_advanced: '<?php _e('Advanced', 'ag-custom-admin'); ?>',
1682
+ remove: '<?php _e('Remove', 'ag-custom-admin'); ?>',
1683
+ frommenu:'<?php _e('from menu', 'ag-custom-admin'); ?>',
1684
+ rename:'<?php _e('Rename', 'ag-custom-admin'); ?>',
1685
+ withthisvalue:'<?php _e('with this value', 'ag-custom-admin'); ?>',
1686
+ submenuitem:'<?php _e('sub-menu item', 'ag-custom-admin'); ?>',
1687
+ open:'<?php _e('open', 'ag-custom-admin'); ?>',
1688
+ 'delete':'<?php _e('Delete', 'ag-custom-admin'); ?>',
1689
+ 'in':'<?php _e('in', 'ag-custom-admin'); ?>',
1690
+ save_changes: '<?php _e('Save changes', 'ag-custom-admin'); ?>'
1691
+ };
1692
+ </script>
1693
+ <?php
1694
+ $this->prepareAGCAAdminTemplates();
1695
+ $this->agca_get_includes();
1696
+ $this->admin_capabilities();
1697
+ wp_get_current_user() ;
1698
+ ?>
1699
+ <?php
1700
+ //in case that javaScript is disabled only admin can access admin menu
1701
+ if(!current_user_can($this->admin_capability())){
1702
+ ?>
1703
+ <style type="text/css">
1704
+ #adminmenu{display:none;}
1705
+ </style>
1706
+ <?php
1707
+ }
1708
+ ?>
1709
+ <script type="text/javascript">
1710
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
1711
+ <?php
1712
+ if(isset($_POST['_agca_import_settings']) && $_POST['_agca_import_settings']=='true'){
1713
+ echo 'isSettingsImport = true;';
1714
+ }
1715
+ ?>
1716
+ </script>
1717
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1718
+ <style type="text/css">
1719
+ .wp-has-current-submenu:after{border:none !important;}
1720
+ #adminmenu li.wp-has-submenu.wp-not-current-submenu.opensub:hover:after{border:none !important;}
1721
+ </style>
1722
+ <?php }
1723
+
1724
+ if($currentScreen->id == 'tools_page_ag-custom-admin/plugin'){
1725
+ ?>
1726
+ <div id="fb-root"></div>
1727
+ <script>(function(d, s, id) {
1728
+ var js, fjs = d.getElementsByTagName(s)[0];
1729
+ if (d.getElementById(id)) return;
1730
+ js = d.createElement(s); js.id = id;
1731
+ js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5&appId=765552763482314";
1732
+ fjs.parentNode.insertBefore(js, fjs);
1733
+ }(document, 'script', 'facebook-jssdk'));</script>
1734
+ <?php
1735
+ }
1736
+
1737
+ if(get_option('agca_menu_remove_client_profile')){
1738
+ remove_menu_page('profile.php');
1739
+ }
1740
+ ?>
1741
+ <script type="text/javascript">
1742
+ /* <![CDATA[ */
1743
+ jQuery(document).ready(function() {
1744
+ try
1745
+ {
1746
+
1747
+ <?php /*CHECK OTHER PLUGINS*/
1748
+ if($this->isPluginActive('ozh-admin-drop-down-menu/wp_ozh_adminmenu.php')){
1749
+ ?>
1750
+ jQuery('ul#adminmenu').css('display','none');
1751
+ jQuery('#footer-ozh-oam').css('display','none');
1752
+ jQuery('#ag_main_menu li').each(function(){
1753
+ if(jQuery(this).text() == "Admin Menu"){
1754
+ jQuery(this).hide();
1755
+ }
1756
+ });
1757
+ <?php
1758
+ }
1759
+ ?>
1760
+
1761
+
1762
+ //get saved onfigurations
1763
+
1764
+ <?php $buttons = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttons'); ?>
1765
+ var buttons = '<?php echo $buttons; ?>';
1766
+
1767
+ <?php $buttonsJq = $this->jsonMenuArray(get_option('ag_add_adminmenu_json'),'buttonsJq'); ?>
1768
+ var buttonsJq = '<?php echo $buttonsJq; ?>';
1769
+
1770
+ createEditMenuPageNew(agca_admin_menu);
1771
+ //createEditMenuPageV32(checkboxes, textboxes);
1772
+
1773
+ <?php
1774
+ //if admin, and option to hide settings for admin is set
1775
+ if((get_option('agca_role_allbutadmin')==true) and current_user_can($this->admin_capability()) or $this->isCusminActive()){
1776
+ ?>
1777
+ <?php } else{ ?>
1778
+ <?php if(get_option('agca_admin_menu_brand')!=""){ ?>
1779
+ additionalStyles = ' style="margin-bottom:-4px" ';
1780
+ jQuery("#adminmenu").before('<div '+additionalStyles+' id="sidebar_adminmenu_logo"><img width="160" src="<?php echo get_option('agca_admin_menu_brand'); ?>" /></div>');
1781
+ <?php } ?>
1782
+ <?php if(get_option('agca_admin_menu_brand_link')!=""){ ?>
1783
+
1784
+ var href = "<?php echo get_option('agca_admin_menu_brand_link'); ?>";
1785
+ href = href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
1786
+
1787
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1788
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1789
+
1790
+ <?php }else{ ?>
1791
+ href = "<?php echo get_bloginfo('wpurl'); ?>";
1792
+ jQuery("#sidebar_adminmenu_logo").attr('onclick','window.open(\"'+ href+ '\");');
1793
+ jQuery("#sidebar_adminmenu_logo").attr('title',href);
1794
+ <?php } ?>
1795
+
1796
+ <?php if(get_option('agca_admin_menu_submenu_round')==true){ ?>
1797
+ jQuery("#adminmenu .wp-submenu").css("border-radius","<?php echo get_option('agca_admin_menu_submenu_round_size'); ?>px");
1798
+ jQuery("#adminmenu .wp-menu-open .wp-submenu").css('border-radius','');
1799
+ <?php $roundedSidebarSize = get_option('agca_admin_menu_submenu_round_size'); ?>
1800
+ roundedSidberSize = <?php echo ($roundedSidebarSize == "")?"0":$roundedSidebarSize; ?>;
1801
+
1802
+
1803
+ <?php } ?>
1804
+ <?php if(get_option('agca_admin_menu_autofold')=="force"){ ?>
1805
+ jQuery("body").addClass("auto-fold");
1806
+ <?php } else if(get_option('agca_admin_menu_autofold')=="disable"){ ?>
1807
+ jQuery("body").removeClass("auto-fold");
1808
+ <?php } ?>
1809
+
1810
+ <?php $this->print_admin_bar_scripts(); ?>
1811
+
1812
+ <?php if(get_option('agca_screen_options_menu')==true){ ?>
1813
+ jQuery("#screen-options-link-wrap").css("display","none");
1814
+ <?php } ?>
1815
+ <?php if(get_option('agca_help_menu')==true){ ?>
1816
+ jQuery("#contextual-help-link-wrap").css("display","none");
1817
+ jQuery("#contextual-help-link").css("display","none");
1818
+ <?php } ?>
1819
+ <?php if(get_option('agca_privacy_options')==true){ ?>
1820
+ jQuery("#privacy-on-link").css("display","none");
1821
+ <?php } ?>
1822
+
1823
+ <?php if(get_option('agca_update_bar')==true){ ?>
1824
+ <?php
1825
+ if ( ! function_exists( 'c2c_no_update_nag' ) ) :
1826
+ function c2c_no_update_nag() {
1827
+ remove_action( 'admin_notices', 'update_nag', 3 );
1828
+ }
1829
+ endif;
1830
+ add_action( 'admin_init', 'c2c_no_update_nag' );
1831
+ ?>
1832
+ jQuery("#update-nag").css("display","none");
1833
+ jQuery(".update-nag").css("display","none");
1834
+ <?php } ?>
1835
+
1836
+ <?php if(get_option('agca_footer')==true){ ?>
1837
+ jQuery("#footer,#wpfooter").css("display","none");
1838
+ <?php } ?>
1839
+
1840
+ <?php if(get_option('agca_footer_left')!=""){ ?>
1841
+ jQuery("#footer-left").html('<?php echo addslashes(get_option('agca_footer_left')); ?>');
1842
+ <?php } ?>
1843
+ <?php if(get_option('agca_footer_left_hide')==true){ ?>
1844
+ jQuery("#footer-left").css("display","none");
1845
+ <?php } ?>
1846
+ <?php if(get_option('agca_footer_right')!=""){ ?>
1847
+ jQuery("#footer-upgrade").html('<?php echo addslashes(get_option('agca_footer_right')); ?>');
1848
+ <?php } ?>
1849
+ <?php if(get_option('agca_footer_right_hide')==true){ ?>
1850
+ jQuery("#footer-upgrade").css("display","none");
1851
+ <?php } ?>
1852
+
1853
+ <?php if(get_option('agca_language_bar')==true){ ?>
1854
+ jQuery("#user_info p").append('<?php include("language_bar/language_bar.php"); ?>');
1855
+ <?php } ?>
1856
+ <?php if(get_option('agca_dashboard_icon')==true){ ?>
1857
+ var className = jQuery("#icon-index").attr("class");
1858
+ if(className=='icon32'){
1859
+ jQuery("#icon-index").attr("id","icon-index-removed");
1860
+ }
1861
+ <?php } ?>
1862
+ <?php if(get_option('agca_dashboard_text')!=""){ ?>
1863
+ jQuery("#dashboard-widgets-wrap").parent().find("h1").html("<?php echo addslashes(get_option('agca_dashboard_text')); ?>");
1864
+ <?php } ?>
1865
+ <?php if(get_option('agca_dashboard_text_paragraph')!=""){
1866
+ require_once($this->filePath('wp-includes/formatting.php'));
1867
+ ?>
1868
+ jQuery("#wpbody-content #dashboard-widgets-wrap").before('<div id="agca_custom_dashboard_content"></div>');
1869
+
1870
+ 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'))))); ?>');
1871
+ <?php } ?>
1872
+
1873
+ <?php /*Remove Dashboard widgets*/ ?>
1874
+ <?php
1875
+
1876
+ if(get_option('agca_dashboard_widget_welcome')==true){
1877
+ ?>jQuery("#welcome-panel").css("display","none");<?php
1878
+ }else{
1879
+ ?>jQuery("#welcome-panel").css("display","block");<?php
1880
+ }
1881
+ if(get_option('agca_dashboard_widget_il')==true){
1882
+ $this->remove_dashboard_widget('dashboard_incoming_links','normal');
1883
+ }else{
1884
+ ?>jQuery("#dashboard_incoming_links").css("display","block");<?php
1885
+ }
1886
+ if(get_option('agca_dashboard_widget_plugins')==true){
1887
+ $this->remove_dashboard_widget('dashboard_plugins','normal');
1888
+ }else{
1889
+ ?>jQuery("#dashboard_plugins").css("display","block");<?php
1890
+ }
1891
+ if(get_option('agca_dashboard_widget_qp')==true){
1892
+ $this->remove_dashboard_widget('dashboard_quick_press','side');
1893
+ }else{
1894
+ ?>jQuery("#dashboard_quick_press").css("display","block");<?php
1895
+ }
1896
+ if(get_option('agca_dashboard_widget_rn')==true){
1897
+ $this->remove_dashboard_widget('dashboard_right_now','normal');
1898
+ }else{
1899
+ ?>jQuery("#dashboard_right_now").css("display","block");<?php
1900
+ }
1901
+ if(get_option('agca_dashboard_widget_rd')==true){
1902
+ $this->remove_dashboard_widget('dashboard_recent_drafts','side');
1903
+ }else{
1904
+ ?>jQuery("#dashboard_recent_drafts").css("display","block");<?php
1905
+ }
1906
+ if(get_option('agca_dashboard_widget_primary')==true){
1907
+ $this->remove_dashboard_widget('dashboard_primary','side');
1908
+ }else{
1909
+ ?>jQuery("#dashboard_primary").css("display","block");<?php
1910
+ }
1911
+ if(get_option('agca_dashboard_widget_secondary')==true){
1912
+ $this->remove_dashboard_widget('dashboard_secondary','side');
1913
+ }else{
1914
+ ?>jQuery("#dashboard_secondary").css("display","block");<?php
1915
+ }
1916
+ if(get_option('agca_dashboard_widget_activity')==true){
1917
+ remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');
1918
+ }else{
1919
+ ?>jQuery("#dashboard_activity").css("display","block");<?php
1920
+ }
1921
+
1922
+ ?>
1923
+
1924
+ <?php /*ADMIN MENU*/ ?>
1925
+
1926
+ <?php if(get_option('agca_admin_menu_separators')==true){ ?>
1927
+ jQuery("#adminmenu li.wp-menu-separator").css({height: 0, margin: 0});
1928
+ <?php } ?>
1929
+ <?php if(get_option('agca_admin_menu_icons') == true){ ?>
1930
+ jQuery(".wp-menu-image").each(function(){
1931
+ jQuery(this).css("display","none");
1932
+ });
1933
+ jQuery('#adminmenu div.wp-menu-name').css('padding','8px');
1934
+ <?php } ?>
1935
+ <?php if(get_option('agca_admin_menu_arrow') == true){ ?>
1936
+ jQuery("#adminmenu .wp-menu-arrow").css("visibility","hidden");
1937
+
1938
+ <?php } ?>
1939
+ <?php if(get_option('agca_admin_menu_turnonoff') == 'on'){ ?>
1940
+
1941
+ <?php /*If Turned on*/ ?>
1942
+
1943
+ <?php if(get_option('agca_admin_menu_agca_button_only') == true){ ?>
1944
+ jQuery('#adminmenu > li').each(function(){
1945
+ if(!jQuery(this).hasClass('agca_button_only')){
1946
+ jQuery(this).addClass('noclass');
1947
+ }
1948
+ });
1949
+ <?php /*Only admin see button*/
1950
+ if (current_user_can($this->admin_capability())){ ?>
1951
+ 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')); ?>');
1952
+ <?php } ?>
1953
+ <?php } ?>
1954
+
1955
+
1956
+ <?php /*EDIT MENU ITEMS*/?>
1957
+ <?php if(get_option('ag_edit_adminmenu_json')!=""){
1958
+
1959
+ $arr = explode("|",get_option('ag_edit_adminmenu_json'));
1960
+
1961
+ $checkboxes = json_decode($arr[0]);
1962
+ $textboxes = json_decode($arr[1]);
1963
+
1964
+ $this->migrate_menu_customizations($checkboxes, $textboxes);
1965
+
1966
+ } ?>
1967
+
1968
+ <?php if(get_option('ag_edit_adminmenu_json_new')!=""){
1969
+ $this->customized_menu();
1970
+ } ?>
1971
+
1972
+
1973
+
1974
+
1975
+ /*Add user buttons*/
1976
+ jQuery('#adminmenu').append(buttons);
1977
+
1978
+ <?php /*END If Turned on*/ ?>
1979
+ <?php } else{ ?>
1980
+ jQuery("#adminmenu").removeClass("noclass");
1981
+ <?php } ?>
1982
+
1983
+ reloadRemoveButtonEvents();
1984
+
1985
+ <?php if(get_option('agca_admin_menu_collapse_button') == true){ ?>
1986
+ //remove collapse menu button
1987
+ jQuery('#collapse-menu').remove();
1988
+ <?php } ?>
1989
+
1990
+ <?php //COLORIZER ?>
1991
+ updateAllColors();
1992
+ <?php //COLORIZER END ?>
1993
+ <?php } //end of apply for any user except admin ?>
1994
+ /*Add user buttons*/
1995
+ jQuery('#ag_add_adminmenu').append(buttonsJq);
1996
+
1997
+
1998
+ }catch(err){
1999
+ errors = "AGCA - ADMIN ERROR: " + err.name + " / " + err.message;
2000
+ console.log(errors);
2001
+ }finally{
2002
+ jQuery('html').css('visibility','visible');
2003
+ }
2004
+ <?php
2005
+ if($this->saveAfterImport == true){
2006
+ ?>savePluginSettings();<?php
2007
+ }
2008
+ ?>
2009
+
2010
+ });
2011
+
2012
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){
2013
+ $this->updateAllColors();
2014
+ }else{
2015
+ ?>function updateAllColors(){}; <?php
2016
+ } ?>
2017
+
2018
+
2019
+ /* ]]> */
2020
+ </script>
2021
+ <style type="text/css">
2022
+ .underline_text{
2023
+ text-decoration:underline;
2024
+ }
2025
+ .form-table th{
2026
+ width:300px;
2027
+ }
2028
+
2029
+ #dashboard-widgets div.empty-container{
2030
+ border:none;
2031
+ }
2032
+ </style>
2033
+ <?php
2034
+ }
2035
+
2036
+ function print_login_head(){
2037
+ if($this->isCusminActive()){
2038
+ return false;
2039
+ }
2040
+
2041
+ $this->context = "login";
2042
+ $this->error_check();
2043
+ //$wpversion = $this->get_wp_version();
2044
+
2045
+ ?>
2046
+ <script type="text/javascript">
2047
+ document.write('<style type="text/css">html{visibility:hidden;}</style>');
2048
+ var agca_version = "<?php echo $this->agca_version; ?>";
2049
+ <?php //var wpversion = "echo $wpversion; ?>
2050
+ var agca_debug = <?php echo ($this->agca_debug)?"true":"false"; ?>;
2051
+ var isCusminActive = <?php echo $this->isCusminActive()?'true':'false'; ?>;
2052
+ var isSettingsImport = false;
2053
+ var agca_context = "login";
2054
+ </script>
2055
+ <?php
2056
+ $this->prepareAGCALoginTemplates();
2057
+ $this->agca_get_includes();
2058
+
2059
+ ?>
2060
+
2061
+ <script type="text/javascript">
2062
+
2063
+
2064
+ /* <![CDATA[ */
2065
+ jQuery(document).ready(function() {
2066
+ try{
2067
+ <?php if(get_option('agca_login_round_box')==true){ ?>
2068
+ jQuery("form#loginform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2069
+ <?php if(!get_option('agca_login_round_box_skip_logo')){ ?>
2070
+ jQuery("#login h1 a").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2071
+ jQuery("#login h1 a").css("margin-bottom",'10px');
2072
+ jQuery("#login h1 a").css("padding-bottom",'0');
2073
+ <?php } ?>
2074
+ jQuery("form#lostpasswordform").css("border-radius","<?php echo get_option('agca_login_round_box_size'); ?>px");
2075
+ <?php } ?>
2076
+ <?php if(get_option('agca_login_banner')==true){ ?>
2077
+ jQuery("#backtoblog").css("display","none");
2078
+ <?php } ?>
2079
+ <?php if(get_option('agca_login_banner_text')==true){ ?>
2080
+ jQuery("#backtoblog a").html('<?php echo "← " . addslashes(get_option('agca_login_banner_text')); ?>');
2081
+ <?php } ?>
2082
+ <?php if(get_option('agca_login_photo_url')==true && get_option('agca_login_photo_remove')!=true){ ?>
2083
+ advanced_url = "<?php echo get_option('agca_login_photo_url'); ?>";
2084
+ var $url = "url(" + advanced_url + ")";
2085
+ jQuery("#login h1 a").css("background",$url+' no-repeat');
2086
+ jQuery("#login h1 a").hide();
2087
+ image = jQuery("<img />").attr("src",advanced_url);
2088
+ jQuery(image).load(function() {
2089
+ var originalWidth = 326;
2090
+ var widthDiff = this.width - originalWidth;
2091
+ jQuery("#login h1 a").height(this.height);
2092
+ jQuery("#login h1 a").width(this.width);
2093
+ jQuery("#login h1 a").css("background-size",this.width+"px "+this.height+"px");
2094
+
2095
+ var loginWidth = jQuery('#login').width();
2096
+ var originalLoginWidth = 320;
2097
+ var photoWidth = this.width;
2098
+
2099
+ if(loginWidth > photoWidth){
2100
+ jQuery("#login h1 a").css('margin','auto');
2101
+ }else{
2102
+ jQuery("#login h1 a").css('margin-left',-(widthDiff/2)+((loginWidth-originalLoginWidth)/2)+"px");
2103
+ }
2104
+
2105
+ jQuery("#login h1 a").show();
2106
+ });
2107
+ <?php } ?>
2108
+ <?php if(get_option('agca_login_photo_href')==true){ ?>
2109
+ var $href = "<?php echo get_option('agca_login_photo_href'); ?>";
2110
+ $href = $href.replace("%BLOG%", "<?php echo get_bloginfo('wpurl'); ?>");
2111
+
2112
+ jQuery("#login h1 a").attr("href",$href);
2113
+ <?php } ?>
2114
+ <?php if(get_option('agca_login_photo_remove')==true){ ?>
2115
+ jQuery("#login h1 a").css("display","none");
2116
+ <?php } ?>
2117
+
2118
+ jQuery("#login h1 a").attr("title","");
2119
+
2120
+ <?php if(get_option('agca_login_register_remove')==true){ ?>
2121
+ if(jQuery('p#nav').size() > 0){
2122
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2123
+ }
2124
+ jQuery('p#nav a').each(function(){
2125
+ if(jQuery(this).attr('href').indexOf('register') != -1){
2126
+ jQuery(this).remove();
2127
+ }
2128
+ });
2129
+
2130
+ <?php } ?>
2131
+ <?php if(get_option('agca_login_register_href')!=""){ ?>
2132
+ jQuery('p#nav a').each(function(){
2133
+ if(jQuery(this).attr('href').indexOf('register') != -1){
2134
+ jQuery(this).attr('href','<?php echo get_option('agca_login_register_href'); ?>');
2135
+ }
2136
+ });
2137
+
2138
+ <?php } ?>
2139
+
2140
+ <?php if(get_option('agca_login_lostpassword_remove')==true){ ?>
2141
+ if(jQuery('p#nav').size() > 0){
2142
+ jQuery('p#nav').html(jQuery('p#nav').html().replace('|',''));
2143
+ }
2144
+ jQuery('p#nav a').each(function(){
2145
+ if(jQuery(this).attr('href').indexOf('lostpassword') != -1){
2146
+ jQuery(this).remove();
2147
+ }
2148
+ });
2149
+
2150
+ <?php } ?>
2151
+
2152
+
2153
+ <?php //COLORIZER ?>
2154
+ <?php if(get_option('agca_colorizer_turnonoff') == 'on'){ ?>
2155
+ jQuery('label,h1,h2,h3,h4,h5,h6,a,p,.form-table th,.form-wrap label').css('text-shadow','none');
2156
+ jQuery("body.login, html").css("background","<?php echo $this->colorizer['login_color_background'];?>");
2157
+
2158
+
2159
+ <?php
2160
+
2161
+
2162
+ } ?>
2163
+ <?php //COLORIZER END ?>
2164
+ }catch(err){
2165
+ console.log("AGCA - LOGIN ERROR: " + err.name + " / " + err.message);
2166
+ }finally{
2167
+ jQuery('html').show();
2168
+ jQuery('html').css('visibility','visible');
2169
+ }
2170
+ });
2171
+ /* ]]> */
2172
+
2173
+ </script>
2174
+ <?php
2175
+ }
2176
+
2177
+ function pluginUrl(){
2178
+ return trailingslashit(plugins_url(basename(dirname(__FILE__))));
2179
+ }
2180
+
2181
+ function agca_admin_page() {
2182
+
2183
+ $wpversion = $this->get_wp_version();
2184
+ $this->agca_error_check();
2185
+ ?>
2186
+ <?php //includes ?>
2187
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/farbtastic.css?ver=<?php echo $wpversion; ?>" />
2188
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2189
+
2190
+ <link rel="stylesheet" type="text/css" href="<?php echo $this->pluginUrl(); ?>style/agca_farbtastic.css?ver=<?php echo $wpversion; ?>" />
2191
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_farbtastic.js?ver=<?php echo $wpversion; ?>"></script>
2192
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/xd.js?ver=<?php echo $wpversion; ?>"></script>
2193
+ <script type="text/javascript">
2194
+ var templates_ep = "<?php echo $this->templates_ep; ?>";
2195
+ var template_selected = '<?php echo get_option('agca_selected_template'); ?>';
2196
+ </script>
2197
+ <script type="text/javascript" src="<?php echo $this->pluginUrl(); ?>script/agca_tmpl.js?ver=<?php echo $wpversion; ?>"></script>
2198
+ <?php //includes ?>
2199
+ <div class="wrap">
2200
+ <h1 id="agca-title"><img src="<?php echo plugins_url( 'images/agca-logo.svg', __FILE__ ) ?>" /><span class="title">absolutely glamorous custom admin</span> <span class="version">(v<?php echo $this->agca_version; ?>)</span></h1>
2201
+ <div id="agca-social" style="float:right; margin-top: -23px;">
2202
+ <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>
2203
+ <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=agca@cusmin.com&item_name=Support+for+AGCA+Development" target="_blank" class="agca-donate-btn" title="Help us improve AGCA">Donate <span class="heart">❤</span></a>
2204
+ </div>
2205
+ <div id="agca_error_placeholder"></div>
2206
+ <div id="agca_news">&nbsp;</div><br />
2207
+ <form method="post" id="agca_form" action="options.php">
2208
+ <?php wp_nonce_field('agca_form','_agca_token'); ?>
2209
+ <?php settings_fields( 'agca-options-group' ); ?>
2210
+ <div id="agca-your-feedback">
2211
+ <strong>
2212
+ <span style="color:#005B69">Your feedback:</span>
2213
+ </strong>
2214
+ <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/">
2215
+ <span class="dashicons dashicons-thumbs-up"></span>
2216
+ </a>
2217
+ <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/">
2218
+ <span class="dashicons dashicons-thumbs-down"></span>
2219
+ </a>
2220
+ </div>
2221
+ <br />
2222
+ <ul id="ag_main_menu" style="<?php echo $this->isCusminActive()?'display:none':''; ?>">
2223
+ <li class="selected" style="border-top-left-radius: 10px; "><a href="#general-settings" class="dashicons-before dashicons-admin-tools" title="<?php _e('General Settings', 'ag-custom-admin')?>" ><?php _e('General', 'ag-custom-admin')?></a></li>
2224
+ <li class="normal"><a href="#admin-bar-settings" class="dashicons-before dashicons-welcome-widgets-menus" title="<?php _e('Settings for admin bar', 'ag-custom-admin')?>" ><?php _e('Admin Bar', 'ag-custom-admin')?></a></li>
2225
+ <li class="normal"><a href="#admin-footer-settings" class="dashicons-before dashicons-welcome-widgets-menus agca-invert-icon" title="<?php _e('Settings for admin footer', 'ag-custom-admin')?>" ><?php _e('Footer', 'ag-custom-admin')?></a></li>
2226
+ <li class="normal"><a href="#dashboad-page-settings" class="dashicons-before dashicons-dashboard" title="<?php _e('Settings for Dashboard page', 'ag-custom-admin')?>"><?php _e('Dashboard', 'ag-custom-admin')?></a></li>
2227
+ <li class="normal"><a href="#login-page-settings" class="dashicons-before dashicons-admin-network" title="<?php _e('Settings for Login page', 'ag-custom-admin')?>"><?php _e('Login Page', 'ag-custom-admin')?></a></li>
2228
+ <li class="normal" ><a href="#admin-menu-settings" class="dashicons-before dashicons-editor-justify" title="<?php _e('Settings for main admin menu', 'ag-custom-admin')?>"><?php _e('Admin Menu', 'ag-custom-admin')?></a></li>
2229
+ <li class="normal"><a href="#ag-colorizer-settings" class="dashicons-before dashicons-admin-appearance agca-invert-icon" title="<?php _e('Colorizer settings', 'ag-custom-admin')?>"><?php _e('Colorizer', 'ag-custom-admin')?></a></li>
2230
+ <li class="normal"><a href="#ag-advanced" class="dashicons-before dashicons-welcome-learn-more" title="<?php _e('My custom scripts', 'ag-custom-admin')?>"><?php _e('Advanced', 'ag-custom-admin')?></a></li>
2231
+ <?php if(defined('AGCA_THEMES')){ ?>
2232
+ <li class="normal" style=""><a href="#ag-templates" title="<?php _e('AGCA Themes', 'ag-custom-admin')?>"><?php _e('Themes', 'ag-custom-admin')?></a></li>
2233
+ <?php } ?>
2234
+ <li class="normal upgrade"><a href="https://cusmin.com/upgrade-to-cusmin?ref=menu" target="_blank" title="<?php _e('Upgrade to Cusmin </br>to unlock all premium features', 'ag-custom-admin')?>"><img src="<?php echo plugins_url( 'images/cusmin-logo.svg', __FILE__ ) ?>" /><?php _e('Upgrade', 'ag-custom-admin')?></a></li>
2235
+
2236
+ <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>
2237
+ </li>
2238
+ <li style="background:none;border:none;padding:0;padding-left:10px;margin-top:-7px"></li>
2239
+ </ul>
2240
+ <a id="agca_advertising" href="https://cusmin.com/upgrade-to-cusmin?ref=agca-ad" target="_blank">
2241
+ <img class="cusmin-logo" src="<?php echo plugins_url( 'images/cusmin-logo.svg', __FILE__ ) ?>" alt="Cusmin" />
2242
+ <ul>
2243
+ <li>Multiple sets of users</li>
2244
+ <li>Multiple sets of settings</li>
2245
+ <li>Reuse settings on other sites</li>
2246
+ <li>Drag & drop to reorder</li>
2247
+ <li>Advanced admin menu manager</li>
2248
+ <li>Advanced admin bar manager</li>
2249
+ <li>Custom admin menu icons</li>
2250
+ <li>Custom dashboard widgets</li>
2251
+ <li>Hide PT and CPT meta boxes</li>
2252
+ <li>Hide plugins and table columns</li>
2253
+ <li>Create custom admin pages</li>
2254
+ <li>Restrict admin page access</li>
2255
+ </ul>
2256
+ <span class="unlock-features">Unlock all features</span>
2257
+ </a>
2258
+ <div class="agca-clear"></div>
2259
+ <div id="section-cusmin" style="display:none;"><?php _e('All AGCA plugin\'s settings 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>
2260
+ <div id="section_general" style="display:none" class="ag_section">
2261
+ <h2 class="section_title"><?php _e('General Settings', 'ag-custom-admin')?></h2>
2262
+ <?php $this->show_save_button_upper(); ?>
2263
+ <p tabindex="0" class="agca-clear agca-tip"><i><?php _e('<strong>Tip: </strong>Move the cursor over an option label to see the more information about the option', 'ag-custom-admin')?></i></p>
2264
+ <table class="agca-clear form-table" width="500px">
2265
+ <?php
2266
+
2267
+ $this->print_checkbox(array(
2268
+ 'name'=>'agca_role_allbutadmin',
2269
+ 'label'=>__('Exclude the AGCA admin from the customizations', 'ag-custom-admin'),
2270
+ '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')
2271
+ ));
2272
+
2273
+ $this->print_options_h3(__('Pages', 'ag-custom-admin'));
2274
+
2275
+ $this->print_checkbox(array(
2276
+ 'hide'=>true,
2277
+ 'name'=>'agca_screen_options_menu',
2278
+ 'label'=>__('Hide <b>Screen Options</b> menu', 'ag-custom-admin'),
2279
+ 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2280
+ ));
2281
+
2282
+ $this->print_checkbox(array(
2283
+ 'hide'=>true,
2284
+ 'name'=>'agca_help_menu',
2285
+ 'label'=>__('Hide <b>Help</b> menu', 'ag-custom-admin'),
2286
+ 'title'=>__('Hides the menu from the admin pages (located on the top right corner of the page, below the admin bar)', 'ag-custom-admin')
2287
+ ));
2288
+
2289
+ $this->print_checkbox(array(
2290
+ 'title'=>__('Hides colors scheme on profile page', 'ag-custom-admin'),
2291
+ 'name'=>'agca_profile_color_scheme',
2292
+ 'hide'=>true,
2293
+ 'label'=>__('Hide User\'s Profile Color Scheme', 'ag-custom-admin')
2294
+ ));
2295
+
2296
+ $this->print_options_h3(__('Security', 'ag-custom-admin'));
2297
+
2298
+ ?>
2299
+
2300
+ <tr valign="center">
2301
+ <th scope="row">
2302
+ <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>
2303
+ </th>
2304
+ <td><?php echo $this->admin_capabilities; ?>&nbsp;&nbsp;<i>(<?php _e('default:&nbsp;<strong>Edit Dashboard</strong>', 'ag-custom-admin'); ?>)</i>
2305
+ <p style="margin-left:5px;"><i><?php _e('Find more information about', 'ag-custom-admin'); ?> <a href="https://wordpress.org/support/article/roles-and-capabilities/" target="_blank"><?php _e('WordPress capabilities', 'ag-custom-admin'); ?></a></i></p>
2306
+ </td>
2307
+ <td>
2308
+ </td>
2309
+ </tr>
2310
+ <tr>
2311
+ <td>
2312
+ <p>Need to apply multiple configurations to multiple user groups/roles? <a href="https://cusmin.com/docs/general/configuration-management?ref=agca" target="_blank">Upgrade to Cusmin</a></p>
2313
+ </td>
2314
+ </tr>
2315
+ <?php
2316
+ $this->print_options_h3(__('Feedback and Support', 'ag-custom-admin'));
2317
+
2318
+ ?>
2319
+ <tr valign="center">
2320
+ <td colspan="2">
2321
+ <div class="agca-feedback-and-support">
2322
+ <?php /*<ul>
2323
+ <li><a href="" 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>
2324
+ </ul>*/
2325
+ ?>
2326
+ <ul>
2327
+ <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>
2328
+ </ul>
2329
+ <?php /*<ul>
2330
+ <li><a href="" 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>
2331
+ </ul>*/
2332
+ ?>
2333
+ <ul>
2334
+ <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>
2335
+ </ul>
2336
+ <?php /*<ul>
2337
+ <li><a href="" 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>
2338
+ </ul>*/
2339
+ ?>
2340
+ <ul>
2341
+ <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>
2342
+ </ul>
2343
+ <ul class="upgrade">
2344
+ <li><a href="https://cusmin.com/upgrade-to-cusmin?ref=page" target="_blank">
2345
+ <img class="cusmin-spinner" src="<?php echo plugins_url( 'images/cusmin-logo.svg', __FILE__ ) ?>" />
2346
+ &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>
2347
+ </ul>
2348
+ </div>
2349
+ </td>
2350
+ <td></td>
2351
+ </tr>
2352
+ </table>
2353
+ </div>
2354
+ <div id="section_admin_bar" style="display:none" class="ag_section">
2355
+ <h2 class="section_title"><?php _e('Admin Bar Settings', 'ag-custom-admin'); ?></h2>
2356
+ <?php $this->show_save_button_upper(); ?>
2357
+ <table class="form-table" width="500px">
2358
+
2359
+ <?php
2360
+ $this->print_checkbox(array(
2361
+ 'attributes'=>array(
2362
+ 'class'=>'ag_table_major_options',
2363
+ ),
2364
+ 'hide'=>true,
2365
+ 'title'=>__('Hides the admin bar completely from the admin panel', 'ag-custom-admin'),
2366
+ 'name'=>'agca_header',
2367
+ 'label'=>__('<strong>Hide Admin bar</strong>', 'ag-custom-admin'),
2368
+ 'input-attributes'=>'data-dependant="#agca_header_show_logout_content"',
2369
+ 'input-class'=>'has-dependant',
2370
+ ));
2371
+
2372
+ $this->print_checkbox(array(
2373
+ 'attributes'=>array(
2374
+ 'class'=>'ag_table_major_options',
2375
+ 'style'=> ((get_option('agca_header')!='true')?'display:none':''),
2376
+ 'id'=>'agca_header_show_logout_content',
2377
+ ),
2378
+ 'title'=>__('Check this if you want to show Log Out button in top right corner of the admin page', 'ag-custom-admin'),
2379
+ 'name'=>'agca_header_show_logout',
2380
+ 'checked'=> ((get_option('agca_header')==true) && (get_option('agca_header_show_logout')==true)),
2381
+ 'label'=>__('<strong>(but show Log Out button)</strong>', 'ag-custom-admin')
2382
+ ));
2383
+
2384
+ $this->print_checkbox(array(
2385
+ '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'),
2386
+ 'name'=>'agca_admin_bar_frontend',
2387
+ 'hide'=>true,
2388
+ 'label'=>__('Site pages: Do not apply Admin bar customizations', 'ag-custom-admin')
2389
+ ));
2390
+
2391
+ $this->print_checkbox(array(
2392
+ 'title'=>__('Hides admin bar completely for authenticated users on site pages.', 'ag-custom-admin'),
2393
+ 'name'=>'agca_admin_bar_frontend_hide',
2394
+ 'hide'=>true,
2395
+ 'label'=>__('Site pages: Hide Admin bar', 'ag-custom-admin')
2396
+ ));
2397
+
2398
+ $this->print_options_h3(__('Left Side', 'ag-custom-admin'));
2399
+
2400
+ $this->print_input(array(
2401
+ 'title'=>__('Change default WordPress logo with custom image.', 'ag-custom-admin'),
2402
+ 'name'=>'agca_wp_logo_custom',
2403
+ 'label'=>__('Admin bar logo', 'ag-custom-admin'),
2404
+ 'hint' =>__('Image URL', 'ag-custom-admin')
2405
+ ));
2406
+
2407
+ $this->print_input(array(
2408
+ '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'),
2409
+ 'name'=>'agca_wp_logo_custom_link',
2410
+ 'label'=>__('Admin bar logo link', 'ag-custom-admin'),
2411
+ 'hint' =>__('Link', 'ag-custom-admin')
2412
+ ));
2413
+
2414
+ $this->print_input(array(
2415
+ '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>',
2416
+ 'name'=>'agca_custom_title',
2417
+ 'label'=>__('Page title template', 'ag-custom-admin'),
2418
+ 'hint' =>__('Please use', 'ag-custom-admin').' <strong>%BLOG%</strong> '.__('and', 'ag-custom-admin'). ' <strong>%PAGE%</strong> '.__('in your title template.', 'ag-custom-admin')
2419
+ ));
2420
+
2421
+ $this->print_input(array(
2422
+ 'title'=>__('Add custom image on the top of the admin content.', 'ag-custom-admin'),
2423
+ 'name'=>'agca_header_logo_custom',
2424
+ 'label'=>__('Header image', 'ag-custom-admin'),
2425
+ 'hint' =>__('Image URL', 'ag-custom-admin')
2426
+ ));
2427
+
2428
+
2429
+ $this->print_checkbox(array(
2430
+ 'hide'=>true,
2431
+ 'title'=>__('Hides small Wordpress logo or custom logo from the admin bar', 'ag-custom-admin'),
2432
+ 'name'=>'agca_header_logo',
2433
+ 'label'=>__('Hide Admin bar logo', 'ag-custom-admin')
2434
+ ));
2435
+
2436
+ $this->print_checkbox(array(
2437
+ 'hide'=>true,
2438
+ 'title'=>__('Hides WordPress context menu on admin bar logo from admin bar', 'ag-custom-admin'),
2439
+ 'name'=>'agca_remove_top_bar_dropdowns',
2440
+ 'label'=>__('Hide Admin bar logo context menu', 'ag-custom-admin')
2441
+ ));
2442
+
2443
+ $this->print_checkbox(array(
2444
+ 'hide'=>true,
2445
+ 'title'=>__('Hides site name link from the admin bar', 'ag-custom-admin'),
2446
+ 'name'=>'agca_remove_site_link',
2447
+ 'label'=>__('Hide Site name', 'ag-custom-admin')
2448
+ ));
2449
+
2450
+ $this->print_checkbox(array(
2451
+ 'hide'=>true,
2452
+ 'title'=>__('Hides update notifications from admin bar', 'ag-custom-admin'),
2453
+ 'name'=>'agca_admin_bar_update_notifications',
2454
+ 'label'=>__('Remove update notifications', 'ag-custom-admin')
2455
+ ));
2456
+
2457
+ $this->print_checkbox(array(
2458
+ 'hide'=>true,
2459
+ 'title'=>__('Hides comments block from admin bar', 'ag-custom-admin'),
2460
+ 'name'=>'agca_admin_bar_comments',
2461
+ 'label'=>__('Hide <b>Comments</b> block', 'ag-custom-admin')
2462
+ ));
2463
+
2464
+ $this->print_checkbox(array(
2465
+ 'hide'=>true,
2466
+ 'attributes'=>array(
2467
+ 'style'=>'margin-top:20px;'
2468
+ ),
2469
+ 'title'=>__('Hides <b>+ New</b> block and its context menu from admin bar', 'ag-custom-admin'),
2470
+ 'name'=>'agca_admin_bar_new_content',
2471
+ 'label'=>__('Hide <b>+ New</b> block', 'ag-custom-admin'),
2472
+ 'input-attributes'=>'data-dependant=".new_content_header_submenu"',
2473
+ 'input-class'=>'has-dependant dependant-opposite'
2474
+ ));
2475
+
2476
+ $this->print_checkbox(array(
2477
+ 'hide'=>true,
2478
+ 'attributes'=>array(
2479
+ 'class'=>'new_content_header_submenu'
2480
+ ),
2481
+ 'title'=>__('Hides <b>Post</b> sub-menu from <b>+ New</b> block on admin bar', 'ag-custom-admin'),
2482
+ 'name'=>'agca_admin_bar_new_content_post',
2483
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide <b>+ New > Post</b> sub-menu', 'ag-custom-admin')
2484
+ ));
2485
+
2486
+ $this->print_checkbox(array(
2487
+ 'hide'=>true,
2488
+ 'attributes'=>array(
2489
+ 'class'=>'new_content_header_submenu'
2490
+ ),
2491
+ 'title'=>__('Hides <b>Link</b> sub-menu from <b>+ New</b> block on admin bar', 'ag-custom-admin'),
2492
+ 'name'=>'agca_admin_bar_new_content_link',
2493
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide <b>+ New > Link</b> sub-menu', 'ag-custom-admin')
2494
+ ));
2495
+
2496
+ $this->print_checkbox(array(
2497
+ 'hide'=>true,
2498
+ 'attributes'=>array(
2499
+ 'class'=>'new_content_header_submenu'
2500
+ ),
2501
+ 'title'=>__('Hides <b>Page</b> sub-menu from <b>+ New</b> block on admin bar', 'ag-custom-admin'),
2502
+ 'name'=>'agca_admin_bar_new_content_page',
2503
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide <b>+ New > Page</b> sub-menu', 'ag-custom-admin')
2504
+ ));
2505
+
2506
+ $this->print_checkbox(array(
2507
+ 'hide'=>true,
2508
+ 'attributes'=>array(
2509
+ 'class'=>'new_content_header_submenu'
2510
+ ),
2511
+ 'title'=>__('Hides <b>User</b> sub-menu from <b>+ New</b> block on admin bar', 'ag-custom-admin'),
2512
+ 'name'=>'agca_admin_bar_new_content_user',
2513
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide <b>+ New > User</b> sub-menu', 'ag-custom-admin')
2514
+ ));
2515
+
2516
+ $this->print_checkbox(array(
2517
+ 'hide'=>true,
2518
+ 'attributes'=>array(
2519
+ 'class'=>'new_content_header_submenu'
2520
+ ),
2521
+ 'title'=>__('Hides <b>Media</b> sub-menu from <b>+ New</b> block on admin bar', 'ag-custom-admin'),
2522
+ 'name'=>'agca_admin_bar_new_content_media',
2523
+ 'label'=>'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.__('Hide <b>+ New > Media</b> sub-menu', 'ag-custom-admin')
2524
+ ));
2525
+
2526
+ /* $this->print_checkbox(array(
2527
+ 'hide'=>true,
2528
+ 'title'=>__('Hides "Admin themes" from admin bar', 'ag-custom-admin'),
2529
+ 'name'=>'agca_admin_bar_admin_themes',
2530
+ 'label'=>__('"Admin themes"', 'ag-custom-admin')
2531
+ ));*/
2532
+
2533
+ $this->print_input(array(
2534
+ 'title'=>__('Adds custom text in admin top bar.', 'ag-custom-admin'),
2535
+ 'name'=>'agca_custom_site_heading',
2536
+ 'label'=>__('Custom blog heading', 'ag-custom-admin'),
2537
+ 'hint'=>__('<strong>Tip: </strong>You can use HTML tags like', 'ag-custom-admin')." &lt;h1&gt; ".__('or', 'ag-custom-admin')." &lt;a&gt;"
2538
+ ));
2539
+
2540
+
2541
+ $this->print_checkbox(array(
2542
+ 'hide'=>true,
2543
+ 'title'=>__('Hides the yellow bar with the information about the new WordPress release', 'ag-custom-admin'),
2544
+ 'name'=>'agca_update_bar',
2545
+ 'label'=>__('Hide WordPress update notification', 'ag-custom-admin')
2546
+ ));
2547
+
2548
+ $this->print_options_h3(__('Right Side', 'ag-custom-admin'));
2549
+
2550
+ $this->print_input(array(
2551
+ 'name'=>'agca_howdy',
2552
+ 'label'=>__('Change Howdy text', 'ag-custom-admin'),
2553
+ ));
2554
+
2555
+ $this->print_input(array(
2556
+ 'title'=>__('Put \'Exit\', for example', 'ag-custom-admin'),
2557
+ 'name'=>'agca_logout',
2558
+ 'label'=>__('Change Log out text', 'ag-custom-admin'),
2559
+ ));
2560
+
2561
+ $this->print_checkbox(array(
2562
+ 'hide'=>true,
2563
+ 'name'=>'agca_remove_your_profile',
2564
+ 'label'=>__('Hide "Edit My Profile" link', 'ag-custom-admin'),
2565
+ ));
2566
+
2567
+ $this->print_checkbox(array(
2568
+ 'title'=>__('If selected, hides all elements in top right corner, except Log Out button', 'ag-custom-admin'),
2569
+ 'name'=>'agca_logout_only',
2570
+ 'label'=>__('Log out only', 'ag-custom-admin')
2571
+ ));
2572
+
2573
+ ?>
2574
+
2575
+ <tr>
2576
+ <td>
2577
+ <p>Try the Cusmin admin bar editor instead: <a href="https://cusmin.com/docs/admin-bar/admin-bar-editor?ref=admin-bar" target="_blank"><br>Upgrade to Cusmin</a></p>
2578
+ </td>
2579
+ </tr>
2580
+ </table>
2581
+ </div>
2582
+
2583
+ <div id="section_admin_footer" style="display:none" class="ag_section">
2584
+ <h2 class="section_title"><?php _e('Admin Footer Settings', 'ag-custom-admin'); ?></h2>
2585
+ <?php $this->show_save_button_upper(); ?>
2586
+ <table class="form-table" width="500px">
2587
+ <?php
2588
+ $this->print_checkbox(array(
2589
+ 'hide'=>true,
2590
+ 'attributes'=>array(
2591
+ 'class'=>'ag_table_major_options'
2592
+ ),
2593
+ 'title'=>__('Hides footer with all elements', 'ag-custom-admin'),
2594
+ 'name'=>'agca_footer',
2595
+ 'label'=>__('<strong>Hide footer</strong>', 'ag-custom-admin')
2596
+ ));
2597
+
2598
+ $this->print_options_h3(__('Footer Options', 'ag-custom-admin'));
2599
+
2600
+ $this->print_checkbox(array(
2601
+ 'hide'=>true,
2602
+ 'title'=>__('Hides default text in footer', 'ag-custom-admin'),
2603
+ 'name'=>'agca_footer_left_hide',
2604
+ 'label'=>__('Hide footer text', 'ag-custom-admin')
2605
+ ));
2606
+
2607
+ $this->print_textarea(array(
2608
+ 'title'=>__('Replaces text \'Thank you for creating with WordPress\' with custom text', 'ag-custom-admin'),
2609
+ 'name'=>'agca_footer_left',
2610
+ 'class' => 'one-line',
2611
+ 'label'=>__('Change footer text', 'ag-custom-admin')
2612
+ ));
2613
+
2614
+ $this->print_checkbox(array(
2615
+ 'hide'=>true,
2616
+ 'title'=>__('Hides text \'Get Version ...\' on right', 'ag-custom-admin'),
2617
+ 'name'=>'agca_footer_right_hide',
2618
+ 'label'=>__('Hide version text', 'ag-custom-admin')
2619
+ ));
2620
+
2621
+ $this->print_textarea(array(
2622
+ 'title'=>__('Replaces text \'Get Version ...\' with custom text', 'ag-custom-admin'),
2623
+ 'name'=>'agca_footer_right',
2624
+ 'class' => 'one-line',
2625
+ 'label'=>__('Change version text', 'ag-custom-admin')
2626
+ ));
2627
+
2628
+ ?>
2629
+
2630
+ </table>
2631
+ </div>
2632
+ <div id="section_dashboard_page" style="display:none" class="ag_section">
2633
+ <h2 class="section_title"><?php _e('Dashboard Settings', 'ag-custom-admin'); ?></h2>
2634
+ <?php $this->show_save_button_upper(); ?>
2635
+ <table class="form-table" width="500px">
2636
+ <?php
2637
+
2638
+ $this->print_options_h3(__('Dashboard Options', 'ag-custom-admin'));
2639
+
2640
+ $this->print_input(array(
2641
+ 'title'=>__('Main heading (\'Dashboard\') on Dashboard page', 'ag-custom-admin'),
2642
+ 'name'=>'agca_dashboard_text',
2643
+ 'label'=>__('Change Dashboard heading text', 'ag-custom-admin'),
2644
+ ));
2645
+
2646
+ ?>
2647
+ <tr valign="center">
2648
+ <th scope="row">
2649
+ <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>
2650
+ </th>
2651
+ <td class="agca_editor">
2652
+ <?php $this->getTextEditor('agca_dashboard_text_paragraph'); ?>
2653
+ </td>
2654
+ </tr>
2655
+ <?php
2656
+
2657
+ $this->print_options_h3(__('Dashboard Widgets Options', 'ag-custom-admin'));
2658
+
2659
+ ?>
2660
+ <tr>
2661
+ <td colspan="2">
2662
+ <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>
2663
+ </td>
2664
+ </tr>
2665
+ <?php
2666
+ $this->print_checkbox(array(
2667
+ 'hide'=>true,
2668
+ 'title'=>__('Hides <b>Welcome WordPress</b> widget', 'ag-custom-admin'),
2669
+ 'name'=>'agca_dashboard_widget_welcome',
2670
+ 'label'=>__('Hide <b>Welcome</b> widget', 'ag-custom-admin')
2671
+ ));
2672
+
2673
+ $this->print_checkbox(array(
2674
+ 'hide'=>true,
2675
+ 'title'=>__('Hides <b>Activity</b> dashboard widget', 'ag-custom-admin'),
2676
+ 'name'=>'agca_dashboard_widget_activity',
2677
+ 'label'=>__('Hide <b>Activity</b> widget', 'ag-custom-admin')
2678
+ ));
2679
+
2680
+ $this->print_checkbox(array(
2681
+ 'hide'=>true,
2682
+ 'title'=>__('Hides <b>Quick Draft</b> dashboard widget', 'ag-custom-admin'),
2683
+ 'name'=>'agca_dashboard_widget_qp',
2684
+ 'label'=>__('Hide <b>Quick Draft</b> widget', 'ag-custom-admin')
2685
+ ));
2686
+
2687
+ $this->print_checkbox(array(
2688
+ 'hide'=>true,
2689
+ 'title'=>__('Hides <b>At a Glance</b> dashboard widget', 'ag-custom-admin'),
2690
+ 'name'=>'agca_dashboard_widget_rn',
2691
+ 'label'=>__('Hide <b>At a Glance</b> widget', 'ag-custom-admin')
2692
+ ));
2693
+
2694
+ $this->print_checkbox(array(
2695
+ 'hide'=>true,
2696
+ 'name'=>'agca_dashboard_widget_primary',
2697
+ 'title'=>__('This is <b>WordPress News</b> or <b>WordPress Development Blog</b> widget in older WordPress versions', 'ag-custom-admin'),
2698
+ 'label'=>__('Hide <b>WordPress News</b> widget', 'ag-custom-admin')
2699
+ ));
2700
+
2701
+ $this->print_checkbox(array(
2702
+ 'hide'=>true,
2703
+ 'name'=>'agca_dashboard_widget_secondary',
2704
+ 'title'=>__('This is <b>Other WordPress News</b> widget by default', 'ag-custom-admin'),
2705
+ 'label'=>__('Hide secondary widget area', 'ag-custom-admin')
2706
+ ));
2707
+
2708
+ ?>
2709
+ <tr>
2710
+ <td>
2711
+ <p>Create custom Dashboard Widgets<br><a href="https://cusmin.com/docs/dashboard/my-dashboard-widgets?ref=agca" target="_blank">Upgrade to Cusmin</a></p>
2712
+ </td>
2713
+ </tr>
2714
+ </table>
2715
+ </div>
2716
+ <div id="section_login_page" style="display:none" class="ag_section">
2717
+ <h2 class="section_title"><?php _e('Login Page Settings', 'ag-custom-admin'); ?></h2>
2718
+ <?php $this->show_save_button_upper(); ?>
2719
+ <table class="form-table" width="500px">
2720
+ <?php
2721
+
2722
+ $this->print_options_h3(__('Login Page Options', 'ag-custom-admin'));
2723
+
2724
+ $this->print_checkbox(array(
2725
+ 'hide'=>true,
2726
+ 'name'=>'agca_login_banner',
2727
+ 'title'=>__('Hide back to blog block', 'ag-custom-admin'),
2728
+ 'label'=>__('Hide "Back to blog" text', 'ag-custom-admin')
2729
+ ));
2730
+
2731
+ $this->print_input(array(
2732
+ 'name'=>'agca_login_banner_text',
2733
+ 'title'=>__('Changes \'<- Back to ...\' text in top bar on Login page', 'ag-custom-admin'),
2734
+ 'label'=>__('Change back to blog text', 'ag-custom-admin')
2735
+ ));
2736
+
2737
+ $this->print_input(array(
2738
+ 'title'=>__('If this field is not empty, image from provided url will be visible on Login page', 'ag-custom-admin'),
2739
+ 'name'=>'agca_login_photo_url',
2740
+ 'label'=>__('Change Login header image', 'ag-custom-admin'),
2741
+ 'hint'=>__('Image URL', 'ag-custom-admin')
2742
+ ));
2743
+
2744
+ $this->print_input(array(
2745
+ 'title'=>__('Put here custom link to a web location, that will be triggered on image click', 'ag-custom-admin'),
2746
+ 'name'=>'agca_login_photo_href',
2747
+ 'label'=>__('Change link on login image', 'ag-custom-admin'),
2748
+ 'hint'=>__('For blog URL use', 'ag-custom-admin').' %BLOG%'
2749
+ ));
2750
+
2751
+ $this->print_checkbox(array(
2752
+ 'hide'=>true,
2753
+ 'title'=>__('Hides login image completely', 'ag-custom-admin'),
2754
+ 'name'=>'agca_login_photo_remove',
2755
+ 'label'=>__('Hide login header image', 'ag-custom-admin'),
2756
+ ));
2757
+
2758
+ $this->print_checkbox(array(
2759
+ 'title'=>__('Rounds box on login page', 'ag-custom-admin'),
2760
+ 'name'=>'agca_login_round_box',
2761
+ 'label'=>'Round box corners',
2762
+ 'input-class'=>'has-dependant',
2763
+ 'input-attributes'=>'data-dependant="#agca_login_round_box_size_block, #agca_login_round_box_skip_logo"'
2764
+ ));
2765
+
2766
+ $this->print_input(array(
2767
+ 'attributes'=>array(
2768
+ 'style'=> ((get_option('agca_login_round_box') !== 'true' )?'display:none':''),
2769
+ 'id'=>'agca_login_round_box_size_block'
2770
+ ),
2771
+ 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2772
+ 'name'=>'agca_login_round_box_size',
2773
+ 'label'=>__('Round box corners - size', 'ag-custom-admin'),
2774
+ 'input-class'=>'validateNumber',
2775
+ 'hint'=>__('(Size in px)', 'ag-custom-admin')
2776
+ ));
2777
+
2778
+ $this->print_checkbox(array(
2779
+ 'attributes'=>array(
2780
+ 'style'=> ((get_option('agca_login_round_box') !== 'true' )?'display:none':''),
2781
+ 'id'=>'agca_login_round_box_skip_logo'
2782
+ ),
2783
+ //'hide'=>true,
2784
+ 'title'=>__('Skip rounding logo on the login page', 'ag-custom-admin'),
2785
+ 'name'=>'agca_login_round_box_skip_logo',
2786
+ 'label'=>__('Don\'t round logo', 'ag-custom-admin'),
2787
+ 'input-class'=>'',
2788
+ ));
2789
+
2790
+ $this->print_checkbox(array(
2791
+ 'hide'=>true,
2792
+ 'title'=>__('Hides register link on login page', 'ag-custom-admin'),
2793
+ 'name'=>'agca_login_register_remove',
2794
+ 'label'=>__('Hide "Register" link', 'ag-custom-admin'),
2795
+ 'input-class'=>'has-dependant dependant-opposite',
2796
+ 'input-attributes'=>'data-dependant="#agca_login_register_href_block"'
2797
+ ));
2798
+
2799
+ $this->print_input(array(
2800
+ 'attributes'=>array(
2801
+ 'style'=> ((get_option('agca_login_register_remove')=='true')?'display:none':''),
2802
+ 'id'=>'agca_login_register_href_block'
2803
+ ),
2804
+ 'title'=>__('Change register link on login page to point to your custom registration page.', 'ag-custom-admin'),
2805
+ 'name'=>'agca_login_register_href',
2806
+ 'label'=>__('Change register link', 'ag-custom-admin'),
2807
+ 'hint'=>__('Link to new registration page', 'ag-custom-admin')
2808
+ ));
2809
+
2810
+ $this->print_checkbox(array(
2811
+ 'hide'=>true,
2812
+ 'title'=>__('Hides lost password link on login page', 'ag-custom-admin'),
2813
+ 'name'=>'agca_login_lostpassword_remove',
2814
+ 'label'=>__('Hide "Lost password" link', 'ag-custom-admin'),
2815
+ ));
2816
+ ?>
2817
+ <tr>
2818
+ <td>
2819
+ <p>Add a custom login background image and apply more login page options: <a href="https://cusmin.com/docs/login-page?ref=login-page" target="_blank">Upgrade to Cusmin</a></p>
2820
+ </td>
2821
+ </tr>
2822
+ </table>
2823
+ </div>
2824
+ <?php
2825
+ /*ADMIN MENU*/
2826
+ ?>
2827
+ <div id="section_admin_menu" style="display:none" class="ag_section">
2828
+ <h2 class="section_title"><?php _e('Admin Menu Settings', 'ag-custom-admin'); ?></h2>
2829
+ <?php $this->show_save_button_upper(); ?>
2830
+ <table class="form-table" width="500px">
2831
+ <tr valign="center" class="ag_table_major_options">
2832
+ <td><label for="agca_admin_menu_turnonoff"><strong><?php _e('Apply admin menu customizations', 'ag-custom-admin'); ?></strong></label></td>
2833
+ <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>
2834
+ </tr>
2835
+ <tr valign="center" class="ag_table_major_options">
2836
+ <td><label for="agca_admin_menu_agca_button_only" title="<?php _e('Hides admin menu completely (administrator can see <b>AGCA</b> button)', 'ag-custom-admin'); ?>"><strong><?php _e('Hide admin menu', 'ag-custom-admin'); ?></strong></label></td>
2837
+ <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 <b>AGCA</b> button)', 'ag-custom-admin'); ?>" value="true" <?php if (get_option('agca_admin_menu_agca_button_only')==true) echo 'checked="checked" '; ?> /></td>
2838
+ </tr>
2839
+ <?php
2840
+ $this->print_options_h3(__('Edit / Remove Menu Items', 'ag-custom-admin'));
2841
+ ?>
2842
+ <tr>
2843
+ <td colspan="2">
2844
+ <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 />
2845
+ <p tabindex="0"><em>(<?php _e('click on the top menu item to show its sub-menus', 'ag-custom-admin'); ?>)</em></p>
2846
+ <table id="ag_edit_adminmenu">
2847
+ <tr style="background-color:#816c64;">
2848
+ <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>
2849
+ </td>
2850
+ </tr>
2851
+ </table>
2852
+ <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')); ?>" />
2853
+ <input type="hidden" size="47" id="ag_edit_adminmenu_json_new" name="ag_edit_adminmenu_json_new" value="" />
2854
+ </td>
2855
+ <td></td>
2856
+ </tr>
2857
+ <?php
2858
+ $this->print_checkbox(array(
2859
+ 'title'=>__('Removes Profile menu item for non-admin users.', 'ag-custom-admin'),
2860
+ 'hide'=>true,
2861
+ 'name'=>'agca_menu_remove_client_profile',
2862
+ 'label'=>__('Remove Profile button from user menu', 'ag-custom-admin'),
2863
+ ));
2864
+ $this->print_checkbox(array(
2865
+ 'title'=>__('Removes Customize button on front end for authenticated users.', 'ag-custom-admin'),
2866
+ 'hide'=>true,
2867
+ 'name'=>'agca_menu_remove_customize_button',
2868
+ 'label'=>__('Front end: Remove Customize button', 'ag-custom-admin'),
2869
+ ));
2870
+ ?>
2871
+ <tr>
2872
+ <td>
2873
+ <p>Try the Cusmin admin menu editor instead: <a href="https://cusmin.com/docs/admin-menu/admin-menu-editor?ref=admin-menu-editor" target="_blank"><br>Upgrade to Cusmin</a></p>
2874
+ </td>
2875
+ </tr>
2876
+
2877
+ <?php
2878
+ $this->print_options_h3(__('Add New Menu Items', 'ag-custom-admin'));
2879
+ ?>
2880
+ <tr>
2881
+ <td colspan="2">
2882
+ <table id="ag_add_adminmenu">
2883
+ <tr>
2884
+ <td colspan="2">
2885
+ <?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" />
2886
+ <?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" />
2887
+ <?php _e('open in', 'ag-custom-admin'); ?>:&nbsp;<select id="ag_add_adminmenu_target" class="agca-selectbox" style="width:auto;">
2888
+ <option value="_self" selected><?php _e('the same tab', 'ag-custom-admin'); ?></option>
2889
+ <option value="_blank" ><?php _e('a new tab', 'ag-custom-admin'); ?></option>
2890
+ </select>
2891
+ <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'); ?>" />
2892
+ </td><td></td>
2893
+ </tr>
2894
+ </table>
2895
+ <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')); ?>" />
2896
+ </td>
2897
+ <td>
2898
+ </td>
2899
+ </tr>
2900
+ <?php
2901
+ $this->print_options_h3(__('Admin Menu Settings', 'ag-custom-admin'));
2902
+ ?>
2903
+ <tr valign="center">
2904
+ <th scope="row">
2905
+ <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>
2906
+ </th>
2907
+ <td>
2908
+ <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" >
2909
+ <option value="" <?php echo (get_option('agca_admin_menu_autofold') == "")?" selected ":""; ?> ><?php _e('Default', 'ag-custom-admin'); ?></option>
2910
+ <option value="force" <?php echo (get_option('agca_admin_menu_autofold') == "force")?" selected ":""; ?> ><?php _e('Force admin menu auto-folding', 'ag-custom-admin'); ?></option>
2911
+ <option value="disable" <?php echo (get_option('agca_admin_menu_autofold') == "disable")?" selected ":""; ?> ><?php _e('Disable admin menu auto-folding', 'ag-custom-admin'); ?></option>
2912
+ </select>
2913
+ </td>
2914
+ </tr>
2915
+ <?php
2916
+
2917
+ $this->print_checkbox(array(
2918
+ 'hide'=>true,
2919
+ 'title'=>__('Removes empty space between some top menu items', 'ag-custom-admin'),
2920
+ 'name'=>'agca_admin_menu_separators',
2921
+ 'label'=>__('Hide menu items separators', 'ag-custom-admin'),
2922
+ ));
2923
+
2924
+ $this->print_checkbox(array(
2925
+ 'hide'=>true,
2926
+ 'title'=>__('Removes icons from dmin menu buttons', 'ag-custom-admin'),
2927
+ 'name'=>'agca_admin_menu_icons',
2928
+ 'label'=>__('Hide menu icons', 'ag-custom-admin'),
2929
+ ));
2930
+
2931
+ $this->print_checkbox(array(
2932
+ 'hide'=>true,
2933
+ 'title'=>__('Removes small arrow that appears on the top button hover', 'ag-custom-admin'),
2934
+ 'name'=>'agca_admin_menu_arrow',
2935
+ 'label'=>__('Hide sub-menu arrow', 'ag-custom-admin'),
2936
+ ));
2937
+
2938
+ $this->print_checkbox(array(
2939
+ 'hide'=>true,
2940
+ 'title'=>__('Removes collapse button at the end of admin menu', 'ag-custom-admin'),
2941
+ 'name'=>'agca_admin_menu_collapse_button',
2942
+ 'label'=>__('Hide "Collapse menu" button', 'ag-custom-admin'),
2943
+ ));
2944
+
2945
+ $this->print_checkbox(array(
2946
+ 'title'=>__('Rounds submenu pop-up box', 'ag-custom-admin'),
2947
+ 'name'=>'agca_admin_menu_submenu_round',
2948
+ 'label'=>__('Round sub-menu pop-up box', 'ag-custom-admin'),
2949
+ 'input-attributes'=>'data-dependant="#agca_admin_menu_submenu_round_size"',
2950
+ 'input-class'=>'has-dependant',
2951
+ ));
2952
+
2953
+ $this->print_input(array(
2954
+ 'attributes'=>array(
2955
+ 'style'=> ((get_option('agca_admin_menu_submenu_round')!=='true')?'display:none':''),
2956
+ 'id'=>'agca_admin_menu_submenu_round_size'
2957
+ ),
2958
+ 'title'=>__('Size of rounded box curve', 'ag-custom-admin'),
2959
+ 'name'=>'agca_admin_menu_submenu_round_size',
2960
+ 'label'=>__('Round sub-menu pop-up box - size', 'ag-custom-admin'),
2961
+ 'input-class'=>'validateNumber',
2962
+ 'hint'=>__('(Size in px)', 'ag-custom-admin')
2963
+ ));
2964
+
2965
+ $this->print_input(array(
2966
+ 'title'=>__('Adds custom logo above the admin menu', 'ag-custom-admin'),
2967
+ 'name'=>'agca_admin_menu_brand',
2968
+ 'label'=>__('Admin menu branding logo', 'ag-custom-admin'),
2969
+ 'hint'=>__('Image URL', 'ag-custom-admin')
2970
+ ));
2971
+
2972
+ $this->print_input(array(
2973
+ 'title'=>__('Change branding logo link</br></br>Use:', 'ag-custom-admin').'</br><strong>%BLOG%</strong> - '. __('for blog URL', 'ag-custom-admin'),
2974
+ 'name'=>'agca_admin_menu_brand_link',
2975
+ 'label'=>__('Branding logo link', 'ag-custom-admin'),
2976
+ 'hint'=>__('Branding image URL', 'ag-custom-admin')
2977
+ ));
2978
+ ?>
2979
+ </table>
2980
+ </div>
2981
+ <div id="section_ag_colorizer_settings" style="display:none" class="ag_section">
2982
+ <h2 class="section_title"><?php _e('Colorizer Page', 'ag-custom-admin'); ?></h2>
2983
+ <?php $this->show_save_button_upper(); ?>
2984
+ <table class="form-table" width="500px">
2985
+ <tr valign="center" class="ag_table_major_options">
2986
+ <td><label for="agca_colorizer_turnonoff"><strong><?php _e('Apply Colorizer customizations', 'ag-custom-admin'); ?></strong></label></td>
2987
+ <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>
2988
+ </tr>
2989
+ <?php
2990
+ $this->print_options_h3(__('Global Color Options', 'ag-custom-admin'));
2991
+
2992
+ $this->print_color('color_background',__('Background:', 'ag-custom-admin'),__('Change admin page background color', 'ag-custom-admin'));
2993
+ $this->print_color('login_color_background',__('Login page background:', 'ag-custom-admin'),__('Change login page background color', 'ag-custom-admin'));
2994
+ $this->print_color('color_header',__('Admin bar:', 'ag-custom-admin'),__('Change admin bar (on top) color in admin panel', 'ag-custom-admin'));
2995
+
2996
+ $this->print_options_h3(__('Admin Menu Color Options', 'ag-custom-admin'));
2997
+
2998
+ $this->print_color('color_admin_menu_top_button_background',__('Button background:', 'ag-custom-admin'),__('Change button background color', 'ag-custom-admin'));
2999
+ $this->print_color('color_admin_menu_font',__('Button text:', 'ag-custom-admin'),__('Change button text color', 'ag-custom-admin'));
3000
+ $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'));
3001
+ $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'));
3002
+ $this->print_color('color_admin_menu_submenu_background',__('Sub-menu button background:', 'ag-custom-admin'),__('Change submenu item background color', 'ag-custom-admin'));
3003
+ $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'));
3004
+ $this->print_color('color_admin_submenu_font',__('Sub-menu text:', 'ag-custom-admin'),__('Sub-menu text color', 'ag-custom-admin'));
3005
+ $this->print_color('color_admin_menu_behind_background',__('Wrapper background:', 'ag-custom-admin'),__('Change background color of element behind admin menu', 'ag-custom-admin'));
3006
+
3007
+ $this->print_options_h3(__('Font Color Options', 'ag-custom-admin'));
3008
+
3009
+ $this->print_color('color_font_content',__('Content text:', 'ag-custom-admin'),__('Change color in content text', 'ag-custom-admin'));
3010
+ $this->print_color('color_font_header',__('Admin bar text:', 'ag-custom-admin'),__('Change color of admin bar text', 'ag-custom-admin'));
3011
+ $this->print_color('color_font_footer',__('Footer text:', 'ag-custom-admin'),__('Change color in footer text', 'ag-custom-admin'));
3012
+
3013
+ $this->print_options_h3(__('Widgets Color Options', 'ag-custom-admin'));
3014
+
3015
+ $this->print_color('color_widget_bar',__('Title bar background:', 'ag-custom-admin'),__('Change color in header text', 'ag-custom-admin'));
3016
+ $this->print_color('color_widget_background',__('Background:', 'ag-custom-admin'),__('Change widget background color', 'ag-custom-admin'));
3017
+ ?>
3018
+
3019
+ </table>
3020
+ <p>Need more Colorizer options? <a href="https://cusmin.com/docs/colorizer?ref=agca" target="_blank">Upgrade to Cusmin</a></p>
3021
+ <input type="hidden" size="47" id="ag_colorizer_json" name="ag_colorizer_json" value="<?php echo htmlspecialchars(get_option('ag_colorizer_json')); ?>" />
3022
+ <div id="picker"></div>
3023
+ </div>
3024
+ <?php if(defined('AGCA_THEMES')){ ?>
3025
+ <div id="section_templates" style="display:none" class="ag_section">
3026
+ <h2 class="section_title"><span style="float:left"><?php _e('Admin Themes', 'ag-custom-admin'); ?></span></h2>
3027
+ <table class="form-table" width="500px">
3028
+ <tr valign="center">
3029
+ <td>
3030
+ <p style="color: red; font-size:15px;font-weight:bold;margin-bottom:20px;">Note: AGCA Themes will be discontinued soon!</p>
3031
+ <div id="agca_templates"></div>
3032
+ </td>
3033
+ </tr>
3034
+ <tr>
3035
+ <td>
3036
+ <div id="advanced_template_options" style="display:none">
3037
+ <div class="agca-feedback-and-support">
3038
+ <ul>
3039
+ <?php /* <li><a href="" 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>*/ ?>
3040
+ <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>
3041
+ </ul>
3042
+ </div>
3043
+ </div>
3044
+ </td>
3045
+ </tr>
3046
+ </table>
3047
+ </div>
3048
+ <?php } ?>
3049
+ <div id="section_advanced" style="display:none" class="ag_section">
3050
+ <h2 class="section_title"><?php _e('Advanced', 'ag-custom-admin'); ?></h2>
3051
+ <?php $this->show_save_button_upper(); ?>
3052
+ <table class="form-table" width="500px">
3053
+ <tr valign="center">
3054
+ <td colspan="2">
3055
+ <p class="agca-tip"><i><?php _e('<strong>Note: </strong>These options will override existing customizations', 'ag-custom-admin'); ?></i></p>
3056
+ </td><td></td>
3057
+ </tr>
3058
+ <tr valign="center">
3059
+ <th scope="row">
3060
+ <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>
3061
+ </th>
3062
+ <td>
3063
+ <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>
3064
+ </td>
3065
+ </tr>
3066
+ <tr valign="center">
3067
+ <th scope="row">
3068
+ <label title="<?php _e('Add additional custom JavaScript', 'ag-custom-admin'); ?>" for="agca_custom_js"><?php _e('Custom JavaScript', 'ag-custom-admin'); ?></label>
3069
+ </th>
3070
+ <td>
3071
+ <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>
3072
+ </td>
3073
+ </tr>
3074
+ <?php
3075
+ $this->print_checkbox(array(
3076
+ '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'),
3077
+ 'name'=>'agca_disable_postver',
3078
+ 'label'=>__('Temporary disable POST verification', 'ag-custom-admin'),
3079
+ ));
3080
+ ?>
3081
+ <tr valign="center">
3082
+ <th scope="row">
3083
+ <label title="<?php _e('Export / import settings', 'ag-custom-admin'); ?>" for="agca_export_import"><?php _e('Export / import settings', 'ag-custom-admin'); ?></label>
3084
+ </th>
3085
+ <td id="import_file_area">
3086
+ <input class="agca_button" type="button" name="agca_export_settings" value="<?php _e('Export Settings', 'ag-custom-admin'); ?>" onclick="exportSettings();"/></br>
3087
+ <input type="file" id="settings_import_file" name="settings_import_file" style="display: none"/>
3088
+ <input type="hidden" id="_agca_import_settings" name="_agca_import_settings" value="false" />
3089
+ <input type="hidden" id="_agca_export_settings" name="_agca_export_settings" value="false" />
3090
+ <input class="agca_button" type="button" name="agca_import_settings" value="<?php _e('Import Settings', 'ag-custom-admin'); ?>" onclick="importSettings();"/>
3091
+ </td>
3092
+ </tr>
3093
+ </table>
3094
+ </div>
3095
+ <?php $this->show_save_button(); ?>
3096
+ </form>
3097
+ <form id="agca_templates_form" name="agca_templates_form" action="<?php echo htmlentities(get_site_url().$_SERVER['PHP_SELF']);?>?page=ag-custom-admin/plugin.php" method="post">
3098
+ <?php wp_nonce_field('agca_form','_agca_token'); ?>
3099
+ <input type="hidden" name="_agca_save_template" value="true" />
3100
+ <input type="hidden" id="templates_data" name="templates_data" value="" />
3101
+ <input type="hidden" id="templates_name" name="templates_name" value="" />
3102
+ </form>
3103
+ </div>
3104
+ <?php
3105
+ }
3106
+
3107
+ #region PRIVATE METHODS
3108
+ function show_save_button_upper(){
3109
+ ?>
3110
+ <div class="save-button-upper">
3111
+ <?php $this->show_save_button() ?>
3112
+ </div>
3113
+ <?php
3114
+ }
3115
+ function show_save_button(){
3116
+ ?>
3117
+ <p class="submit agca-clear">
3118
+ <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()" />
3119
+ </p>
3120
+ <?php
3121
+ }
3122
+
3123
+ function print_checkbox($data){
3124
+ $strAttributes = '';
3125
+ $strOnchange = '';
3126
+ $strInputClass='';
3127
+ $strInputAttributes='';
3128
+ $isChecked = false;
3129
+
3130
+ if(isset($data['attributes'])){
3131
+ foreach($data['attributes'] as $key=>$val){
3132
+ $strAttributes.=' '.$key.'="'.$val.'"';
3133
+ }
3134
+ }
3135
+ if(isset($data['input-class'])){
3136
+ $strInputClass = $data['input-class'];
3137
+ }
3138
+ if(isset($data['hide'])){
3139
+ $strInputClass .= " visibility";
3140
+ }
3141
+ if(isset($data['input-attributes'])){
3142
+ $strInputAttributes = $data['input-attributes'];
3143
+ }
3144
+ if(isset($data['onchange'])){
3145
+ $strOnchange = $data['onchange'];
3146
+ }
3147
+ if(!isset($data['title'])){
3148
+ $data['title'] = $data['label'];
3149
+ }
3150
+ if(isset($data['checked'])){
3151
+ $isChecked = $data['checked'];
3152
+ }else{
3153
+ //use default check with the option
3154
+ $isChecked = get_option($data['name'])==true;
3155
+ }
3156
+ ?>
3157
+ <tr valign="center" <?php echo $strAttributes ?> >
3158
+ <th>
3159
+ <label tabindex="0" title='<?php echo $data['title'] ?>' for="<?php echo $data['name'] ?>" ><?php echo $data['label'] ?></label>
3160
+ </th>
3161
+ <td>
3162
+ <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"':'' ?> />
3163
+ </td>
3164
+ </tr>
3165
+ <?php
3166
+ }
3167
+ function print_input($data){
3168
+ $strHint = '';
3169
+ $suffix ='';
3170
+ $strAttributes = '';
3171
+ $parentAttr = '';
3172
+ if(isset($data['hint'])){
3173
+ $strHint = '&nbsp;<p><i>'.$data['hint'].'</i></p>';
3174
+ }
3175
+ if(!isset($data['title'])){
3176
+ $data['title'] = $data['label'];
3177
+ }
3178
+ if(isset($data['suffix'])){
3179
+ $suffix = $data['suffix'];
3180
+ }
3181
+ if(isset($data['attributes'])){
3182
+ foreach($data['attributes'] as $key=>$val){
3183
+ $strAttributes.=' '.$key.'="'.$val.'"';
3184
+ }
3185
+ }
3186
+ ?>
3187
+ <tr valign="center" <?php echo $strAttributes ?> >
3188
+ <th >
3189
+ <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3190
+ </th>
3191
+ <td>
3192
+ <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']); ?>" />
3193
+ <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 ?>
3194
+ <?php echo $strHint ?>
3195
+ </td>
3196
+ </tr>
3197
+ <?php
3198
+ }
3199
+ function print_textarea($data){
3200
+ $strHint = '';
3201
+ $strClass = '';
3202
+ if(isset($data['hint'])){
3203
+ $strHint = '&nbsp;<p><i>'.$data['hint'].'</i>.</p>';
3204
+ }
3205
+ if(!isset($data['title'])){
3206
+ $data['title'] = $data['label'];
3207
+ }
3208
+ if(isset($data['class'])){
3209
+ $strClass = $data['class'];
3210
+ }
3211
+ ?>
3212
+ <tr valign="center">
3213
+ <th scope="row">
3214
+ <label title="<?php echo $data['title'] ?>" for="<?php echo $data['name'] ?>"><?php echo $data['label'] ?></label>
3215
+ </th>
3216
+ <td>
3217
+ <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>
3218
+ <?php echo $strHint ?>
3219
+ </td>
3220
+ </tr>
3221
+ <?php
3222
+ }
3223
+ function print_color($name, $label, $title){
3224
+ ?>
3225
+ <tr valign="center" class="color">
3226
+ <th><label title="<?php echo $title ?>" for="<?php echo $name ?>"><?php echo $label ?></label></th>
3227
+ <td><input type="text" placeholder="#" id="<?php echo $name ?>" name="<?php echo $name ?>" class="color_picker" value="<?php echo $this->getAGCAColor($name); ?>" />
3228
+ <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>
3229
+ <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>
3230
+ </td>
3231
+ </tr>
3232
+ <?php
3233
+ }
3234
+ function print_options_h3($title){
3235
+ ?>
3236
+ <tr valign="center">
3237
+ <td colspan="2">
3238
+ <div class="ag_table_heading"><h3 tabindex="0"><?php echo $title ?></h3></div>
3239
+ </td>
3240
+ <td></td>
3241
+ </tr>
3242
+ <?php
3243
+ }
3244
+ function print_option_tr(){
3245
+ ?>
3246
+
3247
+ <tr valign="center">
3248
+ <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>
3249
+ <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'); ?>" />
3250
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button agca_button" value="<?php _e('Pick color', 'ag-custom-admin'); ?>" />
3251
+ <input type="button" alt="color_admin_menu_submenu_background" class="pick_color_button_clear agca_button" value="<?php _e('Clear', 'ag-custom-admin'); ?>" />
3252
+ </td>
3253
+ </tr>
3254
+ <?php
3255
+ }
3256
+ #endregion
3257
+
3258
+ }
3259
  //TODO: Add log out button to the admin menu
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Absolutely Glamorous Custom Admin ===
2
  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.6.1
7
- Stable tag: 6.6.3
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
@@ -41,19 +41,19 @@ With this plugin you can easily customize WordPress **admin panel**, **login pag
41
  * Hide site name
42
  * Hide admin bar logo context menu
43
  * Hide update notifications block
44
- * Hide "Comments" block
45
- * Hide "New" menu block
46
- * Hide "New" -> "Post"
47
- * Hide "New" -> "Link"
48
- * Hide "New" -> "Page"
49
- * Hide "New" -> "User"
50
- * Hide "New" -> "Media"
51
  * Change site name to custom text
52
  * Hide yellow WordPress update notification
53
  * Change Howdy text
54
  * Change Log Out text
55
- * Remove "Edit My Profile" option from context menu
56
- * Show "Log Out" button only on the right
57
 
58
  = Admin Footer Options =
59
  * Hide footer completely
@@ -83,7 +83,7 @@ With this plugin you can easily customize WordPress **admin panel**, **login pag
83
  * Remove spaces between admin menu buttons
84
  * Remove admin menu arrow on hover
85
  * Round admin sub-menu popups
86
- * Remove "Collapse" button
87
  * Add custom branding image above the admin menu
88
  * Add custom link to branding image
89
  * Change admin menu auto-folding settings
@@ -145,6 +145,11 @@ If you have the latest WordPress and plugin versions and you still experience so
145
 
146
  == Change Log ==
147
 
 
 
 
 
 
148
  = 6.6.3 =
149
  * WP 5.6.1 compatibility
150
  * Round options improvements
@@ -579,6 +584,10 @@ If you have the latest WordPress and plugin versions and you still experience so
579
 
580
  == Upgrade Notice ==
581
 
 
 
 
 
582
  = 6.6.3 =
583
  * WP 5.6 compatibility and rounding options improvements
584
 
@@ -844,4 +853,4 @@ Added settings for fully customization of admin menus.
844
  Better explanations in Settings page. No changes in functionality.
845
 
846
  = 1.0 =
847
- Initial version.
1
  === Absolutely Glamorous Custom Admin ===
2
  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, admin bar, login page, admin menu, colors
5
  Requires at least: 3.0
6
+ Tested up to: 5.7
7
+ Stable tag: 6.7
8
  License: GPLv3 or later
9
  License URI: https://www.gnu.org/licenses/gpl.txt
10
 
41
  * Hide site name
42
  * Hide admin bar logo context menu
43
  * Hide update notifications block
44
+ * Hide **Comments** block
45
+ * Hide **New** menu block
46
+ * Hide **New** > **Post**
47
+ * Hide **New** > **Link**
48
+ * Hide **New** > **Page**
49
+ * Hide **New** > **User**
50
+ * Hide **New** > **Media**
51
  * Change site name to custom text
52
  * Hide yellow WordPress update notification
53
  * Change Howdy text
54
  * Change Log Out text
55
+ * Remove **Edit My Profile** option from context menu
56
+ * Show **Log Out** button only on the right
57
 
58
  = Admin Footer Options =
59
  * Hide footer completely
83
  * Remove spaces between admin menu buttons
84
  * Remove admin menu arrow on hover
85
  * Round admin sub-menu popups
86
+ * Remove **Collapse** button
87
  * Add custom branding image above the admin menu
88
  * Add custom link to branding image
89
  * Change admin menu auto-folding settings
145
 
146
  == Change Log ==
147
 
148
+ = 6.7 =
149
+ * WP 5.7 compatibility
150
+ * New AGCA brand
151
+ * Improved admin UX
152
+
153
  = 6.6.3 =
154
  * WP 5.6.1 compatibility
155
  * Round options improvements
584
 
585
  == Upgrade Notice ==
586
 
587
+ = 6.7 =
588
+ * WP 5.7 compatibility
589
+ * New AGCA brand and improved admin UX
590
+
591
  = 6.6.3 =
592
  * WP 5.6 compatibility and rounding options improvements
593
 
853
  Better explanations in Settings page. No changes in functionality.
854
 
855
  = 1.0 =
856
+ Initial version.
require/dynamic.php CHANGED
@@ -1,115 +1,115 @@
1
- <?php
2
-
3
- // If using the default WordPress file structure
4
- if (file_exists('../../../../wp-load.php')) {
5
- // Make WordPress functions and methods available
6
- require '../../../../wp-load.php';
7
-
8
- // If using alternative WordPress file structure like Roots' Bedrock
9
- } else {
10
- // WP's constant ABSPATH is not available, so use $_SERVER['DOCUMENT_ROOT'] to get the web root
11
- $directory = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT']);
12
-
13
- // Recursively search web root for wp-load.php
14
- foreach (new RecursiveIteratorIterator($directory) as $file) {
15
- // wp-load.php found, require and break loop
16
- if ($file->getFilename() === 'wp-load.php') {
17
- // Make WordPress functions and methods available
18
- require $file->getPathname();
19
- break;
20
- }
21
- }
22
- }
23
-
24
- $themes = get_option('agca_templates');
25
- $selectedTheme = get_option('agca_selected_template');
26
- $type = "";
27
- $optionName = "";
28
- $agcaContext = "";
29
-
30
- if(isset($_GET["type"])){
31
- $type = $_GET["type"];
32
- }
33
- if(isset($_GET["context"])){
34
- $agcaContext = $_GET["context"];
35
- }
36
-
37
- if ( $agcaContext != "login" && !is_user_logged_in()) {
38
- die();
39
- }
40
-
41
- if($type == "css"){
42
- header('Content-type: text/css');
43
- $optionName = ($agcaContext == "login")? "logincss":"admincss";
44
-
45
- }else if($type == "js"){
46
- header('Content-type: application/javascript');
47
- $optionName = ($agcaContext == "login")? "loginjs":"adminjs";
48
- }
49
- if($type == "css" || $type == "js"){
50
- if(isset($themes[$selectedTheme])){
51
- $theme = $themes[$selectedTheme];
52
- $admin_capability = get_option('agca_admin_capability');
53
- if($admin_capability == ""){
54
- $admin_capability = "edit_dashboard";
55
- }
56
- if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($admin_capability )))){
57
- $adminscript = $theme[$optionName];
58
- $settings = $theme['settings'];
59
- if($settings == "" || $settings == " ") $settings = "{}";
60
- $adminscript = agcaAppendSettingsToAGCATemplateCustomizations($adminscript, $settings);
61
- $admindata = agcaEnableSpecificWPVersionCustomizations($admindata);
62
- $admindata = agcaRemoveCSSComments($admindata);
63
-
64
- echo $adminscript;
65
- }
66
- }
67
- }
68
-
69
- //print_r($themes); print_r($selectedTheme); die;
70
- die;
71
-
72
-
73
- function agcaEnableSpecificWPVersionCustomizations($customizations){
74
- /*enable special CSS for this WP version*/
75
- $ver = agcat_get_wp_version();
76
- $customizations = str_replace("/*".$ver," ", $customizations);
77
- $customizations = str_replace($ver."*/"," ", $customizations);
78
- return $customizations;
79
- }
80
- function agcat_get_wp_version(){
81
- global $wp_version;
82
- $array = explode('-', $wp_version);
83
- $version = $array[0];
84
- return $version;
85
- }
86
- function agcaAppendSettingsToAGCATemplateCustomizations($customizations, $settings){
87
- $template_settings = json_decode($settings);
88
- //print_r($template_settings);
89
- foreach($template_settings as $sett){
90
- $key = $sett->code;
91
-
92
- //use default value if user's value is not set
93
- $value="";
94
- if($sett->value != ""){
95
- $value = $sett->value;
96
- }else{
97
- $value = $sett->default_value;
98
- }
99
-
100
- //Prepare settings
101
- if($sett->type == 6){
102
- if($value !== null && (strtolower($value) == "on" || $value == "1")){
103
- $value = "true";
104
- }else{
105
- $value = "false";
106
- }
107
- }
108
- $customizations = str_replace("%".$key."%",$value, $customizations);
109
- }
110
- return $customizations;
111
- }
112
- function agcaRemoveCSSComments($customizations){
113
- $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
114
- return $customizations;
115
  }
1
+ <?php
2
+
3
+ // If using the default WordPress file structure
4
+ if (file_exists('../../../../wp-load.php')) {
5
+ // Make WordPress functions and methods available
6
+ require '../../../../wp-load.php';
7
+
8
+ // If using alternative WordPress file structure like Roots' Bedrock
9
+ } else {
10
+ // WP's constant ABSPATH is not available, so use $_SERVER['DOCUMENT_ROOT'] to get the web root
11
+ $directory = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT']);
12
+
13
+ // Recursively search web root for wp-load.php
14
+ foreach (new RecursiveIteratorIterator($directory) as $file) {
15
+ // wp-load.php found, require and break loop
16
+ if ($file->getFilename() === 'wp-load.php') {
17
+ // Make WordPress functions and methods available
18
+ require $file->getPathname();
19
+ break;
20
+ }
21
+ }
22
+ }
23
+
24
+ $themes = get_option('agca_templates');
25
+ $selectedTheme = get_option('agca_selected_template');
26
+ $type = "";
27
+ $optionName = "";
28
+ $agcaContext = "";
29
+
30
+ if(isset($_GET["type"])){
31
+ $type = $_GET["type"];
32
+ }
33
+ if(isset($_GET["context"])){
34
+ $agcaContext = $_GET["context"];
35
+ }
36
+
37
+ if ( $agcaContext != "login" && !is_user_logged_in()) {
38
+ die();
39
+ }
40
+
41
+ if($type == "css"){
42
+ header('Content-type: text/css');
43
+ $optionName = ($agcaContext == "login")? "logincss":"admincss";
44
+
45
+ }else if($type == "js"){
46
+ header('Content-type: application/javascript');
47
+ $optionName = ($agcaContext == "login")? "loginjs":"adminjs";
48
+ }
49
+ if($type == "css" || $type == "js"){
50
+ if(isset($themes[$selectedTheme])){
51
+ $theme = $themes[$selectedTheme];
52
+ $admin_capability = get_option('agca_admin_capability');
53
+ if($admin_capability == ""){
54
+ $admin_capability = "edit_dashboard";
55
+ }
56
+ if(!((get_option('agca_role_allbutadmin')==true) and (current_user_can($admin_capability )))){
57
+ $adminscript = $theme[$optionName];
58
+ $settings = $theme['settings'];
59
+ if($settings == "" || $settings == " ") $settings = "{}";
60
+ $adminscript = agcaAppendSettingsToAGCATemplateCustomizations($adminscript, $settings);
61
+ $admindata = agcaEnableSpecificWPVersionCustomizations($admindata);
62
+ $admindata = agcaRemoveCSSComments($admindata);
63
+
64
+ echo $adminscript;
65
+ }
66
+ }
67
+ }
68
+
69
+ //print_r($themes); print_r($selectedTheme); die;
70
+ die;
71
+
72
+
73
+ function agcaEnableSpecificWPVersionCustomizations($customizations){
74
+ /*enable special CSS for this WP version*/
75
+ $ver = agcat_get_wp_version();
76
+ $customizations = str_replace("/*".$ver," ", $customizations);
77
+ $customizations = str_replace($ver."*/"," ", $customizations);
78
+ return $customizations;
79
+ }
80
+ function agcat_get_wp_version(){
81
+ global $wp_version;
82
+ $array = explode('-', $wp_version);
83
+ $version = $array[0];
84
+ return $version;
85
+ }
86
+ function agcaAppendSettingsToAGCATemplateCustomizations($customizations, $settings){
87
+ $template_settings = json_decode($settings);
88
+ //print_r($template_settings);
89
+ foreach($template_settings as $sett){
90
+ $key = $sett->code;
91
+
92
+ //use default value if user's value is not set
93
+ $value="";
94
+ if($sett->value != ""){
95
+ $value = $sett->value;
96
+ }else{
97
+ $value = $sett->default_value;
98
+ }
99
+
100
+ //Prepare settings
101
+ if($sett->type == 6){
102
+ if($value !== null && (strtolower($value) == "on" || $value == "1")){
103
+ $value = "true";
104
+ }else{
105
+ $value = "false";
106
+ }
107
+ }
108
+ $customizations = str_replace("%".$key."%",$value, $customizations);
109
+ }
110
+ return $customizations;
111
+ }
112
+ function agcaRemoveCSSComments($customizations){
113
+ $customizations = preg_replace('#/\*.*?\*/#si','',$customizations);
114
+ return $customizations;
115
  }
script/ag_script.js CHANGED
@@ -1,942 +1,948 @@
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.attr('checked') === "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(isNowChecked){
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
+
383
+ var tipY = e.pageY + 16;
384
+ var tipX = e.pageX + 16;
385
+
386
+ if(window.innerWidth - tipX < 300) {
387
+ tipX -= 150;
388
+ }
389
+
390
+ jQuery("#AGToolTipDiv").css({
391
+ 'top': tipY,
392
+ 'left': tipX,
393
+ 'background': '#efefef',
394
+ 'border': '1px solid #826c63'
395
+ });
396
+ });
397
+ }
398
+ jQuery("#AGToolTipDiv")
399
+ .html(jQuery(this).attr('title'))
400
+ .stop(true,true)
401
+ .fadeIn("fast");
402
+ jQuery(this).removeAttr('title');
403
+ }, function() {
404
+ jQuery("#AGToolTipDiv")
405
+ .stop(true,true)
406
+ .fadeOut("fast", function(){
407
+ jQuery(this).css({
408
+ 'color': '',
409
+ 'border': '',
410
+ 'font-weight':''
411
+ });
412
+ })
413
+
414
+ jQuery(this).attr('title', jQuery("#AGToolTipDiv").html());
415
+ });
416
+ }
417
+ }
418
+
419
+ jQuery(document).ready(function(){
420
+ /*Add click handler on main buttons*/
421
+ jQuery('#ag_main_menu a, #ag_main_menu li').bind('click',function(e){
422
+ if(jQuery(e.target).is('li')){
423
+ var hash = jQuery(this).find('a:first').attr('href');
424
+ document.location.hash = hash;
425
+ };
426
+ hideAllSections();
427
+ var text = jQuery(this).text();
428
+ jQuery(this).removeClass('normal').addClass("selected");
429
+ showHideSection(text);
430
+ });
431
+
432
+ /*Admin Menu Reset all setings button*/
433
+ jQuery('#ag_edit_adminmenu_reset_button').click(function(){
434
+ afterFormClickCreateJson = false;
435
+ jQuery('#agca_form').submit();
436
+ });
437
+
438
+ /*Add new menu item button - creates new HTMl button elements*/
439
+ jQuery('#ag_add_adminmenu_button').click(function(){
440
+ var name = jQuery('#ag_add_adminmenu_name').val();
441
+ var url = jQuery('#ag_add_adminmenu_url').val();
442
+ var target = jQuery('#ag_add_adminmenu_target').val();
443
+ name = name.replace(/["']{1}/gi,"");
444
+ url = url.replace(/["']{1}/gi,"");
445
+ jQuery('#ag_add_adminmenu_name').val("");
446
+ jQuery('#ag_add_adminmenu_url').val("");
447
+ jQuery('#ag_add_adminmenu_target').val("_self");
448
+ 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>');
449
+ reloadRemoveButtonEvents();
450
+ });
451
+
452
+ /*Add tooltip box*/
453
+ jQuery("body").append("<div id='AGToolTipDiv'></div>");
454
+
455
+ /*ToolTip*/
456
+ jQuery("label[title],.agca-donate-btn, li.upgrade a, a.feedback").each(agcaApplyTooltip);
457
+
458
+ /*SECTION FOCUS*/
459
+ jQuery('.section_title').focus(function(){
460
+ });
461
+
462
+
463
+ //check hashtag
464
+ if(document.location.hash !== ""){
465
+ jQuery("#ag_main_menu a[href='"+window.location.hash+"']").trigger('click')
466
+ };
467
+
468
+ if(typeof isCusminActive !== 'undefined' && isCusminActive){
469
+ hideAllSections();
470
+ jQuery('#section_templates, #section-cusmin').show();
471
+ if(typeof agca_client_init === 'function'){
472
+ agca_client_init();
473
+ }
474
+ }
475
+
476
+ });
477
+
478
+ jQuery(function($){
479
+ /*Admin menu*/
480
+ jQuery('#adminmenu').css('display','block');
481
+
482
+ /*FORM SUBMITTED*/
483
+ jQuery('#agca_form').submit(function(){
484
+ processData();
485
+ return true;
486
+ });
487
+
488
+ //on radio button text click
489
+ jQuery('.agca-radio-text').on('click', function(){
490
+ var $o = jQuery(this);
491
+ var type = 'off';
492
+ if($o.hasClass('on')){
493
+ type='on';
494
+ }
495
+ $o.parent().find('.agca-radiobox[value='+type+']').trigger('click');
496
+ });
497
+
498
+ //Colorizer update input text colors
499
+ colorizerColorizeTextboxes();
500
+ });
501
+
502
+
503
+ function processEditAdminMenu(){
504
+ var array = {};
505
+
506
+ //top menus
507
+ jQuery('#ag_edit_adminmenu tr.top').each(function(){
508
+ var $tr = jQuery(this);
509
+ var originalText = $tr.find('.ag_admin_menu_parent a').text();
510
+ var newText = $tr.find('.ag_admin_menu_parent2 input').val();
511
+ var remove = $tr.find('.agca-checkbox').is(':checked');
512
+ var url = $tr.data('url');
513
+ array[url]={
514
+ 'name': originalText,
515
+ 'new': newText || "",
516
+ 'remove':remove,
517
+ 'url':url,
518
+ 'submenus':{}
519
+ };
520
+ });
521
+
522
+ //submenus
523
+ jQuery('#ag_edit_adminmenu tr.sub').each(function(){
524
+ var $tr = jQuery(this);
525
+ var newText = $tr.find('.ag_admin_menu_child2 input').val();
526
+ var remove = $tr.find('.agca-checkbox').is(':checked');
527
+ var url = $tr.data('url');
528
+ var index = $tr.data('index');
529
+ var parentIndex = $tr.data('parent');
530
+ var originalName = $tr.data('name');
531
+ array[parentIndex]['submenus'][index]={
532
+ 'name': originalName,
533
+ 'new': newText || "",
534
+ 'remove':remove,
535
+ 'url':url
536
+ };
537
+ });
538
+ return array;
539
+ }
540
+
541
+ function processData(){
542
+
543
+ //serialize admin menu edit configuration
544
+ var array = processEditAdminMenu();
545
+ if(afterFormClickCreateJson == true){
546
+ jQuery('#ag_edit_adminmenu_json_new').val(JSON.stringify(array));
547
+ }else{
548
+ jQuery('#ag_edit_adminmenu_json_new').val('');
549
+ }
550
+
551
+ //serialize buttons
552
+ array = "{";
553
+ var element = 0;
554
+ jQuery('#ag_add_adminmenu :button').each(function(){
555
+ //console.log(jQuery(this).html()+jQuery(this).attr('title'));
556
+ if(element > 0){
557
+ if(element > 1){
558
+ array += ", ";
559
+ }
560
+ array += "\"" + jQuery(this).html() + "\" : {";
561
+ array += " \"value\" : ";
562
+ array += "\"" + jQuery(this).attr('title') + "\"";
563
+ array += ", \"target\" : ";
564
+ array += "\"" + jQuery(this).attr('target') + "\"}";
565
+ }
566
+ element++;
567
+ });
568
+ array += "}";
569
+ if(element == 1){
570
+ array="";
571
+ }
572
+ jQuery('#ag_add_adminmenu_json').val(array);
573
+
574
+
575
+
576
+ /*Serialize colors*/
577
+ var array = "{";
578
+ var firstElement = true;
579
+ var topMarker = "";
580
+ jQuery('input.color_picker').each(function(){
581
+ if(firstElement != true){
582
+ array += ", ";
583
+ }
584
+ array += "\"" + jQuery(this).attr('id') + "\" : ";
585
+ array += "\"" + jQuery(this).val() + "\"";
586
+ firstElement = false;
587
+ });
588
+ array += "}";
589
+
590
+ if(!isSettingsImport){
591
+ jQuery('#ag_colorizer_json').val(array);
592
+ }
593
+ }
594
+
595
+ function agca_escapeHTMLChars(str){
596
+ return str
597
+ .replace(/&/g, '&amp;')
598
+ .replace(/'/g, '&#39;')
599
+ .replace(/"/g, '&quot;');
600
+ }
601
+
602
+ function agca_escapeChars(str){
603
+ return str.replace(/[\/\\\"\']/g, "\\$&");
604
+ //return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
605
+ }
606
+
607
+ /*C O L O R I Z E R*/
608
+ function updateTargetColor(id, color){
609
+ switch(id)
610
+ {
611
+ case 'color_background':
612
+ jQuery('html, .wp-dialog, #wpwrap').css({
613
+ 'background-color':color
614
+ });
615
+ break;
616
+ case 'login_color_background':
617
+ jQuery('body.login').css({
618
+ 'background-color':color
619
+ });
620
+ break;
621
+
622
+ case 'color_header':
623
+ jQuery('#wphead').css({
624
+ 'background':color
625
+ });
626
+
627
+ //wp > 3.3
628
+ jQuery('#wpadminbar').css({'background':color});
629
+ jQuery('#wpadminbar .ab-top-menu').css({'background':color});
630
+ jQuery('#wphead').css({
631
+ 'margin':'0',
632
+ 'margin-left':'-14px',
633
+ 'padding-left':'15px'
634
+ });
635
+ jQuery("#backtoblog").attr("style","");
636
+ break;
637
+ case 'color_admin_menu_top_button_background':
638
+ jQuery('#adminmenu a.menu-top').css({
639
+ 'background':color
640
+ });
641
+ jQuery('#adminmenu li.menu-top').css({
642
+ 'background':color
643
+ });
644
+ break;
645
+ case 'color_admin_menu_top_button_current_background':
646
+ jQuery('#adminmenu li.menu-top.wp-menu-open a.menu-top').css({
647
+ 'background':color
648
+
649
+ });
650
+ jQuery('#adminmenu li.menu-top.current a.menu-top').css({
651
+ 'background':color
652
+ });
653
+ jQuery('body.folded #adminmenu li.menu-top.wp-menu-open').css({
654
+ 'background':color
655
+ });
656
+ break;
657
+ case 'color_admin_menu_top_button_hover_background':
658
+ if(color == "")break;
659
+ var selector = '#adminmenu a.menu-top';
660
+ if(jQuery('body').hasClass('folded')){
661
+ selector = '#adminmenu li.menu-top';
662
+ }
663
+ var originalBackground = jQuery(selector).css('background-color');
664
+
665
+ //if first is selected, use second
666
+ if((jQuery(selector+":eq(0)").hasClass('current') || jQuery(selector+":eq(0)").hasClass('wp-has-current-submenu'))){
667
+ originalBackground = jQuery(selector+':eq(1)').css('background-color');
668
+ }
669
+ jQuery(selector).mouseover(function(){
670
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
671
+ jQuery(this).css({'background':color});
672
+ }
673
+ }).mouseout(function(){
674
+ if(!(jQuery(this).hasClass('current') || jQuery(this).hasClass('wp-has-current-submenu'))){
675
+ jQuery(this).css('background',originalBackground);
676
+ }
677
+ });
678
+
679
+ //for folded menu
680
+
681
+
682
+ break;
683
+ case 'color_admin_menu_submenu_background':
684
+ // jQuery("#adminmenu li.wp-has-current-submenu").removeClass("wp-has-current-submenu");
685
+ jQuery('#adminmenu .wp-submenu.sub-open').remove();
686
+ jQuery('#adminmenu .wp-submenu a, #adminmenu li.wp-has-current-submenu .wp-submenu a').each(function(){
687
+ jQuery(this).css({
688
+ 'background':color
689
+ });
690
+ });
691
+ jQuery('#adminmenu .wp-submenu').css({'background':color,'margin-left':'0',"padding-top":roundedSidberSize+"px","padding-bottom":roundedSidberSize+"px"});
692
+ jQuery('#adminmenu .wp-has-current-submenu .wp-submenu').css("padding","0");
693
+ //jQuery('#adminmenu .wp-submenu').css('border','3px solid red');
694
+ jQuery('#adminmenu .wp-submenu ul').css({'background':'none'});
695
+ jQuery('#adminmenu .wp-submenu ul').css('border','none');
696
+ jQuery('#adminmenu .wp-submenu .wp-submenu-wrap').css('border','none');
697
+
698
+ break;
699
+ case 'color_admin_submenu_font':
700
+ jQuery('#adminmenu .wp-submenu li a').css('color',color);
701
+ break;
702
+ case 'color_admin_menu_font':
703
+ jQuery('#adminmenu, #adminmenu a, #adminmenu p').css({
704
+ 'color':color
705
+ });
706
+ break;
707
+ case 'color_admin_menu_behind_background':
708
+ jQuery('#adminmenuback, #adminmenuwrap').css({
709
+ 'background-color':color
710
+ });
711
+ break;
712
+ case 'color_admin_menu_submenu_background_hover':
713
+ var submenuSelector = '#adminmenu .wp-submenu a';
714
+ var originalSubBackground = jQuery(submenuSelector).css('background-color');
715
+ jQuery(submenuSelector).mouseover(function(){
716
+ jQuery(this).css({
717
+ 'background':color
718
+ });
719
+ }).mouseout(function(){
720
+ jQuery(this).css('background',originalSubBackground);
721
+ });
722
+ //jQuery('#adminmenu .wp-submenu a:hover').css({'background':color});
723
+ break;
724
+ case 'color_font_content':
725
+ jQuery('#wpbody-content, #wpbody-content label, #wpbody-content p,#wpbody-content .form-table th, #wpbody-content .form-wrap label').css({
726
+ 'color':color
727
+ });
728
+ break;
729
+ case 'color_font_header':
730
+ jQuery('#wphead, #wphead a, #wpadminbar a, #wpadminbar span').css({
731
+ 'color':color
732
+ });
733
+ break;
734
+ case 'color_font_footer':
735
+ jQuery('#wpfooter, #wpfooter a').css({
736
+ 'color':color
737
+ });
738
+ break;
739
+ case 'color_widget_bar':
740
+ jQuery(".widget .widget-top, .postbox h3, .stuffbox h3").css({
741
+ 'background' : color,
742
+ 'text-shadow' :'none'
743
+ });
744
+ break;
745
+ case 'color_widget_background':
746
+ jQuery(".widget, .postbox").css('background',color);
747
+ //jQuery(".widget, #widget-list .widget-top, .postbox, .menu-item-settings").css('background',color); remove if <3.2 work
748
+ break;
749
+ default:
750
+ }
751
+ }
752
+ function updateColor(id,color){
753
+ jQuery("#"+id).css({
754
+ 'background-color':color
755
+ });
756
+ jQuery("#"+id).val(color);
757
+ if(isDarker(color) == true){
758
+ jQuery("#"+id).css('color','#ffffff');
759
+ }else{
760
+ jQuery("#"+id).css('color','#000000');
761
+ }
762
+ updateTargetColor(id,color);
763
+ }
764
+ /*First load apply colours from fields*/
765
+
766
+ /*C O L O R I Z E R E N D*/
767
+
768
+ /*A J A X*/
769
+ jQuery(document).ready(function(){
770
+
771
+ //Ams
772
+ if(typeof isAGCAPage !== 'undefined'){
773
+ if(isAGCAPage == true){
774
+ return false;
775
+ //alert('admin page');
776
+ var url="";
777
+ jQuery.getJSON(
778
+ url,{
779
+ wp_ver: wpversion,
780
+ agca_ver: agca_version,
781
+ format: "json"
782
+ },
783
+ function(json){
784
+ jQuery.each(json,function(i,post){
785
+ jQuery('#agca_advertising ul').append('<li><a target="_blank" href="https://cusmin.com/?id=' + post.id + '" ><img height=\"100px\" src=\"'+post.src+'\" title=\"'+post.title+'\" /></a></li>');
786
+ });
787
+ jQuery('#agca_advertising').show();
788
+
789
+ });
790
+ }
791
+ }
792
+ });
793
+ /*A J A X*/
794
+
795
+ /*AGCA CHECKBOX RADIOBOX*/
796
+ function agcaCheckBoxOnClick(obj){
797
+ var isNowChecked = false;
798
+ var $input = jQuery(obj).prev();
799
+ if($input.attr('checked') === "checked"){
800
+ $input.removeAttr('checked');
801
+ }else{
802
+ isNowChecked = true;
803
+ $input.attr('checked','checked');
804
+ }
805
+
806
+ if($input.hasClass('has-dependant')){
807
+ var dependantSel = $input.data('dependant');
808
+ var isOppositeToggle = $input.hasClass('dependant-opposite');
809
+
810
+ if(isNowChecked && !isOppositeToggle || !isNowChecked && isOppositeToggle){
811
+ jQuery(dependantSel).show("slide");
812
+ }else{
813
+ jQuery(dependantSel).hide("slideDown");
814
+ }
815
+ }
816
+
817
+ //console.log(obj.prev());
818
+ if(isNowChecked){
819
+ jQuery(obj).addClass('agca-checkbox-box-checked');
820
+ jQuery(obj).removeClass('agca-checkbox-box');
821
+ }else{
822
+ jQuery(obj).addClass('agca-checkbox-box');
823
+ jQuery(obj).removeClass('agca-checkbox-box-checked');
824
+ }
825
+ }
826
+ function agcaRadioBoxOnClick(obj){
827
+ obj.prev().trigger('click');
828
+ //console.log(obj.prev());
829
+ obj.parent().find('.agca-radiobox').removeClass('checked');
830
+ if(jQuery(obj).prev().is(':checked')){
831
+ jQuery(obj).addClass('checked');
832
+ }else{
833
+ jQuery(obj).removeClass('checked');
834
+ }
835
+ }
836
+ function agcaChangeCheckBoxStyles(){
837
+ /*checkbox*/
838
+ jQuery('.agca-checkbox-box-checked').remove();
839
+ jQuery('.agca-checkbox-box').remove();
840
+ jQuery('.agca-checkbox').each(function(){
841
+ jQuery(this).hide();
842
+ var cls = "agca-checkbox-box";
843
+ if(jQuery(this).is(':checked')){
844
+ cls = "agca-checkbox-box-checked";
845
+ }
846
+ if(jQuery(this).hasClass('visibility')){
847
+ cls +=' visibility';
848
+ }
849
+ jQuery(this).after('<div onClick="agcaCheckBoxOnClick(jQuery(this));" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
850
+ });
851
+
852
+ /*radio*/
853
+ jQuery('.agca-radiobox').remove();
854
+ jQuery('.agca-radio').each(function(){
855
+ jQuery(this).hide();
856
+ var cls = "agca-radiobox";
857
+ if(jQuery(this).is(':checked')){
858
+ cls = "agca-radiobox checked";
859
+ }
860
+
861
+ jQuery(this).after('<div onClick="agcaRadioBoxOnClick(jQuery(this));" value="'+jQuery(this).attr('value')+'" class="' + cls + '" title="'+jQuery(this).attr('title')+'"><div/>');
862
+ });
863
+ }
864
+
865
+ function isWPHigherOrEqualThan(targetVersion){
866
+ //remove sufixes, beta RC etc
867
+ if (wpversion.indexOf("-")!=-1){
868
+ var parts = wpversion.split("-");
869
+ wpversion = parts[0];
870
+ }
871
+ var currentVersion = parseFloat(wpversion);
872
+ targetVersion = parseFloat(targetVersion);
873
+
874
+ return (wpversion >= targetVersion);
875
+ }
876
+
877
+ function colorizerColorizeTextboxes(){
878
+ jQuery('#section_ag_colorizer_settings .color_picker').each(function(){
879
+ var $o = jQuery(this);
880
+ $o.css('background-color', $o.val());
881
+ $o.lightOrDark();
882
+ if($o.hasClass('dark')){
883
+ $o.css('color','#fff');
884
+ }else{
885
+ $o.css('color','#000');
886
+ }
887
+ });
888
+ }
889
+
890
+
891
+ //VALIDATION
892
+ jQuery(document).ready(function() {
893
+ jQuery(".validateNumber").on('keydown',function(event) {
894
+ // Allow only backspace and delete
895
+ var limit = jQuery(this).attr('limit');
896
+ var value = jQuery(this).val();
897
+
898
+ if ( event.keyCode == 46 || event.keyCode == 8 ) {
899
+ } else {
900
+ if((typeof(limit) != undefined) && value.length >= limit){
901
+ return false;
902
+ }
903
+ if (event.keyCode < 95) {
904
+ if (event.keyCode < 48 || event.keyCode > 57 ) {
905
+ event.preventDefault();
906
+ }
907
+ } else {
908
+ if (event.keyCode < 96 || event.keyCode > 105 ) {
909
+ event.preventDefault();
910
+ }
911
+ }
912
+ }
913
+ });
914
+ });
915
+
916
+ (function($){
917
+
918
+ $.fn.lightOrDark = function(){
919
+ var r,b,g,hsp
920
+ , a = this.css('background-color');
921
+
922
+ if (a.match(/^rgb/)) {
923
+ a = a.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);
924
+ r = a[1];
925
+ g = a[2];
926
+ b = a[3];
927
+ } else {
928
+ a = +("0x" + a.slice(1).replace( // thanks to jed : http://gist.github.com/983661
929
+ a.length < 5 && /./g, '$&$&'
930
+ )
931
+ );
932
+ r = a >> 16;
933
+ b = a >> 8 & 255;
934
+ g = a & 255;
935
+ }
936
+ hsp = Math.sqrt( // HSP equation from http://alienryderflex.com/hsp.html
937
+ 0.299 * (r * r) +
938
+ 0.587 * (g * g) +
939
+ 0.114 * (b * b)
940
+ );
941
+ if (hsp>127.5) {
942
+ this.addClass('light');
943
+ } else {
944
+ this.addClass('dark');
945
+ }
946
+ }
947
+
948
  })(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,887 +1,1142 @@
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
- line-height: 1.5;
297
- min-width: 130px;
298
- padding-left: 7px !important;
299
- }
300
- #agca_form a{
301
- font-weight: bold;
302
- color: #826c63;
303
- }
304
- #agca_form a:hover{
305
- color: #6d6764;
306
- }
307
- #agca_form h2.section_title {
308
-
309
- }
310
-
311
- #agca_form h2.section_title {
312
- font-weight: bold;
313
- font-size: 45px;
314
- line-height: 1em;
315
- }
316
-
317
- #agca_form h2.section_title {
318
- color: #e85e3a;
319
- }
320
-
321
- /* Don't show shadows when selecting text */
322
- #agca_form h2.section_title::-moz-selection {
323
- background: #5af;
324
- color: #fff;
325
- text-shadow: none;
326
- }
327
-
328
- #agca_form h2.section_title::selection {
329
- background: #5af;
330
- color: #fff;
331
- text-shadow: none;
332
- }
333
-
334
- #agca_form #templates_head_buttons input[type=button] {
335
- background: #826c63;
336
- color: white;
337
- font-weight: bold;
338
- }
339
-
340
- #agca_form #templates_head_buttons input[type=button]:hover {
341
- background: white;
342
- color: #6d6764;
343
- }
344
-
345
- .ag-custom-button {
346
-
347
- /* margin-bottom:-4px !important;*/
348
- }
349
-
350
- #sidebar_adminmenu_logo {
351
- margin-bottom: -33px;
352
- min-height: 28px;
353
- cursor: pointer;
354
- }
355
-
356
- .agcaMenuEditorPlusMinus .plus {
357
- padding-right: 4px;
358
- display: inline;
359
- }
360
-
361
- .agcaMenuEditorPlusMinus .minus {
362
- padding-right: 4px;
363
- display: none;
364
- }
365
-
366
- .agcaMenuEditorPlusMinus .dashicons:before {
367
- font-size: 25px;
368
- line-height: 22px;
369
- display: inline-block;
370
- }
371
-
372
- .agcaMenuEditorPlusMinus {
373
- float: left;
374
- margin-right: 18px;
375
- cursor: default;
376
- width: 10px;
377
- color: #816c64;
378
- margin-top: -19px;
379
- padding-top: 9px;
380
- }
381
-
382
- /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
383
- padding: 3px 10px;
384
- background-color:#ffffff;
385
- } */
386
- #agca_form .agca_button.clear span{
387
- margin-top: 5px;
388
- }
389
- #agca_form .agca_button.clear span:before {
390
- color: #826c63;
391
- cursor: pointer;
392
- font-size: 30px;
393
- }
394
-
395
- #agca_form .agca_button.clear span:hover:before {
396
- color: red;
397
- }
398
-
399
- #agca_form input[type=button], button {
400
- background: #826c63;
401
- border: 1px solid #826c63;
402
- border-radius: 3px;
403
- color: #FFFFFF;
404
- padding: 5px 10px;
405
- }
406
-
407
- #agca_form input[type=button]:hover {
408
- background-color: #6d6764;
409
- border: 1px solid #6d6764;
410
- color: #fff;
411
- cursor: pointer;
412
- }
413
-
414
- #agca_form input[type=text] {
415
- height: 28px;
416
- width: 400px;
417
- border: 3px solid #eee;
418
- box-shadow: none;
419
- padding: 15px 10px;
420
- background: #f5f2f2;
421
- color: #816c64;
422
- font-weight: bold;
423
- border-radius: 5px;
424
- }
425
-
426
- #agca_form input.color_picker {
427
- width: 88px;
428
- }
429
-
430
- #agca_form input.color_picker:placeholder-shown + .pick_color_button + .pick_color_button_clear{
431
- display: none !important;
432
- }
433
-
434
- #agca_form input[type=text]:focus{
435
- background-color: transparent;
436
- border: 3px solid #826c63;
437
- }
438
-
439
- #agca_form textarea {
440
- width: 400px;
441
- background: #f5f2f2;
442
- border: 3px solid #eee;
443
- color: #816c64;
444
- font-weight: bold;
445
- padding: 5px;
446
- }
447
- #agca_form textarea.one-line{
448
- height: 35px;
449
- }
450
-
451
- #agca_form textarea.wp-editor-area {
452
- width: 100%;
453
- }
454
-
455
- #agca_form textarea:focus {
456
- background-color: transparent;
457
- border: 3px solid #826c63;
458
- }
459
-
460
- #agca_form #ag_edit_adminmenu tr td{
461
- line-height: 0;
462
- }
463
-
464
- #agca_form #ag_add_adminmenu input[type=text] {
465
- width: 300px;
466
- }
467
-
468
- #agca_form #ag_add_adminmenu .button_edit span,
469
- #agca_form #ag_add_adminmenu .button_remove span {
470
- font-size: 25px;
471
- color: #826c63;
472
- }
473
-
474
- #agca_form #ag_add_adminmenu .button_remove span {
475
- color: red;
476
- }
477
-
478
- #agca_form input#save_plugin_settings {
479
- background: #826c63;
480
- font-weight: bold;
481
- height: 39px;
482
- padding: 4px;
483
- width: 100%;
484
- border: 1px solid #826c63 !important;
485
- text-shadow: none !important;
486
- box-shadow: none !important;
487
- font-size: 16px;
488
- color: #fff !important;
489
- }
490
-
491
- #agca_form input#save_plugin_settings:hover {
492
- background-color: #6d6764 !important;
493
- }
494
-
495
- #agca_form input#save_plugin_settings[type="button"]:hover {
496
- background-color: #ffffff;
497
- color: #ffffff;
498
- }
499
-
500
- /*editor style fix*/
501
- #agca_form .agca_editor input[type="button"], button {
502
- color: black;
503
- }
504
-
505
- #agca_form .agca_editor textarea {
506
- width: 100%;
507
- }
508
-
509
- .agca_editor {
510
- width: 600px;
511
- }
512
-
513
- /*templates*/
514
- #agca_templates .error {
515
- padding: 8px;
516
- font-size: 14px;
517
- }
518
-
519
- .agca_template {
520
- display: block;
521
- float: left;
522
- border: 3px solid #aaa;
523
- margin: 10px;
524
- margin-top: 15px;
525
- cursor: pointer;
526
- }
527
-
528
- .agca_template:hover {
529
- border: 3px solid green;
530
- }
531
-
532
- .agca_template h3 {
533
- text-align: center;
534
- color: green;
535
- }
536
-
537
- .agca_template h3 span {
538
- color: #555;
539
- font-size: 16px;
540
- }
541
-
542
- .agca_template img {
543
- width: 250px;
544
- }
545
-
546
- .agca_logout_button {
547
- background: none repeat scroll 0 0 #dddddd;
548
- float: right;
549
- font-size: 15px;
550
- font-weight: bold;
551
- margin-right: 20px;
552
- padding: 10px;
553
- text-decoration: none;
554
- border-radius: 0 0 3px 3px;
555
- border: 1px solid #BBBBBB;
556
- border-top: none;
557
- margin-left: 6px;
558
- margin-right: 20px;
559
- padding: 6px 10px;
560
- }
561
-
562
- #ag_add_adminmenu button {
563
- border: medium none;
564
- border-radius: 4px;
565
- color: #FFFFFF;
566
- padding: 6px 9px;
567
- min-width: 150px;
568
- }
569
-
570
- .wp-admin.folded #sidebar_adminmenu_logo {
571
- display: none;
572
- }
573
-
574
- .agca-selectbox {
575
- width: 405px;
576
- padding: 4px !important;
577
- height: 28px !important;
578
- }
579
-
580
- .agca-selectbox:hover {
581
- background-color: #eee;
582
- }
583
-
584
- #agca_form .agca-checkbox-box {
585
- cursor: pointer;
586
- display: block;
587
- width: 28px;
588
- height: 28px;
589
- position: relative;
590
- float: left;
591
- }
592
-
593
- #agca_form .agca-checkbox-box:before {
594
- content: "●";
595
- font-size: 45px;
596
- line-height: 25px;
597
- color: #ccc;
598
- }
599
-
600
- #agca_form .agca-checkbox-box-checked {
601
- cursor: pointer;
602
- display: block;
603
- width: 28px;
604
- height: 28px;
605
- position: relative;
606
- float: left;
607
- }
608
-
609
- #agca_form .agca-checkbox-box-checked:before {
610
- content: "●";
611
- font-size: 45px;
612
- line-height: 25px;
613
- color: #826c63;
614
- }
615
-
616
- #agca_form .agca-checkbox-box-checked.visibility:before {
617
- }
618
-
619
- #agca_form .agca-checkbox-box-checked:hover:before,
620
- #agca_form .agca-checkbox-box:hover:before {
621
- color: #999;
622
- }
623
-
624
- #agca_form label {
625
- font-size: 15px;
626
- color: #777777;
627
- }
628
-
629
- #agca_form .form-table th {
630
- width: 350px;
631
- padding: 10px;
632
- }
633
- #agca_form .form-table th label{
634
- font-weight: normal;
635
- }
636
- #agca_form .form-table td {
637
- padding: 10px;
638
- }
639
- #agca_form .form-table td p{
640
- color: #9c8a8a;
641
- }
642
- .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box {
643
- margin-top: -15px;
644
- }
645
-
646
- #agca_form input[type=radio] {
647
- display: block;
648
- float: left;
649
- }
650
-
651
- #agca_form .agca-radiobox {
652
- cursor: pointer;
653
- display: block;
654
- width: 28px;
655
- height: 28px;
656
- position: relative;
657
- float: left;
658
- }
659
-
660
- #agca_form .agca-radio-text {
661
- display: block;
662
- float: left;
663
- font-size: 17px;
664
- font-weight: bold;
665
- margin: 4px 25px 4px 4px;
666
- cursor: pointer;
667
- }
668
-
669
- #agca_form .agca-radio-text.on {
670
- color: #ccc;
671
- }
672
-
673
- #agca_form .agca-radio-text.off {
674
- color: #ccc;
675
- }
676
-
677
- #agca_form .agca-radiobox:before {
678
- font-family: Dashicons;
679
- content: "\f159";
680
- font-size: 30px;
681
- line-height: 30px;
682
- }
683
-
684
- #agca_form .agca-radiobox.checked:before {
685
- content: "\f502";
686
- }
687
-
688
- #agca_form .agca-radiobox.checked[value=off]:before {
689
- content: "\f153";
690
- }
691
-
692
- #agca_form .agca-radiobox[value=on]:before {
693
- color: #ACC491;
694
- }
695
-
696
- #agca_form .agca-radiobox[value=off]:before {
697
- color: #ccc;
698
- }
699
-
700
- #agca_form #section_templates {
701
- background: transparent;
702
- }
703
-
704
- #wp-admin-bar-agca-admin-themes a {
705
- color: #def7c3 !important;
706
- }
707
-
708
- #wp-admin-bar-agca-admin-themes .ab-icon:before {
709
- font-family: "dashicons";
710
- content: "\f100";
711
- margin-top: 2px;
712
- display: block;
713
- color: #eef9d5 !important;
714
- }
715
-
716
- .agca-feedback-and-support a {
717
- border: medium none;
718
- border-radius: 4px;
719
- color: #FFFFFF !important;
720
- padding: 6px 20px;
721
- min-width: 240px;
722
- background: #826c63;
723
- display: inline-block;
724
- font-weight: normal !important;
725
- text-decoration: none;
726
- }
727
-
728
- .agca-feedback-and-support .upgrade a{
729
- background: #f9f9f9;
730
- color: #826c63 !important;
731
- float: left;
732
- border: 1px solid #826c63;
733
- padding: 5px 30px 5px 9px;
734
- }
735
- .agca-feedback-and-support .upgrade span{
736
- display: block;
737
- float: left;
738
- margin-top: 20px;
739
- }
740
- .agca-feedback-and-support .upgrade img{
741
- width: 50px;
742
- height: auto;
743
- float: left;
744
- display: inline-block;
745
- margin-left: -5px;
746
- }
747
-
748
- .agca-feedback-and-support a:hover {
749
- background-color: #6d6764;
750
- }
751
- .agca-feedback-and-support .upgrade a:hover{
752
- background-color: #fff;
753
- color: #826c63;
754
- box-shadow: 1px 1px 1px #ddd;
755
- }
756
- #agca-your-feedback {
757
- float: right;
758
- width: 160px;
759
- margin-top: -10px;
760
- display: none;
761
- }
762
-
763
- #agca-your-feedback .dashicons {
764
- font-size: 24px;
765
- padding: 0 3px;
766
- line-height: 18px;
767
- }
768
-
769
- #agca-your-feedback a {
770
- text-decoration: none;
771
- }
772
-
773
- #agca-your-feedback a {
774
- text-decoration: none;
775
- }
776
-
777
- #agca-your-feedback .feedback.negative {
778
- color: #f08080;
779
- }
780
-
781
- #agca-your-feedback .feedback.negative:hover {
782
- color: red;
783
- }
784
-
785
- #agca-your-feedback .feedback.positive {
786
- color: #ACC491;
787
- }
788
-
789
- #agca-your-feedback .feedback.positive:hover {
790
- color: green;
791
- }
792
-
793
- #agca_donate_button {
794
- margin-left: 5px;
795
- margin-top: 3px;
796
- display: inline-block;
797
- }
798
- #agca_donate_button img{
799
- width: 125px;
800
- margin-top: -8px;
801
- }
802
-
803
- #section_ag_colorizer_settings .color input {
804
- border-radius: 5px;
805
- }
806
-
807
- #section_ag_colorizer_settings .color .agca_button {
808
- cursor: pointer;
809
- }
810
-
811
- #section_ag_colorizer_settings .color .agca_button span {
812
- font-size: 35px;
813
- padding: 0 6px;
814
- color: #826c63;
815
- }
816
-
817
- #section_ag_colorizer_settings .color .agca_button span:hover {
818
- color: #6d6764;
819
- }
820
-
821
- #section_ag_colorizer_settings .color .agca_button span.clear {
822
- color: #826c63;
823
- }
824
-
825
- #section_ag_colorizer_settings .color .agca_button span.clear:hover {
826
- color: red;
827
- }
828
- /*Hide dashboard empty box containers*/
829
- #dashboard-widgets div.empty-container{
830
- display: none;
831
- }
832
-
833
- .tools_page_ag-custom-admin-plugin #wpwrap{
834
- background: #fff;
835
-
836
- }
837
- .tools_page_ag-custom-admin-plugin #agca_form{
838
- font-family: 'Open Sans', sans-serif;
839
- font-weight: 300;
840
- }
841
-
842
- .tools_page_ag-custom-admin-plugin #agca_form *:focus {
843
- outline: none !important;
844
- box-shadow: none !important;
845
- }
846
-
847
- .agca_template_block h3,
848
- .agca_template_block span.price,
849
- .agca_template_block a{
850
- color: inherit !important;
851
- }
852
- #agca_template_popup .agca_content{
853
- background: #bbb !important;
854
- }
855
-
856
- .agca_template_block .template img{
857
- box-shadow: none !important;
858
- }
859
-
860
- #agca_form #ag_edit_adminmenu tr.top td{
861
- background: #f9f8f8;
862
- padding-top: 10px;
863
- padding-bottom: 0;
864
- }
865
- #agca_form #ag_edit_adminmenu tr.top td.ag_admin_menu_parent2{
866
- padding-top: 2px;
867
- }
868
- #agca_form #ag_edit_adminmenu tr.top:nth-child(odd) td{
869
- background: #f3f3f3;
870
- }
871
- #agca_form #ag_edit_adminmenu tr.sub td{
872
- background: #fff;
873
- padding: 0;
874
- padding-left: 10px;
875
- }
876
- #agca_form #ag_edit_adminmenu tr.sub td div a{
877
- padding: 17px;
878
- display: inline-block;
879
- }
880
-
881
- #agca_form #ag_edit_adminmenu tr:first-child td{
882
- background: #826c63;
883
- }
884
-
885
- #agca_form #import_file_area .agca_button{
886
- margin-bottom: 5px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
887
  }
1
+ @import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;600&display=swap');
2
+ /*color scheme*/
3
+ /*
4
+ -main
5
+ #ACC491
6
+ #DEF7C3
7
+
8
+ -lighter
9
+ #eef9d5
10
+
11
+ -blue
12
+ #005B69
13
+
14
+ agca-dark: #23395B;
15
+ agca-gray: #BEC5D0;
16
+ agca-gray-secondary: #C5CECC;
17
+ */
18
+
19
+ .tools_page_ag-custom-admin-plugin #agca_form {
20
+ --agca-color-dark: #23395B;
21
+ --agca-color-gray: #BEC5D0;
22
+ --agca-color-secondary: #C5CECC;
23
+ --agca-color-green: #45cc45;
24
+ }
25
+ .agca-clear {
26
+ clear: both;
27
+ }
28
+
29
+ .agca-tip {
30
+ padding-left: 20px;
31
+ }
32
+
33
+
34
+ /* WebKit and Opera browsers */
35
+ @-webkit-keyframes cusmin-spinner {
36
+ from { -webkit-transform: rotateY(0deg); }
37
+ to { -webkit-transform: rotateY(-360deg); }
38
+ }
39
+
40
+ /* all other browsers */
41
+ @keyframes cusmin-spinner {
42
+ from {
43
+ -moz-transform: rotateY(0deg);
44
+ -ms-transform: rotateY(0deg);
45
+ transform: rotateY(0deg);
46
+ }
47
+ to {
48
+ -moz-transform: rotateY(-360deg);
49
+ -ms-transform: rotateY(-360deg);
50
+ transform: rotateY(-360deg);
51
+ }
52
+ }
53
+
54
+ .cusmin-spinner {
55
+ -webkit-animation-name: cusmin-spinner;
56
+ -webkit-animation-timing-function: linear;
57
+ -webkit-animation-iteration-count: infinite;
58
+ -webkit-animation-duration: 1.5s;
59
+
60
+ animation-name: cusmin-spinner;
61
+ animation-timing-function: linear;
62
+ animation-iteration-count: infinite;
63
+ animation-duration: 1.5s;
64
+
65
+ -webkit-transform-style: preserve-3d;
66
+ -moz-transform-style: preserve-3d;
67
+ -ms-transform-style: preserve-3d;
68
+ transform-style: preserve-3d;
69
+
70
+ -webkit-animation-play-state: paused;
71
+ animation-play-state: paused;
72
+ }
73
+
74
+ h1#agca-title {
75
+ color: #23395B;
76
+ font-weight: bold;
77
+ font-size: 30px;
78
+
79
+ }
80
+ h1#agca-title .title{
81
+ float:left;
82
+ padding: 10px;
83
+ font-family: 'Comfortaa', sans-serif;
84
+ font-weight: 300;
85
+ }
86
+ h1#agca-title img{
87
+ width: 200px;
88
+ float: left;
89
+ margin-top: -3px;
90
+ margin-right: 20px;
91
+ }
92
+ h1#agca-title .version{
93
+ font-size: 15px;
94
+ margin-top: 12px;
95
+ font-family: 'Comfortaa', sans-serif;
96
+ display: inline-block;
97
+ }
98
+
99
+ table .agca-tip {
100
+ padding-left: 10px;
101
+ }
102
+
103
+ #ag_main_menu {
104
+ display: block;
105
+ height: 34px;
106
+ border-bottom: 5px solid #23395B;
107
+ margin-top: 10px;
108
+ }
109
+
110
+ #ag_main_menu .dashicons-before:before {
111
+ margin-right: 6px;
112
+ transform: translateY(-1px);
113
+ }
114
+ #ag_main_menu .agca-invert-icon:before {
115
+ transform: rotate3d(0, 0, 1, 180deg) translate(-1px, 2px);
116
+ }
117
+ #ag_main_menu li a:hover{
118
+ color: #fff;
119
+ }
120
+ #ag_main_menu li.upgrade{
121
+ border-bottom: 5px solid #23395B;
122
+ border-left: 7px solid #23395B;
123
+ background-color: #f4f7fb;
124
+ border-top-right-radius: 10px;
125
+ padding-bottom: 8px;
126
+
127
+ }
128
+ #ag_main_menu li.upgrade:hover{
129
+ background: #fff !important;
130
+ }
131
+ #ag_main_menu li.upgrade a{
132
+ color: #23395B;
133
+ display: inline-block;
134
+ padding-left: 20px;
135
+ font-weight:bolder;
136
+ }
137
+ #ag_main_menu li.upgrade:hover a{
138
+ color:#23395B;
139
+ transform: scale(1.1);
140
+ }
141
+
142
+ #ag_main_menu li.upgrade img{
143
+ width: 20px;
144
+ position: absolute;
145
+ margin-top: -1px;
146
+ margin-left: -25px;
147
+ }
148
+
149
+ .ag_section {
150
+ background: transparent;
151
+ }
152
+
153
+ #agca_form #section-cusmin {
154
+ font-size: 15px;
155
+ padding: 10px;
156
+ border: 2px solid #999;
157
+ background: #fff;
158
+ margin-bottom: 5px;
159
+ border-radius: 6px;
160
+ font-weight: bold;
161
+ color: #999;
162
+ }
163
+
164
+
165
+ #ag_main_menu li {
166
+ display: block;
167
+ background-color: #23395B;
168
+ float: left;
169
+ color: #fff;
170
+ padding: 15px;
171
+ padding-top: 8px;
172
+ padding-bottom: 3px;
173
+ font-weight: bold;
174
+ cursor: pointer;
175
+ border-bottom: 8px solid #23395B;
176
+ transition: all .1s ease-in;
177
+ }
178
+
179
+ #ag_main_menu li.selected {
180
+ background-color: #C5CECC;
181
+ color: #23395B;
182
+ cursor: default;
183
+ }
184
+ #ag_main_menu li.selected a{
185
+ color: #23395B;
186
+ }
187
+
188
+ #ag_main_menu li.normal:hover {
189
+ background-color: #BEC5D0;
190
+ }
191
+
192
+ #ag_main_menu li.normal:hover a {
193
+ color: #23395B;
194
+ }
195
+ #ag_main_menu a:focus {
196
+ outline: none;
197
+ border: 0;
198
+ }
199
+
200
+ #ag_main_menu li a {
201
+ text-decoration: none;
202
+ color: #fff;
203
+ outline: none;
204
+ border: 0;
205
+ }
206
+
207
+ .ag_table_heading {
208
+ background: none;
209
+ display: block;
210
+ height: 25px;
211
+ padding: 5px;
212
+ padding-top: 0px;
213
+ padding-bottom: 1px;
214
+ margin-top: 20px;
215
+ margin-bottom: 24px;
216
+ margin-left: -10px;
217
+ margin-right: -10px;
218
+ }
219
+
220
+ .ag_table_heading h3 {
221
+ color: #23395B;
222
+ background: #efefef;
223
+ margin-left: -15px;
224
+ padding: 5px 15px;
225
+ border: none;
226
+ border: 3px #23395B solid;
227
+ border-radius: 6px;
228
+ font-size: 15px;
229
+ }
230
+
231
+ .ag_table_major_options {
232
+ width: 500px;
233
+ margin-bottom: 2px;
234
+ }
235
+
236
+ #agca_form .form-table .ag_table_major_options td {
237
+ }
238
+
239
+ div#AGToolTipDiv {
240
+ position: absolute;
241
+ top: 100px;
242
+ left: 200px;
243
+ height: auto;
244
+ border: none !important;
245
+ box-shadow: 0px 8px 14px rgba(35, 57, 91, 0.5);
246
+ -webkit-backdrop-filter: blur(3px);
247
+ backdrop-filter: blur(3px);
248
+ background: rgba(197, 206, 204, 0.5) !important;
249
+ color: #23395B !important;
250
+ display: none;
251
+ padding: 5px 10px;
252
+ border-radius: 3px;
253
+ }
254
+
255
+ td.ag_admin_menu_parent {
256
+ font-size: 16px;
257
+ font-weight: bold;
258
+ cursor: pointer;
259
+ }
260
+
261
+ td.ag_admin_menu_parent:hover {
262
+ background-color: #ddd;
263
+ }
264
+
265
+ #ag_edit_adminmenu .agca-checkbox-box:before {
266
+ filter: brightness(85%);
267
+ padding-top: 3px;
268
+ }
269
+
270
+ #ag_edit_adminmenu .agca-checkbox-box-checked:before {
271
+ padding-top: 3px;
272
+ }
273
+
274
+ #ag_edit_adminmenu h3 {
275
+ color: #ffffff;
276
+ }
277
+
278
+
279
+
280
+ #ag_edit_adminmenu tr {
281
+ margin: 0;
282
+ padding: 0;
283
+ background-color: #E8FAE8;
284
+ }
285
+
286
+ #ag_edit_adminmenu td.ag_admin_menu_child {
287
+ margin: 0;
288
+ padding: 15px;
289
+ padding-top: 0;
290
+ padding-bottom: 0;
291
+ }
292
+
293
+ #ag_edit_adminmenu th h2 {
294
+ color: #fff;
295
+ }
296
+
297
+ #ag_edit_adminmenu a {
298
+ text-decoration: none;
299
+ color: #444;
300
+ }
301
+
302
+ .noclass {
303
+ display: none;
304
+ }
305
+
306
+ #agca_footer_support_info {
307
+ font-size: 12px;
308
+ font-weight: bold;
309
+ background: #acc491;
310
+ color: #ffffff;
311
+ border: none;
312
+ padding: 20px;
313
+ }
314
+
315
+ #agca_footer_support_info a {
316
+ color: #005b69;
317
+ text-decoration: none;
318
+ font-size: 18px;
319
+ }
320
+
321
+ #agca_news {
322
+ height: 20px;
323
+ clear: both;
324
+ position: absolute;
325
+ margin-top: -22px;
326
+ color: #005B69;
327
+ display: none;
328
+ }
329
+
330
+ #agca_news a {
331
+ color: #005B69;
332
+ }
333
+
334
+ #agca_advertising {
335
+ display: flex;
336
+ height: auto;
337
+ padding: 15px;
338
+ margin: 0;
339
+ width: auto;
340
+ text-decoration: none;
341
+ transition: all .2s;
342
+ color: #BEC5D0;
343
+ clear: both;
344
+ }
345
+ #agca_advertising,
346
+ #agca_advertising:visited,
347
+ #agca_advertising:focus {
348
+ border-radius: 10px;
349
+ box-shadow: 1px 1px 8px var(--agca-color-gray);
350
+ }
351
+
352
+ #agca_advertising .unlock-features {
353
+ opacity: 0;
354
+ align-self: center;
355
+ justify-self: center;
356
+ transition: all .3s;
357
+ }
358
+
359
+ #agca_advertising .unlock-features:before {
360
+ content: "\f528";
361
+ font-family: 'dashicons';
362
+ transform: translateX(-4px);
363
+ display: inline-block;
364
+ }
365
+
366
+ #agca_advertising .unlock-features:hover {
367
+ color: #45cc45;
368
+ }
369
+ #agca_advertising .unlock-features:hover:before {
370
+ content: "\f345";
371
+ }
372
+
373
+ #agca_advertising .unlock-features:hover:after {
374
+ content: "\f341";
375
+ font-family: 'dashicons';
376
+ transform: translate(4px, 2px);
377
+ display: inline-block;
378
+ }
379
+
380
+ #agca_advertising:hover {
381
+ color: #23395B;
382
+ box-shadow: 1px 1px 8px #a1a1a1;
383
+ }
384
+ #agca_advertising:hover .unlock-features {
385
+ opacity: 1;
386
+ }
387
+
388
+
389
+ #agca_advertising .cusmin-logo {
390
+ width: 65px;
391
+ padding-right: 30px;
392
+ }
393
+
394
+ #agca_advertising ul {
395
+ padding: 0;
396
+ margin: 0;
397
+ display: grid;
398
+ grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
399
+ width: calc(100% - 320px);
400
+ max-width: 1200px;
401
+ grid-column-gap: 35px;
402
+ padding-right: 5px;
403
+ }
404
+
405
+ #agca_advertising > ul > li {
406
+ margin: 0;
407
+ cursor: pointer;
408
+ align-self: center;
409
+ }
410
+ #agca_advertising > ul > li:before {
411
+ content: "\f147";
412
+ display: inline-block;
413
+ font-family: dashicons;
414
+ font-size: 22px;
415
+ transform: translate(-4px, 6px);
416
+ }
417
+ #agca_advertising > ul > li:hover:before {
418
+ color: var(--agca-color-green);
419
+ }
420
+ #agca_form .section_title {
421
+ font-weight: bold;
422
+ background: transparent;
423
+ border-bottom-right-radius: 15px;
424
+ color: #23395B;
425
+ float: left;
426
+ font-size: 40px;
427
+ padding: 20px 11px;
428
+ position: relative;
429
+ text-decoration: none;
430
+ text-shadow: none;
431
+ width: 50%;
432
+ display: block;
433
+ margin-top: 40px;
434
+ }
435
+
436
+ #agca_form select{
437
+ border:3px #23395B solid;
438
+ color: #23395B;
439
+ display: inline-block;
440
+ font-weight: bold;
441
+ height: 35px !important;
442
+ line-height: 1.5;
443
+ min-width: 300px;
444
+ padding-left: 7px !important;
445
+ }
446
+ #agca_form a{
447
+ font-weight: bold;
448
+ color: #23395B;
449
+ transition: all .3s;
450
+ }
451
+ #agca_form p a{
452
+ display: inline-block;
453
+ }
454
+ #agca_form p a:hover{
455
+ color: var(--agca-color-secondary);
456
+ filter: brightness(55%);
457
+ transform: scale(1.05);
458
+ }
459
+ #agca_form h2.section_title {
460
+
461
+ }
462
+
463
+ #agca_form h2.section_title {
464
+ font-weight: bold;
465
+ font-size: 45px;
466
+ line-height: 1em;
467
+ }
468
+
469
+ #agca_form h2.section_title {
470
+ color: #23395B;
471
+ }
472
+
473
+ /* Don't show shadows when selecting text */
474
+ #agca_form h2.section_title::-moz-selection {
475
+ background: #5af;
476
+ color: #fff;
477
+ text-shadow: none;
478
+ }
479
+
480
+ #agca_form h2.section_title::selection {
481
+ background: #5af;
482
+ color: #fff;
483
+ text-shadow: none;
484
+ }
485
+
486
+ #agca_form #templates_head_buttons input[type=button] {
487
+ background: #23395B;
488
+ color: white;
489
+ font-weight: bold;
490
+ }
491
+
492
+ #agca_form #templates_head_buttons input[type=button]:hover {
493
+ background: white;
494
+ color: var(--agca-color-gray);
495
+ }
496
+
497
+ .ag-custom-button {
498
+
499
+ /* margin-bottom:-4px !important;*/
500
+ }
501
+
502
+ #sidebar_adminmenu_logo {
503
+ margin-bottom: -33px;
504
+ min-height: 28px;
505
+ cursor: pointer;
506
+ }
507
+
508
+ .agcaMenuEditorPlusMinus .plus {
509
+ padding-right: 4px;
510
+ display: inline;
511
+ }
512
+
513
+ .agcaMenuEditorPlusMinus .minus {
514
+ padding-right: 4px;
515
+ display: none;
516
+ }
517
+
518
+ .agcaMenuEditorPlusMinus .dashicons:before {
519
+ font-size: 15px;
520
+ line-height: 22px;
521
+ display: inline-block;
522
+ transform: translateY(-2px);
523
+ }
524
+
525
+ .agcaMenuEditorPlusMinus {
526
+ float: left;
527
+ margin-right: 18px;
528
+ cursor: default;
529
+ width: 10px;
530
+ color: var(--agca-color-dark);
531
+ margin-top: -19px;
532
+ padding-top: 9px;
533
+ pointer-events: none;
534
+ }
535
+
536
+ /*#agca_form input.agca_button,#agca_form #ag_add_adminmenu button{
537
+ padding: 3px 10px;
538
+ background-color:#ffffff;
539
+ } */
540
+ #agca_form .agca_button.clear span{
541
+ margin-top: 5px;
542
+ }
543
+ #agca_form .agca_button.clear span:before {
544
+ color: #23395B;
545
+ cursor: pointer;
546
+ font-size: 30px;
547
+ }
548
+
549
+ #agca_form .agca_button.clear span:hover:before {
550
+ color: red;
551
+ }
552
+
553
+ #agca_form input[type=button]:not(.ed_button), button {
554
+ background: #23395B;
555
+ border: 1px solid #23395B;
556
+ border-radius: 3px;
557
+ color: #FFFFFF;
558
+ padding: 5px 10px;
559
+ transition: all .3s;
560
+
561
+ }
562
+
563
+ #agca_form input[type=button]:not(.ed_button):hover {
564
+ background-color: var(--agca-color-secondary);
565
+ border: 1px solid var(--agca-color-secondary);;
566
+ color: var(--agca-color-dark);
567
+ cursor: pointer;
568
+ transform: scale(1.1);
569
+ box-shadow: 0px 2px 4px #444;
570
+ }
571
+
572
+ #agca_form input[type=text] {
573
+ height: 28px;
574
+ width: 400px;
575
+ border: 3px solid #eee;
576
+ box-shadow: none;
577
+ padding: 15px 10px;
578
+ background: #f5f2f2;
579
+ color: #816c64;
580
+ font-weight: bold;
581
+ border-radius: 5px;
582
+ transition: all .3s;
583
+ display: inline-block;
584
+ }
585
+
586
+ #agca_form input[type=text]:hover{
587
+ transform: scale(1.01);
588
+ }
589
+
590
+ #agca_form .color input[type=text]:hover{
591
+ transform: scale(1.05);
592
+ }
593
+
594
+ #agca_form input.color_picker {
595
+ width: 88px;
596
+ }
597
+
598
+ #agca_form input.color_picker:placeholder-shown + .pick_color_button + .pick_color_button_clear{
599
+ display: none !important;
600
+ }
601
+
602
+ #agca_form input[type=text]{
603
+ background-color: #fff;
604
+ color: var(--agca-color-dark);
605
+ border: 3px solid var(--agca-color-gray);
606
+ }
607
+
608
+ #agca_form input[type=text]:hover {
609
+ border-color: var(--agca-color-secondary);
610
+ }
611
+
612
+ #agca_form input[type=text]:focus{
613
+ border-color: var(--agca-color-dark);
614
+ }
615
+
616
+ #agca_form textarea:not(.wp-editor-area) {
617
+ width: 400px;
618
+ background: #fff;
619
+ color: var(--agca-color-dark);
620
+ border: 3px solid var(--agca-color-gray);
621
+ font-weight: bold;
622
+ padding: 5px;
623
+ transition: all .3s;
624
+ }
625
+ #agca_form textarea.one-line{
626
+ height: 35px;
627
+ }
628
+
629
+ #agca_form textarea.wp-editor-area {
630
+ width: 100%;
631
+ }
632
+
633
+ #agca_form textarea:focus {
634
+ border-color: var(--agca-color-dark);
635
+ }
636
+
637
+ #agca_form #ag_edit_adminmenu tr td{
638
+ line-height: 0;
639
+ }
640
+
641
+ #agca_form #ag_add_adminmenu input[type=text] {
642
+ width: 300px;
643
+ }
644
+ #agca_form #ag_add_adminmenu input[type=button] {
645
+ padding: 9px;
646
+ }
647
+
648
+
649
+ #agca_form #ag_add_adminmenu .button_edit span,
650
+ #agca_form #ag_add_adminmenu .button_remove span {
651
+ font-size: 25px;
652
+ color: #23395B;
653
+ }
654
+
655
+ #agca_form #ag_add_adminmenu .button_edit:hover span {
656
+ color: var(--agca-color-secondary);
657
+ }
658
+
659
+ #agca_form #ag_add_adminmenu .button_remove:hover span {
660
+ color: red;
661
+ }
662
+
663
+ #agca_form #temporary_button_edit {
664
+ padding-top: 20px;
665
+ }
666
+
667
+ #agca_form input#save_plugin_settings {
668
+ background: var(--agca-color-dark);
669
+ font-weight: bold;
670
+ height: 39px;
671
+ padding: 4px;
672
+ width: 100%;
673
+ border: 1px solid var(--agca-color-dark) !important;
674
+ text-shadow: none !important;
675
+ box-shadow: none !important;
676
+ font-size: 16px;
677
+ color: #fff !important;
678
+ transition: all .3s;
679
+ }
680
+
681
+ #agca_form input#save_plugin_settings:hover {
682
+ background-color: var(--agca-color-secondary) !important;
683
+ border-color: var(--agca-color-secondary) !important;
684
+ color: var(--agca-color-dark) !important;
685
+ letter-spacing: 0.1em;
686
+ box-shadow: 0px 0px 3px #444 !important;
687
+ transform: none;
688
+ }
689
+
690
+ #agca_form input#save_plugin_settings[type="button"]:hover {
691
+ background-color: #ffffff;
692
+ color: #ffffff;
693
+ }
694
+
695
+ /*editor style fix*/
696
+ #agca_form .agca_editor input[type="button"]:not(.ed_button), button {
697
+ color: black;
698
+ }
699
+
700
+ #agca_form .agca_editor textarea {
701
+ width: 100%;
702
+ }
703
+
704
+ .agca_editor {
705
+ width: 600px;
706
+ }
707
+
708
+ /*templates*/
709
+ #agca_templates .error {
710
+ padding: 8px;
711
+ font-size: 14px;
712
+ }
713
+
714
+ .agca_template {
715
+ display: block;
716
+ float: left;
717
+ border: 3px solid #aaa;
718
+ margin: 10px;
719
+ margin-top: 15px;
720
+ cursor: pointer;
721
+ }
722
+
723
+ .agca_template:hover {
724
+ border: 3px solid green;
725
+ }
726
+
727
+ .agca_template h3 {
728
+ text-align: center;
729
+ color: green;
730
+ }
731
+
732
+ .agca_template h3 span {
733
+ color: #555;
734
+ font-size: 16px;
735
+ }
736
+
737
+ .agca_template img {
738
+ width: 250px;
739
+ }
740
+
741
+ .agca_logout_button {
742
+ background: none repeat scroll 0 0 #dddddd;
743
+ float: right;
744
+ font-size: 15px;
745
+ font-weight: bold;
746
+ margin-right: 20px;
747
+ padding: 10px;
748
+ text-decoration: none;
749
+ border-radius: 0 0 3px 3px;
750
+ border: 1px solid #BBBBBB;
751
+ border-top: none;
752
+ margin-left: 6px;
753
+ margin-right: 20px;
754
+ padding: 6px 10px;
755
+ }
756
+
757
+ #ag_add_adminmenu button {
758
+ border: medium none;
759
+ border-radius: 4px;
760
+ color: #FFFFFF;
761
+ padding: 6px 9px;
762
+ min-width: 150px;
763
+ }
764
+
765
+ .wp-admin.folded #sidebar_adminmenu_logo {
766
+ display: none;
767
+ }
768
+
769
+ .agca-selectbox {
770
+ width: 405px;
771
+ padding: 4px !important;
772
+ height: 28px !important;
773
+ }
774
+
775
+ .agca-selectbox:hover {
776
+ background-color: #eee;
777
+ }
778
+
779
+ #agca_form .agca-checkbox-box {
780
+ cursor: pointer;
781
+ display: block;
782
+ width: 28px;
783
+ height: 28px;
784
+ position: relative;
785
+ float: left;
786
+ }
787
+
788
+ #agca_form .agca-checkbox-box:before {
789
+ content: "●";
790
+ font-size: 45px;
791
+ line-height: 25px;
792
+ color: #BEC5D0;
793
+ display: block;
794
+ transition: all .3s;
795
+ }
796
+
797
+ #agca_form .agca-checkbox-box-checked {
798
+ cursor: pointer;
799
+ display: block;
800
+ width: 28px;
801
+ height: 28px;
802
+ position: relative;
803
+ float: left;
804
+ }
805
+
806
+ #agca_form .agca-checkbox-box-checked:before {
807
+ content: "●";
808
+ font-size: 45px;
809
+ line-height: 25px;
810
+ color: #23395B;
811
+ display:block;
812
+ transform: scale(1.05) !important;
813
+ }
814
+
815
+ #agca_form .agca-checkbox-box-checked.visibility:before {
816
+ }
817
+
818
+ #agca_form .agca-checkbox-box-checked:hover:before,
819
+ #agca_form .agca-checkbox-box:hover:before {
820
+ filter: brightness(85%);
821
+ transform: scale(1.2);
822
+ }
823
+
824
+ #agca_form label {
825
+ font-size: 15px;
826
+ color: var(--agca-color-dark);
827
+ }
828
+
829
+ #agca_form .form-table th {
830
+ width: 350px;
831
+ padding: 10px;
832
+ }
833
+ #agca_form .form-table th label{
834
+ font-weight: normal;
835
+ color: #23395B;
836
+ display: inline-block;
837
+ }
838
+ #agca_form .form-table th label:hover {
839
+ transform: scale(1.01);
840
+ }
841
+ #agca_form .form-table td {
842
+ padding: 10px;
843
+ }
844
+ #agca_form .form-table td p{
845
+ color: var(--agca-color-secondary);
846
+ filter: brightness(45%);
847
+ }
848
+ .ag_admin_menu_parent .agca-checkbox-box-checked, .ag_admin_menu_parent .agca-checkbox-box {
849
+ margin-top: -15px;
850
+ }
851
+
852
+ #agca_form input[type=radio] {
853
+ display: block;
854
+ float: left;
855
+ }
856
+
857
+ #agca_form .agca-radiobox {
858
+ cursor: pointer;
859
+ display: block;
860
+ width: 28px;
861
+ height: 28px;
862
+ position: relative;
863
+ float: left;
864
+ }
865
+
866
+ #agca_form .agca-radio-text {
867
+ display: block;
868
+ float: left;
869
+ font-size: 17px;
870
+ font-weight: bold;
871
+ margin: 4px 25px 4px 4px;
872
+ cursor: pointer;
873
+ }
874
+
875
+ #agca_form .agca-radio-text.on {
876
+ color: #ccc;
877
+ }
878
+
879
+ #agca_form .agca-radio-text.off {
880
+ color: #ccc;
881
+ }
882
+
883
+ #agca_form .agca-radiobox:before {
884
+ font-family: Dashicons;
885
+ content: "\f159";
886
+ font-size: 30px;
887
+ line-height: 30px;
888
+ }
889
+
890
+ #agca_form .agca-radiobox.checked:before {
891
+ content: "\f502";
892
+ }
893
+
894
+ #agca_form .agca-radiobox.checked[value=off]:before {
895
+ content: "\f153";
896
+ }
897
+
898
+ #agca_form .agca-radiobox[value=on]:before {
899
+ color: #ACC491;
900
+ }
901
+
902
+ #agca_form .agca-radiobox[value=off]:before {
903
+ color: #ccc;
904
+ }
905
+
906
+ #agca_form #section_templates {
907
+ background: transparent;
908
+ }
909
+
910
+ #wp-admin-bar-agca-admin-themes a {
911
+ color: #def7c3 !important;
912
+ }
913
+
914
+ #wp-admin-bar-agca-admin-themes .ab-icon:before {
915
+ font-family: "dashicons";
916
+ content: "\f100";
917
+ margin-top: 2px;
918
+ display: block;
919
+ color: #eef9d5 !important;
920
+ }
921
+
922
+ .agca-feedback-and-support a {
923
+ border: medium none;
924
+ border-radius: 4px;
925
+ color: #FFFFFF !important;
926
+ padding: 6px 20px;
927
+ min-width: 258px;
928
+ background: #23395B;
929
+ display: inline-block;
930
+ font-weight: normal !important;
931
+ text-decoration: none;
932
+ transition: all .3s;
933
+ }
934
+
935
+ .agca-feedback-and-support .upgrade a{
936
+ background: #f9f9f9;
937
+ color: #23395B !important;
938
+ float: left;
939
+ border: 1px solid #23395B;
940
+ padding: 5px 30px 5px 9px;
941
+ }
942
+
943
+ .agca-feedback-and-support .upgrade a:hover .cusmin-spinner {
944
+ -webkit-animation-play-state: running;
945
+ animation-play-state: running;
946
+ }
947
+
948
+ .agca-feedback-and-support .upgrade span{
949
+ display: block;
950
+ float: left;
951
+ padding: 25px;
952
+ padding-left: 0;
953
+ }
954
+ .agca-feedback-and-support .upgrade img{
955
+ width: 50px;
956
+ height: auto;
957
+ float: left;
958
+ display: inline-block;
959
+ margin-left: -5px;
960
+ padding: 10px;
961
+ }
962
+
963
+ .agca-feedback-and-support a:hover {
964
+ background-color: var(--agca-color-secondary);
965
+ color: var(--agca-color-dark) !important;
966
+ }
967
+ .agca-feedback-and-support .upgrade a:hover{
968
+ background-color: #fff;
969
+ color: #23395B;
970
+ box-shadow: 1px 1px 1px #ddd;
971
+ }
972
+ #agca-your-feedback {
973
+ float: right;
974
+ width: 160px;
975
+ margin-top: -10px;
976
+ display: none;
977
+ }
978
+
979
+ #agca-your-feedback .dashicons {
980
+ font-size: 24px;
981
+ padding: 0 3px;
982
+ line-height: 18px;
983
+ }
984
+
985
+ #agca-your-feedback a {
986
+ text-decoration: none;
987
+ }
988
+
989
+ #agca-your-feedback a {
990
+ text-decoration: none;
991
+ }
992
+
993
+ #agca-your-feedback .feedback.negative {
994
+ color: #f08080;
995
+ }
996
+
997
+ #agca-your-feedback .feedback.negative:hover {
998
+ color: red;
999
+ }
1000
+
1001
+ #agca-your-feedback .feedback.positive {
1002
+ color: #ACC491;
1003
+ }
1004
+
1005
+ #agca-your-feedback .feedback.positive:hover {
1006
+ color: green;
1007
+ }
1008
+
1009
+ #agca_donate_button {
1010
+ margin-left: 5px;
1011
+ margin-top: 3px;
1012
+ display: none;
1013
+ }
1014
+ #agca_donate_button img{
1015
+ width: 125px;
1016
+ margin-top: -8px;
1017
+ }
1018
+
1019
+ .agca-donate-btn {
1020
+ background: #139a13;
1021
+ color: #fff;
1022
+ padding: 0 7px;
1023
+ border-radius: 3px;
1024
+ font-size: 11px;
1025
+ text-decoration: none;
1026
+ transform: translateY(-10px);
1027
+ display: inline-block;
1028
+ font-weight: bold;
1029
+ border: 1px solid #139a13;
1030
+ transition: all .3s;
1031
+ }
1032
+
1033
+ .agca-donate-btn:hover {
1034
+ border-color: var(--agca-color-dark);
1035
+ color: var(--agca-color-dark);
1036
+ background: transparent;
1037
+ }
1038
+
1039
+ .agca-donate-btn:hover .heart {
1040
+ color: red;
1041
+ }
1042
+
1043
+ #section_ag_colorizer_settings .color input {
1044
+ border-radius: 5px;
1045
+ border-color: var(--agca-color-dark);
1046
+ }
1047
+
1048
+ #section_ag_colorizer_settings .color input:hover {
1049
+ border-color: var(--agca-color-dark);
1050
+ }
1051
+
1052
+ #section_ag_colorizer_settings .color .agca_button {
1053
+ cursor: pointer;
1054
+ }
1055
+
1056
+ #section_ag_colorizer_settings .color .agca_button span {
1057
+ font-size: 35px;
1058
+ padding: 0 6px;
1059
+ color: #23395B;
1060
+ }
1061
+
1062
+ #section_ag_colorizer_settings .color .agca_button span:hover {
1063
+ color: var(--agca-color-secondary);
1064
+ }
1065
+
1066
+ #section_ag_colorizer_settings .color .agca_button span.clear {
1067
+ color: #23395B;
1068
+ }
1069
+
1070
+ #section_ag_colorizer_settings .color .agca_button span.clear:hover {
1071
+ color: red;
1072
+ }
1073
+ /*Hide dashboard empty box containers*/
1074
+ #dashboard-widgets div.empty-container{
1075
+ display: none;
1076
+ }
1077
+
1078
+ .tools_page_ag-custom-admin-plugin #wpwrap{
1079
+ background: #fff;
1080
+
1081
+ }
1082
+ .tools_page_ag-custom-admin-plugin #agca_form{
1083
+ font-family: 'Comfortaa', sans-serif;
1084
+ font-weight: 300;
1085
+ }
1086
+
1087
+ .tools_page_ag-custom-admin-plugin #agca_form *:focus {
1088
+ outline: none !important;
1089
+ box-shadow: none !important;
1090
+ }
1091
+
1092
+ .agca_template_block h3,
1093
+ .agca_template_block span.price,
1094
+ .agca_template_block a{
1095
+ color: inherit !important;
1096
+ }
1097
+ #agca_template_popup .agca_content{
1098
+ background: #bbb !important;
1099
+ }
1100
+
1101
+ .agca_template_block .template img{
1102
+ box-shadow: none !important;
1103
+ }
1104
+
1105
+ #agca_form #ag_edit_adminmenu tr.top td{
1106
+ background: var(--agca-color-gray);
1107
+ filter: brightness(1.1);
1108
+ padding-top: 10px;
1109
+ padding-bottom: 0;
1110
+ }
1111
+ #agca_form #ag_edit_adminmenu tr.top td.ag_admin_menu_parent2{
1112
+ padding-top: 1px;
1113
+ padding-bottom: 1px;
1114
+ padding-left: 0;
1115
+ padding-right: 0;
1116
+ }
1117
+
1118
+ #agca_form #ag_edit_adminmenu input[type=text] {
1119
+ width: 100%;
1120
+ }
1121
+ #agca_form #ag_edit_adminmenu tr.top:nth-child(odd) td{
1122
+ background: var(--agca-color-secondary);
1123
+ }
1124
+ #agca_form #ag_edit_adminmenu tr.sub {
1125
+ transition: all .3s;
1126
+ }
1127
+ #agca_form #ag_edit_adminmenu tr.sub td{
1128
+ background: #fff;
1129
+ padding: 0;
1130
+ }
1131
+ #agca_form #ag_edit_adminmenu tr.sub td div a{
1132
+ padding: 17px;
1133
+ display: inline-block;
1134
+ }
1135
+
1136
+ #agca_form #ag_edit_adminmenu tr:first-child td{
1137
+ background: #23395B;
1138
+ }
1139
+
1140
+ #agca_form #import_file_area .agca_button{
1141
+ margin-bottom: 5px;
1142
  }
uninstall.php CHANGED
@@ -1,92 +1,92 @@
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
- delete_option( 'agca_login_round_box_skip_logo' );
39
-
40
-
41
- delete_option( 'agca_dashboard_icon' );
42
- delete_option( 'agca_dashboard_text' );
43
- delete_option( 'agca_dashboard_text_paragraph' );
44
- delete_option( 'agca_dashboard_widget_welcome' );
45
- delete_option( 'agca_dashboard_widget_il' );
46
- delete_option( 'agca_dashboard_widget_plugins' );
47
- delete_option( 'agca_dashboard_widget_qp' );
48
- delete_option( 'agca_dashboard_widget_rn' );
49
- delete_option( 'agca_dashboard_widget_rd' );
50
- delete_option( 'agca_dashboard_widget_primary' );
51
- delete_option( 'agca_dashboard_widget_secondary' );
52
- delete_option( 'agca_dashboard_widget_activity' );
53
-
54
- //WP3.3
55
- delete_option( 'agca_admin_bar_comments' );
56
- delete_option( 'agca_admin_bar_new_content' );
57
- delete_option( 'agca_admin_bar_new_content_post' );
58
- delete_option( 'agca_admin_bar_new_content_link' );
59
- delete_option( 'agca_admin_bar_new_content_page' );
60
- delete_option( 'agca_admin_bar_new_content_user' );
61
- delete_option( 'agca_admin_bar_new_content_media' );
62
- delete_option( 'agca_admin_bar_update_notifications' );
63
- delete_option( 'agca_admin_bar_admin_themes' );
64
- delete_option( 'agca_remove_top_bar_dropdowns' );
65
-
66
- /*Admin menu*/
67
- delete_option( 'agca_admin_menu_turnonoff' );
68
- delete_option( 'agca_admin_menu_agca_button_only' );
69
- delete_option( 'agca_admin_menu_separator_first' );
70
- delete_option( 'agca_admin_menu_separator_second' );
71
- delete_option( 'agca_admin_menu_icons' );
72
- delete_option( 'agca_admin_menu_arrow' );
73
- delete_option( 'agca_admin_menu_submenu_round' );
74
- delete_option( 'agca_admin_menu_submenu_round_size' );
75
- delete_option( 'agca_admin_menu_brand' );
76
- delete_option( 'agca_admin_menu_brand_link' );
77
- delete_option( 'agca_admin_menu_autofold' );
78
- delete_option( 'ag_edit_adminmenu_json' );
79
- delete_option( 'ag_edit_adminmenu_json_new' );
80
- delete_option( 'ag_add_adminmenu_json' );
81
- delete_option( 'ag_colorizer_json' );
82
- delete_option( 'agca_colorizer_turnonoff' );
83
-
84
- delete_option( 'agca_custom_js' );
85
- delete_option( 'agca_custom_css' );
86
-
87
- delete_option( 'agca_selected_template' );
88
- delete_option( 'agca_templates' );
89
- delete_option( 'agca_disablewarning' );
90
- delete_option( 'agca_disable_postver' );
91
- delete_option( 'agca_menu_remove_client_profile' );
92
  ?>
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
+ delete_option( 'agca_login_round_box_skip_logo' );
39
+
40
+
41
+ delete_option( 'agca_dashboard_icon' );
42
+ delete_option( 'agca_dashboard_text' );
43
+ delete_option( 'agca_dashboard_text_paragraph' );
44
+ delete_option( 'agca_dashboard_widget_welcome' );
45
+ delete_option( 'agca_dashboard_widget_il' );
46
+ delete_option( 'agca_dashboard_widget_plugins' );
47
+ delete_option( 'agca_dashboard_widget_qp' );
48
+ delete_option( 'agca_dashboard_widget_rn' );
49
+ delete_option( 'agca_dashboard_widget_rd' );
50
+ delete_option( 'agca_dashboard_widget_primary' );
51
+ delete_option( 'agca_dashboard_widget_secondary' );
52
+ delete_option( 'agca_dashboard_widget_activity' );
53
+
54
+ //WP3.3
55
+ delete_option( 'agca_admin_bar_comments' );
56
+ delete_option( 'agca_admin_bar_new_content' );
57
+ delete_option( 'agca_admin_bar_new_content_post' );
58
+ delete_option( 'agca_admin_bar_new_content_link' );
59
+ delete_option( 'agca_admin_bar_new_content_page' );
60
+ delete_option( 'agca_admin_bar_new_content_user' );
61
+ delete_option( 'agca_admin_bar_new_content_media' );
62
+ delete_option( 'agca_admin_bar_update_notifications' );
63
+ delete_option( 'agca_admin_bar_admin_themes' );
64
+ delete_option( 'agca_remove_top_bar_dropdowns' );
65
+
66
+ /*Admin menu*/
67
+ delete_option( 'agca_admin_menu_turnonoff' );
68
+ delete_option( 'agca_admin_menu_agca_button_only' );
69
+ delete_option( 'agca_admin_menu_separator_first' );
70
+ delete_option( 'agca_admin_menu_separator_second' );
71
+ delete_option( 'agca_admin_menu_icons' );
72
+ delete_option( 'agca_admin_menu_arrow' );
73
+ delete_option( 'agca_admin_menu_submenu_round' );
74
+ delete_option( 'agca_admin_menu_submenu_round_size' );
75
+ delete_option( 'agca_admin_menu_brand' );
76
+ delete_option( 'agca_admin_menu_brand_link' );
77
+ delete_option( 'agca_admin_menu_autofold' );
78
+ delete_option( 'ag_edit_adminmenu_json' );
79
+ delete_option( 'ag_edit_adminmenu_json_new' );
80
+ delete_option( 'ag_add_adminmenu_json' );
81
+ delete_option( 'ag_colorizer_json' );
82
+ delete_option( 'agca_colorizer_turnonoff' );
83
+
84
+ delete_option( 'agca_custom_js' );
85
+ delete_option( 'agca_custom_css' );
86
+
87
+ delete_option( 'agca_selected_template' );
88
+ delete_option( 'agca_templates' );
89
+ delete_option( 'agca_disablewarning' );
90
+ delete_option( 'agca_disable_postver' );
91
+ delete_option( 'agca_menu_remove_client_profile' );
92
  ?>