Custom Login Page Customizer by Colorlib - Version 1.2.0

Version Description

  • Implemented everything from here: https://github.com/puikinsh/colorlib-login-customizer/milestone/1?closed=1
Download this release

Release Info

Developer colorlibplugins
Plugin Icon wp plugin Custom Login Page Customizer by Colorlib
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.0 to 1.2.0

LICENSE CHANGED
@@ -1,674 +1,674 @@
1
- GNU GENERAL PUBLIC LICENSE
2
- Version 3, 29 June 2007
3
-
4
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
- Everyone is permitted to copy and distribute verbatim copies
6
- of this license document, but changing it is not allowed.
7
-
8
- Preamble
9
-
10
- The GNU General Public License is a free, copyleft license for
11
- software and other kinds of works.
12
-
13
- The licenses for most software and other practical works are designed
14
- to take away your freedom to share and change the works. By contrast,
15
- the GNU General Public License is intended to guarantee your freedom to
16
- share and change all versions of a program--to make sure it remains free
17
- software for all its users. We, the Free Software Foundation, use the
18
- GNU General Public License for most of our software; it applies also to
19
- any other work released this way by its authors. You can apply it to
20
- your programs, too.
21
-
22
- When we speak of free software, we are referring to freedom, not
23
- price. Our General Public Licenses are designed to make sure that you
24
- have the freedom to distribute copies of free software (and charge for
25
- them if you wish), that you receive source code or can get it if you
26
- want it, that you can change the software or use pieces of it in new
27
- free programs, and that you know you can do these things.
28
-
29
- To protect your rights, we need to prevent others from denying you
30
- these rights or asking you to surrender the rights. Therefore, you have
31
- certain responsibilities if you distribute copies of the software, or if
32
- you modify it: responsibilities to respect the freedom of others.
33
-
34
- For example, if you distribute copies of such a program, whether
35
- gratis or for a fee, you must pass on to the recipients the same
36
- freedoms that you received. You must make sure that they, too, receive
37
- or can get the source code. And you must show them these terms so they
38
- know their rights.
39
-
40
- Developers that use the GNU GPL protect your rights with two steps:
41
- (1) assert copyright on the software, and (2) offer you this License
42
- giving you legal permission to copy, distribute and/or modify it.
43
-
44
- For the developers' and authors' protection, the GPL clearly explains
45
- that there is no warranty for this free software. For both users' and
46
- authors' sake, the GPL requires that modified versions be marked as
47
- changed, so that their problems will not be attributed erroneously to
48
- authors of previous versions.
49
-
50
- Some devices are designed to deny users access to install or run
51
- modified versions of the software inside them, although the manufacturer
52
- can do so. This is fundamentally incompatible with the aim of
53
- protecting users' freedom to change the software. The systematic
54
- pattern of such abuse occurs in the area of products for individuals to
55
- use, which is precisely where it is most unacceptable. Therefore, we
56
- have designed this version of the GPL to prohibit the practice for those
57
- products. If such problems arise substantially in other domains, we
58
- stand ready to extend this provision to those domains in future versions
59
- of the GPL, as needed to protect the freedom of users.
60
-
61
- Finally, every program is threatened constantly by software patents.
62
- States should not allow patents to restrict development and use of
63
- software on general-purpose computers, but in those that do, we wish to
64
- avoid the special danger that patents applied to a free program could
65
- make it effectively proprietary. To prevent this, the GPL assures that
66
- patents cannot be used to render the program non-free.
67
-
68
- The precise terms and conditions for copying, distribution and
69
- modification follow.
70
-
71
- TERMS AND CONDITIONS
72
-
73
- 0. Definitions.
74
-
75
- "This License" refers to version 3 of the GNU General Public License.
76
-
77
- "Copyright" also means copyright-like laws that apply to other kinds of
78
- works, such as semiconductor masks.
79
-
80
- "The Program" refers to any copyrightable work licensed under this
81
- License. Each licensee is addressed as "you". "Licensees" and
82
- "recipients" may be individuals or organizations.
83
-
84
- To "modify" a work means to copy from or adapt all or part of the work
85
- in a fashion requiring copyright permission, other than the making of an
86
- exact copy. The resulting work is called a "modified version" of the
87
- earlier work or a work "based on" the earlier work.
88
-
89
- A "covered work" means either the unmodified Program or a work based
90
- on the Program.
91
-
92
- To "propagate" a work means to do anything with it that, without
93
- permission, would make you directly or secondarily liable for
94
- infringement under applicable copyright law, except executing it on a
95
- computer or modifying a private copy. Propagation includes copying,
96
- distribution (with or without modification), making available to the
97
- public, and in some countries other activities as well.
98
-
99
- To "convey" a work means any kind of propagation that enables other
100
- parties to make or receive copies. Mere interaction with a user through
101
- a computer network, with no transfer of a copy, is not conveying.
102
-
103
- An interactive user interface displays "Appropriate Legal Notices"
104
- to the extent that it includes a convenient and prominently visible
105
- feature that (1) displays an appropriate copyright notice, and (2)
106
- tells the user that there is no warranty for the work (except to the
107
- extent that warranties are provided), that licensees may convey the
108
- work under this License, and how to view a copy of this License. If
109
- the interface presents a list of user commands or options, such as a
110
- menu, a prominent item in the list meets this criterion.
111
-
112
- 1. Source Code.
113
-
114
- The "source code" for a work means the preferred form of the work
115
- for making modifications to it. "Object code" means any non-source
116
- form of a work.
117
-
118
- A "Standard Interface" means an interface that either is an official
119
- standard defined by a recognized standards body, or, in the case of
120
- interfaces specified for a particular programming language, one that
121
- is widely used among developers working in that language.
122
-
123
- The "System Libraries" of an executable work include anything, other
124
- than the work as a whole, that (a) is included in the normal form of
125
- packaging a Major Component, but which is not part of that Major
126
- Component, and (b) serves only to enable use of the work with that
127
- Major Component, or to implement a Standard Interface for which an
128
- implementation is available to the public in source code form. A
129
- "Major Component", in this context, means a major essential component
130
- (kernel, window system, and so on) of the specific operating system
131
- (if any) on which the executable work runs, or a compiler used to
132
- produce the work, or an object code interpreter used to run it.
133
-
134
- The "Corresponding Source" for a work in object code form means all
135
- the source code needed to generate, install, and (for an executable
136
- work) run the object code and to modify the work, including scripts to
137
- control those activities. However, it does not include the work's
138
- System Libraries, or general-purpose tools or generally available free
139
- programs which are used unmodified in performing those activities but
140
- which are not part of the work. For example, Corresponding Source
141
- includes interface definition files associated with source files for
142
- the work, and the source code for shared libraries and dynamically
143
- linked subprograms that the work is specifically designed to require,
144
- such as by intimate data communication or control flow between those
145
- subprograms and other parts of the work.
146
-
147
- The Corresponding Source need not include anything that users
148
- can regenerate automatically from other parts of the Corresponding
149
- Source.
150
-
151
- The Corresponding Source for a work in source code form is that
152
- same work.
153
-
154
- 2. Basic Permissions.
155
-
156
- All rights granted under this License are granted for the term of
157
- copyright on the Program, and are irrevocable provided the stated
158
- conditions are met. This License explicitly affirms your unlimited
159
- permission to run the unmodified Program. The output from running a
160
- covered work is covered by this License only if the output, given its
161
- content, constitutes a covered work. This License acknowledges your
162
- rights of fair use or other equivalent, as provided by copyright law.
163
-
164
- You may make, run and propagate covered works that you do not
165
- convey, without conditions so long as your license otherwise remains
166
- in force. You may convey covered works to others for the sole purpose
167
- of having them make modifications exclusively for you, or provide you
168
- with facilities for running those works, provided that you comply with
169
- the terms of this License in conveying all material for which you do
170
- not control copyright. Those thus making or running the covered works
171
- for you must do so exclusively on your behalf, under your direction
172
- and control, on terms that prohibit them from making any copies of
173
- your copyrighted material outside their relationship with you.
174
-
175
- Conveying under any other circumstances is permitted solely under
176
- the conditions stated below. Sublicensing is not allowed; section 10
177
- makes it unnecessary.
178
-
179
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
-
181
- No covered work shall be deemed part of an effective technological
182
- measure under any applicable law fulfilling obligations under article
183
- 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
- similar laws prohibiting or restricting circumvention of such
185
- measures.
186
-
187
- When you convey a covered work, you waive any legal power to forbid
188
- circumvention of technological measures to the extent such circumvention
189
- is effected by exercising rights under this License with respect to
190
- the covered work, and you disclaim any intention to limit operation or
191
- modification of the work as a means of enforcing, against the work's
192
- users, your or third parties' legal rights to forbid circumvention of
193
- technological measures.
194
-
195
- 4. Conveying Verbatim Copies.
196
-
197
- You may convey verbatim copies of the Program's source code as you
198
- receive it, in any medium, provided that you conspicuously and
199
- appropriately publish on each copy an appropriate copyright notice;
200
- keep intact all notices stating that this License and any
201
- non-permissive terms added in accord with section 7 apply to the code;
202
- keep intact all notices of the absence of any warranty; and give all
203
- recipients a copy of this License along with the Program.
204
-
205
- You may charge any price or no price for each copy that you convey,
206
- and you may offer support or warranty protection for a fee.
207
-
208
- 5. Conveying Modified Source Versions.
209
-
210
- You may convey a work based on the Program, or the modifications to
211
- produce it from the Program, in the form of source code under the
212
- terms of section 4, provided that you also meet all of these conditions:
213
-
214
- a) The work must carry prominent notices stating that you modified
215
- it, and giving a relevant date.
216
-
217
- b) The work must carry prominent notices stating that it is
218
- released under this License and any conditions added under section
219
- 7. This requirement modifies the requirement in section 4 to
220
- "keep intact all notices".
221
-
222
- c) You must license the entire work, as a whole, under this
223
- License to anyone who comes into possession of a copy. This
224
- License will therefore apply, along with any applicable section 7
225
- additional terms, to the whole of the work, and all its parts,
226
- regardless of how they are packaged. This License gives no
227
- permission to license the work in any other way, but it does not
228
- invalidate such permission if you have separately received it.
229
-
230
- d) If the work has interactive user interfaces, each must display
231
- Appropriate Legal Notices; however, if the Program has interactive
232
- interfaces that do not display Appropriate Legal Notices, your
233
- work need not make them do so.
234
-
235
- A compilation of a covered work with other separate and independent
236
- works, which are not by their nature extensions of the covered work,
237
- and which are not combined with it such as to form a larger program,
238
- in or on a volume of a storage or distribution medium, is called an
239
- "aggregate" if the compilation and its resulting copyright are not
240
- used to limit the access or legal rights of the compilation's users
241
- beyond what the individual works permit. Inclusion of a covered work
242
- in an aggregate does not cause this License to apply to the other
243
- parts of the aggregate.
244
-
245
- 6. Conveying Non-Source Forms.
246
-
247
- You may convey a covered work in object code form under the terms
248
- of sections 4 and 5, provided that you also convey the
249
- machine-readable Corresponding Source under the terms of this License,
250
- in one of these ways:
251
-
252
- a) Convey the object code in, or embodied in, a physical product
253
- (including a physical distribution medium), accompanied by the
254
- Corresponding Source fixed on a durable physical medium
255
- customarily used for software interchange.
256
-
257
- b) Convey the object code in, or embodied in, a physical product
258
- (including a physical distribution medium), accompanied by a
259
- written offer, valid for at least three years and valid for as
260
- long as you offer spare parts or customer support for that product
261
- model, to give anyone who possesses the object code either (1) a
262
- copy of the Corresponding Source for all the software in the
263
- product that is covered by this License, on a durable physical
264
- medium customarily used for software interchange, for a price no
265
- more than your reasonable cost of physically performing this
266
- conveying of source, or (2) access to copy the
267
- Corresponding Source from a network server at no charge.
268
-
269
- c) Convey individual copies of the object code with a copy of the
270
- written offer to provide the Corresponding Source. This
271
- alternative is allowed only occasionally and noncommercially, and
272
- only if you received the object code with such an offer, in accord
273
- with subsection 6b.
274
-
275
- d) Convey the object code by offering access from a designated
276
- place (gratis or for a charge), and offer equivalent access to the
277
- Corresponding Source in the same way through the same place at no
278
- further charge. You need not require recipients to copy the
279
- Corresponding Source along with the object code. If the place to
280
- copy the object code is a network server, the Corresponding Source
281
- may be on a different server (operated by you or a third party)
282
- that supports equivalent copying facilities, provided you maintain
283
- clear directions next to the object code saying where to find the
284
- Corresponding Source. Regardless of what server hosts the
285
- Corresponding Source, you remain obligated to ensure that it is
286
- available for as long as needed to satisfy these requirements.
287
-
288
- e) Convey the object code using peer-to-peer transmission, provided
289
- you inform other peers where the object code and Corresponding
290
- Source of the work are being offered to the general public at no
291
- charge under subsection 6d.
292
-
293
- A separable portion of the object code, whose source code is excluded
294
- from the Corresponding Source as a System Library, need not be
295
- included in conveying the object code work.
296
-
297
- A "User Product" is either (1) a "consumer product", which means any
298
- tangible personal property which is normally used for personal, family,
299
- or household purposes, or (2) anything designed or sold for incorporation
300
- into a dwelling. In determining whether a product is a consumer product,
301
- doubtful cases shall be resolved in favor of coverage. For a particular
302
- product received by a particular user, "normally used" refers to a
303
- typical or common use of that class of product, regardless of the status
304
- of the particular user or of the way in which the particular user
305
- actually uses, or expects or is expected to use, the product. A product
306
- is a consumer product regardless of whether the product has substantial
307
- commercial, industrial or non-consumer uses, unless such uses represent
308
- the only significant mode of use of the product.
309
-
310
- "Installation Information" for a User Product means any methods,
311
- procedures, authorization keys, or other information required to install
312
- and execute modified versions of a covered work in that User Product from
313
- a modified version of its Corresponding Source. The information must
314
- suffice to ensure that the continued functioning of the modified object
315
- code is in no case prevented or interfered with solely because
316
- modification has been made.
317
-
318
- If you convey an object code work under this section in, or with, or
319
- specifically for use in, a User Product, and the conveying occurs as
320
- part of a transaction in which the right of possession and use of the
321
- User Product is transferred to the recipient in perpetuity or for a
322
- fixed term (regardless of how the transaction is characterized), the
323
- Corresponding Source conveyed under this section must be accompanied
324
- by the Installation Information. But this requirement does not apply
325
- if neither you nor any third party retains the ability to install
326
- modified object code on the User Product (for example, the work has
327
- been installed in ROM).
328
-
329
- The requirement to provide Installation Information does not include a
330
- requirement to continue to provide support service, warranty, or updates
331
- for a work that has been modified or installed by the recipient, or for
332
- the User Product in which it has been modified or installed. Access to a
333
- network may be denied when the modification itself materially and
334
- adversely affects the operation of the network or violates the rules and
335
- protocols for communication across the network.
336
-
337
- Corresponding Source conveyed, and Installation Information provided,
338
- in accord with this section must be in a format that is publicly
339
- documented (and with an implementation available to the public in
340
- source code form), and must require no special password or key for
341
- unpacking, reading or copying.
342
-
343
- 7. Additional Terms.
344
-
345
- "Additional permissions" are terms that supplement the terms of this
346
- License by making exceptions from one or more of its conditions.
347
- Additional permissions that are applicable to the entire Program shall
348
- be treated as though they were included in this License, to the extent
349
- that they are valid under applicable law. If additional permissions
350
- apply only to part of the Program, that part may be used separately
351
- under those permissions, but the entire Program remains governed by
352
- this License without regard to the additional permissions.
353
-
354
- When you convey a copy of a covered work, you may at your option
355
- remove any additional permissions from that copy, or from any part of
356
- it. (Additional permissions may be written to require their own
357
- removal in certain cases when you modify the work.) You may place
358
- additional permissions on material, added by you to a covered work,
359
- for which you have or can give appropriate copyright permission.
360
-
361
- Notwithstanding any other provision of this License, for material you
362
- add to a covered work, you may (if authorized by the copyright holders of
363
- that material) supplement the terms of this License with terms:
364
-
365
- a) Disclaiming warranty or limiting liability differently from the
366
- terms of sections 15 and 16 of this License; or
367
-
368
- b) Requiring preservation of specified reasonable legal notices or
369
- author attributions in that material or in the Appropriate Legal
370
- Notices displayed by works containing it; or
371
-
372
- c) Prohibiting misrepresentation of the origin of that material, or
373
- requiring that modified versions of such material be marked in
374
- reasonable ways as different from the original version; or
375
-
376
- d) Limiting the use for publicity purposes of names of licensors or
377
- authors of the material; or
378
-
379
- e) Declining to grant rights under trademark law for use of some
380
- trade names, trademarks, or service marks; or
381
-
382
- f) Requiring indemnification of licensors and authors of that
383
- material by anyone who conveys the material (or modified versions of
384
- it) with contractual assumptions of liability to the recipient, for
385
- any liability that these contractual assumptions directly impose on
386
- those licensors and authors.
387
-
388
- All other non-permissive additional terms are considered "further
389
- restrictions" within the meaning of section 10. If the Program as you
390
- received it, or any part of it, contains a notice stating that it is
391
- governed by this License along with a term that is a further
392
- restriction, you may remove that term. If a license document contains
393
- a further restriction but permits relicensing or conveying under this
394
- License, you may add to a covered work material governed by the terms
395
- of that license document, provided that the further restriction does
396
- not survive such relicensing or conveying.
397
-
398
- If you add terms to a covered work in accord with this section, you
399
- must place, in the relevant source files, a statement of the
400
- additional terms that apply to those files, or a notice indicating
401
- where to find the applicable terms.
402
-
403
- Additional terms, permissive or non-permissive, may be stated in the
404
- form of a separately written license, or stated as exceptions;
405
- the above requirements apply either way.
406
-
407
- 8. Termination.
408
-
409
- You may not propagate or modify a covered work except as expressly
410
- provided under this License. Any attempt otherwise to propagate or
411
- modify it is void, and will automatically terminate your rights under
412
- this License (including any patent licenses granted under the third
413
- paragraph of section 11).
414
-
415
- However, if you cease all violation of this License, then your
416
- license from a particular copyright holder is reinstated (a)
417
- provisionally, unless and until the copyright holder explicitly and
418
- finally terminates your license, and (b) permanently, if the copyright
419
- holder fails to notify you of the violation by some reasonable means
420
- prior to 60 days after the cessation.
421
-
422
- Moreover, your license from a particular copyright holder is
423
- reinstated permanently if the copyright holder notifies you of the
424
- violation by some reasonable means, this is the first time you have
425
- received notice of violation of this License (for any work) from that
426
- copyright holder, and you cure the violation prior to 30 days after
427
- your receipt of the notice.
428
-
429
- Termination of your rights under this section does not terminate the
430
- licenses of parties who have received copies or rights from you under
431
- this License. If your rights have been terminated and not permanently
432
- reinstated, you do not qualify to receive new licenses for the same
433
- material under section 10.
434
-
435
- 9. Acceptance Not Required for Having Copies.
436
-
437
- You are not required to accept this License in order to receive or
438
- run a copy of the Program. Ancillary propagation of a covered work
439
- occurring solely as a consequence of using peer-to-peer transmission
440
- to receive a copy likewise does not require acceptance. However,
441
- nothing other than this License grants you permission to propagate or
442
- modify any covered work. These actions infringe copyright if you do
443
- not accept this License. Therefore, by modifying or propagating a
444
- covered work, you indicate your acceptance of this License to do so.
445
-
446
- 10. Automatic Licensing of Downstream Recipients.
447
-
448
- Each time you convey a covered work, the recipient automatically
449
- receives a license from the original licensors, to run, modify and
450
- propagate that work, subject to this License. You are not responsible
451
- for enforcing compliance by third parties with this License.
452
-
453
- An "entity transaction" is a transaction transferring control of an
454
- organization, or substantially all assets of one, or subdividing an
455
- organization, or merging organizations. If propagation of a covered
456
- work results from an entity transaction, each party to that
457
- transaction who receives a copy of the work also receives whatever
458
- licenses to the work the party's predecessor in interest had or could
459
- give under the previous paragraph, plus a right to possession of the
460
- Corresponding Source of the work from the predecessor in interest, if
461
- the predecessor has it or can get it with reasonable efforts.
462
-
463
- You may not impose any further restrictions on the exercise of the
464
- rights granted or affirmed under this License. For example, you may
465
- not impose a license fee, royalty, or other charge for exercise of
466
- rights granted under this License, and you may not initiate litigation
467
- (including a cross-claim or counterclaim in a lawsuit) alleging that
468
- any patent claim is infringed by making, using, selling, offering for
469
- sale, or importing the Program or any portion of it.
470
-
471
- 11. Patents.
472
-
473
- A "contributor" is a copyright holder who authorizes use under this
474
- License of the Program or a work on which the Program is based. The
475
- work thus licensed is called the contributor's "contributor version".
476
-
477
- A contributor's "essential patent claims" are all patent claims
478
- owned or controlled by the contributor, whether already acquired or
479
- hereafter acquired, that would be infringed by some manner, permitted
480
- by this License, of making, using, or selling its contributor version,
481
- but do not include claims that would be infringed only as a
482
- consequence of further modification of the contributor version. For
483
- purposes of this definition, "control" includes the right to grant
484
- patent sublicenses in a manner consistent with the requirements of
485
- this License.
486
-
487
- Each contributor grants you a non-exclusive, worldwide, royalty-free
488
- patent license under the contributor's essential patent claims, to
489
- make, use, sell, offer for sale, import and otherwise run, modify and
490
- propagate the contents of its contributor version.
491
-
492
- In the following three paragraphs, a "patent license" is any express
493
- agreement or commitment, however denominated, not to enforce a patent
494
- (such as an express permission to practice a patent or covenant not to
495
- sue for patent infringement). To "grant" such a patent license to a
496
- party means to make such an agreement or commitment not to enforce a
497
- patent against the party.
498
-
499
- If you convey a covered work, knowingly relying on a patent license,
500
- and the Corresponding Source of the work is not available for anyone
501
- to copy, free of charge and under the terms of this License, through a
502
- publicly available network server or other readily accessible means,
503
- then you must either (1) cause the Corresponding Source to be so
504
- available, or (2) arrange to deprive yourself of the benefit of the
505
- patent license for this particular work, or (3) arrange, in a manner
506
- consistent with the requirements of this License, to extend the patent
507
- license to downstream recipients. "Knowingly relying" means you have
508
- actual knowledge that, but for the patent license, your conveying the
509
- covered work in a country, or your recipient's use of the covered work
510
- in a country, would infringe one or more identifiable patents in that
511
- country that you have reason to believe are valid.
512
-
513
- If, pursuant to or in connection with a single transaction or
514
- arrangement, you convey, or propagate by procuring conveyance of, a
515
- covered work, and grant a patent license to some of the parties
516
- receiving the covered work authorizing them to use, propagate, modify
517
- or convey a specific copy of the covered work, then the patent license
518
- you grant is automatically extended to all recipients of the covered
519
- work and works based on it.
520
-
521
- A patent license is "discriminatory" if it does not include within
522
- the scope of its coverage, prohibits the exercise of, or is
523
- conditioned on the non-exercise of one or more of the rights that are
524
- specifically granted under this License. You may not convey a covered
525
- work if you are a party to an arrangement with a third party that is
526
- in the business of distributing software, under which you make payment
527
- to the third party based on the extent of your activity of conveying
528
- the work, and under which the third party grants, to any of the
529
- parties who would receive the covered work from you, a discriminatory
530
- patent license (a) in connection with copies of the covered work
531
- conveyed by you (or copies made from those copies), or (b) primarily
532
- for and in connection with specific products or compilations that
533
- contain the covered work, unless you entered into that arrangement,
534
- or that patent license was granted, prior to 28 March 2007.
535
-
536
- Nothing in this License shall be construed as excluding or limiting
537
- any implied license or other defenses to infringement that may
538
- otherwise be available to you under applicable patent law.
539
-
540
- 12. No Surrender of Others' Freedom.
541
-
542
- If conditions are imposed on you (whether by court order, agreement or
543
- otherwise) that contradict the conditions of this License, they do not
544
- excuse you from the conditions of this License. If you cannot convey a
545
- covered work so as to satisfy simultaneously your obligations under this
546
- License and any other pertinent obligations, then as a consequence you may
547
- not convey it at all. For example, if you agree to terms that obligate you
548
- to collect a royalty for further conveying from those to whom you convey
549
- the Program, the only way you could satisfy both those terms and this
550
- License would be to refrain entirely from conveying the Program.
551
-
552
- 13. Use with the GNU Affero General Public License.
553
-
554
- Notwithstanding any other provision of this License, you have
555
- permission to link or combine any covered work with a work licensed
556
- under version 3 of the GNU Affero General Public License into a single
557
- combined work, and to convey the resulting work. The terms of this
558
- License will continue to apply to the part which is the covered work,
559
- but the special requirements of the GNU Affero General Public License,
560
- section 13, concerning interaction through a network will apply to the
561
- combination as such.
562
-
563
- 14. Revised Versions of this License.
564
-
565
- The Free Software Foundation may publish revised and/or new versions of
566
- the GNU General Public License from time to time. Such new versions will
567
- be similar in spirit to the present version, but may differ in detail to
568
- address new problems or concerns.
569
-
570
- Each version is given a distinguishing version number. If the
571
- Program specifies that a certain numbered version of the GNU General
572
- Public License "or any later version" applies to it, you have the
573
- option of following the terms and conditions either of that numbered
574
- version or of any later version published by the Free Software
575
- Foundation. If the Program does not specify a version number of the
576
- GNU General Public License, you may choose any version ever published
577
- by the Free Software Foundation.
578
-
579
- If the Program specifies that a proxy can decide which future
580
- versions of the GNU General Public License can be used, that proxy's
581
- public statement of acceptance of a version permanently authorizes you
582
- to choose that version for the Program.
583
-
584
- Later license versions may give you additional or different
585
- permissions. However, no additional obligations are imposed on any
586
- author or copyright holder as a result of your choosing to follow a
587
- later version.
588
-
589
- 15. Disclaimer of Warranty.
590
-
591
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
- APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
- HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
- OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
- THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
- IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
- ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
-
600
- 16. Limitation of Liability.
601
-
602
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
- WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
- GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
- USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
- DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
- PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
- SUCH DAMAGES.
611
-
612
- 17. Interpretation of Sections 15 and 16.
613
-
614
- If the disclaimer of warranty and limitation of liability provided
615
- above cannot be given local legal effect according to their terms,
616
- reviewing courts shall apply local law that most closely approximates
617
- an absolute waiver of all civil liability in connection with the
618
- Program, unless a warranty or assumption of liability accompanies a
619
- copy of the Program in return for a fee.
620
-
621
- END OF TERMS AND CONDITIONS
622
-
623
- How to Apply These Terms to Your New Programs
624
-
625
- If you develop a new program, and you want it to be of the greatest
626
- possible use to the public, the best way to achieve this is to make it
627
- free software which everyone can redistribute and change under these terms.
628
-
629
- To do so, attach the following notices to the program. It is safest
630
- to attach them to the start of each source file to most effectively
631
- state the exclusion of warranty; and each file should have at least
632
- the "copyright" line and a pointer to where the full notice is found.
633
-
634
- {one line to give the program's name and a brief idea of what it does.}
635
- Copyright (C) {year} {name of author}
636
-
637
- This program is free software: you can redistribute it and/or modify
638
- it under the terms of the GNU General Public License as published by
639
- the Free Software Foundation, either version 3 of the License, or
640
- (at your option) any later version.
641
-
642
- This program is distributed in the hope that it will be useful,
643
- but WITHOUT ANY WARRANTY; without even the implied warranty of
644
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
- GNU General Public License for more details.
646
-
647
- You should have received a copy of the GNU General Public License
648
- along with this program. If not, see <http://www.gnu.org/licenses/>.
649
-
650
- Also add information on how to contact you by electronic and paper mail.
651
-
652
- If the program does terminal interaction, make it output a short
653
- notice like this when it starts in an interactive mode:
654
-
655
- {project} Copyright (C) {year} {fullname}
656
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
- This is free software, and you are welcome to redistribute it
658
- under certain conditions; type `show c' for details.
659
-
660
- The hypothetical commands `show w' and `show c' should show the appropriate
661
- parts of the General Public License. Of course, your program's commands
662
- might be different; for a GUI interface, you would use an "about box".
663
-
664
- You should also get your employer (if you work as a programmer) or school,
665
- if any, to sign a "copyright disclaimer" for the program, if necessary.
666
- For more information on this, and how to apply and follow the GNU GPL, see
667
- <http://www.gnu.org/licenses/>.
668
-
669
- The GNU General Public License does not permit incorporating your program
670
- into proprietary programs. If your program is a subroutine library, you
671
- may consider it more useful to permit linking proprietary applications with
672
- the library. If this is what you want to do, use the GNU Lesser General
673
- Public License instead of this License. But first, please read
674
- <http://www.gnu.org/philosophy/why-not-lgpl.html>.
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
assets/css/clc-customizer-previewer.css CHANGED
@@ -1,35 +1,41 @@
1
- .clc-general-actions {
2
- position: absolute;
3
- top: 10px;
4
- left: 10px;
5
- z-index: 99;
6
- }
7
-
8
- .clc-preview-event {
9
- cursor: pointer;
10
- background-color: #008ec2;
11
- border-radius: 100%;
12
- color: #fff;
13
- width: 30px;
14
- height: 30px;
15
- text-align: center;
16
- border: 2px solid #fff;
17
- box-shadow: 0 2px 1px rgba(46,68,83,.15);
18
- }
19
- .clc-preview-event > span {
20
- margin-top: 5px;
21
- }
22
-
23
- .clc-general-actions > .clc-preview-event {
24
- display: inline-block;
25
- }
26
- .login h1 a {
27
- text-indent: initial;
28
- position: relative;
29
- overflow: visible;
30
- }
31
- .login h1 a .clc-preview-event {
32
- position: absolute;
33
- left: -15px;
34
- top: -15px;
35
- }
 
 
 
 
 
 
1
+ .clc-general-actions {
2
+ position: absolute;
3
+ top: 10px;
4
+ left: 10px;
5
+ z-index: 99;
6
+ }
7
+
8
+ .clc-preview-event {
9
+ cursor: pointer;
10
+ background-color: #008ec2;
11
+ border-radius: 100%;
12
+ color: #fff;
13
+ width: 30px;
14
+ height: 30px;
15
+ text-align: center;
16
+ border: 2px solid #fff;
17
+ box-shadow: 0 2px 1px rgba(46,68,83,.15);
18
+ }
19
+ .clc-preview-event > span {
20
+ margin-top: 5px;
21
+ }
22
+
23
+ .clc-general-actions > .clc-preview-event {
24
+ display: inline-block;
25
+ }
26
+ .login h1 a {
27
+ text-indent: initial;
28
+ position: relative;
29
+ overflow: visible;
30
+ }
31
+ .login h1 a .clc-preview-event {
32
+ position: absolute;
33
+ left: -15px;
34
+ top: -15px;
35
+ }
36
+ .login h1 a #logo-text {
37
+ display: none;
38
+ }
39
+ .login.clc-text-logo h1 a #logo-text {
40
+ display: block;
41
+ }
assets/css/clc-customizer.css CHANGED
@@ -1,348 +1,436 @@
1
- .customize-control-clc-range-slider input[type="text"] {
2
- border: none;
3
- text-align: center;
4
- padding: 2px;
5
- margin: 0;
6
- font-size: 12px;
7
- color: #333;
8
- border-radius: 10px;
9
- background-color: rgb(248, 248, 248);
10
- -webkit-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
11
- -moz-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
12
- box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
13
- width: 42px;
14
- height: 22px;
15
- }
16
-
17
- .customize-control-clc-range-slider .ui-slider {
18
- position: relative;
19
- text-align: left;
20
- height: 2px;
21
- border-radius: 3px;
22
- border: none;
23
- margin-top: 10px;
24
- margin-left: 10px;
25
- display: inline-block;
26
- width: 202px;
27
- background: #d6d6d6;
28
- }
29
-
30
- .customize-control-clc-range-slider .ui-slider .ui-slider-handle {
31
- position: absolute;
32
- z-index: 2;
33
- top: -10px;
34
- cursor: default;
35
- -ms-touch-action: none;
36
- touch-action: none;
37
- width: 18px;
38
- height: 18px;
39
- -webkit-border-radius: 9px;
40
- -moz-border-radius: 9px;
41
- border-radius: 9px;
42
- background-color: #fff;
43
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
44
- -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
45
- box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
46
- border: solid 1px #d7d7d7;
47
- transform: translateX(-50%);
48
- }
49
-
50
- .customize-control-clc-range-slider .ui-slider .ui-slider-range {
51
- position: absolute;
52
- z-index: 1;
53
- font-size: 0.7em;
54
- display: block;
55
- border: 0;
56
- background-position: 0 0;
57
- background: #E04D43;
58
- top: 0;
59
- bottom: 0;
60
- }
61
-
62
- .clc-tooltip {
63
- width: 150px;
64
- position: absolute;
65
- background: #55AAD3;
66
- color: #EEE;
67
- font-size: 12px;
68
- min-height: 50px;
69
- border-radius: 5px;
70
- left: -75px; /* half of its width */
71
- bottom: 25px;
72
- z-index: 10;
73
- display: none;
74
- padding: 12px;
75
- line-height: 1.5;
76
- font-family: 'Arial', sans-serif;
77
- }
78
-
79
- .accordion-section-content > li:nth-of-type(2) .clc-tooltip {
80
- bottom: initial;
81
- top: 25px;
82
- }
83
-
84
- .dashicons.dashicons-editor-help {
85
- cursor: pointer;
86
- color: #55AAD3;
87
- }
88
-
89
- .dashicons.dashicons-editor-help:hover > .clc-tooltip {
90
- display: block;
91
- }
92
-
93
- .predefined-color-schemes-container {
94
- padding: 10px;
95
- }
96
-
97
- .predefined-color-schemes-container .ml-color-schemes-list {
98
- list-style-type: none;
99
- display: inline-block;
100
- text-align: center;
101
- }
102
-
103
- .predefined-color-schemes-container .ml-color-schemes-list li {
104
- display: inline-block;
105
- text-align: center;
106
- }
107
-
108
- .predefined-color-schemes-container .ml-color-schemes-list a img {
109
- width: 50px;
110
- }
111
-
112
- .customize-control-clc-templates {
113
- margin-bottom: 0;
114
- margin-top: -6px;
115
- position: relative;
116
- }
117
- .customize-control-clc-templates .colorlib-login-customizer-templates {
118
- margin-left: -3px;
119
- overflow-y: scroll;
120
- padding-left: 3px;
121
- padding-right: 3px;
122
- padding-top: 3px;
123
- width: calc(100% + 1px);
124
- }
125
- .customize-control-clc-templates .colorlib-login-customizer-templates__input {
126
- display: none !important;
127
- }
128
- .customize-control-clc-templates .colorlib-login-customizer-templates__input:checked + label {
129
- box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.7);
130
- }
131
- .customize-control-clc-templates .colorlib-login-customizer-templates__label {
132
- border-radius: 1px;
133
- border: 1px solid transparent;
134
- box-shadow: 0 0 0 0 #5b9dd9, 0 0 0 0 rgba(30, 140, 190, 0.8);
135
- cursor: pointer;
136
- display: block;
137
- margin: 0 0 8px;
138
- transition: border-color 100ms, box-shadow 100ms cubic-bezier(0.455, 0.03, 0.515, 0.955), transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
139
- }
140
- .customize-control-clc-templates .colorlib-login-customizer-templates__label:hover {
141
- box-shadow: 0 0 0 1px #5b9dd9, 0 0 3px rgba(0, 115, 170, 0.8);
142
- }
143
- .customize-control-clc-templates .colorlib-login-customizer-templates__label:active {
144
- transform: scale(0.985);
145
- }
146
- .customize-control-clc-templates .colorlib-login-customizer-templates__screenshot {
147
- background-position: center center;
148
- background-repeat: no-repeat;
149
- background-size: contain;
150
- border: 2px solid #eee;
151
- border-radius: 3px;
152
- bottom: 0;
153
- left: 0;
154
- position: absolute;
155
- right: 0;
156
- top: 0;
157
- }
158
- .customize-control-clc-templates .colorlib-login-customizer-templates__intrinsic {
159
- line-height: 0;
160
- margin-bottom: 0;
161
- overflow: hidden;
162
- position: relative;
163
- }
164
- .customize-control-clc-templates .colorlib-login-customizer-templates__intrinsic:after {
165
- content: "";
166
- display: block;
167
- padding-top: 70.4%;
168
- }
169
-
170
- /* Group Button */
171
- .colorlib-login-customizer-control-group {
172
- width: 100%;
173
- height: 33px;
174
- background: #FEFEFE;
175
- border-radius: 3px;
176
- line-height: 35px;
177
- cursor: pointer;
178
- box-sizing: border-box;
179
- border: solid 1px rgba(219, 219, 219, 0.9);
180
- -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.06);
181
- -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.06);
182
- box-shadow: 0 0 4px rgba(0, 0, 0, 0.06);
183
- height: 35px;
184
- }
185
-
186
- .colorlib-login-customizer-control-group a {
187
- float: left;
188
- height: 33px;
189
- background: rgba(150, 180, 150, 0);
190
- text-align: center;
191
- text-decoration: none;
192
- }
193
- .colorlib-login-customizer-control-group.colorlib-login-customizer-group-four a {
194
- width: 25%;
195
- }
196
-
197
- .colorlib-login-customizer-control-group.colorlib-login-customizer-group-three a {
198
- width: 33.333333%;
199
- }
200
-
201
- .colorlib-login-customizer-control-group.colorlib-login-customizer-group-two a {
202
- width: 50%;
203
- }
204
- .colorlib-login-customizer-control-group a.active {
205
- background-color: #fefefe;
206
- -webkit-box-shadow: inset 0 3px 0px #57a7c9, inset 2px 0px 5px 0px rgba(0, 0, 0, 0.05), inset -2px 0px 5px 0px rgba(0, 0, 0, 0.05);
207
- -moz-box-shadow: inset 0 3px 0px #57a7c9, inset 2px 0px 5px 0px rgba(0, 0, 0, 0.05), inset -2px 0px 5px 0px rgba(0, 0, 0, 0.05);
208
- box-shadow: inset 0 3px 0px #57a7c9, inset 2px 0px 5px 0px rgba(0, 0, 0, 0.05), inset -2px 0px 5px 0px rgba(0, 0, 0, 0.05); }
209
-
210
- /* Toggle */
211
- .customize-control-title.onoffswitch_label {
212
- display: block;
213
- float: left;
214
- margin: 0;
215
- height: 22px;
216
- line-height: 22px; }
217
-
218
- .onoffswitch_label {
219
- display: block; }
220
-
221
- .onoffswitch {
222
- position: relative;
223
- width: 52px;
224
- display: block;
225
- float: right;
226
- -webkit-user-select: none;
227
- -moz-user-select: none;
228
- -ms-user-select: none; }
229
-
230
- .onoffswitch-checkbox {
231
- display: none !important; }
232
-
233
- .onoffswitch-label {
234
- display: block;
235
- overflow: hidden;
236
- cursor: pointer;
237
- height: 22px;
238
- padding: 0;
239
- line-height: 19px;
240
- transition: background-color 0.2s ease-in;
241
- -webkit-border-radius: 11px;
242
- -moz-border-radius: 11px;
243
- border-radius: 30px;
244
- background-color: #c4c4c4;
245
- -webkit-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
246
- -moz-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
247
- box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11); }
248
- .onoffswitch-label:before {
249
- content: "";
250
- display: block;
251
- width: 18px;
252
- height: 18px;
253
- margin: 0;
254
- position: absolute;
255
- top: 2px;
256
- bottom: 0;
257
- right: 32px;
258
- background-color: #fff;
259
- -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
260
- -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
261
- box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
262
- -webkit-border-radius: 10px;
263
- -moz-border-radius: 10px;
264
- border-radius: 10px;
265
- transition: all 0.2s ease-in 0s; }
266
- .onoffswitch-label:after {
267
- content: "OFF";
268
- display: block;
269
- color: #FFF;
270
- position: absolute;
271
- top: 2px;
272
- bottom: 2px;
273
- right: 6px;
274
- font-size: 11px;
275
- font-family: 'Arial'; }
276
-
277
- .onoffswitch-checkbox:checked + .onoffswitch-label {
278
- background-color: #3caf0e; }
279
-
280
- .onoffswitch-checkbox:checked + .onoffswitch-label,
281
- .onoffswitch-checkbox:checked + .onoffswitch-label:before {
282
- border-color: #3caf0e; }
283
-
284
- .onoffswitch-checkbox:checked + .onoffswitch-label:before {
285
- right: 2px; }
286
-
287
- .onoffswitch-checkbox:checked + .onoffswitch-label:after {
288
- content: "ON";
289
- display: block;
290
- color: #FFF;
291
- position: absolute;
292
- top: 2px;
293
- bottom: 2px;
294
- right: 27px;
295
- font-size: 11px;
296
- font-family: 'Arial'; }
297
-
298
- /* Color Picker */
299
- .clc-color-picker-title {
300
- margin-left: 42px;
301
- margin-bottom: 0 !important;
302
- line-height: 24px !important;
303
- }
304
- .clc-color-picker-title .clc-color-picker-description {
305
- font-size: 13px;
306
- line-height: 16px;
307
- font-weight: initial;
308
- color: #959696;
309
- display: block; }
310
- .clc-color-picker-title .clc-color-picker-default {
311
- font-style: italic;
312
- font-weight: 300;
313
- color: #959696;
314
- cursor: pointer; }
315
- .clc-color-picker-title .clc-color-picker-default:hover, .clc-color-picker-title .clc-color-picker-default:focus {
316
- color: #55AAD3; }
317
-
318
- .minicolors-theme-default {
319
- display: block !important; }
320
- .minicolors-theme-default .clc-color-picker {
321
- z-index: 100;
322
- position: absolute;
323
- top: -20px;
324
- left: 50px;
325
- opacity: 0;
326
- visibility: hidden;
327
- width: 153px !important;
328
- padding: 5px;
329
- transition: all .1s ease-in; }
330
- .minicolors-theme-default.minicolors-focus .clc-color-picker {
331
- opacity: 1;
332
- visibility: visible; }
333
- .minicolors-theme-default .minicolors-input-swatch {
334
- width: 30px;
335
- height: 22px;
336
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
337
- -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
338
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
339
- cursor: pointer; }
340
-
341
- .lite {
342
- opacity: 0;
343
- visibility: hidden; }
344
-
345
- .minicolors-position-left .minicolors-panel {
346
- left: 50px; }
347
- .customize-control-clc-color-picker {
348
- padding: 18px 0 6px 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .customize-control-clc-range-slider input[type="text"] {
2
+ border: none;
3
+ text-align: center;
4
+ padding: 2px;
5
+ margin: 0;
6
+ font-size: 12px;
7
+ color: #333;
8
+ border-radius: 10px;
9
+ background-color: rgb(248, 248, 248);
10
+ -webkit-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
11
+ -moz-box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
12
+ box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.1);
13
+ width: 42px;
14
+ height: 22px;
15
+ }
16
+
17
+ .customize-control-clc-range-slider .ui-slider {
18
+ position: relative;
19
+ text-align: left;
20
+ height: 2px;
21
+ border-radius: 3px;
22
+ border: none;
23
+ margin-top: 10px;
24
+ margin-left: 10px;
25
+ display: inline-block;
26
+ width: 202px;
27
+ background: #d6d6d6;
28
+ }
29
+
30
+ .customize-control-clc-range-slider .ui-slider .ui-slider-handle {
31
+ position: absolute;
32
+ z-index: 2;
33
+ top: -10px;
34
+ cursor: default;
35
+ -ms-touch-action: none;
36
+ touch-action: none;
37
+ width: 18px;
38
+ height: 18px;
39
+ -webkit-border-radius: 9px;
40
+ -moz-border-radius: 9px;
41
+ border-radius: 9px;
42
+ background-color: #fff;
43
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
44
+ -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
45
+ box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
46
+ border: solid 1px #d7d7d7;
47
+ transform: translateX(-50%);
48
+ }
49
+
50
+ .customize-control-clc-range-slider .ui-slider .ui-slider-range {
51
+ position: absolute;
52
+ z-index: 1;
53
+ font-size: 0.7em;
54
+ display: block;
55
+ border: 0;
56
+ background-position: 0 0;
57
+ background: #E04D43;
58
+ top: 0;
59
+ bottom: 0;
60
+ }
61
+
62
+ .clc-tooltip {
63
+ width: 150px;
64
+ position: absolute;
65
+ background: #55AAD3;
66
+ color: #EEE;
67
+ font-size: 12px;
68
+ min-height: 50px;
69
+ border-radius: 5px;
70
+ left: -75px; /* half of its width */
71
+ bottom: 25px;
72
+ z-index: 10;
73
+ display: none;
74
+ padding: 12px;
75
+ line-height: 1.5;
76
+ font-family: 'Arial', sans-serif;
77
+ }
78
+
79
+ .accordion-section-content > li:nth-of-type(2) .clc-tooltip {
80
+ bottom: initial;
81
+ top: 25px;
82
+ }
83
+
84
+ .dashicons.dashicons-editor-help {
85
+ cursor: pointer;
86
+ color: #55AAD3;
87
+ }
88
+
89
+ .dashicons.dashicons-editor-help:hover > .clc-tooltip {
90
+ display: block;
91
+ }
92
+
93
+ .predefined-color-schemes-container {
94
+ padding: 10px;
95
+ }
96
+
97
+ .predefined-color-schemes-container .ml-color-schemes-list {
98
+ list-style-type: none;
99
+ display: inline-block;
100
+ text-align: center;
101
+ }
102
+
103
+ .predefined-color-schemes-container .ml-color-schemes-list li {
104
+ display: inline-block;
105
+ text-align: center;
106
+ }
107
+
108
+ .predefined-color-schemes-container .ml-color-schemes-list a img {
109
+ width: 50px;
110
+ }
111
+
112
+ .customize-control-clc-templates {
113
+ margin-bottom: 0;
114
+ margin-top: -6px;
115
+ position: relative;
116
+ }
117
+ .customize-control-clc-templates .colorlib-login-customizer-templates {
118
+ margin-left: -3px;
119
+ overflow-y: scroll;
120
+ padding-left: 3px;
121
+ padding-right: 3px;
122
+ padding-top: 3px;
123
+ width: calc(100% + 1px);
124
+ }
125
+ .customize-control-clc-templates .colorlib-login-customizer-templates__input {
126
+ display: none !important;
127
+ }
128
+ .customize-control-clc-templates .colorlib-login-customizer-templates__input:checked + label {
129
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, 0.7);
130
+ }
131
+ .customize-control-clc-templates .colorlib-login-customizer-templates__label {
132
+ border-radius: 1px;
133
+ border: 1px solid transparent;
134
+ box-shadow: 0 0 0 0 #5b9dd9, 0 0 0 0 rgba(30, 140, 190, 0.8);
135
+ cursor: pointer;
136
+ display: block;
137
+ margin: 0 0 8px;
138
+ transition: border-color 100ms, box-shadow 100ms cubic-bezier(0.455, 0.03, 0.515, 0.955), transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
139
+ }
140
+ .customize-control-clc-templates .colorlib-login-customizer-templates__label:hover {
141
+ box-shadow: 0 0 0 1px #5b9dd9, 0 0 3px rgba(0, 115, 170, 0.8);
142
+ }
143
+ .customize-control-clc-templates .colorlib-login-customizer-templates__label:active {
144
+ transform: scale(0.985);
145
+ }
146
+ .customize-control-clc-templates .colorlib-login-customizer-templates__screenshot {
147
+ background-position: center center;
148
+ background-repeat: no-repeat;
149
+ background-size: contain;
150
+ border: 2px solid #eee;
151
+ border-radius: 3px;
152
+ bottom: 0;
153
+ left: 0;
154
+ position: absolute;
155
+ right: 0;
156
+ top: 0;
157
+ }
158
+ .customize-control-clc-templates .colorlib-login-customizer-templates__intrinsic {
159
+ line-height: 0;
160
+ margin-bottom: 0;
161
+ overflow: hidden;
162
+ position: relative;
163
+ }
164
+ .customize-control-clc-templates .colorlib-login-customizer-templates__intrinsic:after {
165
+ content: "";
166
+ display: block;
167
+ padding-top: 70.4%;
168
+ }
169
+
170
+ /* Group Button */
171
+ .colorlib-login-customizer-control-group {
172
+ width: 100%;
173
+ height: 33px;
174
+ background: #FEFEFE;
175
+ border-radius: 3px;
176
+ line-height: 35px;
177
+ cursor: pointer;
178
+ box-sizing: border-box;
179
+ border: solid 1px rgba(219, 219, 219, 0.9);
180
+ -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.06);
181
+ -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.06);
182
+ box-shadow: 0 0 4px rgba(0, 0, 0, 0.06);
183
+ height: 35px;
184
+ }
185
+
186
+ .colorlib-login-customizer-control-group a {
187
+ float: left;
188
+ height: 33px;
189
+ background: rgba(150, 180, 150, 0);
190
+ text-align: center;
191
+ text-decoration: none;
192
+ }
193
+ .colorlib-login-customizer-control-group.colorlib-login-customizer-group-four a {
194
+ width: 25%;
195
+ }
196
+
197
+ .colorlib-login-customizer-control-group.colorlib-login-customizer-group-three a {
198
+ width: 33.333333%;
199
+ }
200
+
201
+ .colorlib-login-customizer-control-group.colorlib-login-customizer-group-two a {
202
+ width: 50%;
203
+ }
204
+ .colorlib-login-customizer-control-group a.active {
205
+ background-color: #fefefe;
206
+ -webkit-box-shadow: inset 0 3px 0px #57a7c9, inset 2px 0px 5px 0px rgba(0, 0, 0, 0.05), inset -2px 0px 5px 0px rgba(0, 0, 0, 0.05);
207
+ -moz-box-shadow: inset 0 3px 0px #57a7c9, inset 2px 0px 5px 0px rgba(0, 0, 0, 0.05), inset -2px 0px 5px 0px rgba(0, 0, 0, 0.05);
208
+ box-shadow: inset 0 3px 0px #57a7c9, inset 2px 0px 5px 0px rgba(0, 0, 0, 0.05), inset -2px 0px 5px 0px rgba(0, 0, 0, 0.05); }
209
+
210
+ /* Toggle */
211
+ .customize-control-title.onoffswitch_label {
212
+ display: block;
213
+ float: left;
214
+ margin: 0;
215
+ height: 22px;
216
+ line-height: 22px; }
217
+
218
+ .onoffswitch_label {
219
+ display: block; }
220
+
221
+ .onoffswitch {
222
+ position: relative;
223
+ width: 52px;
224
+ display: block;
225
+ float: right;
226
+ -webkit-user-select: none;
227
+ -moz-user-select: none;
228
+ -ms-user-select: none; }
229
+
230
+ .onoffswitch-checkbox {
231
+ display: none !important; }
232
+
233
+ .onoffswitch-label {
234
+ display: block;
235
+ overflow: hidden;
236
+ cursor: pointer;
237
+ height: 22px;
238
+ padding: 0;
239
+ line-height: 19px;
240
+ transition: background-color 0.2s ease-in;
241
+ -webkit-border-radius: 11px;
242
+ -moz-border-radius: 11px;
243
+ border-radius: 30px;
244
+ background-color: #c4c4c4;
245
+ -webkit-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
246
+ -moz-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11);
247
+ box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.11); }
248
+ .onoffswitch-label:before {
249
+ content: "";
250
+ display: block;
251
+ width: 18px;
252
+ height: 18px;
253
+ margin: 0;
254
+ position: absolute;
255
+ top: 2px;
256
+ bottom: 0;
257
+ right: 32px;
258
+ background-color: #fff;
259
+ -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
260
+ -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
261
+ box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
262
+ -webkit-border-radius: 10px;
263
+ -moz-border-radius: 10px;
264
+ border-radius: 10px;
265
+ transition: all 0.2s ease-in 0s; }
266
+ .onoffswitch-label:after {
267
+ content: "OFF";
268
+ display: block;
269
+ color: #FFF;
270
+ position: absolute;
271
+ top: 2px;
272
+ bottom: 2px;
273
+ right: 6px;
274
+ font-size: 11px;
275
+ font-family: 'Arial'; }
276
+
277
+ .onoffswitch-checkbox:checked + .onoffswitch-label {
278
+ background-color: #3caf0e; }
279
+
280
+ .onoffswitch-checkbox:checked + .onoffswitch-label,
281
+ .onoffswitch-checkbox:checked + .onoffswitch-label:before {
282
+ border-color: #3caf0e; }
283
+
284
+ .onoffswitch-checkbox:checked + .onoffswitch-label:before {
285
+ right: 2px; }
286
+
287
+ .onoffswitch-checkbox:checked + .onoffswitch-label:after {
288
+ content: "ON";
289
+ display: block;
290
+ color: #FFF;
291
+ position: absolute;
292
+ top: 2px;
293
+ bottom: 2px;
294
+ right: 27px;
295
+ font-size: 11px;
296
+ font-family: 'Arial'; }
297
+
298
+ /* Color Picker */
299
+ .clc-color-picker-title {
300
+ margin-left: 42px;
301
+ margin-bottom: 0 !important;
302
+ line-height: 24px !important;
303
+ }
304
+ .clc-color-picker-title .clc-color-picker-description {
305
+ font-size: 13px;
306
+ line-height: 16px;
307
+ font-weight: initial;
308
+ color: #959696;
309
+ display: block; }
310
+ .clc-color-picker-title .clc-color-picker-default {
311
+ font-style: italic;
312
+ font-weight: 300;
313
+ color: #959696;
314
+ cursor: pointer; }
315
+ .clc-color-picker-title .clc-color-picker-default:hover, .clc-color-picker-title .clc-color-picker-default:focus {
316
+ color: #55AAD3; }
317
+
318
+ .minicolors-theme-default {
319
+ display: block !important; }
320
+ .minicolors-theme-default .clc-color-picker {
321
+ z-index: 100;
322
+ position: absolute;
323
+ top: -20px;
324
+ left: 50px;
325
+ opacity: 0;
326
+ visibility: hidden;
327
+ width: 153px !important;
328
+ padding: 5px;
329
+ transition: all .1s ease-in; }
330
+ .minicolors-theme-default.minicolors-focus .clc-color-picker {
331
+ opacity: 1;
332
+ visibility: visible; }
333
+ .minicolors-theme-default .minicolors-input-swatch {
334
+ width: 30px;
335
+ height: 22px;
336
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
337
+ -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
338
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
339
+ cursor: pointer; }
340
+
341
+ .lite {
342
+ opacity: 0;
343
+ visibility: hidden; }
344
+
345
+ .minicolors-position-left .minicolors-panel {
346
+ left: 50px; }
347
+ .customize-control-clc-color-picker {
348
+ padding: 18px 0 6px 0; }
349
+
350
+ /* Layout Columns */
351
+ .clc-layouts-container-advanced .clc-layouts-setup {
352
+ display: inline-block;
353
+ width: 100%;
354
+ }
355
+ .clc-layouts-container-advanced .clc-column {
356
+ border-right: 4px solid #f4f4f4;
357
+ float: left;
358
+ position: relative;
359
+ box-sizing: border-box;
360
+ height: 40px;
361
+ background-color: #cacaca;
362
+ -webkit-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.15);
363
+ -moz-box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.15);
364
+ box-shadow: inset 0 2px 1px rgba(0, 0, 0, 0.15);
365
+ text-align: center;
366
+ }
367
+ .clc-layouts-container-advanced .clc-column.col12 {
368
+ width: 100%;
369
+ }
370
+ .clc-layouts-container-advanced .clc-column.col11 {
371
+ width: 91.66666667%;
372
+ }
373
+ .clc-layouts-container-advanced .clc-column.col10 {
374
+ width: 83.33333333%;
375
+ }
376
+ .clc-layouts-container-advanced .clc-column.col9 {
377
+ width: 75%;
378
+ }
379
+ .clc-layouts-container-advanced .clc-column.col8 {
380
+ width: 66.66666667%;
381
+ }
382
+ .clc-layouts-container-advanced .clc-column.col7 {
383
+ width: 58.33333333%;
384
+ }
385
+ .clc-layouts-container-advanced .clc-column.col6 {
386
+ width: 50%; }
387
+ .clc-layouts-container-advanced .clc-column.col5 {
388
+ width: 41.66666667%;
389
+ }
390
+ .clc-layouts-container-advanced .clc-column.col4 {
391
+ width: 33.33333333%;
392
+ }
393
+ .clc-layouts-container-advanced .clc-column.col3 {
394
+ width: 25%;
395
+ }
396
+ .clc-layouts-container-advanced .clc-column.col2 {
397
+ width: 16.66666667%;
398
+ }
399
+ .clc-layouts-container-advanced .clc-column.col1 {
400
+ width: 8.33333333%;
401
+ }
402
+ .clc-layouts-container-advanced .clc-column a {
403
+ opacity: .2;
404
+ width: 17px;
405
+ height: 17px;
406
+ -webkit-border-radius: 3px;
407
+ -moz-border-radius: 3px;
408
+ border-radius: 3px;
409
+ background-color: #e14d43;
410
+ color: #fff;
411
+ position: absolute;
412
+ top: 50%;
413
+ left: 2%;
414
+ -webkit-transform: translate(0%, -50%);
415
+ -ms-transform: translate(0%, -50%);
416
+ -o-transform: translate(0%, -50%);
417
+ transform: translate(0%, -50%);
418
+ -webkit-transition: opacity .2s;
419
+ transition: opacity .2s;
420
+ }
421
+ .clc-layouts-container-advanced .clc-column a .dashicons {
422
+ font-size: 12px;
423
+ line-height: 17px;
424
+ width: initial;
425
+ height: initial;
426
+ }
427
+ .clc-layouts-container-advanced .clc-column.clc-column-left a {
428
+ left: auto;
429
+ right: 2%;
430
+ }
431
+ .clc-layouts-container-advanced .clc-column:hover > a,
432
+ .clc-layouts-container-advanced .clc-column:focus > a {
433
+ opacity: 1;
434
+ -webkit-transition: opacity .2s;
435
+ transition: opacity .2s;
436
+ }
assets/img/tpl-03/bg.jpg ADDED
Binary file
assets/img/tpl-03/screen.jpg ADDED
Binary file
assets/img/tpl-04/screen.jpg ADDED
Binary file
assets/js/clc-customizer.js CHANGED
@@ -54,7 +54,8 @@
54
  var control = this,
55
  controlField = control.container.find( 'input.clc-slider' ),
56
  controlSlider = control.container.find( 'div.clc-slider' ),
57
- controlSliderData = control.params.choices;
 
58
 
59
  controlSlider.slider({
60
  range: 'min',
@@ -67,9 +68,25 @@
67
  },
68
  stop: function( event, ui ) {
69
  controlField.val( ui.value );
 
70
  control.setting.set( ui.value );
 
 
 
 
 
 
 
 
 
 
71
  }
 
 
 
 
72
  });
 
