Version Description
| April 29, 2022 = * Version 4.0 is a complete refactor of Erident Custom Login & Dashboard with a modern look and a much improved user experience. For even more options, check out Ultimate Dashboard.
Download this release
Release Info
Developer | davidvongries |
Plugin | Erident Custom Login and Dashboard |
Version | 4.0 |
Comparing to | |
See all releases |
Code changes from version 3.5.9 to 4.0
- ajax/class-load-default-settings.php +49 -0
- ajax/class-reset-settings.php +46 -0
- ajax/class-save-settings.php +80 -0
- assets/css/admin.css +307 -0
- assets/css/heatbox.css +481 -0
- assets/images/default-logo.png +0 -0
- assets/images/erident-logo.png +0 -0
- assets/images/logo.png +0 -0
- assets/images/page-builder-framework.jpg +0 -0
- assets/images/swift-control.jpg +0 -0
- assets/images/ultimate-dashboard.jpg +0 -0
- assets/js/settings-page.js +594 -0
- assets/js/wp-color-picker-alpha.js +453 -0
- class-output.php +141 -0
- class-setup.php +265 -0
- composer.json +10 -0
- composer.lock +72 -0
- er-admin.css +0 -113
- er-custom-login.php +74 -1061
- farbtastic/farbtastic.css +0 -51
- farbtastic/marker.png +0 -0
- farbtastic/mask.png +0 -0
- farbtastic/wheel.png +0 -0
- helpers/class-export.php +37 -0
- helpers/class-import.php +45 -0
- helpers/helpers.php +101 -0
- images/default-logo.png +0 -0
- images/form_bg.jpg +0 -0
- images/top_bg.jpg +0 -0
- inc/login.css.php +284 -0
- readme.txt +185 -185
- templates/setting-boxes/dashboard-settings.php +61 -0
- templates/setting-boxes/export-settings.php +24 -0
- templates/setting-boxes/import-settings.php +30 -0
- templates/setting-boxes/login-bg-settings.php +154 -0
- templates/setting-boxes/login-footer-link-settings.php +52 -0
- templates/setting-boxes/login-form-bg-settings.php +145 -0
- templates/setting-boxes/login-form-button-settings.php +61 -0
- templates/setting-boxes/login-form-input-settings.php +62 -0
- templates/setting-boxes/login-form-label-settings.php +62 -0
- templates/setting-boxes/login-form-layout-settings.php +168 -0
- templates/setting-boxes/login-form-link-settings.php +81 -0
- templates/setting-boxes/login-logo-settings.php +99 -0
- templates/setting-boxes/misc-settings.php +43 -0
- templates/settings-template.php +190 -0
- vendor/aristath/ari-color/LICENSE +339 -0
- vendor/aristath/ari-color/aricolor.php +1017 -0
- vendor/autoload.php +7 -0
- vendor/composer/ClassLoader.php +572 -0
- vendor/composer/InstalledVersions.php +350 -0
- vendor/composer/LICENSE +21 -0
- vendor/composer/autoload_classmap.php +11 -0
- vendor/composer/autoload_namespaces.php +9 -0
- vendor/composer/autoload_psr4.php +9 -0
- vendor/composer/autoload_real.php +57 -0
- vendor/composer/autoload_static.php +21 -0
- vendor/composer/installed.json +62 -0
- vendor/composer/installed.php +32 -0
- vendor/composer/platform_check.php +26 -0
ajax/class-load-default-settings.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Load default settings.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard\Ajax;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class to handle ajax request of loading default settings.
|
14 |
+
*/
|
15 |
+
class Load_Default_Settings {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Class constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
add_action( 'wp_ajax_cldashboard_load_default_settings', [ $this, 'load_default_settings' ] );
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Load default settings.
|
28 |
+
*/
|
29 |
+
public function load_default_settings() {
|
30 |
+
|
31 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
32 |
+
|
33 |
+
if ( ! wp_verify_nonce( $nonce, 'cldashboard_nonce_load_default_settings' ) ) {
|
34 |
+
wp_send_json_error( __( 'Invalid token', 'erident-custom-login-and-dashboard' ), 401 );
|
35 |
+
}
|
36 |
+
|
37 |
+
$default_settings = cldashboard_get_field_default_values();
|
38 |
+
update_option( 'plugin_erident_settings', $default_settings );
|
39 |
+
|
40 |
+
wp_send_json_success(
|
41 |
+
[
|
42 |
+
'message' => __( 'Settings have been replaced', 'erident-custom-login-and-dashboard' ),
|
43 |
+
'settings' => $default_settings,
|
44 |
+
]
|
45 |
+
);
|
46 |
+
|
47 |
+
}
|
48 |
+
|
49 |
+
}
|
ajax/class-reset-settings.php
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Reset settings.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard\Ajax;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class to handle ajax request of settings reset.
|
14 |
+
*/
|
15 |
+
class Reset_Settings {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Class constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
add_action( 'wp_ajax_cldashboard_reset_settings', [ $this, 'reset' ] );
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Reset settings.
|
28 |
+
*/
|
29 |
+
public function reset() {
|
30 |
+
|
31 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
32 |
+
$role = isset( $_POST['type'] ) ? $_POST['type'] : 'all';
|
33 |
+
|
34 |
+
if ( ! wp_verify_nonce( $nonce, 'cldashboard_nonce_reset_settings' ) ) {
|
35 |
+
wp_send_json_error( __( 'Invalid token', 'erident-custom-login-and-dashboard' ), 401 );
|
36 |
+
}
|
37 |
+
|
38 |
+
if ( 'all' === $role ) {
|
39 |
+
delete_option( 'plugin_erident_settings' );
|
40 |
+
}
|
41 |
+
|
42 |
+
wp_send_json_success( __( 'Settings have been reset', 'erident-custom-login-and-dashboard' ) );
|
43 |
+
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
ajax/class-save-settings.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Save settings.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard\Ajax;
|
9 |
+
|
10 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Class to handle ajax request of settings saving.
|
14 |
+
*/
|
15 |
+
class Save_Settings {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Class constructor.
|
19 |
+
*/
|
20 |
+
public function __construct() {
|
21 |
+
|
22 |
+
add_action( 'wp_ajax_cldashboard_save_settings', [ $this, 'save' ] );
|
23 |
+
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Save menu.
|
28 |
+
*/
|
29 |
+
public function save() {
|
30 |
+
$nonce = isset( $_POST['nonce'] ) ? $_POST['nonce'] : '';
|
31 |
+
|
32 |
+
if ( ! wp_verify_nonce( $nonce, 'cldashboard_nonce_save_settings' ) ) {
|
33 |
+
wp_send_json_error( __( 'Invalid token', 'erident-custom-login-and-dashboard' ), 401 );
|
34 |
+
}
|
35 |
+
|
36 |
+
$available_fields = cldashboard_get_field_data_types();
|
37 |
+
|
38 |
+
$raw_post_data = $_POST;
|
39 |
+
$post_data = [];
|
40 |
+
|
41 |
+
foreach ( $available_fields as $field => $value_type ) {
|
42 |
+
if ( isset( $raw_post_data[ $field ] ) ) {
|
43 |
+
$value = $raw_post_data[ $field ];
|
44 |
+
|
45 |
+
switch ( $value_type ) {
|
46 |
+
case 'int':
|
47 |
+
$post_data[ $field ] = absint( $value );
|
48 |
+
break;
|
49 |
+
|
50 |
+
case 'float':
|
51 |
+
$post_data[ $field ] = floatval( $value );
|
52 |
+
break;
|
53 |
+
|
54 |
+
case 'bool':
|
55 |
+
$value = (bool) $value;
|
56 |
+
|
57 |
+
if ( $value ) {
|
58 |
+
$post_data[ $field ] = 1;
|
59 |
+
}
|
60 |
+
|
61 |
+
break;
|
62 |
+
|
63 |
+
default:
|
64 |
+
$post_data[ $field ] = sanitize_text_field( $value );
|
65 |
+
break;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
/**
|
71 |
+
* Update settings.
|
72 |
+
* If the value of a field is not set, then it will be deleted from the database.
|
73 |
+
* So that the database will not contain empty fields.
|
74 |
+
*/
|
75 |
+
update_option( 'plugin_erident_settings', $post_data );
|
76 |
+
|
77 |
+
wp_send_json_success( __( 'Settings have been saved', 'erident-custom-login-and-dashboard' ) );
|
78 |
+
}
|
79 |
+
|
80 |
+
}
|
assets/css/admin.css
ADDED
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* --------------------------------------------------
|
3 |
+
* Animation
|
4 |
+
* --------------------------------------------------
|
5 |
+
*/
|
6 |
+
@-webkit-keyframes loadingSpinAround {
|
7 |
+
from {
|
8 |
+
transform: rotate(0);
|
9 |
+
}
|
10 |
+
to {
|
11 |
+
transform: rotate(359deg);
|
12 |
+
}
|
13 |
+
}
|
14 |
+
@keyframes loadingSpinAround {
|
15 |
+
from {
|
16 |
+
transform: rotate(0);
|
17 |
+
}
|
18 |
+
to {
|
19 |
+
transform: rotate(359deg);
|
20 |
+
}
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* --------------------------------------------------
|
25 |
+
* Heatbox adjustment
|
26 |
+
* --------------------------------------------------
|
27 |
+
*/
|
28 |
+
/* exists to display the updated icon */
|
29 |
+
.heatbox h2 {
|
30 |
+
position: relative;
|
31 |
+
}
|
32 |
+
|
33 |
+
.heatbox-cols {
|
34 |
+
display: flex;
|
35 |
+
flex-wrap: wrap;
|
36 |
+
}
|
37 |
+
|
38 |
+
.heatbox-group .heatbox:not(:first-child) {
|
39 |
+
margin-top: -21px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.heatbox-group .heatbox:not(:first-child) h2 {
|
43 |
+
background-color: #f7f7f7;
|
44 |
+
border-top-width: 0;
|
45 |
+
}
|
46 |
+
|
47 |
+
/**
|
48 |
+
* ------------------------------
|
49 |
+
* Setting fields
|
50 |
+
* ------------------------------
|
51 |
+
*/
|
52 |
+
.setting-fields {
|
53 |
+
padding: 25px 15px;
|
54 |
+
}
|
55 |
+
|
56 |
+
.setting-fields.is-gapless {
|
57 |
+
padding: 0;
|
58 |
+
}
|
59 |
+
|
60 |
+
.setting-fields .label {
|
61 |
+
display: block;
|
62 |
+
font-weight: 600;
|
63 |
+
}
|
64 |
+
|
65 |
+
.setting-fields .description {
|
66 |
+
font-weight: 400;
|
67 |
+
}
|
68 |
+
|
69 |
+
hr {
|
70 |
+
margin: 20px 0;
|
71 |
+
border-top: 1px solid #eee;
|
72 |
+
border-bottom: 0;
|
73 |
+
}
|
74 |
+
|
75 |
+
.setting-fields .field:last-child {
|
76 |
+
margin-bottom: 0;
|
77 |
+
}
|
78 |
+
|
79 |
+
.setting-fields .field {
|
80 |
+
margin-bottom: 20px;
|
81 |
+
}
|
82 |
+
|
83 |
+
.field.is-horizontal {
|
84 |
+
display: flex;
|
85 |
+
flex-wrap: wrap;
|
86 |
+
align-items: center;
|
87 |
+
}
|
88 |
+
|
89 |
+
.field.is-horizontal .field-label {
|
90 |
+
width: 30%;
|
91 |
+
}
|
92 |
+
|
93 |
+
.field.is-horizontal .field-body {
|
94 |
+
padding-left: 20px;
|
95 |
+
width: 70%;
|
96 |
+
}
|
97 |
+
|
98 |
+
.general-setting-field[type="text"] {
|
99 |
+
width: 500px;
|
100 |
+
}
|
101 |
+
|
102 |
+
.general-setting-field.is-small {
|
103 |
+
width: 300px;
|
104 |
+
}
|
105 |
+
|
106 |
+
.general-setting-field.is-tiny {
|
107 |
+
width: 200px;
|
108 |
+
}
|
109 |
+
|
110 |
+
/**
|
111 |
+
* --------------------------------------------------
|
112 |
+
* Form Footer
|
113 |
+
* --------------------------------------------------
|
114 |
+
*/
|
115 |
+
.cldashboard-form-footer {
|
116 |
+
display: flex;
|
117 |
+
flex-wrap: wrap;
|
118 |
+
align-items: center;
|
119 |
+
}
|
120 |
+
|
121 |
+
.cldashboard-submit-area,
|
122 |
+
.cldashboard-reset-area {
|
123 |
+
display: flex;
|
124 |
+
align-items: center;
|
125 |
+
width: 50%;
|
126 |
+
}
|
127 |
+
|
128 |
+
.cldashboard-submit-area {
|
129 |
+
justify-content: flex-start;
|
130 |
+
}
|
131 |
+
|
132 |
+
.cldashboard-reset-area {
|
133 |
+
justify-content: flex-end;
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* --------------------------------------------------
|
138 |
+
* Button
|
139 |
+
* --------------------------------------------------
|
140 |
+
*/
|
141 |
+
.button.cldashboard-button {
|
142 |
+
display: inline-flex;
|
143 |
+
align-items: center;
|
144 |
+
justify-content: center;
|
145 |
+
}
|
146 |
+
|
147 |
+
.button.cldashboard-button.is-hidden {
|
148 |
+
display: none;
|
149 |
+
}
|
150 |
+
|
151 |
+
.button.cldashboard-button.is-loading {
|
152 |
+
justify-content: center;
|
153 |
+
color: transparent !important;
|
154 |
+
pointer-events: none;
|
155 |
+
}
|
156 |
+
|
157 |
+
.button.cldashboard-button.is-loading::after {
|
158 |
+
content: "";
|
159 |
+
position: absolute;
|
160 |
+
width: 1em;
|
161 |
+
display: block;
|
162 |
+
height: 1em;
|
163 |
+
border: 2px solid #dbdbdb;
|
164 |
+
border-color: transparent transparent #fff #fff !important;
|
165 |
+
border-radius: 290486px;
|
166 |
+
-webkit-animation: loadingSpinAround 0.5s infinite linear;
|
167 |
+
animation: loadingSpinAround 0.5s infinite linear;
|
168 |
+
}
|
169 |
+
|
170 |
+
.button.cldashboard-button.cldashboard-load-defaults-button.is-loading::after {
|
171 |
+
border: 2px solid #19629d;
|
172 |
+
border-color: transparent transparent #2271b1 #2271b1 !important;
|
173 |
+
}
|
174 |
+
|
175 |
+
.button.cldashboard-submit-button {
|
176 |
+
margin-right: 10px;
|
177 |
+
}
|
178 |
+
|
179 |
+
.button.cldashboard-reset-button {
|
180 |
+
margin-left: 10px;
|
181 |
+
margin-right: 10px;
|
182 |
+
color: #fff;
|
183 |
+
background-color: tomato;
|
184 |
+
border-color: tomato;
|
185 |
+
}
|
186 |
+
|
187 |
+
.button.cldashboard-reset-button:hover,
|
188 |
+
.button.cldashboard-reset-button:active,
|
189 |
+
.button.cldashboard-reset-button:focus {
|
190 |
+
color: #fff;
|
191 |
+
background-color: #f5492a;
|
192 |
+
border-color: #f5492a;
|
193 |
+
}
|
194 |
+
|
195 |
+
.cldashboard-reset-button:focus {
|
196 |
+
box-shadow: 0 0 0 1px #fff, 0 0 0 3px #f5492a;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* --------------------------------------------------
|
201 |
+
* Notice
|
202 |
+
* --------------------------------------------------
|
203 |
+
*/
|
204 |
+
.cldashboard-notice {
|
205 |
+
font-weight: 500;
|
206 |
+
opacity: 0;
|
207 |
+
visibility: hidden;
|
208 |
+
transition: 350ms all linear;
|
209 |
+
}
|
210 |
+
|
211 |
+
.cldashboard-notice.is-shown {
|
212 |
+
opacity: 1;
|
213 |
+
visibility: visible;
|
214 |
+
transition: 350ms all linear;
|
215 |
+
}
|
216 |
+
|
217 |
+
.cldashboard-notice.is-success {
|
218 |
+
color: rgb(28, 129, 28);
|
219 |
+
}
|
220 |
+
|
221 |
+
.cldashboard-notice.is-error {
|
222 |
+
color: tomato;
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* --------------------------------------------------
|
227 |
+
* Color picker
|
228 |
+
* --------------------------------------------------
|
229 |
+
*/
|
230 |
+
.iris-picker-inner {
|
231 |
+
display: grid;
|
232 |
+
grid-template-columns: 1fr 20px 20px;
|
233 |
+
grid-gap: 7px;
|
234 |
+
}
|
235 |
+
|
236 |
+
.iris-picker-inner > * {
|
237 |
+
width: 100% !important;
|
238 |
+
margin-left: 0 !important;
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* --------------------------------------------------
|
243 |
+
* Tools
|
244 |
+
* --------------------------------------------------
|
245 |
+
*/
|
246 |
+
.cldashboard-tools-container {
|
247 |
+
display: flex;
|
248 |
+
flex-wrap: wrap;
|
249 |
+
}
|
250 |
+
|
251 |
+
.cldashboard-tools-container .heatbox {
|
252 |
+
display: flex;
|
253 |
+
flex-direction: column;
|
254 |
+
flex: 0 49%;
|
255 |
+
margin-right: 2%;
|
256 |
+
}
|
257 |
+
|
258 |
+
.cldashboard-tools-container .heatbox:nth-child(even) {
|
259 |
+
margin-right: 0;
|
260 |
+
}
|
261 |
+
|
262 |
+
.cldashboard-tools-container p.submit {
|
263 |
+
margin-bottom: 0;
|
264 |
+
}
|
265 |
+
|
266 |
+
@media screen and (max-width: 768px) {
|
267 |
+
.cldashboard-tools-container .heatbox {
|
268 |
+
flex: 0 100%;
|
269 |
+
margin-right: 0;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
|
273 |
+
/**
|
274 |
+
* --------------------------------------------------
|
275 |
+
* Featured products
|
276 |
+
* --------------------------------------------------
|
277 |
+
*/
|
278 |
+
.featured-products > h2 {
|
279 |
+
text-align: center;
|
280 |
+
margin-bottom: 50px;
|
281 |
+
font-size: 24px;
|
282 |
+
}
|
283 |
+
|
284 |
+
.featured-products .products {
|
285 |
+
display: flex;
|
286 |
+
justify-content: space-between;
|
287 |
+
flex-wrap: wrap;
|
288 |
+
}
|
289 |
+
|
290 |
+
.featured-products .products li {
|
291 |
+
width: 32%;
|
292 |
+
}
|
293 |
+
|
294 |
+
.featured-products .products .subheadline {
|
295 |
+
font-weight: 600;
|
296 |
+
margin-top: -6px;
|
297 |
+
}
|
298 |
+
|
299 |
+
.featured-products .products img {
|
300 |
+
max-width: 100%;
|
301 |
+
}
|
302 |
+
|
303 |
+
.featured-products .credit {
|
304 |
+
margin-top: 20px;
|
305 |
+
text-align: center;
|
306 |
+
opacity: 0.5;
|
307 |
+
}
|
assets/css/heatbox.css
ADDED
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* Init */
|
2 |
+
.heatbox-wrap,
|
3 |
+
.heatbox-wrap * {
|
4 |
+
-webkit-box-sizing: border-box;
|
5 |
+
box-sizing: border-box;
|
6 |
+
}
|
7 |
+
|
8 |
+
.heatbox-admin.has-header .update-nag {
|
9 |
+
display: none;
|
10 |
+
}
|
11 |
+
|
12 |
+
.heatbox-admin.has-header #wpcontent {
|
13 |
+
padding-left: 0 !important;
|
14 |
+
padding-right: 0 !important;
|
15 |
+
}
|
16 |
+
|
17 |
+
.heatbox-admin.has-header .wrap {
|
18 |
+
margin: 0;
|
19 |
+
}
|
20 |
+
|
21 |
+
/* Tab navigation */
|
22 |
+
.heatbox-tab-nav {
|
23 |
+
padding: 20px 0;
|
24 |
+
margin: 10px 0 0 0;
|
25 |
+
}
|
26 |
+
|
27 |
+
.heatbox-tab-nav li {
|
28 |
+
display: inline-flex;
|
29 |
+
padding: 10px 30px 10px 0;
|
30 |
+
font-weight: 600;
|
31 |
+
font-size: 20px;
|
32 |
+
}
|
33 |
+
|
34 |
+
.heatbox-tab-nav li a {
|
35 |
+
color: #23282d;
|
36 |
+
text-decoration: none;
|
37 |
+
}
|
38 |
+
|
39 |
+
.heatbox-tab-nav li.active a {
|
40 |
+
color: #0073aa;
|
41 |
+
}
|
42 |
+
|
43 |
+
/* Divider */
|
44 |
+
.heatbox-divider {
|
45 |
+
width: 100%;
|
46 |
+
height: 1px;
|
47 |
+
margin: 40px 0;
|
48 |
+
background: #ccc;
|
49 |
+
}
|
50 |
+
|
51 |
+
@media screen and (max-width: 991px) {
|
52 |
+
.heatbox-divider {
|
53 |
+
margin: 20px 0;
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
/* Container */
|
58 |
+
.heatbox-container {
|
59 |
+
max-width: 1200px;
|
60 |
+
padding: 0 20px;
|
61 |
+
}
|
62 |
+
|
63 |
+
.heatbox-container-wide {
|
64 |
+
max-width: 1400px;
|
65 |
+
}
|
66 |
+
|
67 |
+
.heatbox-container-center {
|
68 |
+
margin: 0 auto;
|
69 |
+
}
|
70 |
+
|
71 |
+
/* Header */
|
72 |
+
.heatbox-header {
|
73 |
+
background: #fff;
|
74 |
+
padding-top: 40px;
|
75 |
+
border-bottom: 1px solid #ddd;
|
76 |
+
}
|
77 |
+
|
78 |
+
.heatbox-header.heatbox-has-tab-nav .logo-container {
|
79 |
+
margin-bottom: 0;
|
80 |
+
}
|
81 |
+
|
82 |
+
.heatbox-header .logo-container {
|
83 |
+
display: flex;
|
84 |
+
align-items: center;
|
85 |
+
margin-bottom: 40px;
|
86 |
+
}
|
87 |
+
|
88 |
+
.heatbox-header .logo-container div {
|
89 |
+
width: 50%;
|
90 |
+
}
|
91 |
+
|
92 |
+
.heatbox-header .logo-container .heatbox-logo-wide img {
|
93 |
+
width: 180px;
|
94 |
+
}
|
95 |
+
|
96 |
+
.heatbox-header .logo-container img {
|
97 |
+
width: 100px;
|
98 |
+
height: auto;
|
99 |
+
float: right;
|
100 |
+
}
|
101 |
+
|
102 |
+
.heatbox-header .tab-navigation {
|
103 |
+
margin: -20px 0 20px 0;
|
104 |
+
padding: 0;
|
105 |
+
}
|
106 |
+
|
107 |
+
.heatbox-header .tab-navigation li {
|
108 |
+
display: inline-flex;
|
109 |
+
padding: 10px 30px 10px 0;
|
110 |
+
font-weight: 600;
|
111 |
+
font-size: 20px;
|
112 |
+
}
|
113 |
+
|
114 |
+
.heatbox-header .tab-navigation li a {
|
115 |
+
color: #23282d;
|
116 |
+
text-decoration: none;
|
117 |
+
}
|
118 |
+
|
119 |
+
.heatbox-header .tab-navigation li.active a {
|
120 |
+
color: #0073aa;
|
121 |
+
}
|
122 |
+
|
123 |
+
/* Title */
|
124 |
+
.heatbox-wrap .title {
|
125 |
+
margin: 0;
|
126 |
+
padding: 0;
|
127 |
+
font-size: 34px;
|
128 |
+
font-weight: 700;
|
129 |
+
line-height: 1;
|
130 |
+
}
|
131 |
+
|
132 |
+
.heatbox-wrap .subtitle {
|
133 |
+
margin: 20px 0 0 0;
|
134 |
+
padding: 0;
|
135 |
+
font-size: 20px;
|
136 |
+
line-height: 1;
|
137 |
+
}
|
138 |
+
|
139 |
+
/* Version */
|
140 |
+
.heatbox-wrap .version {
|
141 |
+
font-size: 50%;
|
142 |
+
opacity: 0.6;
|
143 |
+
font-weight: 600;
|
144 |
+
background: #ccc;
|
145 |
+
border-radius: 5px;
|
146 |
+
padding: 5px 12px;
|
147 |
+
line-height: 1;
|
148 |
+
}
|
149 |
+
|
150 |
+
/* 2 Column Layout - Wrapper */
|
151 |
+
.heatbox-column-container {
|
152 |
+
display: flex;
|
153 |
+
flex-wrap: wrap;
|
154 |
+
}
|
155 |
+
|
156 |
+
/* 2 Column Layout - Main Content */
|
157 |
+
.heatbox-main {
|
158 |
+
width: 73%;
|
159 |
+
margin-right: 2%;
|
160 |
+
}
|
161 |
+
|
162 |
+
/* 2 Column Layout - Sidebar */
|
163 |
+
.heatbox-sidebar {
|
164 |
+
width: 25%;
|
165 |
+
}
|
166 |
+
|
167 |
+
/* 2 Column Layout - Responsiveness */
|
168 |
+
@media screen and (max-width: 991px) {
|
169 |
+
.heatbox-main, .heatbox-sidebar {
|
170 |
+
width: 100%;
|
171 |
+
}
|
172 |
+
.heatbox-main {
|
173 |
+
margin-right: 0;
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
/* Panels */
|
178 |
+
.heatbox-admin-panel {
|
179 |
+
display: none;
|
180 |
+
}
|
181 |
+
|
182 |
+
/* Heatbox */
|
183 |
+
.heatbox {
|
184 |
+
background: #fff;
|
185 |
+
margin-bottom: 20px;
|
186 |
+
border: 1px solid #ddd;
|
187 |
+
}
|
188 |
+
|
189 |
+
.heatbox h2 {
|
190 |
+
border-bottom: 1px solid #ddd;
|
191 |
+
margin: 0;
|
192 |
+
padding: 20px;
|
193 |
+
}
|
194 |
+
|
195 |
+
.heatbox.is-grouped h2 {
|
196 |
+
border-top: 1px solid #ddd;
|
197 |
+
}
|
198 |
+
|
199 |
+
.heatbox.is-grouped h2:first-child {
|
200 |
+
border-top: none;
|
201 |
+
}
|
202 |
+
|
203 |
+
.heatbox h3 {
|
204 |
+
margin: 0 0 10px 0;
|
205 |
+
}
|
206 |
+
|
207 |
+
.heatbox p {
|
208 |
+
margin: 0 0 20px 0;
|
209 |
+
}
|
210 |
+
|
211 |
+
.heatbox-content {
|
212 |
+
margin: 0;
|
213 |
+
padding: 20px;
|
214 |
+
}
|
215 |
+
|
216 |
+
.heatbox-content p:first-child {
|
217 |
+
margin-top: 0;
|
218 |
+
}
|
219 |
+
|
220 |
+
/* Margins */
|
221 |
+
.heatbox-margin-top {
|
222 |
+
margin-top: 20px;
|
223 |
+
}
|
224 |
+
|
225 |
+
.heatbox-margin-bottom {
|
226 |
+
margin-bottom: 20px;
|
227 |
+
}
|
228 |
+
|
229 |
+
/* Paddings */
|
230 |
+
.heatbox-margin-top {
|
231 |
+
margin-top: 20px;
|
232 |
+
}
|
233 |
+
|
234 |
+
.heatbox-margin-bottom {
|
235 |
+
margin-bottom: 20px;
|
236 |
+
}
|
237 |
+
|
238 |
+
/* Buttons */
|
239 |
+
.heatbox-wrap .button-larger {
|
240 |
+
padding: 5px 20px;
|
241 |
+
}
|
242 |
+
|
243 |
+
.heatbox-wrap .button-full {
|
244 |
+
width: 100%;
|
245 |
+
text-align: center;
|
246 |
+
}
|
247 |
+
|
248 |
+
/* Settings */
|
249 |
+
.heatbox .form-table {
|
250 |
+
margin: 0;
|
251 |
+
}
|
252 |
+
|
253 |
+
.heatbox .form-table th,
|
254 |
+
.heatbox .form-table td {
|
255 |
+
padding: 20px;
|
256 |
+
vertical-align: top;
|
257 |
+
}
|
258 |
+
|
259 |
+
.heatbox .form-table th .description {
|
260 |
+
margin-top: 10px;
|
261 |
+
}
|
262 |
+
|
263 |
+
.heatbox .setting-fields {
|
264 |
+
|
265 |
+
}
|
266 |
+
|
267 |
+
.heatbox .setting-fields .setting-field {
|
268 |
+
margin-bottom: 7px;
|
269 |
+
}
|
270 |
+
|
271 |
+
.heatbox .setting-fields .setting-field:last-of-type {
|
272 |
+
margin-bottom: 0;
|
273 |
+
}
|
274 |
+
|
275 |
+
/* Submit button */
|
276 |
+
.heatbox-wrap p.submit {
|
277 |
+
margin: 20px 0;
|
278 |
+
padding: 0;
|
279 |
+
}
|
280 |
+
|
281 |
+
/**
|
282 |
+
* Checkboxes & Radio Buttons
|
283 |
+
* Copied & modified from https://codepen.io/KenanYusuf/pen/PZKEKd/
|
284 |
+
*/
|
285 |
+
.heatbox .label {
|
286 |
+
display: inline-block;
|
287 |
+
position: relative;
|
288 |
+
cursor: pointer;
|
289 |
+
}
|
290 |
+
|
291 |
+
.heatbox .label input {
|
292 |
+
position: absolute;
|
293 |
+
z-index: -1;
|
294 |
+
opacity: 0;
|
295 |
+
}
|
296 |
+
|
297 |
+
.heatbox .label .indicator {
|
298 |
+
position: absolute;
|
299 |
+
top: 0;
|
300 |
+
left: 0;
|
301 |
+
height: 20px;
|
302 |
+
width: 20px;
|
303 |
+
background-color: #e6e6e6;
|
304 |
+
-webkit-transition: all 0.2s ease-in-out;
|
305 |
+
transition: all 0.2s ease-in-out;
|
306 |
+
}
|
307 |
+
|
308 |
+
.heatbox .radio-label .indicator {
|
309 |
+
border-radius: 50%;
|
310 |
+
}
|
311 |
+
|
312 |
+
.heatbox .label:hover input ~ .indicator,
|
313 |
+
.heatbox .label input:focus ~ .indicator {
|
314 |
+
background-color: #ccc;
|
315 |
+
}
|
316 |
+
|
317 |
+
.heatbox .label input:checked ~ .indicator {
|
318 |
+
background-color: #007cba;
|
319 |
+
}
|
320 |
+
|
321 |
+
.heatbox .label:hover input:not([disabled]):checked ~ .indicator,
|
322 |
+
.heatbox .label input:checked:focus ~ .indicator {
|
323 |
+
background-color: #00669b;
|
324 |
+
}
|
325 |
+
|
326 |
+
.heatbox .label input:disabled ~ .indicator {
|
327 |
+
background-color: #e6e6e6;
|
328 |
+
opacity: 0.6;
|
329 |
+
pointer-events: none;
|
330 |
+
}
|
331 |
+
|
332 |
+
.heatbox .label .indicator::after {
|
333 |
+
display: none;
|
334 |
+
position: absolute;
|
335 |
+
content: "";
|
336 |
+
}
|
337 |
+
|
338 |
+
.heatbox .label input:checked ~ .indicator::after {
|
339 |
+
display: block;
|
340 |
+
}
|
341 |
+
|
342 |
+
.heatbox .checkbox-label {
|
343 |
+
padding-left: 30px;
|
344 |
+
}
|
345 |
+
|
346 |
+
.heatbox .checkbox-label .indicator::after {
|
347 |
+
left: 8px;
|
348 |
+
top: 4px;
|
349 |
+
width: 3px;
|
350 |
+
height: 8px;
|
351 |
+
border: solid #fff;
|
352 |
+
border-width: 0 2px 2px 0;
|
353 |
+
transform: rotate(45deg);
|
354 |
+
}
|
355 |
+
|
356 |
+
.heatbox .checkbox-label input:disabled ~ .indicator::after {
|
357 |
+
border-color: #7b7b7b;
|
358 |
+
}
|
359 |
+
|
360 |
+
.heatbox .radio-label .indicator::after {
|
361 |
+
left: 7px;
|
362 |
+
top: 7px;
|
363 |
+
height: 6px;
|
364 |
+
width: 6px;
|
365 |
+
border-radius: 50%;
|
366 |
+
background-color: #fff;
|
367 |
+
}
|
368 |
+
|
369 |
+
.heatbox .radio-label input:disabled ~ .indicator::after {
|
370 |
+
background-color: #7b7b7b;
|
371 |
+
}
|
372 |
+
|
373 |
+
/* Call to action */
|
374 |
+
.heatbox-cta-container.is-attached {
|
375 |
+
padding: 20px;
|
376 |
+
background: #fff;
|
377 |
+
margin-top: -20px;
|
378 |
+
margin-bottom: 20px;
|
379 |
+
border: 1px solid #ddd;
|
380 |
+
border-top: none;
|
381 |
+
}
|
382 |
+
|
383 |
+
.heatbox-cta {
|
384 |
+
width: 100%;
|
385 |
+
display: flex;
|
386 |
+
justify-content: space-between;
|
387 |
+
align-items: center;
|
388 |
+
padding: 20px;
|
389 |
+
font-weight: 700;
|
390 |
+
border: 1px solid #ddd;
|
391 |
+
background: #fff;
|
392 |
+
}
|
393 |
+
|
394 |
+
.heatbox-cta > * {
|
395 |
+
margin: 0 !important;
|
396 |
+
}
|
397 |
+
|
398 |
+
.heatbox-cta .button {
|
399 |
+
padding: 5px 15px !important;
|
400 |
+
}
|
401 |
+
|
402 |
+
.heatbox-cta.primary {
|
403 |
+
background: #197cff;
|
404 |
+
color: #fff;
|
405 |
+
border: none;
|
406 |
+
}
|
407 |
+
|
408 |
+
.heatbox-cta.secondary {
|
409 |
+
background: #f1f1f1;
|
410 |
+
}
|
411 |
+
|
412 |
+
.heatbox-cta.primary .button {
|
413 |
+
background: rgba(0, 45, 96, 0.5);
|
414 |
+
}
|
415 |
+
|
416 |
+
.heatbox-cta.primary .button:hover {
|
417 |
+
background: rgba(0, 45, 96, 0.6);
|
418 |
+
}
|
419 |
+
|
420 |
+
/* RTL */
|
421 |
+
.rtl .heatbox-header .logo-container img {
|
422 |
+
float: left;
|
423 |
+
}
|
424 |
+
|
425 |
+
.rtl .heatbox-main {
|
426 |
+
margin-right: 0;
|
427 |
+
margin-left: 2%;
|
428 |
+
}
|
429 |
+
|
430 |
+
.rtl .heatbox .label .indicator {
|
431 |
+
left: auto;
|
432 |
+
right: -30px;
|
433 |
+
}
|
434 |
+
|
435 |
+
/* Tooltip */
|
436 |
+
.heatbox-tooltip {
|
437 |
+
position: relative;
|
438 |
+
cursor: pointer;
|
439 |
+
padding: 5px;
|
440 |
+
}
|
441 |
+
.heatbox-tooltip .tooltipcontent {
|
442 |
+
visibility: hidden;
|
443 |
+
opacity: 0;
|
444 |
+
width: 220px;
|
445 |
+
background-color: #fff;
|
446 |
+
text-align: center;
|
447 |
+
padding: 10px;
|
448 |
+
font-size: 12px;
|
449 |
+
-webkit-transition: all 0.2s ease-in-out;
|
450 |
+
transition: all 0.2s ease-in-out;
|
451 |
+
position: absolute;
|
452 |
+
left: -100px;
|
453 |
+
border: 1px solid #ddd;
|
454 |
+
bottom: 23px;
|
455 |
+
z-index: 1;
|
456 |
+
}
|
457 |
+
|
458 |
+
.heatbox-tooltip:hover .tooltipcontent {
|
459 |
+
visibility: visible;
|
460 |
+
opacity: 1;
|
461 |
+
bottom: 28px;
|
462 |
+
}
|
463 |
+
|
464 |
+
.heatbox-tooltip.has-image .tooltipcontent {
|
465 |
+
padding: 0;
|
466 |
+
text-align: left;
|
467 |
+
display: flex;
|
468 |
+
align-content: center;
|
469 |
+
align-items: center;
|
470 |
+
width: 370px;
|
471 |
+
}
|
472 |
+
|
473 |
+
.heatbox-tooltip.has-image .tooltipcontent img {
|
474 |
+
width: 35%;
|
475 |
+
border-right: 1px solid #eee;
|
476 |
+
}
|
477 |
+
|
478 |
+
.heatbox-tooltip.has-image .tooltipcontent span {
|
479 |
+
width: 65%;
|
480 |
+
padding: 20px;
|
481 |
+
}
|
assets/images/default-logo.png
ADDED
Binary file
|
assets/images/erident-logo.png
ADDED
Binary file
|
assets/images/logo.png
ADDED
Binary file
|
assets/images/page-builder-framework.jpg
ADDED
Binary file
|
assets/images/swift-control.jpg
ADDED
Binary file
|
assets/images/ultimate-dashboard.jpg
ADDED
Binary file
|
assets/js/settings-page.js
ADDED
@@ -0,0 +1,594 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* This script is intended to handle the settings page.
|
3 |
+
*
|
4 |
+
* @param {Object} $ jQuery object.
|
5 |
+
* @return {Object}
|
6 |
+
*/
|
7 |
+
(function ($) {
|
8 |
+
/**
|
9 |
+
* The settings form.
|
10 |
+
*
|
11 |
+
* @var HTMLElement
|
12 |
+
*/
|
13 |
+
var form = document.querySelector(".cldashboard-settings-form");
|
14 |
+
|
15 |
+
/**
|
16 |
+
* The setting fields.
|
17 |
+
*
|
18 |
+
* @var NodeList
|
19 |
+
*/
|
20 |
+
var fields = document.querySelectorAll(
|
21 |
+
".cldashboard-settings-form .general-setting-field"
|
22 |
+
);
|
23 |
+
|
24 |
+
/**
|
25 |
+
* The submit button.
|
26 |
+
*
|
27 |
+
* @var HTMLElement
|
28 |
+
*/
|
29 |
+
var submitButton = document.querySelector(".cldashboard-submit-button");
|
30 |
+
|
31 |
+
/**
|
32 |
+
* The reset button.
|
33 |
+
*
|
34 |
+
* @var HTMLElement
|
35 |
+
*/
|
36 |
+
var resetButton = document.querySelector(".cldashboard-reset-button");
|
37 |
+
|
38 |
+
/**
|
39 |
+
* The load default values button.
|
40 |
+
*
|
41 |
+
* @var HTMLElement
|
42 |
+
*/
|
43 |
+
var loadDefaultSettingsButton = document.querySelector(
|
44 |
+
".cldashboard-load-defaults-button"
|
45 |
+
);
|
46 |
+
|
47 |
+
/**
|
48 |
+
* The submit notice div.
|
49 |
+
*
|
50 |
+
* @var HTMLElement
|
51 |
+
*/
|
52 |
+
var submitNotice = document.querySelector(".cldashboard-submit-notice");
|
53 |
+
|
54 |
+
/**
|
55 |
+
* The reset notice div.
|
56 |
+
*
|
57 |
+
* @var HTMLElement
|
58 |
+
*/
|
59 |
+
var resetNotice = document.querySelector(".cldashboard-reset-notice");
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Whether or not the form is currently being submitted.
|
63 |
+
*/
|
64 |
+
var isProcessing = false;
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Initialize the module, call the main functions.
|
68 |
+
*
|
69 |
+
* This function is the only function that should be called on top level scope.
|
70 |
+
* Other functions are called / hooked from this function.
|
71 |
+
*/
|
72 |
+
function init() {
|
73 |
+
setupColorPicker();
|
74 |
+
setupTabsNavigation();
|
75 |
+
|
76 |
+
var bgImageField = document.querySelector(".cldashboard-bg-image-field");
|
77 |
+
if (bgImageField) setupMediaField(bgImageField);
|
78 |
+
|
79 |
+
var logoImageField = document.querySelector(
|
80 |
+
".cldashboard-logo-image-field"
|
81 |
+
);
|
82 |
+
if (logoImageField) setupMediaField(logoImageField);
|
83 |
+
|
84 |
+
setupChainingFields();
|
85 |
+
|
86 |
+
if (form) form.addEventListener("submit", onSubmit);
|
87 |
+
if (submitButton) submitButton.classList.add("cldashboard-button");
|
88 |
+
|
89 |
+
if (resetButton) {
|
90 |
+
resetButton.classList.add("cldashboard-button");
|
91 |
+
resetButton.addEventListener("click", onReset);
|
92 |
+
}
|
93 |
+
|
94 |
+
if (loadDefaultSettingsButton) {
|
95 |
+
loadDefaultSettingsButton.classList.add("cldashboard-button");
|
96 |
+
loadDefaultSettingsButton.addEventListener(
|
97 |
+
"click",
|
98 |
+
onLoadDefaultSettings
|
99 |
+
);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Setup color picker for color picker fields.
|
105 |
+
*/
|
106 |
+
function setupColorPicker() {
|
107 |
+
$(".color-picker-field").wpColorPicker({
|
108 |
+
palettes: true,
|
109 |
+
hide: true,
|
110 |
+
});
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Setup the tabs navigation for settings page.
|
115 |
+
*/
|
116 |
+
function setupTabsNavigation() {
|
117 |
+
$(".heatbox-tab-nav-item").on("click", function () {
|
118 |
+
$(".heatbox-tab-nav-item").removeClass("active");
|
119 |
+
$(this).addClass("active");
|
120 |
+
|
121 |
+
var link = this.querySelector("a");
|
122 |
+
|
123 |
+
if (link.href.indexOf("#") === -1) return;
|
124 |
+
|
125 |
+
var hashValue = link.href.substring(link.href.indexOf("#") + 1);
|
126 |
+
|
127 |
+
if ("tools" === hashValue) {
|
128 |
+
submitButton.classList.add("is-hidden");
|
129 |
+
resetButton.classList.add("is-hidden");
|
130 |
+
} else {
|
131 |
+
submitButton.classList.remove("is-hidden");
|
132 |
+
resetButton.classList.remove("is-hidden");
|
133 |
+
}
|
134 |
+
|
135 |
+
$(".heatbox-form-container .heatbox-admin-panel").css("display", "none");
|
136 |
+
|
137 |
+
$(".heatbox-form-container .cldashboard-" + hashValue + "-panel").css(
|
138 |
+
"display",
|
139 |
+
"block"
|
140 |
+
);
|
141 |
+
});
|
142 |
+
|
143 |
+
window.addEventListener("load", function () {
|
144 |
+
var hashValue = window.location.hash.substring(1);
|
145 |
+
var currentActiveTabMenu;
|
146 |
+
|
147 |
+
if (!hashValue) {
|
148 |
+
currentActiveTabMenu = document.querySelector(
|
149 |
+
".heatbox-tab-nav-item.active"
|
150 |
+
);
|
151 |
+
hashValue = currentActiveTabMenu
|
152 |
+
? currentActiveTabMenu.dataset.tab
|
153 |
+
: "";
|
154 |
+
hashValue = hashValue ? hashValue : "login-screen";
|
155 |
+
}
|
156 |
+
|
157 |
+
if ("tools" === hashValue) {
|
158 |
+
submitButton.classList.add("is-hidden");
|
159 |
+
resetButton.classList.add("is-hidden");
|
160 |
+
} else {
|
161 |
+
submitButton.classList.remove("is-hidden");
|
162 |
+
resetButton.classList.remove("is-hidden");
|
163 |
+
}
|
164 |
+
|
165 |
+
$(".heatbox-tab-nav-item").removeClass("active");
|
166 |
+
$(".heatbox-tab-nav-item.cldashboard-" + hashValue + "-panel").addClass(
|
167 |
+
"active"
|
168 |
+
);
|
169 |
+
|
170 |
+
$(".heatbox-form-container .heatbox-admin-panel").css("display", "none");
|
171 |
+
|
172 |
+
$(".heatbox-form-container .cldashboard-" + hashValue + "-panel").css(
|
173 |
+
"display",
|
174 |
+
"block"
|
175 |
+
);
|
176 |
+
});
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Setup media field.
|
181 |
+
*/
|
182 |
+
function setupMediaField(field) {
|
183 |
+
var wpMedia;
|
184 |
+
|
185 |
+
wpMedia = wp
|
186 |
+
.media({
|
187 |
+
title: "Choose Background Image",
|
188 |
+
button: {
|
189 |
+
text: "Upload Image",
|
190 |
+
},
|
191 |
+
multiple: false, // Set this to true to allow multiple files to be selected
|
192 |
+
})
|
193 |
+
.on("select", function () {
|
194 |
+
var attachment = wpMedia.state().get("selection").first().toJSON();
|
195 |
+
field.value = attachment.url;
|
196 |
+
field.dispatchEvent(new Event("change"));
|
197 |
+
});
|
198 |
+
|
199 |
+
var uploadButton = field.parentNode.querySelector(
|
200 |
+
".cldashboard-upload-button"
|
201 |
+
);
|
202 |
+
|
203 |
+
if (uploadButton) {
|
204 |
+
uploadButton.addEventListener("click", function (e) {
|
205 |
+
wpMedia.open();
|
206 |
+
});
|
207 |
+
}
|
208 |
+
|
209 |
+
var clearButton = field.parentNode.querySelector(
|
210 |
+
".cldashboard-clear-button"
|
211 |
+
);
|
212 |
+
|
213 |
+
if (clearButton) {
|
214 |
+
clearButton.addEventListener("click", function (e) {
|
215 |
+
field.value = "";
|
216 |
+
field.dispatchEvent(new Event("change"));
|
217 |
+
});
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Setup fields chaining/ dependency.
|
223 |
+
*/
|
224 |
+
function setupChainingFields() {
|
225 |
+
var selectors = [
|
226 |
+
"[data-show-if-field]",
|
227 |
+
"[data-hide-if-field]",
|
228 |
+
"[data-show-if-field-checked]",
|
229 |
+
"[data-show-if-field-unchecked]",
|
230 |
+
];
|
231 |
+
|
232 |
+
selectors.forEach(function (selector) {
|
233 |
+
var children = document.querySelectorAll(selector);
|
234 |
+
if (!children.length) return;
|
235 |
+
|
236 |
+
[].slice.call(children).forEach(function (child) {
|
237 |
+
setupChainingEvent(child, selector);
|
238 |
+
});
|
239 |
+
});
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Setup fields chaining event.
|
244 |
+
*
|
245 |
+
* @param {HTMLElement} child The children element.
|
246 |
+
* @param selector child The selector that belongs to the children element.
|
247 |
+
*/
|
248 |
+
function setupChainingEvent(child, selector) {
|
249 |
+
var parentName = child.getAttribute(
|
250 |
+
selector.replace("[", "").replace("]", "")
|
251 |
+
);
|
252 |
+
var parentField = document.querySelector("#" + parentName);
|
253 |
+
|
254 |
+
var shownDisplayType = window.getComputedStyle(child).display;
|
255 |
+
shownDisplayType = shownDisplayType ? shownDisplayType : "block";
|
256 |
+
|
257 |
+
checkChainingState(child, shownDisplayType, parentField);
|
258 |
+
|
259 |
+
if (parentField.classList.contains("use-select2")) {
|
260 |
+
$(parentField).on("change", function (e) {
|
261 |
+
checkChainingState(child, shownDisplayType, parentField);
|
262 |
+
});
|
263 |
+
} else {
|
264 |
+
parentField.addEventListener("change", function (e) {
|
265 |
+
checkChainingState(child, shownDisplayType, parentField);
|
266 |
+
});
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
/**
|
271 |
+
* Check the children state: shown or hidden.
|
272 |
+
*
|
273 |
+
* @param {HTMLElement} child The children element.
|
274 |
+
* @param string shownDisplayType The display type of child when it's shown (e.g: "flex" or "block").
|
275 |
+
* @param {HTMLElement} parent The parent/ dependency element.
|
276 |
+
*/
|
277 |
+
function checkChainingState(child, shownDisplayType, parent) {
|
278 |
+
var parentTagName = parent.tagName.toLocaleLowerCase();
|
279 |
+
|
280 |
+
if (parentTagName === "input" && parent.type === "checkbox") {
|
281 |
+
// Handle "data-show-if-field-checked".
|
282 |
+
if (child.hasAttribute("data-show-if-field-checked")) {
|
283 |
+
if (parent.checked) {
|
284 |
+
child.style.display = shownDisplayType;
|
285 |
+
} else {
|
286 |
+
child.style.display = "none";
|
287 |
+
}
|
288 |
+
} else {
|
289 |
+
// Handle "data-show-if-field-unchecked".
|
290 |
+
if (!parent.checked) {
|
291 |
+
child.style.display = shownDisplayType;
|
292 |
+
} else {
|
293 |
+
child.style.display = "none";
|
294 |
+
}
|
295 |
+
}
|
296 |
+
|
297 |
+
return;
|
298 |
+
}
|
299 |
+
|
300 |
+
var wantedValue = child.hasAttribute("data-show-if-field")
|
301 |
+
? child.dataset.showIfValue
|
302 |
+
: child.dataset.hideIfValue;
|
303 |
+
var parentValue;
|
304 |
+
|
305 |
+
if (parentTagName === "select") {
|
306 |
+
if (parent.multiple) {
|
307 |
+
parentValue = $(parent).val();
|
308 |
+
wantedValue = JSON.parse(wantedValue);
|
309 |
+
} else {
|
310 |
+
if (parent.selectedIndex > -1) {
|
311 |
+
parentValue = parent.options[parent.selectedIndex].value;
|
312 |
+
}
|
313 |
+
}
|
314 |
+
} else {
|
315 |
+
parentValue = parent.value;
|
316 |
+
}
|
317 |
+
|
318 |
+
// Handle "data-show-if-field".
|
319 |
+
if (child.hasAttribute("data-show-if-field")) {
|
320 |
+
if (parentValue === wantedValue) {
|
321 |
+
child.style.display = shownDisplayType;
|
322 |
+
} else {
|
323 |
+
child.style.display = "none";
|
324 |
+
}
|
325 |
+
} else {
|
326 |
+
// Handle "data-hide-if-field".
|
327 |
+
if (JSON.stringify(parentValue) === JSON.stringify(wantedValue)) {
|
328 |
+
child.style.display = "none";
|
329 |
+
} else {
|
330 |
+
child.style.display = shownDisplayType;
|
331 |
+
}
|
332 |
+
}
|
333 |
+
}
|
334 |
+
|
335 |
+
function startLoading(button) {
|
336 |
+
if (button) button.classList.add("is-loading");
|
337 |
+
}
|
338 |
+
|
339 |
+
function stopLoading(button) {
|
340 |
+
if (button) button.classList.remove("is-loading");
|
341 |
+
}
|
342 |
+
|
343 |
+
/**
|
344 |
+
* Function to run on form submit.
|
345 |
+
*
|
346 |
+
* @param Event e The event object.
|
347 |
+
*/
|
348 |
+
function onSubmit(e) {
|
349 |
+
e.preventDefault();
|
350 |
+
if (isProcessing) return;
|
351 |
+
isProcessing = true;
|
352 |
+
startLoading(submitButton);
|
353 |
+
|
354 |
+
var data = {};
|
355 |
+
|
356 |
+
[].slice.call(fields).forEach(function (field) {
|
357 |
+
var value = false;
|
358 |
+
|
359 |
+
if (field.tagName.toLowerCase() === "select") {
|
360 |
+
if (field.multiple) {
|
361 |
+
value = JSON.stringify($(field).val());
|
362 |
+
} else {
|
363 |
+
if (field.selectedIndex) {
|
364 |
+
value = field.options[field.selectedIndex].value;
|
365 |
+
} else {
|
366 |
+
value = field.value;
|
367 |
+
}
|
368 |
+
}
|
369 |
+
} else {
|
370 |
+
if (field.type === "checkbox" || field.type === "radio") {
|
371 |
+
if (field.checked) {
|
372 |
+
value = field.value;
|
373 |
+
}
|
374 |
+
} else {
|
375 |
+
value = field.value;
|
376 |
+
}
|
377 |
+
}
|
378 |
+
|
379 |
+
if (value !== false) data[field.name] = value;
|
380 |
+
});
|
381 |
+
|
382 |
+
data.action = "cldashboard_save_settings";
|
383 |
+
data.nonce = CustomLoginDashboard.nonces.saveSettings;
|
384 |
+
|
385 |
+
$.ajax({
|
386 |
+
url: ajaxurl,
|
387 |
+
type: "POST",
|
388 |
+
data: data,
|
389 |
+
})
|
390 |
+
.done(function (r) {
|
391 |
+
if (!r || !r.success) return;
|
392 |
+
submitNotice.classList.add("is-success");
|
393 |
+
submitNotice.classList.remove("is-error");
|
394 |
+
submitNotice.innerHTML = r.data;
|
395 |
+
})
|
396 |
+
.fail(function (jqXHR) {
|
397 |
+
var errorMesssage = "Something went wrong";
|
398 |
+
|
399 |
+
if (jqXHR.responseJSON && jqXHR.responseJSON.data) {
|
400 |
+
errorMesssage = jqXHR.responseJSON.data;
|
401 |
+
}
|
402 |
+
|
403 |
+
submitNotice.classList.remove("is-success");
|
404 |
+
submitNotice.classList.add("is-error");
|
405 |
+
submitNotice.innerHTML = errorMesssage;
|
406 |
+
})
|
407 |
+
.always(function () {
|
408 |
+
submitNotice.classList.add("is-shown");
|
409 |
+
isProcessing = false;
|
410 |
+
stopLoading(submitButton);
|
411 |
+
|
412 |
+
setTimeout(function () {
|
413 |
+
submitNotice.classList.remove("is-shown");
|
414 |
+
}, 3000);
|
415 |
+
});
|
416 |
+
}
|
417 |
+
|
418 |
+
/**
|
419 |
+
* Function to run on reset button press.
|
420 |
+
*
|
421 |
+
* @param Event e The event object.
|
422 |
+
*/
|
423 |
+
function onReset(e) {
|
424 |
+
e.preventDefault();
|
425 |
+
if (!confirm(CustomLoginDashboard.dialogs.resetSettingsConfirmation))
|
426 |
+
return;
|
427 |
+
if (isProcessing) return;
|
428 |
+
isProcessing = true;
|
429 |
+
startLoading(resetButton);
|
430 |
+
|
431 |
+
var data = {};
|
432 |
+
|
433 |
+
data.action = "cldashboard_reset_settings";
|
434 |
+
data.nonce = CustomLoginDashboard.nonces.resetSettings;
|
435 |
+
|
436 |
+
$.ajax({
|
437 |
+
url: ajaxurl,
|
438 |
+
type: "POST",
|
439 |
+
data: data,
|
440 |
+
})
|
441 |
+
.done(function (r) {
|
442 |
+
if (!r || !r.success) return;
|
443 |
+
resetForm();
|
444 |
+
resetNotice.classList.add("is-success");
|
445 |
+
resetNotice.classList.remove("is-error");
|
446 |
+
resetNotice.innerHTML = r.data;
|
447 |
+
})
|
448 |
+
.fail(function (jqXHR) {
|
449 |
+
var errorMesssage = "Something went wrong";
|
450 |
+
|
451 |
+
if (jqXHR.responseJSON && jqXHR.responseJSON.data) {
|
452 |
+
errorMesssage = jqXHR.responseJSON.data;
|
453 |
+
}
|
454 |
+
|
455 |
+
resetNotice.classList.remove("is-success");
|
456 |
+
resetNotice.classList.add("is-error");
|
457 |
+
resetNotice.innerHTML = errorMesssage;
|
458 |
+
})
|
459 |
+
.always(function () {
|
460 |
+
resetNotice.classList.add("is-shown");
|
461 |
+
isProcessing = false;
|
462 |
+
stopLoading(resetButton);
|
463 |
+
|
464 |
+
setTimeout(function () {
|
465 |
+
resetNotice.classList.remove("is-shown");
|
466 |
+
resetNotice.innerHTML = "";
|
467 |
+
}, 3000);
|
468 |
+
});
|
469 |
+
}
|
470 |
+
|
471 |
+
/**
|
472 |
+
* Reset the settings form.
|
473 |
+
*/
|
474 |
+
function resetForm() {
|
475 |
+
// This line alone doesn't reset the form :).
|
476 |
+
form.reset();
|
477 |
+
|
478 |
+
[].slice.call(fields).forEach(function (field) {
|
479 |
+
if (field.tagName.toLowerCase() === "select") {
|
480 |
+
if (field.multiple) {
|
481 |
+
$(field).val([]);
|
482 |
+
} else {
|
483 |
+
field.selectedIndex = 0;
|
484 |
+
}
|
485 |
+
} else {
|
486 |
+
if (field.type === "checkbox" || field.type === "radio") {
|
487 |
+
field.checked = false;
|
488 |
+
} else {
|
489 |
+
field.value = "";
|
490 |
+
}
|
491 |
+
}
|
492 |
+
});
|
493 |
+
|
494 |
+
// Reset the color picker.
|
495 |
+
// @link https://github.com/Automattic/Iris/issues/53
|
496 |
+
$(".color-alpha").css("background-color", "");
|
497 |
+
}
|
498 |
+
|
499 |
+
/**
|
500 |
+
* Function to run on load defaults button press.
|
501 |
+
*
|
502 |
+
* @param Event e The event object.
|
503 |
+
*/
|
504 |
+
function onLoadDefaultSettings(e) {
|
505 |
+
e.preventDefault();
|
506 |
+
if (!confirm(CustomLoginDashboard.dialogs.loadDefaultSettingsConfirmation))
|
507 |
+
return;
|
508 |
+
if (isProcessing) return;
|
509 |
+
isProcessing = true;
|
510 |
+
startLoading(loadDefaultSettingsButton);
|
511 |
+
|
512 |
+
var data = {};
|
513 |
+
|
514 |
+
data.action = "cldashboard_load_default_settings";
|
515 |
+
data.nonce = CustomLoginDashboard.nonces.loadDefaultSettings;
|
516 |
+
|
517 |
+
$.ajax({
|
518 |
+
url: ajaxurl,
|
519 |
+
type: "POST",
|
520 |
+
data: data,
|
521 |
+
})
|
522 |
+
.done(function (r) {
|
523 |
+
if (!r || !r.success) return;
|
524 |
+
populateForm(r.data.settings);
|
525 |
+
resetNotice.classList.add("is-success");
|
526 |
+
resetNotice.classList.remove("is-error");
|
527 |
+
resetNotice.innerHTML = r.data.message;
|
528 |
+
})
|
529 |
+
.fail(function (jqXHR) {
|
530 |
+
var errorMesssage = "Something went wrong";
|
531 |
+
|
532 |
+
if (jqXHR.responseJSON && jqXHR.responseJSON.data) {
|
533 |
+
errorMesssage = jqXHR.responseJSON.data;
|
534 |
+
}
|
535 |
+
|
536 |
+
resetNotice.classList.remove("is-success");
|
537 |
+
resetNotice.classList.add("is-error");
|
538 |
+
resetNotice.innerHTML = errorMesssage;
|
539 |
+
})
|
540 |
+
.always(function () {
|
541 |
+
resetNotice.classList.add("is-shown");
|
542 |
+
isProcessing = false;
|
543 |
+
stopLoading(loadDefaultSettingsButton);
|
544 |
+
|
545 |
+
setTimeout(function () {
|
546 |
+
resetNotice.classList.remove("is-shown");
|
547 |
+
resetNotice.innerHTML = "";
|
548 |
+
}, 3000);
|
549 |
+
});
|
550 |
+
}
|
551 |
+
|
552 |
+
function populateForm(settings) {
|
553 |
+
var value;
|
554 |
+
var field;
|
555 |
+
var colorPickerPreview;
|
556 |
+
|
557 |
+
for (var fieldName in settings) {
|
558 |
+
if (Object.hasOwnProperty.call(settings, fieldName)) {
|
559 |
+
value = settings[fieldName];
|
560 |
+
field = document.getElementById(fieldName);
|
561 |
+
|
562 |
+
if (field) {
|
563 |
+
if (field.tagName.toLowerCase() === "select") {
|
564 |
+
if (field.multiple) {
|
565 |
+
$(field).val(value);
|
566 |
+
} else {
|
567 |
+
field.value = value;
|
568 |
+
}
|
569 |
+
} else if (field.type === "checkbox" || field.type === "radio") {
|
570 |
+
field.checked = value ? true : false;
|
571 |
+
} else {
|
572 |
+
field.value = value;
|
573 |
+
|
574 |
+
if (field.classList.contains("color-picker-field")) {
|
575 |
+
$(field).wpColorPicker("color", value);
|
576 |
+
|
577 |
+
colorPickerPreview =
|
578 |
+
field.parentNode.parentNode.parentNode.querySelector(
|
579 |
+
".color-alpha"
|
580 |
+
);
|
581 |
+
|
582 |
+
if (colorPickerPreview) {
|
583 |
+
colorPickerPreview.style.backgroundColor = value;
|
584 |
+
}
|
585 |
+
}
|
586 |
+
}
|
587 |
+
}
|
588 |
+
}
|
589 |
+
}
|
590 |
+
}
|
591 |
+
|
592 |
+
// Run the module.
|
593 |
+
init();
|
594 |
+
})(jQuery);
|
assets/js/wp-color-picker-alpha.js
ADDED
@@ -0,0 +1,453 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* global Color, wpColorPickerL10n */
|
2 |
+
/**
|
3 |
+
* Overwrites Automattic Iris and enables an Alpha Channel in wpColorPicker.
|
4 |
+
* Only run in input if data-alpha is defined and true.
|
5 |
+
*
|
6 |
+
* This is a heavily modified version of the script from https://github.com/kallookoo/wp-color-picker-alpha
|
7 |
+
* for the purposes of a WPTRT package (control-color-alpha).
|
8 |
+
*
|
9 |
+
* Modifications include:
|
10 |
+
* Applying WordPress Coding Standards.
|
11 |
+
* Cleaning up deprecated code for WP < 4.9.
|
12 |
+
* Improved inline comments.
|
13 |
+
* Fixed infinite recursion error.
|
14 |
+
* Removed _addInputListeners method - it's inherited from Iris.
|
15 |
+
* Formatting.
|
16 |
+
* Other minor bugfixes.
|
17 |
+
*
|
18 |
+
* @version 2.1.3
|
19 |
+
* @see https://github.com/kallookoo/wp-color-picker-alpha
|
20 |
+
* @license GPLv2
|
21 |
+
*/
|
22 |
+
|
23 |
+
( function() {
|
24 |
+
|
25 |
+
var image, _after, _wrap, _button, _before, _wrappingLabel, _wrappingLabelText;
|
26 |
+
|
27 |
+
// Prevent double-init.
|
28 |
+
if ( jQuery.wp.wpColorPicker.prototype._hasAlpha ) {
|
29 |
+
return;
|
30 |
+
}
|
31 |
+
|
32 |
+
// Variable for some backgrounds ( grid ).
|
33 |
+
image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==';
|
34 |
+
|
35 |
+
// HTML stuff for wpColorPicker copy of the original color-picker.js.
|
36 |
+
_after = '<div class="wp-picker-holder" />';
|
37 |
+
_wrap = '<div class="wp-picker-container" />';
|
38 |
+
_button = '<input type="button" class="button button-small" />';
|
39 |
+
|
40 |
+
// Declare some global variables when is deprecated or not.
|
41 |
+
_before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>';
|
42 |
+
_wrappingLabel = '<label></label>';
|
43 |
+
_wrappingLabelText = '<span class="screen-reader-text"></span>';
|
44 |
+
__ = wp.i18n.__;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Overwrite Color to enable RGBA support.
|
48 |
+
*
|
49 |
+
* @return {string} - Returns the HEX or RGBA color.
|
50 |
+
*/
|
51 |
+
Color.fn.toString = function() {
|
52 |
+
var hex;
|
53 |
+
if ( 1 > this._alpha ) {
|
54 |
+
return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
|
55 |
+
}
|
56 |
+
|
57 |
+
hex = parseInt( this._color, 10 ).toString( 16 );
|
58 |
+
if ( this.error ) {
|
59 |
+
return '';
|
60 |
+
}
|
61 |
+
|
62 |
+
if ( 6 > hex.length ) {
|
63 |
+
hex = ( '00000' + hex ).substr( -6 );
|
64 |
+
}
|
65 |
+
|
66 |
+
return '#' + hex;
|
67 |
+
};
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Overwrite wpColorPicker.
|
71 |
+
*/
|
72 |
+
jQuery.widget( 'wp.wpColorPicker', jQuery.wp.wpColorPicker, {
|
73 |
+
_hasAlpha: true,
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Creates the color picker.
|
77 |
+
*
|
78 |
+
* Creates the color picker, sets default values, css classes and wraps it all in HTML.
|
79 |
+
*
|
80 |
+
* @return {void}
|
81 |
+
*/
|
82 |
+
_create: function() {
|
83 |
+
var self = this,
|
84 |
+
el = self.element;
|
85 |
+
|
86 |
+
// Return early if Iris support is missing.
|
87 |
+
if ( ! jQuery.support.iris ) {
|
88 |
+
return;
|
89 |
+
}
|
90 |
+
|
91 |
+
// Override default options with options bound to the element.
|
92 |
+
jQuery.extend( self.options, el.data() );
|
93 |
+
|
94 |
+
// Create a color picker which only allows adjustments to the hue.
|
95 |
+
if ( 'hue' === self.options.type ) {
|
96 |
+
return self._createHueOnly();
|
97 |
+
}
|
98 |
+
|
99 |
+
// Bind the close event.
|
100 |
+
self.close = jQuery.proxy( self.close, self );
|
101 |
+
|
102 |
+
self.initialValue = el.val();
|
103 |
+
|
104 |
+
// Add a CSS class to the input field.
|
105 |
+
el.addClass( 'wp-color-picker' );
|
106 |
+
|
107 |
+
// Check if there's already a wrapping label, e.g. in the Customizer.
|
108 |
+
// If there's no label, add a default one to match the Customizer template.
|
109 |
+
if ( ! el.parent( 'label' ).length ) {
|
110 |
+
|
111 |
+
// Wrap the input field in the default label.
|
112 |
+
el.wrap( _wrappingLabel );
|
113 |
+
|
114 |
+
// Insert the default label text.
|
115 |
+
self.wrappingLabelText = jQuery( _wrappingLabelText )
|
116 |
+
.insertBefore( el )
|
117 |
+
.text( __( 'Color value' ) );
|
118 |
+
}
|
119 |
+
|
120 |
+
// At this point, either it's the standalone version or the Customizer one,
|
121 |
+
// we have a wrapping label to use as hook in the DOM, let's store it.
|
122 |
+
self.wrappingLabel = el.parent();
|
123 |
+
|
124 |
+
// Wrap the label in the main wrapper.
|
125 |
+
self.wrappingLabel.wrap( _wrap );
|
126 |
+
|
127 |
+
// Store a reference to the main wrapper.
|
128 |
+
self.wrap = self.wrappingLabel.parent();
|
129 |
+
|
130 |
+
// Set up the toggle button and insert it before the wrapping label.
|
131 |
+
self.toggler = jQuery( _before )
|
132 |
+
.insertBefore( self.wrappingLabel )
|
133 |
+
.css({ backgroundColor: self.initialValue });
|
134 |
+
|
135 |
+
// Set the toggle button span element text.
|
136 |
+
self.toggler.find( '.wp-color-result-text' ).text( __( 'Select Color' ) );
|
137 |
+
|
138 |
+
// Set up the Iris container and insert it after the wrapping label.
|
139 |
+
self.pickerContainer = jQuery( _after ).insertAfter( self.wrappingLabel );
|
140 |
+
|
141 |
+
// Store a reference to the Clear/Default button.
|
142 |
+
self.button = jQuery( _button );
|
143 |
+
|
144 |
+
// Set up the Clear/Default button.
|
145 |
+
if ( self.options.defaultColor ) {
|
146 |
+
self.button.addClass( 'wp-picker-default' ).val( __( 'Default' ) );
|
147 |
+
self.button.attr( 'aria-label', __( 'Select default color' ) );
|
148 |
+
} else {
|
149 |
+
self.button.addClass( 'wp-picker-clear' ).val( __( 'Clear' ) );
|
150 |
+
self.button.attr( 'aria-label', __( 'Clear color' ) );
|
151 |
+
}
|
152 |
+
|
153 |
+
// Wrap the wrapping label in its wrapper and append the Clear/Default button.
|
154 |
+
self.wrappingLabel
|
155 |
+
.wrap( '<span class="wp-picker-input-wrap hidden" />' )
|
156 |
+
.after( self.button );
|
157 |
+
|
158 |
+
// The input wrapper now contains the label+input+Clear/Default button.
|
159 |
+
// Store a reference to the input wrapper: we'll use this to toggle
|
160 |
+
// the controls visibility.
|
161 |
+
self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
|
162 |
+
|
163 |
+
el.iris({
|
164 |
+
target: self.pickerContainer,
|
165 |
+
hide: self.options.hide,
|
166 |
+
width: self.options.width,
|
167 |
+
mode: self.options.mode,
|
168 |
+
palettes: self.options.palettes,
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Handles the onChange event if one has been defined in the options.
|
172 |
+
*
|
173 |
+
* Handles the onChange event if one has been defined in the options and additionally
|
174 |
+
* sets the background color for the toggler element.
|
175 |
+
*
|
176 |
+
* @param {Event} event The event that's being called.
|
177 |
+
* @param {HTMLElement} ui The HTMLElement containing the color picker.
|
178 |
+
*
|
179 |
+
* @return {void}
|
180 |
+
*/
|
181 |
+
change: function( event, ui ) {
|
182 |
+
if ( self.options.alpha ) {
|
183 |
+
self.toggler.css({ 'background-image': 'url(' + image + ')' });
|
184 |
+
self.toggler.css({
|
185 |
+
'position': 'relative'
|
186 |
+
});
|
187 |
+
|
188 |
+
if ( 0 === self.toggler.find( 'span.color-alpha' ).length ) {
|
189 |
+
self.toggler.append( '<span class="color-alpha"></span>' );
|
190 |
+
}
|
191 |
+
|
192 |
+
self.toggler.find( 'span.color-alpha' ).css({
|
193 |
+
'min-width': '30px',
|
194 |
+
'min-height': '100%',
|
195 |
+
'position': 'absolute',
|
196 |
+
'top': 0,
|
197 |
+
'left': 0,
|
198 |
+
'border-top-left-radius': '2px',
|
199 |
+
'border-bottom-left-radius': '2px',
|
200 |
+
'background': ui.color.toString()
|
201 |
+
});
|
202 |
+
} else {
|
203 |
+
self.toggler.css({ backgroundColor: ui.color.toString() });
|
204 |
+
}
|
205 |
+
|
206 |
+
if ( jQuery.isFunction( self.options.change ) ) {
|
207 |
+
self.options.change.call( this, event, ui );
|
208 |
+
}
|
209 |
+
}
|
210 |
+
});
|
211 |
+
|
212 |
+
el.val( self.initialValue );
|
213 |
+
self._addListeners();
|
214 |
+
|
215 |
+
// Force the color picker to always be closed on initial load.
|
216 |
+
if ( ! self.options.hide ) {
|
217 |
+
self.toggler.click();
|
218 |
+
}
|
219 |
+
},
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Binds event listeners to the color picker.
|
223 |
+
*
|
224 |
+
* @return {void}
|
225 |
+
*/
|
226 |
+
_addListeners: function() {
|
227 |
+
var self = this;
|
228 |
+
|
229 |
+
/**
|
230 |
+
* Prevent any clicks inside this widget from leaking to the top and closing it.
|
231 |
+
*
|
232 |
+
* @param {Event} event The event that's being called.
|
233 |
+
* @return {void}
|
234 |
+
*/
|
235 |
+
self.wrap.on( 'click.wpcolorpicker', function( event ) {
|
236 |
+
event.stopPropagation();
|
237 |
+
});
|
238 |
+
|
239 |
+
// Open or close the color picker depending on the class.
|
240 |
+
self.toggler.click( function() {
|
241 |
+
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
|
242 |
+
self.close();
|
243 |
+
} else {
|
244 |
+
self.open();
|
245 |
+
}
|
246 |
+
});
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Checks if value is empty when changing the color in the color picker.
|
250 |
+
*
|
251 |
+
* Checks if value is empty when changing the color in the color picker.
|
252 |
+
* If so, the background color is cleared.
|
253 |
+
*
|
254 |
+
* @param {Event} event The event that's being called.
|
255 |
+
* @return {void}
|
256 |
+
*/
|
257 |
+
self.element.on( 'change', function( event ) {
|
258 |
+
|
259 |
+
// Empty or Error = clear.
|
260 |
+
if ( '' === jQuery( this ).val() || self.element.hasClass( 'iris-error' ) ) {
|
261 |
+
if ( self.options.alpha ) {
|
262 |
+
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
263 |
+
} else {
|
264 |
+
self.toggler.css( 'backgroundColor', '' );
|
265 |
+
}
|
266 |
+
|
267 |
+
// fire clear callback if we have one
|
268 |
+
if ( jQuery.isFunction( self.options.clear ) ) {
|
269 |
+
self.options.clear.call( this, event );
|
270 |
+
}
|
271 |
+
}
|
272 |
+
});
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Enables the user to clear or revert the color in the color picker to the default value.
|
276 |
+
*
|
277 |
+
* @param {Event} event The event that's being called.
|
278 |
+
* @return {void}
|
279 |
+
*/
|
280 |
+
self.button.on( 'click', function( event ) {
|
281 |
+
if ( jQuery( this ).hasClass( 'wp-picker-clear' ) ) {
|
282 |
+
self.element.val( '' );
|
283 |
+
if ( self.options.alpha ) {
|
284 |
+
self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
|
285 |
+
} else {
|
286 |
+
self.toggler.css( 'backgroundColor', '' );
|
287 |
+
}
|
288 |
+
|
289 |
+
if ( jQuery.isFunction( self.options.clear ) ) {
|
290 |
+
self.options.clear.call( this, event );
|
291 |
+
}
|
292 |
+
|
293 |
+
self.element.trigger( 'change' );
|
294 |
+
} else if ( jQuery( this ).hasClass( 'wp-picker-default' ) ) {
|
295 |
+
self.element.val( self.options.defaultColor ).change();
|
296 |
+
}
|
297 |
+
});
|
298 |
+
}
|
299 |
+
});
|
300 |
+
|
301 |
+
/**
|
302 |
+
* Overwrite iris.
|
303 |
+
*/
|
304 |
+
jQuery.widget( 'a8c.iris', jQuery.a8c.iris, {
|
305 |
+
_create: function() {
|
306 |
+
var self, el, _html, aContainer, aSlider, controls, emptyWidth, stripsMargin, stripsWidth;
|
307 |
+
this._super();
|
308 |
+
|
309 |
+
// Global option for check is mode rbga is enabled
|
310 |
+
this.options.alpha = this.element.data( 'alpha' ) || false;
|
311 |
+
|
312 |
+
// Is not input disabled
|
313 |
+
if ( ! this.element.is( ':input' ) ) {
|
314 |
+
this.options.alpha = false;
|
315 |
+
}
|
316 |
+
|
317 |
+
if ( 'undefined' !== typeof this.options.alpha && this.options.alpha ) {
|
318 |
+
self = this;
|
319 |
+
el = self.element;
|
320 |
+
_html = '<div class="iris-strip iris-slider iris-alpha-slider"><div class="iris-slider-offset iris-slider-offset-alpha"></div></div>';
|
321 |
+
aContainer = jQuery( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) );
|
322 |
+
aSlider = aContainer.find( '.iris-slider-offset-alpha' );
|
323 |
+
controls = {
|
324 |
+
aContainer: aContainer,
|
325 |
+
aSlider: aSlider
|
326 |
+
};
|
327 |
+
|
328 |
+
if ( 'undefined' !== typeof el.data( 'custom-width' ) ) {
|
329 |
+
self.options.customWidth = parseInt( el.data( 'custom-width' ), 10 ) || 0;
|
330 |
+
} else {
|
331 |
+
self.options.customWidth = 100;
|
332 |
+
}
|
333 |
+
|
334 |
+
// Set default width for input reset
|
335 |
+
self.options.defaultWidth = el.width();
|
336 |
+
|
337 |
+
// Update width for input
|
338 |
+
if ( 1 > self._color._alpha || -1 !== self._color.toString().indexOf( 'rgb' ) ) {
|
339 |
+
el.width( parseInt( self.options.defaultWidth + self.options.customWidth, 10 ) );
|
340 |
+
}
|
341 |
+
|
342 |
+
// Push new controls
|
343 |
+
jQuery.each( controls, function( k, v ) {
|
344 |
+
self.controls[k] = v;
|
345 |
+
});
|
346 |
+
|
347 |
+
// Change size strip and add margin for sliders
|
348 |
+
self.controls.square.css({ 'margin-right': '0' });
|
349 |
+
emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 );
|
350 |
+
stripsMargin = ( emptyWidth / 6 );
|
351 |
+
stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
|
352 |
+
|
353 |
+
jQuery.each( [ 'aContainer', 'strip' ], function( k, v ) {
|
354 |
+
self.controls[v].width( stripsWidth ).css({ 'margin-left': stripsMargin + 'px' });
|
355 |
+
});
|
356 |
+
|
357 |
+
// Add new slider
|
358 |
+
self._initControls();
|
359 |
+
|
360 |
+
// For updated widget
|
361 |
+
self._change();
|
362 |
+
}
|
363 |
+
},
|
364 |
+
|
365 |
+
/**
|
366 |
+
* Init the controls.
|
367 |
+
*/
|
368 |
+
_initControls: function() {
|
369 |
+
var self, controls;
|
370 |
+
this._super();
|
371 |
+
|
372 |
+
if ( this.options.alpha ) {
|
373 |
+
self = this;
|
374 |
+
controls = self.controls;
|
375 |
+
|
376 |
+
controls.aSlider.slider({
|
377 |
+
orientation: 'vertical',
|
378 |
+
min: 0,
|
379 |
+
max: 100,
|
380 |
+
step: 1,
|
381 |
+
value: parseInt( self._color._alpha * 100, 10 ),
|
382 |
+
slide: function( event, ui ) {
|
383 |
+
|
384 |
+
// Update alpha value
|
385 |
+
self._color._alpha = parseFloat( ui.value / 100 );
|
386 |
+
self._change.apply( self, arguments );
|
387 |
+
}
|
388 |
+
});
|
389 |
+
}
|
390 |
+
},
|
391 |
+
|
392 |
+
/**
|
393 |
+
* On value change.
|
394 |
+
*/
|
395 |
+
_change: function() {
|
396 |
+
var self = this,
|
397 |
+
el = self.element,
|
398 |
+
controls, alpha, color, gradient, defaultWidth, customWidth, target, reset;
|
399 |
+
|
400 |
+
this._super();
|
401 |
+
|
402 |
+
if ( this.options.alpha ) {
|
403 |
+
controls = self.controls;
|
404 |
+
alpha = parseInt( self._color._alpha * 100, 10 );
|
405 |
+
color = self._color.toRgb();
|
406 |
+
gradient = [
|
407 |
+
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
|
408 |
+
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
|
409 |
+
];
|
410 |
+
defaultWidth = self.options.defaultWidth;
|
411 |
+
customWidth = self.options.customWidth;
|
412 |
+
target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
|
413 |
+
|
414 |
+
// Generate background slider alpha, only for CSS3 old browser.
|
415 |
+
controls.aContainer.css({ 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' });
|
416 |
+
|
417 |
+
if ( target.hasClass( 'wp-picker-open' ) ) {
|
418 |
+
|
419 |
+
// Update alpha value.
|
420 |
+
controls.aSlider.slider( 'value', alpha );
|
421 |
+
|
422 |
+
// Disable opacity change in the default saturation slider and change width.
|
423 |
+
if ( 1 > self._color._alpha ) {
|
424 |
+
controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) );
|
425 |
+
el.width( parseInt( defaultWidth + customWidth, 10 ) );
|
426 |
+
} else {
|
427 |
+
el.width( defaultWidth );
|
428 |
+
}
|
429 |
+
}
|
430 |
+
}
|
431 |
+
|
432 |
+
reset = el.data( 'reset-alpha' ) || false;
|
433 |
+
|
434 |
+
if ( reset ) {
|
435 |
+
self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
|
436 |
+
self._color._alpha = 1;
|
437 |
+
self.active = 'external';
|
438 |
+
self._change();
|
439 |
+
});
|
440 |
+
}
|
441 |
+
|
442 |
+
// Only run after the first time.
|
443 |
+
if ( self._inited ) {
|
444 |
+
self._trigger(
|
445 |
+
'change',
|
446 |
+
{ type: self.active },
|
447 |
+
{ color: self._color }
|
448 |
+
);
|
449 |
+
}
|
450 |
+
}
|
451 |
+
});
|
452 |
+
|
453 |
+
}( jQuery ) );
|
class-output.php
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Setup Custom Login Dashboard output.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard;
|
9 |
+
|
10 |
+
use ariColor;
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Setup Better Admin Bar output.
|
14 |
+
*/
|
15 |
+
class Output {
|
16 |
+
|
17 |
+
/**
|
18 |
+
* The class instance.
|
19 |
+
*
|
20 |
+
* @var object
|
21 |
+
*/
|
22 |
+
public static $instance;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Get instance of the class.
|
26 |
+
*/
|
27 |
+
public static function get_instance() {
|
28 |
+
|
29 |
+
if ( null === self::$instance ) {
|
30 |
+
self::$instance = new self();
|
31 |
+
}
|
32 |
+
|
33 |
+
return self::$instance;
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Init the class setup.
|
39 |
+
*/
|
40 |
+
public static function init() {
|
41 |
+
self::$instance = new self();
|
42 |
+
|
43 |
+
add_action( 'plugins_loaded', array( self::$instance, 'setup' ) );
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Setup action & filter hooks.
|
48 |
+
*/
|
49 |
+
public function __construct() {}
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Setup action & filters.
|
53 |
+
*/
|
54 |
+
public function setup() {
|
55 |
+
|
56 |
+
// Left side of the admin area's footer text.
|
57 |
+
add_filter( 'admin_footer_text', [ $this, 'left_footer_text' ] );
|
58 |
+
|
59 |
+
// Right side of the admin area's footer text.
|
60 |
+
add_filter( 'update_footer', [ $this, 'right_footer_text' ], 11 );
|
61 |
+
|
62 |
+
add_action( 'login_head', [ $this, 'print_login_styles' ] );
|
63 |
+
|
64 |
+
add_filter( 'login_headerurl', [ $this, 'login_logo_url' ] );
|
65 |
+
add_filter( 'login_headertext', [ $this, 'login_logo_title' ] );
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Filters the “Thank you” text displayed in the admin footer.
|
71 |
+
*
|
72 |
+
* @param string $text The existing footer text.
|
73 |
+
* @return string The modified footer text.
|
74 |
+
*/
|
75 |
+
public function left_footer_text( $text ) {
|
76 |
+
|
77 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
78 |
+
$text = isset( $settings['dashboard_data_left'] ) && ! empty( $settings['dashboard_data_left'] ) ? $settings['dashboard_data_left'] : $text;
|
79 |
+
|
80 |
+
return stripslashes( $text );
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Filters the version/update text displayed in the admin footer.
|
86 |
+
*
|
87 |
+
* @param string $content The content that will be printed.
|
88 |
+
*/
|
89 |
+
public function right_footer_text( $content ) {
|
90 |
+
|
91 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
92 |
+
$text = isset( $settings['dashboard_data_right'] ) && ! empty( $settings['dashboard_data_right'] ) ? $settings['dashboard_data_right'] : $content;
|
93 |
+
|
94 |
+
return stripslashes( $text );
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
/**
|
99 |
+
* Print login styles.
|
100 |
+
*/
|
101 |
+
public function print_login_styles() {
|
102 |
+
|
103 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
104 |
+
$print_css = require __DIR__ . '/inc/login.css.php';
|
105 |
+
|
106 |
+
echo '<style>';
|
107 |
+
|
108 |
+
ob_start();
|
109 |
+
$print_css( $settings );
|
110 |
+
$output = ob_get_clean();
|
111 |
+
echo $output;
|
112 |
+
|
113 |
+
echo '</style>';
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Change login logo URL.
|
119 |
+
*/
|
120 |
+
public function login_logo_url() {
|
121 |
+
|
122 |
+
return get_bloginfo( 'url' );
|
123 |
+
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Change login logo title.
|
128 |
+
*
|
129 |
+
* @param string $headertext The existing header text.
|
130 |
+
* @return string
|
131 |
+
*/
|
132 |
+
public function login_logo_title( $headertext ) {
|
133 |
+
|
134 |
+
$settings = get_option( 'plugin_erident_settings' );
|
135 |
+
$logo_title = isset( $settings['dashboard_power_text'] ) && ! empty( $settings['dashboard_power_text'] ) ? $settings['dashboard_power_text'] : $headertext;
|
136 |
+
|
137 |
+
return $logo_title;
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
}
|
class-setup.php
ADDED
@@ -0,0 +1,265 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Setup Custom Login Dashboard plugin.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Setup Better Admin Bar.
|
12 |
+
*/
|
13 |
+
class Setup {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* The class instance.
|
17 |
+
*
|
18 |
+
* @var object
|
19 |
+
*/
|
20 |
+
public static $instance;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get instance of the class.
|
24 |
+
*/
|
25 |
+
public static function get_instance() {
|
26 |
+
|
27 |
+
if ( null === self::$instance ) {
|
28 |
+
self::$instance = new self();
|
29 |
+
}
|
30 |
+
|
31 |
+
return self::$instance;
|
32 |
+
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Init the class setup.
|
37 |
+
*/
|
38 |
+
public static function init() {
|
39 |
+
self::$instance = new self();
|
40 |
+
|
41 |
+
add_action( 'plugins_loaded', array( self::$instance, 'setup' ) );
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Setup action & filter hooks.
|
46 |
+
*/
|
47 |
+
public function __construct() {}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Setup action & filters.
|
51 |
+
*/
|
52 |
+
public function setup() {
|
53 |
+
|
54 |
+
add_action( 'init', array( $this, 'setup_text_domain' ) );
|
55 |
+
add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 10, 4 );
|
56 |
+
add_action( 'admin_menu', array( $this, 'add_submenu_page' ) );
|
57 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
|
58 |
+
add_filter( 'admin_body_class', array( $this, 'admin_body_class' ), 20 );
|
59 |
+
|
60 |
+
// Process export-import.
|
61 |
+
add_action( 'admin_init', array( $this, 'process_export' ) );
|
62 |
+
add_action( 'admin_init', array( $this, 'process_import' ) );
|
63 |
+
|
64 |
+
// Ajax handlers.
|
65 |
+
new Ajax\Save_Settings();
|
66 |
+
new Ajax\Reset_Settings();
|
67 |
+
new Ajax\Load_Default_Settings();
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* Setup textdomain.
|
73 |
+
*/
|
74 |
+
public function setup_text_domain() {
|
75 |
+
|
76 |
+
load_plugin_textdomain( 'erident-custom-login-and-dashboard', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
77 |
+
|
78 |
+
}
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Add settings link to plugin list page.
|
82 |
+
*
|
83 |
+
* @param array $actions An array of plugin action links.
|
84 |
+
* @param string $plugin_file Path to the plugin file relative to the plugins directory.
|
85 |
+
* @param array $plugin_data An array of plugin data. See `get_plugin_data()`.
|
86 |
+
* @param string $context The plugin context. By default this can include 'all', 'active', 'inactive',
|
87 |
+
* 'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'.
|
88 |
+
*
|
89 |
+
* @return array The modified plugin action links.
|
90 |
+
*/
|
91 |
+
public function add_settings_link( $actions, $plugin_file, $plugin_data, $context ) {
|
92 |
+
|
93 |
+
if ( CUSTOM_LOGIN_DASHBOARD_PLUGIN_BASENAME === $plugin_file ) {
|
94 |
+
$support_link = '<a href="https://wordpress.org/support/plugin/erident-custom-login-and-dashboard/" target="_blank">' . __( 'Support', 'erident-custom-login-and-dashboard' ) . '</a>';
|
95 |
+
|
96 |
+
array_unshift( $actions, $support_link );
|
97 |
+
|
98 |
+
$settings_link = '<a href="' . esc_url( admin_url( 'options-general.php?page=erident-custom-login-and-dashboard' ) ) . '">' . __( 'Settings', 'erident-custom-login-and-dashboard' ) . '</a>';
|
99 |
+
|
100 |
+
array_unshift( $actions, $settings_link );
|
101 |
+
}
|
102 |
+
|
103 |
+
return $actions;
|
104 |
+
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Add submenu under "Settings" menu item.
|
109 |
+
*/
|
110 |
+
public function add_submenu_page() {
|
111 |
+
|
112 |
+
$page = add_options_page( __( 'Custom Login & Dashboard', 'erident-custom-login-and-dashboard' ), __( 'Custom Login & Dashboard', 'erident-custom-login-and-dashboard' ), 'administrator', 'erident-custom-login-and-dashboard', [ $this, 'page_output' ] );
|
113 |
+
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Better Admin Bar page output.
|
118 |
+
*/
|
119 |
+
public function page_output() {
|
120 |
+
|
121 |
+
$output = require __DIR__ . '/templates/settings-template.php';
|
122 |
+
$output();
|
123 |
+
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Enqueue admin styles & scripts.
|
128 |
+
*/
|
129 |
+
public function admin_scripts() {
|
130 |
+
|
131 |
+
$current_screen = get_current_screen();
|
132 |
+
|
133 |
+
if ( 'settings_page_erident-custom-login-and-dashboard' !== $current_screen->id ) {
|
134 |
+
return;
|
135 |
+
}
|
136 |
+
|
137 |
+
if ( function_exists( 'wp_enqueue_media' ) ) {
|
138 |
+
wp_enqueue_media();
|
139 |
+
} else {
|
140 |
+
wp_enqueue_style( 'thickbox' );
|
141 |
+
wp_enqueue_script( 'media-upload' );
|
142 |
+
wp_enqueue_script( 'thickbox' );
|
143 |
+
}
|
144 |
+
|
145 |
+
// CSS dependencies.
|
146 |
+
|
147 |
+
// WP Color picker dependency.
|
148 |
+
wp_enqueue_style( 'wp-color-picker' );
|
149 |
+
|
150 |
+
// Settings page styling.
|
151 |
+
wp_enqueue_style( 'heatbox', CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL . '/assets/css/heatbox.css', array(), CUSTOM_LOGIN_DASHBOARD_PLUGIN_VERSION );
|
152 |
+
|
153 |
+
// Custom Login Dashboard admin styling.
|
154 |
+
wp_enqueue_style( 'custom-login-dashboard', CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL . '/assets/css/admin.css', array(), CUSTOM_LOGIN_DASHBOARD_PLUGIN_VERSION );
|
155 |
+
|
156 |
+
// JS dependencies.
|
157 |
+
|
158 |
+
// Color picker alpha.
|
159 |
+
wp_enqueue_script( 'wp-color-picker-alpha', CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL . '/assets/js/wp-color-picker-alpha.js', array( 'jquery', 'wp-color-picker', 'wp-i18n' ), '2.1.3', true );
|
160 |
+
|
161 |
+
// Settings page scripts.
|
162 |
+
wp_enqueue_script( 'custom-login-dashboard', CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL . '/assets/js/settings-page.js', array( 'wp-color-picker' ), CUSTOM_LOGIN_DASHBOARD_PLUGIN_VERSION, true );
|
163 |
+
|
164 |
+
wp_localize_script(
|
165 |
+
'custom-login-dashboard',
|
166 |
+
'CustomLoginDashboard',
|
167 |
+
array(
|
168 |
+
'nonces' => array(
|
169 |
+
'saveSettings' => wp_create_nonce( 'cldashboard_nonce_save_settings' ),
|
170 |
+
'resetSettings' => wp_create_nonce( 'cldashboard_nonce_reset_settings' ),
|
171 |
+
'loadDefaultSettings' => wp_create_nonce( 'cldashboard_nonce_load_default_settings' ),
|
172 |
+
),
|
173 |
+
'dialogs' => array(
|
174 |
+
'resetSettingsConfirmation' => __( 'Are you sure you want to delete all settings?', 'erident-custom-login-and-dashboard' ),
|
175 |
+
'loadDefaultSettingsConfirmation' => __( 'Are you sure you want to reset all settings?', 'erident-custom-login-and-dashboard' ),
|
176 |
+
),
|
177 |
+
)
|
178 |
+
);
|
179 |
+
|
180 |
+
// This handle enqueue already from v3.5.9, let's keep it just in case someone is using it.
|
181 |
+
wp_enqueue_script( 'wp_erident_dashboard-script2' );
|
182 |
+
wp_enqueue_script( 'wp_erident_dashboard-script' );
|
183 |
+
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Modify admin body class.
|
188 |
+
*
|
189 |
+
* @param string $classes The class names.
|
190 |
+
*/
|
191 |
+
public function admin_body_class( $classes ) {
|
192 |
+
|
193 |
+
$current_user = wp_get_current_user();
|
194 |
+
$classes .= ' custom-login-dashboard-user-' . $current_user->user_nicename;
|
195 |
+
|
196 |
+
$roles = $current_user->roles;
|
197 |
+
$roles = $roles ? $roles : array();
|
198 |
+
|
199 |
+
foreach ( $roles as $role ) {
|
200 |
+
$classes .= ' custom-login-dashboard-role-' . $role;
|
201 |
+
}
|
202 |
+
|
203 |
+
$screens = array(
|
204 |
+
'settings_page_erident-custom-login-and-dashboard',
|
205 |
+
);
|
206 |
+
|
207 |
+
$screen = get_current_screen();
|
208 |
+
|
209 |
+
if ( ! in_array( $screen->id, $screens, true ) ) {
|
210 |
+
return $classes;
|
211 |
+
}
|
212 |
+
|
213 |
+
$classes .= ' heatbox-admin has-header';
|
214 |
+
|
215 |
+
return $classes;
|
216 |
+
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Process widget export.
|
221 |
+
*/
|
222 |
+
public function process_export() {
|
223 |
+
|
224 |
+
if ( empty( $_POST['er_action'] ) || 'export_settings' != $_POST['er_action'] ) {
|
225 |
+
return;
|
226 |
+
}
|
227 |
+
|
228 |
+
if ( ! wp_verify_nonce( $_POST['er_export_nonce'], 'er_export_nonce' ) ) {
|
229 |
+
return;
|
230 |
+
}
|
231 |
+
|
232 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
233 |
+
return;
|
234 |
+
}
|
235 |
+
|
236 |
+
$exporter = new Helpers\Export();
|
237 |
+
|
238 |
+
$exporter->export();
|
239 |
+
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* Process widget import.
|
244 |
+
*/
|
245 |
+
public function process_import() {
|
246 |
+
|
247 |
+
if ( empty( $_POST['er_action'] ) || 'import_settings' != $_POST['er_action'] ) {
|
248 |
+
return;
|
249 |
+
}
|
250 |
+
|
251 |
+
if ( ! wp_verify_nonce( $_POST['er_import_nonce'], 'er_import_nonce' ) ) {
|
252 |
+
return;
|
253 |
+
}
|
254 |
+
|
255 |
+
if ( ! current_user_can( 'manage_options' ) ) {
|
256 |
+
return;
|
257 |
+
}
|
258 |
+
|
259 |
+
$importer = new Helpers\Import();
|
260 |
+
|
261 |
+
$importer->import();
|
262 |
+
|
263 |
+
}
|
264 |
+
|
265 |
+
}
|
composer.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "mapsteps/custom-login-dashboard",
|
3 |
+
"description": "Custom login & dashboard plugin for WordPress",
|
4 |
+
"type": "library",
|
5 |
+
"license": "MIT",
|
6 |
+
"minimum-stability": "stable",
|
7 |
+
"require": {
|
8 |
+
"aristath/ari-color": "^1.1"
|
9 |
+
}
|
10 |
+
}
|
composer.lock
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_readme": [
|
3 |
+
"This file locks the dependencies of your project to a known state",
|
4 |
+
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
5 |
+
"This file is @generated automatically"
|
6 |
+
],
|
7 |
+
"content-hash": "44db7c215059cfd299f1bd22b8f3adc5",
|
8 |
+
"packages": [
|
9 |
+
{
|
10 |
+
"name": "aristath/ari-color",
|
11 |
+
"version": "v1.1.2",
|
12 |
+
"source": {
|
13 |
+
"type": "git",
|
14 |
+
"url": "https://github.com/aristath/ariColor.git",
|
15 |
+
"reference": "59f2938dfda5a61beef9af98b3c45c79eb58fe4c"
|
16 |
+
},
|
17 |
+
"dist": {
|
18 |
+
"type": "zip",
|
19 |
+
"url": "https://api.github.com/repos/aristath/ariColor/zipball/59f2938dfda5a61beef9af98b3c45c79eb58fe4c",
|
20 |
+
"reference": "59f2938dfda5a61beef9af98b3c45c79eb58fe4c",
|
21 |
+
"shasum": ""
|
22 |
+
},
|
23 |
+
"require": {
|
24 |
+
"php": ">=5.2"
|
25 |
+
},
|
26 |
+
"require-dev": {
|
27 |
+
"composer/installers": "~1.0",
|
28 |
+
"phpunit/phpunit": "~4.0",
|
29 |
+
"satooshi/php-coveralls": "~2.2"
|
30 |
+
},
|
31 |
+
"type": "library",
|
32 |
+
"autoload": {
|
33 |
+
"classmap": [
|
34 |
+
"aricolor.php"
|
35 |
+
]
|
36 |
+
},
|
37 |
+
"notification-url": "https://packagist.org/downloads/",
|
38 |
+
"license": [
|
39 |
+
"GPL-2.0-or-later"
|
40 |
+
],
|
41 |
+
"authors": [
|
42 |
+
{
|
43 |
+
"name": "aristath",
|
44 |
+
"email": "aristath@gmail.com",
|
45 |
+
"homepage": "http://aristeides.com"
|
46 |
+
}
|
47 |
+
],
|
48 |
+
"description": "A PHP library for color manipulation in themes and plugins",
|
49 |
+
"homepage": "http://aristath.github.io/ariColor",
|
50 |
+
"support": {
|
51 |
+
"issues": "https://github.com/aristath/ariColor/issues",
|
52 |
+
"source": "https://github.com/aristath/ariColor/tree/v1.1.2"
|
53 |
+
},
|
54 |
+
"funding": [
|
55 |
+
{
|
56 |
+
"url": "https://github.com/aristath",
|
57 |
+
"type": "github"
|
58 |
+
}
|
59 |
+
],
|
60 |
+
"time": "2020-09-15T07:10:36+00:00"
|
61 |
+
}
|
62 |
+
],
|
63 |
+
"packages-dev": [],
|
64 |
+
"aliases": [],
|
65 |
+
"minimum-stability": "stable",
|
66 |
+
"stability-flags": [],
|
67 |
+
"prefer-stable": false,
|
68 |
+
"prefer-lowest": false,
|
69 |
+
"platform": [],
|
70 |
+
"platform-dev": [],
|
71 |
+
"plugin-api-version": "2.2.0"
|
72 |
+
}
|
er-admin.css
DELETED
@@ -1,113 +0,0 @@
|
|
1 |
-
.wp-erident-dashboard .er-textfield {
|
2 |
-
width:400px;
|
3 |
-
padding:5px;
|
4 |
-
}
|
5 |
-
.wp-erident-dashboard .er-textfield-small {
|
6 |
-
padding:5px;
|
7 |
-
width:130px;
|
8 |
-
}
|
9 |
-
.wp-erident-dashboard td {
|
10 |
-
margin-bottom: 9px;
|
11 |
-
padding: 8px 10px;
|
12 |
-
line-height: 20px;
|
13 |
-
font-size: 12px;
|
14 |
-
}
|
15 |
-
.wp-erident-dashboard th {
|
16 |
-
vertical-align: top;
|
17 |
-
text-align: left;
|
18 |
-
padding: 10px;
|
19 |
-
width: 220px;
|
20 |
-
font-weight:normal;
|
21 |
-
}
|
22 |
-
#ilctabscolorpicker, #ilctabscolorpicker2, #ilctabscolorpicker3, #ilctabscolorpicker4, #ilctabscolorpicker5, #ilctabscolorpicker6, #ilctabscolorpicker7, #ilctabscolorpicker8, #ilctabscolorpicker9, #ilctabscolorpicker10 {
|
23 |
-
margin-left:210px;
|
24 |
-
position:absolute;
|
25 |
-
}
|
26 |
-
#ilctabscolorpicker {
|
27 |
-
margin-top:-90px;
|
28 |
-
}
|
29 |
-
#ilctabscolorpicker2 {
|
30 |
-
margin-top:-160px;
|
31 |
-
}
|
32 |
-
#ilctabscolorpicker3 {
|
33 |
-
margin-top:-50px;
|
34 |
-
}
|
35 |
-
#ilctabscolorpicker4 {
|
36 |
-
margin-top:-160px;
|
37 |
-
}
|
38 |
-
#ilctabscolorpicker5 {
|
39 |
-
margin-top:-55px;
|
40 |
-
}
|
41 |
-
#ilctabscolorpicker6 {
|
42 |
-
margin-top:-160px;
|
43 |
-
}
|
44 |
-
#ilctabscolorpicker7 {
|
45 |
-
margin-top:-170px;
|
46 |
-
}
|
47 |
-
#ilctabscolorpicker8 {
|
48 |
-
margin-top:-55px;
|
49 |
-
}
|
50 |
-
#ilctabscolorpicker9 {
|
51 |
-
margin-top:-170px;
|
52 |
-
}
|
53 |
-
#ilctabscolorpicker10 {
|
54 |
-
margin-top:-170px;
|
55 |
-
}
|
56 |
-
|
57 |
-
.er_notice {
|
58 |
-
padding: 10px 20px;
|
59 |
-
-moz-border-radius: 3px;
|
60 |
-
-webkit-border-radius: 3px;
|
61 |
-
border-radius: 3px;
|
62 |
-
background: lightYellow;
|
63 |
-
border: 1px solid #E6DB55;
|
64 |
-
margin: 10px 5px 10px 0;
|
65 |
-
float: left;
|
66 |
-
width: 46%;
|
67 |
-
min-width: 310px;
|
68 |
-
}
|
69 |
-
.er_notice2 {
|
70 |
-
color: #00529B;
|
71 |
-
background-color: #BDE5F8;
|
72 |
-
border: 1px solid;
|
73 |
-
margin: 10px 0px;
|
74 |
-
padding:15px 20px;
|
75 |
-
width: 45%;
|
76 |
-
float: left;
|
77 |
-
margin-right: 10px;
|
78 |
-
min-width: 260px;
|
79 |
-
}
|
80 |
-
.er_notice2.orange {
|
81 |
-
background-color: #ffeed0;
|
82 |
-
border-color: orange;
|
83 |
-
color: #444;
|
84 |
-
}
|
85 |
-
.wp-erident-dashboard select {
|
86 |
-
height:30px;
|
87 |
-
}
|
88 |
-
.settings_page_erident-custom-login-and-dashboard .postbox .hndle {
|
89 |
-
padding:5px;
|
90 |
-
}
|
91 |
-
.settings_page_erident-custom-login-and-dashboard .postbox .hndle span {
|
92 |
-
font-size: 15px;
|
93 |
-
}
|
94 |
-
.settings_page_erident-custom-login-and-dashboard .postbox .hndle .postbox-title-action {
|
95 |
-
font-size:12px;
|
96 |
-
font-style:italic;
|
97 |
-
padding-left:5px;
|
98 |
-
}
|
99 |
-
.er_notice2 li.login-page a {
|
100 |
-
color:red;
|
101 |
-
}
|
102 |
-
.er_notice2 li.green a {
|
103 |
-
color:green;
|
104 |
-
}
|
105 |
-
.settings_page_erident-custom-login-and-dashboard .inside {
|
106 |
-
display: none;
|
107 |
-
}
|
108 |
-
.settings_page_erident-custom-login-and-dashboard .inside.openinside {
|
109 |
-
display: block;
|
110 |
-
}
|
111 |
-
.clearfix {
|
112 |
-
clear: both;
|
113 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
er-custom-login.php
CHANGED
@@ -1,1061 +1,74 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Plugin Name: Erident Custom Login and Dashboard
|
4 |
-
* Plugin URI: https://ultimatedashboard.io/
|
5 |
-
* Description:
|
6 |
-
* Text Domain: erident-custom-login-and-dashboard
|
7 |
-
* Domain Path: /languages
|
8 |
-
* Version:
|
9 |
-
* Author: David Vongries
|
10 |
-
* Author URI: https://
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
/*Get all options from db */
|
76 |
-
$er_options = get_option('plugin_erident_settings');
|
77 |
-
|
78 |
-
if($er_options['dashboard_check_shadow'] == "Yes") {
|
79 |
-
$er_login_link_shadow = $er_options['dashboard_link_shadow'].' 0 1px 0';
|
80 |
-
}
|
81 |
-
else {
|
82 |
-
$er_login_link_shadow = "none";
|
83 |
-
}
|
84 |
-
|
85 |
-
if($er_options['dashboard_check_form_shadow'] == "Yes") {
|
86 |
-
$er_login_form_shadow = '0 4px 10px -1px '.$er_options['dashboard_form_shadow'];
|
87 |
-
}
|
88 |
-
else {
|
89 |
-
$er_login_form_shadow = "none";
|
90 |
-
}
|
91 |
-
|
92 |
-
if($er_options['dashboard_check_lost_pass'] == "Yes") {
|
93 |
-
$er_login_lost_pass = "none";
|
94 |
-
}
|
95 |
-
else {
|
96 |
-
$er_login_lost_pass = "block";
|
97 |
-
}
|
98 |
-
|
99 |
-
if($er_options['dashboard_check_backtoblog'] == "Yes") {
|
100 |
-
$er_login_backtoblog = "none";
|
101 |
-
}
|
102 |
-
else {
|
103 |
-
$er_login_backtoblog = "block";
|
104 |
-
}
|
105 |
-
|
106 |
-
/* Check if opacity field is empty */
|
107 |
-
if($er_options['dashboard_login_bg_opacity'] == "") {
|
108 |
-
$er_login_default_opacity = "1";
|
109 |
-
}
|
110 |
-
else {
|
111 |
-
$er_login_default_opacity = $er_options['dashboard_login_bg_opacity'];
|
112 |
-
}
|
113 |
-
function er_hex2rgb( $colour ) {
|
114 |
-
if ( $colour[0] == '#' ) {
|
115 |
-
$colour = substr( $colour, 1 );
|
116 |
-
}
|
117 |
-
if ( strlen( $colour ) == 6 ) {
|
118 |
-
list( $r, $g, $b ) = array( $colour[0] . $colour[1], $colour[2] . $colour[3], $colour[4] . $colour[5] );
|
119 |
-
} elseif ( strlen( $colour ) == 3 ) {
|
120 |
-
list( $r, $g, $b ) = array( $colour[0] . $colour[0], $colour[1] . $colour[1], $colour[2] . $colour[2] );
|
121 |
-
} else {
|
122 |
-
return false;
|
123 |
-
}
|
124 |
-
$r = hexdec( $r );
|
125 |
-
$g = hexdec( $g );
|
126 |
-
$b = hexdec( $b );
|
127 |
-
return array( 'red' => $r, 'green' => $g, 'blue' => $b );
|
128 |
-
}
|
129 |
-
$btnrgba = er_hex2rgb( $er_options['dashboard_button_color'] );
|
130 |
-
$loginbg = er_hex2rgb( $er_options['dashboard_login_bg'] );
|
131 |
-
|
132 |
-
?>
|
133 |
-
<style type="text/css">
|
134 |
-
/* Styles loading from Erident Custom Login and Dashboard Plugin*/
|
135 |
-
html {
|
136 |
-
background: none !important;
|
137 |
-
}
|
138 |
-
html body.login {
|
139 |
-
background: <?php echo $er_options['top_bg_color'] ?> url(<?php echo $er_options['top_bg_image'] ?>) <?php echo $er_options['top_bg_repeat'] ?> <?php echo $er_options['top_bg_xpos'] ?> <?php echo $er_options['top_bg_ypos'] ?> !important;
|
140 |
-
background-size: <?php echo $er_options['top_bg_size'] ?> !important;
|
141 |
-
}
|
142 |
-
body.login div#login h1 a {
|
143 |
-
background-image: url(<?php echo $er_options['dashboard_image_logo'] ?>) !important;
|
144 |
-
padding-bottom: 30px;
|
145 |
-
margin: 0 auto;
|
146 |
-
background-size: <?php echo $er_options['dashboard_image_logo_width'] ?>px <?php echo $er_options['dashboard_image_logo_height'] ?>px;
|
147 |
-
width: <?php echo $er_options['dashboard_image_logo_width'] ?>px;
|
148 |
-
height: <?php echo $er_options['dashboard_image_logo_height'] ?>px;
|
149 |
-
}
|
150 |
-
body.login #login {
|
151 |
-
width:<?php echo $er_options['dashboard_login_width'] ?>px;
|
152 |
-
}
|
153 |
-
.login form {
|
154 |
-
border-radius:<?php echo $er_options['dashboard_login_radius'] ?>px !important;
|
155 |
-
border:<?php echo $er_options['dashboard_border_thick'] ?>px <?php echo $er_options['dashboard_login_border'] ?> <?php echo $er_options['dashboard_border_color'] ?> !important;
|
156 |
-
background:rgba(<?php echo $loginbg['red'];?>,<?php echo $loginbg['green']?>,<?php echo $loginbg['blue']?>,<?php echo $er_login_default_opacity; ?>) url(<?php echo $er_options['login_bg_image'] ?>) <?php echo $er_options['login_bg_repeat'] ?> <?php echo $er_options['login_bg_xpos'] ?> <?php echo $er_options['login_bg_ypos'] ?> !important;
|
157 |
-
-moz-box-shadow: <?php echo $er_login_form_shadow ?> !important;
|
158 |
-
-webkit-box-shadow: <?php echo $er_login_form_shadow ?> !important;
|
159 |
-
box-shadow: <?php echo $er_login_form_shadow ?> !important;
|
160 |
-
}
|
161 |
-
body.login div#login form label, p#reg_passmail {
|
162 |
-
color:<?php echo $er_options['dashboard_text_color'] ?> !important;
|
163 |
-
font-size:<?php echo $er_options['dashboard_label_text_size'] ?>px !important;
|
164 |
-
}
|
165 |
-
body.login #loginform p.submit .button-primary, body.wp-core-ui .button-primary {
|
166 |
-
background: <?php echo $er_options['dashboard_button_color'] ?> !important;
|
167 |
-
color: <?php echo isset($er_options['dashboard_button_text_color']) ? $er_options['dashboard_button_text_color'] : '#ffffff' ; ?> !important;
|
168 |
-
border: none !important;
|
169 |
-
text-shadow: <?php echo $er_login_link_shadow ?> !important;
|
170 |
-
}
|
171 |
-
body.login #loginform p.submit .button-primary:hover, body.login #loginform p.submit .button-primary:focus, body.wp-core-ui .button-primary:hover {
|
172 |
-
background: rgba(<?php echo $btnrgba['red'];?>,<?php echo $btnrgba['green']?>,<?php echo $btnrgba['blue']?>, 0.9) !important;
|
173 |
-
}
|
174 |
-
body.login div#login form .input, .login input[type="text"] {
|
175 |
-
color: <?php echo $er_options['dashboard_input_text_color'] ?> !important;
|
176 |
-
font-size:<?php echo $er_options['dashboard_input_text_size'] ?>px !important;
|
177 |
-
}
|
178 |
-
body.login #nav a, body.login #backtoblog a {
|
179 |
-
color: <?php echo $er_options['dashboard_link_color'] ?> !important;
|
180 |
-
}
|
181 |
-
body.login #nav, body.login #backtoblog {
|
182 |
-
text-shadow: <?php echo $er_login_link_shadow ?> !important;
|
183 |
-
}
|
184 |
-
.login form .input, .login input[type=text], .wp-core-ui .button-primary:focus {
|
185 |
-
box-shadow: none !important;
|
186 |
-
}
|
187 |
-
body.login #loginform p.submit .button-primary, body.wp-core-ui .button-primary { box-shadow: none; }
|
188 |
-
body.login p#nav { display: <?php echo $er_login_lost_pass ?> !important; }
|
189 |
-
body.login #backtoblog { display: <?php echo $er_login_backtoblog ?> !important; }
|
190 |
-
</style>
|
191 |
-
<?php
|
192 |
-
}
|
193 |
-
add_action( 'login_enqueue_scripts', 'er_login_logo' );
|
194 |
-
|
195 |
-
/* Login Links */
|
196 |
-
function er_login_logo_url() {
|
197 |
-
return get_bloginfo( 'url' );
|
198 |
-
}
|
199 |
-
add_filter( 'login_headerurl', 'er_login_logo_url' );
|
200 |
-
|
201 |
-
function er_login_logo_url_title() {
|
202 |
-
/*Get all options from db */
|
203 |
-
$er_options = get_option('plugin_erident_settings');
|
204 |
-
return stripslashes($er_options['dashboard_power_text']);
|
205 |
-
}
|
206 |
-
add_filter( 'login_headertext', 'er_login_logo_url_title' );
|
207 |
-
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Process a settings export that generates a .json file of the erident settings
|
211 |
-
*/
|
212 |
-
function er_process_settings_export() {
|
213 |
-
|
214 |
-
if( empty( $_POST['er_action'] ) || 'export_settings' != $_POST['er_action'] )
|
215 |
-
return;
|
216 |
-
|
217 |
-
if( ! wp_verify_nonce( $_POST['er_export_nonce'], 'er_export_nonce' ) )
|
218 |
-
return;
|
219 |
-
|
220 |
-
if( ! current_user_can( 'manage_options' ) )
|
221 |
-
return;
|
222 |
-
|
223 |
-
$settings = get_option( 'plugin_erident_settings' );
|
224 |
-
|
225 |
-
ignore_user_abort( true );
|
226 |
-
|
227 |
-
nocache_headers();
|
228 |
-
header( 'Content-Type: application/json; charset=utf-8' );
|
229 |
-
header( 'Content-Disposition: attachment; filename=erident-settings-export-' . date( 'm-d-Y' ) . '.json' );
|
230 |
-
header( "Expires: 0" );
|
231 |
-
|
232 |
-
echo json_encode( $settings );
|
233 |
-
exit;
|
234 |
-
}
|
235 |
-
add_action( 'admin_init', 'er_process_settings_export' );
|
236 |
-
|
237 |
-
/**
|
238 |
-
* Process a settings import from a json file
|
239 |
-
*/
|
240 |
-
function er_process_settings_import() {
|
241 |
-
|
242 |
-
if( empty( $_POST['er_action'] ) || 'import_settings' != $_POST['er_action'] )
|
243 |
-
return;
|
244 |
-
|
245 |
-
if( ! wp_verify_nonce( $_POST['er_import_nonce'], 'er_import_nonce' ) )
|
246 |
-
return;
|
247 |
-
|
248 |
-
if( ! current_user_can( 'manage_options' ) )
|
249 |
-
return;
|
250 |
-
|
251 |
-
$extension = end( explode( '.', $_FILES['import_file']['name'] ) );
|
252 |
-
|
253 |
-
if( $extension != 'json' ) {
|
254 |
-
wp_die( __( 'Please upload a valid .json file' ) );
|
255 |
-
}
|
256 |
-
|
257 |
-
$import_file = $_FILES['import_file']['tmp_name'];
|
258 |
-
|
259 |
-
if( empty( $import_file ) ) {
|
260 |
-
wp_die( __( 'Please upload a file to import' ) );
|
261 |
-
}
|
262 |
-
|
263 |
-
// Retrieve the settings from the file and convert the json object to an array.
|
264 |
-
$settings = (array) json_decode( file_get_contents( $import_file ) );
|
265 |
-
|
266 |
-
update_option( 'plugin_erident_settings', $settings );
|
267 |
-
echo '<div id="message" class="updated fade"><p><strong>' . __('New settings imported successfully!') . '</strong></p></div>';
|
268 |
-
|
269 |
-
}
|
270 |
-
add_action( 'admin_init', 'er_process_settings_import' );
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
/* Runs when plugin is activated */
|
275 |
-
register_activation_hook(__FILE__,'wp_erident_dashboard_install');
|
276 |
-
|
277 |
-
/* Runs on plugin deactivation*/
|
278 |
-
register_deactivation_hook( __FILE__, 'wp_erident_dashboard_remove' );
|
279 |
-
|
280 |
-
function wp_erident_dashboard_install() {
|
281 |
-
/* Creates new database field */
|
282 |
-
|
283 |
-
$er_new_options = array(
|
284 |
-
'dashboard_data_left' => 'Powered by YourWebsiteName',
|
285 |
-
'dashboard_data_right' => '© 2021 All Rights Reserved',
|
286 |
-
'dashboard_image_logo' => plugins_url('images/default-logo.png', __FILE__),
|
287 |
-
'dashboard_image_logo_width' => '274',
|
288 |
-
'dashboard_image_logo_height' => '63',
|
289 |
-
'dashboard_power_text' => 'Powered by YourWebsiteName',
|
290 |
-
'dashboard_login_width' => '350',
|
291 |
-
'dashboard_login_radius' => '10',
|
292 |
-
'dashboard_login_border' => 'solid',
|
293 |
-
'dashboard_border_thick' => '4',
|
294 |
-
'dashboard_border_color' => '#0069A0',
|
295 |
-
'dashboard_login_bg' => '#dbdbdb',
|
296 |
-
'dashboard_login_bg_opacity' => '1',
|
297 |
-
'dashboard_text_color' => '#000000',
|
298 |
-
'dashboard_input_text_color' => '#555555',
|
299 |
-
'dashboard_label_text_size' => '14',
|
300 |
-
'dashboard_input_text_size' => '24',
|
301 |
-
'dashboard_link_color' => '#21759B',
|
302 |
-
'dashboard_check_shadow' => 'Yes',
|
303 |
-
'dashboard_link_shadow' => '#ffffff',
|
304 |
-
'dashboard_check_form_shadow' => 'Yes',
|
305 |
-
'dashboard_check_lost_pass' => 'No',
|
306 |
-
'dashboard_check_backtoblog' => 'No',
|
307 |
-
'dashboard_form_shadow' => '#C8C8C8',
|
308 |
-
'dashboard_button_color' => '#5E5E5E',
|
309 |
-
'dashboard_button_text_color' => '#FFFFFF',
|
310 |
-
'top_bg_color' => '#f9fad2',
|
311 |
-
'top_bg_image' => plugins_url('images/top_bg.jpg', __FILE__),
|
312 |
-
'top_bg_repeat' => 'repeat',
|
313 |
-
'top_bg_xpos' => 'top',
|
314 |
-
'top_bg_ypos' => 'left',
|
315 |
-
'login_bg_image' => plugins_url('images/form_bg.jpg', __FILE__),
|
316 |
-
'login_bg_repeat' => 'repeat',
|
317 |
-
'login_bg_xpos' => 'top',
|
318 |
-
'login_bg_ypos' => 'left',
|
319 |
-
'top_bg_size' => 'auto',
|
320 |
-
'dashboard_delete_db' => 'No'
|
321 |
-
);
|
322 |
-
|
323 |
-
add_option( 'plugin_erident_settings', $er_new_options );
|
324 |
-
}
|
325 |
-
|
326 |
-
function wp_erident_dashboard_remove() {
|
327 |
-
/*Get all options from db */
|
328 |
-
$er_options = get_option('plugin_erident_settings');
|
329 |
-
|
330 |
-
if($er_options['dashboard_delete_db'] == "Yes") {
|
331 |
-
/* Deletes the database field */
|
332 |
-
delete_option('plugin_erident_settings');
|
333 |
-
}
|
334 |
-
else { }
|
335 |
-
}
|
336 |
-
|
337 |
-
if ( is_admin() ){
|
338 |
-
add_action( 'admin_init', 'wp_erident_dashboard_admin_init' );
|
339 |
-
add_action( 'admin_menu', 'wp_erident_dashboard_admin_menu' );
|
340 |
-
|
341 |
-
function wp_erident_dashboard_admin_init() {
|
342 |
-
/* Register our script.*/
|
343 |
-
wp_enqueue_script( 'farbtastic', array('jquery') );
|
344 |
-
}
|
345 |
-
|
346 |
-
function wp_erident_dashboard_admin_menu() {
|
347 |
-
/* Register our plugin page */
|
348 |
-
$page = add_options_page(__('Custom Login and Dashboard', 'erident-custom-login-and-dashboard'), __('Custom Login and Dashboard', 'erident-custom-login-and-dashboard'), 'administrator', 'erident-custom-login-and-dashboard', 'wp_erident_dashboard_html_page');
|
349 |
-
|
350 |
-
/* Using registered $page handle to hook script load */
|
351 |
-
add_action('admin_print_styles-' . $page, 'wp_erident_dashboard_admin_styles');
|
352 |
-
}
|
353 |
-
|
354 |
-
function wp_erident_dashboard_admin_styles() {
|
355 |
-
/*
|
356 |
-
* It will be called only on your plugin admin page, enqueue our script here
|
357 |
-
*/
|
358 |
-
wp_enqueue_script( 'wp_erident_dashboard-script2' );
|
359 |
-
wp_enqueue_script( 'wp_erident_dashboard-script' );
|
360 |
-
}
|
361 |
-
/* Call the html code */
|
362 |
-
|
363 |
-
}
|
364 |
-
function wp_erident_dashboard_html_page() {
|
365 |
-
?>
|
366 |
-
|
367 |
-
<div class="wrap">
|
368 |
-
<div id="icon-options-general" class="icon32"><br></div>
|
369 |
-
<h2><?php _e( 'Erident Custom Login and Dashboard Settings', 'erident-custom-login-and-dashboard' ); ?></h2>
|
370 |
-
<p><i><?php _e( 'Plugin Loads default values for all below entries. Please change the values to yours.', 'erident-custom-login-and-dashboard' ); ?></i><br/><span style="background: #f9ff0a;"><?php _e( 'Click on the header of each block to open it.', 'erident-custom-login-and-dashboard' ); ?></span></p>
|
371 |
-
<form class="wp-erident-dashboard" method="post">
|
372 |
-
|
373 |
-
<?php
|
374 |
-
if( isset($_POST['er_update_settings']) ) {
|
375 |
-
if ( ! empty( $_POST ) && check_admin_referer( 'er_nonce_form', 'er_total_nonce' ) ) {
|
376 |
-
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
377 |
-
$er_new_options = $_POST['er_options_up'];
|
378 |
-
update_option( 'plugin_erident_settings', $er_new_options);
|
379 |
-
echo '<div id="message" class="updated fade"><p><strong>' . __('Settings saved.') . '</strong></p></div>';
|
380 |
-
}
|
381 |
-
} ?>
|
382 |
-
<?php /*Get all options from db */
|
383 |
-
$er_options = get_option('plugin_erident_settings');
|
384 |
-
|
385 |
-
|
386 |
-
?>
|
387 |
-
<div class="postbox">
|
388 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Dashboard Settings', 'erident-custom-login-and-dashboard' ); ?></span>
|
389 |
-
<span class="postbox-title-action"><?php _e( '(These settings will be reflected when a user/admin logins to the WordPress Dashboard)', 'erident-custom-login-and-dashboard' ); ?></span>
|
390 |
-
</h3>
|
391 |
-
<div class="inside">
|
392 |
-
<table border="0">
|
393 |
-
<tr valign="top">
|
394 |
-
<th scope="row"><?php _e( 'Enter the text for dashboard left side footer:', 'erident-custom-login-and-dashboard' ); ?></th>
|
395 |
-
<td>
|
396 |
-
<input class="er-textfield" name="er_options_up[dashboard_data_left]" type="text" id="wp_erident_dashboard_data_left"
|
397 |
-
value="<?php echo esc_html( stripslashes($er_options['dashboard_data_left'] )); ?>" placeholder="Text for dashboard left side footer" />
|
398 |
-
<br />
|
399 |
-
<span class="description"><?php _e( 'This will replace the default "Thank you for creating with WordPress" on the bottom left side of dashboard', 'erident-custom-login-and-dashboard' ); ?></span>
|
400 |
-
</td>
|
401 |
-
</tr>
|
402 |
-
<tr valign="top">
|
403 |
-
<th scope="row"><?php _e( 'Enter the text for dashboard right side footer:', 'erident-custom-login-and-dashboard' ); ?></th>
|
404 |
-
<td><input class="er-textfield" name="er_options_up[dashboard_data_right]" type="text" id="wp_erident_dashboard_data_right"
|
405 |
-
value="<?php echo esc_html( stripslashes($er_options['dashboard_data_right'] )); ?>" placeholder="Text for dashboard left right footer" />
|
406 |
-
<br />
|
407 |
-
<span class="description"><?php _e( 'This will replace the default "WordPress Version" on the bottom right side of dashboard. Keep it as empty field for disabling this feature. Refresh the page again to see the result after saving.', 'erident-custom-login-and-dashboard' ); ?></span>
|
408 |
-
</td>
|
409 |
-
</tr>
|
410 |
-
</table>
|
411 |
-
</div><!-- end inside -->
|
412 |
-
</div><!-- end postbox -->
|
413 |
-
|
414 |
-
<div class="postbox">
|
415 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Login Screen Background', 'erident-custom-login-and-dashboard' ); ?></span>
|
416 |
-
<span class="postbox-title-action"><?php _e( '(The following settings will be reflected on the "wp-login.php" page)', 'erident-custom-login-and-dashboard' ); ?></span>
|
417 |
-
</h3>
|
418 |
-
<div class="inside">
|
419 |
-
<table border="0">
|
420 |
-
<tr valign="top">
|
421 |
-
<th scope="row"><?php _e( 'Login Screen Background Color:', 'erident-custom-login-and-dashboard' ); ?></th>
|
422 |
-
<td>
|
423 |
-
<input class="er-textfield-small" type="text" id="wp_erident_top_bg_color" name="er_options_up[top_bg_color]" value="<?php echo $er_options['top_bg_color']; ?>" />
|
424 |
-
<div id="ilctabscolorpicker4"></div>
|
425 |
-
<br />
|
426 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
427 |
-
</td>
|
428 |
-
</tr>
|
429 |
-
|
430 |
-
<tr valign="top">
|
431 |
-
<th scope="row"><?php _e( 'Login Screen Background Image:', 'erident-custom-login-and-dashboard' ); ?></th>
|
432 |
-
<td><input class="er-textfield" name="er_options_up[top_bg_image]" type="text" id="wp_erident_top_bg_image"
|
433 |
-
value="<?php echo $er_options['top_bg_image']; ?>" /><button class="set_custom_images button"><?php _e( 'Add Background Image', 'erident-custom-login-and-dashboard' ); ?></button>
|
434 |
-
<br />
|
435 |
-
<span class="description"><?php _e( 'Add your own pattern/image url for the screen background. Leave blank if you don\'t need any images.', 'erident-custom-login-and-dashboard' ); ?></span>
|
436 |
-
</td>
|
437 |
-
</tr>
|
438 |
-
<tr valign="top">
|
439 |
-
<th scope="row"><?php _e( 'Login Screen Background Repeat', 'erident-custom-login-and-dashboard' ); ?></th>
|
440 |
-
<td>
|
441 |
-
<?php
|
442 |
-
switch($er_options['top_bg_repeat'])
|
443 |
-
{
|
444 |
-
case 'none':
|
445 |
-
$er_screen_a='selected="selected"';
|
446 |
-
$er_screen_b=$er_screen_c=$er_screen_d="";
|
447 |
-
break;
|
448 |
-
|
449 |
-
case 'repeat':
|
450 |
-
$er_screen_b='selected="selected"';
|
451 |
-
$er_screen_a=$er_screen_c=$er_screen_d="";
|
452 |
-
break;
|
453 |
-
|
454 |
-
case 'repeat-x':
|
455 |
-
$er_screen_c='selected="selected"';
|
456 |
-
$er_screen_a=$er_screen_b=$er_screen_d="";
|
457 |
-
break;
|
458 |
-
|
459 |
-
case 'repeat-y':
|
460 |
-
$er_screen_d='selected="selected"';
|
461 |
-
$er_screen_a=$er_screen_b=$er_screen_c="";
|
462 |
-
break;
|
463 |
-
|
464 |
-
default:
|
465 |
-
$er_screen_a=$er_screen_b=$er_screen_c=$er_screen_d="";
|
466 |
-
break;
|
467 |
-
}
|
468 |
-
?>
|
469 |
-
<select class="er-textfield-small" name="er_options_up[top_bg_repeat]" id="wp_erident_top_bg_repeat">
|
470 |
-
<option value="no-repeat" <?php echo $er_screen_a; ?>>No Repeat</option>
|
471 |
-
<option value="repeat" <?php echo $er_screen_b; ?>>Repeat</option>
|
472 |
-
<option value="repeat-x" <?php echo $er_screen_c; ?>>Repeat-x</option>
|
473 |
-
<option value="repeat-y" <?php echo $er_screen_d; ?>>Repeat-y</option>
|
474 |
-
</select>
|
475 |
-
|
476 |
-
<br />
|
477 |
-
<span class="description"><?php _e( 'Select an image repeat option from dropdown.', 'erident-custom-login-and-dashboard' ); ?></span>
|
478 |
-
</td>
|
479 |
-
</tr>
|
480 |
-
<tr valign="top">
|
481 |
-
<th scope="row"><?php _e( 'Background Position:', 'erident-custom-login-and-dashboard' ); ?></th>
|
482 |
-
<td><?php _e( 'Horizontal Position: ', 'erident-custom-login-and-dashboard' ); ?> <input class="er-textfield-small" name="er_options_up[top_bg_xpos]" type="text" id="wp_erident_top_bg_xpos"
|
483 |
-
value="<?php echo $er_options['top_bg_xpos']; ?>" />
|
484 |
-
Vertical Position: <input class="er-textfield-small" name="er_options_up[top_bg_ypos]" type="text" id="wp_erident_top_bg_ypos"
|
485 |
-
value="<?php echo $er_options['top_bg_ypos']; ?>" />
|
486 |
-
<br />
|
487 |
-
<span class="description"><?php _e( 'The background-position property sets the starting position of a background image. If you entering the value in "pixels" or "percentage", add "px" or "%" at the end of value. This will not show any changes if you set the Background Repeat option as "Repeat". <a href="http://www.w3schools.com/cssref/pr_background-position.asp" target="_blank">More Info</a>', 'erident-custom-login-and-dashboard' ); ?></span>
|
488 |
-
</td>
|
489 |
-
</tr>
|
490 |
-
|
491 |
-
<tr valign="top">
|
492 |
-
<th scope="row"><?php _e( 'Background Size:', 'erident-custom-login-and-dashboard' ); ?></th>
|
493 |
-
<td><input class="er-textfield-small" name="er_options_up[top_bg_size]" type="text" id="wp_erident_top_bg_size"
|
494 |
-
value="<?php echo $er_options['top_bg_size']; ?>" />
|
495 |
-
<br />
|
496 |
-
<span class="description"><?php _e( 'The background-size property specifies the size of a background image. If you entering the value in "pixels" or "percentage", add "px" or "%" at the end of value. Possible values: auto, length, percentage, cover, contain. <a href="http://www.w3schools.com/cssref/css3_pr_background-size.asp" target="_blank">More Info</a>', 'erident-custom-login-and-dashboard' ); ?></span>
|
497 |
-
</td>
|
498 |
-
</tr>
|
499 |
-
|
500 |
-
</table>
|
501 |
-
</div><!-- end inside -->
|
502 |
-
</div><!-- end postbox -->
|
503 |
-
|
504 |
-
|
505 |
-
<div class="postbox">
|
506 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Login Screen Logo', 'erident-custom-login-and-dashboard' ); ?></span>
|
507 |
-
<span class="postbox-title-action"><?php _e( '(Change the default WordPress logo and powered by text)', 'erident-custom-login-and-dashboard' ); ?></span>
|
508 |
-
</h3>
|
509 |
-
<div class="inside openinside">
|
510 |
-
<table>
|
511 |
-
<tr valign="top">
|
512 |
-
<th scope="row"><?php _e( 'Logo Url:', 'erident-custom-login-and-dashboard' ); ?></th>
|
513 |
-
<td><input class="er-textfield" name="er_options_up[dashboard_image_logo]" type="text" id="wp_erident_dashboard_image_logo"
|
514 |
-
value="<?php echo $er_options['dashboard_image_logo']; ?>" class="regular-text process_custom_images" max="" min="1" step="1" /> <button class="set_custom_images button"><?php _e( 'Add Logo', 'erident-custom-login-and-dashboard' ); ?></button>
|
515 |
-
<br />
|
516 |
-
<span class="description"><?php _e( '(URL path to image to replace default WordPress Logo. (You can upload your image with the WordPress media uploader)', 'erident-custom-login-and-dashboard' ); ?></span>
|
517 |
-
</td>
|
518 |
-
</tr>
|
519 |
-
|
520 |
-
<tr valign="top">
|
521 |
-
<th scope="row"><?php _e( 'Logo Width:', 'erident-custom-login-and-dashboard' ); ?></th>
|
522 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_image_logo_width]" type="text" id="wp_erident_dashboard_image_logo_width"
|
523 |
-
value="<?php echo $er_options['dashboard_image_logo_width']; ?>" />px
|
524 |
-
<br />
|
525 |
-
<span class="description"><?php _e( 'Your Logo width(Enter in pixels). Default: 274px', 'erident-custom-login-and-dashboard' ); ?></span>
|
526 |
-
</td>
|
527 |
-
</tr>
|
528 |
-
<tr valign="top">
|
529 |
-
<th scope="row"><?php _e( 'Logo Height:', 'erident-custom-login-and-dashboard' ); ?></th>
|
530 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_image_logo_height]" type="text" id="wp_erident_dashboard_image_logo_height"
|
531 |
-
value="<?php echo $er_options['dashboard_image_logo_height']; ?>" />px
|
532 |
-
<br />
|
533 |
-
<span class="description"><?php _e( 'Your Logo Height(Enter in pixels). Default: 63px', 'erident-custom-login-and-dashboard' ); ?></span>
|
534 |
-
</td>
|
535 |
-
</tr>
|
536 |
-
|
537 |
-
<tr valign="top">
|
538 |
-
<th scope="row"><?php _e( 'Powered by Text:', 'erident-custom-login-and-dashboard' ); ?></th>
|
539 |
-
<td><input class="er-textfield" name="er_options_up[dashboard_power_text]" type="text" id="wp_erident_dashboard_power_text"
|
540 |
-
value="<?php echo stripslashes($er_options['dashboard_power_text']); ?>" />
|
541 |
-
<br />
|
542 |
-
<span class="description"><?php _e( 'Show when mouse hover over custom Login logo', 'erident-custom-login-and-dashboard' ); ?></span>
|
543 |
-
</td>
|
544 |
-
</tr>
|
545 |
-
</table>
|
546 |
-
</div><!-- end inside -->
|
547 |
-
</div><!-- end postbox -->
|
548 |
-
|
549 |
-
|
550 |
-
<div class="postbox">
|
551 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Login Form Settings', 'erident-custom-login-and-dashboard' ); ?></span>
|
552 |
-
<span class="postbox-title-action"><?php _e( '(The following settings will change the Login Form style)', 'erident-custom-login-and-dashboard' ); ?></span>
|
553 |
-
</h3>
|
554 |
-
<div class="inside">
|
555 |
-
<table>
|
556 |
-
<tr valign="top">
|
557 |
-
<th scope="row"><?php _e( 'Login form width:', 'erident-custom-login-and-dashboard' ); ?></th>
|
558 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_login_width]" type="text" id="wp_erident_dashboard_login_width"
|
559 |
-
value="<?php echo $er_options['dashboard_login_width']; ?>" />px
|
560 |
-
<br />
|
561 |
-
<span class="description"><?php _e( 'Total Form width(Enter in pixels). Default: 350px', 'erident-custom-login-and-dashboard' ); ?></span>
|
562 |
-
</td>
|
563 |
-
</tr>
|
564 |
-
<tr valign="top">
|
565 |
-
<th scope="row"><?php _e( 'Login Form Border Radius:', 'erident-custom-login-and-dashboard' ); ?></th>
|
566 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_login_radius]" type="text" id="wp_erident_dashboard_login_radius"
|
567 |
-
value="<?php echo $er_options['dashboard_login_radius']; ?>" />px
|
568 |
-
<br />
|
569 |
-
<span class="description"><?php _e( 'Border Radius of Login Form. This is the option to make the corners rounded.(Enter in pixels)', 'erident-custom-login-and-dashboard' ); ?></span>
|
570 |
-
</td>
|
571 |
-
</tr>
|
572 |
-
<tr valign="top">
|
573 |
-
<th scope="row"><?php _e( 'Login Border Style', 'erident-custom-login-and-dashboard' ); ?></th>
|
574 |
-
<td>
|
575 |
-
<?php
|
576 |
-
switch($er_options['dashboard_login_border'])
|
577 |
-
{
|
578 |
-
case 'none':
|
579 |
-
$er_a='selected="selected"';
|
580 |
-
$er_b=$er_c=$er_d=$er_e="";
|
581 |
-
break;
|
582 |
-
|
583 |
-
case 'solid':
|
584 |
-
$er_b='selected="selected"';
|
585 |
-
$er_a=$er_c=$er_d=$er_e="";
|
586 |
-
break;
|
587 |
-
|
588 |
-
case 'dotted':
|
589 |
-
$er_c='selected="selected"';
|
590 |
-
$er_a=$er_b=$er_d=$er_e="";
|
591 |
-
break;
|
592 |
-
|
593 |
-
case 'dashed':
|
594 |
-
$er_d='selected="selected"';
|
595 |
-
$er_a=$er_b=$er_c=$er_e="";
|
596 |
-
break;
|
597 |
-
|
598 |
-
case 'double':
|
599 |
-
$er_e='selected="selected"';
|
600 |
-
$er_a=$er_b=$er_c=$er_d="";
|
601 |
-
break;
|
602 |
-
|
603 |
-
default:
|
604 |
-
$er_a=$er_b=$er_c=$er_d=$er_e="";
|
605 |
-
break;
|
606 |
-
}
|
607 |
-
?>
|
608 |
-
<select class="er-textfield-small" name="er_options_up[dashboard_login_border]" id="wp_erident_dashboard_login_border">
|
609 |
-
<option value="none" <?php echo $er_a; ?>>None</option>
|
610 |
-
<option value="solid" <?php echo $er_b; ?>>Solid</option>
|
611 |
-
<option value="dotted" <?php echo $er_c; ?>>Dotted</option>
|
612 |
-
<option value="dashed" <?php echo $er_d; ?>>Dashed</option>
|
613 |
-
<option value="double" <?php echo $er_e; ?>>Double</option>
|
614 |
-
</select>
|
615 |
-
|
616 |
-
<br />
|
617 |
-
<span class="description"><?php _e( 'Select a Border Style option from dropdown.', 'erident-custom-login-and-dashboard' ); ?></span>
|
618 |
-
</td>
|
619 |
-
</tr>
|
620 |
-
<tr valign="top">
|
621 |
-
<th scope="row"><?php _e( 'Login Border Thickness:', 'erident-custom-login-and-dashboard' ); ?></th>
|
622 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_border_thick]" type="text" id="wp_erident_dashboard_border_thick"
|
623 |
-
value="<?php echo $er_options['dashboard_border_thick']; ?>" />px
|
624 |
-
<br />
|
625 |
-
<span class="description"><?php _e( 'Thickness of Border (Enter value in pixels)', 'erident-custom-login-and-dashboard' ); ?></span>
|
626 |
-
</td>
|
627 |
-
</tr>
|
628 |
-
<tr valign="top">
|
629 |
-
<th scope="row"><?php _e( 'Login Border Color:', 'erident-custom-login-and-dashboard' ); ?></th>
|
630 |
-
<td>
|
631 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_border_color" name="er_options_up[dashboard_border_color]" value="<?php echo $er_options['dashboard_border_color']; ?>" />
|
632 |
-
<div id="ilctabscolorpicker"></div>
|
633 |
-
<br />
|
634 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
635 |
-
</td>
|
636 |
-
</tr>
|
637 |
-
<tr valign="top">
|
638 |
-
<th scope="row"><?php _e( 'Login Form Background Color:', 'erident-custom-login-and-dashboard' ); ?></th>
|
639 |
-
<td>
|
640 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_login_bg" name="er_options_up[dashboard_login_bg]" value="<?php echo $er_options['dashboard_login_bg']; ?>" />
|
641 |
-
<div id="ilctabscolorpicker2"></div>
|
642 |
-
<?php _e( 'Background Opacity: ', 'erident-custom-login-and-dashboard' ); ?> <input class="er-textfield-small" name="er_options_up[dashboard_login_bg_opacity]" type="number" step="0.1" min="0" max="1" id="wp_erident_dashboard_login_bg_opacity" value="<?php echo $er_options['dashboard_login_bg_opacity']; ?>" />
|
643 |
-
<br />
|
644 |
-
<span class="description"><?php _e( 'Click the box to select a color. Background Opacity will helps you to put transparent color over a background image. Possible values 0 to 1. Example: 0.5 means 50% transparency. Default: 1 <a href="https://wordpress.org/plugins/erident-custom-login-and-dashboard/faq/" target="_blank">More Info</a>', 'erident-custom-login-and-dashboard' ); ?></span>
|
645 |
-
</td>
|
646 |
-
</tr>
|
647 |
-
<tr valign="top">
|
648 |
-
<th scope="row"><?php _e( 'Login Form Background Image:', 'erident-custom-login-and-dashboard' ); ?></th>
|
649 |
-
<td><input class="er-textfield" name="er_options_up[login_bg_image]" type="text" id="wp_erident_login_bg_image" value="<?php echo $er_options['login_bg_image']; ?>" /><button class="set_custom_images button"><?php _e( 'Add Background Image', 'erident-custom-login-and-dashboard' ); ?></button>
|
650 |
-
<br />
|
651 |
-
<span class="description"><?php _e( 'Add your own pattern/image url to the form background. Leave blank if you don\'t need any images.', 'erident-custom-login-and-dashboard' ); ?></span>
|
652 |
-
</td>
|
653 |
-
</tr>
|
654 |
-
<tr valign="top">
|
655 |
-
<th scope="row"><?php _e( 'Login Form Background Repeat', 'erident-custom-login-and-dashboard' ); ?></th>
|
656 |
-
<td>
|
657 |
-
<?php
|
658 |
-
switch($er_options['login_bg_repeat'])
|
659 |
-
{
|
660 |
-
case 'none':
|
661 |
-
$er_login_a='selected="selected"';
|
662 |
-
$er_login_b=$er_login_c=$er_login_d="";
|
663 |
-
break;
|
664 |
-
|
665 |
-
case 'repeat':
|
666 |
-
$er_login_b='selected="selected"';
|
667 |
-
$er_login_a=$er_login_c=$er_login_d="";
|
668 |
-
break;
|
669 |
-
|
670 |
-
case 'repeat-x':
|
671 |
-
$er_login_c='selected="selected"';
|
672 |
-
$er_login_a=$er_login_b=$er_login_d="";
|
673 |
-
break;
|
674 |
-
|
675 |
-
case 'repeat-y':
|
676 |
-
$er_login_d='selected="selected"';
|
677 |
-
$er_login_a=$er_login_b=$er_login_c="";
|
678 |
-
break;
|
679 |
-
|
680 |
-
default:
|
681 |
-
$er_login_a=$er_login_b=$er_login_c=$er_login_d="";
|
682 |
-
break;
|
683 |
-
}
|
684 |
-
?>
|
685 |
-
<select class="er-textfield-small" name="er_options_up[login_bg_repeat]" id="wp_erident_login_bg_repeat">
|
686 |
-
<option value="no-repeat" <?php echo $er_login_a; ?>>No Repeat</option>
|
687 |
-
<option value="repeat" <?php echo $er_login_b; ?>>Repeat</option>
|
688 |
-
<option value="repeat-x" <?php echo $er_login_c; ?>>Repeat-x</option>
|
689 |
-
<option value="repeat-y" <?php echo $er_login_d; ?>>Repeat-y</option>
|
690 |
-
</select>
|
691 |
-
|
692 |
-
<br />
|
693 |
-
<span class="description"><?php _e( 'Select an image repeat option from dropdown.', 'erident-custom-login-and-dashboard' ); ?></span>
|
694 |
-
</td>
|
695 |
-
</tr>
|
696 |
-
|
697 |
-
<tr valign="top">
|
698 |
-
<th scope="row"><?php _e( 'Background Position:', 'erident-custom-login-and-dashboard' ); ?></th>
|
699 |
-
<td><?php _e( 'Horizontal Position: ', 'erident-custom-login-and-dashboard' ); ?><input class="er-textfield-small" name="er_options_up[login_bg_xpos]" type="text" id="wp_erident_login_bg_xpos"
|
700 |
-
value="<?php echo $er_options['login_bg_xpos']; ?>" />
|
701 |
-
<?php _e( 'Vertical Position: ', 'erident-custom-login-and-dashboard' ); ?><input class="er-textfield-small" name="er_options_up[login_bg_ypos]" type="text" id="wp_erident_login_bg_ypos"
|
702 |
-
value="<?php echo $er_options['login_bg_ypos']; ?>" />
|
703 |
-
<br />
|
704 |
-
<span class="description"><?php _e( 'The background-position property sets the starting position of a background image. If you entering the value in "pixels" or "percentage", add "px" or "%" at the end of value. This will not show any changes if you set the Background Repeat option as "Repeat". <a href="http://www.w3schools.com/cssref/pr_background-position.asp" target="_blank">More Info</a>', 'erident-custom-login-and-dashboard' ); ?></span>
|
705 |
-
</td>
|
706 |
-
</tr>
|
707 |
-
|
708 |
-
<tr valign="top">
|
709 |
-
<th scope="row"><?php _e( 'Login Form Label Text Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
710 |
-
<td>
|
711 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_text_color" name="er_options_up[dashboard_text_color]" value="<?php echo $er_options['dashboard_text_color']; ?>" />
|
712 |
-
<div id="ilctabscolorpicker3"></div>
|
713 |
-
<br />
|
714 |
-
<span class="description"><?php _e( 'Click the box to select a color. This will change the color of label Username/Password', 'erident-custom-login-and-dashboard' ); ?></span>
|
715 |
-
</td>
|
716 |
-
</tr>
|
717 |
-
<tr valign="top">
|
718 |
-
<th scope="row"><?php _e( 'Login Form Label Text Size:', 'erident-custom-login-and-dashboard' ); ?></th>
|
719 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_label_text_size]" type="text" id="wp_erident_dashboard_label_text_size" value="<?php echo $er_options['dashboard_label_text_size']; ?>" />px
|
720 |
-
<br />
|
721 |
-
<span class="description"><?php _e( 'Font Size of Label Username/Password(Enter value in pixels)', 'erident-custom-login-and-dashboard' ); ?></span>
|
722 |
-
</td>
|
723 |
-
</tr>
|
724 |
-
<tr valign="top">
|
725 |
-
<th scope="row"><?php _e( 'Login Form Input Text Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
726 |
-
<td>
|
727 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_input_text_color" name="er_options_up[dashboard_input_text_color]" value="<?php echo $er_options['dashboard_input_text_color']; ?>" />
|
728 |
-
<div id="ilctabscolorpicker8"></div>
|
729 |
-
<br />
|
730 |
-
<span class="description"><?php _e( 'Click the box to select a color. This will change the color of text inside text box.', 'erident-custom-login-and-dashboard' ); ?></span>
|
731 |
-
</td>
|
732 |
-
</tr>
|
733 |
-
<tr valign="top">
|
734 |
-
<th scope="row"><?php _e( 'Login Form Input Text Size:', 'erident-custom-login-and-dashboard' ); ?></th>
|
735 |
-
<td><input class="er-textfield-small" name="er_options_up[dashboard_input_text_size]" type="text" id="wp_erident_dashboard_input_text_size" value="<?php echo $er_options['dashboard_input_text_size']; ?>" />px
|
736 |
-
<br />
|
737 |
-
<span class="description"><?php _e( 'Font Size of text inside text box(Enter value in pixels)', 'erident-custom-login-and-dashboard' ); ?></span>
|
738 |
-
</td>
|
739 |
-
</tr>
|
740 |
-
<tr valign="top">
|
741 |
-
<th scope="row"><?php _e( 'Login Form Link Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
742 |
-
<td>
|
743 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_link_color" name="er_options_up[dashboard_link_color]" value="<?php echo $er_options['dashboard_link_color']; ?>" />
|
744 |
-
<div id="ilctabscolorpicker5"></div>
|
745 |
-
<br />
|
746 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
747 |
-
</td>
|
748 |
-
</tr>
|
749 |
-
|
750 |
-
<tr valign="top">
|
751 |
-
<th scope="row"><?php _e( 'Enable link shadow?', 'erident-custom-login-and-dashboard' ); ?></th>
|
752 |
-
<td>
|
753 |
-
<?php
|
754 |
-
$check_sh = $er_options['dashboard_check_shadow'];
|
755 |
-
if($check_sh == 'Yes') { $sx = "checked"; $sy = ''; } else { $sy = "checked"; $sx = ''; } ?>
|
756 |
-
|
757 |
-
<label>
|
758 |
-
<input type="radio" name="er_options_up[dashboard_check_shadow]" value="Yes" id="wp_erident_dashboard_check_shadow_0" <?php echo $sx; ?> onclick="jQuery('#hide-this').show('normal')" />
|
759 |
-
<?php _e( 'Yes', 'erident-custom-login-and-dashboard' ); ?></label>
|
760 |
-
|
761 |
-
<label>
|
762 |
-
<input type="radio" name="er_options_up[dashboard_check_shadow]" value="No" id="wp_erident_dashboard_check_shadow_1" <?php echo $sy; ?> onclick="jQuery('#hide-this').hide('normal')" />
|
763 |
-
<?php _e( 'No', 'erident-custom-login-and-dashboard' ); ?></label>
|
764 |
-
<br />
|
765 |
-
<span class="description"><?php _e( '(Check an option)', 'erident-custom-login-and-dashboard' ); ?></span>
|
766 |
-
</td>
|
767 |
-
</tr>
|
768 |
-
<tr valign="top" id="hide-this">
|
769 |
-
<th scope="row"><?php _e( 'Login Form Link Shadow Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
770 |
-
<td>
|
771 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_link_shadow" name="er_options_up[dashboard_link_shadow]" value="<?php echo $er_options['dashboard_link_shadow']; ?>" />
|
772 |
-
<div id="ilctabscolorpicker6"></div>
|
773 |
-
<br />
|
774 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
775 |
-
</td>
|
776 |
-
</tr>
|
777 |
-
|
778 |
-
<!-- Form Shadow -->
|
779 |
-
<tr valign="top">
|
780 |
-
<th scope="row"><?php _e( 'Enable form shadow?', 'erident-custom-login-and-dashboard' ); ?></th>
|
781 |
-
<td>
|
782 |
-
<?php
|
783 |
-
$check_fsh = $er_options['dashboard_check_form_shadow'];
|
784 |
-
if($check_fsh == 'Yes') { $fsx = "checked"; $fsy = ''; } else { $fsy = "checked"; $fsx = ''; } ?>
|
785 |
-
|
786 |
-
<label>
|
787 |
-
<input type="radio" name="er_options_up[dashboard_check_form_shadow]" value="Yes" id="wp_erident_dashboard_check_form_shadow_0" <?php echo $fsx; ?> onclick="jQuery('#hide-this2').show('normal')" />
|
788 |
-
<?php _e( 'Yes', 'erident-custom-login-and-dashboard' ); ?></label>
|
789 |
-
|
790 |
-
<label>
|
791 |
-
<input type="radio" name="er_options_up[dashboard_check_form_shadow]" value="No" id="wp_erident_dashboard_check_form_shadow_1" <?php echo $fsy; ?> onclick="jQuery('#hide-this2').hide('normal')" />
|
792 |
-
<?php _e( 'No', 'erident-custom-login-and-dashboard' ); ?></label>
|
793 |
-
<br />
|
794 |
-
<span class="description"><?php _e( '(Check an option)', 'erident-custom-login-and-dashboard' ); ?></span>
|
795 |
-
</td>
|
796 |
-
</tr>
|
797 |
-
<tr valign="top" id="hide-this2">
|
798 |
-
<th scope="row"><?php _e( 'Login Form Shadow Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
799 |
-
<td>
|
800 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_form_shadow" name="er_options_up[dashboard_form_shadow]" value="<?php echo $er_options['dashboard_form_shadow']; ?>" />
|
801 |
-
<div id="ilctabscolorpicker7"></div>
|
802 |
-
<br />
|
803 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
804 |
-
</td>
|
805 |
-
</tr>
|
806 |
-
<!-- end Form shadow -->
|
807 |
-
|
808 |
-
<!-- Login Button Color -->
|
809 |
-
<tr valign="top">
|
810 |
-
<th scope="row"><?php _e( 'Login Button Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
811 |
-
<td>
|
812 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_button_color" name="er_options_up[dashboard_button_color]" value="<?php echo $er_options['dashboard_button_color']; ?>" />
|
813 |
-
<div id="ilctabscolorpicker9"></div>
|
814 |
-
<br />
|
815 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
816 |
-
</td>
|
817 |
-
</tr>
|
818 |
-
|
819 |
-
<!-- Login Button Text Color -->
|
820 |
-
<tr valign="top">
|
821 |
-
<th scope="row"><?php _e( 'Login Button Text Color', 'erident-custom-login-and-dashboard' ); ?></th>
|
822 |
-
<td>
|
823 |
-
<input class="er-textfield-small" type="text" id="wp_erident_dashboard_button_text_color" name="er_options_up[dashboard_button_text_color]" value="<?php echo isset($er_options['dashboard_button_text_color']) ? $er_options['dashboard_button_text_color'] : '#ffffff' ; ?>" />
|
824 |
-
<div id="ilctabscolorpicker10"></div>
|
825 |
-
<br />
|
826 |
-
<span class="description"><?php _e( 'Click the box to select a color.', 'erident-custom-login-and-dashboard' ); ?></span>
|
827 |
-
</td>
|
828 |
-
</tr>
|
829 |
-
|
830 |
-
<!-- Lost Password -->
|
831 |
-
<tr valign="top">
|
832 |
-
<th scope="row"><?php _e( 'Hide Register | Lost your password link', 'erident-custom-login-and-dashboard' ); ?></th>
|
833 |
-
<td>
|
834 |
-
<?php
|
835 |
-
$check_lsp = $er_options['dashboard_check_lost_pass'];
|
836 |
-
if($check_lsp == 'Yes') { $lspy = "checked"; $lspn = ''; } else { $lspn = "checked"; $lspy = ''; } ?>
|
837 |
-
|
838 |
-
<label>
|
839 |
-
<input type="radio" name="er_options_up[dashboard_check_lost_pass]" value="Yes" id="wp_erident_dashboard_check_lost_pass_0" <?php echo $lspy; ?> />
|
840 |
-
<?php _e( 'Yes', 'erident-custom-login-and-dashboard' ); ?></label>
|
841 |
-
|
842 |
-
<label>
|
843 |
-
<input type="radio" name="er_options_up[dashboard_check_lost_pass]" value="No" id="wp_erident_dashboard_check_lost_pass_1" <?php echo $lspn; ?> />
|
844 |
-
<?php _e( 'No', 'erident-custom-login-and-dashboard' ); ?></label>
|
845 |
-
<br />
|
846 |
-
<span class="description"><?php _e( '(Check an option)', 'erident-custom-login-and-dashboard' ); ?></span>
|
847 |
-
</td>
|
848 |
-
</tr>
|
849 |
-
<!-- end Lost Password -->
|
850 |
-
|
851 |
-
<!-- Back to Blog -->
|
852 |
-
<tr valign="top">
|
853 |
-
<th scope="row"><?php _e( 'Hide Back to your website link', 'erident-custom-login-and-dashboard' ); ?></th>
|
854 |
-
<td>
|
855 |
-
<?php
|
856 |
-
$check_btb = $er_options['dashboard_check_backtoblog'];
|
857 |
-
if($check_btb == 'Yes') { $btby = "checked"; $btbn = ''; } else { $btbn = "checked"; $btby = ''; } ?>
|
858 |
-
|
859 |
-
<label>
|
860 |
-
<input type="radio" name="er_options_up[dashboard_check_backtoblog]" value="Yes" id="wp_erident_dashboard_check_btb_0" <?php echo $btby; ?> />
|
861 |
-
<?php _e( 'Yes', 'erident-custom-login-and-dashboard' ); ?></label>
|
862 |
-
|
863 |
-
<label>
|
864 |
-
<input type="radio" name="er_options_up[dashboard_check_backtoblog]" value="No" id="wp_erident_dashboard_check_btb_1" <?php echo $btbn; ?> />
|
865 |
-
<?php _e( 'No', 'erident-custom-login-and-dashboard' ); ?></label>
|
866 |
-
<br />
|
867 |
-
<span class="description"><?php _e( '(Check an option)', 'erident-custom-login-and-dashboard' ); ?></span>
|
868 |
-
</td>
|
869 |
-
</tr>
|
870 |
-
<!-- end Back to Blog -->
|
871 |
-
|
872 |
-
</table>
|
873 |
-
</div><!-- end inside -->
|
874 |
-
</div><!-- end postbox -->
|
875 |
-
|
876 |
-
|
877 |
-
<div class="postbox">
|
878 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Plugin Un-install Settings', 'erident-custom-login-and-dashboard' ); ?></span>
|
879 |
-
</h3>
|
880 |
-
<div class="inside">
|
881 |
-
<table border="0">
|
882 |
-
<tr valign="top">
|
883 |
-
<th scope="row"><?php _e( 'Delete custom settings upon plugin deactivation?', 'erident-custom-login-and-dashboard' ); ?></th>
|
884 |
-
<td>
|
885 |
-
<?php
|
886 |
-
$check = $er_options['dashboard_delete_db'];
|
887 |
-
if($check == 'Yes') { $x = "checked"; $y = ''; } else { $y = "checked"; $x = ''; } ?>
|
888 |
-
|
889 |
-
<label>
|
890 |
-
<input type="radio" name="er_options_up[dashboard_delete_db]" value="Yes" id="wp_erident_dashboard_delete_db_0" <?php echo $x; ?> />
|
891 |
-
<?php _e( 'Yes', 'erident-custom-login-and-dashboard' ); ?></label>
|
892 |
-
|
893 |
-
<label>
|
894 |
-
<input type="radio" name="er_options_up[dashboard_delete_db]" value="No" id="wp_erident_dashboard_delete_db_1" <?php echo $y; ?> />
|
895 |
-
<?php _e( 'No', 'erident-custom-login-and-dashboard' ); ?></label>
|
896 |
-
<br />
|
897 |
-
<span class="description"><?php _e( '(If you set "Yes" all custom settings will be deleted from database upon plugin deactivation)', 'erident-custom-login-and-dashboard' ); ?></span>
|
898 |
-
</td>
|
899 |
-
</tr>
|
900 |
-
</table>
|
901 |
-
</div><!-- end inside -->
|
902 |
-
</div><!-- end postbox -->
|
903 |
-
|
904 |
-
<p>
|
905 |
-
<input type="submit" name="er_update_settings" class="button-primary" value="<?php _e('Save Changes') ?>" />
|
906 |
-
</p>
|
907 |
-
<?php wp_nonce_field( 'er_nonce_form', 'er_total_nonce' ); ?>
|
908 |
-
</form>
|
909 |
-
|
910 |
-
<div class="postbox">
|
911 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Export Settings', 'erident-custom-login-and-dashboard' ); ?></span></h3>
|
912 |
-
<div class="inside">
|
913 |
-
<p><?php _e( 'Export the plugin settings for this site as a .json file. This allows you to easily import the configuration into another site.', 'erident-custom-login-and-dashboard' ); ?></p>
|
914 |
-
<form method="post">
|
915 |
-
<p><input type="hidden" name="er_action" value="export_settings" /></p>
|
916 |
-
<p>
|
917 |
-
<?php wp_nonce_field( 'er_export_nonce', 'er_export_nonce' ); ?>
|
918 |
-
<?php submit_button( __( 'Export' ), 'secondary', 'submit', false ); ?>
|
919 |
-
</p>
|
920 |
-
</form>
|
921 |
-
</div><!-- .inside -->
|
922 |
-
</div><!-- .postbox -->
|
923 |
-
|
924 |
-
<div class="postbox">
|
925 |
-
<h3 class="hndle" title="Click to toggle"><span><?php _e( 'Import Settings', 'erident-custom-login-and-dashboard' ); ?></span></h3>
|
926 |
-
<div class="inside">
|
927 |
-
<p><?php _e( 'Import the plugin settings from a .json file. This file can be obtained by exporting the settings on another site using the form above.', 'erident-custom-login-and-dashboard' ); ?></p>
|
928 |
-
<form method="post" enctype="multipart/form-data">
|
929 |
-
<p>
|
930 |
-
<input type="file" name="import_file"/>
|
931 |
-
</p>
|
932 |
-
<p>
|
933 |
-
<input type="hidden" name="er_action" value="import_settings" />
|
934 |
-
<?php wp_nonce_field( 'er_import_nonce', 'er_import_nonce' ); ?>
|
935 |
-
<?php submit_button( __( 'Import' ), 'secondary', 'submit', false ); ?>
|
936 |
-
</p>
|
937 |
-
</form>
|
938 |
-
</div><!-- .inside -->
|
939 |
-
</div><!-- .postbox -->
|
940 |
-
|
941 |
-
<div class="bottom-notices">
|
942 |
-
<div class="er_notice2">
|
943 |
-
<h3><?php _e( 'Quick Links', 'erident-custom-login-and-dashboard' ); ?></h3>
|
944 |
-
<ul>
|
945 |
-
<li class="login-page"><a href="<?php bloginfo( 'wpurl' ); ?>/wp-login.php" target="_blank"><?php _e( 'Open Your WP Login Page in a New Tab', 'erident-custom-login-and-dashboard' ); ?></a></li>
|
946 |
-
<li><a href="http://wordpress.org/extend/plugins/erident-custom-login-and-dashboard/" target="_blank"><?php _e( 'Plugin Documentation', 'erident-custom-login-and-dashboard' ); ?></a></li>
|
947 |
-
<li><a href="http://wordpress.org/support/plugin/erident-custom-login-and-dashboard" target="_blank"><?php _e( 'Plugin Support Page', 'erident-custom-login-and-dashboard' ); ?></a></li>
|
948 |
-
<li class="green"><a href="http://wordpress.org/support/view/plugin-reviews/erident-custom-login-and-dashboard" target="_blank"><?php _e( 'Got some Love? Give us a 5 star rating!', 'erident-custom-login-and-dashboard' ); ?></a></li>
|
949 |
-
</ul>
|
950 |
-
</div><!-- end .er_notice2 -->
|
951 |
-
<div class="er_notice2 orange">
|
952 |
-
<h3>Donate</h3>
|
953 |
-
<p>Erident Custom Login and Dashboard is a free plugin offering a bunch of options to completely customize the look of your wordpress login page. I'm always working hard to add new options while keeping the plugin FREE to use. Support the plugin by offering a donation.</p>
|
954 |
-
<a href="https://www.paypal.me/LibinVBabu/25" class="button-primary" target="_blank">Donate Now</a>
|
955 |
-
</div>
|
956 |
-
<div class="clearfix"></div>
|
957 |
-
<div class="er_notice">
|
958 |
-
<h3><?php _e( 'Hire Me', 'erident-custom-login-and-dashboard' ); ?></h3>
|
959 |
-
<p><?php _e( 'Hey, I\'m Libin, a professional Front End Engineer/WordPress Developer. You can hire me for freelancing projects.<br/><br/>Email me: <a href="mailto:libin@libin.in">libin@libin.in</a> <br/>Online Portfolio: <a href="http://www.libin.in" target="_blank">www.libin.in</a>', 'erident-custom-login-and-dashboard' ); ?></p>
|
960 |
-
</div>
|
961 |
-
<div class="er_notice2 orange">
|
962 |
-
<h3><?php _e( 'Translation Credits', 'erident-custom-login-and-dashboard'); ?></h3>
|
963 |
-
<ul>
|
964 |
-
<li><?php _e( 'Spanish by <a href="http://www.linkedin.com/in/adrifolio" target="_blank">Adriana De La Cuadra</a>', 'erident-custom-login-and-dashboard'); ?></li>
|
965 |
-
<li><?php _e( 'French by <a href="https://www.linkedin.com/pub/vaslin-guillaume/38/35a/5aa" target="_blank">Guillaume Vaslin</a>', 'erident-custom-login-and-dashboard'); ?></li>
|
966 |
-
<li><?php _e( 'German by <a href="http://www.starsofvietnam.net/" target="_blank">Peter Kaulfuss</a>', 'erident-custom-login-and-dashboard'); ?></li>
|
967 |
-
<li><?php _e( 'Turkish by <a href="https://www.linkedin.com/profile/view?id=335577895" target="_blank">Muhammet Küçük</a>', 'erident-custom-login-and-dashboard'); ?></li>
|
968 |
-
<li><?php _e( 'Persian by <a href="https://about.me/reza.heydari" target="_blank">Reza Heydari</a>', 'erident-custom-login-and-dashboard'); ?></li>
|
969 |
-
<li><?php _e( 'Portuguese-Brazil by <a href="https://www.facebook.com/samuel.desconsi" target="_blank">Samuel Desconsi </a>', 'erident-custom-login-and-dashboard'); ?></li>
|
970 |
-
</ul>
|
971 |
-
<p><?php _e( 'Do you wants to translate this plugin to your language? Email me!', 'erident-custom-login-and-dashboard'); ?></p>
|
972 |
-
</div><!-- end .er_notice -->
|
973 |
-
</div>
|
974 |
-
|
975 |
-
</div>
|
976 |
-
<script type="text/javascript">
|
977 |
-
|
978 |
-
jQuery(document).ready(function() {
|
979 |
-
jQuery('#ilctabscolorpicker').hide();
|
980 |
-
jQuery('#ilctabscolorpicker').farbtastic("#wp_erident_dashboard_border_color");
|
981 |
-
jQuery("#wp_erident_dashboard_border_color").click(function(){jQuery('#ilctabscolorpicker').slideDown()});
|
982 |
-
jQuery("#wp_erident_dashboard_border_color").blur(function(){jQuery('#ilctabscolorpicker').slideUp()});
|
983 |
-
|
984 |
-
jQuery('#ilctabscolorpicker2').hide();
|
985 |
-
jQuery('#ilctabscolorpicker2').farbtastic("#wp_erident_dashboard_login_bg");
|
986 |
-
jQuery("#wp_erident_dashboard_login_bg").click(function(){jQuery('#ilctabscolorpicker2').slideDown()});
|
987 |
-
jQuery("#wp_erident_dashboard_login_bg").blur(function(){jQuery('#ilctabscolorpicker2').slideUp()});
|
988 |
-
|
989 |
-
jQuery('#ilctabscolorpicker3').hide();
|
990 |
-
jQuery('#ilctabscolorpicker3').farbtastic("#wp_erident_dashboard_text_color");
|
991 |
-
jQuery("#wp_erident_dashboard_text_color").click(function(){jQuery('#ilctabscolorpicker3').slideDown()});
|
992 |
-
jQuery("#wp_erident_dashboard_text_color").blur(function(){jQuery('#ilctabscolorpicker3').slideUp()});
|
993 |
-
|
994 |
-
jQuery('#ilctabscolorpicker4').hide();
|
995 |
-
jQuery('#ilctabscolorpicker4').farbtastic("#wp_erident_top_bg_color");
|
996 |
-
jQuery("#wp_erident_top_bg_color").click(function(){jQuery('#ilctabscolorpicker4').slideDown()});
|
997 |
-
jQuery("#wp_erident_top_bg_color").blur(function(){jQuery('#ilctabscolorpicker4').slideUp()});
|
998 |
-
|
999 |
-
jQuery('#ilctabscolorpicker5').hide();
|
1000 |
-
jQuery('#ilctabscolorpicker5').farbtastic("#wp_erident_dashboard_link_color");
|
1001 |
-
jQuery("#wp_erident_dashboard_link_color").click(function(){jQuery('#ilctabscolorpicker5').slideDown()});
|
1002 |
-
jQuery("#wp_erident_dashboard_link_color").blur(function(){jQuery('#ilctabscolorpicker5').slideUp()});
|
1003 |
-
|
1004 |
-
jQuery('#ilctabscolorpicker6').hide();
|
1005 |
-
jQuery('#ilctabscolorpicker6').farbtastic("#wp_erident_dashboard_link_shadow");
|
1006 |
-
jQuery("#wp_erident_dashboard_link_shadow").click(function(){jQuery('#ilctabscolorpicker6').slideDown()});
|
1007 |
-
jQuery("#wp_erident_dashboard_link_shadow").blur(function(){jQuery('#ilctabscolorpicker6').slideUp()});
|
1008 |
-
|
1009 |
-
jQuery('#ilctabscolorpicker7').hide();
|
1010 |
-
jQuery('#ilctabscolorpicker7').farbtastic("#wp_erident_dashboard_form_shadow");
|
1011 |
-
jQuery("#wp_erident_dashboard_form_shadow").click(function(){jQuery('#ilctabscolorpicker7').slideDown()});
|
1012 |
-
jQuery("#wp_erident_dashboard_form_shadow").blur(function(){jQuery('#ilctabscolorpicker7').slideUp()});
|
1013 |
-
|
1014 |
-
jQuery('#ilctabscolorpicker8').hide();
|
1015 |
-
jQuery('#ilctabscolorpicker8').farbtastic("#wp_erident_dashboard_input_text_color");
|
1016 |
-
jQuery("#wp_erident_dashboard_input_text_color").click(function(){jQuery('#ilctabscolorpicker8').slideDown()});
|
1017 |
-
jQuery("#wp_erident_dashboard_input_text_color").blur(function(){jQuery('#ilctabscolorpicker8').slideUp()});
|
1018 |
-
|
1019 |
-
jQuery('#ilctabscolorpicker9').hide();
|
1020 |
-
jQuery('#ilctabscolorpicker9').farbtastic("#wp_erident_dashboard_button_color");
|
1021 |
-
jQuery("#wp_erident_dashboard_button_color").click(function(){jQuery('#ilctabscolorpicker9').slideDown()});
|
1022 |
-
jQuery("#wp_erident_dashboard_button_color").blur(function(){jQuery('#ilctabscolorpicker9').slideUp()});
|
1023 |
-
|
1024 |
-
jQuery('#ilctabscolorpicker10').hide();
|
1025 |
-
jQuery('#ilctabscolorpicker10').farbtastic("#wp_erident_dashboard_button_text_color");
|
1026 |
-
jQuery("#wp_erident_dashboard_button_text_color").click(function(){jQuery('#ilctabscolorpicker10').slideDown()});
|
1027 |
-
jQuery("#wp_erident_dashboard_button_text_color").blur(function(){jQuery('#ilctabscolorpicker10').slideUp()});
|
1028 |
-
|
1029 |
-
jQuery( ".postbox .hndle" ).on( "mouseover", function() {
|
1030 |
-
jQuery( this ).css( "cursor", "pointer" );
|
1031 |
-
});
|
1032 |
-
|
1033 |
-
/* Sliding the panels */
|
1034 |
-
jQuery(".postbox").on('click', '.handlediv', function(){
|
1035 |
-
jQuery(this).siblings(".inside").slideToggle();
|
1036 |
-
});
|
1037 |
-
jQuery(".postbox").on('click', '.hndle', function(){
|
1038 |
-
jQuery(this).siblings(".inside").slideToggle();
|
1039 |
-
});
|
1040 |
-
|
1041 |
-
if (jQuery('.set_custom_images').length > 0) {
|
1042 |
-
if ( typeof wp !== 'undefined' && wp.media && wp.media.editor) {
|
1043 |
-
jQuery('.wrap').on('click', '.set_custom_images', function(e) {
|
1044 |
-
e.preventDefault();
|
1045 |
-
var button = jQuery(this);
|
1046 |
-
var id = button.prev();
|
1047 |
-
wp.media.editor.send.attachment = function(props, attachment) {
|
1048 |
-
id.val(attachment.url);
|
1049 |
-
};
|
1050 |
-
wp.media.editor.open(button);
|
1051 |
-
return false;
|
1052 |
-
});
|
1053 |
-
}
|
1054 |
-
};
|
1055 |
-
|
1056 |
-
});
|
1057 |
-
|
1058 |
-
</script>
|
1059 |
-
<?php
|
1060 |
-
}
|
1061 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Erident Custom Login and Dashboard
|
4 |
+
* Plugin URI: https://ultimatedashboard.io/
|
5 |
+
* Description: Fully customize the WordPress Login Screen.
|
6 |
+
* Text Domain: erident-custom-login-and-dashboard
|
7 |
+
* Domain Path: /languages
|
8 |
+
* Version: 4.0
|
9 |
+
* Author: David Vongries
|
10 |
+
* Author URI: https://davidvongries.com/
|
11 |
+
* License: GPL-3.0
|
12 |
+
|
13 |
+
* @package Custom_Login_Dashboard
|
14 |
+
*/
|
15 |
+
|
16 |
+
// Helper constants.
|
17 |
+
define( 'CUSTOM_LOGIN_DASHBOARD_PLUGIN_DIR', rtrim( plugin_dir_path( __FILE__ ), '/' ) );
|
18 |
+
define( 'CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL', rtrim( plugin_dir_url( __FILE__ ), '/' ) );
|
19 |
+
define( 'CUSTOM_LOGIN_DASHBOARD_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
|
20 |
+
define( 'CUSTOM_LOGIN_DASHBOARD_PLUGIN_VERSION', '4.0' );
|
21 |
+
|
22 |
+
load_plugin_textdomain( 'erident-custom-login-and-dashboard', false, basename( dirname( __FILE__ ) ) . '/languages/' );
|
23 |
+
|
24 |
+
// Composer
|
25 |
+
require __DIR__ . '/vendor/autoload.php';
|
26 |
+
|
27 |
+
// Helper classes.
|
28 |
+
require __DIR__ . '/helpers/helpers.php';
|
29 |
+
require __DIR__ . '/helpers/class-export.php';
|
30 |
+
require __DIR__ . '/helpers/class-import.php';
|
31 |
+
|
32 |
+
// Ajax handler classes.
|
33 |
+
require __DIR__ . '/ajax/class-save-settings.php';
|
34 |
+
require __DIR__ . '/ajax/class-reset-settings.php';
|
35 |
+
require __DIR__ . '/ajax/class-load-default-settings.php';
|
36 |
+
|
37 |
+
// Required classes.
|
38 |
+
require __DIR__ . '/class-setup.php';
|
39 |
+
require __DIR__ . '/class-output.php';
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Function to run on plugin activation.
|
43 |
+
*/
|
44 |
+
function cldashboard_activation_script() {
|
45 |
+
|
46 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
47 |
+
|
48 |
+
if ( empty( $settings ) ) {
|
49 |
+
update_option( 'plugin_erident_settings', cldashboard_get_field_default_values() );
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
53 |
+
register_activation_hook( __FILE__, 'cldashboard_activation_script' );
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Function to run on plugin deactivation.
|
57 |
+
*/
|
58 |
+
function cldashboard_deactivation_script() {
|
59 |
+
|
60 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
61 |
+
|
62 |
+
$clean_deactivation = isset( $settings['dashboard_delete_db'] ) ? $settings['dashboard_delete_db'] : 0;
|
63 |
+
$clean_deactivation = 'yes' === strtolower( $clean_deactivation ) ? 1 : $clean_deactivation;
|
64 |
+
$clean_deactivation = 'no' === strtolower( $clean_deactivation ) ? 0 : $clean_deactivation;
|
65 |
+
|
66 |
+
if ( $clean_deactivation ) {
|
67 |
+
delete_option( 'plugin_erident_settings' );
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
71 |
+
register_deactivation_hook( __FILE__, 'cldashboard_deactivation_script' );
|
72 |
+
|
73 |
+
CustomLoginDashboard\Setup::init();
|
74 |
+
CustomLoginDashboard\Output::init();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
farbtastic/farbtastic.css
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Farbtastic Color Picker 1.2
|
3 |
-
* © 2008 Steven Wittens
|
4 |
-
*
|
5 |
-
* This program is free software; you can redistribute it and/or modify
|
6 |
-
* it under the terms of the GNU General Public License as published by
|
7 |
-
* the Free Software Foundation; either version 2 of the License, or
|
8 |
-
* (at your option) any later version.
|
9 |
-
*
|
10 |
-
* This program is distributed in the hope that it will be useful,
|
11 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
-
* GNU General Public License for more details.
|
14 |
-
*
|
15 |
-
* You should have received a copy of the GNU General Public License
|
16 |
-
* along with this program; if not, write to the Free Software
|
17 |
-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18 |
-
*/
|
19 |
-
.farbtastic {
|
20 |
-
position: relative;
|
21 |
-
}
|
22 |
-
.farbtastic * {
|
23 |
-
position: absolute;
|
24 |
-
cursor: crosshair;
|
25 |
-
}
|
26 |
-
.farbtastic, .farbtastic .wheel {
|
27 |
-
width: 195px;
|
28 |
-
height: 195px;
|
29 |
-
}
|
30 |
-
.farbtastic .color, .farbtastic .overlay {
|
31 |
-
top: 47px;
|
32 |
-
left: 47px;
|
33 |
-
width: 101px;
|
34 |
-
height: 101px;
|
35 |
-
}
|
36 |
-
.farbtastic .wheel {
|
37 |
-
background: url(wheel.png) no-repeat;
|
38 |
-
width: 195px;
|
39 |
-
height: 195px;
|
40 |
-
}
|
41 |
-
.farbtastic .overlay {
|
42 |
-
background: url(mask.png) no-repeat;
|
43 |
-
}
|
44 |
-
.farbtastic .marker {
|
45 |
-
width: 17px;
|
46 |
-
height: 17px;
|
47 |
-
margin: -8px 0 0 -8px;
|
48 |
-
overflow: hidden;
|
49 |
-
background: url(marker.png) no-repeat;
|
50 |
-
}
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
farbtastic/marker.png
DELETED
Binary file
|
farbtastic/mask.png
DELETED
Binary file
|
farbtastic/wheel.png
DELETED
Binary file
|
helpers/class-export.php
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Setup export functions.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard\Helpers;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Setup widget export functions.
|
12 |
+
*/
|
13 |
+
class Export {
|
14 |
+
/**
|
15 |
+
* Setup action & filter hooks.
|
16 |
+
*/
|
17 |
+
public function __construct() {}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Run importer.
|
21 |
+
*/
|
22 |
+
public function export() {
|
23 |
+
|
24 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
25 |
+
|
26 |
+
ignore_user_abort( true );
|
27 |
+
|
28 |
+
nocache_headers();
|
29 |
+
header( 'Content-Type: application/json; charset=utf-8' );
|
30 |
+
header( 'Content-Disposition: attachment; filename=erident-settings-export-' . date( 'm-d-Y' ) . '.json' );
|
31 |
+
header( 'Expires: 0' );
|
32 |
+
|
33 |
+
echo json_encode( $settings );
|
34 |
+
exit;
|
35 |
+
|
36 |
+
}
|
37 |
+
}
|
helpers/class-import.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Setup import functions.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
namespace CustomLoginDashboard\Helpers;
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Setup widget import functions.
|
12 |
+
*/
|
13 |
+
class Import {
|
14 |
+
/**
|
15 |
+
* Setup action & filter hooks.
|
16 |
+
*/
|
17 |
+
public function __construct() {}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Run importer.
|
21 |
+
*/
|
22 |
+
public function import() {
|
23 |
+
|
24 |
+
$explodes = explode( '.', $_FILES['import_file']['name'] );
|
25 |
+
$extension = end( $explodes );
|
26 |
+
|
27 |
+
if ( 'json' !== $extension ) {
|
28 |
+
wp_die( __( 'Please upload a valid .json file' ) );
|
29 |
+
}
|
30 |
+
|
31 |
+
$import_file = $_FILES['import_file']['tmp_name'];
|
32 |
+
|
33 |
+
if ( empty( $import_file ) ) {
|
34 |
+
wp_die( __( 'Please upload a file to import' ) );
|
35 |
+
}
|
36 |
+
|
37 |
+
// Retrieve the settings from the file and convert the json object to an array.
|
38 |
+
$settings = (array) json_decode( file_get_contents( $import_file ) );
|
39 |
+
|
40 |
+
update_option( 'plugin_erident_settings', $settings );
|
41 |
+
echo '<div id="message" class="updated fade"><p><strong>' . __( 'New settings imported successfully!' ) . '</strong></p></div>';
|
42 |
+
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
helpers/helpers.php
ADDED
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/** Custom Login Dashboard's helper functions.
|
3 |
+
*
|
4 |
+
* @package Custom_Login_Dashboard
|
5 |
+
*/
|
6 |
+
|
7 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Get field data types.
|
11 |
+
*/
|
12 |
+
function cldashboard_get_field_data_types() {
|
13 |
+
|
14 |
+
return [
|
15 |
+
'dashboard_data_left' => 'string',
|
16 |
+
'dashboard_data_right' => 'string',
|
17 |
+
'dashboard_image_logo' => 'string',
|
18 |
+
'dashboard_image_logo_width' => 'int',
|
19 |
+
'dashboard_image_logo_height' => 'int',
|
20 |
+
'dashboard_power_text' => 'string',
|
21 |
+
'dashboard_login_width' => 'int',
|
22 |
+
'dashboard_login_radius' => 'int',
|
23 |
+
'dashboard_login_border' => 'string',
|
24 |
+
'dashboard_border_thick' => 'int',
|
25 |
+
'dashboard_border_color' => 'string',
|
26 |
+
'dashboard_login_bg' => 'string',
|
27 |
+
'dashboard_login_bg_opacity' => 'float', // Deprecated.
|
28 |
+
'dashboard_text_color' => 'string',
|
29 |
+
'dashboard_input_text_color' => 'string',
|
30 |
+
'dashboard_label_text_size' => 'int',
|
31 |
+
'dashboard_input_text_size' => 'int',
|
32 |
+
'dashboard_link_color' => 'string',
|
33 |
+
'dashboard_check_shadow' => 'bool',
|
34 |
+
'dashboard_link_shadow' => 'string',
|
35 |
+
'dashboard_check_form_shadow' => 'bool',
|
36 |
+
'dashboard_check_lost_pass' => 'bool',
|
37 |
+
'dashboard_check_backtoblog' => 'bool',
|
38 |
+
'dashboard_form_shadow' => 'string',
|
39 |
+
'dashboard_button_color' => 'string',
|
40 |
+
'dashboard_button_text_color' => 'string',
|
41 |
+
'top_bg_color' => 'string',
|
42 |
+
'top_bg_image' => 'string',
|
43 |
+
'top_bg_repeat' => 'string',
|
44 |
+
'top_bg_xpos' => 'string',
|
45 |
+
'top_bg_ypos' => 'string',
|
46 |
+
'login_bg_image' => 'string',
|
47 |
+
'login_bg_repeat' => 'string',
|
48 |
+
'login_bg_xpos' => 'string',
|
49 |
+
'login_bg_ypos' => 'string',
|
50 |
+
'top_bg_size' => 'string',
|
51 |
+
'dashboard_delete_db' => 'bool',
|
52 |
+
];
|
53 |
+
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Get field default values.
|
58 |
+
*/
|
59 |
+
function cldashboard_get_field_default_values() {
|
60 |
+
|
61 |
+
return [
|
62 |
+
'dashboard_data_left' => 'Thank you for creating with <a href="https://wordpress.org/">WordPress</a>.',
|
63 |
+
'dashboard_data_right' => '© 2022 All Rights Reserved',
|
64 |
+
'dashboard_image_logo' => CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL . '/assets/images/default-logo.png',
|
65 |
+
'dashboard_image_logo_width' => 90,
|
66 |
+
'dashboard_image_logo_height' => 90,
|
67 |
+
'dashboard_power_text' => 'Powered by Your Website',
|
68 |
+
'dashboard_login_width' => 320,
|
69 |
+
'dashboard_login_radius' => 4,
|
70 |
+
'dashboard_login_border' => 'solid',
|
71 |
+
'dashboard_border_thick' => 2,
|
72 |
+
'dashboard_border_color' => '#dddddd',
|
73 |
+
'dashboard_login_bg' => '#ffffff',
|
74 |
+
'dashboard_login_bg_opacity' => 1, // Deprecated.
|
75 |
+
'dashboard_text_color' => '#3c434a',
|
76 |
+
'dashboard_input_text_color' => '#2c3338',
|
77 |
+
'dashboard_label_text_size' => 14,
|
78 |
+
'dashboard_input_text_size' => 24,
|
79 |
+
'dashboard_link_color' => '#50575e',
|
80 |
+
'dashboard_check_shadow' => 0,
|
81 |
+
'dashboard_link_shadow' => '#ffffff',
|
82 |
+
'dashboard_check_form_shadow' => 0,
|
83 |
+
'dashboard_check_lost_pass' => 0,
|
84 |
+
'dashboard_check_backtoblog' => 0,
|
85 |
+
'dashboard_form_shadow' => '#CCCCCC',
|
86 |
+
'dashboard_button_color' => '#2271b1',
|
87 |
+
'dashboard_button_text_color' => '#FFFFFF',
|
88 |
+
'top_bg_color' => '#f1f1f1',
|
89 |
+
'top_bg_image' => '',
|
90 |
+
'top_bg_repeat' => 'repeat',
|
91 |
+
'top_bg_xpos' => 'left',
|
92 |
+
'top_bg_ypos' => 'top',
|
93 |
+
'login_bg_image' => '',
|
94 |
+
'login_bg_repeat' => 'repeat',
|
95 |
+
'login_bg_xpos' => 'left',
|
96 |
+
'login_bg_ypos' => 'top',
|
97 |
+
'top_bg_size' => 'auto',
|
98 |
+
'dashboard_delete_db' => 0,
|
99 |
+
];
|
100 |
+
|
101 |
+
}
|
images/default-logo.png
DELETED
Binary file
|
images/form_bg.jpg
DELETED
Binary file
|
images/top_bg.jpg
DELETED
Binary file
|
inc/login.css.php
ADDED
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Output login CSS.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Output login CSS.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$page_bg_color = isset( $settings['top_bg_color'] ) && ! empty( $settings['top_bg_color'] ) ? $settings['top_bg_color'] : '';
|
18 |
+
$page_bg_image = isset( $settings['top_bg_image'] ) && ! empty( $settings['top_bg_image'] ) ? $settings['top_bg_image'] : '';
|
19 |
+
$page_bg_repeat = isset( $settings['top_bg_repeat'] ) && ! empty( $settings['top_bg_repeat'] ) ? $settings['top_bg_repeat'] : '';
|
20 |
+
$page_bg_pos_x = isset( $settings['top_bg_xpos'] ) && ! empty( $settings['top_bg_xpos'] ) ? $settings['top_bg_xpos'] : '';
|
21 |
+
$page_bg_pos_y = isset( $settings['top_bg_ypos'] ) && ! empty( $settings['top_bg_ypos'] ) ? $settings['top_bg_ypos'] : '';
|
22 |
+
$page_bg_size = isset( $settings['top_bg_size'] ) && ! empty( $settings['top_bg_size'] ) ? $settings['top_bg_size'] : '';
|
23 |
+
|
24 |
+
$logo_image = isset( $settings['dashboard_image_logo'] ) && ! empty( $settings['dashboard_image_logo'] ) ? $settings['dashboard_image_logo'] : '';
|
25 |
+
$logo_width = isset( $settings['dashboard_image_logo_width'] ) && ! empty( $settings['dashboard_image_logo_width'] ) ? $settings['dashboard_image_logo_width'] : '';
|
26 |
+
$logo_height = isset( $settings['dashboard_image_logo_height'] ) && ! empty( $settings['dashboard_image_logo_height'] ) ? $settings['dashboard_image_logo_height'] : '';
|
27 |
+
|
28 |
+
$enable_form_box_shadow = isset( $settings['dashboard_check_form_shadow'] ) ? $settings['dashboard_check_form_shadow'] : 0;
|
29 |
+
$enable_form_box_shadow = 'yes' === strtolower( $enable_form_box_shadow ) ? 1 : $enable_form_box_shadow;
|
30 |
+
$enable_form_box_shadow = 'no' === strtolower( $enable_form_box_shadow ) ? 0 : $enable_form_box_shadow;
|
31 |
+
|
32 |
+
$login_form_box_shadow = '';
|
33 |
+
|
34 |
+
if ( $enable_form_box_shadow ) {
|
35 |
+
$login_form_box_shadow = '0 4px 10px -1px ' . $settings['dashboard_form_shadow'];
|
36 |
+
}
|
37 |
+
|
38 |
+
$remove_register_link = isset( $settings['dashboard_check_lost_pass'] ) ? $settings['dashboard_check_lost_pass'] : 0;
|
39 |
+
$remove_register_link = 'yes' === strtolower( $remove_register_link ) ? 1 : $remove_register_link;
|
40 |
+
$remove_register_link = 'no' === strtolower( $remove_register_link ) ? 0 : $remove_register_link;
|
41 |
+
|
42 |
+
$remove_back_to_blog_link = isset( $settings['dashboard_check_backtoblog'] ) ? $settings['dashboard_check_backtoblog'] : 0;
|
43 |
+
$remove_back_to_blog_link = 'yes' === strtolower( $remove_back_to_blog_link ) ? 1 : $remove_back_to_blog_link;
|
44 |
+
$remove_back_to_blog_link = 'no' === strtolower( $remove_back_to_blog_link ) ? 0 : $remove_back_to_blog_link;
|
45 |
+
|
46 |
+
$btn_text_color = isset( $settings['dashboard_button_text_color'] ) && ! empty( $settings['dashboard_button_text_color'] ) ? $settings['dashboard_button_text_color'] : '';
|
47 |
+
$btn_bg_color = isset( $settings['dashboard_button_color'] ) && ! empty( $settings['dashboard_button_color'] ) ? $settings['dashboard_button_color'] : '';
|
48 |
+
|
49 |
+
$btn_bg_color_hover = '';
|
50 |
+
|
51 |
+
if ( ! empty( $btn_bg_color ) ) {
|
52 |
+
$btn_bg_color_hover = ariColor::newColor( $btn_bg_color );
|
53 |
+
$btn_bg_color_hover = $btn_bg_color_hover->getNew( 'alpha', 0.9 )->toCSS( 'rgba' );
|
54 |
+
}
|
55 |
+
|
56 |
+
$form_width = isset( $settings['dashboard_login_width'] ) && ! empty( $settings['dashboard_login_width'] ) ? $settings['dashboard_login_width'] : '';
|
57 |
+
$form_border_radius = isset( $settings['dashboard_login_radius'] ) && ! empty( $settings['dashboard_login_radius'] ) ? $settings['dashboard_login_radius'] : '';
|
58 |
+
$form_border_width = isset( $settings['dashboard_border_thick'] ) && ! empty( $settings['dashboard_border_thick'] ) ? $settings['dashboard_border_thick'] : '';
|
59 |
+
$form_border_style = isset( $settings['dashboard_login_border'] ) && ! empty( $settings['dashboard_login_border'] ) ? $settings['dashboard_login_border'] : '';
|
60 |
+
$form_border_color = isset( $settings['dashboard_border_color'] ) && ! empty( $settings['dashboard_border_color'] ) ? $settings['dashboard_border_color'] : '';
|
61 |
+
|
62 |
+
$login_form_bg_color = '';
|
63 |
+
|
64 |
+
if ( isset( $settings['dashboard_login_bg'] ) && ! empty( $settings['dashboard_login_bg'] ) ) {
|
65 |
+
$login_form_bg_color = $settings['dashboard_login_bg'];
|
66 |
+
|
67 |
+
if ( isset( $settings['dashboard_login_bg_opacity'] ) ) {
|
68 |
+
// This `dashboard_login_bg_opacity` won't be used anymore since we use colorpicker alpha now.
|
69 |
+
$login_form_bg_opacity = '' !== $settings['dashboard_login_bg_opacity'] ? $settings['dashboard_login_bg_opacity'] : 1; // 0 is allowed here.
|
70 |
+
|
71 |
+
if ( false === stripos( $login_form_bg_color, 'rgba' ) && 1 > $login_form_bg_opacity ) {
|
72 |
+
$login_form_bg_color = ariColor::newColor( $login_form_bg_color );
|
73 |
+
$login_form_bg_color = $login_form_bg_color->getNew( 'alpha', $login_form_bg_opacity )->toCSS( 'rgba' );
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
$login_bg_image = isset( $settings['login_bg_image'] ) && ! empty( $settings['login_bg_image'] ) ? $settings['login_bg_image'] : '';
|
79 |
+
$login_bg_repeat = isset( $settings['login_bg_repeat'] ) && ! empty( $settings['login_bg_repeat'] ) ? $settings['login_bg_repeat'] : '';
|
80 |
+
$login_bg_pos_x = isset( $settings['login_bg_xpos'] ) && ! empty( $settings['login_bg_xpos'] ) ? $settings['login_bg_xpos'] : '';
|
81 |
+
$login_bg_pos_y = isset( $settings['login_bg_ypos'] ) && ! empty( $settings['login_bg_ypos'] ) ? $settings['login_bg_ypos'] : '';
|
82 |
+
|
83 |
+
$label_font_color = isset( $settings['dashboard_text_color'] ) && ! empty( $settings['dashboard_text_color'] ) ? $settings['dashboard_text_color'] : '';
|
84 |
+
$label_font_size = isset( $settings['dashboard_label_text_size'] ) && ! empty( $settings['dashboard_label_text_size'] ) ? $settings['dashboard_label_text_size'] : '';
|
85 |
+
|
86 |
+
$input_font_color = isset( $settings['dashboard_input_text_color'] ) && ! empty( $settings['dashboard_input_text_color'] ) ? $settings['dashboard_input_text_color'] : '';
|
87 |
+
$input_font_size = isset( $settings['dashboard_input_text_size'] ) && ! empty( $settings['dashboard_input_text_size'] ) ? $settings['dashboard_input_text_size'] : '';
|
88 |
+
|
89 |
+
$link_color = isset( $settings['dashboard_link_color'] ) && ! empty( $settings['dashboard_link_color'] ) ? $settings['dashboard_link_color'] : '';
|
90 |
+
|
91 |
+
$enable_link_text_shadow = isset( $settings['dashboard_check_shadow'] ) ? $settings['dashboard_check_shadow'] : 0;
|
92 |
+
$enable_link_text_shadow = 'yes' === strtolower( $enable_link_text_shadow ) ? 1 : $enable_link_text_shadow;
|
93 |
+
$enable_link_text_shadow = 'no' === strtolower( $enable_link_text_shadow ) ? 0 : $enable_link_text_shadow;
|
94 |
+
|
95 |
+
$login_link_text_shadow = '';
|
96 |
+
|
97 |
+
if ( $enable_link_text_shadow ) {
|
98 |
+
$login_link_text_shadow = $settings['dashboard_link_shadow'] . ' 0 1px 0';
|
99 |
+
}
|
100 |
+
?>
|
101 |
+
|
102 |
+
html {
|
103 |
+
background: none !important;
|
104 |
+
}
|
105 |
+
|
106 |
+
html body.login {
|
107 |
+
<?php if ( ! empty( $page_bg_color ) ) : ?>
|
108 |
+
background-color: <?php echo esc_html( $page_bg_color ); ?> !important;
|
109 |
+
<?php endif; ?>
|
110 |
+
|
111 |
+
<?php if ( ! empty( $page_bg_image ) ) : ?>
|
112 |
+
background-image: url(<?php echo esc_html( $page_bg_image ); ?>) !important;
|
113 |
+
|
114 |
+
<?php if ( ! empty( $page_bg_repeat ) ) : ?>
|
115 |
+
background-repeat: <?php echo esc_html( $page_bg_repeat ); ?> !important;
|
116 |
+
<?php endif; ?>
|
117 |
+
|
118 |
+
<?php if ( ! empty( $page_bg_pos_x ) && ! empty( $page_bg_pos_y ) ) : ?>
|
119 |
+
background-position: <?php echo esc_html( $page_bg_pos_x ); ?> <?php echo esc_html( $page_bg_pos_y ); ?> !important;
|
120 |
+
<?php endif; ?>
|
121 |
+
|
122 |
+
<?php if ( ! empty( $page_bg_size ) ) : ?>
|
123 |
+
background-size: <?php echo esc_html( $page_bg_size ); ?> !important;
|
124 |
+
<?php endif; ?>
|
125 |
+
<?php endif; ?>
|
126 |
+
}
|
127 |
+
|
128 |
+
body.login div#login h1 a {
|
129 |
+
margin: 0 auto;
|
130 |
+
|
131 |
+
<?php if ( ! empty( $logo_image ) ) : ?>
|
132 |
+
background-image: url(<?php echo esc_html( $logo_image ); ?>) !important;
|
133 |
+
<?php endif; ?>
|
134 |
+
|
135 |
+
<?php if ( ! empty( $logo_width ) || ! empty( $logo_height ) ) : ?>
|
136 |
+
<?php if ( ! empty( $logo_width ) && ! empty( $logo_height ) ) : ?>
|
137 |
+
background-size: <?php echo esc_html( $logo_width ); ?>px <?php echo esc_html( $logo_height ); ?>px;
|
138 |
+
<?php elseif ( ! empty( $logo_width ) && empty( $logo_height ) ) : ?>
|
139 |
+
background-size: <?php echo esc_html( $logo_width ); ?>px auto;
|
140 |
+
<?php elseif ( empty( $logo_width ) && ! empty( $logo_height ) ) : ?>
|
141 |
+
background-size: auto <?php echo esc_html( $logo_height ); ?>px;
|
142 |
+
<?php endif; ?>
|
143 |
+
<?php endif; ?>
|
144 |
+
|
145 |
+
<?php if ( ! empty( $logo_width ) ) : ?>
|
146 |
+
width: <?php echo esc_html( $logo_width ); ?>px;
|
147 |
+
<?php endif; ?>
|
148 |
+
|
149 |
+
<?php if ( ! empty( $logo_height ) ) : ?>
|
150 |
+
height: <?php echo esc_html( $logo_height ); ?>px;
|
151 |
+
<?php endif; ?>
|
152 |
+
}
|
153 |
+
|
154 |
+
body.login #login {
|
155 |
+
<?php if ( ! empty( $form_width ) ) : ?>
|
156 |
+
width: <?php echo esc_html( $form_width ); ?>px;
|
157 |
+
<?php endif; ?>
|
158 |
+
}
|
159 |
+
|
160 |
+
#loginform {
|
161 |
+
<?php if ( ! empty( $form_border_radius ) ) : ?>
|
162 |
+
border-radius:<?php echo esc_html( $form_border_radius ); ?>px !important;
|
163 |
+
<?php endif; ?>
|
164 |
+
|
165 |
+
<?php if ( ! empty( $form_border_color ) ) : ?>
|
166 |
+
border-color: <?php echo esc_html( $form_border_color ); ?> !important;
|
167 |
+
|
168 |
+
<?php if ( ! empty( $form_border_width ) ) : ?>
|
169 |
+
border-width: <?php echo esc_html( $form_border_width ); ?>px !important;
|
170 |
+
<?php endif; ?>
|
171 |
+
|
172 |
+
<?php if ( ! empty( $form_border_style ) ) : ?>
|
173 |
+
border-style: <?php echo esc_html( $form_border_style ); ?> !important;
|
174 |
+
<?php endif; ?>
|
175 |
+
<?php endif; ?>
|
176 |
+
|
177 |
+
<?php if ( ! empty( $login_form_bg_color ) ) : ?>
|
178 |
+
background-color: <?php echo esc_html( $login_form_bg_color ); ?> !important;
|
179 |
+
<?php endif; ?>
|
180 |
+
|
181 |
+
<?php if ( ! empty( $login_bg_image ) ) : ?>
|
182 |
+
background-image: url(<?php echo esc_html( $login_bg_image ); ?>) !important;
|
183 |
+
|
184 |
+
<?php if ( ! empty( $login_bg_repeat ) ) : ?>
|
185 |
+
background-repeat: <?php echo esc_html( $login_bg_repeat ); ?> !important;
|
186 |
+
<?php endif; ?>
|
187 |
+
|
188 |
+
<?php if ( ! empty( $login_bg_pos_x ) && ! empty( $login_bg_pos_y ) ) : ?>
|
189 |
+
background-position: <?php echo esc_html( $login_bg_pos_x ); ?> <?php echo esc_html( $login_bg_pos_y ); ?> !important;
|
190 |
+
<?php endif; ?>
|
191 |
+
<?php endif; ?>
|
192 |
+
|
193 |
+
<?php if ( ! empty( $login_form_box_shadow ) ) : ?>
|
194 |
+
-moz-box-shadow: <?php echo esc_html( $login_form_box_shadow ); ?> !important;
|
195 |
+
-webkit-box-shadow: <?php echo esc_html( $login_form_box_shadow ); ?> !important;
|
196 |
+
box-shadow: <?php echo esc_html( $login_form_box_shadow ); ?> !important;
|
197 |
+
<?php endif; ?>
|
198 |
+
}
|
199 |
+
|
200 |
+
body.login div#login form label,
|
201 |
+
p#reg_passmail {
|
202 |
+
<?php if ( ! empty( $label_font_color ) ) : ?>
|
203 |
+
color: <?php echo esc_html( $label_font_color ); ?> !important;
|
204 |
+
<?php endif; ?>
|
205 |
+
|
206 |
+
<?php if ( ! empty( $label_font_size ) ) : ?>
|
207 |
+
font-size: <?php echo esc_html( $label_font_size ); ?>px !important;
|
208 |
+
<?php endif; ?>
|
209 |
+
}
|
210 |
+
|
211 |
+
body.login #loginform p.submit .button-primary,
|
212 |
+
body.wp-core-ui .button-primary {
|
213 |
+
border: none !important;
|
214 |
+
|
215 |
+
<?php if ( ! empty( $btn_text_color ) ) : ?>
|
216 |
+
color: <?php echo esc_html( $btn_text_color ); ?> !important;
|
217 |
+
<?php endif; ?>
|
218 |
+
|
219 |
+
<?php if ( ! empty( $btn_bg_color ) ) : ?>
|
220 |
+
background: <?php echo esc_html( $btn_bg_color ); ?> !important;
|
221 |
+
<?php endif; ?>
|
222 |
+
|
223 |
+
<?php if ( ! empty( $login_link_text_shadow ) ) : ?>
|
224 |
+
text-shadow: <?php echo esc_html( $login_link_text_shadow ); ?> !important;
|
225 |
+
<?php endif; ?>
|
226 |
+
}
|
227 |
+
|
228 |
+
body.login #loginform p.submit .button-primary:hover,
|
229 |
+
body.login #loginform p.submit .button-primary:focus,
|
230 |
+
body.wp-core-ui .button-primary:hover {
|
231 |
+
<?php if ( ! empty( $btn_bg_color_hover ) ) : ?>
|
232 |
+
background: <?php echo esc_html( $btn_bg_color_hover ); ?> !important;
|
233 |
+
<?php endif; ?>
|
234 |
+
}
|
235 |
+
|
236 |
+
body.login div#login form .input,
|
237 |
+
.login input[type="text"] {
|
238 |
+
<?php if ( ! empty( $input_font_color ) ) : ?>
|
239 |
+
color: <?php echo esc_html( $input_font_color ); ?> !important;
|
240 |
+
<?php endif; ?>
|
241 |
+
|
242 |
+
<?php if ( ! empty( $input_font_size ) ) : ?>
|
243 |
+
font-size: <?php echo esc_html( $input_font_size ); ?>px !important;
|
244 |
+
<?php endif; ?>
|
245 |
+
}
|
246 |
+
|
247 |
+
body.login #nav a, body.login #backtoblog a {
|
248 |
+
<?php if ( ! empty( $link_color ) ) : ?>
|
249 |
+
color: <?php echo esc_html( $link_color ); ?> !important;
|
250 |
+
<?php endif; ?>
|
251 |
+
}
|
252 |
+
|
253 |
+
body.login #nav,
|
254 |
+
body.login #backtoblog {
|
255 |
+
<?php if ( ! empty( $login_link_text_shadow ) ) : ?>
|
256 |
+
text-shadow: <?php echo esc_html( $login_link_text_shadow ); ?> !important;
|
257 |
+
<?php endif; ?>
|
258 |
+
}
|
259 |
+
|
260 |
+
.login form .input,
|
261 |
+
.login input[type=text],
|
262 |
+
.wp-core-ui .button-primary:focus {
|
263 |
+
box-shadow: none !important;
|
264 |
+
}
|
265 |
+
|
266 |
+
body.login #loginform p.submit .button-primary,
|
267 |
+
body.wp-core-ui .button-primary {
|
268 |
+
box-shadow: none;
|
269 |
+
}
|
270 |
+
|
271 |
+
body.login p#nav {
|
272 |
+
<?php if ( $remove_register_link ) : ?>
|
273 |
+
display: none !important;
|
274 |
+
<?php endif; ?>
|
275 |
+
}
|
276 |
+
|
277 |
+
body.login #backtoblog {
|
278 |
+
<?php if ( $remove_back_to_blog_link ) : ?>
|
279 |
+
display: none !important;
|
280 |
+
<?php endif; ?>
|
281 |
+
}
|
282 |
+
|
283 |
+
<?php
|
284 |
+
};
|
readme.txt
CHANGED
@@ -1,185 +1,185 @@
|
|
1 |
-
=== Erident Custom Login and Dashboard ===
|
2 |
-
Contributors: davidvongries, libinvbabu
|
3 |
-
Tags: login, customisation, admin, dashboard, customise, erident, custom login, form, logo, customize, branding, login customizer, CSS, admin login, white label, login background, custom login page
|
4 |
-
Requires at least: 3.0.0
|
5 |
-
Tested up to: 5.9
|
6 |
-
Stable tag:
|
7 |
-
Requires PHP: 5.6
|
8 |
-
License: GPL-3.0 License
|
9 |
-
License URI: https://oss.ninja/gpl-3.0?organization=David%20Vongries&project=Erident%20Custom%20Login%20and%20Dashboard
|
10 |
-
|
11 |
-
Fully customize the WordPress Login Screen.
|
12 |
-
|
13 |
-
== Description ==
|
14 |
-
**Erident Custom Login and Dashboard** is the #1 rated
|
15 |
-
|
16 |
-
Create a custom WordPress login page with just a few clicks! All the settings to customize the WordPress login are located under Settings
|
17 |
-
|
18 |
-
Are you looking for a way to fully customize your WordPress admin area? Check out our **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=repository&utm_campaign=udb)** Plugin.
|
19 |
-
|
20 |
-
=== Features ===
|
21 |
-
Here is a list of some of the features available in Erident Custom Login & Dashboard:
|
22 |
-
|
23 |
-
* Add a custom Logo & Logo URL
|
24 |
-
* Change the Login Page Background Color
|
25 |
-
* Add a Background Image to your Login Screen
|
26 |
-
* Completely customize the WordPress Login Form
|
27 |
-
* Remove Footer links from the WordPress Login Page
|
28 |
-
* Change the WordPress Footer Text
|
29 |
-
* Change the WordPress Version Text
|
30 |
-
* Import/Export Feature
|
31 |
-
* & much more!
|
32 |
-
|
33 |
-
=== What's next? ===
|
34 |
-
If you like Erident Custom Login and Dashboard, make sure to check out our other products:
|
35 |
-
|
36 |
-
* **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=repository&utm_campaign=udb)** - The #1 WordPress plugin to customize your WordPress dashboard and admin area.
|
37 |
-
* **[Page Builder Framework](https://wp-pagebuilderframework.com/?utm_source=erident&utm_medium=repository&utm_campaign=wpbf)** - A fast & minimalistic WordPress theme designed for the new WordPress era.
|
38 |
-
* **[Better Admin Bar](https://betteradminbar.com/?utm_source=erident&utm_medium=repository&utm_campaign=bab)** - The plugin to make your clients enjoy WordPress. It replaces the default admin bar to provide the best possible user experience when editing & navigating a website.
|
39 |
-
|
40 |
-
== Installation ==
|
41 |
-
1. Download the erident-custom-login-and-dashboard.zip file to your computer.
|
42 |
-
1. Unzip the file.
|
43 |
-
1. Upload the `erident-custom-login-and-dashboard` folder to your `/wp-content/plugins/` directory.
|
44 |
-
1. Activate the plugin through the *Plugins* menu in WordPress.
|
45 |
-
|
46 |
-
== Frequently Asked Questions ==
|
47 |
-
= Are there more options to customize the WordPress Dashboard? =
|
48 |
-
Yes! For more options and to fully customize the WordPress dashboard, check out **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=repository&utm_campaign=udb)**.
|
49 |
-
|
50 |
-
== Screenshots ==
|
51 |
-
1. Settings Page
|
52 |
-
2. Default Erident Login Screen
|
53 |
-
3. Customized WordPress Login Screen (Example 1)
|
54 |
-
4. Customized WordPress Login Screen (Example 2)
|
55 |
-
|
56 |
-
== Changelog ==
|
57 |
-
= 4.0 | April 29, 2022 =
|
58 |
-
* Version 4.0 is a complete refactor of Erident Custom Login & Dashboard with a modern look and a much improved user experience. For even more options, check out **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=changelog&utm_campaign=udb)**.
|
59 |
-
|
60 |
-
= 3.5.9 (01 Apr 2021) =
|
61 |
-
* XSS Security Fix
|
62 |
-
* Compatibility with latest WordPress version
|
63 |
-
|
64 |
-
= 3.5.8 (27 May 2020) =
|
65 |
-
* Password Label field color fix
|
66 |
-
* Compatibility with latest WordPress version
|
67 |
-
|
68 |
-
= 3.5.7 (23 Jun 2019) =
|
69 |
-
* Complete shadow removal for forms
|
70 |
-
* Updating deprecated function login_headertitle
|
71 |
-
|
72 |
-
= 3.5.5 (29 Nov 2017) =
|
73 |
-
* Option to add Login button's text color
|
74 |
-
* Removed conflicting css
|
75 |
-
|
76 |
-
= 3.5.4 (9 Mar 2017) =
|
77 |
-
* Fixed the function names which may conflict with other plugins
|
78 |
-
|
79 |
-
= 3.5.3 (6 Feb 2017) =
|
80 |
-
* Fixed warning in dashboard
|
81 |
-
* Minor CSS improvement on register page
|
82 |
-
|
83 |
-
= 3.5.2 =
|
84 |
-
* Hide Register | Lost your password link
|
85 |
-
* Hide Back to your website link
|
86 |
-
* CSS updates to override default wp shadows
|
87 |
-
|
88 |
-
= 3.5.1 =
|
89 |
-
* Compatibility fix with WordPress 4.5
|
90 |
-
* Minor bug fix
|
91 |
-
|
92 |
-
= 3.5 =
|
93 |
-
* Option to keep default WordPress version on dashboard footer
|
94 |
-
* Persian translation added
|
95 |
-
* Security fix for CSRF
|
96 |
-
|
97 |
-
= 3.4.1 =
|
98 |
-
* Fixed function for php older version
|
99 |
-
|
100 |
-
= 3.4 =
|
101 |
-
* Supports WordPress media uploader inside the settings page
|
102 |
-
* Turkish translation added
|
103 |
-
|
104 |
-
= 3.3.1 =
|
105 |
-
* Extended link shadow enable/disable option to login button as well
|
106 |
-
* Moved screenshots to assets directory
|
107 |
-
|
108 |
-
= 3.3 =
|
109 |
-
* Added Background Opacity feature to the Login Form
|
110 |
-
* Now Register button will also take same color of Login button
|
111 |
-
|
112 |
-
= 3.2 =
|
113 |
-
* Minor fix for Logo size option.
|
114 |
-
* Added German translation.
|
115 |
-
|
116 |
-
= 3.1 =
|
117 |
-
* Major bug fix on backend.
|
118 |
-
* Striped slashes from apostrophe texts.
|
119 |
-
|
120 |
-
= 3.0 =
|
121 |
-
* Huge database performance upgrade on backend
|
122 |
-
* Added Import/Export settings feature
|
123 |
-
* Added French translation
|
124 |
-
* Improved UI with latest WordPress 3.9
|
125 |
-
|
126 |
-
= 2.3.1 =
|
127 |
-
* Fixed one function conflict with some themes.
|
128 |
-
|
129 |
-
= 2.3.0 =
|
130 |
-
* New option to customize Login button Color
|
131 |
-
* Localized the entire plugin and ready for translation
|
132 |
-
* Spanish translation available
|
133 |
-
|
134 |
-
= 2.2.1 =
|
135 |
-
* Fixed constants Notice.
|
136 |
-
* Fixed Image background cut on small screen resolutions.
|
137 |
-
|
138 |
-
= 2.2.0 =
|
139 |
-
* New Default UI for login page.
|
140 |
-
* Optimized the backend files.
|
141 |
-
|
142 |
-
= 2.1.1 =
|
143 |
-
* Fixed Background property overriding problem with some themes and plugins.
|
144 |
-
|
145 |
-
= 2.1.0 =
|
146 |
-
* Added Login Screen Background size Property
|
147 |
-
|
148 |
-
= 2.0.1 =
|
149 |
-
* Bug Fix
|
150 |
-
|
151 |
-
= 2.0.0 =
|
152 |
-
* Enhanced UI for easy usage (Added an option to hide/show settings block)
|
153 |
-
* Added option for Logo Width and Height
|
154 |
-
|
155 |
-
= 1.5.1 =
|
156 |
-
* Fixed a small bug
|
157 |
-
* Help texts improved and added new FAQ question
|
158 |
-
|
159 |
-
= 1.4 =
|
160 |
-
* Added an option for Login Form label and input text's font size
|
161 |
-
* Added an option for Login Form input text color
|
162 |
-
* Bug fixed for settings link conflicting
|
163 |
-
|
164 |
-
= 1.3 =
|
165 |
-
* Added an option for Form Shadow.
|
166 |
-
* Fixed Minor bugs.
|
167 |
-
|
168 |
-
= 1.2 =
|
169 |
-
* Fixed the issue of conflicting with other plugins on admin pages.
|
170 |
-
|
171 |
-
= 1.1 =
|
172 |
-
* Added "background-position" option for the screen & login form background images.
|
173 |
-
* Added a link on Settings tab for directly open the login.php page on a new tab.
|
174 |
-
* Improved the css layout of Settings page
|
175 |
-
* Added a "Quick Links" section at the bottom of settings page.
|
176 |
-
* Improved the tutorial texts on settings page.
|
177 |
-
|
178 |
-
= 1.0 =
|
179 |
-
* First version.
|
180 |
-
|
181 |
-
== Upgrade Notice ==
|
182 |
-
|
183 |
-
= 3.5.8 =
|
184 |
-
Password Label field color fix
|
185 |
-
Compatibility with latest WordPress version
|
1 |
+
=== Erident Custom Login and Dashboard ===
|
2 |
+
Contributors: davidvongries, libinvbabu
|
3 |
+
Tags: login, customisation, admin, dashboard, customise, erident, custom login, form, logo, customize, branding, login customizer, CSS, admin login, white label, login background, custom login page
|
4 |
+
Requires at least: 3.0.0
|
5 |
+
Tested up to: 5.9
|
6 |
+
Stable tag: 4.0
|
7 |
+
Requires PHP: 5.6
|
8 |
+
License: GPL-3.0 License
|
9 |
+
License URI: https://oss.ninja/gpl-3.0?organization=David%20Vongries&project=Erident%20Custom%20Login%20and%20Dashboard
|
10 |
+
|
11 |
+
Fully customize the WordPress Login Screen.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
**Erident Custom Login and Dashboard** is the #1 rated Plugin to customize the WordPress Login Screen. It's a clean & minimalist way for you to fully customize almost all aspects of the WordPress Login Page.
|
15 |
+
|
16 |
+
Create a custom WordPress login page with just a few clicks! All the settings to customize the WordPress login are located under Settings > Custom Login & Dashboard.
|
17 |
+
|
18 |
+
Are you looking for a way to fully customize your WordPress admin area? Check out our **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=repository&utm_campaign=udb)** Plugin.
|
19 |
+
|
20 |
+
=== Features ===
|
21 |
+
Here is a list of some of the features available in Erident Custom Login & Dashboard:
|
22 |
+
|
23 |
+
* Add a custom Logo & Logo URL
|
24 |
+
* Change the Login Page Background Color
|
25 |
+
* Add a Background Image to your Login Screen
|
26 |
+
* Completely customize the WordPress Login Form
|
27 |
+
* Remove Footer links from the WordPress Login Page
|
28 |
+
* Change the WordPress Footer Text
|
29 |
+
* Change the WordPress Version Text
|
30 |
+
* Import/Export Feature
|
31 |
+
* & much more!
|
32 |
+
|
33 |
+
=== What's next? ===
|
34 |
+
If you like Erident Custom Login and Dashboard, make sure to check out our other products:
|
35 |
+
|
36 |
+
* **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=repository&utm_campaign=udb)** - The #1 WordPress plugin to customize your WordPress dashboard and admin area.
|
37 |
+
* **[Page Builder Framework](https://wp-pagebuilderframework.com/?utm_source=erident&utm_medium=repository&utm_campaign=wpbf)** - A fast & minimalistic WordPress theme designed for the new WordPress era.
|
38 |
+
* **[Better Admin Bar](https://betteradminbar.com/?utm_source=erident&utm_medium=repository&utm_campaign=bab)** - The plugin to make your clients enjoy WordPress. It replaces the default admin bar to provide the best possible user experience when editing & navigating a website.
|
39 |
+
|
40 |
+
== Installation ==
|
41 |
+
1. Download the erident-custom-login-and-dashboard.zip file to your computer.
|
42 |
+
1. Unzip the file.
|
43 |
+
1. Upload the `erident-custom-login-and-dashboard` folder to your `/wp-content/plugins/` directory.
|
44 |
+
1. Activate the plugin through the *Plugins* menu in WordPress.
|
45 |
+
|
46 |
+
== Frequently Asked Questions ==
|
47 |
+
= Are there more options to customize the WordPress Dashboard? =
|
48 |
+
Yes! For more options and to fully customize the WordPress dashboard, check out **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=repository&utm_campaign=udb)**.
|
49 |
+
|
50 |
+
== Screenshots ==
|
51 |
+
1. Settings Page
|
52 |
+
2. Default Erident Login Screen
|
53 |
+
3. Customized WordPress Login Screen (Example 1)
|
54 |
+
4. Customized WordPress Login Screen (Example 2)
|
55 |
+
|
56 |
+
== Changelog ==
|
57 |
+
= 4.0 | April 29, 2022 =
|
58 |
+
* Version 4.0 is a complete refactor of Erident Custom Login & Dashboard with a modern look and a much improved user experience. For even more options, check out **[Ultimate Dashboard](https://ultimatedashboard.io/?utm_source=erident&utm_medium=changelog&utm_campaign=udb)**.
|
59 |
+
|
60 |
+
= 3.5.9 (01 Apr 2021) =
|
61 |
+
* XSS Security Fix
|
62 |
+
* Compatibility with latest WordPress version
|
63 |
+
|
64 |
+
= 3.5.8 (27 May 2020) =
|
65 |
+
* Password Label field color fix
|
66 |
+
* Compatibility with latest WordPress version
|
67 |
+
|
68 |
+
= 3.5.7 (23 Jun 2019) =
|
69 |
+
* Complete shadow removal for forms
|
70 |
+
* Updating deprecated function login_headertitle
|
71 |
+
|
72 |
+
= 3.5.5 (29 Nov 2017) =
|
73 |
+
* Option to add Login button's text color
|
74 |
+
* Removed conflicting css
|
75 |
+
|
76 |
+
= 3.5.4 (9 Mar 2017) =
|
77 |
+
* Fixed the function names which may conflict with other plugins
|
78 |
+
|
79 |
+
= 3.5.3 (6 Feb 2017) =
|
80 |
+
* Fixed warning in dashboard
|
81 |
+
* Minor CSS improvement on register page
|
82 |
+
|
83 |
+
= 3.5.2 =
|
84 |
+
* Hide Register | Lost your password link
|
85 |
+
* Hide Back to your website link
|
86 |
+
* CSS updates to override default wp shadows
|
87 |
+
|
88 |
+
= 3.5.1 =
|
89 |
+
* Compatibility fix with WordPress 4.5
|
90 |
+
* Minor bug fix
|
91 |
+
|
92 |
+
= 3.5 =
|
93 |
+
* Option to keep default WordPress version on dashboard footer
|
94 |
+
* Persian translation added
|
95 |
+
* Security fix for CSRF
|
96 |
+
|
97 |
+
= 3.4.1 =
|
98 |
+
* Fixed function for php older version
|
99 |
+
|
100 |
+
= 3.4 =
|
101 |
+
* Supports WordPress media uploader inside the settings page
|
102 |
+
* Turkish translation added
|
103 |
+
|
104 |
+
= 3.3.1 =
|
105 |
+
* Extended link shadow enable/disable option to login button as well
|
106 |
+
* Moved screenshots to assets directory
|
107 |
+
|
108 |
+
= 3.3 =
|
109 |
+
* Added Background Opacity feature to the Login Form
|
110 |
+
* Now Register button will also take same color of Login button
|
111 |
+
|
112 |
+
= 3.2 =
|
113 |
+
* Minor fix for Logo size option.
|
114 |
+
* Added German translation.
|
115 |
+
|
116 |
+
= 3.1 =
|
117 |
+
* Major bug fix on backend.
|
118 |
+
* Striped slashes from apostrophe texts.
|
119 |
+
|
120 |
+
= 3.0 =
|
121 |
+
* Huge database performance upgrade on backend
|
122 |
+
* Added Import/Export settings feature
|
123 |
+
* Added French translation
|
124 |
+
* Improved UI with latest WordPress 3.9
|
125 |
+
|
126 |
+
= 2.3.1 =
|
127 |
+
* Fixed one function conflict with some themes.
|
128 |
+
|
129 |
+
= 2.3.0 =
|
130 |
+
* New option to customize Login button Color
|
131 |
+
* Localized the entire plugin and ready for translation
|
132 |
+
* Spanish translation available
|
133 |
+
|
134 |
+
= 2.2.1 =
|
135 |
+
* Fixed constants Notice.
|
136 |
+
* Fixed Image background cut on small screen resolutions.
|
137 |
+
|
138 |
+
= 2.2.0 =
|
139 |
+
* New Default UI for login page.
|
140 |
+
* Optimized the backend files.
|
141 |
+
|
142 |
+
= 2.1.1 =
|
143 |
+
* Fixed Background property overriding problem with some themes and plugins.
|
144 |
+
|
145 |
+
= 2.1.0 =
|
146 |
+
* Added Login Screen Background size Property
|
147 |
+
|
148 |
+
= 2.0.1 =
|
149 |
+
* Bug Fix
|
150 |
+
|
151 |
+
= 2.0.0 =
|
152 |
+
* Enhanced UI for easy usage (Added an option to hide/show settings block)
|
153 |
+
* Added option for Logo Width and Height
|
154 |
+
|
155 |
+
= 1.5.1 =
|
156 |
+
* Fixed a small bug
|
157 |
+
* Help texts improved and added new FAQ question
|
158 |
+
|
159 |
+
= 1.4 =
|
160 |
+
* Added an option for Login Form label and input text's font size
|
161 |
+
* Added an option for Login Form input text color
|
162 |
+
* Bug fixed for settings link conflicting
|
163 |
+
|
164 |
+
= 1.3 =
|
165 |
+
* Added an option for Form Shadow.
|
166 |
+
* Fixed Minor bugs.
|
167 |
+
|
168 |
+
= 1.2 =
|
169 |
+
* Fixed the issue of conflicting with other plugins on admin pages.
|
170 |
+
|
171 |
+
= 1.1 =
|
172 |
+
* Added "background-position" option for the screen & login form background images.
|
173 |
+
* Added a link on Settings tab for directly open the login.php page on a new tab.
|
174 |
+
* Improved the css layout of Settings page
|
175 |
+
* Added a "Quick Links" section at the bottom of settings page.
|
176 |
+
* Improved the tutorial texts on settings page.
|
177 |
+
|
178 |
+
= 1.0 =
|
179 |
+
* First version.
|
180 |
+
|
181 |
+
== Upgrade Notice ==
|
182 |
+
|
183 |
+
= 3.5.8 =
|
184 |
+
Password Label field color fix
|
185 |
+
Compatibility with latest WordPress version
|
templates/setting-boxes/dashboard-settings.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Dashboard settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display dashboard settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$left_side_text = isset( $settings['dashboard_data_left'] ) ? stripslashes( $settings['dashboard_data_left'] ) : '';
|
18 |
+
$right_side_text = isset( $settings['dashboard_data_right'] ) ? stripslashes( $settings['dashboard_data_right'] ) : '';
|
19 |
+
?>
|
20 |
+
|
21 |
+
<div class="heatbox dashboard-settings-box">
|
22 |
+
<h2>
|
23 |
+
<?php _e( 'Dashboard Settings', 'erident-custom-login-and-dashboard' ); ?>
|
24 |
+
</h2>
|
25 |
+
<div class="setting-fields">
|
26 |
+
|
27 |
+
<div class="field is-horizontal">
|
28 |
+
<div class="field-label">
|
29 |
+
<label for="dashboard_data_left" class="label">
|
30 |
+
<?php _e( 'Footer Text', 'erident-custom-login-and-dashboard' ); ?>
|
31 |
+
</label>
|
32 |
+
</div>
|
33 |
+
<div class="field-body">
|
34 |
+
<div class="field">
|
35 |
+
<div class="control">
|
36 |
+
<input type="text" name="dashboard_data_left" id="dashboard_data_left" class="general-setting-field" value="<?php echo esc_attr( $left_side_text ); ?>">
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="field is-horizontal">
|
43 |
+
<div class="field-label">
|
44 |
+
<label for="dashboard_data_right" class="label">
|
45 |
+
<?php _e( 'Version Text', 'erident-custom-login-and-dashboard' ); ?>
|
46 |
+
</label>
|
47 |
+
</div>
|
48 |
+
<div class="field-body">
|
49 |
+
<div class="field">
|
50 |
+
<div class="control">
|
51 |
+
<input type="text" name="dashboard_data_right" id="dashboard_data_right" class="general-setting-field" value="<?php echo esc_attr( $right_side_text ); ?>">
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<?php
|
61 |
+
};
|
templates/setting-boxes/export-settings.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Export settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
?>
|
10 |
+
|
11 |
+
<div class="heatbox export-widgets-box">
|
12 |
+
<form method="post" action="<?php menu_page_url( 'erident-custom-login-and-dashboard', true ); ?>#tools">
|
13 |
+
<input type="hidden" name="er_action" value="export_settings" />
|
14 |
+
<?php wp_nonce_field( 'er_export_nonce', 'er_export_nonce' ); ?>
|
15 |
+
|
16 |
+
<h2><?php _e( 'Export', 'erident-custom-login-and-dashboard' ); ?></h2>
|
17 |
+
<div class="heatbox-content">
|
18 |
+
<p>
|
19 |
+
<?php _e( 'Generate & export a .json file to backup your settings or move them to a different WordPress install.', 'erident-custom-login-and-dashboard' ); ?>
|
20 |
+
</p>
|
21 |
+
<?php submit_button( __( 'Export Settings', 'erident-custom-login-and-dashboard' ), 'primary', 'submit_export' ); ?>
|
22 |
+
</div>
|
23 |
+
</form>
|
24 |
+
</div>
|
templates/setting-boxes/import-settings.php
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Import settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
?>
|
10 |
+
|
11 |
+
<div class="heatbox import-widgets-box">
|
12 |
+
<form method="post" action="<?php menu_page_url( 'erident-custom-login-and-dashboard', true ); ?>#tools" enctype="multipart/form-data">
|
13 |
+
<input type="hidden" name="er_action" value="import_settings">
|
14 |
+
<?php wp_nonce_field( 'er_import_nonce', 'er_import_nonce' ); ?>
|
15 |
+
|
16 |
+
<h2><?php _e( 'Import', 'erident-custom-login-and-dashboard' ); ?></h2>
|
17 |
+
<div class="heatbox-content">
|
18 |
+
<p>
|
19 |
+
<?php _e( 'Select the .json file you would like to import.', 'erident-custom-login-and-dashboard' ); ?>
|
20 |
+
</p>
|
21 |
+
<div class="setting-fields is-gapless">
|
22 |
+
<div class="fields-wrapper">
|
23 |
+
<label class="block-label" for="import_file">Select File</label>
|
24 |
+
<input type="file" name="import_file" id="import_file">
|
25 |
+
</div>
|
26 |
+
</div>
|
27 |
+
<?php submit_button( __( 'Import Settings', 'erident-custom-login-and-dashboard' ), 'primary', 'submit_import' ); ?>
|
28 |
+
</div>
|
29 |
+
</form>
|
30 |
+
</div>
|
templates/setting-boxes/login-bg-settings.php
ADDED
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login background settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login background settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$bg_color = isset( $settings['top_bg_color'] ) && ! empty( $settings['top_bg_color'] ) ? $settings['top_bg_color'] : '';
|
18 |
+
$bg_image_url = isset( $settings['top_bg_image'] ) && ! empty( $settings['top_bg_image'] ) ? $settings['top_bg_image'] : '';
|
19 |
+
$bg_repeat = isset( $settings['top_bg_repeat'] ) && ! empty( $settings['top_bg_repeat'] ) ? $settings['top_bg_repeat'] : '';
|
20 |
+
$horizontal_pos = isset( $settings['top_bg_xpos'] ) && ! empty( $settings['top_bg_xpos'] ) ? $settings['top_bg_xpos'] : '';
|
21 |
+
$vertical_pos = isset( $settings['top_bg_ypos'] ) && ! empty( $settings['top_bg_ypos'] ) ? $settings['top_bg_ypos'] : '';
|
22 |
+
$bg_size = isset( $settings['top_bg_size'] ) && ! empty( $settings['top_bg_size'] ) ? $settings['top_bg_size'] : '';
|
23 |
+
?>
|
24 |
+
|
25 |
+
<div class="heatbox login-bg-settings-box">
|
26 |
+
<h2>
|
27 |
+
<?php _e( 'Background Settings', 'erident-custom-login-and-dashboard' ); ?>
|
28 |
+
</h2>
|
29 |
+
<div class="setting-fields">
|
30 |
+
|
31 |
+
<div class="field is-horizontal">
|
32 |
+
<div class="field-label">
|
33 |
+
<label for="top_bg_color" class="label">
|
34 |
+
<?php _e( 'Background Color', 'erident-custom-login-and-dashboard' ); ?>
|
35 |
+
</label>
|
36 |
+
</div>
|
37 |
+
<div class="field-body">
|
38 |
+
<div class="field">
|
39 |
+
<div class="control">
|
40 |
+
<input type="text" name="top_bg_color" id="top_bg_color" value="<?php echo esc_attr( $bg_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $bg_color ); ?>">
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<hr>
|
47 |
+
|
48 |
+
<div class="field is-horizontal">
|
49 |
+
<div class="field-label">
|
50 |
+
<label for="top_bg_image" class="label">
|
51 |
+
<?php _e( 'Background Image URL', 'erident-custom-login-and-dashboard' ); ?>
|
52 |
+
</label>
|
53 |
+
</div>
|
54 |
+
<div class="field-body">
|
55 |
+
<div class="field">
|
56 |
+
<div class="control">
|
57 |
+
<input type="text" id="top_bg_image" name="top_bg_image" value="<?php echo esc_url( $bg_image_url ); ?>" class="general-setting-field is-small cldashboard-bg-image-field">
|
58 |
+
<button type="button" class="button-secondary cldashboard-upload-button">
|
59 |
+
<?php _e( 'Add Background Image', 'erident-custom-login-and-dashboard' ); ?>
|
60 |
+
</button>
|
61 |
+
<button type="button" class="button-secondary cldashboard-clear-button">x</button>
|
62 |
+
</div>
|
63 |
+
</div>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<div class="field is-horizontal">
|
68 |
+
<div class="field-label">
|
69 |
+
<label for="top_bg_repeat" class="label">
|
70 |
+
<?php _e( 'Background Repeat', 'erident-custom-login-and-dashboard' ); ?>
|
71 |
+
</label>
|
72 |
+
</div>
|
73 |
+
<div class="field-body">
|
74 |
+
<div class="field">
|
75 |
+
<div class="control">
|
76 |
+
<?php
|
77 |
+
$bg_repeat_opts = [
|
78 |
+
'no-repeat',
|
79 |
+
'repeat',
|
80 |
+
'repeat-x',
|
81 |
+
'repeat-y',
|
82 |
+
];
|
83 |
+
?>
|
84 |
+
<select name="top_bg_repeat" id="top_bg_repeat" class="general-setting-field is-tiny">
|
85 |
+
<?php foreach ( $bg_repeat_opts as $bg_repeat_opt ) : ?>
|
86 |
+
<option value="<?php echo esc_attr( $bg_repeat_opt ); ?>" <?php selected( $bg_repeat_opt, $bg_repeat ); ?>>
|
87 |
+
<?php echo esc_attr( $bg_repeat_opt ); ?>
|
88 |
+
</option>
|
89 |
+
<?php endforeach; ?>
|
90 |
+
</select>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<div class="field is-horizontal" data-hide-if-field="top_bg_repeat" data-hide-if-value="repeat">
|
97 |
+
<div class="field-label">
|
98 |
+
<label for="top_bg_xpos" class="label">
|
99 |
+
<?php _e( 'Background Horizontal Position', 'erident-custom-login-and-dashboard' ); ?>
|
100 |
+
<p class="description">
|
101 |
+
<?php _e( 'Possible values: <code>left</code>, <code>center</code>, <code>right</code> or numeric value. If a numeric value is provided, a unit (<code>px</code>, <code>%</code>, etc.) must be defined.', 'erident-custom-login-and-dashboard' ); ?>
|
102 |
+
</p>
|
103 |
+
</label>
|
104 |
+
</div>
|
105 |
+
<div class="field-body">
|
106 |
+
<div class="field">
|
107 |
+
<div class="control">
|
108 |
+
<input type="text" name="top_bg_xpos" id="top_bg_xpos" value="<?php echo esc_attr( $horizontal_pos ); ?>" class="general-setting-field is-tiny">
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
|
114 |
+
<div class="field is-horizontal" data-hide-if-field="top_bg_repeat" data-hide-if-value="repeat">
|
115 |
+
<div class="field-label">
|
116 |
+
<label for="top_bg_ypos" class="label">
|
117 |
+
<?php _e( 'Background Vertical Position', 'erident-custom-login-and-dashboard' ); ?>
|
118 |
+
<p class="description">
|
119 |
+
<?php _e( 'Possible values: <code>left</code>, <code>center</code>, <code>right</code> or numeric value. If a numeric value is provided, a unit (<code>px</code>, <code>%</code>, etc.) must be defined.', 'erident-custom-login-and-dashboard' ); ?>
|
120 |
+
</p>
|
121 |
+
</label>
|
122 |
+
</div>
|
123 |
+
<div class="field-body">
|
124 |
+
<div class="field">
|
125 |
+
<div class="control">
|
126 |
+
<input type="text" name="top_bg_ypos" id="top_bg_ypos" value="<?php echo esc_attr( $vertical_pos ); ?>" class="general-setting-field is-tiny">
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
<div class="field is-horizontal">
|
133 |
+
<div class="field-label">
|
134 |
+
<label for="top_bg_size" class="label">
|
135 |
+
<?php _e( 'Background Size', 'erident-custom-login-and-dashboard' ); ?>
|
136 |
+
<p class="description">
|
137 |
+
<?php _e( 'Possible values: <code>auto</code>, <code>cover</code>, <code>contain</code> or numeric value. If a numeric value is provided, a unit (<code>px</code>, <code>%</code>, etc.) must be defined.', 'erident-custom-login-and-dashboard' ); ?>
|
138 |
+
</p>
|
139 |
+
</label>
|
140 |
+
</div>
|
141 |
+
<div class="field-body">
|
142 |
+
<div class="field">
|
143 |
+
<div class="control">
|
144 |
+
<input type="text" name="top_bg_size" id="top_bg_size" value="<?php echo esc_attr( $bg_size ); ?>" class="general-setting-field is-tiny">
|
145 |
+
</div>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
|
153 |
+
<?php
|
154 |
+
};
|
templates/setting-boxes/login-footer-link-settings.php
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login footer link settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login footer link settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$remove_register_link = isset( $settings['dashboard_check_lost_pass'] ) ? $settings['dashboard_check_lost_pass'] : 0;
|
18 |
+
$remove_register_link = 'yes' === strtolower( $remove_register_link ) ? 1 : $remove_register_link;
|
19 |
+
$remove_register_link = 'no' === strtolower( $remove_register_link ) ? 0 : $remove_register_link;
|
20 |
+
|
21 |
+
$remove_back_to_blog_link = isset( $settings['dashboard_check_backtoblog'] ) ? $settings['dashboard_check_backtoblog'] : 0;
|
22 |
+
$remove_back_to_blog_link = 'yes' === strtolower( $remove_back_to_blog_link ) ? 1 : $remove_back_to_blog_link;
|
23 |
+
$remove_back_to_blog_link = 'no' === strtolower( $remove_back_to_blog_link ) ? 0 : $remove_back_to_blog_link;
|
24 |
+
?>
|
25 |
+
|
26 |
+
<div class="heatbox dashboard-settings-box">
|
27 |
+
<h2>
|
28 |
+
<?php _e( 'Footer Link Settings', 'erident-custom-login-and-dashboard' ); ?>
|
29 |
+
</h2>
|
30 |
+
<div class="setting-fields">
|
31 |
+
|
32 |
+
<div class="field">
|
33 |
+
<label for="dashboard_check_lost_pass" class="label checkbox-label">
|
34 |
+
<?php _e( 'Remove "Register | Lost your password?" link', 'erident-custom-login-and-dashboard' ); ?>
|
35 |
+
<input type="checkbox" name="dashboard_check_lost_pass" id="dashboard_check_lost_pass" value="1" class="general-setting-field" <?php checked( $remove_register_link, 1 ); ?>>
|
36 |
+
<div class="indicator"></div>
|
37 |
+
</label>
|
38 |
+
</div>
|
39 |
+
|
40 |
+
<div class="field">
|
41 |
+
<label for="dashboard_check_backtoblog" class="label checkbox-label">
|
42 |
+
<?php _e( 'Remove "Back to website" link', 'erident-custom-login-and-dashboard' ); ?>
|
43 |
+
<input type="checkbox" name="dashboard_check_backtoblog" id="dashboard_check_backtoblog" value="1" class="general-setting-field" <?php checked( $remove_back_to_blog_link, 1 ); ?>>
|
44 |
+
<div class="indicator"></div>
|
45 |
+
</label>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<?php
|
52 |
+
};
|
templates/setting-boxes/login-form-bg-settings.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login form bg settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login form bg settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$bg_color = isset( $settings['dashboard_login_bg'] ) && ! empty( $settings['dashboard_login_bg'] ) ? $settings['dashboard_login_bg'] : '';
|
18 |
+
$bg_image_url = isset( $settings['login_bg_image'] ) && ! empty( $settings['login_bg_image'] ) ? $settings['login_bg_image'] : '';
|
19 |
+
$bg_repeat = isset( $settings['login_bg_repeat'] ) && ! empty( $settings['login_bg_repeat'] ) ? $settings['login_bg_repeat'] : '';
|
20 |
+
$horizontal_pos = isset( $settings['login_bg_xpos'] ) && ! empty( $settings['login_bg_xpos'] ) ? $settings['login_bg_xpos'] : '';
|
21 |
+
$vertical_pos = isset( $settings['login_bg_ypos'] ) && ! empty( $settings['login_bg_ypos'] ) ? $settings['login_bg_ypos'] : '';
|
22 |
+
|
23 |
+
if ( isset( $settings['dashboard_login_bg_opacity'] ) ) {
|
24 |
+
// This `dashboard_login_bg_opacity` won't be used anymore since we use colorpicker alpha now.
|
25 |
+
$bg_opacity = '' !== $settings['dashboard_login_bg_opacity'] ? $settings['dashboard_login_bg_opacity'] : 1; // 0 is allowed here.
|
26 |
+
|
27 |
+
if ( false === stripos( $bg_color, 'rgba' ) && 1 > $bg_opacity ) {
|
28 |
+
$bg_color = ariColor::newColor( $bg_color );
|
29 |
+
$bg_color = $bg_color->getNew( 'alpha', $bg_opacity )->toCSS( 'rgba' );
|
30 |
+
}
|
31 |
+
}
|
32 |
+
?>
|
33 |
+
|
34 |
+
<div class="heatbox dashboard-settings-box">
|
35 |
+
<h2>
|
36 |
+
<?php _e( 'Form Background Settings', 'erident-custom-login-and-dashboard' ); ?>
|
37 |
+
</h2>
|
38 |
+
<div class="setting-fields">
|
39 |
+
|
40 |
+
<div class="field is-horizontal">
|
41 |
+
<div class="field-label">
|
42 |
+
<label for="dashboard_login_bg" class="label">
|
43 |
+
<?php _e( 'Background Color', 'erident-custom-login-and-dashboard' ); ?>
|
44 |
+
</label>
|
45 |
+
</div>
|
46 |
+
<div class="field-body">
|
47 |
+
<div class="field">
|
48 |
+
<div class="control">
|
49 |
+
<input type="text" name="dashboard_login_bg" id="dashboard_login_bg" value="<?php echo esc_attr( $bg_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $bg_color ); ?>">
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<hr>
|
56 |
+
|
57 |
+
<div class="field is-horizontal">
|
58 |
+
<div class="field-label">
|
59 |
+
<label for="login_bg_image" class="label">
|
60 |
+
<?php _e( 'Background Image URL', 'erident-custom-login-and-dashboard' ); ?>
|
61 |
+
</label>
|
62 |
+
</div>
|
63 |
+
<div class="field-body">
|
64 |
+
<div class="field">
|
65 |
+
<div class="control">
|
66 |
+
<input type="text" id="login_bg_image" name="login_bg_image" value="<?php echo esc_url( $bg_image_url ); ?>" class="general-setting-field is-small cldashboard-form-bg-image-field">
|
67 |
+
<button type="button" class="button-secondary cldashboard-upload-button">
|
68 |
+
<?php _e( 'Add Background Image', 'erident-custom-login-and-dashboard' ); ?>
|
69 |
+
</button>
|
70 |
+
<button type="button" class="button-secondary cldashboard-clear-button">x</button>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
|
76 |
+
<div class="field is-horizontal">
|
77 |
+
<div class="field-label">
|
78 |
+
<label for="login_bg_repeat" class="label">
|
79 |
+
<?php _e( 'Background Repeat', 'erident-custom-login-and-dashboard' ); ?>
|
80 |
+
</label>
|
81 |
+
</div>
|
82 |
+
<div class="field-body">
|
83 |
+
<div class="field">
|
84 |
+
<div class="control">
|
85 |
+
<?php
|
86 |
+
$bg_repeat_opts = [
|
87 |
+
'no-repeat',
|
88 |
+
'repeat',
|
89 |
+
'repeat-x',
|
90 |
+
'repeat-y',
|
91 |
+
];
|
92 |
+
?>
|
93 |
+
<select name="login_bg_repeat" id="login_bg_repeat" class="general-setting-field is-tiny">
|
94 |
+
<?php foreach ( $bg_repeat_opts as $bg_repeat_opt ) : ?>
|
95 |
+
<option value="<?php echo esc_attr( $bg_repeat_opt ); ?>" <?php selected( $bg_repeat_opt, $bg_repeat ); ?>>
|
96 |
+
<?php echo esc_attr( $bg_repeat_opt ); ?>
|
97 |
+
</option>
|
98 |
+
<?php endforeach; ?>
|
99 |
+
</select>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<div class="field is-horizontal" data-hide-if-field="login_bg_repeat" data-hide-if-value="repeat">
|
106 |
+
<div class="field-label">
|
107 |
+
<label for="login_bg_xpos" class="label">
|
108 |
+
<?php _e( 'Background Horizontal Position', 'erident-custom-login-and-dashboard' ); ?>
|
109 |
+
<p class="description">
|
110 |
+
<?php _e( 'Possible values: <code>left</code>, <code>center</code>, <code>right</code> or numeric value. If a numeric value is provided, a unit (<code>px</code>, <code>%</code>, etc.) must be defined.', 'erident-custom-login-and-dashboard' ); ?>
|
111 |
+
</p>
|
112 |
+
</label>
|
113 |
+
</div>
|
114 |
+
<div class="field-body">
|
115 |
+
<div class="field">
|
116 |
+
<div class="control">
|
117 |
+
<input type="text" name="login_bg_xpos" id="login_bg_xpos" value="<?php echo esc_attr( $horizontal_pos ); ?>" class="general-setting-field is-tiny">
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
</div>
|
122 |
+
|
123 |
+
<div class="field is-horizontal" data-hide-if-field="login_bg_repeat" data-hide-if-value="repeat">
|
124 |
+
<div class="field-label">
|
125 |
+
<label for="login_bg_ypos" class="label">
|
126 |
+
<?php _e( 'Background Vertical Position', 'erident-custom-login-and-dashboard' ); ?>
|
127 |
+
<p class="description">
|
128 |
+
<?php _e( 'Possible values: <code>left</code>, <code>center</code>, <code>right</code> or numeric value. If a numeric value is provided, a unit (<code>px</code>, <code>%</code>, etc.) must be defined.', 'erident-custom-login-and-dashboard' ); ?>
|
129 |
+
</p>
|
130 |
+
</label>
|
131 |
+
</div>
|
132 |
+
<div class="field-body">
|
133 |
+
<div class="field">
|
134 |
+
<div class="control">
|
135 |
+
<input type="text" name="login_bg_ypos" id="login_bg_ypos" value="<?php echo esc_attr( $vertical_pos ); ?>" class="general-setting-field is-tiny">
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
|
141 |
+
</div>
|
142 |
+
</div>
|
143 |
+
|
144 |
+
<?php
|
145 |
+
};
|
templates/setting-boxes/login-form-button-settings.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login form button settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login form button settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$button_bg_color = isset( $settings['dashboard_button_color'] ) && ! empty( $settings['dashboard_button_color'] ) ? $settings['dashboard_button_color'] : '';
|
18 |
+
$button_text_color = isset( $settings['dashboard_button_text_color'] ) && ! empty( $settings['dashboard_button_text_color'] ) ? $settings['dashboard_button_text_color'] : '';
|
19 |
+
?>
|
20 |
+
|
21 |
+
<div class="heatbox dashboard-settings-box">
|
22 |
+
<h2>
|
23 |
+
<?php _e( 'Form Button Settings', 'erident-custom-login-and-dashboard' ); ?>
|
24 |
+
</h2>
|
25 |
+
<div class="setting-fields">
|
26 |
+
|
27 |
+
<div class="field is-horizontal">
|
28 |
+
<div class="field-label">
|
29 |
+
<label for="dashboard_button_color" class="label">
|
30 |
+
<?php _e( 'Background Color', 'erident-custom-login-and-dashboard' ); ?>
|
31 |
+
</label>
|
32 |
+
</div>
|
33 |
+
<div class="field-body">
|
34 |
+
<div class="field">
|
35 |
+
<div class="control">
|
36 |
+
<input type="text" name="dashboard_button_color" id="dashboard_button_color" value="<?php echo esc_attr( $button_bg_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $button_bg_color ); ?>">
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="field is-horizontal">
|
43 |
+
<div class="field-label">
|
44 |
+
<label for="dashboard_button_text_color" class="label">
|
45 |
+
<?php _e( 'Font Color', 'erident-custom-login-and-dashboard' ); ?>
|
46 |
+
</label>
|
47 |
+
</div>
|
48 |
+
<div class="field-body">
|
49 |
+
<div class="field">
|
50 |
+
<div class="control">
|
51 |
+
<input type="text" name="dashboard_button_text_color" id="dashboard_button_text_color" value="<?php echo esc_attr( $button_text_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $button_text_color ); ?>">
|
52 |
+
</div>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<?php
|
61 |
+
};
|
templates/setting-boxes/login-form-input-settings.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login form input settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login form input settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$font_color = isset( $settings['dashboard_input_text_color'] ) && ! empty( $settings['dashboard_input_text_color'] ) ? $settings['dashboard_input_text_color'] : '';
|
18 |
+
$font_size = isset( $settings['dashboard_input_text_size'] ) && ! empty( $settings['dashboard_input_text_size'] ) ? $settings['dashboard_input_text_size'] : '';
|
19 |
+
?>
|
20 |
+
|
21 |
+
<div class="heatbox dashboard-settings-box">
|
22 |
+
<h2>
|
23 |
+
<?php _e( 'Form Input Field Settings', 'erident-custom-login-and-dashboard' ); ?>
|
24 |
+
</h2>
|
25 |
+
<div class="setting-fields">
|
26 |
+
|
27 |
+
<div class="field is-horizontal">
|
28 |
+
<div class="field-label">
|
29 |
+
<label for="dashboard_input_text_color" class="label">
|
30 |
+
<?php _e( 'Font Color', 'erident-custom-login-and-dashboard' ); ?>
|
31 |
+
</label>
|
32 |
+
</div>
|
33 |
+
<div class="field-body">
|
34 |
+
<div class="field">
|
35 |
+
<div class="control">
|
36 |
+
<input type="text" name="dashboard_input_text_color" id="dashboard_input_text_color" value="<?php echo esc_attr( $font_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $font_color ); ?>">
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="field is-horizontal">
|
43 |
+
<div class="field-label">
|
44 |
+
<label for="dashboard_input_text_size" class="label">
|
45 |
+
<?php _e( 'Font Size', 'erident-custom-login-and-dashboard' ); ?>
|
46 |
+
</label>
|
47 |
+
</div>
|
48 |
+
<div class="field-body">
|
49 |
+
<div class="field">
|
50 |
+
<div class="control">
|
51 |
+
<input type="number" min="0" step="1" name="dashboard_input_text_size" id="dashboard_input_text_size" value="<?php echo esc_attr( $font_size ); ?>" class="general-setting-field is-tiny">
|
52 |
+
<code>px</code>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<?php
|
62 |
+
};
|
templates/setting-boxes/login-form-label-settings.php
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login form label settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login form label settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$font_color = isset( $settings['dashboard_text_color'] ) && ! empty( $settings['dashboard_text_color'] ) ? $settings['dashboard_text_color'] : '';
|
18 |
+
$font_size = isset( $settings['dashboard_label_text_size'] ) && ! empty( $settings['dashboard_label_text_size'] ) ? $settings['dashboard_label_text_size'] : '';
|
19 |
+
?>
|
20 |
+
|
21 |
+
<div class="heatbox dashboard-settings-box">
|
22 |
+
<h2>
|
23 |
+
<?php _e( 'Form Label Settings', 'erident-custom-login-and-dashboard' ); ?>
|
24 |
+
</h2>
|
25 |
+
<div class="setting-fields">
|
26 |
+
|
27 |
+
<div class="field is-horizontal">
|
28 |
+
<div class="field-label">
|
29 |
+
<label for="dashboard_text_color" class="label">
|
30 |
+
<?php _e( 'Font Color', 'erident-custom-login-and-dashboard' ); ?>
|
31 |
+
</label>
|
32 |
+
</div>
|
33 |
+
<div class="field-body">
|
34 |
+
<div class="field">
|
35 |
+
<div class="control">
|
36 |
+
<input type="text" name="dashboard_text_color" id="dashboard_text_color" value="<?php echo esc_attr( $font_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $font_color ); ?>">
|
37 |
+
</div>
|
38 |
+
</div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<div class="field is-horizontal">
|
43 |
+
<div class="field-label">
|
44 |
+
<label for="dashboard_label_text_size" class="label">
|
45 |
+
<?php _e( 'Font Size', 'erident-custom-login-and-dashboard' ); ?>
|
46 |
+
</label>
|
47 |
+
</div>
|
48 |
+
<div class="field-body">
|
49 |
+
<div class="field">
|
50 |
+
<div class="control">
|
51 |
+
<input type="number" min="0" step="1" name="dashboard_label_text_size" id="dashboard_label_text_size" value="<?php echo esc_attr( $font_size ); ?>" class="general-setting-field is-tiny">
|
52 |
+
<code>px</code>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
|
61 |
+
<?php
|
62 |
+
};
|
templates/setting-boxes/login-form-layout-settings.php
ADDED
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login form layout settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login form layout settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$form_width = isset( $settings['dashboard_login_width'] ) && ! empty( $settings['dashboard_login_width'] ) ? $settings['dashboard_login_width'] : '';
|
18 |
+
$border_radius = isset( $settings['dashboard_login_radius'] ) && ! empty( $settings['dashboard_login_radius'] ) ? $settings['dashboard_login_radius'] : '';
|
19 |
+
$border_width = isset( $settings['dashboard_border_thick'] ) && ! empty( $settings['dashboard_border_thick'] ) ? $settings['dashboard_border_thick'] : '';
|
20 |
+
$border_style = isset( $settings['dashboard_login_border'] ) && ! empty( $settings['dashboard_login_border'] ) ? $settings['dashboard_login_border'] : '';
|
21 |
+
$border_color = isset( $settings['dashboard_border_color'] ) && ! empty( $settings['dashboard_border_color'] ) ? $settings['dashboard_border_color'] : '';
|
22 |
+
|
23 |
+
$enable_shadow = isset( $settings['dashboard_check_form_shadow'] ) ? $settings['dashboard_check_form_shadow'] : 0;
|
24 |
+
$enable_shadow = 'yes' === strtolower( $enable_shadow ) ? 1 : $enable_shadow;
|
25 |
+
$enable_shadow = 'no' === strtolower( $enable_shadow ) ? 0 : $enable_shadow;
|
26 |
+
$shadow_color = isset( $settings['dashboard_form_shadow'] ) && ! empty( $settings['dashboard_form_shadow'] ) ? $settings['dashboard_form_shadow'] : '';
|
27 |
+
?>
|
28 |
+
|
29 |
+
<div class="heatbox dashboard-settings-box">
|
30 |
+
<h2>
|
31 |
+
<?php _e( 'Form Layout Settings', 'erident-custom-login-and-dashboard' ); ?>
|
32 |
+
</h2>
|
33 |
+
<div class="setting-fields">
|
34 |
+
|
35 |
+
<div class="field is-horizontal">
|
36 |
+
<div class="field-label">
|
37 |
+
<label for="dashboard_login_width" class="label">
|
38 |
+
<?php _e( 'Form Width', 'erident-custom-login-and-dashboard' ); ?>
|
39 |
+
</label>
|
40 |
+
</div>
|
41 |
+
<div class="field-body">
|
42 |
+
<div class="field">
|
43 |
+
<div class="control">
|
44 |
+
<input type="number" name="dashboard_login_width" id="dashboard_login_width" class="general-setting-field is-tiny" value="<?php echo esc_attr( $form_width ); ?>">
|
45 |
+
<code>px</code>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<hr>
|
52 |
+
|
53 |
+
<div class="field is-horizontal">
|
54 |
+
<div class="field-label">
|
55 |
+
<label for="dashboard_login_radius" class="label">
|
56 |
+
<?php _e( 'Border Radius', 'erident-custom-login-and-dashboard' ); ?>
|
57 |
+
</label>
|
58 |
+
</div>
|
59 |
+
<div class="field-body">
|
60 |
+
<div class="field">
|
61 |
+
<div class="control">
|
62 |
+
<input type="number" name="dashboard_login_radius" id="dashboard_login_radius" class="general-setting-field is-tiny" value="<?php echo esc_attr( $border_radius ); ?>">
|
63 |
+
<code>px</code>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
</div>
|
67 |
+
</div>
|
68 |
+
|
69 |
+
<div class="field is-horizontal">
|
70 |
+
<div class="field-label">
|
71 |
+
<label for="dashboard_border_thick" class="label">
|
72 |
+
<?php _e( 'Border Width', 'erident-custom-login-and-dashboard' ); ?>
|
73 |
+
</label>
|
74 |
+
</div>
|
75 |
+
<div class="field-body">
|
76 |
+
<div class="field">
|
77 |
+
<div class="control">
|
78 |
+
<input type="number" name="dashboard_border_thick" id="dashboard_border_thick" class="general-setting-field is-tiny" value="<?php echo esc_attr( $border_width ); ?>">
|
79 |
+
<code>px</code>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
|
85 |
+
<div class="field is-horizontal">
|
86 |
+
<div class="field-label">
|
87 |
+
<label for="dashboard_login_border" class="label">
|
88 |
+
<?php _e( 'Border Style', 'erident-custom-login-and-dashboard' ); ?>
|
89 |
+
</label>
|
90 |
+
</div>
|
91 |
+
<div class="field-body">
|
92 |
+
<div class="field">
|
93 |
+
<div class="control">
|
94 |
+
<?php
|
95 |
+
$form_border_styles = [
|
96 |
+
'none',
|
97 |
+
'solid',
|
98 |
+
'dotted',
|
99 |
+
'dashed',
|
100 |
+
'double',
|
101 |
+
];
|
102 |
+
?>
|
103 |
+
<select name="dashboard_login_border" id="dashboard_login_border" class="general-setting-field is-tiny">
|
104 |
+
<?php foreach ( $form_border_styles as $form_border_style ) : ?>
|
105 |
+
<option value="<?php echo esc_attr( $form_border_style ); ?>" <?php selected( $form_border_style, $border_style ); ?>>
|
106 |
+
<?php echo esc_attr( $form_border_style ); ?>
|
107 |
+
</option>
|
108 |
+
<?php endforeach; ?>
|
109 |
+
</select>
|
110 |
+
</div>
|
111 |
+
</div>
|
112 |
+
</div>
|
113 |
+
</div>
|
114 |
+
|
115 |
+
<div class="field is-horizontal">
|
116 |
+
<div class="field-label">
|
117 |
+
<label for="dashboard_border_color" class="label">
|
118 |
+
<?php _e( 'Border Color', 'erident-custom-login-and-dashboard' ); ?>
|
119 |
+
</label>
|
120 |
+
</div>
|
121 |
+
<div class="field-body">
|
122 |
+
<div class="field">
|
123 |
+
<div class="control">
|
124 |
+
<input type="text" name="dashboard_border_color" id="dashboard_border_color" value="<?php echo esc_attr( $border_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $border_color ); ?>">
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
|
130 |
+
<hr>
|
131 |
+
|
132 |
+
<div class="field is-horizontal">
|
133 |
+
<div class="field-label">
|
134 |
+
<label for="dashboard_check_form_shadow" class="label">
|
135 |
+
<?php _e( 'Form Box Shadow', 'erident-custom-login-and-dashboard' ); ?>
|
136 |
+
</label>
|
137 |
+
</div>
|
138 |
+
<div class="field-body">
|
139 |
+
<div class="field">
|
140 |
+
<label for="dashboard_check_form_shadow" class="label checkbox-label">
|
141 |
+
<?php _e( 'Enable', 'erident-custom-login-and-dashboard' ); ?>
|
142 |
+
<input type="checkbox" name="dashboard_check_form_shadow" id="dashboard_check_form_shadow" value="1" class="general-setting-field" <?php checked( $enable_shadow, 1 ); ?>>
|
143 |
+
<div class="indicator"></div>
|
144 |
+
</label>
|
145 |
+
</div>
|
146 |
+
</div>
|
147 |
+
</div>
|
148 |
+
|
149 |
+
<div class="field is-horizontal" data-show-if-field-checked="dashboard_check_form_shadow">
|
150 |
+
<div class="field-label">
|
151 |
+
<label for="dashboard_form_shadow" class="label">
|
152 |
+
<?php _e( 'Form Box Shadow Color', 'erident-custom-login-and-dashboard' ); ?>
|
153 |
+
</label>
|
154 |
+
</div>
|
155 |
+
<div class="field-body">
|
156 |
+
<div class="field">
|
157 |
+
<div class="control">
|
158 |
+
<input type="text" name="dashboard_form_shadow" id="dashboard_form_shadow" value="<?php echo esc_attr( $shadow_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $shadow_color ); ?>">
|
159 |
+
</div>
|
160 |
+
</div>
|
161 |
+
</div>
|
162 |
+
</div>
|
163 |
+
|
164 |
+
</div>
|
165 |
+
</div>
|
166 |
+
|
167 |
+
<?php
|
168 |
+
};
|
templates/setting-boxes/login-form-link-settings.php
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login form link settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login form link settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$link_color = isset( $settings['dashboard_link_color'] ) && ! empty( $settings['dashboard_link_color'] ) ? $settings['dashboard_link_color'] : '';
|
18 |
+
$enable_shadow = isset( $settings['dashboard_check_shadow'] ) ? $settings['dashboard_check_shadow'] : 0;
|
19 |
+
$enable_shadow = 'yes' === strtolower( $enable_shadow ) ? 1 : $enable_shadow;
|
20 |
+
$enable_shadow = 'no' === strtolower( $enable_shadow ) ? 0 : $enable_shadow;
|
21 |
+
$shadow_color = isset( $settings['dashboard_link_shadow'] ) && ! empty( $settings['dashboard_link_shadow'] ) ? $settings['dashboard_link_shadow'] : '';
|
22 |
+
?>
|
23 |
+
|
24 |
+
<div class="heatbox dashboard-settings-box">
|
25 |
+
<h2>
|
26 |
+
<?php _e( 'Form Link Settings', 'erident-custom-login-and-dashboard' ); ?>
|
27 |
+
</h2>
|
28 |
+
<div class="setting-fields">
|
29 |
+
|
30 |
+
<div class="field is-horizontal">
|
31 |
+
<div class="field-label">
|
32 |
+
<label for="dashboard_link_color" class="label">
|
33 |
+
<?php _e( 'Color', 'erident-custom-login-and-dashboard' ); ?>
|
34 |
+
</label>
|
35 |
+
</div>
|
36 |
+
<div class="field-body">
|
37 |
+
<div class="field">
|
38 |
+
<div class="control">
|
39 |
+
<input type="text" name="dashboard_link_color" id="dashboard_link_color" value="<?php echo esc_attr( $link_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $link_color ); ?>">
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
</div>
|
44 |
+
|
45 |
+
<div class="field is-horizontal">
|
46 |
+
<div class="field-label">
|
47 |
+
<label for="dashboard_check_shadow" class="label">
|
48 |
+
<?php _e( 'Text Shadow', 'erident-custom-login-and-dashboard' ); ?>
|
49 |
+
</label>
|
50 |
+
</div>
|
51 |
+
<div class="field-body">
|
52 |
+
<div class="field">
|
53 |
+
<label for="dashboard_check_shadow" class="label checkbox-label">
|
54 |
+
<?php _e( 'Enable', 'erident-custom-login-and-dashboard' ); ?>
|
55 |
+
<input type="checkbox" name="dashboard_check_shadow" id="dashboard_check_shadow" value="1" class="general-setting-field" <?php checked( $enable_shadow, 1 ); ?>>
|
56 |
+
<div class="indicator"></div>
|
57 |
+
</label>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
|
62 |
+
<div class="field is-horizontal" data-show-if-field-checked="dashboard_check_shadow">
|
63 |
+
<div class="field-label">
|
64 |
+
<label for="dashboard_link_shadow" class="label">
|
65 |
+
<?php _e( 'Text Shadow Color', 'erident-custom-login-and-dashboard' ); ?>
|
66 |
+
</label>
|
67 |
+
</div>
|
68 |
+
<div class="field-body">
|
69 |
+
<div class="field">
|
70 |
+
<div class="control">
|
71 |
+
<input type="text" name="dashboard_link_shadow" id="dashboard_link_shadow" value="<?php echo esc_attr( $shadow_color ); ?>" class="color-picker-field general-setting-field" data-alpha="true" data-default-color="<?php echo esc_attr( $shadow_color ); ?>">
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<?php
|
81 |
+
};
|
templates/setting-boxes/login-logo-settings.php
ADDED
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Login logo settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display login logo settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$logo_image_url = isset( $settings['dashboard_image_logo'] ) && ! empty( $settings['dashboard_image_logo'] ) ? $settings['dashboard_image_logo'] : '';
|
18 |
+
$logo_width = isset( $settings['dashboard_image_logo_width'] ) && ! empty( $settings['dashboard_image_logo_width'] ) ? $settings['dashboard_image_logo_width'] : '';
|
19 |
+
$logo_height = isset( $settings['dashboard_image_logo_height'] ) && ! empty( $settings['dashboard_image_logo_height'] ) ? $settings['dashboard_image_logo_height'] : '';
|
20 |
+
$logo_hint_text = isset( $settings['dashboard_power_text'] ) && ! empty( $settings['dashboard_power_text'] ) ? $settings['dashboard_power_text'] : '';
|
21 |
+
?>
|
22 |
+
|
23 |
+
<div class="heatbox login-bg-settings-box">
|
24 |
+
<h2>
|
25 |
+
<?php _e( 'Logo Settings', 'erident-custom-login-and-dashboard' ); ?>
|
26 |
+
</h2>
|
27 |
+
<div class="setting-fields">
|
28 |
+
|
29 |
+
<div class="field is-horizontal">
|
30 |
+
<div class="field-label">
|
31 |
+
<label for="dashboard_image_logo" class="label">
|
32 |
+
<?php _e( 'Logo URL', 'erident-custom-login-and-dashboard' ); ?>
|
33 |
+
</label>
|
34 |
+
</div>
|
35 |
+
<div class="field-body">
|
36 |
+
<div class="field">
|
37 |
+
<div class="control">
|
38 |
+
<input type="text" id="dashboard_image_logo" name="dashboard_image_logo" value="<?php echo esc_url( $logo_image_url ); ?>" class="general-setting-field is-small cldashboard-logo-image-field">
|
39 |
+
<button type="button" class="button-secondary cldashboard-upload-button">
|
40 |
+
<?php _e( 'Add Logo', 'erident-custom-login-and-dashboard' ); ?>
|
41 |
+
</button>
|
42 |
+
<button type="button" class="button-secondary cldashboard-clear-button">x</button>
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div class="field is-horizontal">
|
49 |
+
<div class="field-label">
|
50 |
+
<label for="dashboard_image_logo_width" class="label">
|
51 |
+
<?php _e( 'Logo Width', 'erident-custom-login-and-dashboard' ); ?>
|
52 |
+
</label>
|
53 |
+
</div>
|
54 |
+
<div class="field-body">
|
55 |
+
<div class="field">
|
56 |
+
<div class="control">
|
57 |
+
<input type="number" name="dashboard_image_logo_width" id="dashboard_image_logo_width" value="<?php echo esc_attr( $logo_width ); ?>" class="general-setting-field is-tiny">
|
58 |
+
<code>px</code>
|
59 |
+
</div>
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
</div>
|
63 |
+
|
64 |
+
<div class="field is-horizontal">
|
65 |
+
<div class="field-label">
|
66 |
+
<label for="dashboard_image_logo_height" class="label">
|
67 |
+
<?php _e( 'Logo Height', 'erident-custom-login-and-dashboard' ); ?>
|
68 |
+
</label>
|
69 |
+
</div>
|
70 |
+
<div class="field-body">
|
71 |
+
<div class="field">
|
72 |
+
<div class="control">
|
73 |
+
<input type="number" name="dashboard_image_logo_height" id="dashboard_image_logo_height" value="<?php echo esc_attr( $logo_height ); ?>" class="general-setting-field is-tiny">
|
74 |
+
<code>px</code>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
|
80 |
+
<div class="field is-horizontal">
|
81 |
+
<div class="field-label">
|
82 |
+
<label for="dashboard_power_text" class="label">
|
83 |
+
<?php _e( 'Logo Title', 'erident-custom-login-and-dashboard' ); ?>
|
84 |
+
</label>
|
85 |
+
</div>
|
86 |
+
<div class="field-body">
|
87 |
+
<div class="field">
|
88 |
+
<div class="control">
|
89 |
+
<input type="text" name="dashboard_power_text" id="dashboard_power_text" value="<?php echo esc_attr( $logo_hint_text ); ?>" class="general-setting-field">
|
90 |
+
</div>
|
91 |
+
</div>
|
92 |
+
</div>
|
93 |
+
</div>
|
94 |
+
|
95 |
+
</div>
|
96 |
+
</div>
|
97 |
+
|
98 |
+
<?php
|
99 |
+
};
|
templates/setting-boxes/misc-settings.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Miscellaneus settings template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Display misc. settings template.
|
12 |
+
*
|
13 |
+
* @param array $settings The plugin settings.
|
14 |
+
*/
|
15 |
+
return function ( $settings ) {
|
16 |
+
|
17 |
+
$clean_deactivation = isset( $settings['dashboard_delete_db'] ) ? $settings['dashboard_delete_db'] : 0;
|
18 |
+
$clean_deactivation = 'yes' === strtolower( $clean_deactivation ) ? 1 : $clean_deactivation;
|
19 |
+
$clean_deactivation = 'no' === strtolower( $clean_deactivation ) ? 0 : $clean_deactivation;
|
20 |
+
?>
|
21 |
+
|
22 |
+
<div class="heatbox misc-settings-box">
|
23 |
+
<h2>
|
24 |
+
<?php _e( 'Misc', 'erident-custom-login-and-dashboard' ); ?>
|
25 |
+
</h2>
|
26 |
+
<div class="setting-fields">
|
27 |
+
|
28 |
+
<div class="field">
|
29 |
+
<label for="dashboard_delete_db" class="label checkbox-label">
|
30 |
+
<?php _e( 'Remove data on uninstall', 'erident-custom-login-and-dashboard' ); ?>
|
31 |
+
<p class="description">
|
32 |
+
<?php _e( 'If checked, all data will be removed on plugin deactivation.', 'erident-custom-login-and-dashboard' ); ?>
|
33 |
+
</p>
|
34 |
+
<input type="checkbox" name="dashboard_delete_db" id="dashboard_delete_db" value="1" class="general-setting-field" <?php checked( $clean_deactivation, 1 ); ?>>
|
35 |
+
<div class="indicator"></div>
|
36 |
+
</label>
|
37 |
+
</div>
|
38 |
+
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
|
42 |
+
<?php
|
43 |
+
};
|
templates/settings-template.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Settings page template.
|
4 |
+
*
|
5 |
+
* @package Custom_Login_Dashboard
|
6 |
+
*/
|
7 |
+
|
8 |
+
defined( 'ABSPATH' ) || die( "Can't access directly" );
|
9 |
+
|
10 |
+
return function () {
|
11 |
+
|
12 |
+
$settings = get_option( 'plugin_erident_settings', [] );
|
13 |
+
?>
|
14 |
+
|
15 |
+
<div class="wrap heatbox-wrap cldashboard-settings-page">
|
16 |
+
|
17 |
+
<div class="heatbox-header heatbox-has-tab-nav heatbox-margin-bottom">
|
18 |
+
|
19 |
+
<div class="heatbox-container heatbox-container-center">
|
20 |
+
|
21 |
+
<div class="logo-container">
|
22 |
+
|
23 |
+
<div>
|
24 |
+
<span class="title">
|
25 |
+
<?php _e( 'Custom Login & Dashboard', 'erident-custom-login-and-dashboard' ); ?>
|
26 |
+
<span class="version"><?php echo esc_html( CUSTOM_LOGIN_DASHBOARD_PLUGIN_VERSION ); ?></span>
|
27 |
+
</span>
|
28 |
+
<p class="subtitle"><?php _e( 'The #1 rated Plugin to customize the WordPress Login Screen.', 'erident-custom-login-and-dashboard' ); ?></p>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<div>
|
32 |
+
<img src="<?php echo esc_url( CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL ); ?>/assets/images/erident-logo.png">
|
33 |
+
</div>
|
34 |
+
|
35 |
+
</div>
|
36 |
+
|
37 |
+
<nav>
|
38 |
+
<ul class="heatbox-tab-nav">
|
39 |
+
<li class="heatbox-tab-nav-item cldashboard-login-screen-panel">
|
40 |
+
<a href="#login-screen"><?php _e( 'Login Screen', 'erident-custom-login-and-dashboard' ); ?></a>
|
41 |
+
</li>
|
42 |
+
<li class="heatbox-tab-nav-item cldashboard-dashboard-settings-panel">
|
43 |
+
<a href="#dashboard-settings"><?php _e( 'Dashboard Settings', 'erident-custom-login-and-dashboard' ); ?></a>
|
44 |
+
</li>
|
45 |
+
<li class="heatbox-tab-nav-item cldashboard-tools-panel">
|
46 |
+
<a href="#tools"><?php _e( 'Tools', 'erident-custom-login-and-dashboard' ); ?></a>
|
47 |
+
</li>
|
48 |
+
</ul>
|
49 |
+
</nav>
|
50 |
+
|
51 |
+
</div>
|
52 |
+
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<div class="heatbox-container heatbox-container-center heatbox-form-container">
|
56 |
+
|
57 |
+
<h1 style="display: none;"></h1>
|
58 |
+
|
59 |
+
<div>
|
60 |
+
<form method="post" action="options.php" class="cldashboard-settings-form">
|
61 |
+
<div class="heatbox-admin-panel cldashboard-dashboard-settings-panel">
|
62 |
+
<?php
|
63 |
+
$dashboard_settings_box = require __DIR__ . '/setting-boxes/dashboard-settings.php';
|
64 |
+
$dashboard_settings_box( $settings );
|
65 |
+
|
66 |
+
$misc_settings_box = require __DIR__ . '/setting-boxes/misc-settings.php';
|
67 |
+
$misc_settings_box( $settings );
|
68 |
+
?>
|
69 |
+
</div>
|
70 |
+
|
71 |
+
<div class="heatbox-admin-panel cldashboard-login-screen-panel">
|
72 |
+
<?php
|
73 |
+
$login_logo_settings_box = require_once __DIR__ . '/setting-boxes/login-logo-settings.php';
|
74 |
+
$login_logo_settings_box( $settings );
|
75 |
+
|
76 |
+
$login_bg_settings_box = require_once __DIR__ . '/setting-boxes/login-bg-settings.php';
|
77 |
+
$login_bg_settings_box( $settings );
|
78 |
+
?>
|
79 |
+
|
80 |
+
<div class="heatbox-group">
|
81 |
+
<?php
|
82 |
+
$login_form_layout_settings_box = require_once __DIR__ . '/setting-boxes/login-form-layout-settings.php';
|
83 |
+
$login_form_layout_settings_box( $settings );
|
84 |
+
|
85 |
+
$login_form_bg_settings_box = require_once __DIR__ . '/setting-boxes/login-form-bg-settings.php';
|
86 |
+
$login_form_bg_settings_box( $settings );
|
87 |
+
|
88 |
+
$login_form_label_settings_box = require_once __DIR__ . '/setting-boxes/login-form-label-settings.php';
|
89 |
+
$login_form_label_settings_box( $settings );
|
90 |
+
|
91 |
+
$login_form_input_settings_box = require_once __DIR__ . '/setting-boxes/login-form-input-settings.php';
|
92 |
+
$login_form_input_settings_box( $settings );
|
93 |
+
|
94 |
+
$login_form_button_settings_box = require_once __DIR__ . '/setting-boxes/login-form-button-settings.php';
|
95 |
+
$login_form_button_settings_box( $settings );
|
96 |
+
|
97 |
+
$login_form_link_settings_box = require_once __DIR__ . '/setting-boxes/login-form-link-settings.php';
|
98 |
+
$login_form_link_settings_box( $settings );
|
99 |
+
?>
|
100 |
+
</div>
|
101 |
+
|
102 |
+
<?php
|
103 |
+
$login_footer_link_settings_box = require_once __DIR__ . '/setting-boxes/login-footer-link-settings.php';
|
104 |
+
$login_footer_link_settings_box( $settings );
|
105 |
+
?>
|
106 |
+
</div>
|
107 |
+
|
108 |
+
<div class="cldashboard-form-footer">
|
109 |
+
<div class="cldashboard-submit-area">
|
110 |
+
<button type="submit" class="button button-primary button-larger cldashboard-submit-button">
|
111 |
+
<?php esc_html_e( 'Save All Settings', 'erident-custom-login-and-dashboard' ); ?>
|
112 |
+
</button>
|
113 |
+
<span class="cldashboard-notice cldashboard-submit-notice"></span>
|
114 |
+
</div>
|
115 |
+
<div class="cldashboard-reset-area">
|
116 |
+
<span class="cldashboard-notice cldashboard-reset-notice"></span>
|
117 |
+
<button type="button" class="button button-larger cldashboard-reset-button">
|
118 |
+
<?php esc_html_e( 'Reset Settings', 'erident-custom-login-and-dashboard' ); ?>
|
119 |
+
</button>
|
120 |
+
<button type="button" class="button button-larger cldashboard-load-defaults-button">
|
121 |
+
<?php esc_html_e( 'Load Default Settings', 'erident-custom-login-and-dashboard' ); ?>
|
122 |
+
</button>
|
123 |
+
</div>
|
124 |
+
</div>
|
125 |
+
</form>
|
126 |
+
|
127 |
+
<div class="heatbox-admin-panel cldashboard-tools-panel">
|
128 |
+
<div class="cldashboard-tools-container">
|
129 |
+
|
130 |
+
<?php
|
131 |
+
require_once __DIR__ . '/setting-boxes/export-settings.php';
|
132 |
+
require_once __DIR__ . '/setting-boxes/import-settings.php';
|
133 |
+
?>
|
134 |
+
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
<div class="heatbox-divider"></div>
|
140 |
+
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<div class="heatbox-container heatbox-container-wide heatbox-container-center featured-products">
|
144 |
+
|
145 |
+
<h2><?php _e( 'Check out our other free WordPress products!', 'erident-custom-login-and-dashboard' ); ?></h2>
|
146 |
+
|
147 |
+
<ul class="products">
|
148 |
+
<li class="heatbox">
|
149 |
+
<a href="https://wordpress.org/plugins/ultimate-dashboard/" target="_blank">
|
150 |
+
<img src="<?php echo esc_url( CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL ); ?>/assets/images/ultimate-dashboard.jpg">
|
151 |
+
</a>
|
152 |
+
<div class="heatbox-content">
|
153 |
+
<h3><?php _e( 'Ultimate Dashboard', 'erident-custom-login-and-dashboard' ); ?></h3>
|
154 |
+
<p class="subheadline"><?php _e( 'Fully customize your WordPress Dashboard.', 'erident-custom-login-and-dashboard' ); ?></p>
|
155 |
+
<p><?php _e( 'Ultimate Dashboard is the #1 plugin to create a Custom WordPress Dashboard for you and your clients. It also comes with Multisite Support which makes it the perfect plugin for your WaaS network.', 'erident-custom-login-and-dashboard' ); ?></p>
|
156 |
+
<a href="https://wordpress.org/plugins/ultimate-dashboard/" target="_blank" class="button"><?php _e( 'View Features', 'erident-custom-login-and-dashboard' ); ?></a>
|
157 |
+
</div>
|
158 |
+
</li>
|
159 |
+
<li class="heatbox">
|
160 |
+
<a href="https://wordpress.org/themes/page-builder-framework/" target="_blank">
|
161 |
+
<img src="<?php echo esc_url( CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL ); ?>/assets/images/page-builder-framework.jpg">
|
162 |
+
</a>
|
163 |
+
<div class="heatbox-content">
|
164 |
+
<h3><?php _e( 'Page Builder Framework', 'erident-custom-login-and-dashboard' ); ?></h3>
|
165 |
+
<p class="subheadline"><?php _e( 'The only Theme you\'ll ever need.', 'erident-custom-login-and-dashboard' ); ?></p>
|
166 |
+
<p class="description"><?php _e( 'With its minimalistic design the Page Builder Framework theme is the perfect foundation for your next project. Build blazing fast websites with a theme that is easy to use, lightweight & highly customizable.', 'erident-custom-login-and-dashboard' ); ?></p>
|
167 |
+
<a href="https://wordpress.org/themes/page-builder-framework/" target="_blank" class="button"><?php _e( 'View Features', 'erident-custom-login-and-dashboard' ); ?></a>
|
168 |
+
</div>
|
169 |
+
</li>
|
170 |
+
<li class="heatbox">
|
171 |
+
<a href="https://wordpress.org/plugins/better-admin-bar/" target="_blank">
|
172 |
+
<img src="<?php echo esc_url( CUSTOM_LOGIN_DASHBOARD_PLUGIN_URL ); ?>/assets/images/swift-control.jpg">
|
173 |
+
</a>
|
174 |
+
<div class="heatbox-content">
|
175 |
+
<h3><?php _e( 'Better Admin Bar', 'erident-custom-login-and-dashboard' ); ?></h3>
|
176 |
+
<p class="subheadline"><?php _e( 'Replace the boring WordPress Admin Bar with this!', 'erident-custom-login-and-dashboard' ); ?></p>
|
177 |
+
<p><?php _e( 'Better Admin Bar is the plugin that make your clients love WordPress. It drastically improves the user experience when working with WordPress and allows you to replace the boring WordPress admin bar with your own navigation panel.', 'erident-custom-login-and-dashboard' ); ?></p>
|
178 |
+
<a href="https://wordpress.org/plugins/better-admin-bar/" target="_blank" class="button"><?php _e( 'View Features', 'erident-custom-login-and-dashboard' ); ?></a>
|
179 |
+
</div>
|
180 |
+
</li>
|
181 |
+
</ul>
|
182 |
+
|
183 |
+
<p class="credit"><?php _e( 'Made with ❤ in Aschaffenburg, Germany', 'erident-custom-login-and-dashboard' ); ?></p>
|
184 |
+
|
185 |
+
</div>
|
186 |
+
|
187 |
+
</div>
|
188 |
+
|
189 |
+
<?php
|
190 |
+
};
|
vendor/aristath/ari-color/LICENSE
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
{description}
|
294 |
+
Copyright (C) {year} {fullname}
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
{signature of Ty Coon}, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
vendor/aristath/ari-color/aricolor.php
ADDED
@@ -0,0 +1,1017 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: ariColor
|
4 |
+
* Plugin URI: http://aristath.github.io/ariColor/
|
5 |
+
* Description: A PHP library for color manipulation in WordPress themes and plugins
|
6 |
+
* Author: Aristeides Stathopoulos
|
7 |
+
* Author URI: http://aristeides.com
|
8 |
+
* Version: 1.1.0
|
9 |
+
* Text Domain: aricolor
|
10 |
+
*
|
11 |
+
* GitHub Plugin URI: aristath/ariColor
|
12 |
+
* GitHub Plugin URI: https://github.com/aristath/ariColor
|
13 |
+
*
|
14 |
+
* @package ariColor
|
15 |
+
* @category Core
|
16 |
+
* @author Aristeides Stathopoulos
|
17 |
+
* @copyright Copyright (c) 2016, Aristeides Stathopoulos
|
18 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
19 |
+
* @since 1.0
|
20 |
+
*/
|
21 |
+
|
22 |
+
if ( ! class_exists( 'ariColor' ) ) {
|
23 |
+
/**
|
24 |
+
* The color calculations class.
|
25 |
+
*/
|
26 |
+
class ariColor {
|
27 |
+
|
28 |
+
/**
|
29 |
+
* An array of our instances.
|
30 |
+
*
|
31 |
+
* @static
|
32 |
+
* @access public
|
33 |
+
* @since 1.0.0
|
34 |
+
* @var array
|
35 |
+
*/
|
36 |
+
public static $instances = array();
|
37 |
+
|
38 |
+
/**
|
39 |
+
* The color initially set.
|
40 |
+
*
|
41 |
+
* @access public
|
42 |
+
* @since 1.0.0
|
43 |
+
* @var mixed
|
44 |
+
*/
|
45 |
+
public $color;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* A fallback color in case of failure.
|
49 |
+
*
|
50 |
+
* @access public
|
51 |
+
* @since 1.0.0
|
52 |
+
* @var mixed
|
53 |
+
*/
|
54 |
+
public $fallback = '#ffffff';
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Fallback object from the fallback color.
|
58 |
+
*
|
59 |
+
* @access public
|
60 |
+
* @since 1.0.0
|
61 |
+
* @var object
|
62 |
+
*/
|
63 |
+
public $fallback_obj;
|
64 |
+
|
65 |
+
/**
|
66 |
+
* The mode we're using for this color.
|
67 |
+
*
|
68 |
+
* @access public
|
69 |
+
* @since 1.0.0
|
70 |
+
* @var string
|
71 |
+
*/
|
72 |
+
public $mode = 'hex';
|
73 |
+
|
74 |
+
/**
|
75 |
+
* An array containing all word-colors (white/blue/red etc)
|
76 |
+
* and their corresponding HEX codes.
|
77 |
+
*
|
78 |
+
* @access public
|
79 |
+
* @since 1.0.0
|
80 |
+
* @var array
|
81 |
+
*/
|
82 |
+
public $word_colors = array();
|
83 |
+
|
84 |
+
/**
|
85 |
+
* The hex code of the color.
|
86 |
+
*
|
87 |
+
* @access public
|
88 |
+
* @since 1.0.0
|
89 |
+
* @var string
|
90 |
+
*/
|
91 |
+
public $hex;
|
92 |
+
|
93 |
+
/**
|
94 |
+
* Red value.
|
95 |
+
*
|
96 |
+
* @access public
|
97 |
+
* @since 1.0.0
|
98 |
+
* @var int
|
99 |
+
*/
|
100 |
+
public $red = 0;
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Green value.
|
104 |
+
*
|
105 |
+
* @access public
|
106 |
+
* @since 1.0.0
|
107 |
+
* @var int
|
108 |
+
*/
|
109 |
+
public $green = 0;
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Blue value.
|
113 |
+
*
|
114 |
+
* @access public
|
115 |
+
* @since 1.0.0
|
116 |
+
* @var int
|
117 |
+
*/
|
118 |
+
public $blue = 0;
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Alpha value (min:0, max: 1)
|
122 |
+
*
|
123 |
+
* @access public
|
124 |
+
* @since 1.0.0
|
125 |
+
* @var float
|
126 |
+
*/
|
127 |
+
public $alpha = 1;
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Hue value.
|
131 |
+
*
|
132 |
+
* @access public
|
133 |
+
* @since 1.0.0
|
134 |
+
* @var float
|
135 |
+
*/
|
136 |
+
public $hue;
|
137 |
+
|
138 |
+
/**
|
139 |
+
* Saturation value.
|
140 |
+
*
|
141 |
+
* @access public
|
142 |
+
* @since 1.0.0
|
143 |
+
* @var float
|
144 |
+
*/
|
145 |
+
public $saturation;
|
146 |
+
|
147 |
+
/**
|
148 |
+
* Lightness value.
|
149 |
+
*
|
150 |
+
* @access public
|
151 |
+
* @since 1.0.0
|
152 |
+
* @var float
|
153 |
+
*/
|
154 |
+
public $lightness;
|
155 |
+
|
156 |
+
/**
|
157 |
+
* Chroma value.
|
158 |
+
*
|
159 |
+
* @access public
|
160 |
+
* @since 1.0.0
|
161 |
+
* @var float
|
162 |
+
*/
|
163 |
+
public $chroma;
|
164 |
+
|
165 |
+
/**
|
166 |
+
* An array containing brightnesses.
|
167 |
+
*
|
168 |
+
* @access public
|
169 |
+
* @since 1.0.0
|
170 |
+
* @var array
|
171 |
+
*/
|
172 |
+
public $brightness = array();
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Luminance value.
|
176 |
+
*
|
177 |
+
* @access public
|
178 |
+
* @since 1.0.0
|
179 |
+
* @var float
|
180 |
+
*/
|
181 |
+
public $luminance;
|
182 |
+
|
183 |
+
/**
|
184 |
+
* The class constructor.
|
185 |
+
*
|
186 |
+
* @access protected
|
187 |
+
* @since 1.0.0
|
188 |
+
* @param string|array $color The color.
|
189 |
+
* @param string $mode The color mode. Leave empty to auto-detect.
|
190 |
+
*/
|
191 |
+
protected function __construct( $color = '', $mode = 'auto' ) {
|
192 |
+
$this->color = $color;
|
193 |
+
|
194 |
+
if ( is_array( $color ) && isset( $color['fallback'] ) ) {
|
195 |
+
$this->fallback = $color['fallback'];
|
196 |
+
$this->fallback_obj = self::newColor( $this->fallback );
|
197 |
+
}
|
198 |
+
|
199 |
+
if ( ! method_exists( $this, 'from_' . $mode ) ) {
|
200 |
+
$mode = $this->get_mode( $color );
|
201 |
+
}
|
202 |
+
|
203 |
+
$this->mode = $mode;
|
204 |
+
|
205 |
+
if ( ! $mode ) {
|
206 |
+
return;
|
207 |
+
}
|
208 |
+
|
209 |
+
$this->mode = $mode;
|
210 |
+
$method = 'from_' . $mode;
|
211 |
+
// Call the from_{$color_mode} method.
|
212 |
+
$this->$method();
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Gets an instance for this color.
|
217 |
+
* We use a separate instance per color
|
218 |
+
* because there's no need to create a completely new instance each time we call this class.
|
219 |
+
* Instead using instances helps us improve performance & footprint.
|
220 |
+
*
|
221 |
+
* @static
|
222 |
+
* @access public
|
223 |
+
* @since 1.0.0
|
224 |
+
* @param string|array $color The color.
|
225 |
+
* @param string $mode Mode to be used.
|
226 |
+
* @return ariColor (object)
|
227 |
+
*/
|
228 |
+
public static function newColor( $color, $mode = 'auto' ) {
|
229 |
+
|
230 |
+
// Get an md5 for this color.
|
231 |
+
$color_md5 = ( is_array( $color ) ) ? md5( json_encode( $color ) . $mode ) : md5( $color . $mode );
|
232 |
+
// Set the instance if it does not already exist.
|
233 |
+
if ( ! isset( self::$instances[ $color_md5 ] ) ) {
|
234 |
+
self::$instances[ $color_md5 ] = new self( $color, $mode );
|
235 |
+
}
|
236 |
+
return self::$instances[ $color_md5 ];
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Alias of the newColor method.
|
241 |
+
*
|
242 |
+
* @static
|
243 |
+
* @access public
|
244 |
+
* @since 1.1
|
245 |
+
* @param string|array $color The color.
|
246 |
+
* @param string $mode Mode to be used.
|
247 |
+
* @return ariColor (object)
|
248 |
+
*/
|
249 |
+
public static function new_color( $color, $mode = 'auto' ) {
|
250 |
+
return self::newColor( $color, $mode );
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Allows us to get a new instance by modifying a property of the existing one.
|
255 |
+
*
|
256 |
+
* @access public
|
257 |
+
* @since 1.0.0
|
258 |
+
* @param string $property Can be one of the following:
|
259 |
+
* red,
|
260 |
+
* green,
|
261 |
+
* blue,
|
262 |
+
* alpha,
|
263 |
+
* hue,
|
264 |
+
* saturation,
|
265 |
+
* lightness,
|
266 |
+
* brightness.
|
267 |
+
* @param int|float|string $value The new value.
|
268 |
+
* @return ariColor|null
|
269 |
+
*/
|
270 |
+
public function getNew( $property = '', $value = '' ) {
|
271 |
+
|
272 |
+
if ( in_array( $property, array( 'red', 'green', 'blue', 'alpha' ), true ) ) {
|
273 |
+
// Check if we're changing any of the rgba values.
|
274 |
+
$value = max( 0, min( 255, $value ) );
|
275 |
+
if ( 'red' === $property ) {
|
276 |
+
return self::new_color( 'rgba(' . $value . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' );
|
277 |
+
} elseif ( 'green' === $property ) {
|
278 |
+
return self::new_color( 'rgba(' . $this->red . ',' . $value . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' );
|
279 |
+
} elseif ( 'blue' === $property ) {
|
280 |
+
return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $value . ',' . $this->alpha . ')', 'rgba' );
|
281 |
+
} elseif ( 'alpha' === $property ) {
|
282 |
+
return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $value . ')', 'rgba' );
|
283 |
+
}
|
284 |
+
} elseif ( in_array( $property, array( 'hue', 'saturation', 'lightness' ), true ) ) {
|
285 |
+
// Check if we're changing any of the hsl values.
|
286 |
+
$value = ( 'hue' === $property ) ? max( 0, min( 360, $value ) ) : max( 0, min( 100, $value ) );
|
287 |
+
|
288 |
+
if ( 'hue' === $property ) {
|
289 |
+
return self::new_color( 'hsla(' . $value . ',' . $this->saturation . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
|
290 |
+
} elseif ( 'saturation' === $property ) {
|
291 |
+
return self::new_color( 'hsla(' . $this->hue . ',' . $value . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
|
292 |
+
} elseif ( 'lightness' === $property ) {
|
293 |
+
return self::new_color( 'hsla(' . $this->hue . ',' . $this->saturation . '%,' . $value . '%,' . $this->alpha . ')', 'hsla' );
|
294 |
+
}
|
295 |
+
} elseif ( 'brightness' === $property ) {
|
296 |
+
// Check if we're changing the brightness.
|
297 |
+
if ( $value < $this->brightness['total'] ) {
|
298 |
+
$red = max( 0, min( 255, $this->red - ( $this->brightness['total'] - $value ) ) );
|
299 |
+
$green = max( 0, min( 255, $this->green - ( $this->brightness['total'] - $value ) ) );
|
300 |
+
$blue = max( 0, min( 255, $this->blue - ( $this->brightness['total'] - $value ) ) );
|
301 |
+
} elseif ( $value > $this->brightness['total'] ) {
|
302 |
+
$red = max( 0, min( 255, $this->red + ( $value - $this->brightness['total'] ) ) );
|
303 |
+
$green = max( 0, min( 255, $this->green + ( $value - $this->brightness['total'] ) ) );
|
304 |
+
$blue = max( 0, min( 255, $this->blue + ( $value - $this->brightness['total'] ) ) );
|
305 |
+
} else {
|
306 |
+
// If it's not smaller and it's not greater, then it's equal.
|
307 |
+
return $this;
|
308 |
+
}
|
309 |
+
return self::new_color( 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $this->alpha . ')', 'rgba' );
|
310 |
+
}
|
311 |
+
return null;
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Allias for the getNew method.
|
316 |
+
*
|
317 |
+
* @access public
|
318 |
+
* @since 1.1.0
|
319 |
+
* @param string $property Can be one of the following:
|
320 |
+
* red,
|
321 |
+
* green,
|
322 |
+
* blue,
|
323 |
+
* alpha,
|
324 |
+
* hue,
|
325 |
+
* saturation,
|
326 |
+
* lightness,
|
327 |
+
* brightness.
|
328 |
+
* @param int|float|string $value The new value.
|
329 |
+
* @return ariColor|null
|
330 |
+
*/
|
331 |
+
public function get_new( $property = '', $value = '' ) {
|
332 |
+
return $this->getNew( $property, $value );
|
333 |
+
}
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Figure out what mode we're using.
|
337 |
+
*
|
338 |
+
* @access public
|
339 |
+
* @since 1.0.0
|
340 |
+
* @param string|array $color The color we're querying.
|
341 |
+
* @return string
|
342 |
+
*/
|
343 |
+
public function get_mode( $color ) {
|
344 |
+
|
345 |
+
// Check if value is an array.
|
346 |
+
if ( is_array( $color ) ) {
|
347 |
+
// Does the array have an 'rgba' key?
|
348 |
+
if ( isset( $color['rgba'] ) ) {
|
349 |
+
$this->color = $color['rgba'];
|
350 |
+
return 'rgba';
|
351 |
+
} elseif ( isset( $color['color'] ) ) {
|
352 |
+
// Does the array have a 'color' key?
|
353 |
+
$this->color = $color['color'];
|
354 |
+
if ( is_string( $color['color'] ) && false !== strpos( $color['color'], 'rgba' ) ) {
|
355 |
+
return 'rgba';
|
356 |
+
}
|
357 |
+
return 'hex';
|
358 |
+
}
|
359 |
+
// Is this a simple array with 4 items?
|
360 |
+
if ( 4 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) && isset( $color[3] ) ) {
|
361 |
+
$this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',' . intval( $color[3] ) . ')';
|
362 |
+
return 'rgba';
|
363 |
+
} elseif ( 3 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) ) {
|
364 |
+
// Is this a simple array with 3 items?
|
365 |
+
$this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',1)';
|
366 |
+
return 'rgba';
|
367 |
+
}
|
368 |
+
|
369 |
+
// Check for other keys in the array and get values from there.
|
370 |
+
$finders_keepers = array(
|
371 |
+
'r' => 'red',
|
372 |
+
'g' => 'green',
|
373 |
+
'b' => 'blue',
|
374 |
+
'a' => 'alpha',
|
375 |
+
'red' => 'red',
|
376 |
+
'green' => 'green',
|
377 |
+
'blue' => 'blue',
|
378 |
+
'alpha' => 'alpha',
|
379 |
+
'opacity' => 'alpha',
|
380 |
+
);
|
381 |
+
$found = false;
|
382 |
+
foreach ( $finders_keepers as $finder => $keeper ) {
|
383 |
+
if ( isset( $color[ $finder ] ) ) {
|
384 |
+
$found = true;
|
385 |
+
$this->$keeper = $color[ $finder ];
|
386 |
+
}
|
387 |
+
}
|
388 |
+
|
389 |
+
// We failed, use fallback.
|
390 |
+
if ( ! $found ) {
|
391 |
+
$this->from_fallback();
|
392 |
+
return $this->mode;
|
393 |
+
}
|
394 |
+
|
395 |
+
// We did not fail, so use rgba values recovered above.
|
396 |
+
$this->color = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')';
|
397 |
+
return 'rgba';
|
398 |
+
}
|
399 |
+
|
400 |
+
$color = trim( strtolower( $color ) );
|
401 |
+
|
402 |
+
if ( 'transparent' === $color ) {
|
403 |
+
$color = 'rgba(255,255,255,0)';
|
404 |
+
$this->color = $color;
|
405 |
+
}
|
406 |
+
|
407 |
+
// If the color contains 3 or 6 hex numbers, prepend #.
|
408 |
+
if ( preg_match( '|^([0-9a-f]{3}){1,2}$|', $color ) ) {
|
409 |
+
$color = '#' . $color;
|
410 |
+
$this->color = $color;
|
411 |
+
}
|
412 |
+
|
413 |
+
// If we got this far, it's not an array.
|
414 |
+
// Check for key identifiers in the value.
|
415 |
+
$finders_keepers = array(
|
416 |
+
'#' => 'hex',
|
417 |
+
'rgba' => 'rgba',
|
418 |
+
'rgb' => 'rgb',
|
419 |
+
'hsla' => 'hsla',
|
420 |
+
'hsl' => 'hsl',
|
421 |
+
);
|
422 |
+
foreach ( $finders_keepers as $finder => $keeper ) {
|
423 |
+
if ( false !== strrpos( $color, $finder ) ) {
|
424 |
+
|
425 |
+
// Make sure hex colors have 6 digits and not more.
|
426 |
+
if ( '#' === $finder && 7 < strlen( $color ) ) {
|
427 |
+
$this->color = substr( $color, 0, 7 );
|
428 |
+
}
|
429 |
+
|
430 |
+
return $keeper;
|
431 |
+
}
|
432 |
+
}
|
433 |
+
// Perhaps we're using a word like "orange"?
|
434 |
+
$wordcolors = $this->get_word_colors();
|
435 |
+
if ( array_key_exists( $color, $wordcolors ) ) {
|
436 |
+
$this->color = '#' . $wordcolors[ $color ];
|
437 |
+
return 'hex';
|
438 |
+
}
|
439 |
+
// Fallback to hex.
|
440 |
+
|
441 |
+
$this->color = $this->fallback;
|
442 |
+
return 'hex';
|
443 |
+
}
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Sanitize a hex color.
|
447 |
+
*
|
448 |
+
* @param string $color The color we want to sanitize.
|
449 |
+
* @return string
|
450 |
+
*/
|
451 |
+
protected function sanitize_hex_color( $color ) {
|
452 |
+
$color = '#' . ltrim( $color, '#' );
|
453 |
+
if ( '#' === $color ) {
|
454 |
+
return '';
|
455 |
+
}
|
456 |
+
// 3 or 6 hex digits, or the empty string.
|
457 |
+
if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
|
458 |
+
return $color;
|
459 |
+
}
|
460 |
+
return '';
|
461 |
+
}
|
462 |
+
|
463 |
+
/**
|
464 |
+
* Starts with a HEX color and calculates all other properties.
|
465 |
+
*
|
466 |
+
* @access protected
|
467 |
+
* @since 1.0.0
|
468 |
+
* @return void
|
469 |
+
*/
|
470 |
+
protected function from_hex() {
|
471 |
+
|
472 |
+
// Is this perhaps a word-color?
|
473 |
+
$word_colors = $this->get_word_colors();
|
474 |
+
if ( array_key_exists( $this->color, $word_colors ) ) {
|
475 |
+
$this->color = '#' . $word_colors[ $this->color ];
|
476 |
+
}
|
477 |
+
// Sanitize color.
|
478 |
+
$this->hex = $this->sanitize_hex_color( $this->color );
|
479 |
+
$hex = ltrim( $this->hex, '#' );
|
480 |
+
|
481 |
+
// Fallback if needed.
|
482 |
+
if ( ! $hex || 3 > strlen( $hex ) ) {
|
483 |
+
$this->from_fallback();
|
484 |
+
return;
|
485 |
+
}
|
486 |
+
// Make sure we have 6 digits for the below calculations.
|
487 |
+
if ( 3 === strlen( $hex ) ) {
|
488 |
+
$hex = ltrim( $this->hex, '#' );
|
489 |
+
$hex = substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 2, 1 ) . substr( $hex, 2, 1 );
|
490 |
+
}
|
491 |
+
|
492 |
+
// Set red, green, blue.
|
493 |
+
$this->red = hexdec( substr( $hex, 0, 2 ) );
|
494 |
+
$this->green = hexdec( substr( $hex, 2, 2 ) );
|
495 |
+
$this->blue = hexdec( substr( $hex, 4, 2 ) );
|
496 |
+
$this->alpha = 1;
|
497 |
+
// Set other color properties.
|
498 |
+
$this->set_brightness();
|
499 |
+
$this->set_hsl();
|
500 |
+
$this->set_luminance();
|
501 |
+
|
502 |
+
}
|
503 |
+
|
504 |
+
/**
|
505 |
+
* Starts with an RGB color and calculates all other properties.
|
506 |
+
*
|
507 |
+
* @access protected
|
508 |
+
* @since 1.0.0
|
509 |
+
* @return void
|
510 |
+
*/
|
511 |
+
protected function from_rgb() {
|
512 |
+
$value = explode( ',', str_replace( array( ' ', 'rgb', '(', ')' ), '', $this->color ) );
|
513 |
+
// Set red, green, blue.
|
514 |
+
$this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255;
|
515 |
+
$this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255;
|
516 |
+
$this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255;
|
517 |
+
$this->alpha = 1;
|
518 |
+
// Set the hex.
|
519 |
+
$this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
|
520 |
+
// Set other color properties.
|
521 |
+
$this->set_brightness();
|
522 |
+
$this->set_hsl();
|
523 |
+
$this->set_luminance();
|
524 |
+
}
|
525 |
+
|
526 |
+
/**
|
527 |
+
* Starts with an RGBA color and calculates all other properties.
|
528 |
+
*
|
529 |
+
* @access protected
|
530 |
+
* @since 1.0.0
|
531 |
+
* @return void
|
532 |
+
*/
|
533 |
+
protected function from_rgba() {
|
534 |
+
// Set r, g, b, a properties.
|
535 |
+
$value = explode( ',', str_replace( array( ' ', 'rgba', '(', ')' ), '', $this->color ) );
|
536 |
+
$this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255;
|
537 |
+
$this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255;
|
538 |
+
$this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255;
|
539 |
+
$this->alpha = ( isset( $value[3] ) ) ? filter_var( $value[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : 1;
|
540 |
+
// Limit values in the range of 0 - 255.
|
541 |
+
$this->red = max( 0, min( 255, $this->red ) );
|
542 |
+
$this->green = max( 0, min( 255, $this->green ) );
|
543 |
+
$this->blue = max( 0, min( 255, $this->blue ) );
|
544 |
+
// Limit values 0 - 1.
|
545 |
+
$this->alpha = max( 0, min( 1, $this->alpha ) );
|
546 |
+
// Set hex.
|
547 |
+
$this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
|
548 |
+
// Set other color properties.
|
549 |
+
$this->set_brightness();
|
550 |
+
$this->set_hsl();
|
551 |
+
$this->set_luminance();
|
552 |
+
}
|
553 |
+
|
554 |
+
/**
|
555 |
+
* Starts with an HSL color and calculates all other properties.
|
556 |
+
*
|
557 |
+
* @access protected
|
558 |
+
* @since 1.0.0
|
559 |
+
* @return void
|
560 |
+
*/
|
561 |
+
protected function from_hsl() {
|
562 |
+
$value = explode( ',', str_replace( array( ' ', 'hsl', '(', ')', '%' ), '', $this->color ) );
|
563 |
+
$this->hue = $value[0];
|
564 |
+
$this->saturation = $value[1];
|
565 |
+
$this->lightness = $value[2];
|
566 |
+
$this->from_hsl_array();
|
567 |
+
}
|
568 |
+
|
569 |
+
/**
|
570 |
+
* Starts with an HSLA color and calculates all other properties.
|
571 |
+
*
|
572 |
+
* @access protected
|
573 |
+
* @since 1.0.0
|
574 |
+
* @return void
|
575 |
+
*/
|
576 |
+
protected function from_hsla() {
|
577 |
+
$value = explode( ',', str_replace( array( ' ', 'hsla', '(', ')', '%' ), '', $this->color ) );
|
578 |
+
$this->hue = $value[0];
|
579 |
+
$this->saturation = $value[1];
|
580 |
+
$this->lightness = $value[2];
|
581 |
+
$this->alpha = $value[3];
|
582 |
+
$this->from_hsl_array();
|
583 |
+
}
|
584 |
+
|
585 |
+
/**
|
586 |
+
* Generates the HEX value of a color given values for $red, $green, $blue.
|
587 |
+
*
|
588 |
+
* @access protected
|
589 |
+
* @since 1.0.0
|
590 |
+
* @param int|string $red The red value of this color.
|
591 |
+
* @param int|string $green The green value of this color.
|
592 |
+
* @param int|string $blue The blue value of this color.
|
593 |
+
* @return string
|
594 |
+
*/
|
595 |
+
protected function rgb_to_hex( $red, $green, $blue ) {
|
596 |
+
// Get hex values properly formatted.
|
597 |
+
$hex_red = $this->dexhex_double_digit( $red );
|
598 |
+
$hex_green = $this->dexhex_double_digit( $green );
|
599 |
+
$hex_blue = $this->dexhex_double_digit( $blue );
|
600 |
+
return '#' . $hex_red . $hex_green . $hex_blue;
|
601 |
+
}
|
602 |
+
|
603 |
+
/**
|
604 |
+
* Convert a decimal value to hex and make sure it's 2 characters.
|
605 |
+
*
|
606 |
+
* @access protected
|
607 |
+
* @since 1.0.0
|
608 |
+
* @param int|string $value The value to convert.
|
609 |
+
* @return string
|
610 |
+
*/
|
611 |
+
protected function dexhex_double_digit( $value ) {
|
612 |
+
$value = dechex( $value );
|
613 |
+
if ( 1 === strlen( $value ) ) {
|
614 |
+
$value = '0' . $value;
|
615 |
+
}
|
616 |
+
return $value;
|
617 |
+
}
|
618 |
+
|
619 |
+
/**
|
620 |
+
* Calculates the red, green, blue values of an HSL color.
|
621 |
+
*
|
622 |
+
* @access protected
|
623 |
+
* @since 1.0.0
|
624 |
+
* @see https://gist.github.com/brandonheyer/5254516
|
625 |
+
*/
|
626 |
+
protected function from_hsl_array() {
|
627 |
+
$h = $this->hue / 360;
|
628 |
+
$s = $this->saturation / 100;
|
629 |
+
$l = $this->lightness / 100;
|
630 |
+
|
631 |
+
$r = $l;
|
632 |
+
$g = $l;
|
633 |
+
$b = $l;
|
634 |
+
$v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s );
|
635 |
+
if ( $v > 0 ) {
|
636 |
+
$m = $l + $l - $v;
|
637 |
+
$sv = ( $v - $m ) / $v;
|
638 |
+
$h *= 6.0;
|
639 |
+
$sextant = floor( $h );
|
640 |
+
$fract = $h - $sextant;
|
641 |
+
$vsf = $v * $sv * $fract;
|
642 |
+
$mid1 = $m + $vsf;
|
643 |
+
$mid2 = $v - $vsf;
|
644 |
+
switch ( $sextant ) {
|
645 |
+
case 0:
|
646 |
+
$r = $v;
|
647 |
+
$g = $mid1;
|
648 |
+
$b = $m;
|
649 |
+
break;
|
650 |
+
case 1:
|
651 |
+
$r = $mid2;
|
652 |
+
$g = $v;
|
653 |
+
$b = $m;
|
654 |
+
break;
|
655 |
+
case 2:
|
656 |
+
$r = $m;
|
657 |
+
$g = $v;
|
658 |
+
$b = $mid1;
|
659 |
+
break;
|
660 |
+
case 3:
|
661 |
+
$r = $m;
|
662 |
+
$g = $mid2;
|
663 |
+
$b = $v;
|
664 |
+
break;
|
665 |
+
case 4:
|
666 |
+
$r = $mid1;
|
667 |
+
$g = $m;
|
668 |
+
$b = $v;
|
669 |
+
break;
|
670 |
+
case 5:
|
671 |
+
$r = $v;
|
672 |
+
$g = $m;
|
673 |
+
$b = $mid2;
|
674 |
+
break;
|
675 |
+
}
|
676 |
+
}
|
677 |
+
$this->red = round( $r * 255, 0 );
|
678 |
+
$this->green = round( $g * 255, 0 );
|
679 |
+
$this->blue = round( $b * 255, 0 );
|
680 |
+
|
681 |
+
$this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
|
682 |
+
$this->set_luminance();
|
683 |
+
}
|
684 |
+
|
685 |
+
/**
|
686 |
+
* Returns a CSS-formatted value for colors.
|
687 |
+
*
|
688 |
+
* @access public
|
689 |
+
* @since 1.0.0
|
690 |
+
* @param string $mode The mode we're using.
|
691 |
+
* @return string
|
692 |
+
*/
|
693 |
+
public function toCSS( $mode = 'hex' ) {
|
694 |
+
|
695 |
+
$value = '';
|
696 |
+
|
697 |
+
switch ( $mode ) {
|
698 |
+
case 'hex':
|
699 |
+
$value = strtolower( $this->hex );
|
700 |
+
break;
|
701 |
+
case 'rgba':
|
702 |
+
$value = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')';
|
703 |
+
break;
|
704 |
+
case 'rgb':
|
705 |
+
$value = 'rgb(' . $this->red . ',' . $this->green . ',' . $this->blue . ')';
|
706 |
+
break;
|
707 |
+
case 'hsl':
|
708 |
+
$value = 'hsl(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%)';
|
709 |
+
break;
|
710 |
+
case 'hsla':
|
711 |
+
$value = 'hsla(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%,' . $this->alpha . ')';
|
712 |
+
break;
|
713 |
+
}
|
714 |
+
return $value;
|
715 |
+
}
|
716 |
+
|
717 |
+
/**
|
718 |
+
* Alias for the toCSS method.
|
719 |
+
*
|
720 |
+
* @access public
|
721 |
+
* @since 1.1
|
722 |
+
* @param string $mode The mode we're using.
|
723 |
+
* @return string
|
724 |
+
*/
|
725 |
+
public function to_css( $mode = 'hex' ) {
|
726 |
+
return $this->toCSS( $mode );
|
727 |
+
}
|
728 |
+
|
729 |
+
/**
|
730 |
+
* Sets the HSL values of a color based on the values of red, green, blue.
|
731 |
+
*
|
732 |
+
* @access public
|
733 |
+
* @since 1.0.0
|
734 |
+
*/
|
735 |
+
protected function set_hsl() {
|
736 |
+
$red = $this->red / 255;
|
737 |
+
$green = $this->green / 255;
|
738 |
+
$blue = $this->blue / 255;
|
739 |
+
|
740 |
+
$max = max( $red, $green, $blue );
|
741 |
+
$min = min( $red, $green, $blue );
|
742 |
+
|
743 |
+
$lightness = ( $max + $min ) / 2;
|
744 |
+
$difference = $max - $min;
|
745 |
+
|
746 |
+
if ( ! $difference ) {
|
747 |
+
$hue = $saturation = 0; // Achromatic.
|
748 |
+
} else {
|
749 |
+
$saturation = $difference / ( 1 - abs( 2 * $lightness - 1 ) );
|
750 |
+
switch ( $max ) {
|
751 |
+
case $red:
|
752 |
+
$hue = 60 * fmod( ( ( $green - $blue ) / $difference ), 6 );
|
753 |
+
if ( $blue > $green ) {
|
754 |
+
$hue += 360;
|
755 |
+
}
|
756 |
+
break;
|
757 |
+
case $green:
|
758 |
+
$hue = 60 * ( ( $blue - $red ) / $difference + 2 );
|
759 |
+
break;
|
760 |
+
case $blue:
|
761 |
+
$hue = 60 * ( ( $red - $green ) / $difference + 4 );
|
762 |
+
break;
|
763 |
+
}
|
764 |
+
}
|
765 |
+
|
766 |
+
$this->hue = round( $hue );
|
767 |
+
$this->saturation = round( $saturation * 100 );
|
768 |
+
$this->lightness = round( $lightness * 100 );
|
769 |
+
}
|
770 |
+
|
771 |
+
/**
|
772 |
+
* Sets the brightness of a color based on the values of red, green, blue.
|
773 |
+
*
|
774 |
+
* @access protected
|
775 |
+
* @since 1.0.0
|
776 |
+
*/
|
777 |
+
protected function set_brightness() {
|
778 |
+
$this->brightness = array(
|
779 |
+
'red' => round( $this->red * .299 ),
|
780 |
+
'green' => round( $this->green * .587 ),
|
781 |
+
'blue' => round( $this->blue * .114 ),
|
782 |
+
'total' => intval( ( $this->red * .299 ) + ( $this->green * .587 ) + ( $this->blue * .114 ) ),
|
783 |
+
);
|
784 |
+
}
|
785 |
+
|
786 |
+
/**
|
787 |
+
* Sets the luminance of a color (range:0-255) based on the values of red, green, blue.
|
788 |
+
*
|
789 |
+
* @access protected
|
790 |
+
* @since 1.0.0
|
791 |
+
*/
|
792 |
+
protected function set_luminance() {
|
793 |
+
$lum = ( 0.2126 * $this->red ) + ( 0.7152 * $this->green ) + ( 0.0722 * $this->blue );
|
794 |
+
$this->luminance = round( $lum );
|
795 |
+
}
|
796 |
+
|
797 |
+
/**
|
798 |
+
* Gets an array of all the wordcolors.
|
799 |
+
*
|
800 |
+
* @access protected
|
801 |
+
* @since 1.0.0
|
802 |
+
* @return array
|
803 |
+
*/
|
804 |
+
protected function get_word_colors() {
|
805 |
+
return array(
|
806 |
+
'aliceblue' => 'F0F8FF',
|
807 |
+
'antiquewhite' => 'FAEBD7',
|
808 |
+
'aqua' => '00FFFF',
|
809 |
+
'aquamarine' => '7FFFD4',
|
810 |
+
'azure' => 'F0FFFF',
|
811 |
+
'beige' => 'F5F5DC',
|
812 |
+
'bisque' => 'FFE4C4',
|
813 |
+
'black' => '000000',
|
814 |
+
'blanchedalmond' => 'FFEBCD',
|
815 |
+
'blue' => '0000FF',
|
816 |
+
'blueviolet' => '8A2BE2',
|
817 |
+
'brown' => 'A52A2A',
|
818 |
+
'burlywood' => 'DEB887',
|
819 |
+
'cadetblue' => '5F9EA0',
|
820 |
+
'chartreuse' => '7FFF00',
|
821 |
+
'chocolate' => 'D2691E',
|
822 |
+
'coral' => 'FF7F50',
|
823 |
+
'cornflowerblue' => '6495ED',
|
824 |
+
'cornsilk' => 'FFF8DC',
|
825 |
+
'crimson' => 'DC143C',
|
826 |
+
'cyan' => '00FFFF',
|
827 |
+
'darkblue' => '00008B',
|
828 |
+
'darkcyan' => '008B8B',
|
829 |
+
'darkgoldenrod' => 'B8860B',
|
830 |
+
'darkgray' => 'A9A9A9',
|
831 |
+
'darkgreen' => '006400',
|
832 |
+
'darkgrey' => 'A9A9A9',
|
833 |
+
'darkkhaki' => 'BDB76B',
|
834 |
+
'darkmagenta' => '8B008B',
|
835 |
+
'darkolivegreen' => '556B2F',
|
836 |
+
'darkorange' => 'FF8C00',
|
837 |
+
'darkorchid' => '9932CC',
|
838 |
+
'darkred' => '8B0000',
|
839 |
+
'darksalmon' => 'E9967A',
|
840 |
+
'darkseagreen' => '8FBC8F',
|
841 |
+
'darkslateblue' => '483D8B',
|
842 |
+
'darkslategray' => '2F4F4F',
|
843 |
+
'darkslategrey' => '2F4F4F',
|
844 |
+
'darkturquoise' => '00CED1',
|
845 |
+
'darkviolet' => '9400D3',
|
846 |
+
'deeppink' => 'FF1493',
|
847 |
+
'deepskyblue' => '00BFFF',
|
848 |
+
'dimgray' => '696969',
|
849 |
+
'dimgrey' => '696969',
|
850 |
+
'dodgerblue' => '1E90FF',
|
851 |
+
'firebrick' => 'B22222',
|
852 |
+
'floralwhite' => 'FFFAF0',
|
853 |
+
'forestgreen' => '228B22',
|
854 |
+
'fuchsia' => 'FF00FF',
|
855 |
+
'gainsboro' => 'DCDCDC',
|
856 |
+
'ghostwhite' => 'F8F8FF',
|
857 |
+
'gold' => 'FFD700',
|
858 |
+
'goldenrod' => 'DAA520',
|
859 |
+
'gray' => '808080',
|
860 |
+
'green' => '008000',
|
861 |
+
'greenyellow' => 'ADFF2F',
|
862 |
+
'grey' => '808080',
|
863 |
+
'honeydew' => 'F0FFF0',
|
864 |
+
'hotpink' => 'FF69B4',
|
865 |
+
'indianred' => 'CD5C5C',
|
866 |
+
'indigo' => '4B0082',
|
867 |
+
'ivory' => 'FFFFF0',
|
868 |
+
'khaki' => 'F0E68C',
|
869 |
+
'lavender' => 'E6E6FA',
|
870 |
+
'lavenderblush' => 'FFF0F5',
|
871 |
+
'lawngreen' => '7CFC00',
|
872 |
+
'lemonchiffon' => 'FFFACD',
|
873 |
+
'lightblue' => 'ADD8E6',
|
874 |
+
'lightcoral' => 'F08080',
|
875 |
+
'lightcyan' => 'E0FFFF',
|
876 |
+
'lightgoldenrodyellow' => 'FAFAD2',
|
877 |
+
'lightgray' => 'D3D3D3',
|
878 |
+
'lightgreen' => '90EE90',
|
879 |
+
'lightgrey' => 'D3D3D3',
|
880 |
+
'lightpink' => 'FFB6C1',
|
881 |
+
'lightsalmon' => 'FFA07A',
|
882 |
+
'lightseagreen' => '20B2AA',
|
883 |
+
'lightskyblue' => '87CEFA',
|
884 |
+
'lightslategray' => '778899',
|
885 |
+
'lightslategrey' => '778899',
|
886 |
+
'lightsteelblue' => 'B0C4DE',
|
887 |
+
'lightyellow' => 'FFFFE0',
|
888 |
+
'lime' => '00FF00',
|
889 |
+
'limegreen' => '32CD32',
|
890 |
+
'linen' => 'FAF0E6',
|
891 |
+
'magenta' => 'FF00FF',
|
892 |
+
'maroon' => '800000',
|
893 |
+
'mediumaquamarine' => '66CDAA',
|
894 |
+
'mediumblue' => '0000CD',
|
895 |
+
'mediumorchid' => 'BA55D3',
|
896 |
+
'mediumpurple' => '9370D0',
|
897 |
+
'mediumseagreen' => '3CB371',
|
898 |
+
'mediumslateblue' => '7B68EE',
|
899 |
+
'mediumspringgreen' => '00FA9A',
|
900 |
+
'mediumturquoise' => '48D1CC',
|
901 |
+
'mediumvioletred' => 'C71585',
|
902 |
+
'midnightblue' => '191970',
|
903 |
+
'mintcream' => 'F5FFFA',
|
904 |
+
'mistyrose' => 'FFE4E1',
|
905 |
+
'moccasin' => 'FFE4B5',
|
906 |
+
'navajowhite' => 'FFDEAD',
|
907 |
+
'navy' => '000080',
|
908 |
+
'oldlace' => 'FDF5E6',
|
909 |
+
'olive' => '808000',
|
910 |
+
'olivedrab' => '6B8E23',
|
911 |
+
'orange' => 'FFA500',
|
912 |
+
'orangered' => 'FF4500',
|
913 |
+
'orchid' => 'DA70D6',
|
914 |
+
'palegoldenrod' => 'EEE8AA',
|
915 |
+
'palegreen' => '98FB98',
|
916 |
+
'paleturquoise' => 'AFEEEE',
|
917 |
+
'palevioletred' => 'DB7093',
|
918 |
+
'papayawhip' => 'FFEFD5',
|
919 |
+
'peachpuff' => 'FFDAB9',
|
920 |
+
'peru' => 'CD853F',
|
921 |
+
'pink' => 'FFC0CB',
|
922 |
+
'plum' => 'DDA0DD',
|
923 |
+
'powderblue' => 'B0E0E6',
|
924 |
+
'purple' => '800080',
|
925 |
+
'red' => 'FF0000',
|
926 |
+
'rosybrown' => 'BC8F8F',
|
927 |
+
'royalblue' => '4169E1',
|
928 |
+
'saddlebrown' => '8B4513',
|
929 |
+
'salmon' => 'FA8072',
|
930 |
+
'sandybrown' => 'F4A460',
|
931 |
+
'seagreen' => '2E8B57',
|
932 |
+
'seashell' => 'FFF5EE',
|
933 |
+
'sienna' => 'A0522D',
|
934 |
+
'silver' => 'C0C0C0',
|
935 |
+
'skyblue' => '87CEEB',
|
936 |
+
'slateblue' => '6A5ACD',
|
937 |
+
'slategray' => '708090',
|
938 |
+
'slategrey' => '708090',
|
939 |
+
'snow' => 'FFFAFA',
|
940 |
+
'springgreen' => '00FF7F',
|
941 |
+
'steelblue' => '4682B4',
|
942 |
+
'tan' => 'D2B48C',
|
943 |
+
'teal' => '008080',
|
944 |
+
'thistle' => 'D8BFD8',
|
945 |
+
'tomato' => 'FF6347',
|
946 |
+
'turquoise' => '40E0D0',
|
947 |
+
'violet' => 'EE82EE',
|
948 |
+
'wheat' => 'F5DEB3',
|
949 |
+
'white' => 'FFFFFF',
|
950 |
+
'whitesmoke' => 'F5F5F5',
|
951 |
+
'yellow' => 'FFFF00',
|
952 |
+
'yellowgreen' => '9ACD32',
|
953 |
+
);
|
954 |
+
|
955 |
+
}
|
956 |
+
|
957 |
+
/**
|
958 |
+
* Use fallback object.
|
959 |
+
*
|
960 |
+
* @access protected
|
961 |
+
* @since 1.2.0
|
962 |
+
*/
|
963 |
+
protected function from_fallback() {
|
964 |
+
$this->color = $this->fallback;
|
965 |
+
|
966 |
+
if ( ! $this->fallback_obj ) {
|
967 |
+
$this->fallback_obj = self::newColor( $this->fallback );
|
968 |
+
}
|
969 |
+
$this->color = $this->fallback_obj->color;
|
970 |
+
$this->mode = $this->fallback_obj->mode;
|
971 |
+
$this->red = $this->fallback_obj->red;
|
972 |
+
$this->green = $this->fallback_obj->green;
|
973 |
+
$this->blue = $this->fallback_obj->blue;
|
974 |
+
$this->alpha = $this->fallback_obj->alpha;
|
975 |
+
$this->hue = $this->fallback_obj->hue;
|
976 |
+
$this->saturation = $this->fallback_obj->saturation;
|
977 |
+
$this->lightness = $this->fallback_obj->lightness;
|
978 |
+
$this->luminance = $this->fallback_obj->luminance;
|
979 |
+
$this->hex = $this->fallback_obj->hex;
|
980 |
+
}
|
981 |
+
|
982 |
+
/**
|
983 |
+
* Handle non-existing public methods.
|
984 |
+
*
|
985 |
+
* @access public
|
986 |
+
* @since 1.1.0
|
987 |
+
* @param string $name The method name.
|
988 |
+
* @param mixed $arguments The method arguments.
|
989 |
+
* @return mixed
|
990 |
+
*/
|
991 |
+
public function __call( $name, $arguments ) {
|
992 |
+
if ( method_exists( $this, $name ) ) {
|
993 |
+
call_user_func( array( $this, $name ), $arguments );
|
994 |
+
} else {
|
995 |
+
return $arguments;
|
996 |
+
}
|
997 |
+
}
|
998 |
+
|
999 |
+
/**
|
1000 |
+
* Handle non-existing public static methods.
|
1001 |
+
*
|
1002 |
+
* @static
|
1003 |
+
* @access public
|
1004 |
+
* @since 1.1.0
|
1005 |
+
* @param string $name The method name.
|
1006 |
+
* @param mixed $arguments The method arguments.
|
1007 |
+
* @return mixed
|
1008 |
+
*/
|
1009 |
+
public static function __callStatic( $name, $arguments ) {
|
1010 |
+
if ( method_exists( __CLASS__, $name ) ) {
|
1011 |
+
call_user_func( array( __CLASS__, $name ), $arguments );
|
1012 |
+
} else {
|
1013 |
+
return $arguments;
|
1014 |
+
}
|
1015 |
+
}
|
1016 |
+
}
|
1017 |
+
}
|
vendor/autoload.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload.php @generated by Composer
|
4 |
+
|
5 |
+
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
+
|
7 |
+
return ComposerAutoloaderInit2c637ac97dec4158e243822b69b247af::getLoader();
|
vendor/composer/ClassLoader.php
ADDED
@@ -0,0 +1,572 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer\Autoload;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
|
17 |
+
*
|
18 |
+
* $loader = new \Composer\Autoload\ClassLoader();
|
19 |
+
*
|
20 |
+
* // register classes with namespaces
|
21 |
+
* $loader->add('Symfony\Component', __DIR__.'/component');
|
22 |
+
* $loader->add('Symfony', __DIR__.'/framework');
|
23 |
+
*
|
24 |
+
* // activate the autoloader
|
25 |
+
* $loader->register();
|
26 |
+
*
|
27 |
+
* // to enable searching the include path (eg. for PEAR packages)
|
28 |
+
* $loader->setUseIncludePath(true);
|
29 |
+
*
|
30 |
+
* In this example, if you try to use a class in the Symfony\Component
|
31 |
+
* namespace or one of its children (Symfony\Component\Console for instance),
|
32 |
+
* the autoloader will first look for the class under the component/
|
33 |
+
* directory, and it will then fallback to the framework/ directory if not
|
34 |
+
* found before giving up.
|
35 |
+
*
|
36 |
+
* This class is loosely based on the Symfony UniversalClassLoader.
|
37 |
+
*
|
38 |
+
* @author Fabien Potencier <fabien@symfony.com>
|
39 |
+
* @author Jordi Boggiano <j.boggiano@seld.be>
|
40 |
+
* @see https://www.php-fig.org/psr/psr-0/
|
41 |
+
* @see https://www.php-fig.org/psr/psr-4/
|
42 |
+
*/
|
43 |
+
class ClassLoader
|
44 |
+
{
|
45 |
+
/** @var ?string */
|
46 |
+
private $vendorDir;
|
47 |
+
|
48 |
+
// PSR-4
|
49 |
+
/**
|
50 |
+
* @var array[]
|
51 |
+
* @psalm-var array<string, array<string, int>>
|
52 |
+
*/
|
53 |
+
private $prefixLengthsPsr4 = array();
|
54 |
+
/**
|
55 |
+
* @var array[]
|
56 |
+
* @psalm-var array<string, array<int, string>>
|
57 |
+
*/
|
58 |
+
private $prefixDirsPsr4 = array();
|
59 |
+
/**
|
60 |
+
* @var array[]
|
61 |
+
* @psalm-var array<string, string>
|
62 |
+
*/
|
63 |
+
private $fallbackDirsPsr4 = array();
|
64 |
+
|
65 |
+
// PSR-0
|
66 |
+
/**
|
67 |
+
* @var array[]
|
68 |
+
* @psalm-var array<string, array<string, string[]>>
|
69 |
+
*/
|
70 |
+
private $prefixesPsr0 = array();
|
71 |
+
/**
|
72 |
+
* @var array[]
|
73 |
+
* @psalm-var array<string, string>
|
74 |
+
*/
|
75 |
+
private $fallbackDirsPsr0 = array();
|
76 |
+
|
77 |
+
/** @var bool */
|
78 |
+
private $useIncludePath = false;
|
79 |
+
|
80 |
+
/**
|
81 |
+
* @var string[]
|
82 |
+
* @psalm-var array<string, string>
|
83 |
+
*/
|
84 |
+
private $classMap = array();
|
85 |
+
|
86 |
+
/** @var bool */
|
87 |
+
private $classMapAuthoritative = false;
|
88 |
+
|
89 |
+
/**
|
90 |
+
* @var bool[]
|
91 |
+
* @psalm-var array<string, bool>
|
92 |
+
*/
|
93 |
+
private $missingClasses = array();
|
94 |
+
|
95 |
+
/** @var ?string */
|
96 |
+
private $apcuPrefix;
|
97 |
+
|
98 |
+
/**
|
99 |
+
* @var self[]
|
100 |
+
*/
|
101 |
+
private static $registeredLoaders = array();
|
102 |
+
|
103 |
+
/**
|
104 |
+
* @param ?string $vendorDir
|
105 |
+
*/
|
106 |
+
public function __construct($vendorDir = null)
|
107 |
+
{
|
108 |
+
$this->vendorDir = $vendorDir;
|
109 |
+
}
|
110 |
+
|
111 |
+
/**
|
112 |
+
* @return string[]
|
113 |
+
*/
|
114 |
+
public function getPrefixes()
|
115 |
+
{
|
116 |
+
if (!empty($this->prefixesPsr0)) {
|
117 |
+
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
118 |
+
}
|
119 |
+
|
120 |
+
return array();
|
121 |
+
}
|
122 |
+
|
123 |
+
/**
|
124 |
+
* @return array[]
|
125 |
+
* @psalm-return array<string, array<int, string>>
|
126 |
+
*/
|
127 |
+
public function getPrefixesPsr4()
|
128 |
+
{
|
129 |
+
return $this->prefixDirsPsr4;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* @return array[]
|
134 |
+
* @psalm-return array<string, string>
|
135 |
+
*/
|
136 |
+
public function getFallbackDirs()
|
137 |
+
{
|
138 |
+
return $this->fallbackDirsPsr0;
|
139 |
+
}
|
140 |
+
|
141 |
+
/**
|
142 |
+
* @return array[]
|
143 |
+
* @psalm-return array<string, string>
|
144 |
+
*/
|
145 |
+
public function getFallbackDirsPsr4()
|
146 |
+
{
|
147 |
+
return $this->fallbackDirsPsr4;
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* @return string[] Array of classname => path
|
152 |
+
* @psalm-return array<string, string>
|
153 |
+
*/
|
154 |
+
public function getClassMap()
|
155 |
+
{
|
156 |
+
return $this->classMap;
|
157 |
+
}
|
158 |
+
|
159 |
+
/**
|
160 |
+
* @param string[] $classMap Class to filename map
|
161 |
+
* @psalm-param array<string, string> $classMap
|
162 |
+
*
|
163 |
+
* @return void
|
164 |
+
*/
|
165 |
+
public function addClassMap(array $classMap)
|
166 |
+
{
|
167 |
+
if ($this->classMap) {
|
168 |
+
$this->classMap = array_merge($this->classMap, $classMap);
|
169 |
+
} else {
|
170 |
+
$this->classMap = $classMap;
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Registers a set of PSR-0 directories for a given prefix, either
|
176 |
+
* appending or prepending to the ones previously set for this prefix.
|
177 |
+
*
|
178 |
+
* @param string $prefix The prefix
|
179 |
+
* @param string[]|string $paths The PSR-0 root directories
|
180 |
+
* @param bool $prepend Whether to prepend the directories
|
181 |
+
*
|
182 |
+
* @return void
|
183 |
+
*/
|
184 |
+
public function add($prefix, $paths, $prepend = false)
|
185 |
+
{
|
186 |
+
if (!$prefix) {
|
187 |
+
if ($prepend) {
|
188 |
+
$this->fallbackDirsPsr0 = array_merge(
|
189 |
+
(array) $paths,
|
190 |
+
$this->fallbackDirsPsr0
|
191 |
+
);
|
192 |
+
} else {
|
193 |
+
$this->fallbackDirsPsr0 = array_merge(
|
194 |
+
$this->fallbackDirsPsr0,
|
195 |
+
(array) $paths
|
196 |
+
);
|
197 |
+
}
|
198 |
+
|
199 |
+
return;
|
200 |
+
}
|
201 |
+
|
202 |
+
$first = $prefix[0];
|
203 |
+
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
204 |
+
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
205 |
+
|
206 |
+
return;
|
207 |
+
}
|
208 |
+
if ($prepend) {
|
209 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
210 |
+
(array) $paths,
|
211 |
+
$this->prefixesPsr0[$first][$prefix]
|
212 |
+
);
|
213 |
+
} else {
|
214 |
+
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
215 |
+
$this->prefixesPsr0[$first][$prefix],
|
216 |
+
(array) $paths
|
217 |
+
);
|
218 |
+
}
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Registers a set of PSR-4 directories for a given namespace, either
|
223 |
+
* appending or prepending to the ones previously set for this namespace.
|
224 |
+
*
|
225 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
226 |
+
* @param string[]|string $paths The PSR-4 base directories
|
227 |
+
* @param bool $prepend Whether to prepend the directories
|
228 |
+
*
|
229 |
+
* @throws \InvalidArgumentException
|
230 |
+
*
|
231 |
+
* @return void
|
232 |
+
*/
|
233 |
+
public function addPsr4($prefix, $paths, $prepend = false)
|
234 |
+
{
|
235 |
+
if (!$prefix) {
|
236 |
+
// Register directories for the root namespace.
|
237 |
+
if ($prepend) {
|
238 |
+
$this->fallbackDirsPsr4 = array_merge(
|
239 |
+
(array) $paths,
|
240 |
+
$this->fallbackDirsPsr4
|
241 |
+
);
|
242 |
+
} else {
|
243 |
+
$this->fallbackDirsPsr4 = array_merge(
|
244 |
+
$this->fallbackDirsPsr4,
|
245 |
+
(array) $paths
|
246 |
+
);
|
247 |
+
}
|
248 |
+
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
249 |
+
// Register directories for a new namespace.
|
250 |
+
$length = strlen($prefix);
|
251 |
+
if ('\\' !== $prefix[$length - 1]) {
|
252 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
253 |
+
}
|
254 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
255 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
256 |
+
} elseif ($prepend) {
|
257 |
+
// Prepend directories for an already registered namespace.
|
258 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
259 |
+
(array) $paths,
|
260 |
+
$this->prefixDirsPsr4[$prefix]
|
261 |
+
);
|
262 |
+
} else {
|
263 |
+
// Append directories for an already registered namespace.
|
264 |
+
$this->prefixDirsPsr4[$prefix] = array_merge(
|
265 |
+
$this->prefixDirsPsr4[$prefix],
|
266 |
+
(array) $paths
|
267 |
+
);
|
268 |
+
}
|
269 |
+
}
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Registers a set of PSR-0 directories for a given prefix,
|
273 |
+
* replacing any others previously set for this prefix.
|
274 |
+
*
|
275 |
+
* @param string $prefix The prefix
|
276 |
+
* @param string[]|string $paths The PSR-0 base directories
|
277 |
+
*
|
278 |
+
* @return void
|
279 |
+
*/
|
280 |
+
public function set($prefix, $paths)
|
281 |
+
{
|
282 |
+
if (!$prefix) {
|
283 |
+
$this->fallbackDirsPsr0 = (array) $paths;
|
284 |
+
} else {
|
285 |
+
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
|
286 |
+
}
|
287 |
+
}
|
288 |
+
|
289 |
+
/**
|
290 |
+
* Registers a set of PSR-4 directories for a given namespace,
|
291 |
+
* replacing any others previously set for this namespace.
|
292 |
+
*
|
293 |
+
* @param string $prefix The prefix/namespace, with trailing '\\'
|
294 |
+
* @param string[]|string $paths The PSR-4 base directories
|
295 |
+
*
|
296 |
+
* @throws \InvalidArgumentException
|
297 |
+
*
|
298 |
+
* @return void
|
299 |
+
*/
|
300 |
+
public function setPsr4($prefix, $paths)
|
301 |
+
{
|
302 |
+
if (!$prefix) {
|
303 |
+
$this->fallbackDirsPsr4 = (array) $paths;
|
304 |
+
} else {
|
305 |
+
$length = strlen($prefix);
|
306 |
+
if ('\\' !== $prefix[$length - 1]) {
|
307 |
+
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
308 |
+
}
|
309 |
+
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
310 |
+
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
311 |
+
}
|
312 |
+
}
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Turns on searching the include path for class files.
|
316 |
+
*
|
317 |
+
* @param bool $useIncludePath
|
318 |
+
*
|
319 |
+
* @return void
|
320 |
+
*/
|
321 |
+
public function setUseIncludePath($useIncludePath)
|
322 |
+
{
|
323 |
+
$this->useIncludePath = $useIncludePath;
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Can be used to check if the autoloader uses the include path to check
|
328 |
+
* for classes.
|
329 |
+
*
|
330 |
+
* @return bool
|
331 |
+
*/
|
332 |
+
public function getUseIncludePath()
|
333 |
+
{
|
334 |
+
return $this->useIncludePath;
|
335 |
+
}
|
336 |
+
|
337 |
+
/**
|
338 |
+
* Turns off searching the prefix and fallback directories for classes
|
339 |
+
* that have not been registered with the class map.
|
340 |
+
*
|
341 |
+
* @param bool $classMapAuthoritative
|
342 |
+
*
|
343 |
+
* @return void
|
344 |
+
*/
|
345 |
+
public function setClassMapAuthoritative($classMapAuthoritative)
|
346 |
+
{
|
347 |
+
$this->classMapAuthoritative = $classMapAuthoritative;
|
348 |
+
}
|
349 |
+
|
350 |
+
/**
|
351 |
+
* Should class lookup fail if not found in the current class map?
|
352 |
+
*
|
353 |
+
* @return bool
|
354 |
+
*/
|
355 |
+
public function isClassMapAuthoritative()
|
356 |
+
{
|
357 |
+
return $this->classMapAuthoritative;
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
|
362 |
+
*
|
363 |
+
* @param string|null $apcuPrefix
|
364 |
+
*
|
365 |
+
* @return void
|
366 |
+
*/
|
367 |
+
public function setApcuPrefix($apcuPrefix)
|
368 |
+
{
|
369 |
+
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* The APCu prefix in use, or null if APCu caching is not enabled.
|
374 |
+
*
|
375 |
+
* @return string|null
|
376 |
+
*/
|
377 |
+
public function getApcuPrefix()
|
378 |
+
{
|
379 |
+
return $this->apcuPrefix;
|
380 |
+
}
|
381 |
+
|
382 |
+
/**
|
383 |
+
* Registers this instance as an autoloader.
|
384 |
+
*
|
385 |
+
* @param bool $prepend Whether to prepend the autoloader or not
|
386 |
+
*
|
387 |
+
* @return void
|
388 |
+
*/
|
389 |
+
public function register($prepend = false)
|
390 |
+
{
|
391 |
+
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
392 |
+
|
393 |
+
if (null === $this->vendorDir) {
|
394 |
+
return;
|
395 |
+
}
|
396 |
+
|
397 |
+
if ($prepend) {
|
398 |
+
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
399 |
+
} else {
|
400 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
401 |
+
self::$registeredLoaders[$this->vendorDir] = $this;
|
402 |
+
}
|
403 |
+
}
|
404 |
+
|
405 |
+
/**
|
406 |
+
* Unregisters this instance as an autoloader.
|
407 |
+
*
|
408 |
+
* @return void
|
409 |
+
*/
|
410 |
+
public function unregister()
|
411 |
+
{
|
412 |
+
spl_autoload_unregister(array($this, 'loadClass'));
|
413 |
+
|
414 |
+
if (null !== $this->vendorDir) {
|
415 |
+
unset(self::$registeredLoaders[$this->vendorDir]);
|
416 |
+
}
|
417 |
+
}
|
418 |
+
|
419 |
+
/**
|
420 |
+
* Loads the given class or interface.
|
421 |
+
*
|
422 |
+
* @param string $class The name of the class
|
423 |
+
* @return true|null True if loaded, null otherwise
|
424 |
+
*/
|
425 |
+
public function loadClass($class)
|
426 |
+
{
|
427 |
+
if ($file = $this->findFile($class)) {
|
428 |
+
includeFile($file);
|
429 |
+
|
430 |
+
return true;
|
431 |
+
}
|
432 |
+
|
433 |
+
return null;
|
434 |
+
}
|
435 |
+
|
436 |
+
/**
|
437 |
+
* Finds the path to the file where the class is defined.
|
438 |
+
*
|
439 |
+
* @param string $class The name of the class
|
440 |
+
*
|
441 |
+
* @return string|false The path if found, false otherwise
|
442 |
+
*/
|
443 |
+
public function findFile($class)
|
444 |
+
{
|
445 |
+
// class map lookup
|
446 |
+
if (isset($this->classMap[$class])) {
|
447 |
+
return $this->classMap[$class];
|
448 |
+
}
|
449 |
+
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
|
450 |
+
return false;
|
451 |
+
}
|
452 |
+
if (null !== $this->apcuPrefix) {
|
453 |
+
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
|
454 |
+
if ($hit) {
|
455 |
+
return $file;
|
456 |
+
}
|
457 |
+
}
|
458 |
+
|
459 |
+
$file = $this->findFileWithExtension($class, '.php');
|
460 |
+
|
461 |
+
// Search for Hack files if we are running on HHVM
|
462 |
+
if (false === $file && defined('HHVM_VERSION')) {
|
463 |
+
$file = $this->findFileWithExtension($class, '.hh');
|
464 |
+
}
|
465 |
+
|
466 |
+
if (null !== $this->apcuPrefix) {
|
467 |
+
apcu_add($this->apcuPrefix.$class, $file);
|
468 |
+
}
|
469 |
+
|
470 |
+
if (false === $file) {
|
471 |
+
// Remember that this class does not exist.
|
472 |
+
$this->missingClasses[$class] = true;
|
473 |
+
}
|
474 |
+
|
475 |
+
return $file;
|
476 |
+
}
|
477 |
+
|
478 |
+
/**
|
479 |
+
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
480 |
+
*
|
481 |
+
* @return self[]
|
482 |
+
*/
|
483 |
+
public static function getRegisteredLoaders()
|
484 |
+
{
|
485 |
+
return self::$registeredLoaders;
|
486 |
+
}
|
487 |
+
|
488 |
+
/**
|
489 |
+
* @param string $class
|
490 |
+
* @param string $ext
|
491 |
+
* @return string|false
|
492 |
+
*/
|
493 |
+
private function findFileWithExtension($class, $ext)
|
494 |
+
{
|
495 |
+
// PSR-4 lookup
|
496 |
+
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
|
497 |
+
|
498 |
+
$first = $class[0];
|
499 |
+
if (isset($this->prefixLengthsPsr4[$first])) {
|
500 |
+
$subPath = $class;
|
501 |
+
while (false !== $lastPos = strrpos($subPath, '\\')) {
|
502 |
+
$subPath = substr($subPath, 0, $lastPos);
|
503 |
+
$search = $subPath . '\\';
|
504 |
+
if (isset($this->prefixDirsPsr4[$search])) {
|
505 |
+
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
|
506 |
+
foreach ($this->prefixDirsPsr4[$search] as $dir) {
|
507 |
+
if (file_exists($file = $dir . $pathEnd)) {
|
508 |
+
return $file;
|
509 |
+
}
|
510 |
+
}
|
511 |
+
}
|
512 |
+
}
|
513 |
+
}
|
514 |
+
|
515 |
+
// PSR-4 fallback dirs
|
516 |
+
foreach ($this->fallbackDirsPsr4 as $dir) {
|
517 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
|
518 |
+
return $file;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
|
522 |
+
// PSR-0 lookup
|
523 |
+
if (false !== $pos = strrpos($class, '\\')) {
|
524 |
+
// namespaced class name
|
525 |
+
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
|
526 |
+
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
|
527 |
+
} else {
|
528 |
+
// PEAR-like class name
|
529 |
+
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
|
530 |
+
}
|
531 |
+
|
532 |
+
if (isset($this->prefixesPsr0[$first])) {
|
533 |
+
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
|
534 |
+
if (0 === strpos($class, $prefix)) {
|
535 |
+
foreach ($dirs as $dir) {
|
536 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
537 |
+
return $file;
|
538 |
+
}
|
539 |
+
}
|
540 |
+
}
|
541 |
+
}
|
542 |
+
}
|
543 |
+
|
544 |
+
// PSR-0 fallback dirs
|
545 |
+
foreach ($this->fallbackDirsPsr0 as $dir) {
|
546 |
+
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
|
547 |
+
return $file;
|
548 |
+
}
|
549 |
+
}
|
550 |
+
|
551 |
+
// PSR-0 include paths.
|
552 |
+
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
|
553 |
+
return $file;
|
554 |
+
}
|
555 |
+
|
556 |
+
return false;
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* Scope isolated include.
|
562 |
+
*
|
563 |
+
* Prevents access to $this/self from included files.
|
564 |
+
*
|
565 |
+
* @param string $file
|
566 |
+
* @return void
|
567 |
+
* @private
|
568 |
+
*/
|
569 |
+
function includeFile($file)
|
570 |
+
{
|
571 |
+
include $file;
|
572 |
+
}
|
vendor/composer/InstalledVersions.php
ADDED
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of Composer.
|
5 |
+
*
|
6 |
+
* (c) Nils Adermann <naderman@naderman.de>
|
7 |
+
* Jordi Boggiano <j.boggiano@seld.be>
|
8 |
+
*
|
9 |
+
* For the full copyright and license information, please view the LICENSE
|
10 |
+
* file that was distributed with this source code.
|
11 |
+
*/
|
12 |
+
|
13 |
+
namespace Composer;
|
14 |
+
|
15 |
+
use Composer\Autoload\ClassLoader;
|
16 |
+
use Composer\Semver\VersionParser;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* This class is copied in every Composer installed project and available to all
|
20 |
+
*
|
21 |
+
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
|
22 |
+
*
|
23 |
+
* To require its presence, you can require `composer-runtime-api ^2.0`
|
24 |
+
*/
|
25 |
+
class InstalledVersions
|
26 |
+
{
|
27 |
+
/**
|
28 |
+
* @var mixed[]|null
|
29 |
+
* @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}|array{}|null
|
30 |
+
*/
|
31 |
+
private static $installed;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @var bool|null
|
35 |
+
*/
|
36 |
+
private static $canGetVendors;
|
37 |
+
|
38 |
+
/**
|
39 |
+
* @var array[]
|
40 |
+
* @psalm-var array<string, array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
41 |
+
*/
|
42 |
+
private static $installedByVendor = array();
|
43 |
+
|
44 |
+
/**
|
45 |
+
* Returns a list of all package names which are present, either by being installed, replaced or provided
|
46 |
+
*
|
47 |
+
* @return string[]
|
48 |
+
* @psalm-return list<string>
|
49 |
+
*/
|
50 |
+
public static function getInstalledPackages()
|
51 |
+
{
|
52 |
+
$packages = array();
|
53 |
+
foreach (self::getInstalled() as $installed) {
|
54 |
+
$packages[] = array_keys($installed['versions']);
|
55 |
+
}
|
56 |
+
|
57 |
+
if (1 === \count($packages)) {
|
58 |
+
return $packages[0];
|
59 |
+
}
|
60 |
+
|
61 |
+
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Returns a list of all package names with a specific type e.g. 'library'
|
66 |
+
*
|
67 |
+
* @param string $type
|
68 |
+
* @return string[]
|
69 |
+
* @psalm-return list<string>
|
70 |
+
*/
|
71 |
+
public static function getInstalledPackagesByType($type)
|
72 |
+
{
|
73 |
+
$packagesByType = array();
|
74 |
+
|
75 |
+
foreach (self::getInstalled() as $installed) {
|
76 |
+
foreach ($installed['versions'] as $name => $package) {
|
77 |
+
if (isset($package['type']) && $package['type'] === $type) {
|
78 |
+
$packagesByType[] = $name;
|
79 |
+
}
|
80 |
+
}
|
81 |
+
}
|
82 |
+
|
83 |
+
return $packagesByType;
|
84 |
+
}
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Checks whether the given package is installed
|
88 |
+
*
|
89 |
+
* This also returns true if the package name is provided or replaced by another package
|
90 |
+
*
|
91 |
+
* @param string $packageName
|
92 |
+
* @param bool $includeDevRequirements
|
93 |
+
* @return bool
|
94 |
+
*/
|
95 |
+
public static function isInstalled($packageName, $includeDevRequirements = true)
|
96 |
+
{
|
97 |
+
foreach (self::getInstalled() as $installed) {
|
98 |
+
if (isset($installed['versions'][$packageName])) {
|
99 |
+
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
100 |
+
}
|
101 |
+
}
|
102 |
+
|
103 |
+
return false;
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Checks whether the given package satisfies a version constraint
|
108 |
+
*
|
109 |
+
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
|
110 |
+
*
|
111 |
+
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
|
112 |
+
*
|
113 |
+
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
|
114 |
+
* @param string $packageName
|
115 |
+
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
|
116 |
+
* @return bool
|
117 |
+
*/
|
118 |
+
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
119 |
+
{
|
120 |
+
$constraint = $parser->parseConstraints($constraint);
|
121 |
+
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
122 |
+
|
123 |
+
return $provided->matches($constraint);
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Returns a version constraint representing all the range(s) which are installed for a given package
|
128 |
+
*
|
129 |
+
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
|
130 |
+
* whether a given version of a package is installed, and not just whether it exists
|
131 |
+
*
|
132 |
+
* @param string $packageName
|
133 |
+
* @return string Version constraint usable with composer/semver
|
134 |
+
*/
|
135 |
+
public static function getVersionRanges($packageName)
|
136 |
+
{
|
137 |
+
foreach (self::getInstalled() as $installed) {
|
138 |
+
if (!isset($installed['versions'][$packageName])) {
|
139 |
+
continue;
|
140 |
+
}
|
141 |
+
|
142 |
+
$ranges = array();
|
143 |
+
if (isset($installed['versions'][$packageName]['pretty_version'])) {
|
144 |
+
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
|
145 |
+
}
|
146 |
+
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
|
147 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
|
148 |
+
}
|
149 |
+
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
|
150 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
|
151 |
+
}
|
152 |
+
if (array_key_exists('provided', $installed['versions'][$packageName])) {
|
153 |
+
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
|
154 |
+
}
|
155 |
+
|
156 |
+
return implode(' || ', $ranges);
|
157 |
+
}
|
158 |
+
|
159 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
160 |
+
}
|
161 |
+
|
162 |
+
/**
|
163 |
+
* @param string $packageName
|
164 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
165 |
+
*/
|
166 |
+
public static function getVersion($packageName)
|
167 |
+
{
|
168 |
+
foreach (self::getInstalled() as $installed) {
|
169 |
+
if (!isset($installed['versions'][$packageName])) {
|
170 |
+
continue;
|
171 |
+
}
|
172 |
+
|
173 |
+
if (!isset($installed['versions'][$packageName]['version'])) {
|
174 |
+
return null;
|
175 |
+
}
|
176 |
+
|
177 |
+
return $installed['versions'][$packageName]['version'];
|
178 |
+
}
|
179 |
+
|
180 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
181 |
+
}
|
182 |
+
|
183 |
+
/**
|
184 |
+
* @param string $packageName
|
185 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
|
186 |
+
*/
|
187 |
+
public static function getPrettyVersion($packageName)
|
188 |
+
{
|
189 |
+
foreach (self::getInstalled() as $installed) {
|
190 |
+
if (!isset($installed['versions'][$packageName])) {
|
191 |
+
continue;
|
192 |
+
}
|
193 |
+
|
194 |
+
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
|
195 |
+
return null;
|
196 |
+
}
|
197 |
+
|
198 |
+
return $installed['versions'][$packageName]['pretty_version'];
|
199 |
+
}
|
200 |
+
|
201 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
202 |
+
}
|
203 |
+
|
204 |
+
/**
|
205 |
+
* @param string $packageName
|
206 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
|
207 |
+
*/
|
208 |
+
public static function getReference($packageName)
|
209 |
+
{
|
210 |
+
foreach (self::getInstalled() as $installed) {
|
211 |
+
if (!isset($installed['versions'][$packageName])) {
|
212 |
+
continue;
|
213 |
+
}
|
214 |
+
|
215 |
+
if (!isset($installed['versions'][$packageName]['reference'])) {
|
216 |
+
return null;
|
217 |
+
}
|
218 |
+
|
219 |
+
return $installed['versions'][$packageName]['reference'];
|
220 |
+
}
|
221 |
+
|
222 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
223 |
+
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* @param string $packageName
|
227 |
+
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
|
228 |
+
*/
|
229 |
+
public static function getInstallPath($packageName)
|
230 |
+
{
|
231 |
+
foreach (self::getInstalled() as $installed) {
|
232 |
+
if (!isset($installed['versions'][$packageName])) {
|
233 |
+
continue;
|
234 |
+
}
|
235 |
+
|
236 |
+
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
|
237 |
+
}
|
238 |
+
|
239 |
+
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
|
240 |
+
}
|
241 |
+
|
242 |
+
/**
|
243 |
+
* @return array
|
244 |
+
* @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}
|
245 |
+
*/
|
246 |
+
public static function getRootPackage()
|
247 |
+
{
|
248 |
+
$installed = self::getInstalled();
|
249 |
+
|
250 |
+
return $installed[0]['root'];
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Returns the raw installed.php data for custom implementations
|
255 |
+
*
|
256 |
+
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
|
257 |
+
* @return array[]
|
258 |
+
* @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}
|
259 |
+
*/
|
260 |
+
public static function getRawData()
|
261 |
+
{
|
262 |
+
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
|
263 |
+
|
264 |
+
if (null === self::$installed) {
|
265 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
266 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
267 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
268 |
+
self::$installed = include __DIR__ . '/installed.php';
|
269 |
+
} else {
|
270 |
+
self::$installed = array();
|
271 |
+
}
|
272 |
+
}
|
273 |
+
|
274 |
+
return self::$installed;
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Returns the raw data of all installed.php which are currently loaded for custom implementations
|
279 |
+
*
|
280 |
+
* @return array[]
|
281 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
282 |
+
*/
|
283 |
+
public static function getAllRawData()
|
284 |
+
{
|
285 |
+
return self::getInstalled();
|
286 |
+
}
|
287 |
+
|
288 |
+
/**
|
289 |
+
* Lets you reload the static array from another file
|
290 |
+
*
|
291 |
+
* This is only useful for complex integrations in which a project needs to use
|
292 |
+
* this class but then also needs to execute another project's autoloader in process,
|
293 |
+
* and wants to ensure both projects have access to their version of installed.php.
|
294 |
+
*
|
295 |
+
* A typical case would be PHPUnit, where it would need to make sure it reads all
|
296 |
+
* the data it needs from this class, then call reload() with
|
297 |
+
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
|
298 |
+
* the project in which it runs can then also use this class safely, without
|
299 |
+
* interference between PHPUnit's dependencies and the project's dependencies.
|
300 |
+
*
|
301 |
+
* @param array[] $data A vendor/composer/installed.php data set
|
302 |
+
* @return void
|
303 |
+
*
|
304 |
+
* @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>} $data
|
305 |
+
*/
|
306 |
+
public static function reload($data)
|
307 |
+
{
|
308 |
+
self::$installed = $data;
|
309 |
+
self::$installedByVendor = array();
|
310 |
+
}
|
311 |
+
|
312 |
+
/**
|
313 |
+
* @return array[]
|
314 |
+
* @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string, type?: string}>}>
|
315 |
+
*/
|
316 |
+
private static function getInstalled()
|
317 |
+
{
|
318 |
+
if (null === self::$canGetVendors) {
|
319 |
+
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
|
320 |
+
}
|
321 |
+
|
322 |
+
$installed = array();
|
323 |
+
|
324 |
+
if (self::$canGetVendors) {
|
325 |
+
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
|
326 |
+
if (isset(self::$installedByVendor[$vendorDir])) {
|
327 |
+
$installed[] = self::$installedByVendor[$vendorDir];
|
328 |
+
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
329 |
+
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
330 |
+
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
331 |
+
self::$installed = $installed[count($installed) - 1];
|
332 |
+
}
|
333 |
+
}
|
334 |
+
}
|
335 |
+
}
|
336 |
+
|
337 |
+
if (null === self::$installed) {
|
338 |
+
// only require the installed.php file if this file is loaded from its dumped location,
|
339 |
+
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
340 |
+
if (substr(__DIR__, -8, 1) !== 'C') {
|
341 |
+
self::$installed = require __DIR__ . '/installed.php';
|
342 |
+
} else {
|
343 |
+
self::$installed = array();
|
344 |
+
}
|
345 |
+
}
|
346 |
+
$installed[] = self::$installed;
|
347 |
+
|
348 |
+
return $installed;
|
349 |
+
}
|
350 |
+
}
|
vendor/composer/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
Copyright (c) Nils Adermann, Jordi Boggiano
|
3 |
+
|
4 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
5 |
+
of this software and associated documentation files (the "Software"), to deal
|
6 |
+
in the Software without restriction, including without limitation the rights
|
7 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8 |
+
copies of the Software, and to permit persons to whom the Software is furnished
|
9 |
+
to do so, subject to the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be included in all
|
12 |
+
copies or substantial portions of the Software.
|
13 |
+
|
14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20 |
+
THE SOFTWARE.
|
21 |
+
|
vendor/composer/autoload_classmap.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_classmap.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
10 |
+
'ariColor' => $vendorDir . '/aristath/ari-color/aricolor.php',
|
11 |
+
);
|
vendor/composer/autoload_namespaces.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_namespaces.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
);
|
vendor/composer/autoload_psr4.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_psr4.php @generated by Composer
|
4 |
+
|
5 |
+
$vendorDir = dirname(dirname(__FILE__));
|
6 |
+
$baseDir = dirname($vendorDir);
|
7 |
+
|
8 |
+
return array(
|
9 |
+
);
|
vendor/composer/autoload_real.php
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_real.php @generated by Composer
|
4 |
+
|
5 |
+
class ComposerAutoloaderInit2c637ac97dec4158e243822b69b247af
|
6 |
+
{
|
7 |
+
private static $loader;
|
8 |
+
|
9 |
+
public static function loadClassLoader($class)
|
10 |
+
{
|
11 |
+
if ('Composer\Autoload\ClassLoader' === $class) {
|
12 |
+
require __DIR__ . '/ClassLoader.php';
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @return \Composer\Autoload\ClassLoader
|
18 |
+
*/
|
19 |
+
public static function getLoader()
|
20 |
+
{
|
21 |
+
if (null !== self::$loader) {
|
22 |
+
return self::$loader;
|
23 |
+
}
|
24 |
+
|
25 |
+
require __DIR__ . '/platform_check.php';
|
26 |
+
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInit2c637ac97dec4158e243822b69b247af', 'loadClassLoader'), true, true);
|
28 |
+
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit2c637ac97dec4158e243822b69b247af', 'loadClassLoader'));
|
30 |
+
|
31 |
+
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
+
if ($useStaticLoader) {
|
33 |
+
require __DIR__ . '/autoload_static.php';
|
34 |
+
|
35 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit2c637ac97dec4158e243822b69b247af::getInitializer($loader));
|
36 |
+
} else {
|
37 |
+
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
+
foreach ($map as $namespace => $path) {
|
39 |
+
$loader->set($namespace, $path);
|
40 |
+
}
|
41 |
+
|
42 |
+
$map = require __DIR__ . '/autoload_psr4.php';
|
43 |
+
foreach ($map as $namespace => $path) {
|
44 |
+
$loader->setPsr4($namespace, $path);
|
45 |
+
}
|
46 |
+
|
47 |
+
$classMap = require __DIR__ . '/autoload_classmap.php';
|
48 |
+
if ($classMap) {
|
49 |
+
$loader->addClassMap($classMap);
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
+
$loader->register(true);
|
54 |
+
|
55 |
+
return $loader;
|
56 |
+
}
|
57 |
+
}
|
vendor/composer/autoload_static.php
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// autoload_static.php @generated by Composer
|
4 |
+
|
5 |
+
namespace Composer\Autoload;
|
6 |
+
|
7 |
+
class ComposerStaticInit2c637ac97dec4158e243822b69b247af
|
8 |
+
{
|
9 |
+
public static $classMap = array (
|
10 |
+
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
11 |
+
'ariColor' => __DIR__ . '/..' . '/aristath/ari-color/aricolor.php',
|
12 |
+
);
|
13 |
+
|
14 |
+
public static function getInitializer(ClassLoader $loader)
|
15 |
+
{
|
16 |
+
return \Closure::bind(function () use ($loader) {
|
17 |
+
$loader->classMap = ComposerStaticInit2c637ac97dec4158e243822b69b247af::$classMap;
|
18 |
+
|
19 |
+
}, null, ClassLoader::class);
|
20 |
+
}
|
21 |
+
}
|
vendor/composer/installed.json
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"packages": [
|
3 |
+
{
|
4 |
+
"name": "aristath/ari-color",
|
5 |
+
"version": "v1.1.2",
|
6 |
+
"version_normalized": "1.1.2.0",
|
7 |
+
"source": {
|
8 |
+
"type": "git",
|
9 |
+
"url": "https://github.com/aristath/ariColor.git",
|
10 |
+
"reference": "59f2938dfda5a61beef9af98b3c45c79eb58fe4c"
|
11 |
+
},
|
12 |
+
"dist": {
|
13 |
+
"type": "zip",
|
14 |
+
"url": "https://api.github.com/repos/aristath/ariColor/zipball/59f2938dfda5a61beef9af98b3c45c79eb58fe4c",
|
15 |
+
"reference": "59f2938dfda5a61beef9af98b3c45c79eb58fe4c",
|
16 |
+
"shasum": ""
|
17 |
+
},
|
18 |
+
"require": {
|
19 |
+
"php": ">=5.2"
|
20 |
+
},
|
21 |
+
"require-dev": {
|
22 |
+
"composer/installers": "~1.0",
|
23 |
+
"phpunit/phpunit": "~4.0",
|
24 |
+
"satooshi/php-coveralls": "~2.2"
|
25 |
+
},
|
26 |
+
"time": "2020-09-15T07:10:36+00:00",
|
27 |
+
"type": "library",
|
28 |
+
"installation-source": "dist",
|
29 |
+
"autoload": {
|
30 |
+
"classmap": [
|
31 |
+
"aricolor.php"
|
32 |
+
]
|
33 |
+
},
|
34 |
+
"notification-url": "https://packagist.org/downloads/",
|
35 |
+
"license": [
|
36 |
+
"GPL-2.0-or-later"
|
37 |
+
],
|
38 |
+
"authors": [
|
39 |
+
{
|
40 |
+
"name": "aristath",
|
41 |
+
"email": "aristath@gmail.com",
|
42 |
+
"homepage": "http://aristeides.com"
|
43 |
+
}
|
44 |
+
],
|
45 |
+
"description": "A PHP library for color manipulation in themes and plugins",
|
46 |
+
"homepage": "http://aristath.github.io/ariColor",
|
47 |
+
"support": {
|
48 |
+
"issues": "https://github.com/aristath/ariColor/issues",
|
49 |
+
"source": "https://github.com/aristath/ariColor/tree/v1.1.2"
|
50 |
+
},
|
51 |
+
"funding": [
|
52 |
+
{
|
53 |
+
"url": "https://github.com/aristath",
|
54 |
+
"type": "github"
|
55 |
+
}
|
56 |
+
],
|
57 |
+
"install-path": "../aristath/ari-color"
|
58 |
+
}
|
59 |
+
],
|
60 |
+
"dev": true,
|
61 |
+
"dev-package-names": []
|
62 |
+
}
|
vendor/composer/installed.php
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php return array(
|
2 |
+
'root' => array(
|
3 |
+
'pretty_version' => 'dev-master',
|
4 |
+
'version' => 'dev-master',
|
5 |
+
'type' => 'library',
|
6 |
+
'install_path' => __DIR__ . '/../../',
|
7 |
+
'aliases' => array(),
|
8 |
+
'reference' => '573d4a9855e81e31838743714bec17718b350b5d',
|
9 |
+
'name' => 'mapsteps/custom-login-dashboard',
|
10 |
+
'dev' => true,
|
11 |
+
),
|
12 |
+
'versions' => array(
|
13 |
+
'aristath/ari-color' => array(
|
14 |
+
'pretty_version' => 'v1.1.2',
|
15 |
+
'version' => '1.1.2.0',
|
16 |
+
'type' => 'library',
|
17 |
+
'install_path' => __DIR__ . '/../aristath/ari-color',
|
18 |
+
'aliases' => array(),
|
19 |
+
'reference' => '59f2938dfda5a61beef9af98b3c45c79eb58fe4c',
|
20 |
+
'dev_requirement' => false,
|
21 |
+
),
|
22 |
+
'mapsteps/custom-login-dashboard' => array(
|
23 |
+
'pretty_version' => 'dev-master',
|
24 |
+
'version' => 'dev-master',
|
25 |
+
'type' => 'library',
|
26 |
+
'install_path' => __DIR__ . '/../../',
|
27 |
+
'aliases' => array(),
|
28 |
+
'reference' => '573d4a9855e81e31838743714bec17718b350b5d',
|
29 |
+
'dev_requirement' => false,
|
30 |
+
),
|
31 |
+
),
|
32 |
+
);
|
vendor/composer/platform_check.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// platform_check.php @generated by Composer
|
4 |
+
|
5 |
+
$issues = array();
|
6 |
+
|
7 |
+
if (!(PHP_VERSION_ID >= 50200)) {
|
8 |
+
$issues[] = 'Your Composer dependencies require a PHP version ">= 5.2.0". You are running ' . PHP_VERSION . '.';
|
9 |
+
}
|
10 |
+
|
11 |
+
if ($issues) {
|
12 |
+
if (!headers_sent()) {
|
13 |
+
header('HTTP/1.1 500 Internal Server Error');
|
14 |
+
}
|
15 |
+
if (!ini_get('display_errors')) {
|
16 |
+
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
17 |
+
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
|
18 |
+
} elseif (!headers_sent()) {
|
19 |
+
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
|
20 |
+
}
|
21 |
+
}
|
22 |
+
trigger_error(
|
23 |
+
'Composer detected issues in your platform: ' . implode(' ', $issues),
|
24 |
+
E_USER_ERROR
|
25 |
+
);
|
26 |
+
}
|