73
  }
74
  });
75
 
@@ -105,6 +122,85 @@
105
  }
106
  });
107
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  wp.customize.controlConstructor['clc-color-picker'] = wp.customize.Control.extend({
109
  ready: function() {
110
  var control = this,
@@ -113,7 +209,7 @@
113
  input = $( control.container ).find( '.clc-color-picker' );
114
 
115
  input.minicolors({
116
- format: 'rgb',
117
  opacity: true,
118
  keywords: 'transparent, initial, inherit',
119
  change: function( value, opacity ) {
@@ -159,19 +255,45 @@
159
  });
160
 
161
  wp.customize( 'clc-options[columns]', function( value ) {
162
-
163
  value.bind( function( to ) {
164
  var alignControl = wp.customize.control( 'clc-options[form-column-align]' ),
165
  backgroundControl = wp.customize.control( 'clc-options[custom-background-form]' ),
 
166
  backgroundColorControl = wp.customize.control( 'clc-options[custom-background-color-form]' );
167
  if ( '2' === to ) {
168
  alignControl.toggle( true );
169
  backgroundControl.toggle( true );
170
  backgroundColorControl.toggle( true );
 
171
  } else {
172
  alignControl.toggle( false );
173
  backgroundControl.toggle( false );
174
  backgroundColorControl.toggle( false );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  }
176
  });
177
  });
54
  var control = this,
55
  controlField = control.container.find( 'input.clc-slider' ),
56
  controlSlider = control.container.find( 'div.clc-slider' ),
57
+ controlSliderData = control.params.choices,
58
+ updating = false;
59
 
60
  controlSlider.slider({
61
  range: 'min',
68
  },
69
  stop: function( event, ui ) {
70
  controlField.val( ui.value );
71
+ updating = true;
72
  control.setting.set( ui.value );
73
+ updating = false;
74
+ }
75
+ });
76
+
77
+ // Whenever the setting's value changes, refresh the preview.
78
+ control.setting.bind( function( value ) {
79
+
80
+ // Bail if the update came from the control itself.
81
+ if ( updating ) {
82
+ return;
83
  }
84
+
85
+ controlField.val( value );
86
+ controlSlider.slider( 'value', value );
87
+
88
  });
89
+
90
  }
91
  });
92
 
122
  }
123
  });
124
 
125
+ wp.customize.controlConstructor['clc-column-width'] = wp.customize.Control.extend({
126
+ ready: function() {
127
+ var control = this,
128
+ updating = false;
129
+
130
+ control.values = control.params.value;
131
+
132
+ control.container.on( 'click', '.clc-layouts-setup .clc-column > a', function() {
133
+ var currentAction = $( this ).data( 'action' );
134
+
135
+ updating = true;
136
+ control.updateColumns( currentAction );
137
+ updating = false;
138
+
139
+ });
140
+
141
+ // Whenever the setting's value changes, refresh the preview.
142
+ control.setting.bind( function( value ) {
143
+
144
+ // Bail if the update came from the control itself.
145
+ if ( updating ) {
146
+ return;
147
+ }
148
+
149
+ control.values = value;
150
+ control.rederColumns();
151
+
152
+ });
153
+
154
+ },
155
+
156
+ updateColumns: function( increment ) {
157
+ var incrementElement,
158
+ decrementElement,
159
+ control = this;
160
+
161
+ if ( 11 === control.values[ increment ] ) {
162
+ return;
163
+ }
164
+
165
+ if ( 'left' == increment ) {
166
+ incrementElement = control.container.find( '.clc-column-left' );
167
+ decrementElement = control.container.find( '.clc-column-right' );
168
+
169
+ control.values['left'] += 1;
170
+ control.values['right'] -= 1;
171
+
172
+ }else{
173
+ incrementElement = control.container.find( '.clc-column-right' );
174
+ decrementElement = control.container.find( '.clc-column-left' );
175
+
176
+ control.values['right'] += 1;
177
+ control.values['left'] -= 1;
178
+
179
+ }
180
+
181
+ // Update control values
182
+ control.setting( '' );
183
+ control.setting( control.values );
184
+
185
+ control.rederColumns();
186
+
187
+ },
188
+
189
+ rederColumns: function() {
190
+ var control = this,
191
+ leftColumn = control.container.find( '.clc-column-left' ),
192
+ rightColumn = control.container.find( '.clc-column-right' ),
193
+ classes = 'col12 col11 col10 col9 col8 col7 col6 col5 col4 col3 col2 col1';
194
+
195
+ leftColumn.removeClass( classes ).addClass( 'col' + control.values['left'] );
196
+ rightColumn.removeClass( classes ).addClass( 'col' + control.values['right'] );
197
+
198
+ }
199
+
200
+
201
+
202
+ });
203
+
204
  wp.customize.controlConstructor['clc-color-picker'] = wp.customize.Control.extend({
205
  ready: function() {
206
  var control = this,
209
  input = $( control.container ).find( '.clc-color-picker' );
210
 
211
  input.minicolors({
212
+ format: 'hex',
213
  opacity: true,
214
  keywords: 'transparent, initial, inherit',
215
  change: function( value, opacity ) {
255
  });
256
 
257
  wp.customize( 'clc-options[columns]', function( value ) {
 
258
  value.bind( function( to ) {
259
  var alignControl = wp.customize.control( 'clc-options[form-column-align]' ),
260
  backgroundControl = wp.customize.control( 'clc-options[custom-background-form]' ),
261
+ columnsWidthControl = wp.customize.control( 'clc-options[columns-width]' ),
262
  backgroundColorControl = wp.customize.control( 'clc-options[custom-background-color-form]' );
263
  if ( '2' === to ) {
264
  alignControl.toggle( true );
265
  backgroundControl.toggle( true );
266
  backgroundColorControl.toggle( true );
267
+ columnsWidthControl.toggle( true );
268
  } else {
269
  alignControl.toggle( false );
270
  backgroundControl.toggle( false );
271
  backgroundColorControl.toggle( false );
272
+ columnsWidthControl.toggle( false );
273
+ }
274
+ });
275
+ });
276
+
277
+ wp.customize( 'clc-options[use-text-logo]', function( value ) {
278
+ value.bind( function( to ) {
279
+ var logoText = wp.customize.control( 'clc-options[logo-text]' ),
280
+ logoTextColor = wp.customize.control( 'clc-options[logo-text-color]' ),
281
+ logoTextColorHover = wp.customize.control( 'clc-options[logo-text-color-hover]' ),
282
+ logoTextSize = wp.customize.control( 'clc-options[logo-text-size]' ),
283
+ logoImage = wp.customize.control( 'clc-options[custom-logo]' );
284
+
285
+ if ( '1' == to ) {
286
+ logoText.toggle( true );
287
+ logoTextColor.toggle( true );
288
+ logoTextColorHover.toggle( true );
289
+ logoTextSize.toggle( true );
290
+ logoImage.toggle( false );
291
+ }else{
292
+ logoText.toggle( false );
293
+ logoTextColor.toggle( false );
294
+ logoTextColorHover.toggle( false );
295
+ logoTextSize.toggle( false );
296
+ logoImage.toggle( true );
297
  }
298
  });
299
  });
assets/js/clc-preview.js CHANGED
@@ -46,12 +46,12 @@
46
  return '';
47
  }
48
 
49
- if ( $.inArray( this.settings[ option ].attribute, [ 'width', 'min-width', 'max-width', 'background-size', 'height', 'min-height', 'max-height' ] ) >= 0 ) {
50
  line += this.settings[ option ].value + 'px';
51
  }else if ( 'background-image' === this.settings[ option ].attribute ) {
52
  line += 'url(' + this.settings[ option ].value + ')';
53
  }else if ( 'display' === this.settings[ option ].attribute ) {
54
- if ( '1' === this.settings[ option ].value ) {
55
  line += 'none';
56
  } else {
57
  line += 'block';
@@ -79,6 +79,23 @@
79
  } );
80
  } );
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /* Column Align */
83
  wp.customize( 'clc-options[form-column-align]', function( value ) {
84
  value.bind( function( to ) {
@@ -103,6 +120,48 @@
103
  } );
104
  } );
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
  $( '.clc-preview-event' ).click( function() {
107
  wp.customize.preview.send( 'clc-focus-section', $( this ).data( 'section' ) );
108
  } );
46
  return '';
47
  }
48
 
49
+ if ( $.inArray( this.settings[ option ].attribute, [ 'width', 'min-width', 'max-width', 'background-size', 'height', 'min-height', 'max-height', 'font-size' ] ) >= 0 ) {
50
  line += this.settings[ option ].value + 'px';
51
  }else if ( 'background-image' === this.settings[ option ].attribute ) {
52
  line += 'url(' + this.settings[ option ].value + ')';
53
  }else if ( 'display' === this.settings[ option ].attribute ) {
54
+ if ( this.settings[ option ].value ) {
55
  line += 'none';
56
  } else {
57
  line += 'block';
79
  } );
80
  } );
81
 
82
+ // Add class if we have text logo
83
+ wp.customize( 'clc-options[use-text-logo]', function( value ) {
84
+ value.bind( function( to ) {
85
+ if ( to ) {
86
+ $( 'body' ).addClass( 'clc-text-logo' );
87
+ } else {
88
+ $( 'body' ).removeClass( 'clc-text-logo' );
89
+ }
90
+ } );
91
+ } );
92
+
93
+ wp.customize( 'clc-options[logo-text]', function( value ) {
94
+ value.bind( function( to ) {
95
+ $( '#logo-text' ).text( to );
96
+ } );
97
+ } );
98
+
99
  /* Column Align */
100
  wp.customize( 'clc-options[form-column-align]', function( value ) {
101
  value.bind( function( to ) {
120
  } );
121
  } );
122
 
123
+ // Custom CSS
124
+ wp.customize( 'clc-options[custom-css]', function( value ) {
125
+ value.bind( function( to ) {
126
+ $( '#clc-custom-css' ).text( to );
127
+ } );
128
+ } );
129
+
130
+ // Username label
131
+ wp.customize( 'clc-options[username-label]', function( value ) {
132
+ value.bind( function( to ) {
133
+ $( '#clc-username-label' ).text( to );
134
+ } );
135
+ } );
136
+
137
+ // Password label
138
+ wp.customize( 'clc-options[password-label]', function( value ) {
139
+ value.bind( function( to ) {
140
+ $( '#clc-password-label' ).text( to );
141
+ } );
142
+ } );
143
+
144
+ // Columns width
145
+ wp.customize( 'clc-options[columns-width]', function( value ) {
146
+ value.bind( function( to ) {
147
+ var customCSS = '',
148
+ leftWidth,
149
+ rightWidth;
150
+ if ( '' !== to && undefined !== to.left && undefined !== to.right ) {
151
+ leftWidth = ( 100 / 12 )*parseInt( to.left, 10 );
152
+ rightWidth = ( 100 / 12 )*parseInt( to.right, 10 );
153
+ customCSS = '.ml-half-screen.ml-login-align-3 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-1 .ml-container .ml-form-container{ width:' + leftWidth + '%; }';
154
+ customCSS += '.ml-half-screen.ml-login-align-4 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-2 .ml-container .ml-form-container{ flex-basis:' + leftWidth + '%; }';
155
+
156
+ customCSS += '.ml-half-screen.ml-login-align-3 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-1 .ml-container .ml-extra-div{ width:' + rightWidth + '%; }';
157
+ customCSS += '.ml-half-screen.ml-login-align-4 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-2 .ml-container .ml-extra-div{ flex-basis:' + rightWidth + '%; }';
158
+
159
+ $( '#clc-columns-style' ).text( customCSS );
160
+
161
+ }
162
+ } );
163
+ } );
164
+
165
  $( '.clc-preview-event' ).click( function() {
166
  wp.customize.preview.send( 'clc-focus-section', $( this ).data( 'section' ) );
167
  } );
colorlib-login-customizer.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
- /*
3
- * Plugin Name: Colorlib Login Customizer
4
- * Version: 1.1.0
5
- * Description: Colorlib Login Customizer is an awesome and intuitive plugin that helps you personalize your login form directly from the Customizer. The plugin fully supports the Live Customizer feature and you can see all the changes in real time and edit them.
6
- * Author: Colorlib
7
- * Author URI: https://colorlib.com/
8
- * Requires at least: 4.0
9
- * Tested up to: 4.7
10
- *
11
- * Text Domain: colorlib-login-customizer
12
- * Domain Path: /languages/
13
- *
14
- * @package WordPress
15
- * @author Colorlib
16
- * @since 1.0.0
17
- */
18
-
19
- if ( ! defined( 'ABSPATH' ) ) {
20
- exit;
21
- }
22
-
23
- define( 'COLORLIB_LOGIN_CUSTOMIZER_BASE', plugin_dir_path( __FILE__ ) );
24
- define( 'COLORLIB_LOGIN_CUSTOMIZER_URL', plugin_dir_url( __FILE__ ) );
25
- define( 'COLORLIB_LOGIN_CUSTOMIZER_SITE', rtrim( ABSPATH, '\\/' ) );
26
-
27
- // Load plugin class files
28
- require_once 'includes/class-colorlib-login-customizer-autoloader.php';
29
-
30
- /**
31
- * Returns the main instance of Colorlib_Login_Customizer to prevent the need to use globals.
32
- *
33
- * @since 1.0.0
34
- * @return object Colorlib_Login_Customizer
35
- */
36
- function colorlib_login_customizer() {
37
- $instance = Colorlib_Login_Customizer::instance( __FILE__, '1.1.0' );
38
-
39
- if ( is_null( $instance->settings ) ) {
40
- $instance->settings = Colorlib_Login_Customizer_Settings::instance( $instance );
41
- }
42
-
43
- return $instance;
44
- }
45
-
46
- colorlib_login_customizer();
1
+ <?php
2
+ /*
3
+ * Plugin Name: Colorlib Login Customizer
4
+ * Version: 1.2.0
5
+ * Description: Colorlib Login Customizer is an awesome and intuitive plugin that helps you personalize your login form directly from the Customizer. The plugin fully supports the Live Customizer feature and you can see all the changes in real time and edit them.
6
+ * Author: Colorlib
7
+ * Author URI: https://colorlib.com/
8
+ * Requires at least: 4.0
9
+ * Tested up to: 4.9
10
+ *
11
+ * Text Domain: colorlib-login-customizer
12
+ * Domain Path: /languages/
13
+ *
14
+ * @package WordPress
15
+ * @author Colorlib
16
+ * @since 1.0.0
17
+ */
18
+
19
+ if ( ! defined( 'ABSPATH' ) ) {
20
+ exit;
21
+ }
22
+
23
+ define( 'COLORLIB_LOGIN_CUSTOMIZER_BASE', plugin_dir_path( __FILE__ ) );
24
+ define( 'COLORLIB_LOGIN_CUSTOMIZER_URL', plugin_dir_url( __FILE__ ) );
25
+ define( 'COLORLIB_LOGIN_CUSTOMIZER_SITE', rtrim( ABSPATH, '\\/' ) );
26
+
27
+ // Load plugin class files
28
+ require_once 'includes/class-colorlib-login-customizer-autoloader.php';
29
+
30
+ /**
31
+ * Returns the main instance of Colorlib_Login_Customizer to prevent the need to use globals.
32
+ *
33
+ * @since 1.0.0
34
+ * @return object Colorlib_Login_Customizer
35
+ */
36
+ function colorlib_login_customizer() {
37
+ $instance = Colorlib_Login_Customizer::instance( __FILE__, '1.2.0' );
38
+
39
+ if ( is_null( $instance->settings ) ) {
40
+ $instance->settings = Colorlib_Login_Customizer_Settings::instance( $instance );
41
+ }
42
+
43
+ return $instance;
44
+ }
45
+
46
+ colorlib_login_customizer();
includes/class-colorlib-login-customizer-autoloader.php CHANGED
@@ -1,46 +1,46 @@
1
- <?php
2
- if ( ! defined( 'WPINC' ) ) {
3
- die;
4
- }
5
-
6
- /**
7
- * Class Colorlib_Login_Customizer_Autoloader
8
- */
9
- class Colorlib_Login_Customizer_Autoloader {
10
- /**
11
- * Colorlib_Login_Customizer_Autoloader constructor.
12
- */
13
- public function __construct() {
14
- spl_autoload_register( array( $this, 'load' ) );
15
- }
16
-
17
- /**
18
- * @param $class
19
- */
20
- public function load( $class ) {
21
- $parts = explode( '_', $class );
22
- $bind = implode( '-', $parts );
23
-
24
- if ( 'Colorlib' == $parts[0] ) {
25
-
26
- /*
27
- * Core library autoload.
28
- */
29
- $directories = array(
30
- COLORLIB_LOGIN_CUSTOMIZER_BASE . '/includes',
31
- COLORLIB_LOGIN_CUSTOMIZER_BASE . '/includes/lib',
32
- COLORLIB_LOGIN_CUSTOMIZER_BASE . '/includes/lib/controls',
33
- );
34
-
35
- foreach ( $directories as $directory ) {
36
- if ( file_exists( $directory . '/class-' . strtolower( $bind ) . '.php' ) ) {
37
- require_once $directory . '/class-' . strtolower( $bind ) . '.php';
38
-
39
- return;
40
- }
41
- }
42
- }
43
- }
44
- }
45
-
46
- $autoloader = new Colorlib_Login_Customizer_Autoloader();
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) {
3
+ die;
4
+ }
5
+
6
+ /**
7
+ * Class Colorlib_Login_Customizer_Autoloader
8
+ */
9
+ class Colorlib_Login_Customizer_Autoloader {
10
+ /**
11
+ * Colorlib_Login_Customizer_Autoloader constructor.
12
+ */
13
+ public function __construct() {
14
+ spl_autoload_register( array( $this, 'load' ) );
15
+ }
16
+
17
+ /**
18
+ * @param $class
19
+ */
20
+ public function load( $class ) {
21
+ $parts = explode( '_', $class );
22
+ $bind = implode( '-', $parts );
23
+
24
+ if ( 'Colorlib' == $parts[0] ) {
25
+
26
+ /*
27
+ * Core library autoload.
28
+ */
29
+ $directories = array(
30
+ COLORLIB_LOGIN_CUSTOMIZER_BASE . '/includes',
31
+ COLORLIB_LOGIN_CUSTOMIZER_BASE . '/includes/lib',
32
+ COLORLIB_LOGIN_CUSTOMIZER_BASE . '/includes/lib/controls',
33
+ );
34
+
35
+ foreach ( $directories as $directory ) {
36
+ if ( file_exists( $directory . '/class-' . strtolower( $bind ) . '.php' ) ) {
37
+ require_once $directory . '/class-' . strtolower( $bind ) . '.php';
38
+
39
+ return;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ $autoloader = new Colorlib_Login_Customizer_Autoloader();
includes/class-colorlib-login-customizer-feedback.php CHANGED
@@ -1,262 +1,262 @@
1
- <?php
2
-
3
- class Colorlib_Login_Customizer_Feedback {
4
-
5
- private $plugin_file = '';
6
- private $plugin_name = '';
7
-
8
- function __construct( $_plugin_file ) {
9
-
10
- $this->plugin_file = $_plugin_file;
11
- $this->plugin_name = basename( $this->plugin_file, '.php' );
12
-
13
- // Deactivation
14
- add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ) );
15
- add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) );
16
- add_action( 'wp_ajax_epsilon_deactivate_plugin', array( $this, 'epsilon_deactivate_plugin_callback' ) );
17
-
18
- }
19
-
20
- /**
21
- * Filter the deactivation link to allow us to present a form when the user deactivates the plugin
22
- * @since 1.0.0
23
- */
24
- public function filter_action_links( $links ) {
25
-
26
- if ( isset( $links['deactivate'] ) ) {
27
- $deactivation_link = $links['deactivate'];
28
- // Insert an onClick action to allow form before deactivating
29
- $deactivation_link = str_replace( '<a ', '<div class="epsilon-deactivate-form-wrapper"><span class="epsilon-deactivate-form" id="epsilon-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span></div><a onclick="javascript:event.preventDefault();" id="epsilon-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
30
- $links['deactivate'] = $deactivation_link;
31
- }
32
- return $links;
33
- }
34
-
35
- /**
36
- * Form text strings
37
- * These can be filtered
38
- * @since 1.0.0
39
- */
40
- public function goodbye_ajax() {
41
- // Get our strings for the form
42
- $form = $this->get_form_info();
43
-
44
- // Build the HTML to go in the form
45
- $html = '<div class="epsilon-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>';
46
- $html .= '<div class="epsilon-deactivate-form-body"><p>' . esc_html( $form['body'] ) . '</p>';
47
- if ( is_array( $form['options'] ) ) {
48
- $html .= '<div class="epsilon-deactivate-options"><p>';
49
- foreach ( $form['options'] as $key => $option ) {
50
- if ( 'no-reason' == $key ) {
51
- $html .= '<input type="radio" name="epsilon-deactivate-reason" checked="checked" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
52
- } else {
53
- $html .= '<input type="radio" name="epsilon-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
54
- }
55
- }
56
- $html .= '</p><label id="epsilon-deactivate-details-label" for="epsilon-deactivate-reasons"><strong>' . esc_html( $form['details'] ) . '</strong></label><textarea name="epsilon-deactivate-details" id="epsilon-deactivate-details" rows="2" style="width:100%"></textarea>';
57
- $html .= '<input type="checkbox" name="epsilon-deactivate-tracking" checked="" id="allow-tracking" value="yes"> <label for="allow-tracking">' . esc_html__( 'Allow us to get more information in order to improve our plugin', 'colorlib-login-customizer' ) . '</label><br>';
58
- $html .= '</div><!-- .epsilon-deactivate-options -->';
59
- }
60
- $html .= '</div><!-- .epsilon-deactivate-form-body -->';
61
- $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'colorlib-login-customizer' ) . '</p>';
62
- $html .= '<div class="epsilon-deactivate-form-footer"><p><a id="epsilon-deactivate-plugin" href="#">' . __( 'Just Deactivate', 'colorlib-login-customizer' ) . '</a><a id="epsilon-deactivate-submit-form" class="button button-primary" href="#">' . __( 'Submit and Deactivate', 'colorlib-login-customizer' ) . '</a></p></div>'
63
- ?>
64
- <div class="epsilon-deactivate-form-bg"></div>
65
- <style type="text/css">
66
- .epsilon-deactivate-form-active .epsilon-deactivate-form-bg {
67
- background: rgba( 0, 0, 0, .5 );
68
- position: fixed;
69
- top: 0;
70
- left: 0;
71
- width: 100%;
72
- height: 100%;
73
- }
74
- .epsilon-deactivate-form-wrapper {
75
- position: relative;
76
- z-index: 999;
77
- display: none;
78
- }
79
- .epsilon-deactivate-form-active .epsilon-deactivate-form-wrapper {
80
- display: block;
81
- }
82
- .epsilon-deactivate-form {
83
- display: none;
84
- }
85
- .epsilon-deactivate-form-active .epsilon-deactivate-form {
86
- position: absolute;
87
- bottom: 30px;
88
- left: 0;
89
- width: 400px;
90
- background: #fff;
91
- white-space: normal;
92
- }
93
- .epsilon-deactivate-form-head {
94
- background: #51AD31;
95
- color: #fff;
96
- padding: 8px 18px;
97
- }
98
- .epsilon-deactivate-form-body {
99
- padding: 8px 18px;
100
- color: #444;
101
- }
102
- .deactivating-spinner {
103
- display: none;
104
- }
105
- .deactivating-spinner .spinner {
106
- float: none;
107
- margin: 4px 4px 0 18px;
108
- vertical-align: bottom;
109
- visibility: visible;
110
- }
111
- .epsilon-deactivate-form-footer {
112
- padding: 8px 18px;
113
- }
114
- .epsilon-deactivate-form-footer p {
115
- display: flex;
116
- align-items: center;
117
- justify-content: space-between;
118
- }
119
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body,
120
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer {
121
- position: relative;
122
- }
123
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body:after,
124
- .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer:after {
125
- content: "";
126
- display: block;
127
- position: absolute;
128
- top: 0;
129
- left: 0;
130
- width: 100%;
131
- height: 100%;
132
- background-color: rgba( 255, 255, 255, .5 );
133
- }
134
- </style>
135
- <script>
136
- jQuery(document).ready(function($){
137
- var deactivateURL = $("#epsilon-deactivate-link-<?php echo esc_attr( $this->plugin_name ); ?>"),
138
- formContainer = $('#epsilon-deactivate-form-<?php echo esc_attr( $this->plugin_name ); ?>'),
139
- detailsStrings = {
140
- 'no-reson' : '<?php echo __( 'How could we improve ?', 'colorlib-login-customizer' ); ?>',
141
- 'setup' : '<?php echo __( 'What was the dificult part ?', 'colorlib-login-customizer' ); ?>',
142
- 'documentation' : '<?php echo __( 'What can we describe more ?', 'colorlib-login-customizer' ); ?>',
143
- 'features' : '<?php echo __( 'How could we improve ?', 'colorlib-login-customizer' ); ?>',
144
- 'better-plugin' : '<?php echo __( 'Can you mention it ?', 'colorlib-login-customizer' ); ?>',
145
- 'incompatibility' : '<?php echo __( 'With what plugin or theme is incompatible ?', 'colorlib-login-customizer' ); ?>',
146
- };
147
-
148
- $( deactivateURL ).on("click",function(){
149
- // We'll send the user to this deactivation link when they've completed or dismissed the form
150
- var url = deactivateURL.attr( 'href' );
151
- $('body').toggleClass('epsilon-deactivate-form-active');
152
- formContainer.fadeIn( {
153
- complete: function() {
154
- var offset = formContainer.offset();
155
- if( offset.top < 50 ) {
156
- $(this).parent().css('top', (50 - offset.top) + 'px')
157
- }
158
- $( 'body' ).animate( { scrollTop: Math.max( 0, offset.top - 50 ) } );
159
- }
160
- } );
161
- formContainer.html( '<?php echo $html; ?>');
162
-
163
- formContainer.on( 'change', 'input[name="epsilon-deactivate-reason"]', function(){
164
- var detailsLabel = formContainer.find( '#epsilon-deactivate-details-label strong' );
165
- var value = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
166
- detailsLabel.text( detailsStrings[ value ] );
167
- });
168
-
169
- formContainer.on('click', '#epsilon-deactivate-submit-form', function(e){
170
- var data = {
171
- 'action': 'epsilon_deactivate_plugin',
172
- 'security': "<?php echo wp_create_nonce( 'epsilon_deactivate_plugin' ); ?>",
173
- 'dataType': "json"
174
- };
175
- e.preventDefault();
176
- // As soon as we click, the body of the form should disappear
177
- formContainer.addClass( 'process-response' );
178
- // Fade in spinner
179
- formContainer.find(".deactivating-spinner").fadeIn();
180
-
181
- data['reason'] = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
182
- data['details'] = formContainer.find('#epsilon-deactivate-details').val();
183
- data['tracking'] = formContainer.find( '#allow-tracking:checked' ).length;
184
-
185
- $.post(
186
- ajaxurl,
187
- data,
188
- function(response){
189
- // Redirect to original deactivation URL
190
- window.location.href = url;
191
- }
192
- );
193
- });
194
-
195
- formContainer.on('click', '#epsilon-deactivate-plugin', function(e){
196
- e.preventDefault();
197
- window.location.href = url;
198
- });
199
-
200
- // If we click outside the form, the form will close
201
- $('.epsilon-deactivate-form-bg').on('click',function(){
202
- formContainer.fadeOut();
203
- $('body').removeClass('epsilon-deactivate-form-active');
204
- });
205
- });
206
- });
207
- </script>
208
- <?php
209
- }
210
-
211
- /*
212
- * Form text strings
213
- * These are non-filterable and used as fallback in case filtered strings aren't set correctly
214
- * @since 1.0.0
215
- */
216
- public function get_form_info() {
217
- $form = array();
218
- $form['heading'] = __( 'Sorry to see you go', 'colorlib-login-customizer' );
219
- $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'colorlib-login-customizer' );
220
- $form['options'] = array(
221
- 'no-reason' => __( 'Without reason', 'colorlib-login-customizer' ),
222
- 'setup' => __( 'Set up is too difficult', 'colorlib-login-customizer' ),
223
- 'documentation' => __( 'Lack of documentation', 'colorlib-login-customizer' ),
224
- 'features' => __( 'Not the features I wanted', 'colorlib-login-customizer' ),
225
- 'better-plugin' => __( 'Found a better plugin', 'colorlib-login-customizer' ),
226
- 'incompatibility' => __( 'Incompatible with theme or plugin', 'colorlib-login-customizer' ),
227
- );
228
- $form['details'] = __( 'How could we improve ?', 'colorlib-login-customizer' );
229
- return $form;
230
- }
231
-
232
- public function epsilon_deactivate_plugin_callback() {
233
-
234
- check_ajax_referer( 'epsilon_deactivate_plugin', 'security' );
235
-
236
- if ( isset( $_POST['reason'] ) && isset( $_POST['details'] ) && isset( $_POST['tracking'] ) ) {
237
- $args = array(
238
- 'reason' => $_POST['reason'],
239
- 'details' => $_POST['details'],
240
- 'tracking' => $_POST['tracking'],
241
- );
242
- $request = new Colorlib_Login_Customizer_Plugin_Request( $this->plugin_file, $args );
243
- if ( $request->request_successful ) {
244
- echo json_encode( array(
245
- 'status' => 'ok',
246
- ) );
247
- } else {
248
- echo json_encode( array(
249
- 'status' => 'nok',
250
- ) );
251
- }
252
- } else {
253
- echo json_encode( array(
254
- 'status' => 'ok',
255
- ) );
256
- }
257
-
258
- die();
259
-
260
- }
261
-
262
- }
1
+ <?php
2
+
3
+ class Colorlib_Login_Customizer_Feedback {
4
+
5
+ private $plugin_file = '';
6
+ private $plugin_name = '';
7
+
8
+ function __construct( $_plugin_file ) {
9
+
10
+ $this->plugin_file = $_plugin_file;
11
+ $this->plugin_name = basename( $this->plugin_file, '.php' );
12
+
13
+ // Deactivation
14
+ add_filter( 'plugin_action_links_' . plugin_basename( $this->plugin_file ), array( $this, 'filter_action_links' ) );
15
+ add_action( 'admin_footer-plugins.php', array( $this, 'goodbye_ajax' ) );
16
+ add_action( 'wp_ajax_epsilon_deactivate_plugin', array( $this, 'epsilon_deactivate_plugin_callback' ) );
17
+
18
+ }
19
+
20
+ /**
21
+ * Filter the deactivation link to allow us to present a form when the user deactivates the plugin
22
+ * @since 1.0.0
23
+ */
24
+ public function filter_action_links( $links ) {
25
+
26
+ if ( isset( $links['deactivate'] ) ) {
27
+ $deactivation_link = $links['deactivate'];
28
+ // Insert an onClick action to allow form before deactivating
29
+ $deactivation_link = str_replace( '<a ', '<div class="epsilon-deactivate-form-wrapper"><span class="epsilon-deactivate-form" id="epsilon-deactivate-form-' . esc_attr( $this->plugin_name ) . '"></span></div><a onclick="javascript:event.preventDefault();" id="epsilon-deactivate-link-' . esc_attr( $this->plugin_name ) . '" ', $deactivation_link );
30
+ $links['deactivate'] = $deactivation_link;
31
+ }
32
+ return $links;
33
+ }
34
+
35
+ /**
36
+ * Form text strings
37
+ * These can be filtered
38
+ * @since 1.0.0
39
+ */
40
+ public function goodbye_ajax() {
41
+ // Get our strings for the form
42
+ $form = $this->get_form_info();
43
+
44
+ // Build the HTML to go in the form
45
+ $html = '<div class="epsilon-deactivate-form-head"><strong>' . esc_html( $form['heading'] ) . '</strong></div>';
46
+ $html .= '<div class="epsilon-deactivate-form-body"><p>' . esc_html( $form['body'] ) . '</p>';
47
+ if ( is_array( $form['options'] ) ) {
48
+ $html .= '<div class="epsilon-deactivate-options"><p>';
49
+ foreach ( $form['options'] as $key => $option ) {
50
+ if ( 'no-reason' == $key ) {
51
+ $html .= '<input type="radio" name="epsilon-deactivate-reason" checked="checked" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
52
+ } else {
53
+ $html .= '<input type="radio" name="epsilon-deactivate-reason" id="' . esc_attr( $key ) . '" value="' . esc_attr( $key ) . '"> <label for="' . esc_attr( $key ) . '">' . esc_attr( $option ) . '</label><br>';
54
+ }
55
+ }
56
+ $html .= '</p><label id="epsilon-deactivate-details-label" for="epsilon-deactivate-reasons"><strong>' . esc_html( $form['details'] ) . '</strong></label><textarea name="epsilon-deactivate-details" id="epsilon-deactivate-details" rows="2" style="width:100%"></textarea>';
57
+ $html .= '<input type="checkbox" name="epsilon-deactivate-tracking" checked="" id="allow-tracking" value="yes"> <label for="allow-tracking">' . esc_html__( 'Allow us to get more information in order to improve our plugin', 'colorlib-login-customizer' ) . '</label><br>';
58
+ $html .= '</div><!-- .epsilon-deactivate-options -->';
59
+ }
60
+ $html .= '</div><!-- .epsilon-deactivate-form-body -->';
61
+ $html .= '<p class="deactivating-spinner"><span class="spinner"></span> ' . __( 'Submitting form', 'colorlib-login-customizer' ) . '</p>';
62
+ $html .= '<div class="epsilon-deactivate-form-footer"><p><a id="epsilon-deactivate-plugin" href="#">' . __( 'Just Deactivate', 'colorlib-login-customizer' ) . '</a><a id="epsilon-deactivate-submit-form" class="button button-primary" href="#">' . __( 'Submit and Deactivate', 'colorlib-login-customizer' ) . '</a></p></div>'
63
+ ?>
64
+ <div class="epsilon-deactivate-form-bg"></div>
65
+ <style type="text/css">
66
+ .epsilon-deactivate-form-active .epsilon-deactivate-form-bg {
67
+ background: rgba( 0, 0, 0, .5 );
68
+ position: fixed;
69
+ top: 0;
70
+ left: 0;
71
+ width: 100%;
72
+ height: 100%;
73
+ }
74
+ .epsilon-deactivate-form-wrapper {
75
+ position: relative;
76
+ z-index: 999;
77
+ display: none;
78
+ }
79
+ .epsilon-deactivate-form-active .epsilon-deactivate-form-wrapper {
80
+ display: block;
81
+ }
82
+ .epsilon-deactivate-form {
83
+ display: none;
84
+ }
85
+ .epsilon-deactivate-form-active .epsilon-deactivate-form {
86
+ position: absolute;
87
+ bottom: 30px;
88
+ left: 0;
89
+ width: 400px;
90
+ background: #fff;
91
+ white-space: normal;
92
+ }
93
+ .epsilon-deactivate-form-head {
94
+ background: #51AD31;
95
+ color: #fff;
96
+ padding: 8px 18px;
97
+ }
98
+ .epsilon-deactivate-form-body {
99
+ padding: 8px 18px;
100
+ color: #444;
101
+ }
102
+ .deactivating-spinner {
103
+ display: none;
104
+ }
105
+ .deactivating-spinner .spinner {
106
+ float: none;
107
+ margin: 4px 4px 0 18px;
108
+ vertical-align: bottom;
109
+ visibility: visible;
110
+ }
111
+ .epsilon-deactivate-form-footer {
112
+ padding: 8px 18px;
113
+ }
114
+ .epsilon-deactivate-form-footer p {
115
+ display: flex;
116
+ align-items: center;
117
+ justify-content: space-between;
118
+ }
119
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body,
120
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer {
121
+ position: relative;
122
+ }
123
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-body:after,
124
+ .epsilon-deactivate-form.process-response .epsilon-deactivate-form-footer:after {
125
+ content: "";
126
+ display: block;
127
+ position: absolute;
128
+ top: 0;
129
+ left: 0;
130
+ width: 100%;
131
+ height: 100%;
132
+ background-color: rgba( 255, 255, 255, .5 );
133
+ }
134
+ </style>
135
+ <script>
136
+ jQuery(document).ready(function($){
137
+ var deactivateURL = $("#epsilon-deactivate-link-<?php echo esc_attr( $this->plugin_name ); ?>"),
138
+ formContainer = $('#epsilon-deactivate-form-<?php echo esc_attr( $this->plugin_name ); ?>'),
139
+ detailsStrings = {
140
+ 'no-reson' : '<?php echo __( 'How could we improve ?', 'colorlib-login-customizer' ); ?>',
141
+ 'setup' : '<?php echo __( 'What was the dificult part ?', 'colorlib-login-customizer' ); ?>',
142
+ 'documentation' : '<?php echo __( 'What can we describe more ?', 'colorlib-login-customizer' ); ?>',
143
+ 'features' : '<?php echo __( 'How could we improve ?', 'colorlib-login-customizer' ); ?>',
144
+ 'better-plugin' : '<?php echo __( 'Can you mention it ?', 'colorlib-login-customizer' ); ?>',
145
+ 'incompatibility' : '<?php echo __( 'With what plugin or theme is incompatible ?', 'colorlib-login-customizer' ); ?>',
146
+ };
147
+
148
+ $( deactivateURL ).on("click",function(){
149
+ // We'll send the user to this deactivation link when they've completed or dismissed the form
150
+ var url = deactivateURL.attr( 'href' );
151
+ $('body').toggleClass('epsilon-deactivate-form-active');
152
+ formContainer.fadeIn( {
153
+ complete: function() {
154
+ var offset = formContainer.offset();
155
+ if( offset.top < 50 ) {
156
+ $(this).parent().css('top', (50 - offset.top) + 'px')
157
+ }
158
+ $( 'body' ).animate( { scrollTop: Math.max( 0, offset.top - 50 ) } );
159
+ }
160
+ } );
161
+ formContainer.html( '<?php echo $html; ?>');
162
+
163
+ formContainer.on( 'change', 'input[name="epsilon-deactivate-reason"]', function(){
164
+ var detailsLabel = formContainer.find( '#epsilon-deactivate-details-label strong' );
165
+ var value = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
166
+ detailsLabel.text( detailsStrings[ value ] );
167
+ });
168
+
169
+ formContainer.on('click', '#epsilon-deactivate-submit-form', function(e){
170
+ var data = {
171
+ 'action': 'epsilon_deactivate_plugin',
172
+ 'security': "<?php echo wp_create_nonce( 'epsilon_deactivate_plugin' ); ?>",
173
+ 'dataType': "json"
174
+ };
175
+ e.preventDefault();
176
+ // As soon as we click, the body of the form should disappear
177
+ formContainer.addClass( 'process-response' );
178
+ // Fade in spinner
179
+ formContainer.find(".deactivating-spinner").fadeIn();
180
+
181
+ data['reason'] = formContainer.find( 'input[name="epsilon-deactivate-reason"]:checked' ).val();
182
+ data['details'] = formContainer.find('#epsilon-deactivate-details').val();
183
+ data['tracking'] = formContainer.find( '#allow-tracking:checked' ).length;
184
+
185
+ $.post(
186
+ ajaxurl,
187
+ data,
188
+ function(response){
189
+ // Redirect to original deactivation URL
190
+ window.location.href = url;
191
+ }
192
+ );
193
+ });
194
+
195
+ formContainer.on('click', '#epsilon-deactivate-plugin', function(e){
196
+ e.preventDefault();
197
+ window.location.href = url;
198
+ });
199
+
200
+ // If we click outside the form, the form will close
201
+ $('.epsilon-deactivate-form-bg').on('click',function(){
202
+ formContainer.fadeOut();
203
+ $('body').removeClass('epsilon-deactivate-form-active');
204
+ });
205
+ });
206
+ });
207
+ </script>
208
+ <?php
209
+ }
210
+
211
+ /*
212
+ * Form text strings
213
+ * These are non-filterable and used as fallback in case filtered strings aren't set correctly
214
+ * @since 1.0.0
215
+ */
216
+ public function get_form_info() {
217
+ $form = array();
218
+ $form['heading'] = __( 'Sorry to see you go', 'colorlib-login-customizer' );
219
+ $form['body'] = __( 'Before you deactivate the plugin, would you quickly give us your reason for doing so?', 'colorlib-login-customizer' );
220
+ $form['options'] = array(
221
+ 'no-reason' => __( 'Without reason', 'colorlib-login-customizer' ),
222
+ 'setup' => __( 'Set up is too difficult', 'colorlib-login-customizer' ),
223
+ 'documentation' => __( 'Lack of documentation', 'colorlib-login-customizer' ),
224
+ 'features' => __( 'Not the features I wanted', 'colorlib-login-customizer' ),
225
+ 'better-plugin' => __( 'Found a better plugin', 'colorlib-login-customizer' ),
226
+ 'incompatibility' => __( 'Incompatible with theme or plugin', 'colorlib-login-customizer' ),
227
+ );
228
+ $form['details'] = __( 'How could we improve ?', 'colorlib-login-customizer' );
229
+ return $form;
230
+ }
231
+
232
+ public function epsilon_deactivate_plugin_callback() {
233
+
234
+ check_ajax_referer( 'epsilon_deactivate_plugin', 'security' );
235
+
236
+ if ( isset( $_POST['reason'] ) && isset( $_POST['details'] ) && isset( $_POST['tracking'] ) ) {
237
+ $args = array(
238
+ 'reason' => $_POST['reason'],
239
+ 'details' => $_POST['details'],
240
+ 'tracking' => $_POST['tracking'],
241
+ );
242
+ $request = new Colorlib_Login_Customizer_Plugin_Request( $this->plugin_file, $args );
243
+ if ( $request->request_successful ) {
244
+ echo json_encode( array(
245
+ 'status' => 'ok',
246
+ ) );
247
+ } else {
248
+ echo json_encode( array(
249
+ 'status' => 'nok',
250
+ ) );
251
+ }
252
+ } else {
253
+ echo json_encode( array(
254
+ 'status' => 'ok',
255
+ ) );
256
+ }
257
+
258
+ die();
259
+
260
+ }
261
+
262
+ }
includes/class-colorlib-login-customizer-plugin-request.php CHANGED
@@ -1,225 +1,225 @@
1
- <?php
2
-
3
- class Colorlib_Login_Customizer_Plugin_Request {
4
-
5
- /**
6
- * Url for the request
7
- *
8
- * @var string
9
- */
10
- private $url = 'https://tamewp.com/';
11
- /**
12
- * Api endpoint
13
- *
14
- * @var string
15
- */
16
- private $endpoint = 'wp-json/epsilon/v1/add-tracking-data';
17
- /**
18
- * Private data
19
- *
20
- * @var array
21
- */
22
- private $data = array(
23
- 'server' => array(),
24
- 'user' => array(),
25
- 'wordpress' => array(
26
- 'deactivated_plugin' => array(),
27
- ),
28
- );
29
- /**
30
- * Plugin file
31
- *
32
- * @var string
33
- */
34
- private $plugin_file = '';
35
-
36
- private $allow_tracking = 0;
37
-
38
- public $request_successful = false;
39
-
40
- function __construct( $_plugin_file, $args ) {
41
-
42
- // Set variables
43
- $this->allow_tracking = $args['tracking'];
44
- $this->plugin_file = $_plugin_file;
45
- $this->data['unique'] = md5( home_url() . get_bloginfo( 'admin_email' ) );
46
- $this->data['wordpress']['deactivated_plugin']['uninstall_reason'] = $args['reason'];
47
- $this->data['wordpress']['deactivated_plugin']['uninstall_details'] = $args['details'];
48
-
49
- // Start collecting data
50
- $this->_collect_data();
51
- $this->_generate_url();
52
- $this->request_successful = $this->_send_request();
53
- }
54
-
55
- /**
56
- * Collect all data for the request.
57
- *
58
- */
59
- private function _collect_data() {
60
-
61
- $current_plugin = get_plugin_data( $this->plugin_file );
62
-
63
- // Plugin data
64
- $this->data['wordpress']['deactivated_plugin']['slug'] = $current_plugin['TextDomain'];
65
- $this->data['wordpress']['deactivated_plugin']['name'] = $current_plugin['Name'];
66
- $this->data['wordpress']['deactivated_plugin']['version'] = $current_plugin['Version'];
67
- $this->data['wordpress']['deactivated_plugin']['author'] = $current_plugin['AuthorName'];
68
-
69
- if ( $this->allow_tracking ) {
70
- $this->_collect_wordpress_data();
71
- $this->_collect_server_data();
72
- $this->_collect_user_data();
73
- }
74
-
75
- }
76
-
77
- /**
78
- * Collect WordPress data.
79
- *
80
- */
81
- private function _collect_wordpress_data() {
82
- $this->data['wordpress']['locale'] = ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale();
83
- $this->data['wordpress']['wp_version'] = get_bloginfo( 'version' );
84
- $this->data['wordpress']['multisite'] = is_multisite();
85
-
86
- $this->data['wordpress']['themes'] = $this->get_themes();
87
- $this->data['wordpress']['plugins'] = $this->get_plugins();
88
- }
89
-
90
- /**
91
- * Collect server data.
92
- *
93
- */
94
- private function _collect_server_data() {
95
- $this->data['server']['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
96
- $this->data['server']['php_version'] = phpversion();
97
- $this->data['server']['url'] = home_url();
98
- }
99
-
100
- /**
101
- * Collect user data.
102
- *
103
- */
104
- private function _collect_user_data() {
105
- $admin = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
106
- if ( ! $admin ) {
107
- $this->data['user']['email'] = '';
108
- $this->data['user']['first_name'] = '';
109
- $this->data['user']['last_name'] = '';
110
- } else {
111
- $this->data['user']['email'] = get_bloginfo( 'admin_email' );
112
- $this->data['user']['first_name'] = $admin->first_name;
113
- $this->data['user']['last_name'] = $admin->last_name;
114
- }
115
- }
116
-
117
- /**
118
- * Get current themes
119
- *
120
- * @return array
121
- */
122
- private function get_themes() {
123
- $theme = wp_get_theme();
124
-
125
- return array(
126
- 'installed' => $this->_get_installed_themes(),
127
- 'active' => array(
128
- 'slug' => get_stylesheet(),
129
- 'name' => $theme->get( 'Name' ),
130
- 'version' => $theme->get( 'Version' ),
131
- 'author' => $theme->get( 'Author' ),
132
- ),
133
- );
134
- }
135
-
136
- /**
137
- * Get an array of installed themes
138
- */
139
- private function _get_installed_themes() {
140
- $installed = wp_get_themes();
141
- $theme = get_stylesheet();
142
- $arr = array();
143
-
144
- foreach ( $installed as $slug => $info ) {
145
- if ( $slug === $theme ) {
146
- continue;
147
- }
148
- $arr[ $slug ] = array(
149
- 'slug' => $slug,
150
- 'name' => $info->get( 'Name' ),
151
- 'version' => $info->get( 'Version' ),
152
- 'author' => $info->get( 'Author' ),
153
- );
154
- };
155
-
156
- return $arr;
157
- }
158
-
159
- /**
160
- * Get a list of installed plugins
161
- */
162
- private function get_plugins() {
163
- if ( ! function_exists( 'get_plugins' ) ) {
164
- include ABSPATH . '/wp-admin/includes/plugin.php';
165
- }
166
-
167
- $plugins = get_plugins();
168
- $option = get_option( 'active_plugins', array() );
169
- $active = array();
170
- $installed = array();
171
- foreach ( $plugins as $id => $info ) {
172
- if ( in_array( $id, $active ) ) {
173
- continue;
174
- }
175
-
176
- $id = explode( '/', $id );
177
- $id = ucwords( str_replace( '-', ' ', $id[0] ) );
178
-
179
- $installed[] = $id;
180
- }
181
-
182
- foreach ( $option as $id ) {
183
- $id = explode( '/', $id );
184
- $id = ucwords( str_replace( '-', ' ', $id[0] ) );
185
-
186
- $active[] = $id;
187
- }
188
-
189
- return array(
190
- 'installed' => $installed,
191
- 'active' => $active,
192
- );
193
- }
194
-
195
- /**
196
- * Generate the url
197
- */
198
- protected function _generate_url() {
199
- $this->url = $this->url . $this->endpoint;
200
- }
201
-
202
- /**
203
- * Send dat to server.
204
- *
205
- */
206
- private function _send_request() {
207
-
208
- $request = wp_remote_post( $this->url, array(
209
- 'method' => 'POST',
210
- 'timeout' => 20,
211
- 'redirection' => 5,
212
- 'httpversion' => '1.1',
213
- 'blocking' => true,
214
- 'body' => $this->data,
215
- 'user-agent' => 'MT/EPSILON-CUSTOMER-TRACKING/' . esc_url( home_url() ),
216
- ) );
217
-
218
- if ( is_wp_error( $request ) ) {
219
- return false;
220
- }
221
-
222
- return true;
223
-
224
- }
225
- }
1
+ <?php
2
+
3
+ class Colorlib_Login_Customizer_Plugin_Request {
4
+
5
+ /**
6
+ * Url for the request
7
+ *
8
+ * @var string
9
+ */
10
+ private $url = 'https://tamewp.com/';
11
+ /**
12
+ * Api endpoint
13
+ *
14
+ * @var string
15
+ */
16
+ private $endpoint = 'wp-json/epsilon/v1/add-tracking-data';
17
+ /**
18
+ * Private data
19
+ *
20
+ * @var array
21
+ */
22
+ private $data = array(
23
+ 'server' => array(),
24
+ 'user' => array(),
25
+ 'wordpress' => array(
26
+ 'deactivated_plugin' => array(),
27
+ ),
28
+ );
29
+ /**
30
+ * Plugin file
31
+ *
32
+ * @var string
33
+ */
34
+ private $plugin_file = '';
35
+
36
+ private $allow_tracking = 0;
37
+
38
+ public $request_successful = false;
39
+
40
+ function __construct( $_plugin_file, $args ) {
41
+
42
+ // Set variables
43
+ $this->allow_tracking = $args['tracking'];
44
+ $this->plugin_file = $_plugin_file;
45
+ $this->data['unique'] = md5( home_url() . get_bloginfo( 'admin_email' ) );
46
+ $this->data['wordpress']['deactivated_plugin']['uninstall_reason'] = $args['reason'];
47
+ $this->data['wordpress']['deactivated_plugin']['uninstall_details'] = $args['details'];
48
+
49
+ // Start collecting data
50
+ $this->_collect_data();
51
+ $this->_generate_url();
52
+ $this->request_successful = $this->_send_request();
53
+ }
54
+
55
+ /**
56
+ * Collect all data for the request.
57
+ *
58
+ */
59
+ private function _collect_data() {
60
+
61
+ $current_plugin = get_plugin_data( $this->plugin_file );
62
+
63
+ // Plugin data
64
+ $this->data['wordpress']['deactivated_plugin']['slug'] = $current_plugin['TextDomain'];
65
+ $this->data['wordpress']['deactivated_plugin']['name'] = $current_plugin['Name'];
66
+ $this->data['wordpress']['deactivated_plugin']['version'] = $current_plugin['Version'];
67
+ $this->data['wordpress']['deactivated_plugin']['author'] = $current_plugin['AuthorName'];
68
+
69
+ if ( $this->allow_tracking ) {
70
+ $this->_collect_wordpress_data();
71
+ $this->_collect_server_data();
72
+ $this->_collect_user_data();
73
+ }
74
+
75
+ }
76
+
77
+ /**
78
+ * Collect WordPress data.
79
+ *
80
+ */
81
+ private function _collect_wordpress_data() {
82
+ $this->data['wordpress']['locale'] = ( get_bloginfo( 'version' ) >= 4.7 ) ? get_user_locale() : get_locale();
83
+ $this->data['wordpress']['wp_version'] = get_bloginfo( 'version' );
84
+ $this->data['wordpress']['multisite'] = is_multisite();
85
+
86
+ $this->data['wordpress']['themes'] = $this->get_themes();
87
+ $this->data['wordpress']['plugins'] = $this->get_plugins();
88
+ }
89
+
90
+ /**
91
+ * Collect server data.
92
+ *
93
+ */
94
+ private function _collect_server_data() {
95
+ $this->data['server']['server'] = isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '';
96
+ $this->data['server']['php_version'] = phpversion();
97
+ $this->data['server']['url'] = home_url();
98
+ }
99
+
100
+ /**
101
+ * Collect user data.
102
+ *
103
+ */
104
+ private function _collect_user_data() {
105
+ $admin = get_user_by( 'email', get_bloginfo( 'admin_email' ) );
106
+ if ( ! $admin ) {
107
+ $this->data['user']['email'] = '';
108
+ $this->data['user']['first_name'] = '';
109
+ $this->data['user']['last_name'] = '';
110
+ } else {
111
+ $this->data['user']['email'] = get_bloginfo( 'admin_email' );
112
+ $this->data['user']['first_name'] = $admin->first_name;
113
+ $this->data['user']['last_name'] = $admin->last_name;
114
+ }
115
+ }
116
+
117
+ /**
118
+ * Get current themes
119
+ *
120
+ * @return array
121
+ */
122
+ private function get_themes() {
123
+ $theme = wp_get_theme();
124
+
125
+ return array(
126
+ 'installed' => $this->_get_installed_themes(),
127
+ 'active' => array(
128
+ 'slug' => get_stylesheet(),
129
+ 'name' => $theme->get( 'Name' ),
130
+ 'version' => $theme->get( 'Version' ),
131
+ 'author' => $theme->get( 'Author' ),
132
+ ),
133
+ );
134
+ }
135
+
136
+ /**
137
+ * Get an array of installed themes
138
+ */
139
+ private function _get_installed_themes() {
140
+ $installed = wp_get_themes();
141
+ $theme = get_stylesheet();
142
+ $arr = array();
143
+
144
+ foreach ( $installed as $slug => $info ) {
145
+ if ( $slug === $theme ) {
146
+ continue;
147
+ }
148
+ $arr[ $slug ] = array(
149
+ 'slug' => $slug,
150
+ 'name' => $info->get( 'Name' ),
151
+ 'version' => $info->get( 'Version' ),
152
+ 'author' => $info->get( 'Author' ),
153
+ );
154
+ };
155
+
156
+ return $arr;
157
+ }
158
+
159
+ /**
160
+ * Get a list of installed plugins
161
+ */
162
+ private function get_plugins() {
163
+ if ( ! function_exists( 'get_plugins' ) ) {
164
+ include ABSPATH . '/wp-admin/includes/plugin.php';
165
+ }
166
+
167
+ $plugins = get_plugins();
168
+ $option = get_option( 'active_plugins', array() );
169
+ $active = array();
170
+ $installed = array();
171
+ foreach ( $plugins as $id => $info ) {
172
+ if ( in_array( $id, $active ) ) {
173
+ continue;
174
+ }
175
+
176
+ $id = explode( '/', $id );
177
+ $id = ucwords( str_replace( '-', ' ', $id[0] ) );
178
+
179
+ $installed[] = $id;
180
+ }
181
+
182
+ foreach ( $option as $id ) {
183
+ $id = explode( '/', $id );
184
+ $id = ucwords( str_replace( '-', ' ', $id[0] ) );
185
+
186
+ $active[] = $id;
187
+ }
188
+
189
+ return array(
190
+ 'installed' => $installed,
191
+ 'active' => $active,
192
+ );
193
+ }
194
+
195
+ /**
196
+ * Generate the url
197
+ */
198
+ protected function _generate_url() {
199
+ $this->url = $this->url . $this->endpoint;
200
+ }
201
+
202
+ /**
203
+ * Send dat to server.
204
+ *
205
+ */
206
+ private function _send_request() {
207
+
208
+ $request = wp_remote_post( $this->url, array(
209
+ 'method' => 'POST',
210
+ 'timeout' => 20,
211
+ 'redirection' => 5,
212
+ 'httpversion' => '1.1',
213
+ 'blocking' => true,
214
+ 'body' => $this->data,
215
+ 'user-agent' => 'MT/EPSILON-CUSTOMER-TRACKING/' . esc_url( home_url() ),
216
+ ) );
217
+
218
+ if ( is_wp_error( $request ) ) {
219
+ return false;
220
+ }
221
+
222
+ return true;
223
+
224
+ }
225
+ }
includes/class-colorlib-login-customizer.php CHANGED
@@ -1,274 +1,274 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- };
5
-
6
- class Colorlib_Login_Customizer {
7
-
8
- /**
9
- * The single instance of Colorlib_Login_Customizer.
10
- *
11
- * @var object
12
- * @access private
13
- * @since 1.0.0
14
- */
15
- private static $_instance = null;
16
-
17
- /**
18
- * Settings class object
19
- *
20
- * @var object
21
- * @access public
22
- * @since 1.0.0
23
- */
24
- public $settings = null;
25
-
26
- /**
27
- * The version number.
28
- *
29
- * @var string
30
- * @access public
31
- * @since 1.0.0
32
- */
33
- public $_version;
34
-
35
- /**
36
- * The token.
37
- *
38
- * @var string
39
- * @access public
40
- * @since 1.0.0
41
- */
42
- public $_token;
43
-
44
- /**
45
- * The main plugin file.
46
- *
47
- * @var string
48
- * @access public
49
- * @since 1.0.0
50
- */
51
- public $file;
52
-
53
- /**
54
- * The main plugin directory.
55
- *
56
- * @var string
57
- * @access public
58
- * @since 1.0.0
59
- */
60
- public $dir;
61
-
62
- /**
63
- * The plugin assets directory.
64
- *
65
- * @var string
66
- * @access public
67
- * @since 1.0.0
68
- */
69
- public $assets_dir;
70
-
71
- /**
72
- * The plugin assets URL.
73
- *
74
- * @var string
75
- * @access public
76
- * @since 1.0.0
77
- */
78
- public $assets_url;
79
-
80
- /**
81
- * Suffix for Javascripts.
82
- *
83
- * @var string
84
- * @access public
85
- * @since 1.0.0
86
- */
87
- public $script_suffix;
88
-
89
- /**
90
- * Constructor function.
91
- *
92
- * @access public
93
- * @since 1.0.0
94
- */
95
- public function __construct( $file = '', $version = '1.0.0' ) {
96
- $this->_version = $version;
97
- $this->_token = 'colorlib-login-customizer';
98
- $this->base = 'clc_';
99
- $this->key_name = 'clc-options';
100
-
101
- // Load plugin environment variables
102
- $this->file = $file;
103
- $this->dir = dirname( $this->file );
104
- $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
105
- $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
106
-
107
- $this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
108
- // Remove this after Grunt
109
- $this->script_suffix = '';
110
-
111
- if ( is_admin() ) {
112
- // Plugin Deactivate Feedback
113
- new Colorlib_Login_Customizer_Feedback( $file );
114
- }
115
-
116
- register_activation_hook( $this->file, array( $this, 'install' ) );
117
-
118
- add_action( 'admin_init', array( $this, 'redirect_customizer' ) );
119
-
120
- // Load customizer settings
121
- add_action( 'customize_register', array( $this, 'load_customizer' ), 10, 1 );
122
-
123
- add_filter( 'template_include', array( $this, 'change_template_if_necessary' ), 99 );
124
-
125
- // Handle localisation
126
- $this->load_plugin_textdomain();
127
- add_action( 'init', array( $this, 'load_localisation' ), 0 );
128
-
129
- // Generate plugins css
130
- add_action( 'init', array( $this, 'load_customizer_css' ) );
131
-
132
- } // End __construct ()
133
-
134
- /**
135
- * Load the customizer controls
136
- *
137
- * @param $manager
138
- */
139
- public function load_customizer( $manager ) {
140
- new Colorlib_Login_Customizer_Customizer( $this, $manager );
141
- }
142
-
143
- public function load_customizer_css() {
144
- new Colorlib_Login_Customizer_CSS_Customization();
145
- }
146
-
147
- /**
148
- * Hook to redirect the page for the Customizer.
149
- *
150
- * @access public
151
- * @return void
152
- */
153
- public function redirect_customizer() {
154
- if ( ! empty( $_GET['page'] ) ) { // Input var okay.
155
- if ( 'colorlib-login-customizer_settings' === $_GET['page'] ) { // Input var okay.
156
-
157
- // Generate the redirect url.
158
- $url = add_query_arg(
159
- array(
160
- 'autofocus[panel]' => 'clc_main_panel',
161
- ),
162
- admin_url( 'customize.php' )
163
- );
164
-
165
- wp_safe_redirect( $url );
166
- }
167
- }
168
- }
169
-
170
- /**
171
- * Load plugin localisation
172
- *
173
- * @access public
174
- * @since 1.0.0
175
- * @return void
176
- */
177
- public function load_localisation() {
178
- load_plugin_textdomain( 'colorlib-login-customizer', false, dirname( plugin_basename( $this->file ) ) . '/languages/' );
179
- } // End load_localisation ()
180
-
181
- /**
182
- * Load plugin textdomain
183
- *
184
- * @access public
185
- * @since 1.0.0
186
- * @return void
187
- */
188
- public function load_plugin_textdomain() {
189
- $domain = 'colorlib-login-customizer';
190
-
191
- $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
192
-
193
- load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
194
- load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/languages/' );
195
- } // End load_plugin_textdomain ()
196
-
197
- /**
198
- * Main Colorlib_Login_Customizer Instance
199
- *
200
- * Ensures only one instance of Colorlib_Login_Customizer is loaded or can be loaded.
201
- *
202
- * @since 1.0.0
203
- * @static
204
- * @see Colorlib_Login_Customizer()
205
- * @return Main Colorlib_Login_Customizer instance
206
- */
207
- public static function instance( $file = '', $version = '1.0.0' ) {
208
- if ( is_null( self::$_instance ) ) {
209
- self::$_instance = new self( $file, $version );
210
- }
211
-
212
- return self::$_instance;
213
- } // End instance ()
214
-
215
- /**
216
- * Cloning is forbidden.
217
- *
218
- * @since 1.0.0
219
- */
220
- public function __clone() {
221
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->_version );
222
- } // End __clone ()
223
-
224
- /**
225
- * Unserializing instances of this class is forbidden.
226
- *
227
- * @since 1.0.0
228
- */
229
- public function __wakeup() {
230
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->_version );
231
- } // End __wakeup ()
232
-
233
- /**
234
- * Installation. Runs on activation.
235
- *
236
- * @access public
237
- * @since 1.0.0
238
- * @return void
239
- */
240
- public function install() {
241
- $this->_log_version_number();
242
-
243
- // Backward compatibility
244
- $options = get_option( $this->key_name, array() );
245
- if ( isset( $options['templates'] ) && '01' == $options['templates'] ) {
246
- $options['templates'] = 'default';
247
- $options['columns'] = 2;
248
- update_option( $this->key_name, $options );
249
- }
250
- } // End install ()
251
-
252
- /**
253
- * Log the plugin version number.
254
- *
255
- * @access public
256
- * @since 1.0.0
257
- * @return void
258
- */
259
- private function _log_version_number() {
260
- update_option( $this->_token . '_version', $this->_version );
261
- } // End _log_version_number ()
262
-
263
-
264
- // Let's hack a little bit
265
- public function change_template_if_necessary( $template ) {
266
-
267
- if ( is_customize_preview() && isset( $_REQUEST['colorlib-login-customizer-customization'] ) && is_user_logged_in() ) {
268
- $new_template = plugin_dir_path( __FILE__ ) . 'login-template.php';
269
- return $new_template;
270
- }
271
-
272
- return $template;
273
- }
274
- }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ };
5
+
6
+ class Colorlib_Login_Customizer {
7
+
8
+ /**
9
+ * The single instance of Colorlib_Login_Customizer.
10
+ *
11
+ * @var object
12
+ * @access private
13
+ * @since 1.0.0
14
+ */
15
+ private static $_instance = null;
16
+
17
+ /**
18
+ * Settings class object
19
+ *
20
+ * @var object
21
+ * @access public
22
+ * @since 1.0.0
23
+ */
24
+ public $settings = null;
25
+
26
+ /**
27
+ * The version number.
28
+ *
29
+ * @var string
30
+ * @access public
31
+ * @since 1.0.0
32
+ */
33
+ public $_version;
34
+
35
+ /**
36
+ * The token.
37
+ *
38
+ * @var string
39
+ * @access public
40
+ * @since 1.0.0
41
+ */
42
+ public $_token;
43
+
44
+ /**
45
+ * The main plugin file.
46
+ *
47
+ * @var string
48
+ * @access public
49
+ * @since 1.0.0
50
+ */
51
+ public $file;
52
+
53
+ /**
54
+ * The main plugin directory.
55
+ *
56
+ * @var string
57
+ * @access public
58
+ * @since 1.0.0
59
+ */
60
+ public $dir;
61
+
62
+ /**
63
+ * The plugin assets directory.
64
+ *
65
+ * @var string
66
+ * @access public
67
+ * @since 1.0.0
68
+ */
69
+ public $assets_dir;
70
+
71
+ /**
72
+ * The plugin assets URL.
73
+ *
74
+ * @var string
75
+ * @access public
76
+ * @since 1.0.0
77
+ */
78
+ public $assets_url;
79
+
80
+ /**
81
+ * Suffix for Javascripts.
82
+ *
83
+ * @var string
84
+ * @access public
85
+ * @since 1.0.0
86
+ */
87
+ public $script_suffix;
88
+
89
+ /**
90
+ * Constructor function.
91
+ *
92
+ * @access public
93
+ * @since 1.0.0
94
+ */
95
+ public function __construct( $file = '', $version = '1.0.0' ) {
96
+ $this->_version = $version;
97
+ $this->_token = 'colorlib-login-customizer';
98
+ $this->base = 'clc_';
99
+ $this->key_name = 'clc-options';
100
+
101
+ // Load plugin environment variables
102
+ $this->file = $file;
103
+ $this->dir = dirname( $this->file );
104
+ $this->assets_dir = trailingslashit( $this->dir ) . 'assets';
105
+ $this->assets_url = esc_url( trailingslashit( plugins_url( '/assets/', $this->file ) ) );
106
+
107
+ $this->script_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
108
+ // Remove this after Grunt
109
+ $this->script_suffix = '';
110
+
111
+ if ( is_admin() ) {
112
+ // Plugin Deactivate Feedback
113
+ new Colorlib_Login_Customizer_Feedback( $file );
114
+ }
115
+
116
+ register_activation_hook( $this->file, array( $this, 'install' ) );
117
+
118
+ add_action( 'admin_init', array( $this, 'redirect_customizer' ) );
119
+
120
+ // Load customizer settings
121
+ add_action( 'customize_register', array( $this, 'load_customizer' ), 10, 1 );
122
+
123
+ add_filter( 'template_include', array( $this, 'change_template_if_necessary' ), 99 );
124
+
125
+ // Handle localisation
126
+ $this->load_plugin_textdomain();
127
+ add_action( 'init', array( $this, 'load_localisation' ), 0 );
128
+
129
+ // Generate plugins css
130
+ add_action( 'init', array( $this, 'load_customizer_css' ) );
131
+
132
+ } // End __construct ()
133
+
134
+ /**
135
+ * Load the customizer controls
136
+ *
137
+ * @param $manager
138
+ */
139
+ public function load_customizer( $manager ) {
140
+ new Colorlib_Login_Customizer_Customizer( $this, $manager );
141
+ }
142
+
143
+ public function load_customizer_css() {
144
+ new Colorlib_Login_Customizer_CSS_Customization();
145
+ }
146
+
147
+ /**
148
+ * Hook to redirect the page for the Customizer.
149
+ *
150
+ * @access public
151
+ * @return void
152
+ */
153
+ public function redirect_customizer() {
154
+ if ( ! empty( $_GET['page'] ) ) { // Input var okay.
155
+ if ( 'colorlib-login-customizer_settings' === $_GET['page'] ) { // Input var okay.
156
+
157
+ // Generate the redirect url.
158
+ $url = add_query_arg(
159
+ array(
160
+ 'autofocus[panel]' => 'clc_main_panel',
161
+ ),
162
+ admin_url( 'customize.php' )
163
+ );
164
+
165
+ wp_safe_redirect( $url );
166
+ }
167
+ }
168
+ }
169
+
170
+ /**
171
+ * Load plugin localisation
172
+ *
173
+ * @access public
174
+ * @since 1.0.0
175
+ * @return void
176
+ */
177
+ public function load_localisation() {
178
+ load_plugin_textdomain( 'colorlib-login-customizer', false, dirname( plugin_basename( $this->file ) ) . '/languages/' );
179
+ } // End load_localisation ()
180
+
181
+ /**
182
+ * Load plugin textdomain
183
+ *
184
+ * @access public
185
+ * @since 1.0.0
186
+ * @return void
187
+ */
188
+ public function load_plugin_textdomain() {
189
+ $domain = 'colorlib-login-customizer';
190
+
191
+ $locale = apply_filters( 'plugin_locale', get_locale(), $domain );
192
+
193
+ load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
194
+ load_plugin_textdomain( $domain, false, dirname( plugin_basename( $this->file ) ) . '/languages/' );
195
+ } // End load_plugin_textdomain ()
196
+
197
+ /**
198
+ * Main Colorlib_Login_Customizer Instance
199
+ *
200
+ * Ensures only one instance of Colorlib_Login_Customizer is loaded or can be loaded.
201
+ *
202
+ * @since 1.0.0
203
+ * @static
204
+ * @see Colorlib_Login_Customizer()
205
+ * @return Main Colorlib_Login_Customizer instance
206
+ */
207
+ public static function instance( $file = '', $version = '1.0.0' ) {
208
+ if ( is_null( self::$_instance ) ) {
209
+ self::$_instance = new self( $file, $version );
210
+ }
211
+
212
+ return self::$_instance;
213
+ } // End instance ()
214
+
215
+ /**
216
+ * Cloning is forbidden.
217
+ *
218
+ * @since 1.0.0
219
+ */
220
+ public function __clone() {
221
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->_version );
222
+ } // End __clone ()
223
+
224
+ /**
225
+ * Unserializing instances of this class is forbidden.
226
+ *
227
+ * @since 1.0.0
228
+ */
229
+ public function __wakeup() {
230
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->_version );
231
+ } // End __wakeup ()
232
+
233
+ /**
234
+ * Installation. Runs on activation.
235
+ *
236
+ * @access public
237
+ * @since 1.0.0
238
+ * @return void
239
+ */
240
+ public function install() {
241
+ $this->_log_version_number();
242
+
243
+ // Backward compatibility
244
+ $options = get_option( $this->key_name, array() );
245
+ if ( isset( $options['templates'] ) && '01' == $options['templates'] ) {
246
+ $options['templates'] = 'default';
247
+ $options['columns'] = 2;
248
+ update_option( $this->key_name, $options );
249
+ }
250
+ } // End install ()
251
+
252
+ /**
253
+ * Log the plugin version number.
254
+ *
255
+ * @access public
256
+ * @since 1.0.0
257
+ * @return void
258
+ */
259
+ private function _log_version_number() {
260
+ update_option( $this->_token . '_version', $this->_version );
261
+ } // End _log_version_number ()
262
+
263
+
264
+ // Let's hack a little bit
265
+ public function change_template_if_necessary( $template ) {
266
+
267
+ if ( is_customize_preview() && isset( $_REQUEST['colorlib-login-customizer-customization'] ) && is_user_logged_in() ) {
268
+ $new_template = plugin_dir_path( __FILE__ ) . 'login-template.php';
269
+ return $new_template;
270
+ }
271
+
272
+ return $template;
273
+ }
274
+ }
includes/index.php CHANGED
@@ -1,3 +1,3 @@
1
- <?php
2
-
3
- // Silence is golden
1
+ <?php
2
+
3
+ // Silence is golden
includes/lib/class-colorlib-login-customizer-css-customization.php CHANGED
@@ -1,630 +1,817 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- /**
7
- * Class Colorlib_Login_Customizer_Customization
8
- */
9
- class Colorlib_Login_Customizer_CSS_Customization {
10
- /**
11
- * @var array
12
- */
13
- private $options = array();
14
- /**
15
- * @var array
16
- */
17
- private $selectors = array();
18
- /**
19
- * @var string
20
- */
21
- private $base = '';
22
-
23
- /**
24
- * Colorlib_Login_Customizer_CSS_Customization constructor.
25
- */
26
- public function __construct() {
27
- $plugin = Colorlib_Login_Customizer::instance();
28
- $this->key_name = $plugin->key_name;
29
- $this->set_options();
30
- add_action( 'login_head', array( $this, 'generate_css' ), 15 );
31
- add_action( 'login_header', array( $this, 'add_extra_div' ) );
32
- add_action( 'login_footer', array( $this, 'close_extra_div' ) );
33
-
34
- add_filter( 'login_body_class', array( $this, 'body_class' ) );
35
- add_filter( 'login_headerurl', array( $this, 'logo_url' ), 99 );
36
-
37
- //
38
- add_action( 'customize_preview_init', array( $this, 'output_css_object' ), 26 );
39
- }
40
-
41
- private function generate_name( $id ) {
42
- return $this->key_name . '[' . $id . ']';
43
- }
44
-
45
- public function output_css_object() {
46
-
47
- $css_object = array(
48
- 'selectors' => array(),
49
- 'settings' => array(),
50
- );
51
-
52
- foreach ( $this->selectors as $selector => $settings ) {
53
- $css_object['selectors'][ $selector ] = $settings['options'];
54
- foreach ( $settings['options'] as $index => $setting ) {
55
- $css_object['settings'][ $setting ] = array(
56
- 'name' => $this->generate_name( $setting ),
57
- 'value' => $this->options[ $setting ],
58
- 'attribute' => $settings['attributes'][ $index ],
59
- );
60
- }
61
- }
62
-
63
- wp_localize_script( 'colorlib-login-customizer-preview', 'CLC', $css_object );
64
-
65
- }
66
-
67
- /**
68
- * Set the options array, it returns nothing
69
- */
70
- public function set_options() {
71
-
72
- $options = get_option( $this->key_name, array() );
73
-
74
- $defaults = array(
75
- /**
76
- * Templates
77
- */
78
- 'templates' => 'default',
79
- /**
80
- * Layout
81
- */
82
- 'columns' => '1',
83
- 'form-column-align' => '3',
84
- 'form-vertical-align' => '2',
85
- /**
86
- * Logo section
87
- */
88
- 'hide-logo' => 0,
89
- 'custom-logo-url' => '',
90
- 'custom-logo' => '',
91
- 'logo-width' => '',
92
- 'logo-height' => '',
93
- /**
94
- * Background section
95
- */
96
- 'custom-background' => '',
97
- 'custom-background-form' => '',
98
- 'custom-background-color' => '',
99
- 'custom-background-color-form' => '',
100
- /**
101
- * Form section
102
- */
103
- 'form-width' => '',
104
- 'form-height' => '',
105
- 'form-background-image' => '',
106
- 'form-background-color' => '#fff',
107
- 'form-padding' => '',
108
- 'form-border' => '',
109
- 'form-shadow' => '',
110
- 'form-field-width' => '',
111
- 'form-field-margin' => '',
112
- 'form-field-background' => '',
113
- 'form-field-color' => '',
114
- 'form-label-color' => '',
115
- 'hide-extra-links' => 0,
116
- /**
117
- * Others section ( misc )
118
- */
119
- 'button-background' => '',
120
- 'button-background-hover' => '',
121
- 'button-border-color' => '',
122
- 'button-border-color-hover' => '',
123
- 'button-shadow' => '',
124
- 'button-color' => '',
125
- 'link-color' => '',
126
- 'link-color-hover' => '',
127
- /**
128
- * Reset value is not dynamic
129
- */
130
- 'initial' => 'initial',
131
- );
132
-
133
- $this->options = wp_parse_args( $options, $defaults );
134
-
135
- $this->selectors = array(
136
- '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover' => array(
137
- 'attributes' => array(
138
- 'background',
139
- 'border-color',
140
- ),
141
- 'options' => array(
142
- 'button-background-hover',
143
- 'button-border-color-hover',
144
- ),
145
- ),
146
- '.wp-core-ui .button-primary' => array(
147
- 'attributes' => array(
148
- 'background',
149
- 'border-color',
150
- 'box-shadow',
151
- 'color',
152
- ),
153
- 'options' => array(
154
- 'button-background',
155
- 'button-border-color',
156
- 'button-shadow',
157
- 'button-color',
158
- ),
159
- ),
160
- '.login #backtoblog a, .login #nav a' => array(
161
- 'attributes' => array(
162
- 'color',
163
- ),
164
- 'options' => array(
165
- 'link-color',
166
- ),
167
- ),
168
- '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover' => array(
169
- 'attributes' => array(
170
- 'color',
171
- ),
172
- 'options' => array(
173
- 'link-color-hover',
174
- ),
175
- ),
176
- '.ml-container #login' => array(
177
- 'attributes' => array(
178
- 'max-width',
179
- ),
180
- 'options' => array(
181
- 'form-width',
182
- ),
183
- ),
184
- '#loginform' => array(
185
- 'attributes' => array(
186
- 'height',
187
- 'background-image',
188
- 'background-color',
189
- 'padding',
190
- 'border',
191
- 'box-shadow',
192
- ),
193
- 'options' => array(
194
- 'form-height',
195
- 'form-background-image',
196
- 'form-background-color',
197
- 'form-padding',
198
- 'form-border',
199
- 'form-shadow',
200
- ),
201
- ),
202
- '.login form .input, .login input[type="text"]' => array(
203
- 'attributes' => array(
204
- 'max-width',
205
- 'margin',
206
- 'background',
207
- 'color',
208
- ),
209
- 'options' => array(
210
- 'form-field-width',
211
- 'form-field-margin',
212
- 'form-field-background',
213
- 'form-field-color',
214
- ),
215
- ),
216
- '.login label' => array(
217
- 'attributes' => array(
218
- 'color',
219
- ),
220
- 'options' => array(
221
- 'form-label-color',
222
- ),
223
- ),
224
- '.ml-container .ml-extra-div' => array(
225
- 'attributes' => array(
226
- 'background-image',
227
- 'background-color',
228
- ),
229
- 'options' => array(
230
- 'custom-background',
231
- 'custom-background-color',
232
- ),
233
- ),
234
- '.ml-container .ml-form-container' => array(
235
- 'attributes' => array(
236
- 'background-image',
237
- 'background-color',
238
- ),
239
- 'options' => array(
240
- 'custom-background-form',
241
- 'custom-background-color-form',
242
- )
243
- ),
244
- '.login h1 a' => array(
245
- 'attributes' => array(
246
- 'background-image',
247
- 'width',
248
- 'height',
249
- ),
250
- 'options' => array(
251
- 'custom-logo',
252
- 'logo-width',
253
- 'logo-height',
254
- ),
255
- ),
256
- '#login > h1' => array(
257
- 'attributes' => array(
258
- 'display',
259
- ),
260
- 'options' => array(
261
- 'hide-logo',
262
- ),
263
- ),
264
- '#login > #nav,#login > #backtoblog' => array(
265
- 'attributes' => array(
266
- 'display',
267
- ),
268
- 'options' => array(
269
- 'hide-extra-links',
270
- ),
271
- ),
272
- );
273
-
274
- }
275
-
276
- /**
277
- * Create the CSS string for output
278
- *
279
- * @return mixed|string
280
- */
281
- public function create_css() {
282
- /**
283
- * Get an instance of the plugin so we can get the token
284
- */
285
- //$instance = Colorlib_Login_Customizer::instance();
286
-
287
- $string = '';
288
- /**
289
- * In case the array is empty, we return an empty string
290
- */
291
- if ( empty( $this->options ) ) {
292
- return $string;
293
- }
294
-
295
- /**
296
- * Start building the CSS file
297
- */
298
- $string .= $this->_set_background_options();
299
- $string .= $this->_set_logo_options();
300
- $string .= $this->_set_form_options();
301
- $string .= $this->_set_miscellaneous_options();
302
-
303
- return $string;
304
- }
305
-
306
- /**
307
- * @return string
308
- */
309
- public function _set_miscellaneous_options() {
310
- $string = '';
311
-
312
- $string .= $this->create_css_lines(
313
- '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover',
314
- array(
315
- 'background',
316
- 'border-color',
317
- ),
318
- array(
319
- 'button-background-hover',
320
- 'button-border-color-hover',
321
- )
322
- );
323
-
324
- $string .= $this->create_css_lines(
325
- '.wp-core-ui .button-primary',
326
- array(
327
- 'background',
328
- 'border-color',
329
- 'box-shadow',
330
- 'color',
331
- ),
332
- array(
333
- 'button-background',
334
- 'button-border-color',
335
- 'button-shadow',
336
- 'button-color',
337
- )
338
- );
339
-
340
- $string .= $this->create_css_lines(
341
- '.login #backtoblog a, .login #nav a',
342
- array(
343
- 'color',
344
- ),
345
- array(
346
- 'link-color',
347
- )
348
- );
349
-
350
- $string .= $this->create_css_lines(
351
- '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover',
352
- array(
353
- 'color',
354
- ),
355
- array(
356
- 'link-color-hover',
357
- )
358
- );
359
-
360
- return $string;
361
- }
362
-
363
- /**
364
- * @return string
365
- */
366
- public function _set_form_options() {
367
- $string = '';
368
-
369
- $string .= $this->create_css_lines(
370
- '.ml-container #login',
371
- array(
372
- 'max-width',
373
- ),
374
- array(
375
- 'form-width',
376
- )
377
- );
378
-
379
- /**
380
- * Set form variables
381
- */
382
- $string .= $this->create_css_lines(
383
- '#loginform',
384
- array(
385
- 'height',
386
- 'background-image',
387
- 'background-color',
388
- 'padding',
389
- 'border',
390
- 'box-shadow',
391
- ),
392
- array(
393
- 'form-height',
394
- 'form-background-image',
395
- 'form-background-color',
396
- 'form-padding',
397
- 'form-border',
398
- 'form-shadow',
399
- )
400
- );
401
-
402
- /**
403
- * Set form field variables
404
- */
405
- $string .= $this->create_css_lines(
406
- '.login form .input, .login input[type="text"]',
407
- array(
408
- 'max-width',
409
- 'margin',
410
- 'background',
411
- 'color',
412
- ),
413
- array(
414
- 'form-field-width',
415
- 'form-field-margin',
416
- 'form-field-background',
417
- 'form-field-color',
418
- )
419
- );
420
-
421
- /**
422
- * Set form field labels
423
- */
424
- $string .= $this->create_css_lines(
425
- '.login label',
426
- array( 'color' ),
427
- array( 'form-label-color' )
428
- );
429
-
430
- $string .= $this->create_css_lines(
431
- '#login > #nav,#login > #backtoblog',
432
- array(
433
- 'display',
434
- ),
435
- array(
436
- 'hide-extra-links',
437
- )
438
- );
439
-
440
- return $string;
441
- }
442
-
443
- /**
444
- * @return string
445
- */
446
- public function _set_background_options() {
447
- $string = '';
448
- /**
449
- * Set background-image
450
- */
451
- $string .= $this->create_css_lines(
452
- '.ml-container .ml-extra-div',
453
- array(
454
- 'background-image',
455
- 'background-color',
456
- ),
457
- array(
458
- 'custom-background',
459
- 'custom-background-color',
460
- )
461
- );
462
-
463
- $string .= $this->create_css_lines(
464
- '.ml-container .ml-form-container',
465
- array(
466
- 'background-image',
467
- 'background-color',
468
- ),
469
- array(
470
- 'custom-background-form',
471
- 'custom-background-color-form',
472
- )
473
- );
474
-
475
- return $string;
476
-
477
- }
478
-
479
- /**
480
- * @return string
481
- */
482
- public function _set_logo_options() {
483
- $string = '';
484
- /**
485
- * Set logo dimensions
486
- */
487
- $string .= $this->create_css_lines(
488
- '.login h1 a',
489
- array(
490
- 'background-image',
491
- 'background-size',
492
- 'width',
493
- 'height',
494
- ),
495
- array(
496
- 'custom-logo',
497
- 'logo-width',
498
- 'logo-width',
499
- 'logo-height',
500
- )
501
- );
502
-
503
- $string .= $this->create_css_lines(
504
- '#login > h1',
505
- array(
506
- 'display',
507
- ),
508
- array(
509
- 'hide-logo',
510
- )
511
- );
512
-
513
- return $string;
514
- }
515
-
516
- /**
517
- * @param $selector
518
- * @param $properties
519
- * @param $options
520
- *
521
- * @return string
522
- */
523
- private function create_css_lines( $selector, $properties, $options ) {
524
- $string = '';
525
- $valued = array();
526
-
527
- $i = 0;
528
- foreach ( $options as $option ) {
529
- if ( ! empty( $this->options[ $option ] ) ) {
530
- $valued[ $properties[ $i ] ] = $this->options[ $option ];
531
- }
532
- $i ++;
533
- }
534
-
535
- if ( ! empty( $valued ) ) {
536
- $string .= $selector . '{' . "\n";
537
-
538
- foreach ( $valued as $index => $value ) {
539
- $string .= $index . ':' . esc_attr( $this->add_artifacts( $index, $value ) ) . ';' . "\n";
540
- }
541
- $string .= '}' . "\n";
542
- }
543
-
544
- return $string;
545
- }
546
-
547
- /**
548
- *
549
- *
550
- * @param $property
551
- * @param $value
552
- *
553
- * @return string
554
- */
555
- private function add_artifacts( $property, $value ) {
556
- switch ( $property ) {
557
- case 'background-image':
558
- $value = 'url(' . $value . ')';
559
- break;
560
-
561
- case 'width':
562
- case 'min-width':
563
- case 'max-width':
564
- case 'background-size':
565
- case 'height':
566
- case 'min-height':
567
- case 'max-height':
568
- $value = $value . 'px';
569
- break;
570
- case 'display':
571
- if ( ! $value ) {
572
- $value = 'block';
573
- }else{
574
- $value = 'none';
575
- }
576
- default:
577
- break;
578
- }
579
-
580
- return $value;
581
- }
582
-
583
- public function body_class( $classes ) {
584
-
585
- if ( '2' == $this->options['columns'] ) {
586
- $classes[] = 'ml-half-screen';
587
- if ( isset( $this->options['form-column-align'] ) ) {
588
- $classes[] = 'ml-login-align-' . esc_attr( $this->options['form-column-align'] );
589
- }
590
- }
591
-
592
- if ( isset( $this->options['form-vertical-align'] ) ) {
593
- $classes[] = 'ml-login-vertical-align-' . esc_attr( $this->options['form-vertical-align'] );
594
- }
595
-
596
- if ( isset( $this->options['form-horizontal-align'] ) ) {
597
- $classes[] = 'ml-login-horizontal-align-' . esc_attr( $this->options['form-horizontal-align'] );
598
- }
599
-
600
- return $classes;
601
- }
602
-
603
- public function logo_url( $url ) {
604
- if ( '' != $this->options['custom-logo-url'] ) {
605
- return esc_url( $this->options['custom-logo-url'] );
606
- }
607
-
608
- return $url;
609
- }
610
-
611
- /**
612
- * Output the inline CSS
613
- */
614
- public function generate_css() {
615
- $instance = Colorlib_Login_Customizer::instance();
616
- $css = $this->create_css();
617
-
618
- echo '<style type="text/css">body:not( .ml-half-screen ) .ml-form-container{background:transparent !important;}.login h1 a{background-position: center;background-size:contain !important;}.ml-container #login{ position:relative;padding: 0;width:100%;max-width:320px;margin:0;}#loginform{box-sizing: border-box;max-height: 100%;background-position: center;background-repeat: no-repeat;background-size: cover;}.ml-container{position:relative;min-height:100vh;display:flex}.ml-container .ml-extra-div{background-position:center;background-size:cover;background-repeat:no-repeat}body .ml-form-container{display:flex;align-items:center;justify-content:center}body:not( .ml-half-screen ) .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%}body:not( .ml-half-screen ) .ml-container .ml-form-container{width:100%;min-height:100vh}body.ml-half-screen .ml-container{flex-wrap:wrap}body.ml-half-screen .ml-container>.ml-extra-div,body.ml-half-screen .ml-container>.ml-form-container{width:50%}body.ml-half-screen.ml-login-align-2 .ml-container>div,body.ml-half-screen.ml-login-align-4 .ml-container>div{width:100%;height:50%;flex:1;flex-shrink:0}body.ml-half-screen.ml-login-align-2 .ml-container{flex-direction:column-reverse}body.ml-half-screen.ml-login-align-4 .ml-container{flex-direction:column}body.ml-half-screen.ml-login-align-1 .ml-container{flex-direction:row-reverse}body.ml-login-vertical-align-1 .ml-form-container{align-items:flex-start}body.ml-login-vertical-align-3 .ml-form-container{align-items:flex-end}body.ml-login-horizontal-align-1 .ml-form-container{justify-content:flex-start}body.ml-login-horizontal-align-3 .ml-form-container{justify-content:flex-end}@media only screen and (max-width: 768px) {body.ml-half-screen .ml-container > .ml-extra-div, body.ml-half-screen .ml-container > .ml-form-container{width:100%;}body .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%;}}</style>';
619
- echo '<style type="text/css" id="clc-style">' . $css . '</style>';
620
- }
621
-
622
- public function add_extra_div() {
623
- echo '<div class="ml-container"><div class="ml-extra-div"></div><div class="ml-form-container">';
624
- }
625
-
626
- public function close_extra_div() {
627
- echo '</div></div>';
628
- }
629
-
630
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
5
+
6
+ /**
7
+ * Class Colorlib_Login_Customizer_Customization
8
+ */
9
+ class Colorlib_Login_Customizer_CSS_Customization {
10
+ /**
11
+ * @var array
12
+ */
13
+ private $options = array();
14
+ /**
15
+ * @var array
16
+ */
17
+ private $selectors = array();
18
+ /**
19
+ * @var string
20
+ */
21
+ private $base = '';
22
+
23
+ /**
24
+ * Colorlib_Login_Customizer_CSS_Customization constructor.
25
+ */
26
+ public function __construct() {
27
+ $plugin = Colorlib_Login_Customizer::instance();
28
+ $this->key_name = $plugin->key_name;
29
+ $this->set_options();
30
+
31
+ add_action( 'login_head', array( $this, 'check_labels' ) );
32
+ add_action( 'login_header', array( $this, 'add_extra_div' ) );
33
+ add_action( 'login_head', array( $this, 'generate_css' ), 15 );
34
+ add_action( 'login_footer', array( $this, 'close_extra_div' ) );
35
+
36
+ add_filter( 'login_body_class', array( $this, 'body_class' ) );
37
+ add_filter( 'login_headerurl', array( $this, 'logo_url' ), 99 );
38
+ add_filter( 'login_headertitle', array( $this, 'logo_text' ), 99 );
39
+
40
+ //
41
+ add_action( 'customize_preview_init', array( $this, 'output_css_object' ), 26 );
42
+ }
43
+
44
+ private function generate_name( $id ) {
45
+ return $this->key_name . '[' . $id . ']';
46
+ }
47
+
48
+ public function output_css_object() {
49
+
50
+ $css_object = array(
51
+ 'selectors' => array(),
52
+ 'settings' => array(),
53
+ );
54
+
55
+ foreach ( $this->selectors as $selector => $settings ) {
56
+ $css_object['selectors'][ $selector ] = $settings['options'];
57
+ foreach ( $settings['options'] as $index => $setting ) {
58
+ $css_object['settings'][ $setting ] = array(
59
+ 'name' => $this->generate_name( $setting ),
60
+ 'value' => $this->options[ $setting ],
61
+ 'attribute' => $settings['attributes'][ $index ],
62
+ );
63
+ }
64
+ }
65
+
66
+ wp_localize_script( 'colorlib-login-customizer-preview', 'CLC', $css_object );
67
+
68
+ }
69
+
70
+ /**
71
+ * Set the options array, it returns nothing
72
+ */
73
+ public function set_options() {
74
+
75
+ $options = get_option( $this->key_name, array() );
76
+
77
+ $defaults = array(
78
+ /**
79
+ * Templates
80
+ */
81
+ 'templates' => 'default',
82
+ /**
83
+ * Layout
84
+ */
85
+ 'columns' => '1',
86
+ 'columns-width' => array(
87
+ 'left' => 6,
88
+ 'right' => 6,
89
+ ),
90
+ 'form-column-align' => '3',
91
+ 'form-vertical-align' => '2',
92
+ /**
93
+ * Logo section
94
+ */
95
+ 'hide-logo' => 0,
96
+ 'use-text-logo' => 0,
97
+ 'custom-logo-url' => '',
98
+ 'custom-logo' => '',
99
+ 'logo-text-color' => '#444',
100
+ 'logo-text-size' => '20',
101
+ 'logo-text-color-hover' => '#00a0d2',
102
+ 'logo-width' => '',
103
+ 'logo-height' => '',
104
+ /**
105
+ * Background section
106
+ */
107
+ 'custom-background' => '',
108
+ 'custom-background-form' => '',
109
+ 'custom-background-color' => '',
110
+ 'custom-background-color-form' => '',
111
+ /**
112
+ * Form section
113
+ */
114
+ 'form-width' => '',
115
+ 'form-height' => '',
116
+ 'form-background-image' => '',
117
+ 'form-background-color' => '#fff',
118
+ 'form-padding' => '',
119
+ 'form-border' => '',
120
+ 'form-border-radius' => '',
121
+ 'form-shadow' => '',
122
+ 'form-field-width' => '',
123
+ 'form-field-margin' => '',
124
+ 'form-field-border-radius' => 'unset',
125
+ 'form-field-border' => '1px solid #ddd',
126
+ 'form-field-background' => '',
127
+ 'form-field-color' => '',
128
+ 'username-label' => 'Username or Email Address',
129
+ 'password-label' => 'Password',
130
+ 'form-label-color' => '',
131
+ 'hide-extra-links' => false,
132
+ /**
133
+ * Others section ( misc )
134
+ */
135
+ 'button-background' => '',
136
+ 'button-background-hover' => '',
137
+ 'button-border-color' => '',
138
+ 'button-border-color-hover' => '',
139
+ 'button-shadow' => '',
140
+ 'button-text-shadow' => '',
141
+ 'button-color' => '',
142
+ 'link-color' => '',
143
+ 'link-color-hover' => '',
144
+ 'hide-rememberme' => false,
145
+ /**
146
+ * Reset value is not dynamic
147
+ */
148
+ 'initial' => 'initial',
149
+ );
150
+
151
+ $this->options = wp_parse_args( $options, $defaults );
152
+
153
+ $this->selectors = array(
154
+ '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover' => array(
155
+ 'attributes' => array(
156
+ 'background',
157
+ 'border-color',
158
+ ),
159
+ 'options' => array(
160
+ 'button-background-hover',
161
+ 'button-border-color-hover',
162
+ ),
163
+ ),
164
+ '.wp-core-ui .button-primary' => array(
165
+ 'attributes' => array(
166
+ 'background',
167
+ 'border-color',
168
+ 'box-shadow',
169
+ 'text-shadow',
170
+ 'color',
171
+ ),
172
+ 'options' => array(
173
+ 'button-background',
174
+ 'button-border-color',
175
+ 'button-shadow',
176
+ 'button-text-shadow',
177
+ 'button-color',
178
+ ),
179
+ ),
180
+ '.login #backtoblog a, .login #nav a' => array(
181
+ 'attributes' => array(
182
+ 'color',
183
+ ),
184
+ 'options' => array(
185
+ 'link-color',
186
+ ),
187
+ ),
188
+ '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover' => array(
189
+ 'attributes' => array(
190
+ 'color',
191
+ ),
192
+ 'options' => array(
193
+ 'link-color-hover',
194
+ ),
195
+ ),
196
+ '.ml-container #login' => array(
197
+ 'attributes' => array(
198
+ 'max-width',
199
+ ),
200
+ 'options' => array(
201
+ 'form-width',
202
+ ),
203
+ ),
204
+ '#loginform' => array(
205
+ 'attributes' => array(
206
+ 'height',
207
+ 'background-image',
208
+ 'background-color',
209
+ 'padding',
210
+ 'border',
211
+ 'border-radius',
212
+ 'box-shadow',
213
+ ),
214
+ 'options' => array(
215
+ 'form-height',
216
+ 'form-background-image',
217
+ 'form-background-color',
218
+ 'form-padding',
219
+ 'form-border',
220
+ 'form-border-radius',
221
+ 'form-shadow',
222
+ ),
223
+ ),
224
+ '.login form .input, .login input[type="text"]' => array(
225
+ 'attributes' => array(
226
+ 'max-width',
227
+ 'margin',
228
+ 'border-radius',
229
+ 'border',
230
+ 'background',
231
+ 'color',
232
+ ),
233
+ 'options' => array(
234
+ 'form-field-width',
235
+ 'form-field-margin',
236
+ 'form-field-border-radius',
237
+ 'form-field-border',
238
+ 'form-field-background',
239
+ 'form-field-color',
240
+ ),
241
+ ),
242
+ '.login label' => array(
243
+ 'attributes' => array(
244
+ 'color',
245
+ ),
246
+ 'options' => array(
247
+ 'form-label-color',
248
+ ),
249
+ ),
250
+ '.ml-container .ml-extra-div' => array(
251
+ 'attributes' => array(
252
+ 'background-image',
253
+ 'background-color',
254
+ ),
255
+ 'options' => array(
256
+ 'custom-background',
257
+ 'custom-background-color',
258
+ ),
259
+ ),
260
+ '.ml-container .ml-form-container' => array(
261
+ 'attributes' => array(
262
+ 'background-image',
263
+ 'background-color',
264
+ ),
265
+ 'options' => array(
266
+ 'custom-background-form',
267
+ 'custom-background-color-form',
268
+ )
269
+ ),
270
+ '.login h1 a' => array(
271
+ 'attributes' => array(
272
+ 'background-image',
273
+ 'width',
274
+ 'height',
275
+ ),
276
+ 'options' => array(
277
+ 'custom-logo',
278
+ 'logo-width',
279
+ 'logo-height',
280
+ ),
281
+ ),
282
+ '.login.clc-text-logo h1 a' => array(
283
+ 'attributes' => array(
284
+ 'color',
285
+ 'font-size',
286
+ ),
287
+ 'options' => array(
288
+ 'logo-text-color',
289
+ 'logo-text-size',
290
+ ),
291
+ ),
292
+ '.login.clc-text-logo h1 a:hover' => array(
293
+ 'attributes' => array(
294
+ 'color',
295
+ ),
296
+ 'options' => array(
297
+ 'logo-text-color-hover',
298
+ ),
299
+ ),
300
+ '#login > h1' => array(
301
+ 'attributes' => array(
302
+ 'display',
303
+ ),
304
+ 'options' => array(
305
+ 'hide-logo',
306
+ ),
307
+ ),
308
+ '#login > #nav,#login > #backtoblog' => array(
309
+ 'attributes' => array(
310
+ 'display',
311
+ ),
312
+ 'options' => array(
313
+ 'hide-extra-links',
314
+ ),
315
+ ),
316
+ '#login form .forgetmenot' => array(
317
+ 'attributes' => array(
318
+ 'display',
319
+ ),
320
+ 'options' => array(
321
+ 'hide-rememberme',
322
+ ),
323
+ ),
324
+ );
325
+
326
+ }
327
+
328
+ /**
329
+ * Create the CSS string for output
330
+ *
331
+ * @return mixed|string
332
+ */
333
+ public function create_css() {
334
+ /**
335
+ * Get an instance of the plugin so we can get the token
336
+ */
337
+ //$instance = Colorlib_Login_Customizer::instance();
338
+
339
+ $string = '';
340
+ /**
341
+ * In case the array is empty, we return an empty string
342
+ */
343
+ if ( empty( $this->options ) ) {
344
+ return $string;
345
+ }
346
+
347
+ /**
348
+ * Start building the CSS file
349
+ */
350
+ $string .= $this->_set_background_options();
351
+ $string .= $this->_set_logo_options();
352
+ $string .= $this->_set_form_options();
353
+ $string .= $this->_set_miscellaneous_options();
354
+
355
+ return $string;
356
+ }
357
+
358
+ /**
359
+ * @return string
360
+ */
361
+ public function _set_miscellaneous_options() {
362
+ $string = '';
363
+
364
+ $string .= $this->create_css_lines(
365
+ '.wp-core-ui .button-primary.focus, .wp-core-ui .button-primary.hover, .wp-core-ui .button-primary:focus, .wp-core-ui .button-primary:hover',
366
+ array(
367
+ 'background',
368
+ 'border-color',
369
+ ),
370
+ array(
371
+ 'button-background-hover',
372
+ 'button-border-color-hover',
373
+ )
374
+ );
375
+
376
+ $string .= $this->create_css_lines(
377
+ '.wp-core-ui .button-primary',
378
+ array(
379
+ 'background',
380
+ 'border-color',
381
+ 'box-shadow',
382
+ 'text-shadow',
383
+ 'color',
384
+ ),
385
+ array(
386
+ 'button-background',
387
+ 'button-border-color',
388
+ 'button-shadow',
389
+ 'button-text-shadow',
390
+ 'button-color',
391
+ )
392
+ );
393
+
394
+ $string .= $this->create_css_lines(
395
+ '.login #backtoblog a, .login #nav a',
396
+ array(
397
+ 'color',
398
+ ),
399
+ array(
400
+ 'link-color',
401
+ )
402
+ );
403
+
404
+ $string .= $this->create_css_lines(
405
+ '.login #backtoblog a:hover, .login #nav a:hover, .login h1 a:hover',
406
+ array(
407
+ 'color',
408
+ ),
409
+ array(
410
+ 'link-color-hover',
411
+ )
412
+ );
413
+
414
+ $string .= $this->create_css_lines(
415
+ '#login form .forgetmenot',
416
+ array(
417
+ 'display',
418
+ ),
419
+ array(
420
+ 'hide-rememberme',
421
+ )
422
+ );
423
+
424
+ return $string;
425
+ }
426
+
427
+ /**
428
+ * @return string
429
+ */
430
+ public function _set_form_options() {
431
+ $string = '';
432
+
433
+ $string .= $this->create_css_lines(
434
+ '.ml-container #login',
435
+ array(
436
+ 'max-width',
437
+ ),
438
+ array(
439
+ 'form-width',
440
+ )
441
+ );
442
+
443
+ /**
444
+ * Set form variables
445
+ */
446
+ $string .= $this->create_css_lines(
447
+ '#loginform',
448
+ array(
449
+ 'height',
450
+ 'background-image',
451
+ 'background-color',
452
+ 'padding',
453
+ 'border',
454
+ 'border-radius',
455
+ 'box-shadow',
456
+ ),
457
+ array(
458
+ 'form-height',
459
+ 'form-background-image',
460
+ 'form-background-color',
461
+ 'form-padding',
462
+ 'form-border',
463
+ 'form-border-radius',
464
+ 'form-shadow',
465
+ )
466
+ );
467
+
468
+ /**
469
+ * Set form field variables
470
+ */
471
+ $string .= $this->create_css_lines(
472
+ '.login form .input, .login input[type="text"]',
473
+ array(
474
+ 'max-width',
475
+ 'margin',
476
+ 'border-radius',
477
+ 'border',
478
+ 'background',
479
+ 'color',
480
+ ),
481
+ array(
482
+ 'form-field-width',
483
+ 'form-field-margin',
484
+ 'form-field-border-radius',
485
+ 'form-field-border',
486
+ 'form-field-background',
487
+ 'form-field-color',
488
+ )
489
+ );
490
+
491
+ /**
492
+ * Set form field labels
493
+ */
494
+ $string .= $this->create_css_lines(
495
+ '.login label',
496
+ array(
497
+ 'color',
498
+ ),
499
+ array(
500
+ 'form-label-color',
501
+ )
502
+ );
503
+
504
+ $string .= $this->create_css_lines(
505
+ '#login > #nav,#login > #backtoblog',
506
+ array(
507
+ 'display',
508
+ ),
509
+ array(
510
+ 'hide-extra-links',
511
+ )
512
+ );
513
+
514
+ return $string;
515
+ }
516
+
517
+ /**
518
+ * @return string
519
+ */
520
+ public function _set_background_options() {
521
+ $string = '';
522
+ /**
523
+ * Set background-image
524
+ */
525
+ $string .= $this->create_css_lines(
526
+ '.ml-container .ml-extra-div',
527
+ array(
528
+ 'background-image',
529
+ 'background-color',
530
+ ),
531
+ array(
532
+ 'custom-background',
533
+ 'custom-background-color',
534
+ )
535
+ );
536
+
537
+ $string .= $this->create_css_lines(
538
+ '.ml-container .ml-form-container',
539
+ array(
540
+ 'background-image',
541
+ 'background-color',
542
+ ),
543
+ array(
544
+ 'custom-background-form',
545
+ 'custom-background-color-form',
546
+ )
547
+ );
548
+
549
+ return $string;
550
+
551
+ }
552
+
553
+ /**
554
+ * @return string
555
+ */
556
+ public function _set_logo_options() {
557
+ $string = '';
558
+ /**
559
+ * Set logo dimensions
560
+ */
561
+ $string .= $this->create_css_lines(
562
+ '.login h1 a',
563
+ array(
564
+ 'background-image',
565
+ 'background-size',
566
+ 'width',
567
+ 'height',
568
+ ),
569
+ array(
570
+ 'custom-logo',
571
+ 'logo-width',
572
+ 'logo-width',
573
+ 'logo-height',
574
+ )
575
+ );
576
+
577
+ $string .= $this->create_css_lines(
578
+ '.login.clc-text-logo h1 a',
579
+ array(
580
+ 'color',
581
+ 'font-size',
582
+ ),
583
+ array(
584
+ 'logo-text-color',
585
+ 'logo-text-size',
586
+ )
587
+ );
588
+
589
+ $string .= $this->create_css_lines(
590
+ '.login.clc-text-logo h1 a:hover',
591
+ array(
592
+ 'color',
593
+ ),
594
+ array(
595
+ 'logo-text-color-hover',
596
+ )
597
+ );
598
+
599
+ $string .= $this->create_css_lines(
600
+ '#login > h1',
601
+ array(
602
+ 'display',
603
+ ),
604
+ array(
605
+ 'hide-logo',
606
+ )
607
+ );
608
+
609
+ return $string;
610
+ }
611
+
612
+ /**
613
+ * @param $selector
614
+ * @param $properties
615
+ * @param $options
616
+ *
617
+ * @return string
618
+ */
619
+ private function create_css_lines( $selector, $properties, $options ) {
620
+ $string = '';
621
+ $valued = array();
622
+
623
+ $i = 0;
624
+ foreach ( $options as $option ) {
625
+ if ( ! empty( $this->options[ $option ] ) ) {
626
+ $valued[ $properties[ $i ] ] = $this->options[ $option ];
627
+ }
628
+ $i ++;
629
+ }
630
+
631
+ if ( ! empty( $valued ) ) {
632
+ $string .= $selector . '{' . "\n";
633
+
634
+ foreach ( $valued as $index => $value ) {
635
+ $string .= $index . ':' . esc_attr( $this->add_artifacts( $index, $value ) ) . ';' . "\n";
636
+ }
637
+ $string .= '}' . "\n";
638
+ }
639
+
640
+ return $string;
641
+ }
642
+
643
+ /**
644
+ *
645
+ *
646
+ * @param $property
647
+ * @param $value
648
+ *
649
+ * @return string
650
+ */
651
+ private function add_artifacts( $property, $value ) {
652
+ switch ( $property ) {
653
+ case 'background-image':
654
+ $value = 'url(' . $value . ')';
655
+ break;
656
+
657
+ case 'width':
658
+ case 'min-width':
659
+ case 'max-width':
660
+ case 'background-size':
661
+ case 'height':
662
+ case 'min-height':
663
+ case 'max-height':
664
+ case 'font-size':
665
+ $value = $value . 'px';
666
+ break;
667
+ case 'display':
668
+ if ( ! $value ) {
669
+ $value = 'block';
670
+ }else{
671
+ $value = 'none';
672
+ }
673
+ default:
674
+ break;
675
+ }
676
+
677
+ return $value;
678
+ }
679
+
680
+ public function body_class( $classes ) {
681
+
682
+ if ( '2' == $this->options['columns'] ) {
683
+ $classes[] = 'ml-half-screen';
684
+ if ( isset( $this->options['form-column-align'] ) ) {
685
+ $classes[] = 'ml-login-align-' . esc_attr( $this->options['form-column-align'] );
686
+ }
687
+ }
688
+
689
+ if ( isset( $this->options['form-vertical-align'] ) ) {
690
+ $classes[] = 'ml-login-vertical-align-' . esc_attr( $this->options['form-vertical-align'] );
691
+ }
692
+
693
+ if ( isset( $this->options['form-horizontal-align'] ) ) {
694
+ $classes[] = 'ml-login-horizontal-align-' . esc_attr( $this->options['form-horizontal-align'] );
695
+ }
696
+
697
+ if ( isset( $this->options['use-text-logo'] ) && $this->options['use-text-logo'] ) {
698
+ $classes[] = 'clc-text-logo';
699
+ }
700
+
701
+ return $classes;
702
+ }
703
+
704
+ public function logo_url( $url ) {
705
+ if ( '' != $this->options['custom-logo-url'] ) {
706
+ return esc_url( $this->options['custom-logo-url'] );
707
+ }
708
+
709
+ return $url;
710
+ }
711
+
712
+ public function logo_text( $text ) {
713
+ if ( isset( $this->options['use-text-logo'] ) && $this->options['use-text-logo'] ) {
714
+ return wp_kses_post( $this->options['logo-text'] );
715
+ }
716
+
717
+ return $text;
718
+ }
719
+
720
+ /**
721
+ * Output the inline CSS
722
+ */
723
+ public function generate_css() {
724
+ $instance = Colorlib_Login_Customizer::instance();
725
+ $css = $this->create_css();
726
+ $custom_css = $this->options['custom-css'];
727
+ $columns_css = '';
728
+
729
+ if ( 2 == $this->options['columns'] ) {
730
+ $widths = $this->options['columns-width'];
731
+
732
+ $left_width = ( 100 / 12 )*absint( $widths['left'] );
733
+ $right_width = ( 100 / 12 )*absint( $widths['right'] );
734
+
735
+ $columns_css .= '.ml-half-screen.ml-login-align-3 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-1 .ml-container .ml-form-container{ width:' . $left_width . '%; }';
736
+ $columns_css .= '.ml-half-screen.ml-login-align-4 .ml-container .ml-extra-div,.ml-half-screen.ml-login-align-2 .ml-container .ml-form-container{ flex-basis:' . $left_width . '%; }';
737
+
738
+ $columns_css .= '.ml-half-screen.ml-login-align-3 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-1 .ml-container .ml-extra-div{ width:' . $right_width . '%; }';
739
+ $columns_css .= '.ml-half-screen.ml-login-align-4 .ml-container .ml-form-container,.ml-half-screen.ml-login-align-2 .ml-container .ml-extra-div{ flex-basis:' . $right_width . '%; }';
740
+
741
+ }
742
+
743
+ echo '<style type="text/css">.login.clc-text-logo h1 a{ background-image: none !important;text-indent: unset; }#login form p label br{display:none}body:not( .ml-half-screen ) .ml-form-container{background:transparent !important;}.login h1 a{background-position: center;background-size:contain !important;}.ml-container #login{ position:relative;padding: 0;width:100%;max-width:320px;margin:0;}#loginform{box-sizing: border-box;max-height: 100%;background-position: center;background-repeat: no-repeat;background-size: cover;}.ml-container{position:relative;min-height:100vh;display:flex;height:100%;min-width:100%;}.ml-container .ml-extra-div{background-position:center;background-size:cover;background-repeat:no-repeat}body .ml-form-container{display:flex;align-items:center;justify-content:center}body:not( .ml-half-screen ) .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%}body:not( .ml-half-screen ) .ml-container .ml-form-container{width:100%;min-height:100vh}body.ml-half-screen .ml-container{flex-wrap:wrap}body.ml-half-screen .ml-container>.ml-extra-div,body.ml-half-screen .ml-container>.ml-form-container{width:50%}body.ml-half-screen.ml-login-align-2 .ml-container>div,body.ml-half-screen.ml-login-align-4 .ml-container>div{width:100%;flex-basis:50%;}body.ml-half-screen.ml-login-align-2 .ml-container{flex-direction:column-reverse}body.ml-half-screen.ml-login-align-4 .ml-container{flex-direction:column}body.ml-half-screen.ml-login-align-1 .ml-container{flex-direction:row-reverse}body.ml-login-vertical-align-1 .ml-form-container{align-items:flex-start}body.ml-login-vertical-align-3 .ml-form-container{align-items:flex-end}body.ml-login-horizontal-align-1 .ml-form-container{justify-content:flex-start}body.ml-login-horizontal-align-3 .ml-form-container{justify-content:flex-end}@media only screen and (max-width: 768px) {body.ml-half-screen .ml-container > .ml-extra-div, body.ml-half-screen .ml-container > .ml-form-container{width:100%;}body .ml-container .ml-extra-div{position:absolute;top:0;left:0;width:100%;height:100%;}}</style>';
744
+ echo '<style type="text/css" id="clc-style">' . $css . '</style>';
745
+ echo '<style type="text/css" id="clc-columns-style">' . $columns_css . '</style>';
746
+ echo '<style type="text/css" id="clc-custom-css">' . $custom_css . '</style>';
747
+ }
748
+
749
+ public function add_extra_div() {
750
+ echo '<div class="ml-container"><div class="ml-extra-div"></div><div class="ml-form-container">';
751
+ }
752
+
753
+ public function close_extra_div() {
754
+ echo '</div></div>';
755
+ }
756
+
757
+ public function check_labels() {
758
+
759
+ add_filter( 'gettext', array( $this, 'change_username_label' ), 99, 3 );
760
+ add_filter( 'gettext', array( $this, 'change_password_label' ), 99, 3 );
761
+
762
+ }
763
+
764
+ /**
765
+ * Customizer output for custom username label.
766
+ *
767
+ * @param string|string $translated_text The translated text.
768
+ * @param string|string $text The label we want to replace.
769
+ * @param string|string $domain The text domain of the site.
770
+ * @return string
771
+ */
772
+ public function change_username_label( $translated_text, $text, $domain ) {
773
+ $default = 'Username or Email Address';
774
+ $label = $this->options['username-label'];
775
+
776
+ // Check if is our text
777
+ if ( $default !== $text ) {
778
+ return $translated_text;
779
+ }
780
+
781
+ // Check if the label is changed
782
+ if ( $label === $text ) {
783
+ return $translated_text;
784
+ }else{
785
+ $translated_text = esc_html( $label );
786
+ }
787
+
788
+ return $translated_text;
789
+ }
790
+ /**
791
+ * Customizer output for custom password label.
792
+ *
793
+ * @param string|string $translated_text The translated text.
794
+ * @param string|string $text The label we want to replace.
795
+ * @param string|string $domain The text domain of the site.
796
+ * @return string
797
+ */
798
+ public function change_password_label( $translated_text, $text, $domain ) {
799
+ $default = 'Password';
800
+ $label = $this->options['password-label'];
801
+
802
+ // Check if is our text
803
+ if ( $default !== $text ) {
804
+ return $translated_text;
805
+ }
806
+
807
+ // Check if the label is changed
808
+ if ( $label === $text ) {
809
+ return $translated_text;
810
+ }else{
811
+ $translated_text = esc_html( $label );
812
+ }
813
+
814
+ return $translated_text;
815
+ }
816
+
817
+ }
includes/lib/class-colorlib-login-customizer-customizer.php CHANGED
@@ -1,638 +1,903 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- };
6
-
7
- /**
8
- * Class Colorlib_Login_Customizer_Customizer
9
- */
10
- class Colorlib_Login_Customizer_Customizer {
11
- /**
12
- * @var
13
- */
14
- public $settings;
15
- /**
16
- * The main plugin object.
17
- *
18
- * @var object
19
- * @access public
20
- * @since 1.0.0
21
- */
22
- public $parent = null;
23
-
24
- /**
25
- * Colorlib_Login_Customizer_Customizer constructor.
26
- *
27
- * @param $parent
28
- * @param $manager
29
- */
30
- public function __construct( $parent, $manager ) {
31
- //Plugin object
32
- $this->parent = $parent;
33
- // Initialise settings
34
- $this->init_settings();
35
- // Register plugin sections and settings
36
- $this->register_settings( $manager );
37
- // Load customizer assets
38
- add_action( 'customize_controls_enqueue_scripts', array( $this, 'customizer_enqueue_scripts' ), 25 );
39
- add_action( 'customize_preview_init', array( $this, 'customize_preview_styles' ), 25 );
40
- }
41
-
42
- /**
43
- * Initialise settings
44
- *
45
- * @return void
46
- */
47
- public function init_settings() {
48
- $this->settings = $this->settings_fields();
49
- }
50
-
51
- private function generate_name( $id ) {
52
- return $this->parent->key_name . '[' . $id . ']';
53
- }
54
-
55
- /**
56
- * Build settings fields
57
- *
58
- * @return array Fields to be displayed on settings page
59
- */
60
- private function settings_fields() {
61
- $settings['templates'] = array(
62
- 'title' => esc_html__( 'Templates', 'colorlib-login-customizer' ),
63
- 'description' => '',
64
- 'fields' => array(
65
- array(
66
- 'id' => 'templates',
67
- 'label' => esc_html__( 'Temapltes', 'colorlib-login-customizer' ),
68
- 'description' => '',
69
- 'type' => 'clc-templates',
70
- 'default' => 'default',
71
- 'choices' => array(
72
- 'default' => array(
73
- 'url' => esc_url( $this->parent->assets_url ) . 'img/default.jpg',
74
- 'options' => array(
75
- /**
76
- * Layout
77
- */
78
- 'columns' => '1',
79
- 'form-column-align' => '3',
80
- 'form-vertical-align' => '2',
81
- /**
82
- * Logo section
83
- */
84
- 'hide-logo' => 0,
85
- 'custom-logo-url' => '',
86
- 'custom-logo' => '',
87
- 'logo-width' => '84',
88
- 'logo-height' => '84',
89
- /**
90
- * Background section
91
- */
92
- 'custom-background' => '',
93
- 'custom-background-color' => '#f1f1f1',
94
- /**
95
- * Form section
96
- */
97
- 'form-width' => '320',
98
- 'form-height' => '297',
99
- 'form-background-image' => '',
100
- 'form-background-color' => 'rgba(255, 255, 255, 1)',
101
- 'form-padding' => '26px 24px 46px',
102
- 'form-border' => '',
103
- 'form-field-width' => '',
104
- 'form-field-margin' => '',
105
- 'form-field-background' => '#fbfbfb',
106
- 'form-field-color' => '#333333',
107
- 'form-label-color' => '#72777c',
108
- 'hide-extra-links' => 0,
109
- /**
110
- * Others section ( misc )
111
- */
112
- 'button-background' => '#0085ba',
113
- 'button-background-hover' => '#008ec2',
114
- 'button-border-color' => '#0073aa',
115
- 'button-border-color-hover' => '#006799',
116
- 'button-shadow' => '',
117
- 'button-color' => '#ffffff',
118
- 'link-color' => '#555d66',
119
- 'link-color-hover' => '#00a0d2',
120
- ),
121
- ),
122
- 'template-01' => array(
123
- 'url' => esc_url( $this->parent->assets_url ) . 'img/template-01.jpg',
124
- 'options' => array(
125
- 'columns' => '2',
126
- 'form-column-align' => '1',
127
- 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background.jpg',
128
- ),
129
- ),
130
- 'template-02' => array(
131
- 'url' => esc_url( $this->parent->assets_url ) . 'img/template-02.jpg',
132
- 'options' => array(
133
- 'hide-logo' => '1',
134
- 'hide-extra-links' => '1',
135
- 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background-1.jpg',
136
- 'form-background-color' => 'rgba(255, 255, 255, 0)',
137
- 'form-shadow' => 'none',
138
- ),
139
- ),
140
- ),
141
- ),
142
- ),
143
- );
144
-
145
- $settings['logo'] = array(
146
- 'title' => esc_html__( 'Logo options', 'colorlib-login-customizer' ),
147
- 'description' => '',
148
- 'fields' => array(
149
- array(
150
- 'id' => 'hide-logo',
151
- 'label' => esc_html__( 'Hide Logo', 'colorlib-login-customizer' ),
152
- 'description' => esc_html__( 'Show/Hide the logo from login page', 'colorlib-login-customizer' ),
153
- 'type' => 'clc-toggle',
154
- 'default' => 0,
155
- ),
156
- array(
157
- 'id' => 'custom-logo-url',
158
- 'label' => esc_html__( 'Custom logo URL', 'colorlib-login-customizer' ),
159
- 'description' => esc_html__( 'This is where the logo will link to.', 'colorlib-login-customizer' ),
160
- 'type' => 'text',
161
- 'default' => esc_url( get_home_url() ),
162
- ),
163
- array(
164
- 'id' => 'custom-logo',
165
- 'label' => esc_html__( 'Custom logo', 'colorlib-login-customizer' ),
166
- 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
167
- 'type' => 'image',
168
- 'default' => '',
169
- ),
170
- array(
171
- 'id' => 'logo-width',
172
- 'label' => esc_html__( 'Logo Width', 'colorlib-login-customizer' ),
173
- 'description' => esc_html__( 'Make sure you set the logo width to match your image.', 'colorlib-login-customizer' ),
174
- 'default' => 84,
175
- 'choices' => array(
176
- 'min' => 50,
177
- 'max' => 1000,
178
- 'step' => 5,
179
- ),
180
- 'type' => 'clc-range-slider',
181
- ),
182
- array(
183
- 'id' => 'logo-height',
184
- 'label' => esc_html__( 'Logo Height', 'colorlib-login-customizer' ),
185
- 'description' => esc_html__( 'Make sure you set the logo height to match your image.', 'colorlib-login-customizer' ),
186
- 'default' => 84,
187
- 'choices' => array(
188
- 'min' => 50,
189
- 'max' => 1000,
190
- 'step' => 5,
191
- ),
192
- 'type' => 'clc-range-slider',
193
- ),
194
- ),
195
- );
196
-
197
- $settings['layout'] = array(
198
- 'title' => esc_html__( 'Layout options', 'colorlib-login-customizer' ),
199
- 'description' => '',
200
- 'fields' => array(
201
- array(
202
- 'id' => 'columns',
203
- 'label' => esc_html__( 'Columns', 'colorlib-login-customizer' ),
204
- 'description' => '',
205
- 'default' => 1,
206
- 'choices' => array(
207
- 1 => array(
208
- 'value' => 1,
209
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/one-column.png',
210
- ),
211
- 2 => array(
212
- 'value' => 2,
213
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/two-column.png',
214
- ),
215
- ),
216
- 'type' => 'clc-button-group',
217
- ),
218
- array(
219
- 'id' => 'form-column-align',
220
- 'label' => esc_html__( 'Form Column Alignment', 'colorlib-login-customizer' ),
221
- 'description' => '',
222
- 'default' => 3,
223
- 'choices' => array(
224
- 'left' => array(
225
- 'value' => 1,
226
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-left.jpg',
227
- ),
228
- 'top' => array(
229
- 'value' => 2,
230
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-top.jpg',
231
- ),
232
- 'right' => array(
233
- 'value' => 3,
234
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-right.jpg',
235
- ),
236
- 'bottom' => array(
237
- 'value' => 4,
238
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-bottom.jpg',
239
- ),
240
- ),
241
- 'type' => 'clc-button-group',
242
- 'active_callback' => array( $this, 'check_two_column_layout' ),
243
- ),
244
- array(
245
- 'id' => 'form-vertical-align',
246
- 'label' => esc_html__( 'Form Vertical Alignment', 'colorlib-login-customizer' ),
247
- 'description' => '',
248
- 'default' => 2,
249
- 'choices' => array(
250
- 'top' => array(
251
- 'value' => 1,
252
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-top.png',
253
- ),
254
- 'middle' => array(
255
- 'value' => 2,
256
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
257
- ),
258
- 'bottom' => array(
259
- 'value' => 3,
260
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-bottom.png',
261
- ),
262
- ),
263
- 'type' => 'clc-button-group',
264
- ),
265
- array(
266
- 'id' => 'form-horizontal-align',
267
- 'label' => esc_html__( 'Form Horizontal Alignment', 'colorlib-login-customizer' ),
268
- 'description' => '',
269
- 'default' => 2,
270
- 'choices' => array(
271
- 'left' => array(
272
- 'value' => 1,
273
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-left.png',
274
- ),
275
- 'middle' => array(
276
- 'value' => 2,
277
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
278
- ),
279
- 'right' => array(
280
- 'value' => 3,
281
- 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-right.png',
282
- ),
283
- ),
284
- 'type' => 'clc-button-group',
285
- ),
286
- ),
287
- );
288
-
289
- $settings['background'] = array(
290
- 'title' => esc_html__( 'Background options', 'colorlib-login-customizer' ),
291
- 'description' => '',
292
- 'fields' => array(
293
- array(
294
- 'id' => 'custom-background-color',
295
- 'label' => esc_html__( 'Custom background color', 'colorlib-login-customizer' ),
296
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
297
- 'type' => 'color',
298
- 'default' => '#f1f1f1',
299
- ),
300
- array(
301
- 'id' => 'custom-background',
302
- 'label' => esc_html__( 'Custom background', 'colorlib-login-customizer' ),
303
- 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
304
- 'type' => 'image',
305
- 'default' => '',
306
- ),
307
- array(
308
- 'id' => 'custom-background-color-form',
309
- 'label' => esc_html__( 'Form Column background color', 'colorlib-login-customizer' ),
310
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
311
- 'type' => 'color',
312
- 'default' => '#f1f1f1',
313
- 'active_callback' => array( $this, 'check_two_column_layout' ),
314
- ),
315
- array(
316
- 'id' => 'custom-background-form',
317
- 'label' => esc_html__( 'Form Column background', 'colorlib-login-customizer' ),
318
- 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
319
- 'type' => 'image',
320
- 'default' => '',
321
- 'active_callback' => array( $this, 'check_two_column_layout' ),
322
- ),
323
- ),
324
- );
325
-
326
- $settings['form'] = array(
327
- 'title' => esc_html__( 'Form options', 'colorlib-login-customizer' ),
328
- 'description' => '',
329
- 'fields' => array(
330
- array(
331
- 'id' => 'form-width',
332
- 'label' => esc_html__( 'Form Width', 'colorlib-login-customizer' ),
333
- 'description' => esc_html__( 'Please input the desired width for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
334
- 'default' => 320,
335
- 'type' => 'clc-range-slider',
336
- 'choices' => array(
337
- 'min' => 150,
338
- 'max' => 1000,
339
- 'step' => 5,
340
- ),
341
- ),
342
- array(
343
- 'id' => 'form-height',
344
- 'label' => esc_html__( 'Form Height', 'colorlib-login-customizer' ),
345
- 'description' => esc_html__( 'Please input the desired height for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
346
- 'default' => 194,
347
- 'choices' => array(
348
- 'min' => 150,
349
- 'max' => 1000,
350
- 'step' => 5,
351
- ),
352
- 'type' => 'clc-range-slider',
353
- ),
354
- array(
355
- 'id' => 'form-background-image',
356
- 'label' => esc_html__( 'Form background image', 'colorlib-login-customizer' ),
357
- 'description' => esc_html__( 'This will change the background image property of login form.', 'colorlib-login-customizer' ),
358
- 'type' => 'image',
359
- 'default' => '',
360
- ),
361
- array(
362
- 'id' => 'form-background-color',
363
- 'label' => esc_html__( 'Form background color', 'colorlib-login-customizer' ),
364
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
365
- 'type' => 'color',
366
- 'default' => '#ffffff',
367
- ),
368
- array(
369
- 'id' => 'form-padding',
370
- 'label' => esc_html__( 'Form padding', 'colorlib-login-customizer' ),
371
- 'description' => esc_html__( 'This will change the padding property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
372
- 'type' => 'text',
373
- 'default' => '26px 24px 46px',
374
- ),
375
- array(
376
- 'id' => 'form-border',
377
- 'label' => esc_html__( 'Form border', 'colorlib-login-customizer' ),
378
- 'description' => esc_html__( 'This will change the border property. Example: 2px dotted black', 'colorlib-login-customizer' ),
379
- 'type' => 'text',
380
- 'default' => '0 none',
381
- ),
382
- array(
383
- 'id' => 'form-shadow',
384
- 'label' => esc_html__( 'Form shadow', 'colorlib-login-customizer' ),
385
- 'description' => esc_html__( 'This will change the form\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
386
- 'type' => 'text',
387
- 'default' => '0 1px 3px rgba(0,0,0,.13)',
388
- ),
389
- array(
390
- 'id' => 'form-field-width',
391
- 'label' => esc_html__( 'Form field width', 'colorlib-login-customizer' ),
392
- 'description' => esc_html__( 'Please input the desired width for the form field in pixels. Example: 20', 'colorlib-login-customizer' ),
393
- 'type' => 'text',
394
- 'default' => '100%',
395
- ),
396
- array(
397
- 'id' => 'form-field-margin',
398
- 'label' => esc_html__( 'Form field margin', 'colorlib-login-customizer' ),
399
- 'description' => esc_html__( 'This will change the margin property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
400
- 'type' => 'text',
401
- 'default' => '2px 6px 16px 0px',
402
- ),
403
- array(
404
- 'id' => 'form-field-background',
405
- 'label' => esc_html__( 'Form field background', 'colorlib-login-customizer' ),
406
- 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
407
- 'type' => 'color',
408
- 'default' => '#fbfbfb',
409
- ),
410
- array(
411
- 'id' => 'form-field-color',
412
- 'label' => esc_html__( 'Form field color', 'colorlib-login-customizer' ),
413
- 'description' => esc_html__( 'This will change the text color property.', 'colorlib-login-customizer' ),
414
- 'type' => 'color',
415
- 'default' => '#333333',
416
- ),
417
- array(
418
- 'id' => 'form-label-color',
419
- 'label' => esc_html__( 'Form label color', 'colorlib-login-customizer' ),
420
- 'description' => esc_html__( 'This will change the label text color property.', 'colorlib-login-customizer' ),
421
- 'type' => 'color',
422
- 'default' => '#72777c',
423
- ),
424
- array(
425
- 'id' => 'hide-extra-links',
426
- 'label' => esc_html__( 'Hide Extra Links', 'colorlib-login-customizer' ),
427
- 'description' => esc_html__( 'Show/Hide the links under the login form', 'colorlib-login-customizer' ),
428
- 'type' => 'clc-toggle',
429
- 'default' => 0,
430
- ),
431
- ),
432
- );
433
-
434
- $settings['general'] = array(
435
- 'title' => esc_html__( 'Miscellaneous', 'colorlib-login-customizer' ),
436
- 'description' => '',
437
- 'fields' => array(
438
- array(
439
- 'id' => 'button-background',
440
- 'label' => esc_html__( 'Button background', 'colorlib-login-customizer' ),
441
- 'description' => esc_html__( 'This will change the submit button\'s background property', 'colorlib-login-customizer' ),
442
- 'type' => 'color',
443
- 'default' => '#0085ba',
444
- ),
445
- array(
446
- 'id' => 'button-background-hover',
447
- 'label' => esc_html__( 'Button background hover state', 'colorlib-login-customizer' ),
448
- 'description' => esc_html__( 'This will change the submit button\'s background property on hover', 'colorlib-login-customizer' ),
449
- 'type' => 'color',
450
- 'default' => '#008ec2',
451
- ),
452
- array(
453
- 'id' => 'button-border-color',
454
- 'label' => esc_html__( 'Button border color', 'colorlib-login-customizer' ),
455
- 'description' => esc_html__( 'This will change the submit button\'s border color property', 'colorlib-login-customizer' ),
456
- 'type' => 'color',
457
- 'default' => '#0073aa',
458
- ),
459
- array(
460
- 'id' => 'button-border-color-hover',
461
- 'label' => esc_html__( 'Button border hover state', 'colorlib-login-customizer' ),
462
- 'description' => esc_html__( 'This will change the submit button\'s border property on hover', 'colorlib-login-customizer' ),
463
- 'type' => 'color',
464
- 'default' => '#006799',
465
- ),
466
- array(
467
- 'id' => 'button-shadow',
468
- 'label' => esc_html__( 'Button shadow', 'colorlib-login-customizer' ),
469
- 'description' => esc_html__( 'This will change the submit button\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
470
- 'type' => 'text',
471
- 'default' => '0 1px 0 #006799',
472
- ),
473
- array(
474
- 'id' => 'button-color',
475
- 'label' => esc_html__( 'Button color', 'colorlib-login-customizer' ),
476
- 'description' => esc_html__( 'This will change the submit button\'s text color property', 'colorlib-login-customizer' ),
477
- 'type' => 'color',
478
- 'default' => '#ffffff',
479
- ),
480
- array(
481
- 'id' => 'link-color',
482
- 'label' => esc_html__( 'Link color', 'colorlib-login-customizer' ),
483
- 'description' => esc_html__( 'This will change the text color of links that are underneath the login form', 'colorlib-login-customizer' ),
484
- 'type' => 'color',
485
- 'default' => '#555d66',
486
- ),
487
- array(
488
- 'id' => 'link-color-hover',
489
- 'label' => esc_html__( 'Link color hover', 'colorlib-login-customizer' ),
490
- 'description' => esc_html__( 'This will change the text color of links, that are underneath the login form, on hover', 'colorlib-login-customizer' ),
491
- 'type' => 'color',
492
- 'default' => '#00a0d2',
493
- ),
494
- ),
495
- );
496
-
497
- $settings = apply_filters( $this->parent->_token . '_settings_fields', $settings );
498
-
499
- return $settings;
500
- }
501
-
502
- /**
503
- * Register settings in the customizer
504
- */
505
- public function register_settings( $manager ) {
506
- $manager->add_panel(
507
- 'clc_main_panel',
508
- array(
509
- 'capability' => 'edit_theme_options',
510
- 'theme_supports' => '',
511
- 'title' => esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ),
512
- )
513
- );
514
-
515
- foreach ( $this->settings as $section => $properties ) {
516
- $manager->add_section(
517
- 'clc_' . $section,
518
- array(
519
- 'title' => $properties['title'],
520
- 'description' => $properties['description'],
521
- 'panel' => 'clc_main_panel',
522
- )
523
- );
524
-
525
- foreach ( $properties['fields'] as $setting ) {
526
- $key_name = $this->generate_name( $setting['id'] );
527
- $settings_args = array(
528
- 'type' => 'option',
529
- 'transport' => 'postMessage',
530
- );
531
-
532
- if ( isset( $setting['default'] ) ) {
533
- $settings_args['default'] = $setting['default'];
534
- }
535
-
536
- $manager->add_setting( $key_name, $settings_args );
537
-
538
- $control_args = array(
539
- 'label' => $setting['label'],
540
- 'description' => $setting['description'],
541
- 'section' => 'clc_' . $section,
542
- );
543
-
544
- if ( isset( $setting['active_callback'] ) ) {
545
- $control_args['active_callback'] = $setting['active_callback'];
546
- }
547
-
548
- if ( isset( $setting['choices'] ) ) {
549
- $control_args['choices'] = $setting['choices'];
550
- }
551
-
552
- switch ( $setting['type'] ) {
553
- case 'image':
554
- $manager->add_control(
555
- new WP_Customize_Image_Control( $manager, $key_name, $control_args )
556
- );
557
- break;
558
- case 'color':
559
- $manager->add_control(
560
- new Colorlib_Login_Customizer_Control_Color_Picker( $manager, $key_name, $control_args )
561
- );
562
- break;
563
- case 'clc-range-slider':
564
- $manager->add_control(
565
- new Colorlib_Login_Customizer_Range_Slider_Control( $manager, $key_name, $control_args )
566
- );
567
- break;
568
- case 'clc-templates':
569
- $manager->add_control(
570
- new Colorlib_Login_Customizer_Template_Control( $manager, $key_name, $control_args )
571
- );
572
- break;
573
- case 'clc-button-group':
574
- $manager->add_control(
575
- new Colorlib_Login_Customizer_Button_Group_Control( $manager, $key_name, $control_args )
576
- );
577
- break;
578
- case 'clc-toggle' :
579
- $manager->add_control(
580
- new Colorlib_Login_Customizer_Control_Toggle( $manager, $key_name, $control_args )
581
- );
582
- break;
583
- default:
584
- $manager->add_control( $key_name, $control_args );
585
- break;
586
- }
587
- }
588
- }
589
-
590
- }
591
-
592
- /**
593
- * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
594
- */
595
- public function customize_preview_styles() {
596
- wp_enqueue_style( 'colorlib-login-customizer-previewer', esc_url( $this->parent->assets_url ) . 'css/clc-customizer-previewer.css' );
597
- wp_enqueue_script( 'colorlib-login-customizer-preview', esc_url( $this->parent->assets_url ) . 'js/clc-preview.js', array( 'customize-preview' ), false, true );
598
- }
599
-
600
- /*
601
- * Our Customizer script
602
- *
603
- * Dependencies: Customizer Controls script (core)
604
- */
605
- public function customizer_enqueue_scripts() {
606
- wp_enqueue_style( 'colorlib-login-customizer-minicolors-styles', esc_url( $this->parent->assets_url ) . 'css/jquery.minicolors.css' );
607
- wp_enqueue_style( 'colorlib-login-customizer-styles', esc_url( $this->parent->assets_url ) . 'css/clc-customizer.css' );
608
- wp_enqueue_script(
609
- 'colorlib-login-customizer-minicolors-script', esc_url( $this->parent->assets_url ) . 'js/jquery.minicolors.js', array(
610
- 'jquery',
611
- ), false, true
612
- );
613
- wp_enqueue_script(
614
- 'colorlib-login-customizer-script', esc_url( $this->parent->assets_url ) . 'js/clc-customizer.js', array(
615
- 'jquery',
616
- 'customize-controls',
617
- 'colorlib-login-customizer-minicolors-script',
618
- ), false, true
619
- );
620
-
621
- wp_localize_script(
622
- 'colorlib-login-customizer-script', 'CLCUrls', array(
623
- 'siteurl' => get_option( 'siteurl' ),
624
- )
625
- );
626
- }
627
-
628
- // Active callbacks
629
- public function check_two_column_layout( $control ) {
630
- $options = get_option( 'clc-options', array() );
631
-
632
- if ( '2' == $control->manager->get_setting( 'clc-options[columns]' )->value() ) {
633
- return true;
634
- }
635
-
636
- return false;
637
- }
638
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ };
6
+
7
+ /**
8
+ * Class Colorlib_Login_Customizer_Customizer
9
+ */
10
+ class Colorlib_Login_Customizer_Customizer {
11
+ /**
12
+ * @var
13
+ */
14
+ public $settings;
15
+ /**
16
+ * The main plugin object.
17
+ *
18
+ * @var object
19
+ * @access public
20
+ * @since 1.0.0
21
+ */
22
+ public $parent = null;
23
+
24
+ /**
25
+ * Colorlib_Login_Customizer_Customizer constructor.
26
+ *
27
+ * @param $parent
28
+ * @param $manager
29
+ */
30
+ public function __construct( $parent, $manager ) {
31
+ //Plugin object
32
+ $this->parent = $parent;
33
+ // Initialise settings
34
+ $this->init_settings();
35
+ // Register plugin sections and settings
36
+ $this->register_settings( $manager );
37
+ // Load customizer assets
38
+ add_action( 'customize_controls_enqueue_scripts', array( $this, 'customizer_enqueue_scripts' ), 25 );
39
+ add_action( 'customize_preview_init', array( $this, 'customize_preview_styles' ), 25 );
40
+ }
41
+
42
+ /**
43
+ * Initialise settings
44
+ *
45
+ * @return void
46
+ */
47
+ public function init_settings() {
48
+ $this->settings = $this->settings_fields();
49
+ }
50
+
51
+ private function generate_name( $id ) {
52
+ return $this->parent->key_name . '[' . $id . ']';
53
+ }
54
+
55
+ /**
56
+ * Build settings fields
57
+ *
58
+ * @return array Fields to be displayed on settings page
59
+ */
60
+ private function settings_fields() {
61
+ $settings['templates'] = array(
62
+ 'title' => esc_html__( 'Templates', 'colorlib-login-customizer' ),
63
+ 'description' => '',
64
+ 'fields' => array(
65
+ array(
66
+ 'id' => 'templates',
67
+ 'label' => esc_html__( 'Temapltes', 'colorlib-login-customizer' ),
68
+ 'description' => '',
69
+ 'type' => 'clc-templates',
70
+ 'default' => 'default',
71
+ 'choices' => array(
72
+ 'default' => array(
73
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/default.jpg',
74
+ 'options' => array(
75
+ /**
76
+ * Layout
77
+ */
78
+ 'columns' => '1',
79
+ 'columns-width' => array(
80
+ 'left' => 6,
81
+ 'right' => 6,
82
+ ),
83
+ 'form-column-align' => '3',
84
+ 'form-vertical-align' => '2',
85
+ /**
86
+ * Logo section
87
+ */
88
+ 'hide-logo' => 0,
89
+ 'use-text-logo' => 0,
90
+ 'logo-text' => '',
91
+ 'custom-logo-url' => '',
92
+ 'custom-logo' => '',
93
+ 'logo-text-color' => '#444',
94
+ 'logo-text-size' => '20',
95
+ 'logo-text-color-hover' => '#00a0d2',
96
+ 'logo-width' => '84',
97
+ 'logo-height' => '84',
98
+ /**
99
+ * Background section
100
+ */
101
+ 'custom-background' => '',
102
+ 'custom-background-form' => '',
103
+ 'custom-background-color' => '#f1f1f1',
104
+ 'custom-background-color-form' => '#f1f1f1',
105
+ /**
106
+ * Form section
107
+ */
108
+ 'form-width' => '320',
109
+ 'form-height' => '297',
110
+ 'form-background-image' => '',
111
+ 'form-background-color' => '#ffffff',
112
+ 'form-padding' => '26px 24px',
113
+ 'form-border' => '0 none',
114
+ 'form-shadow' => '0 1px 3px rgba(0,0,0,.13)',
115
+ 'form-border-radius' => 'unset',
116
+ 'form-field-border-radius' => 'unset',
117
+ 'form-field-border' => '1px solid #ddd',
118
+ 'form-field-width' => '',
119
+ 'form-field-margin' => '2px 6px 16px 0',
120
+ 'form-field-background' => '#fbfbfb',
121
+ 'form-field-color' => '#32373c',
122
+ 'form-label-color' => '#72777c',
123
+ 'hide-extra-links' => 0,
124
+ 'username-label' => 'Username or Email Address',
125
+ 'password-label' => 'Password',
126
+ /**
127
+ * Others section ( misc )
128
+ */
129
+ 'button-background' => '#0085ba',
130
+ 'button-background-hover' => '#008ec2',
131
+ 'button-border-color' => '#0073aa',
132
+ 'button-border-color-hover' => '#006799',
133
+ 'button-shadow' => '0 1px 0 #006799',
134
+ 'button-text-shadow' => '0 -1px 1px #006799, 1px 0 1px #006799, 0 1px 1px #006799, -1px 0 1px #006799',
135
+ 'button-color' => '#ffffff',
136
+ 'link-color' => '#555d66',
137
+ 'link-color-hover' => '#00a0d2',
138
+ 'hide-rememberme' => false,
139
+ 'custom-css' => '',
140
+ ),
141
+ ),
142
+ 'template-01' => array(
143
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/template-01.jpg',
144
+ 'options' => array(
145
+ 'columns' => '2',
146
+ 'form-column-align' => '1',
147
+ 'form-background-color' => 'rgba(255, 255, 255, 1)',
148
+ 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background.jpg',
149
+ 'custom-css' => '',
150
+ ),
151
+ ),
152
+ 'template-02' => array(
153
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/template-02.jpg',
154
+ 'options' => array(
155
+ 'hide-logo' => '1',
156
+ 'hide-extra-links' => '1',
157
+ 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/background-1.jpg',
158
+ 'form-background-color' => 'rgba(255, 255, 255, 0)',
159
+ 'form-shadow' => 'none',
160
+ 'custom-css' => '',
161
+ ),
162
+ ),
163
+ 'template-03' => array(
164
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/tpl-03/screen.jpg',
165
+ 'options' => array(
166
+ 'columns' => '2',
167
+ 'columns-width' => array(
168
+ 'left' => 8,
169
+ 'right' => 4,
170
+ ),
171
+ /**
172
+ * Form section
173
+ */
174
+ 'form-width' => '430',
175
+ 'form-height' => '350',
176
+ 'form-column-align' => '3',
177
+ 'hide-logo' => '1',
178
+ 'hide-extra-links' => '1',
179
+ 'custom-background-color' => '#f7f7f7',
180
+ 'custom-background' => esc_url( $this->parent->assets_url ) . 'img/tpl-03/bg.jpg',
181
+ 'form-background-color' => 'rgba(255,255,255,0)',
182
+ 'form-shadow' => 'none',
183
+ 'custom-css' => ".ml-form-container .submit input[type='submit'] {width: 100%; box-sizing: border-box;display: inline-block;text-align: center;border-radius: 30px;padding: 0 20px;height: 38px;line-height: 1;font-weight: bold;vertical-align: middle; }",
184
+ 'form-field-background' => '#f7f7f7',
185
+ 'button-background' => '#6675df',
186
+ 'button-background-hover' => '#333333',
187
+ 'button-border-color' => '#6675df',
188
+ 'button-border-color-hover' => '#333333',
189
+ 'hide-rememberme' => '1',
190
+ /**
191
+ * Logo section
192
+ */
193
+ 'hide-logo' => 0,
194
+ 'use-text-logo' => 1,
195
+ 'logo-text' => 'Login to continue',
196
+ 'custom-logo-url' => '',
197
+ 'custom-logo' => '',
198
+ 'logo-text-color' => '#333',
199
+ 'logo-text-size' => '30',
200
+ 'logo-text-color-hover' => '#00a0d2',
201
+ 'logo-width' => '350',
202
+ 'logo-height' => '0',
203
+ 'username-label' => 'Username',
204
+ 'password-label' => 'Password',
205
+ ),
206
+ ),
207
+ 'template-04' => array(
208
+ 'url' => esc_url( $this->parent->assets_url ) . 'img/tpl-04/screen.jpg',
209
+ 'options' => array(
210
+ 'form-width' => '350',
211
+ 'form-height' => '350',
212
+ 'form-padding' => '50px 30px',
213
+ 'columns' => '1',
214
+ 'hide-logo' => '1',
215
+ 'hide-extra-links' => 0,
216
+ 'custom-background-color' => '#e9faff',
217
+ 'custom-background' => '',
218
+ 'form-background-color' => 'rgba(255,255,255,1)',
219
+ 'form-shadow' => 'none',
220
+ 'form-field-background' => '#FFF',
221
+ 'button-background' => '#4272d7',
222
+ 'button-background-hover' => '#333333',
223
+ 'button-border-color' => '#4272d7',
224
+ 'button-border-color-hover' => '#333333',
225
+ 'hide-rememberme' => 1,
226
+ /**
227
+ * Logo section
228
+ */
229
+ 'hide-logo' => 0,
230
+ 'use-text-logo' => 1,
231
+ 'logo-text' => 'Account Login',
232
+ 'custom-logo-url' => '',
233
+ 'custom-logo' => '',
234
+ 'logo-text-color' => '#333',
235
+ 'logo-text-size' => '20',
236
+ 'logo-text-color-hover' => '#00a0d2',
237
+ 'logo-width' => '350',
238
+ 'logo-height' => '0',
239
+ 'username-label' => '',
240
+ 'password-label' => '',
241
+ 'form-shadow' => '0 3px 20px 0px rgba(0, 0, 0, 0.1)',
242
+ 'custom-css' => '',
243
+ 'form-field-border-radius' => '0',
244
+ 'form-field-margin' => '0',
245
+ 'form-field-border' => '1px solid #eee',
246
+ 'custom-css' => ".ml-form-container .submit input[type='submit'] {width: 100%; box-sizing: border-box;display: inline-block;text-align: center;padding: 0 20px;height: 38px;line-height: 1;font-weight: bold;vertical-align: middle; margin-top: 15px;} .ml-form-container input[type='text'], .ml-form-container input[type='password'] { height: 50px; } .login .ml-form-container #backtoblog,.login .ml-form-container #nav{position:absolute;left:0;right:0;margin-right:auto!important;bottom:50px;max-width:100%;text-align:center}.login .ml-form-container #nav{bottom:40px}.ml-form-container #login>h1{position:absolute;top:50px}",
247
+ ),
248
+ ),
249
+ ),
250
+ ),
251
+ ),
252
+ );
253
+
254
+ $settings['logo'] = array(
255
+ 'title' => esc_html__( 'Logo options', 'colorlib-login-customizer' ),
256
+ 'description' => '',
257
+ 'fields' => array(
258
+ array(
259
+ 'id' => 'hide-logo',
260
+ 'label' => esc_html__( 'Hide Logo', 'colorlib-login-customizer' ),
261
+ 'description' => esc_html__( 'Show/Hide the logo from login page', 'colorlib-login-customizer' ),
262
+ 'type' => 'clc-toggle',
263
+ 'default' => 0,
264
+ ),
265
+ array(
266
+ 'id' => 'use-text-logo',
267
+ 'label' => esc_html__( 'Use Text Logo', 'colorlib-login-customizer' ),
268
+ 'description' => esc_html__( 'Show/Hide the logo text from login page', 'colorlib-login-customizer' ),
269
+ 'type' => 'clc-toggle',
270
+ 'default' => 0,
271
+ ),
272
+ array(
273
+ 'id' => 'logo-text',
274
+ 'label' => esc_html__( 'Logo text', 'colorlib-login-customizer' ),
275
+ 'description' => esc_html__( 'This is will be your logo.', 'colorlib-login-customizer' ),
276
+ 'type' => 'text',
277
+ 'default' => '',
278
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
279
+ ),
280
+ array(
281
+ 'id' => 'logo-text-color',
282
+ 'label' => esc_html__( 'Logo text color', 'colorlib-login-customizer' ),
283
+ 'description' => esc_html__( 'This will change the color text property.', 'colorlib-login-customizer' ),
284
+ 'type' => 'color',
285
+ 'default' => '#444',
286
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
287
+ ),
288
+ array(
289
+ 'id' => 'logo-text-color-hover',
290
+ 'label' => esc_html__( 'Logo text color hover', 'colorlib-login-customizer' ),
291
+ 'description' => esc_html__( 'This will change the color text property on hover.', 'colorlib-login-customizer' ),
292
+ 'type' => 'color',
293
+ 'default' => '#00a0d2',
294
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
295
+ ),
296
+ array(
297
+ 'id' => 'logo-text-size',
298
+ 'label' => esc_html__( 'Logo text size', 'colorlib-login-customizer' ),
299
+ 'description' => esc_html__( 'This will change the text size of logo.', 'colorlib-login-customizer' ),
300
+ 'default' => 20,
301
+ 'choices' => array(
302
+ 'min' => 10,
303
+ 'max' => 120,
304
+ 'step' => 1,
305
+ ),
306
+ 'type' => 'clc-range-slider',
307
+ 'active_callback' => array( $this, 'check_if_text_logo' ),
308
+ ),
309
+ array(
310
+ 'id' => 'custom-logo-url',
311
+ 'label' => esc_html__( 'Custom logo URL', 'colorlib-login-customizer' ),
312
+ 'description' => esc_html__( 'This is where the logo will link to.', 'colorlib-login-customizer' ),
313
+ 'type' => 'text',
314
+ 'default' => esc_url( get_home_url() ),
315
+ ),
316
+ array(
317
+ 'id' => 'custom-logo',
318
+ 'label' => esc_html__( 'Custom logo', 'colorlib-login-customizer' ),
319
+ 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
320
+ 'type' => 'image',
321
+ 'default' => '',
322
+ 'active_callback' => array( $this, 'check_if_not_text_logo' ),
323
+ ),
324
+ array(
325
+ 'id' => 'logo-width',
326
+ 'label' => esc_html__( 'Logo Width', 'colorlib-login-customizer' ),
327
+ 'description' => esc_html__( 'Make sure you set the logo width to match your image.', 'colorlib-login-customizer' ),
328
+ 'default' => 84,
329
+ 'choices' => array(
330
+ 'min' => 0,
331
+ 'max' => 1000,
332
+ 'step' => 5,
333
+ ),
334
+ 'type' => 'clc-range-slider',
335
+ ),
336
+ array(
337
+ 'id' => 'logo-height',
338
+ 'label' => esc_html__( 'Logo Height', 'colorlib-login-customizer' ),
339
+ 'description' => esc_html__( 'Make sure you set the logo height to match your image.', 'colorlib-login-customizer' ),
340
+ 'default' => 20,
341
+ 'choices' => array(
342
+ 'min' => 0,
343
+ 'max' => 1000,
344
+ 'step' => 5,
345
+ ),
346
+ 'type' => 'clc-range-slider',
347
+ ),
348
+ ),
349
+ );
350
+
351
+ $settings['layout'] = array(
352
+ 'title' => esc_html__( 'Layout options', 'colorlib-login-customizer' ),
353
+ 'description' => '',
354
+ 'fields' => array(
355
+ array(
356
+ 'id' => 'columns',
357
+ 'label' => esc_html__( 'Columns', 'colorlib-login-customizer' ),
358
+ 'description' => '',
359
+ 'default' => 1,
360
+ 'choices' => array(
361
+ 1 => array(
362
+ 'value' => 1,
363
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/one-column.png',
364
+ ),
365
+ 2 => array(
366
+ 'value' => 2,
367
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/two-column.png',
368
+ ),
369
+ ),
370
+ 'type' => 'clc-button-group',
371
+ ),
372
+ array(
373
+ 'id' => 'columns-width',
374
+ 'label' => esc_html__( 'Columns Width', 'colorlib-login-customizer' ),
375
+ 'description' => '',
376
+ 'type' => 'clc-column-width',
377
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
378
+ ),
379
+ array(
380
+ 'id' => 'form-column-align',
381
+ 'label' => esc_html__( 'Form Column Alignment', 'colorlib-login-customizer' ),
382
+ 'description' => '',
383
+ 'default' => 3,
384
+ 'choices' => array(
385
+ 'left' => array(
386
+ 'value' => 1,
387
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-left.jpg',
388
+ ),
389
+ 'top' => array(
390
+ 'value' => 2,
391
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-top.jpg',
392
+ ),
393
+ 'right' => array(
394
+ 'value' => 3,
395
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-right.jpg',
396
+ ),
397
+ 'bottom' => array(
398
+ 'value' => 4,
399
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-align-bottom.jpg',
400
+ ),
401
+ ),
402
+ 'type' => 'clc-button-group',
403
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
404
+ ),
405
+ array(
406
+ 'id' => 'form-vertical-align',
407
+ 'label' => esc_html__( 'Form Vertical Alignment', 'colorlib-login-customizer' ),
408
+ 'description' => '',
409
+ 'default' => 2,
410
+ 'choices' => array(
411
+ 'top' => array(
412
+ 'value' => 1,
413
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-top.png',
414
+ ),
415
+ 'middle' => array(
416
+ 'value' => 2,
417
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
418
+ ),
419
+ 'bottom' => array(
420
+ 'value' => 3,
421
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-bottom.png',
422
+ ),
423
+ ),
424
+ 'type' => 'clc-button-group',
425
+ ),
426
+ array(
427
+ 'id' => 'form-horizontal-align',
428
+ 'label' => esc_html__( 'Form Horizontal Alignment', 'colorlib-login-customizer' ),
429
+ 'description' => '',
430
+ 'default' => 2,
431
+ 'choices' => array(
432
+ 'left' => array(
433
+ 'value' => 1,
434
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-left.png',
435
+ ),
436
+ 'middle' => array(
437
+ 'value' => 2,
438
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-vertical-align-middle.png',
439
+ ),
440
+ 'right' => array(
441
+ 'value' => 3,
442
+ 'png' => COLORLIB_LOGIN_CUSTOMIZER_URL . '/assets/img/form-horizontal-align-right.png',
443
+ ),
444
+ ),
445
+ 'type' => 'clc-button-group',
446
+ ),
447
+ ),
448
+ );
449
+
450
+ $settings['background'] = array(
451
+ 'title' => esc_html__( 'Background options', 'colorlib-login-customizer' ),
452
+ 'description' => '',
453
+ 'fields' => array(
454
+ array(
455
+ 'id' => 'custom-background-color',
456
+ 'label' => esc_html__( 'Custom background color', 'colorlib-login-customizer' ),
457
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
458
+ 'type' => 'color',
459
+ 'default' => '#f1f1f1',
460
+ ),
461
+ array(
462
+ 'id' => 'custom-background',
463
+ 'label' => esc_html__( 'Custom background', 'colorlib-login-customizer' ),
464
+ 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
465
+ 'type' => 'image',
466
+ 'default' => '',
467
+ ),
468
+ array(
469
+ 'id' => 'custom-background-color-form',
470
+ 'label' => esc_html__( 'Form Column background color', 'colorlib-login-customizer' ),
471
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
472
+ 'type' => 'color',
473
+ 'default' => '#f1f1f1',
474
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
475
+ ),
476
+ array(
477
+ 'id' => 'custom-background-form',
478
+ 'label' => esc_html__( 'Form Column background', 'colorlib-login-customizer' ),
479
+ 'description' => esc_html__( 'This will upload an image to your media library and store the attachment ID in the option field. Once you have uploaded an imge the thumbnail will display above these buttons.', 'colorlib-login-customizer' ),
480
+ 'type' => 'image',
481
+ 'default' => '',
482
+ 'active_callback' => array( $this, 'check_two_column_layout' ),
483
+ ),
484
+ ),
485
+ );
486
+
487
+ $settings['form'] = array(
488
+ 'title' => esc_html__( 'Form options', 'colorlib-login-customizer' ),
489
+ 'description' => '',
490
+ 'fields' => array(
491
+ array(
492
+ 'id' => 'form-width',
493
+ 'label' => esc_html__( 'Form Width', 'colorlib-login-customizer' ),
494
+ 'description' => esc_html__( 'Please input the desired width for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
495
+ 'default' => 320,
496
+ 'type' => 'clc-range-slider',
497
+ 'choices' => array(
498
+ 'min' => 150,
499
+ 'max' => 1000,
500
+ 'step' => 5,
501
+ ),
502
+ ),
503
+ array(
504
+ 'id' => 'form-height',
505
+ 'label' => esc_html__( 'Form Height', 'colorlib-login-customizer' ),
506
+ 'description' => esc_html__( 'Please input the desired height for the login form in pixels. Example: 20', 'colorlib-login-customizer' ),
507
+ 'default' => 194,
508
+ 'choices' => array(
509
+ 'min' => 150,
510
+ 'max' => 1000,
511
+ 'step' => 5,
512
+ ),
513
+ 'type' => 'clc-range-slider',
514
+ ),
515
+ array(
516
+ 'id' => 'form-background-image',
517
+ 'label' => esc_html__( 'Form background image', 'colorlib-login-customizer' ),
518
+ 'description' => esc_html__( 'This will change the background image property of login form.', 'colorlib-login-customizer' ),
519
+ 'type' => 'image',
520
+ 'default' => '',
521
+ ),
522
+ array(
523
+ 'id' => 'form-background-color',
524
+ 'label' => esc_html__( 'Form background color', 'colorlib-login-customizer' ),
525
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
526
+ 'type' => 'color',
527
+ 'default' => '#ffffff',
528
+ ),
529
+ array(
530
+ 'id' => 'form-padding',
531
+ 'label' => esc_html__( 'Form padding', 'colorlib-login-customizer' ),
532
+ 'description' => esc_html__( 'This will change the padding property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
533
+ 'type' => 'text',
534
+ 'default' => '26px 24px',
535
+ ),
536
+ array(
537
+ 'id' => 'form-border',
538
+ 'label' => esc_html__( 'Form border', 'colorlib-login-customizer' ),
539
+ 'description' => esc_html__( 'This will change the border property. Example: 2px dotted black', 'colorlib-login-customizer' ),
540
+ 'type' => 'text',
541
+ 'default' => '0 none',
542
+ ),
543
+ array(
544
+ 'id' => 'form-border-radius',
545
+ 'label' => esc_html__( 'Form border radius', 'colorlib-login-customizer' ),
546
+ 'description' => esc_html__( 'This will change the border radius property. Example: 2px 2px 2px 2px', 'colorlib-login-customizer' ),
547
+ 'type' => 'text',
548
+ 'default' => '0',
549
+ ),
550
+ array(
551
+ 'id' => 'form-shadow',
552
+ 'label' => esc_html__( 'Form shadow', 'colorlib-login-customizer' ),
553
+ 'description' => esc_html__( 'This will change the form\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
554
+ 'type' => 'text',
555
+ 'default' => '0 1px 3px rgba(0,0,0,.13)',
556
+ ),
557
+ array(
558
+ 'id' => 'form-field-width',
559
+ 'label' => esc_html__( 'Form field width', 'colorlib-login-customizer' ),
560
+ 'description' => esc_html__( 'Please input the desired width for the form field in pixels. Example: 20', 'colorlib-login-customizer' ),
561
+ 'type' => 'text',
562
+ 'default' => '100%',
563
+ ),
564
+ array(
565
+ 'id' => 'form-field-margin',
566
+ 'label' => esc_html__( 'Form field margin', 'colorlib-login-customizer' ),
567
+ 'description' => esc_html__( 'This will change the margin property. Example: 26px 24px 46px 30px', 'colorlib-login-customizer' ),
568
+ 'type' => 'text',
569
+ 'default' => '2px 6px 16px 0',
570
+ ),
571
+ array(
572
+ 'id' => 'form-field-border',
573
+ 'label' => esc_html__( 'Form field border', 'colorlib-login-customizer' ),
574
+ 'description' => esc_html__( 'Please input the desired border for the form field. Example: 2px dotted black', 'colorlib-login-customizer' ),
575
+ 'type' => 'text',
576
+ 'default' => '1px solid #ddd',
577
+ ),
578
+ array(
579
+ 'id' => 'form-field-border-radius',
580
+ 'label' => esc_html__( 'Form field border radius', 'colorlib-login-customizer' ),
581
+ 'description' => esc_html__( 'Please input the desired border radiuse for the form field. Example: 5px 5px 5px 5px', 'colorlib-login-customizer' ),
582
+ 'type' => 'text',
583
+ 'default' => 'unset',
584
+ ),
585
+ array(
586
+ 'id' => 'form-field-background',
587
+ 'label' => esc_html__( 'Form field background', 'colorlib-login-customizer' ),
588
+ 'description' => esc_html__( 'This will change the background color property.', 'colorlib-login-customizer' ),
589
+ 'type' => 'color',
590
+ 'default' => '#fbfbfb',
591
+ ),
592
+ array(
593
+ 'id' => 'form-field-color',
594
+ 'label' => esc_html__( 'Form field color', 'colorlib-login-customizer' ),
595
+ 'description' => esc_html__( 'This will change the text color property.', 'colorlib-login-customizer' ),
596
+ 'type' => 'color',
597
+ 'default' => '#32373c',
598
+ ),
599
+ array(
600
+ 'id' => 'form-label-color',
601
+ 'label' => esc_html__( 'Form label color', 'colorlib-login-customizer' ),
602
+ 'description' => esc_html__( 'This will change the label text color property.', 'colorlib-login-customizer' ),
603
+ 'type' => 'color',
604
+ 'default' => '#72777c',
605
+ ),
606
+ array(
607
+ 'id' => 'username-label',
608
+ 'label' => esc_html__( 'Username label', 'colorlib-login-customizer' ),
609
+ 'description' => esc_html__( 'You can change the default text for username label or just delete it.', 'colorlib-login-customizer' ),
610
+ 'type' => 'text',
611
+ 'default' => 'Username or Email Address',
612
+ ),
613
+ array(
614
+ 'id' => 'password-label',
615
+ 'label' => esc_html__( 'Password label', 'colorlib-login-customizer' ),
616
+ 'description' => esc_html__( 'You can change the default text for password label or just delete it.', 'colorlib-login-customizer' ),
617
+ 'type' => 'text',
618
+ 'default' => 'Password',
619
+ ),
620
+ array(
621
+ 'id' => 'hide-extra-links',
622
+ 'label' => esc_html__( 'Hide Extra Links', 'colorlib-login-customizer' ),
623
+ 'description' => esc_html__( 'Show/Hide the links under the login form', 'colorlib-login-customizer' ),
624
+ 'type' => 'clc-toggle',
625
+ 'default' => 0,
626
+ ),
627
+ ),
628
+ );
629
+
630
+ $settings['general'] = array(
631
+ 'title' => esc_html__( 'Form Button & Links', 'colorlib-login-customizer' ),
632
+ 'description' => '',
633
+ 'fields' => array(
634
+ array(
635
+ 'id' => 'button-background',
636
+ 'label' => esc_html__( 'Button background', 'colorlib-login-customizer' ),
637
+ 'description' => esc_html__( 'This will change the submit button\'s background property', 'colorlib-login-customizer' ),
638
+ 'type' => 'color',
639
+ 'default' => '#0085ba',
640
+ ),
641
+ array(
642
+ 'id' => 'button-background-hover',
643
+ 'label' => esc_html__( 'Button background hover state', 'colorlib-login-customizer' ),
644
+ 'description' => esc_html__( 'This will change the submit button\'s background property on hover', 'colorlib-login-customizer' ),
645
+ 'type' => 'color',
646
+ 'default' => '#008ec2',
647
+ ),
648
+ array(
649
+ 'id' => 'button-border-color',
650
+ 'label' => esc_html__( 'Button border color', 'colorlib-login-customizer' ),
651
+ 'description' => esc_html__( 'This will change the submit button\'s border color property', 'colorlib-login-customizer' ),
652
+ 'type' => 'color',
653
+ 'default' => '#0073aa',
654
+ ),
655
+ array(
656
+ 'id' => 'button-border-color-hover',
657
+ 'label' => esc_html__( 'Button border hover state', 'colorlib-login-customizer' ),
658
+ 'description' => esc_html__( 'This will change the submit button\'s border property on hover', 'colorlib-login-customizer' ),
659
+ 'type' => 'color',
660
+ 'default' => '#006799',
661
+ ),
662
+ array(
663
+ 'id' => 'button-shadow',
664
+ 'label' => esc_html__( 'Button shadow', 'colorlib-login-customizer' ),
665
+ 'description' => esc_html__( 'This will change the submit button\'s shadow property. Example: 0 1px 0 #006799', 'colorlib-login-customizer' ),
666
+ 'type' => 'text',
667
+ 'default' => '0 1px 0 #006799',
668
+ ),
669
+ array(
670
+ 'id' => 'button-text-shadow',
671
+ 'label' => esc_html__( 'Button text shadow', 'colorlib-login-customizer' ),
672
+ 'description' => esc_html__( 'This will change the submit button text\'s shadow property. Example: 0 -1px 1px #006799', 'colorlib-login-customizer' ),
673
+ 'type' => 'text',
674
+ 'default' => '0 -1px 1px #006799',
675
+ ),
676
+ array(
677
+ 'id' => 'button-color',
678
+ 'label' => esc_html__( 'Button color', 'colorlib-login-customizer' ),
679
+ 'description' => esc_html__( 'This will change the submit button\'s text color property', 'colorlib-login-customizer' ),
680
+ 'type' => 'color',
681
+ 'default' => '#ffffff',
682
+ ),
683
+ array(
684
+ 'id' => 'link-color',
685
+ 'label' => esc_html__( 'Link color', 'colorlib-login-customizer' ),
686
+ 'description' => esc_html__( 'This will change the text color of links that are underneath the login form', 'colorlib-login-customizer' ),
687
+ 'type' => 'color',
688
+ 'default' => '#555d66',
689
+ ),
690
+ array(
691
+ 'id' => 'link-color-hover',
692
+ 'label' => esc_html__( 'Link color hover', 'colorlib-login-customizer' ),
693
+ 'description' => esc_html__( 'This will change the text color of links, that are underneath the login form, on hover', 'colorlib-login-customizer' ),
694
+ 'type' => 'color',
695
+ 'default' => '#00a0d2',
696
+ ),
697
+ array(
698
+ 'id' => 'hide-rememberme',
699
+ 'label' => esc_html__( 'Hide "Remember Me"', 'colorlib-login-customizer' ),
700
+ 'description' => esc_html__( 'Show/Hide the "Remember Me" checkbox', 'colorlib-login-customizer' ),
701
+ 'type' => 'clc-toggle',
702
+ 'default' => 0,
703
+ ),
704
+ ),
705
+ );
706
+
707
+ $settings['clc-custom-css'] = array(
708
+ 'title' => esc_html__( 'Custom CSS', 'colorlib-login-customizer' ),
709
+ 'description' => '',
710
+ 'fields' => array(
711
+ array(
712
+ 'id' => 'custom-css',
713
+ 'label' => __( 'CSS code', 'colorlib-login-customizer' ),
714
+ 'description' => '',
715
+ 'code_type' => 'text/css',
716
+ 'type' => 'custom-css',
717
+ 'input_attrs' => array(
718
+ 'aria-describedby' => 'editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',
719
+ ),
720
+ ),
721
+ ),
722
+ );
723
+
724
+ $settings = apply_filters( $this->parent->_token . '_settings_fields', $settings );
725
+
726
+ return $settings;
727
+ }
728
+
729
+ /**
730
+ * Register settings in the customizer
731
+ */
732
+ public function register_settings( $manager ) {
733
+ $manager->add_panel(
734
+ 'clc_main_panel',
735
+ array(
736
+ 'capability' => 'edit_theme_options',
737
+ 'theme_supports' => '',
738
+ 'title' => esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ),
739
+ )
740
+ );
741
+
742
+ foreach ( $this->settings as $section => $properties ) {
743
+ $manager->add_section(
744
+ 'clc_' . $section,
745
+ array(
746
+ 'title' => $properties['title'],
747
+ 'description' => $properties['description'],
748
+ 'panel' => 'clc_main_panel',
749
+ )
750
+ );
751
+
752
+ foreach ( $properties['fields'] as $setting ) {
753
+ $key_name = $this->generate_name( $setting['id'] );
754
+ $settings_args = array(
755
+ 'type' => 'option',
756
+ 'transport' => 'postMessage',
757
+ );
758
+
759
+ if ( isset( $setting['default'] ) ) {
760
+ $settings_args['default'] = $setting['default'];
761
+ }
762
+
763
+ $manager->add_setting( $key_name, $settings_args );
764
+
765
+ $control_args = array(
766
+ 'label' => $setting['label'],
767
+ 'description' => $setting['description'],
768
+ 'section' => 'clc_' . $section,
769
+ );
770
+
771
+ if ( isset( $setting['active_callback'] ) ) {
772
+ $control_args['active_callback'] = $setting['active_callback'];
773
+ }
774
+
775
+ if ( isset( $setting['choices'] ) ) {
776
+ $control_args['choices'] = $setting['choices'];
777
+ }
778
+
779
+ if ( isset( $setting['code_type'] ) ) {
780
+ $control_args['code_type'] = $setting['code_type'];
781
+ }
782
+
783
+ if ( isset( $setting['input_attrs'] ) ) {
784
+ $control_args['input_attrs'] = $setting['input_attrs'];
785
+ }
786
+
787
+ switch ( $setting['type'] ) {
788
+ case 'image':
789
+ $manager->add_control(
790
+ new WP_Customize_Image_Control( $manager, $key_name, $control_args )
791
+ );
792
+ break;
793
+ case 'color':
794
+ $manager->add_control(
795
+ new Colorlib_Login_Customizer_Control_Color_Picker( $manager, $key_name, $control_args )
796
+ );
797
+ break;
798
+ case 'clc-range-slider':
799
+ $manager->add_control(
800
+ new Colorlib_Login_Customizer_Range_Slider_Control( $manager, $key_name, $control_args )
801
+ );
802
+ break;
803
+ case 'clc-templates':
804
+ $manager->add_control(
805
+ new Colorlib_Login_Customizer_Template_Control( $manager, $key_name, $control_args )
806
+ );
807
+ break;
808
+ case 'clc-button-group':
809
+ $manager->add_control(
810
+ new Colorlib_Login_Customizer_Button_Group_Control( $manager, $key_name, $control_args )
811
+ );
812
+ break;
813
+ case 'clc-column-width':
814
+ $manager->add_control(
815
+ new Colorlib_Login_Customizer_Column_Width( $manager, $key_name, $control_args )
816
+ );
817
+ break;
818
+ case 'clc-toggle':
819
+ $manager->add_control(
820
+ new Colorlib_Login_Customizer_Control_Toggle( $manager, $key_name, $control_args )
821
+ );
822
+ break;
823
+ case 'custom-css':
824
+ $manager->add_control(
825
+ new WP_Customize_Code_Editor_Control( $manager, $key_name, $control_args )
826
+ );
827
+ break;
828
+ default:
829
+ $manager->add_control( $key_name, $control_args );
830
+ break;
831
+ }
832
+ }
833
+ }
834
+
835
+ }
836
+
837
+ /**
838
+ * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
839
+ */
840
+ public function customize_preview_styles() {
841
+ wp_enqueue_style( 'colorlib-login-customizer-previewer', esc_url( $this->parent->assets_url ) . 'css/clc-customizer-previewer.css' );
842
+ wp_enqueue_script( 'colorlib-login-customizer-preview', esc_url( $this->parent->assets_url ) . 'js/clc-preview.js', array( 'customize-preview' ), false, true );
843
+ }
844
+
845
+ /*
846
+ * Our Customizer script
847
+ *
848
+ * Dependencies: Customizer Controls script (core)
849
+ */
850
+ public function customizer_enqueue_scripts() {
851
+ wp_enqueue_style( 'colorlib-login-customizer-minicolors-styles', esc_url( $this->parent->assets_url ) . 'css/jquery.minicolors.css' );
852
+ wp_enqueue_style( 'colorlib-login-customizer-styles', esc_url( $this->parent->assets_url ) . 'css/clc-customizer.css' );
853
+ wp_enqueue_script(
854
+ 'colorlib-login-customizer-minicolors-script', esc_url( $this->parent->assets_url ) . 'js/jquery.minicolors.js', array(
855
+ 'jquery',
856
+ ), false, true
857
+ );
858
+ wp_enqueue_script(
859
+ 'colorlib-login-customizer-script', esc_url( $this->parent->assets_url ) . 'js/clc-customizer.js', array(
860
+ 'jquery',
861
+ 'customize-controls',
862
+ 'colorlib-login-customizer-minicolors-script',
863
+ ), false, true
864
+ );
865
+
866
+ wp_localize_script(
867
+ 'colorlib-login-customizer-script', 'CLCUrls', array(
868
+ 'siteurl' => get_option( 'siteurl' ),
869
+ )
870
+ );
871
+ }
872
+
873
+ // Active callbacks
874
+ public function check_two_column_layout( $control ) {
875
+ $options = get_option( 'clc-options', array() );
876
+
877
+ if ( '2' == $control->manager->get_setting( 'clc-options[columns]' )->value() ) {
878
+ return true;
879
+ }
880
+
881
+ return false;
882
+ }
883
+
884
+ public function check_if_text_logo( $control ) {
885
+ $options = get_option( 'clc-options', array() );
886
+
887
+ if ( 1 == $control->manager->get_setting( 'clc-options[use-text-logo]' )->value() ) {
888
+ return true;
889
+ }
890
+
891
+ return false;
892
+ }
893
+
894
+ public function check_if_not_text_logo( $control ) {
895
+ $options = get_option( 'clc-options', array() );
896
+
897
+ if ( 1 == $control->manager->get_setting( 'clc-options[use-text-logo]' )->value() ) {
898
+ return false;
899
+ }
900
+
901
+ return true;
902
+ }
903
+ }
includes/lib/class-colorlib-login-customizer-settings.php CHANGED
@@ -1,142 +1,142 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- };
6
-
7
- class Colorlib_Login_Customizer_Settings {
8
-
9
- /**
10
- * The single instance of Colorlib_Login_Customizer_Settings.
11
- *
12
- * @var object
13
- * @access private
14
- * @since 1.0.0
15
- */
16
- private static $_instance = null;
17
-
18
- /**
19
- * The main plugin object.
20
- *
21
- * @var object
22
- * @access public
23
- * @since 1.0.0
24
- */
25
- public $parent = null;
26
-
27
- /**
28
- * Prefix for plugin settings.
29
- *
30
- * @var string
31
- * @access public
32
- * @since 1.0.0
33
- */
34
- public $base = '';
35
-
36
- /**
37
- * Available settings for plugin.
38
- *
39
- * @var array
40
- * @access public
41
- * @since 1.0.0
42
- */
43
- public $settings = array();
44
-
45
- public function __construct( $parent ) {
46
- $this->parent = $parent;
47
-
48
- // Add settings page to menu
49
- add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
50
-
51
- // Add settings link to plugins page
52
- add_filter(
53
- 'plugin_action_links_' . plugin_basename( $this->parent->file ), array(
54
- $this,
55
- 'add_settings_link',
56
- )
57
- );
58
- }
59
-
60
-
61
- /**
62
- * Add settings page to admin menu
63
- *
64
- * @return void
65
- */
66
- public function add_menu_item() {
67
- $page = add_menu_page(
68
- esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ), esc_html__( 'Login Customizer', 'colorlib-login-customizer' ), 'manage_options', $this->parent->_token . '_settings', array(
69
- $this,
70
- 'settings_page',
71
- ), 'dashicons-share-alt'
72
- );
73
- }
74
-
75
- /**
76
- * Add settings link to plugin list table
77
- *
78
- * @param array $links Existing links
79
- *
80
- * @return array Modified links
81
- */
82
- public function add_settings_link( $links ) {
83
- $settings_link = '<a href="options-general.php?page=' . $this->parent->_token . '_settings">' . __( 'Settings', 'colorlib-login-customizer' ) . '</a>';
84
- array_push( $links, $settings_link );
85
-
86
- return $links;
87
- }
88
-
89
- /**
90
- * Load settings page content
91
- *
92
- * @return void
93
- */
94
- public function settings_page() {
95
-
96
- // Build page HTML
97
- $html = '<div class="wrap" id="' . $this->parent->_token . '_settings">' . "\n";
98
- $html .= '<h2>' . esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ) . '</h2>' . "\n";
99
- $html .= '<p>' . esc_html__( 'Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your changes before you save them! Awesome, right?', 'colorlib-login-customizer' ) . '</p>';
100
- $html .= '<a href="' . get_admin_url() . 'customize.php?url=' . wp_login_url() . '" id="submit" class="button button-primary">' . __( 'Start Customizing!', 'colorlib-login-customizer' ) . '</a>';
101
- $html .= '</div>' . "\n";
102
-
103
- echo $html;
104
- }
105
-
106
- /**
107
- * Main Colorlib_Login_Customizer_Settings Instance
108
- *
109
- * Ensures only one instance of Colorlib_Login_Customizer_Settings is loaded or can be loaded.
110
- *
111
- * @since 1.0.0
112
- * @static
113
- * @see Colorlib_Login_Customizer()
114
- * @return Main Colorlib_Login_Customizer_Settings instance
115
- */
116
- public static function instance( $parent ) {
117
- if ( is_null( self::$_instance ) ) {
118
- self::$_instance = new self( $parent );
119
- }
120
-
121
- return self::$_instance;
122
- } // End instance()
123
-
124
- /**
125
- * Cloning is forbidden.
126
- *
127
- * @since 1.0.0
128
- */
129
- public function __clone() {
130
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->parent->_version );
131
- } // End __clone()
132
-
133
- /**
134
- * Unserializing instances of this class is forbidden.
135
- *
136
- * @since 1.0.0
137
- */
138
- public function __wakeup() {
139
- _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->parent->_version );
140
- } // End __wakeup()
141
-
142
- }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ };
6
+
7
+ class Colorlib_Login_Customizer_Settings {
8
+
9
+ /**
10
+ * The single instance of Colorlib_Login_Customizer_Settings.
11
+ *
12
+ * @var object
13
+ * @access private
14
+ * @since 1.0.0
15
+ */
16
+ private static $_instance = null;
17
+
18
+ /**
19
+ * The main plugin object.
20
+ *
21
+ * @var object
22
+ * @access public
23
+ * @since 1.0.0
24
+ */
25
+ public $parent = null;
26
+
27
+ /**
28
+ * Prefix for plugin settings.
29
+ *
30
+ * @var string
31
+ * @access public
32
+ * @since 1.0.0
33
+ */
34
+ public $base = '';
35
+
36
+ /**
37
+ * Available settings for plugin.
38
+ *
39
+ * @var array
40
+ * @access public
41
+ * @since 1.0.0
42
+ */
43
+ public $settings = array();
44
+
45
+ public function __construct( $parent ) {
46
+ $this->parent = $parent;
47
+
48
+ // Add settings page to menu
49
+ add_action( 'admin_menu', array( $this, 'add_menu_item' ) );
50
+
51
+ // Add settings link to plugins page
52
+ add_filter(
53
+ 'plugin_action_links_' . plugin_basename( $this->parent->file ), array(
54
+ $this,
55
+ 'add_settings_link',
56
+ )
57
+ );
58
+ }
59
+
60
+
61
+ /**
62
+ * Add settings page to admin menu
63
+ *
64
+ * @return void
65
+ */
66
+ public function add_menu_item() {
67
+ $page = add_menu_page(
68
+ esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ), esc_html__( 'Login Customizer', 'colorlib-login-customizer' ), 'manage_options', $this->parent->_token . '_settings', array(
69
+ $this,
70
+ 'settings_page',
71
+ ), 'dashicons-share-alt'
72
+ );
73
+ }
74
+
75
+ /**
76
+ * Add settings link to plugin list table
77
+ *
78
+ * @param array $links Existing links
79
+ *
80
+ * @return array Modified links
81
+ */
82
+ public function add_settings_link( $links ) {
83
+ $settings_link = '<a href="options-general.php?page=' . $this->parent->_token . '_settings">' . __( 'Settings', 'colorlib-login-customizer' ) . '</a>';
84
+ array_push( $links, $settings_link );
85
+
86
+ return $links;
87
+ }
88
+
89
+ /**
90
+ * Load settings page content
91
+ *
92
+ * @return void
93
+ */
94
+ public function settings_page() {
95
+
96
+ // Build page HTML
97
+ $html = '<div class="wrap" id="' . $this->parent->_token . '_settings">' . "\n";
98
+ $html .= '<h2>' . esc_html__( 'Colorlib Login Customizer', 'colorlib-login-customizer' ) . '</h2>' . "\n";
99
+ $html .= '<p>' . esc_html__( 'Login Customizer plugin allows you to easily customize your login page straight from your WordPress Customizer! You can preview your changes before you save them! Awesome, right?', 'colorlib-login-customizer' ) . '</p>';
100
+ $html .= '<a href="' . get_admin_url() . 'customize.php?url=' . wp_login_url() . '" id="submit" class="button button-primary">' . __( 'Start Customizing!', 'colorlib-login-customizer' ) . '</a>';
101
+ $html .= '</div>' . "\n";
102
+
103
+ echo $html;
104
+ }
105
+
106
+ /**
107
+ * Main Colorlib_Login_Customizer_Settings Instance
108
+ *
109
+ * Ensures only one instance of Colorlib_Login_Customizer_Settings is loaded or can be loaded.
110
+ *
111
+ * @since 1.0.0
112
+ * @static
113
+ * @see Colorlib_Login_Customizer()
114
+ * @return Main Colorlib_Login_Customizer_Settings instance
115
+ */
116
+ public static function instance( $parent ) {
117
+ if ( is_null( self::$_instance ) ) {
118
+ self::$_instance = new self( $parent );
119
+ }
120
+
121
+ return self::$_instance;
122
+ } // End instance()
123
+
124
+ /**
125
+ * Cloning is forbidden.
126
+ *
127
+ * @since 1.0.0
128
+ */
129
+ public function __clone() {
130
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->parent->_version );
131
+ } // End __clone()
132
+
133
+ /**
134
+ * Unserializing instances of this class is forbidden.
135
+ *
136
+ * @since 1.0.0
137
+ */
138
+ public function __wakeup() {
139
+ _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'colorlib-login-customizer' ), $this->parent->_version );
140
+ } // End __wakeup()
141
+
142
+ }
includes/lib/controls/class-colorlib-login-customizer-background-control.php CHANGED
@@ -1,52 +1,52 @@
1
- <?php
2
-
3
- class Colorlib_Login_Customizer_Background_Control extends WP_Customize_Image_Control {
4
-
5
- /**
6
- * The type of customize control being rendered.
7
- *
8
- * @since 1.1.0
9
- * @access public
10
- * @var string
11
- */
12
- public $type = 'clc-background';
13
-
14
- public $default_backgrounds;
15
-
16
- /**
17
- * Colorlib_Login_Customizer_Background_Control constructor.
18
- *
19
- * @param WP_Customize_Manager $manager
20
- * @param string $id
21
- * @param array $args
22
- */
23
- public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
24
- parent::__construct( $manager, $id, $args );
25
- $manager->register_control_type( 'Colorlib_Login_Customizer_Background_Control' );
26
- }
27
-
28
- /**
29
- * Add custom parameters to pass to the JS via JSON.
30
- *
31
- * @since 1.1.0
32
- * @access public
33
- */
34
- public function json() {
35
- $json = parent::json();
36
-
37
- $json['id'] = $this->id;
38
- $json['link'] = $this->get_link();
39
- $json['gallery'] = $this->generate_gallery();
40
-
41
- return $json;
42
- }
43
-
44
- private function generate_gallery() {
45
-
46
- if ( ! is_array( $this->default_backgrounds ) ) {
47
- return array();
48
- }
49
-
50
- }
51
-
52
  }
1
+ <?php
2
+
3
+ class Colorlib_Login_Customizer_Background_Control extends WP_Customize_Image_Control {
4
+
5
+ /**
6
+ * The type of customize control being rendered.
7
+ *
8
+ * @since 1.1.0
9
+ * @access public
10
+ * @var string
11
+ */
12
+ public $type = 'clc-background';
13
+
14
+ public $default_backgrounds;
15
+
16
+ /**
17
+ * Colorlib_Login_Customizer_Background_Control constructor.
18
+ *
19
+ * @param WP_Customize_Manager $manager
20
+ * @param string $id
21
+ * @param array $args
22
+ */
23
+ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
24
+ parent::__construct( $manager, $id, $args );
25
+ $manager->register_control_type( 'Colorlib_Login_Customizer_Background_Control' );
26
+ }
27
+
28
+ /**
29
+ * Add custom parameters to pass to the JS via JSON.
30
+ *
31
+ * @since 1.1.0
32
+ * @access public
33
+ */
34
+ public function json() {
35
+ $json = parent::json();
36
+
37
+ $json['id'] = $this->id;
38
+ $json['link'] = $this->get_link();
39
+ $json['gallery'] = $this->generate_gallery();
40
+
41
+ return $json;
42
+ }
43
+
44
+ private function generate_gallery() {
45
+
46
+ if ( ! is_array( $this->default_backgrounds ) ) {
47
+ return array();
48
+ }
49
+
50
+ }
51
+
52
  }
includes/lib/controls/class-colorlib-login-customizer-column-width.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) {
3
+ die;
4
+ }
5
+
6
+ /**
7
+ * Class Colorlib_Login_Customizer_Column_Width
8
+ */
9
+ class Colorlib_Login_Customizer_Column_Width extends WP_Customize_Control {
10
+ /**
11
+ * The type of customize control being rendered.
12
+ *
13
+ * @since 1.1.0
14
+ * @access public
15
+ * @var string
16
+ */
17
+ public $type = 'clc-column-width';
18
+
19
+ /**
20
+ * Colorlib_Login_Customizer_Column_Width constructor.
21
+ *
22
+ * @since 1.1.0
23
+ *
24
+ * @param WP_Customize_Manager $manager
25
+ * @param string $id
26
+ * @param array $args
27
+ */
28
+ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
29
+ parent::__construct( $manager, $id, $args );
30
+ $manager->register_control_type( 'Colorlib_Login_Customizer_Column_Width' );
31
+ }
32
+
33
+ /**
34
+ * Add custom parameters to pass to the JS via JSON.
35
+ *
36
+ * @since 1.1.0
37
+ * @access public
38
+ */
39
+ public function json() {
40
+ $json = parent::json();
41
+ $json['id'] = $this->id;
42
+ $json['link'] = $this->get_link();
43
+ $json['value'] = $this->get_columns();
44
+
45
+ return $json;
46
+ }
47
+
48
+ /**
49
+ * Set value
50
+ */
51
+ public function get_columns() {
52
+ $default = array(
53
+ 'left' => 6,
54
+ 'right' => 6
55
+ );
56
+ $current_columns = $this->value();
57
+ $current_columns = is_array( $current_columns ) ? $current_columns : array();
58
+
59
+ return wp_parse_args( $current_columns, $default );
60
+ }
61
+
62
+ /**
63
+ * Display the control's content
64
+ */
65
+ public function content_template() {
66
+ //@formatter:off ?>
67
+ <div class="colorlib-login-customizer-control-container">
68
+ <label>
69
+ <span class="customize-control-title">
70
+ {{{ data.label }}}
71
+ <# if( data.description ){ #>
72
+ <i class="dashicons dashicons-editor-help" style="vertical-align: text-bottom; position: relative;">
73
+ <span class="mte-tooltip">
74
+ {{{ data.description }}}
75
+ </span>
76
+ </i>
77
+ <# } #>
78
+ </span>
79
+ </label>
80
+ <div class="clc-layouts-container-advanced">
81
+ <div class="clc-layouts-setup">
82
+ <div class="clc-column clc-column-left col{{data.value.left}}">
83
+ <a href="#" data-action="left"><span class="dashicons dashicons-arrow-right"></span></a>
84
+ </div>
85
+ <div class="clc-column clc-column-right col{{data.value.right}}">
86
+ <a href="#" data-action="right"><span class="dashicons dashicons-arrow-left"></span></a>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ <?php //@formatter: on
92
+ }
93
+ }
includes/lib/controls/class-colorlib-login-customizer-control-color-picker.php CHANGED
@@ -67,7 +67,7 @@ class Colorlib_Login_Customizer_Control_Color_Picker extends WP_Customize_Contro
67
  public function content_template() {
68
  //@formatter:off ?>
69
  <label <# if( data.lite ) { #>class="lite"<# } #>>
70
- <input class="clc-color-picker" type="text" <# if( data.default ){ #>placeholder="{{ data.default }}"<# } #> <# if(data.value){ #> value="{{ data.value }}" <# } #> {{{ data.link }}} />
71
  <span class="customize-control-title clc-color-picker-title">
72
  {{{ data.label }}}
73
  <# if( data.default ){ #>
67
  public function content_template() {
68
  //@formatter:off ?>
69
  <label <# if( data.lite ) { #>class="lite"<# } #>>
70
+ <input class="clc-color-picker" type="text" <# if( data.default ){ #>placeholder="{{ data.default }}"<# } #> <# if(data.value){ #> value="{{ data.value }}" <# } #> />
71
  <span class="customize-control-title clc-color-picker-title">
72
  {{{ data.label }}}
73
  <# if( data.default ){ #>
includes/lib/controls/class-colorlib-login-customizer-range-slider-control.php CHANGED
@@ -1,112 +1,112 @@
1
- <?php
2
- if ( ! defined( 'WPINC' ) ) {
3
- die;
4
- }
5
-
6
- /**
7
- * Slider control
8
- *
9
- * @since 1.0.0
10
- * @access public
11
- *
12
- */
13
- class Colorlib_Login_Customizer_Range_Slider_Control extends WP_Customize_Control {
14
- /**
15
- * The type of customize control being rendered.
16
- *
17
- * @since 1.0.0
18
- * @access public
19
- * @var string
20
- */
21
- public $type = 'clc-range-slider';
22
-
23
- /**
24
- * Provide a default
25
- *
26
- * @var string
27
- */
28
- public $default = '';
29
-
30
- /**
31
- * Epsilon_Control_Slider constructor.
32
- *
33
- * @param WP_Customize_Manager $manager
34
- * @param string $id
35
- * @param array $args
36
- */
37
- public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
38
- $manager->register_section_type( 'Colorlib_Login_Customizer_Range_Slider_Control' );
39
- parent::__construct( $manager, $id, $args );
40
- if ( isset( $args['default'] ) ) {
41
- $this->default = $args['default'];
42
- }
43
- }
44
-
45
- /**
46
- * Enqueue scripts/styles.
47
- *
48
- * @since 1.0.0
49
- * @access public
50
- * @return void
51
- */
52
- public function enqueue() {
53
- wp_enqueue_script( 'jquery-ui' );
54
- wp_enqueue_script( 'jquery-ui-slider' );
55
- }
56
-
57
- public function get_value() {
58
- $value = $this->value();
59
- if ( ! $value && isset( $this->default ) ) {
60
- return $this->default;
61
- }
62
-
63
- return $value;
64
- }
65
-
66
- public function to_json() {
67
-
68
- $default_choices = array(
69
- 'min' => 1,
70
- 'max' => 10,
71
- 'step' => 1,
72
- );
73
-
74
- $this->choices = wp_parse_args( $this->choices, $default_choices );
75
-
76
- parent::to_json();
77
- $this->json['value'] = $this->get_value();
78
- $this->json['id'] = $this->id;
79
- $this->json['link'] = $this->get_link();
80
- $this->json['choices'] = $this->choices;
81
- }
82
-
83
- /**
84
- * Displays the control content.
85
- *
86
- * @since 1.0.0
87
- * @access public
88
- * @return void
89
- */
90
- public function render_content() {
91
- }
92
-
93
- public function content_template() {
94
- ?>
95
- <label>
96
- <span class="customize-control-title">
97
- <# if ( data.label != '' ){ #>
98
- {{ data.label }}
99
- <# } #>
100
- <# if ( data.description != '' ){ #>
101
- <i class="dashicons dashicons-editor-help" style="vertical-align: text-bottom; position: relative;">
102
- <span class="clc-tooltip">{{ data.description }}</span>
103
- </i>
104
- <# } #>
105
- </span>
106
- <input type="text" class="clc-slider" id="input_{{ data.id }}" value="{{ data.value }}" {{ data.link }}/>
107
- </label>
108
- <div id="slider_{{ data.id }}" class="clc-slider"></div>
109
- <?php
110
- }
111
- }
112
-
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) {
3
+ die;
4
+ }
5
+
6
+ /**
7
+ * Slider control
8
+ *
9
+ * @since 1.0.0
10
+ * @access public
11
+ *
12
+ */
13
+ class Colorlib_Login_Customizer_Range_Slider_Control extends WP_Customize_Control {
14
+ /**
15
+ * The type of customize control being rendered.
16
+ *
17
+ * @since 1.0.0
18
+ * @access public
19
+ * @var string
20
+ */
21
+ public $type = 'clc-range-slider';
22
+
23
+ /**
24
+ * Provide a default
25
+ *
26
+ * @var string
27
+ */
28
+ public $default = '';
29
+
30
+ /**
31
+ * Epsilon_Control_Slider constructor.
32
+ *
33
+ * @param WP_Customize_Manager $manager
34
+ * @param string $id
35
+ * @param array $args
36
+ */
37
+ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
38
+ $manager->register_section_type( 'Colorlib_Login_Customizer_Range_Slider_Control' );
39
+ parent::__construct( $manager, $id, $args );
40
+ if ( isset( $args['default'] ) ) {
41
+ $this->default = $args['default'];
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Enqueue scripts/styles.
47
+ *
48
+ * @since 1.0.0
49
+ * @access public
50
+ * @return void
51
+ */
52
+ public function enqueue() {
53
+ wp_enqueue_script( 'jquery-ui' );
54
+ wp_enqueue_script( 'jquery-ui-slider' );
55
+ }
56
+
57
+ public function get_value() {
58
+ $value = $this->value();
59
+ if ( ! $value && isset( $this->default ) ) {
60
+ return $this->default;
61
+ }
62
+
63
+ return $value;
64
+ }
65
+
66
+ public function to_json() {
67
+
68
+ $default_choices = array(
69
+ 'min' => 1,
70
+ 'max' => 10,
71
+ 'step' => 1,
72
+ );
73
+
74
+ $this->choices = wp_parse_args( $this->choices, $default_choices );
75
+
76
+ parent::to_json();
77
+ $this->json['value'] = $this->get_value();
78
+ $this->json['id'] = $this->id;
79
+ $this->json['link'] = $this->get_link();
80
+ $this->json['choices'] = $this->choices;
81
+ }
82
+
83
+ /**
84
+ * Displays the control content.
85
+ *
86
+ * @since 1.0.0
87
+ * @access public
88
+ * @return void
89
+ */
90
+ public function render_content() {
91
+ }
92
+
93
+ public function content_template() {
94
+ ?>
95
+ <label>
96
+ <span class="customize-control-title">
97
+ <# if ( data.label != '' ){ #>
98
+ {{ data.label }}
99
+ <# } #>
100
+ <# if ( data.description != '' ){ #>
101
+ <i class="dashicons dashicons-editor-help" style="vertical-align: text-bottom; position: relative;">
102
+ <span class="clc-tooltip">{{ data.description }}</span>
103
+ </i>
104
+ <# } #>
105
+ </span>
106
+ <input type="text" class="clc-slider" id="input_{{ data.id }}" value="{{ data.value }}"/>
107
+ </label>
108
+ <div id="slider_{{ data.id }}" class="clc-slider"></div>
109
+ <?php
110
+ }
111
+ }
112
+
includes/lib/controls/class-colorlib-login-customizer-template-control.php CHANGED
@@ -1,137 +1,137 @@
1
- <?php
2
-
3
- // Exit if accessed directly.
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
- // Exit if WP_Customize_Control does not exsist.
9
- if ( ! class_exists( 'WP_Customize_Control' ) ) {
10
- return null;
11
- }
12
-
13
- /**
14
- * This class is for the gallery selector in the Customizer.
15
- *
16
- * @access public
17
- */
18
- class Colorlib_Login_Customizer_Template_Control extends WP_Customize_Control {
19
-
20
- /**
21
- * The control type.
22
- *
23
- * @access public
24
- * @var string
25
- */
26
- public $type = 'clc-templates';
27
-
28
- /**
29
- * Colorlib_Login_Customizer_Template_Control constructor.
30
- *
31
- * @param WP_Customize_Manager $manager
32
- * @param string $id
33
- * @param array $args
34
- */
35
- public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
36
- $manager->register_section_type( 'Colorlib_Login_Customizer_Template_Control' );
37
- parent::__construct( $manager, $id, $args );
38
- }
39
-
40
- /**
41
- * Add custom parameters to pass to the JS via JSON.
42
- *
43
- * @access public
44
- * @since 1.1.7
45
- * @return void
46
- */
47
- public function to_json() {
48
- parent::to_json();
49
-
50
- $arrays = $this->generate_arrays();
51
-
52
- // The setting value.
53
- $this->json['id'] = $this->id;
54
- $this->json['value'] = $this->value();
55
- $this->json['link'] = $this->get_link();
56
- $this->json['choices'] = $arrays['choices'];
57
- $this->json['options'] = $arrays['options'];
58
-
59
- }
60
-
61
- private function generate_name( $id ) {
62
- return 'clc-options[' . $id . ']';
63
- }
64
-
65
- public function generate_arrays() {
66
- $arrays = array(
67
- 'choices' => array(),
68
- 'options' => array(),
69
- );
70
-
71
- foreach ( $this->choices as $key => $choice ) {
72
- $arrays['choices'][ $key ] = $choice['url'];
73
- $arrays['options'][ $key ] = array();
74
- foreach ( $choice['options'] as $option_key => $option_value ) {
75
- $name = $this->generate_name( $option_key );
76
- $arrays['options'][ $key ][ $option_key ] = array(
77
- 'name' => $name,
78
- 'value' => $option_value
79
- );
80
- }
81
- }
82
-
83
- return $arrays;
84
-
85
- }
86
-
87
- /**
88
- * Don't render the content via PHP. This control is handled with a JS template.
89
- *
90
- * @access public
91
- * @since 1.0.0
92
- * @return void
93
- */
94
- public function render_content() {}
95
-
96
- /**
97
- * An Underscore (JS) template for this control's content.
98
- *
99
- * Class variables for this control class are available in the `data` JS object;
100
- * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
101
- *
102
- * @see WP_Customize_Control::print_template()
103
- *
104
- * @access protected
105
- * @since 1.1.7
106
- * @return void
107
- */
108
- protected function content_template() {
109
- ?>
110
-
111
- <# if ( ! data.choices ) {
112
- return;
113
- } #>
114
-
115
- <# if ( data.description ) { #>
116
- <span class="customize-control-description">{{ data.description }}</span>
117
- <# } #>
118
-
119
- <div id="colorlib-login-customizer-templates" class="colorlib-login-customizer-templates">
120
-
121
- <# for ( choice in data.choices ) { #>
122
-
123
- <input type="radio" value="{{ choice }}" name="_customize-{{ data.id }}" id="{{ data.id }}{{ choice }}" class="colorlib-login-customizer-templates__input" {{{ data.link }}} <# if ( data.value === choice ) { #> checked="checked" <# } #> />
124
-
125
- <label for="{{ data.id }}{{ choice }}" class="colorlib-login-customizer-templates__label">
126
- <div class="colorlib-login-customizer-templates__intrinsic">
127
- <div class="colorlib-login-customizer-templates__screenshot" style="background-image: url( {{ data.choices[ choice ] }} );"></div>
128
- </div>
129
- </label>
130
-
131
- <# } #>
132
-
133
- </div>
134
-
135
- <?php
136
- }
137
- }
1
+ <?php
2
+
3
+ // Exit if accessed directly.
4
+ if ( ! defined( 'ABSPATH' ) ) {
5
+ exit;
6
+ }
7
+
8
+ // Exit if WP_Customize_Control does not exsist.
9
+ if ( ! class_exists( 'WP_Customize_Control' ) ) {
10
+ return null;
11
+ }
12
+
13
+ /**
14
+ * This class is for the gallery selector in the Customizer.
15
+ *
16
+ * @access public
17
+ */
18
+ class Colorlib_Login_Customizer_Template_Control extends WP_Customize_Control {
19
+
20
+ /**
21
+ * The control type.
22
+ *
23
+ * @access public
24
+ * @var string
25
+ */
26
+ public $type = 'clc-templates';
27
+
28
+ /**
29
+ * Colorlib_Login_Customizer_Template_Control constructor.
30
+ *
31
+ * @param WP_Customize_Manager $manager
32
+ * @param string $id
33
+ * @param array $args
34
+ */
35
+ public function __construct( WP_Customize_Manager $manager, $id, array $args = array() ) {
36
+ $manager->register_section_type( 'Colorlib_Login_Customizer_Template_Control' );
37
+ parent::__construct( $manager, $id, $args );
38
+ }
39
+
40
+ /**
41
+ * Add custom parameters to pass to the JS via JSON.
42
+ *
43
+ * @access public
44
+ * @since 1.1.7
45
+ * @return void
46
+ */
47
+ public function to_json() {
48
+ parent::to_json();
49
+
50
+ $arrays = $this->generate_arrays();
51
+
52
+ // The setting value.
53
+ $this->json['id'] = $this->id;
54
+ $this->json['value'] = $this->value();
55
+ $this->json['link'] = $this->get_link();
56
+ $this->json['choices'] = $arrays['choices'];
57
+ $this->json['options'] = $arrays['options'];
58
+
59
+ }
60
+
61
+ private function generate_name( $id ) {
62
+ return 'clc-options[' . $id . ']';
63
+ }
64
+
65
+ public function generate_arrays() {
66
+ $arrays = array(
67
+ 'choices' => array(),
68
+ 'options' => array(),
69
+ );
70
+
71
+ foreach ( $this->choices as $key => $choice ) {
72
+ $arrays['choices'][ $key ] = $choice['url'];
73
+ $arrays['options'][ $key ] = array();
74
+ foreach ( $choice['options'] as $option_key => $option_value ) {
75
+ $name = $this->generate_name( $option_key );
76
+ $arrays['options'][ $key ][ $option_key ] = array(
77
+ 'name' => $name,
78
+ 'value' => $option_value
79
+ );
80
+ }
81
+ }
82
+
83
+ return $arrays;
84
+
85
+ }
86
+
87
+ /**
88
+ * Don't render the content via PHP. This control is handled with a JS template.
89
+ *
90
+ * @access public
91
+ * @since 1.0.0
92
+ * @return void
93
+ */
94
+ public function render_content() {}
95
+
96
+ /**
97
+ * An Underscore (JS) template for this control's content.
98
+ *
99
+ * Class variables for this control class are available in the `data` JS object;
100
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
101
+ *
102
+ * @see WP_Customize_Control::print_template()
103
+ *
104
+ * @access protected
105
+ * @since 1.1.7
106
+ * @return void
107
+ */
108
+ protected function content_template() {
109
+ ?>
110
+
111
+ <# if ( ! data.choices ) {
112
+ return;
113
+ } #>
114
+
115
+ <# if ( data.description ) { #>
116
+ <span class="customize-control-description">{{ data.description }}</span>
117
+ <# } #>
118
+
119
+ <div id="colorlib-login-customizer-templates" class="colorlib-login-customizer-templates">
120
+
121
+ <# for ( choice in data.choices ) { #>
122
+
123
+ <input type="radio" value="{{ choice }}" name="_customize-{{ data.id }}" id="{{ data.id }}{{ choice }}" class="colorlib-login-customizer-templates__input" />
124
+
125
+ <label for="{{ data.id }}{{ choice }}" class="colorlib-login-customizer-templates__label">
126
+ <div class="colorlib-login-customizer-templates__intrinsic">
127
+ <div class="colorlib-login-customizer-templates__screenshot" style="background-image: url( {{ data.choices[ choice ] }} );"></div>
128
+ </div>
129
+ </label>
130
+
131
+ <# } #>
132
+
133
+ </div>
134
+
135
+ <?php
136
+ }
137
+ }
includes/login-template.php CHANGED
@@ -1,216 +1,217 @@
1
- <?php
2
- /**
3
- * Template Name: Colorlib Login Customizer Template
4
- *
5
- * Template to display the WordPress login form in the Customizer.
6
- * This is essentially a stripped down version of wp-login.php, though not accessible from outside the Customizer.
7
- *
8
- */
9
-
10
-
11
- /**
12
- * Output the login page header.
13
- *
14
- * @param string $title Optional. WordPress login Page title to display in the `<title>` element.
15
- * Default 'Log In'.
16
- * @param string $message Optional. Message to display in header. Default empty.
17
- * @param WP_Error $wp_error Optional. The error to pass. Default empty.
18
- */
19
- function clc_login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
20
-
21
- global $error, $action;
22
-
23
- if ( empty( $wp_error ) ) {
24
- $wp_error = new WP_Error();
25
- }
26
-
27
- $login_title = get_bloginfo( 'name', 'display' );
28
-
29
- /* translators: Login screen title. 1: Login screen name, 2: Network or site name */
30
- $login_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress', 'colorlib-login-customizer' ), $title, $login_title );
31
- /**
32
- * Filters the title tag content for login page.
33
- *
34
- * @since 4.9.0
35
- *
36
- * @param string $login_title The page title, with extra context added.
37
- * @param string $title The original page title.
38
- */
39
- $login_title = apply_filters( 'login_title', $login_title, $title );
40
- ?><!DOCTYPE html>
41
- <head>
42
- <title><?php echo esc_attr( $login_title ); ?></title>
43
- <?php
44
- wp_enqueue_style( 'login' );
45
-
46
- /**
47
- * Enqueue scripts and styles for the login page.
48
- *
49
- * @since 3.1.0
50
- */
51
- do_action( 'login_enqueue_scripts' );
52
-
53
- /**
54
- * Fires in the login page header after scripts are enqueued.
55
- *
56
- * @since 2.1.0
57
- */
58
- do_action( 'login_head' );
59
- ?>
60
- </head>
61
-
62
- <?php
63
- }
64
-
65
- /**
66
- * Fires when the login form is initialized.
67
- *
68
- * @since 3.2.0
69
- */
70
- do_action( 'login_init' );
71
-
72
- /**
73
- * Fires before a specified login form action.
74
- *
75
- * The dynamic portion of the hook name, `$action`, refers to the action
76
- * that brought the visitor to the login form. Actions include 'postpass',
77
- * 'logout', 'lostpassword', etc.
78
- *
79
- * @since 2.8.0
80
- */
81
- do_action( 'login_form_login' );
82
-
83
- /**
84
- * Filters the separator used between login form navigation links.
85
- */
86
- $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
87
-
88
- /**
89
- * Filters the login page errors.
90
- *
91
- * @since 3.6.0
92
- *
93
- * @param object $errors WP Error object.
94
- * @param string $redirect_to Redirect destination URL.
95
- */
96
- clc_login_header( __( 'Log In', 'colorlib-login-customizer' ), '', '' );
97
-
98
- $login_header_url = __( 'https://wordpress.org/', 'colorlib-login-customizer' );
99
- $login_header_title = __( 'Powered by WordPress', 'colorlib-login-customizer' );
100
-
101
- /**
102
- * Filters link URL of the header logo above login form.
103
- *
104
- * @since 2.1.0
105
- *
106
- * @param string $login_header_url Login header logo URL.
107
- */
108
- $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
109
-
110
- /**
111
- * Filters the title attribute of the header logo above login form.
112
- *
113
- * @since 2.1.0
114
- *
115
- * @param string $login_header_title Login header logo title attribute.
116
- */
117
- $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
118
-
119
- /*
120
- * To match the URL/title set above, Multisite sites have the blog name,
121
- * while single sites get the header title.
122
- */
123
- if ( is_multisite() ) {
124
- $login_header_text = get_bloginfo( 'name', 'display' );
125
- } else {
126
- $login_header_text = $login_header_title;
127
- }
128
-
129
- /**
130
- * Filters the login page body classes.
131
- *
132
- * @since 3.5.0
133
- *
134
- * @param array $classes An array of body classes.
135
- * @param string $action The action that brought the visitor to the login page.
136
- */
137
- $classes = array( 'login-action-login', 'wp-core-ui' );
138
- $classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
139
- $classes = apply_filters( 'login_body_class', $classes, 'login' );
140
- ?>
141
-
142
- <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
143
- <div class="clc-general-actions">
144
- <div id="clc-templates" class="clc-preview-event" data-section="clc_templates"><span class="dashicons dashicons-tagcloud"></span></div>
145
- <div id="clc-layout" class="clc-preview-event" data-section="clc_layout"><span class="dashicons dashicons-layout"></span></div>
146
- <div id="clc-background" class="clc-preview-event" data-section="clc_background"><span class="dashicons dashicons-admin-customizer"></span></div>
147
- </div>
148
- <?php
149
- /**
150
- * Fires in the login page header after the body tag is opened.
151
- *
152
- * @since 4.6.0
153
- */
154
- do_action( 'login_header' );
155
- ?>
156
-
157
- <div id="login">
158
-
159
- <h1>
160
- <a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1">
161
- <span id="clc-logo" class="clc-preview-event" data-section="clc_logo"><span class="dashicons dashicons-edit"></span></span>
162
- </a>
163
- </h1>
164
-
165
- <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
166
- <div id="clc-loginform" class="clc-preview-event" data-section="clc_form"><span class="dashicons dashicons-edit"></span></div>
167
- <p>
168
- <label for="user_login"><?php _e( 'Username or Email Address', 'colorlib-login-customizer' ); ?><br />
169
- <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label>
170
- </p>
171
- <p>
172
- <label for="user_pass"><?php _e( 'Password', 'colorlib-login-customizer' ); ?><br />
173
- <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
174
- </p>
175
- <?php
176
- /**
177
- * Fires following the 'Password' field in the login form.
178
- *
179
- * @since 2.1.0
180
- */
181
- do_action( 'login_form' );
182
- ?>
183
- <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php esc_html_e( 'Remember Me', 'colorlib-login-customizer' ); ?></label></p>
184
- <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'colorlib-login-customizer' ); ?>" /></p>
185
- </form>
186
- <p id="nav">
187
- <?php
188
- if ( get_option( 'users_can_register' ) ) :
189
- $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register', 'colorlib-login-customizer' ) );
190
-
191
- /** This filter is documented in wp-includes/general-template.php */
192
- echo apply_filters( 'register', $registration_url );
193
-
194
- echo esc_html( $login_link_separator );
195
- endif;
196
- ?>
197
- <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'colorlib-login-customizer' ); ?></a>
198
- </p>
199
- <p id="backtoblog">
200
- <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
201
- <?php
202
- /* translators: %s: site title */
203
- printf( _x( '&larr; Back to %s', 'site', 'colorlib-login-customizer' ), esc_html( get_bloginfo( 'title', 'display' ) ) );
204
- ?>
205
- </a>
206
- </p>
207
- </div>
208
-
209
- <?php do_action( 'login_footer' ); ?>
210
- <div class="clear"></div>
211
- <?php
212
- wp_footer();
213
- ?>
214
- </body>
215
-
216
- </html>
 
1
+ <?php
2
+ /**
3
+ * Template Name: Colorlib Login Customizer Template
4
+ *
5
+ * Template to display the WordPress login form in the Customizer.
6
+ * This is essentially a stripped down version of wp-login.php, though not accessible from outside the Customizer.
7
+ *
8
+ */
9
+
10
+
11
+ /**
12
+ * Output the login page header.
13
+ *
14
+ * @param string $title Optional. WordPress login Page title to display in the `<title>` element.
15
+ * Default 'Log In'.
16
+ * @param string $message Optional. Message to display in header. Default empty.
17
+ * @param WP_Error $wp_error Optional. The error to pass. Default empty.
18
+ */
19
+ function clc_login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
20
+
21
+ global $error, $action;
22
+
23
+ if ( empty( $wp_error ) ) {
24
+ $wp_error = new WP_Error();
25
+ }
26
+
27
+ $login_title = get_bloginfo( 'name', 'display' );
28
+
29
+ /* translators: Login screen title. 1: Login screen name, 2: Network or site name */
30
+ $login_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress', 'colorlib-login-customizer' ), $title, $login_title );
31
+ /**
32
+ * Filters the title tag content for login page.
33
+ *
34
+ * @since 4.9.0
35
+ *
36
+ * @param string $login_title The page title, with extra context added.
37
+ * @param string $title The original page title.
38
+ */
39
+ $login_title = apply_filters( 'login_title', $login_title, $title );
40
+ ?><!DOCTYPE html>
41
+ <head>
42
+ <title><?php echo esc_attr( $login_title ); ?></title>
43
+ <?php
44
+ wp_enqueue_style( 'login' );
45
+
46
+ /**
47
+ * Enqueue scripts and styles for the login page.
48
+ *
49
+ * @since 3.1.0
50
+ */
51
+ do_action( 'login_enqueue_scripts' );
52
+
53
+ /**
54
+ * Fires in the login page header after scripts are enqueued.
55
+ *
56
+ * @since 2.1.0
57
+ */
58
+ do_action( 'login_head' );
59
+ ?>
60
+ </head>
61
+
62
+ <?php
63
+ }
64
+
65
+ /**
66
+ * Fires when the login form is initialized.
67
+ *
68
+ * @since 3.2.0
69
+ */
70
+ do_action( 'login_init' );
71
+
72
+ /**
73
+ * Fires before a specified login form action.
74
+ *
75
+ * The dynamic portion of the hook name, `$action`, refers to the action
76
+ * that brought the visitor to the login form. Actions include 'postpass',
77
+ * 'logout', 'lostpassword', etc.
78
+ *
79
+ * @since 2.8.0
80
+ */
81
+ do_action( 'login_form_login' );
82
+
83
+ /**
84
+ * Filters the separator used between login form navigation links.
85
+ */
86
+ $login_link_separator = apply_filters( 'login_link_separator', ' | ' );
87
+
88
+ /**
89
+ * Filters the login page errors.
90
+ *
91
+ * @since 3.6.0
92
+ *
93
+ * @param object $errors WP Error object.
94
+ * @param string $redirect_to Redirect destination URL.
95
+ */
96
+ clc_login_header( __( 'Log In', 'colorlib-login-customizer' ), '', '' );
97
+
98
+ $login_header_url = __( 'https://wordpress.org/', 'colorlib-login-customizer' );
99
+ $login_header_title = __( 'Powered by WordPress', 'colorlib-login-customizer' );
100
+
101
+ /**
102
+ * Filters link URL of the header logo above login form.
103
+ *
104
+ * @since 2.1.0
105
+ *
106
+ * @param string $login_header_url Login header logo URL.
107
+ */
108
+ $login_header_url = apply_filters( 'login_headerurl', $login_header_url );
109
+
110
+ /**
111
+ * Filters the title attribute of the header logo above login form.
112
+ *
113
+ * @since 2.1.0
114
+ *
115
+ * @param string $login_header_title Login header logo title attribute.
116
+ */
117
+ $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
118
+
119
+ /*
120
+ * To match the URL/title set above, Multisite sites have the blog name,
121
+ * while single sites get the header title.
122
+ */
123
+ if ( is_multisite() ) {
124
+ $login_header_text = get_bloginfo( 'name', 'display' );
125
+ } else {
126
+ $login_header_text = $login_header_title;
127
+ }
128
+
129
+ /**
130
+ * Filters the login page body classes.
131
+ *
132
+ * @since 3.5.0
133
+ *
134
+ * @param array $classes An array of body classes.
135
+ * @param string $action The action that brought the visitor to the login page.
136
+ */
137
+ $classes = array( 'login-action-login', 'wp-core-ui' );
138
+ $classes[] = ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
139
+ $classes = apply_filters( 'login_body_class', $classes, 'login' );
140
+ ?>
141
+
142
+ <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
143
+ <div class="clc-general-actions">
144
+ <div id="clc-templates" class="clc-preview-event" data-section="clc_templates"><span class="dashicons dashicons-tagcloud"></span></div>
145
+ <div id="clc-layout" class="clc-preview-event" data-section="clc_layout"><span class="dashicons dashicons-layout"></span></div>
146
+ <div id="clc-background" class="clc-preview-event" data-section="clc_background"><span class="dashicons dashicons-admin-customizer"></span></div>
147
+ </div>
148
+ <?php
149
+ /**
150
+ * Fires in the login page header after the body tag is opened.
151
+ *
152
+ * @since 4.6.0
153
+ */
154
+ do_action( 'login_header' );
155
+ ?>
156
+
157
+ <div id="login">
158
+
159
+ <h1>
160
+ <a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>" tabindex="-1">
161
+ <span id="clc-logo" class="clc-preview-event" data-section="clc_logo"><span class="dashicons dashicons-edit"></span></span>
162
+ <span id="logo-text"><?php echo $login_header_text ?></span>
163
+ </a>
164
+ </h1>
165
+
166
+ <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
167
+ <div id="clc-loginform" class="clc-preview-event" data-section="clc_form"><span class="dashicons dashicons-edit"></span></div>
168
+ <p>
169
+ <label for="user_login"><span id="clc-username-label"><?php _e( 'Username or Email Address', 'colorlib-login-customizer' ); ?></span><br />
170
+ <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label>
171
+ </p>
172
+ <p>
173
+ <label for="user_pass"><span id="clc-password-label"><?php _e( 'Password', 'colorlib-login-customizer' ); ?></span><br />
174
+ <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
175
+ </p>
176
+ <?php
177
+ /**
178
+ * Fires following the 'Password' field in the login form.
179
+ *
180
+ * @since 2.1.0
181
+ */
182
+ do_action( 'login_form' );
183
+ ?>
184
+ <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php esc_html_e( 'Remember Me', 'colorlib-login-customizer' ); ?></label></p>
185
+ <p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In', 'colorlib-login-customizer' ); ?>" /></p>
186
+ </form>
187
+ <p id="nav">
188
+ <?php
189
+ if ( get_option( 'users_can_register' ) ) :
190
+ $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register', 'colorlib-login-customizer' ) );
191
+
192
+ /** This filter is documented in wp-includes/general-template.php */
193
+ echo apply_filters( 'register', $registration_url );
194
+
195
+ echo esc_html( $login_link_separator );
196
+ endif;
197
+ ?>
198
+ <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?', 'colorlib-login-customizer' ); ?></a>
199
+ </p>
200
+ <p id="backtoblog">
201
+ <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
202
+ <?php
203
+ /* translators: %s: site title */
204
+ printf( _x( '&larr; Back to %s', 'site', 'colorlib-login-customizer' ), esc_html( get_bloginfo( 'title', 'display' ) ) );
205
+ ?>
206
+ </a>
207
+ </p>
208
+ </div>
209
+
210
+ <?php do_action( 'login_footer' ); ?>
211
+ <div class="clear"></div>
212
+ <?php
213
+ wp_footer();
214
+ ?>
215
+ </body>
216
+
217
+ </html>
readme.txt CHANGED
@@ -1,53 +1,106 @@
1
- === Colorlib Login Customizer ===
2
- Contributors: colorlibplugins, silkalns
3
- Tags: customize login, login, custom login, customize wordpress login, wordpress login, customizer, custom admin, login logo, logo, login customizer, custom wp-login
4
- Requires at least: 4.7
5
- Tested up to: 4.9
6
- Stable tag: 1.1.0
7
- License: GPLv2 or later
8
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
-
10
- Colorlib Login Customizer by Colorlib is a plugin that helps you personalize your login form directly from the Customizer.
11
-
12
- == Description ==
13
-
14
- Colorlib Login Customizer by Colorlib is an awesome and intuitive plugin that helps you personalize your login form directly from the Customizer. The plugin fully supports the Live Customizer feature and you can see all the changes in real time and edit them.
15
-
16
- All this plugin’s tools and options can be found by going to Appearance > Customize > Colorlib Login Customizer. There you have templates you can use, logo options, background options, form customizations, and some more.
17
-
18
- Colorlib Login Customizer is without doubt one of the easiest to use WordPress plugin that allows the customization of the login page and form. It was designed and developed to be powerful and user friendly so it can be enjoyed by both beginner and advanced developers. With Colorlib Login Customizer you can build a custom login page and form in a matter of seconds, unlike some other login customizer plugins. Colorlib Login Customizer marks the end of boring and bland login forms as you will be able to fine tune every aspect of the form to match your style and view.
19
-
20
- Build and personalize your WordPress login form from start to finish. Colorlib Login Customizer has the following features:
21
-
22
- - Logo options: you can add a custom logo and set up its height and weight.
23
- - Background options: from here you can upload a background image or change the background’s color.
24
- - Form options: you can change the form’s width and height, add a background image, change the background color, add padding and borders, and change the form’s field background color, width, and margin.
25
- - Miscellaneous: in here you will find the options to change the button’s background, color, hover state, border, shadow, and the link’s color and hover color.
26
-
27
- = Further Reading =
28
-
29
- This plugin is developed and maintained by Colorlib. Which is well know for their free <a href="https://colorlib.com/wp/themes/" target="_blank"></a>WordPress themes. However, now they are looking to extend their presence in plugin development and believe that Colorlib Login Customizer is a great way to start.
30
-
31
- If you are new to WordPress and want to learn more we have got you covered. Colorlib will teach you how to <a href="https://colorlib.com/">start a blog</a> or <a href="https://colorlib.com/wp/how-to-make-a-website/">create a website</a> and much more. If you are already familiar with WordPress you likely want to learn how to make it faster and more reliable. That's when you want to look into hosting and more specifically <a href="http://colorlib.com/wp/wordpress-hosting">WordPress hosting</a>.
32
-
33
- If you enjoy using Colorlib Login Customizer for WordPress please leave a [positive feedback](https://wordpress.org/support/plugin/colorlib-login-customiezr/reviews/?filter=5). We are committed to make it the best Login Customizer plugin for WordPress.
34
-
35
-
36
- == Installation ==
37
-
38
- 1. Download the plugin (.zip file) on your hard drive.
39
- 2. Unzip the zip file contents.
40
- 3. Upload the `colorlib-login-customizer` folder to the `/wp-content/plugins/` directory.
41
- 4. Activate the plugin through the 'Plugins' menu in WordPress.
42
- 5. A new sub menu item `Colorlib Login Customizer` will appear in your main Settings menu.
43
-
44
- == Changelog ==
45
-
46
- = 1.1 =
47
- * Changed templates functionality
48
- * Added new layout options
49
- * Fixed live preview editing
50
- * Fixed minor bugs
51
-
52
- = 1.0 =
53
- * Initial release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Custom Login Page Customizer by Colorlib ===
2
+ Contributors: colorlibplugins, silkalns
3
+ Tags: customize login, login, custom login, customize wordpress login, wordpress login, customizer, custom admin, login logo, logo, login customizer, custom wp-login
4
+ Requires at least: 4.7
5
+ Tested up to: 4.9
6
+ Stable tag: 1.2.0
7
+ License: GPLv2 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
+
10
+ Colorlib Login Customizer by Colorlib is a plugin that helps you personalize your login form directly from the Customizer.
11
+
12
+ == Description ==
13
+
14
+ Custom Login Page Customizer by Colorlib is an awesome and intuitive login page plugin that helps you personalize your login page and login form directly from the Customizer. Custom Login Page Customizer fully supports the Live Customizer feature and you can see all the changes in real time on your login page and edit them.
15
+
16
+ All this plugin’s tools and options can be found by going to Appearance > Customize > Custom Login Page Customizer. There you have templates you can use on your login page, custom login page logo, custom login page background options, custom login page form customizations, login form custom width, login form padding and borders, and more all leading to you having a brand new and custom login page.
17
+
18
+ Custom Login Page Customizer is without doubt one of the easiest to use WordPress plugins that allows the customization of the login page and login form. It was designed and developed to be powerful and user friendly so it can be enjoyed by both beginner and advanced developers. With Custom Login Page Customizer you can build a custom login page and custom login form in a matter of seconds, unlike some other login customizer plugins. Custom Login Page Customizer marks the end of a boring and bland login page and login form as you will be able to fine tune every aspect of the form to match your style and view and create a unique and custom login page.
19
+
20
+ Build and personalize your WordPress login page and login form from start to finish. Custom Login Page Customizer has the following features:
21
+
22
+ • Custom login page logo options: you can add a custom login page logo and set up its height and weight.
23
+ • Custom login page and login form background options: from here you can upload a background image or change the background’s color.
24
+ • Custom login form options: you can change the login form’s width and height, add a background image, change the background color, add padding and borders, and change the login form’s field background color, width, and margin.
25
+ Miscellaneous: in here you will find the options to change the login form button’s background, color, hover state, border, shadow, and the link’s color and hover color.
26
+
27
+ Custom Login Page Customizer by Colorlib detailed features:
28
+
29
+ - Custom login page templates
30
+ - Hide/show login logo from login page
31
+ - Show/hide the logo text from login page
32
+ - Custom logo on login page
33
+ - Change logo width on login page
34
+ - Change logo height on login page
35
+ - Change number of columns on your login page
36
+ - Customize width of the columns on your login page
37
+ - Change login form column alignment
38
+ - Customize login form vertical alignment
39
+ - Customize login form horizontal alignment
40
+ - Customize background color on the login page
41
+ - Add a custom background image on login page
42
+ - Customize login form column background color
43
+ - Add a custom background image for login form column
44
+ - Customize login form width
45
+ - Customize login form width
46
+ - Add custom background image for login form
47
+ - Customize the background color for login form
48
+ - Customize login form border radius
49
+ - Customize login form fields’ width
50
+ - Customize login form fields’ margin
51
+ - Customize login form fields’ border
52
+ - Customize login form fields’ border radius
53
+ - Customize login form fields’ background color
54
+ - Customize login form fields’ text color
55
+ - Customize login form fields’ label color
56
+ - Customize login form username label
57
+ - Customize login form password label
58
+ - Show/hide the links on login page under the login form
59
+ - Customize login form button background color
60
+ - Customize login form button hover background color
61
+ - Customize login form button border color
62
+ - Customize login form button border color on hover
63
+ - Customize login form button shadow
64
+ - Customize login form button text shadow
65
+ - Customize login form links color
66
+ - Customize login form links color on hover
67
+ - Hide/Show ‘Remember me?’ option on login form
68
+ - Custom CSS option to customize further the login form and login page
69
+
70
+ Build and personalize your WordPress login form from start to finish. Colorlib Login Customizer has the following features:
71
+
72
+ - Logo options: you can add a custom logo and set up its height and weight.
73
+ - Background options: from here you can upload a background image or change the background’s color.
74
+ - Form options: you can change the form’s width and height, add a background image, change the background color, add padding and borders, and change the form’s field background color, width, and margin.
75
+ - Miscellaneous: in here you will find the options to change the button’s background, color, hover state, border, shadow, and the link’s color and hover color.
76
+
77
+ = Further Reading =
78
+
79
+ This plugin is developed and maintained by Colorlib. Which is well know for their free <a href="https://colorlib.com/wp/themes/" target="_blank"></a>WordPress themes. However, now they are looking to extend their presence in plugin development and believe that Colorlib Login Customizer is a great way to start.
80
+
81
+ If you are new to WordPress and want to learn more we have got you covered. Colorlib will teach you how to <a href="https://colorlib.com/">start a blog</a> or <a href="https://colorlib.com/wp/how-to-make-a-website/">create a website</a> and much more. If you are already familiar with WordPress you likely want to learn how to make it faster and more reliable. That's when you want to look into hosting and more specifically <a href="http://colorlib.com/wp/wordpress-hosting">WordPress hosting</a>.
82
+
83
+ If you enjoy using Colorlib Login Customizer for WordPress please leave a [positive feedback](https://wordpress.org/support/plugin/colorlib-login-customiezr/reviews/?filter=5). We are committed to make it the best Login Customizer plugin for WordPress.
84
+
85
+
86
+ == Installation ==
87
+
88
+ 1. Download the plugin (.zip file) on your hard drive.
89
+ 2. Unzip the zip file contents.
90
+ 3. Upload the `colorlib-login-customizer` folder to the `/wp-content/plugins/` directory.
91
+ 4. Activate the plugin through the 'Plugins' menu in WordPress.
92
+ 5. A new sub menu item `Colorlib Login Customizer` will appear in your main Settings menu.
93
+
94
+ == Changelog ==
95
+
96
+ = 1.2.0 =
97
+ * Implemented everything from here: https://github.com/puikinsh/colorlib-login-customizer/milestone/1?closed=1
98
+
99
+ = 1.1 =
100
+ * Changed templates functionality
101
+ * Added new layout options
102
+ * Fixed live preview editing
103
+ * Fixed minor bugs
104
+
105
+ = 1.0 =
106
+ * Initial release
uninstall.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
-
3
- /**
4
- *
5
- * This file runs when the plugin in uninstalled (deleted).
6
- * This will not run when the plugin is deactivated.
7
- * Ideally you will add all your clean-up scripts here
8
- * that will clean-up unused meta, options, etc. in the database.
9
- *
10
- */
11
-
12
- // If plugin is not being uninstalled, exit (do nothing)
13
- if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
- exit;
15
- }
16
-
17
- // Do something here if plugin is being uninstalled.
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ * This file runs when the plugin in uninstalled (deleted).
6
+ * This will not run when the plugin is deactivated.
7
+ * Ideally you will add all your clean-up scripts here
8
+ * that will clean-up unused meta, options, etc. in the database.
9
+ *
10
+ */
11
+
12
+ // If plugin is not being uninstalled, exit (do nothing)
13
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
14
+ exit;
15
+ }
16
+
17
+ // Do something here if plugin is being uninstalled.