Adminimize - Version 1.11.5

Version Description

Download this release

Release Info

Developer Bueltge
Plugin Icon wp plugin Adminimize
Version 1.11.5
Comparing to
See all releases

Code changes from version 1.11.4 to 1.11.5

LICENSE.txt CHANGED
@@ -1,622 +1,281 @@
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
 
@@ -628,15 +287,15 @@ 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,
@@ -644,31 +303,37 @@ the "copyright" line and a pointer to where the full notice is found.
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
- <program> Copyright (C) <year> <name of author>
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 2, June 1991
3
 
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
  Everyone is permitted to copy and distribute verbatim copies
7
  of this license document, but changing it is not allowed.
8
 
9
  Preamble
10
 
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
 
 
19
  your programs, too.
20
 
21
  When we speak of free software, we are referring to freedom, not
22
  price. Our General Public Licenses are designed to make sure that you
23
  have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
 
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
 
33
  For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  The precise terms and conditions for copying, distribution and
57
  modification follow.
58
 
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
195
  this License.
196
 
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
  be similar in spirit to the present version, but may differ in detail to
240
  address new problems or concerns.
241
 
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
 
 
 
 
 
 
 
 
 
 
 
 
 
279
 
280
  END OF TERMS AND CONDITIONS
281
 
287
 
288
  To do so, attach the following notices to the program. It is safest
289
  to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
  <one line to give the program's name and a brief idea of what it does.>
294
  Copyright (C) <year> <name of author>
295
 
296
+ This program is free software; you can redistribute it and/or modify
297
  it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
  (at your option) any later version.
300
 
301
  This program is distributed in the hope that it will be useful,
303
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
  GNU General Public License for more details.
305
 
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
 
310
  Also add information on how to contact you by electronic and paper mail.
311
 
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
 
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
  This is free software, and you are welcome to redistribute it
318
  under certain conditions; type `show c' for details.
319
 
320
  The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
adminimize.php CHANGED
@@ -7,15 +7,15 @@
7
  * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles.
8
  * Author: Frank Bültge
9
  * Author URI: http://bueltge.de/
10
- * Version: 1.11.4
11
- * License: GPLv3+
12
  *
13
  * Php Version 5.6
14
  *
15
  * @package WordPress
16
  * @author Frank Bültge <frank@bueltge.de>
17
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
18
- * @version 2017-12-14
19
  */
20
 
21
  /**
@@ -96,26 +96,26 @@ function _mw_adminimize_exclude_super_admin() {
96
  function _mw_adminimize_exclude_settings_page() {
97
 
98
  if ( ! is_admin() ) {
99
- return FALSE;
100
  }
101
 
102
- if ( defined('DOING_AJAX') && DOING_AJAX ) {
103
- return FALSE;
104
  }
105
 
106
  $page = '';
107
- if ( isset( $_GET[ 'page' ] ) ) {
108
- $page = esc_attr( $_GET[ 'page' ] );
109
  }
110
 
111
  $screen = $page;
112
  if ( function_exists( 'get_current_screen' ) ) {
113
  $screen_tmp = get_current_screen();
114
- }
115
 
116
- if ( isset( $screen_tmp->id ) && null !== $screen_tmp->id ) {
117
- $screen = $screen_tmp->id;
118
  }
 
119
 
120
  // Don't filter on settings page
121
  return FALSE !== strpos( $screen, 'adminimize' );
@@ -226,7 +226,7 @@ function _mw_adminimize_get_current_post_type() {
226
  elseif ( $current_screen && $current_screen->post_type ) {
227
  return $current_screen->post_type;
228
  } // lastly check the post_type querystring
229
- elseif ( isset( $_REQUEST[ 'post_type' ] ) ) {
230
  return sanitize_key( $_REQUEST[ 'post_type' ] );
231
  }
232
 
@@ -370,13 +370,13 @@ function _mw_adminimize_admin_init() {
370
 
371
  // Set default editor tinymce
372
  if ( _mw_adminimize_recursive_in_array(
373
- '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
374
- $disabled_metaboxes_page_all
375
- )
376
- || _mw_adminimize_recursive_in_array(
377
- '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
378
- $disabled_metaboxes_post_all
379
- )
380
  ) {
381
  add_filter( 'wp_default_editor', '_mw_admininimize_return_tinmyce' );
382
  /**
@@ -392,7 +392,7 @@ function _mw_adminimize_admin_init() {
392
 
393
  // Remove media buttons
394
  if ( _mw_adminimize_recursive_in_array( 'media_buttons', $disabled_metaboxes_page_all )
395
- || _mw_adminimize_recursive_in_array( 'media_buttons', $disabled_metaboxes_post_all )
396
  ) {
397
  remove_action( 'media_buttons', 'media_buttons' );
398
  }
@@ -409,7 +409,7 @@ function _mw_adminimize_admin_init() {
409
  }
410
  // set custom post type options
411
  if ( function_exists( 'get_post_types' ) && in_array( $pagenow, $def_custom_pages, TRUE )
412
- && in_array( $current_post_type, $def_custom_types, TRUE )
413
  ) {
414
  add_action( 'admin_head', '_mw_adminimize_set_metabox_cp_option', 1 );
415
  }
@@ -488,7 +488,7 @@ function _mw_adminimize_remove_dashboard() {
488
  foreach ( $user_roles as $role ) {
489
  if ( _mw_adminimize_current_user_has_role( $role ) ) {
490
  if ( _mw_adminimize_recursive_in_array( 'index.php', $disabled_menu_[ $role ] )
491
- || _mw_adminimize_recursive_in_array( 'index.php', $disabled_submenu_[ $role ] )
492
  ) {
493
  $redirect = TRUE;
494
  }
@@ -599,7 +599,7 @@ function _mw_adminimize_set_menu_option() {
599
  // Set admin-menu.
600
  foreach ( $user_roles as $role ) {
601
  if ( in_array( $role, $user->roles, TRUE )
602
- && _mw_adminimize_current_user_has_role( $role )
603
  ) {
604
  // Create array about all items with all affected roles.
605
  foreach ( (array) $disabled_menu_[ $role ] as $menu_item ) {
@@ -735,33 +735,48 @@ function _mw_adminimize_set_metabox_post_option() {
735
 
736
  $user_roles = _mw_adminimize_get_all_user_roles();
737
  $_mw_adminimize_admin_head = '';
738
- $metaboxes = '';
 
739
 
740
  foreach ( $user_roles as $role ) {
741
  $disabled_metaboxes_post_[ $role ] = _mw_adminimize_get_option_value(
742
  'mw_adminimize_disabled_metaboxes_post_' . $role . '_items'
743
  );
744
 
745
- if ( ! isset( $disabled_metaboxes_post_[ $role ][ '0' ] ) ) {
746
- $disabled_metaboxes_post_[ $role ][ '0' ] = '';
 
 
 
 
 
747
  }
748
 
749
- // New since version 1.7.8.
750
- $user = wp_get_current_user();
751
- if ( is_array( $user->roles ) && in_array( $role, $user->roles, TRUE ) ) {
 
 
 
 
 
752
  if ( _mw_adminimize_current_user_has_role( $role ) && isset( $disabled_metaboxes_post_[ $role ] )
753
- && is_array(
754
- $disabled_metaboxes_post_[ $role ]
755
- )
756
  ) {
757
- $metaboxes = implode( ',', $disabled_metaboxes_post_[ $role ] );
 
 
 
758
  }
759
  }
760
  }
761
 
762
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize metabox post options -->' . "\n";
 
763
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
764
- $metaboxes . ' {display:none !important;}</style>' . "\n";
765
 
766
  if ( ! empty( $metaboxes ) ) {
767
  echo $_mw_adminimize_admin_head;
@@ -800,8 +815,8 @@ function _mw_adminimize_set_metabox_page_option() {
800
  $user = wp_get_current_user();
801
  if ( is_array( $user->roles ) && in_array( $role, $user->roles, TRUE ) ) {
802
  if ( _mw_adminimize_current_user_has_role( $role )
803
- && isset( $disabled_metaboxes_page_[ $role ] )
804
- && is_array( $disabled_metaboxes_page_[ $role ] )
805
  ) {
806
  $metaboxes = implode( ',', $disabled_metaboxes_page_[ $role ] );
807
  }
@@ -810,7 +825,7 @@ function _mw_adminimize_set_metabox_page_option() {
810
 
811
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize metabox page options -->' . "\n";
812
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
813
- $metaboxes . ' {display:none !important;}</style>' . "\n";
814
 
815
  if ( ! empty( $metaboxes ) ) {
816
  echo $_mw_adminimize_admin_head;
@@ -855,31 +870,33 @@ function _mw_adminimize_set_metabox_cp_option() {
855
 
856
  $user_roles = _mw_adminimize_get_all_user_roles();
857
  $_mw_adminimize_admin_head = '';
858
- $metaboxes = '';
859
 
860
  foreach ( $user_roles as $role ) {
861
  $disabled_metaboxes_[ $current_post_type . '_' . $role ] = _mw_adminimize_get_option_value(
862
  'mw_adminimize_disabled_metaboxes_' . $current_post_type . '_' . $role . '_items'
863
  );
864
 
865
- if ( ! isset( $disabled_metaboxes_[ $current_post_type . '_' . $role ][ '0' ] ) ) {
866
- $disabled_metaboxes_[ $current_post_type . '_' . $role ][ '0' ] = '';
 
 
867
  }
868
 
869
- $user = wp_get_current_user();
870
- if ( is_array( $user->roles ) && in_array( $role, $user->roles, TRUE ) ) {
871
  if ( _mw_adminimize_current_user_has_role( $role )
872
- && isset( $disabled_metaboxes_[ $current_post_type . '_' . $role ] )
873
- && is_array( $disabled_metaboxes_[ $current_post_type . '_' . $role ] )
874
  ) {
875
- $metaboxes = implode( ',', $disabled_metaboxes_[ $current_post_type . '_' . $role ] );
876
  }
877
  }
878
  }
879
 
880
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize post options -->' . "\n";
881
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
882
- $metaboxes . ' {display:none !important;}</style>' . "\n";
883
 
884
  if ( ! empty( $metaboxes ) ) {
885
  echo $_mw_adminimize_admin_head;
@@ -931,7 +948,7 @@ function _mw_adminimize_set_link_option() {
931
 
932
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize links options -->' . "\n";
933
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
934
- $link_options . ' {display:none !important;}</style>' . "\n";
935
 
936
  if ( ! empty( $link_options ) ) {
937
  echo $_mw_adminimize_admin_head;
@@ -983,7 +1000,7 @@ function _mw_adminimize_set_nav_menu_option() {
983
 
984
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize WP Nav Menu options -->' . "\n";
985
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
986
- $nav_menu_options . ' {display: none !important;}</style>' . "\n";
987
 
988
  if ( $nav_menu_options ) {
989
  echo $_mw_adminimize_admin_head;
@@ -1035,7 +1052,7 @@ function _mw_adminimize_set_widget_option() {
1035
 
1036
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize Widget options -->' . "\n";
1037
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
1038
- $widget_options . ' {display: none !important;}</style>' . "\n";
1039
 
1040
  if ( $widget_options ) {
1041
  echo $_mw_adminimize_admin_head;
@@ -1101,7 +1118,7 @@ require_once 'inc-setup/import.php';
1101
  * @param array $links
1102
  * @param string $file
1103
  *
1104
- * @return string $links
1105
  */
1106
  function _mw_adminimize_filter_plugin_meta( $links, $file ) {
1107
 
@@ -1409,7 +1426,7 @@ function _mw_adminimize_update() {
1409
  // global options
1410
  if ( isset( $_POST[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ] ) ) {
1411
  $adminimizeoptions[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ] =
1412
- $_POST[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ];
1413
  } else {
1414
  $adminimizeoptions[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ] = array();
1415
  }
7
  * Description: Visually compresses the administrative meta-boxes so that more admin page content can be initially seen. The plugin that lets you hide 'unnecessary' items from the WordPress administration menu, for all roles of your install. You can also hide post meta controls on the edit-area to simplify the interface. It is possible to simplify the admin in different for all roles.
8
  * Author: Frank Bültge
9
  * Author URI: http://bueltge.de/
10
+ * Version: 1.11.5
11
+ * License: GPLv2+
12
  *
13
  * Php Version 5.6
14
  *
15
  * @package WordPress
16
  * @author Frank Bültge <frank@bueltge.de>
17
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
18
+ * @version 2019-07-07
19
  */
20
 
21
  /**
96
  function _mw_adminimize_exclude_settings_page() {
97
 
98
  if ( ! is_admin() ) {
99
+ return false;
100
  }
101
 
102
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
103
+ return false;
104
  }
105
 
106
  $page = '';
107
+ if ( isset( $_GET['page'] ) ) {
108
+ $page = esc_attr( $_GET['page'] );
109
  }
110
 
111
  $screen = $page;
112
  if ( function_exists( 'get_current_screen' ) ) {
113
  $screen_tmp = get_current_screen();
 
114
 
115
+ if ( isset( $screen_tmp->id ) && null !== $screen_tmp->id ) {
116
+ $screen = $screen_tmp->id;
117
  }
118
+ }
119
 
120
  // Don't filter on settings page
121
  return FALSE !== strpos( $screen, 'adminimize' );
226
  elseif ( $current_screen && $current_screen->post_type ) {
227
  return $current_screen->post_type;
228
  } // lastly check the post_type querystring
229
+ elseif ( isset( $_REQUEST['post_type'] ) ) {
230
  return sanitize_key( $_REQUEST[ 'post_type' ] );
231
  }
232
 
370
 
371
  // Set default editor tinymce
372
  if ( _mw_adminimize_recursive_in_array(
373
+ '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
374
+ $disabled_metaboxes_page_all
375
+ )
376
+ || _mw_adminimize_recursive_in_array(
377
+ '#editor-toolbar #edButtonHTML, #quicktags, #content-html',
378
+ $disabled_metaboxes_post_all
379
+ )
380
  ) {
381
  add_filter( 'wp_default_editor', '_mw_admininimize_return_tinmyce' );
382
  /**
392
 
393
  // Remove media buttons
394
  if ( _mw_adminimize_recursive_in_array( 'media_buttons', $disabled_metaboxes_page_all )
395
+ || _mw_adminimize_recursive_in_array( 'media_buttons', $disabled_metaboxes_post_all )
396
  ) {
397
  remove_action( 'media_buttons', 'media_buttons' );
398
  }
409
  }
410
  // set custom post type options
411
  if ( function_exists( 'get_post_types' ) && in_array( $pagenow, $def_custom_pages, TRUE )
412
+ && in_array( $current_post_type, $def_custom_types, TRUE )
413
  ) {
414
  add_action( 'admin_head', '_mw_adminimize_set_metabox_cp_option', 1 );
415
  }
488
  foreach ( $user_roles as $role ) {
489
  if ( _mw_adminimize_current_user_has_role( $role ) ) {
490
  if ( _mw_adminimize_recursive_in_array( 'index.php', $disabled_menu_[ $role ] )
491
+ || _mw_adminimize_recursive_in_array( 'index.php', $disabled_submenu_[ $role ] )
492
  ) {
493
  $redirect = TRUE;
494
  }
599
  // Set admin-menu.
600
  foreach ( $user_roles as $role ) {
601
  if ( in_array( $role, $user->roles, TRUE )
602
+ && _mw_adminimize_current_user_has_role( $role )
603
  ) {
604
  // Create array about all items with all affected roles.
605
  foreach ( (array) $disabled_menu_[ $role ] as $menu_item ) {
735
 
736
  $user_roles = _mw_adminimize_get_all_user_roles();
737
  $_mw_adminimize_admin_head = '';
738
+ // It's better to declare $metaboxes as an array for better manipulation later.
739
+ $metaboxes = array();
740
 
741
  foreach ( $user_roles as $role ) {
742
  $disabled_metaboxes_post_[ $role ] = _mw_adminimize_get_option_value(
743
  'mw_adminimize_disabled_metaboxes_post_' . $role . '_items'
744
  );
745
 
746
+ if ( ! isset( $disabled_metaboxes_post_[ $role ]['0'] ) ) {
747
+ $disabled_metaboxes_post_[ $role ]['0'] = '';
748
+
749
+ /**
750
+ * @todo Think why keep going if $role does not even have boxes to hide? We may as well jump to the next $role.
751
+ */
752
+ continue;
753
  }
754
 
755
+ /**
756
+ * @todo Think why call a function as we can use a global variable already declared by WordPress.
757
+ * @var WP_User $user Instance of WP_User.
758
+ * @since 1.7.8
759
+ * @version 1.11.4
760
+ */
761
+ $user = $GLOBALS['current_user'];
762
+ if ( is_array( $user->roles ) && in_array( $role, $user->roles, true ) ) {
763
  if ( _mw_adminimize_current_user_has_role( $role ) && isset( $disabled_metaboxes_post_[ $role ] )
764
+ && is_array(
765
+ $disabled_metaboxes_post_[ $role ]
766
+ )
767
  ) {
768
+ // The previous way $metaboxes was being filled it could be at some point non empty and empty afterwards.
769
+ // For instance, if a $role has items to be hidden and the user has this $role, $metaboxes will be filled.
770
+ // But in next loop $metaboxes may receive '' as the next $role might not have items to hide and the user might has the next $role.
771
+ $metaboxes[] = implode( ',', $disabled_metaboxes_post_[ $role ] );
772
  }
773
  }
774
  }
775
 
776
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize metabox post options -->' . "\n";
777
+ // And below we implode $metaboxes because it's an array now.
778
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
779
+ implode( ',', $metaboxes ) . ' {display:none !important;}</style>' . "\n";
780
 
781
  if ( ! empty( $metaboxes ) ) {
782
  echo $_mw_adminimize_admin_head;
815
  $user = wp_get_current_user();
816
  if ( is_array( $user->roles ) && in_array( $role, $user->roles, TRUE ) ) {
817
  if ( _mw_adminimize_current_user_has_role( $role )
818
+ && isset( $disabled_metaboxes_page_[ $role ] )
819
+ && is_array( $disabled_metaboxes_page_[ $role ] )
820
  ) {
821
  $metaboxes = implode( ',', $disabled_metaboxes_page_[ $role ] );
822
  }
825
 
826
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize metabox page options -->' . "\n";
827
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
828
+ $metaboxes . ' {display:none !important;}</style>' . "\n";
829
 
830
  if ( ! empty( $metaboxes ) ) {
831
  echo $_mw_adminimize_admin_head;
870
 
871
  $user_roles = _mw_adminimize_get_all_user_roles();
872
  $_mw_adminimize_admin_head = '';
873
+ $metaboxes = array();
874
 
875
  foreach ( $user_roles as $role ) {
876
  $disabled_metaboxes_[ $current_post_type . '_' . $role ] = _mw_adminimize_get_option_value(
877
  'mw_adminimize_disabled_metaboxes_' . $current_post_type . '_' . $role . '_items'
878
  );
879
 
880
+ if ( ! isset( $disabled_metaboxes_[ $current_post_type . '_' . $role ]['0'] ) ) {
881
+ $disabled_metaboxes_[ $current_post_type . '_' . $role ]['0'] = '';
882
+
883
+ continue;
884
  }
885
 
886
+ $user = $GLOBALS['current_user'];
887
+ if ( is_array( $user->roles ) && in_array( $role, $user->roles, true ) ) {
888
  if ( _mw_adminimize_current_user_has_role( $role )
889
+ && isset( $disabled_metaboxes_[ $current_post_type . '_' . $role ] )
890
+ && is_array( $disabled_metaboxes_[ $current_post_type . '_' . $role ] )
891
  ) {
892
+ $metaboxes[] = implode( ',', $disabled_metaboxes_[ $current_post_type . '_' . $role ] );
893
  }
894
  }
895
  }
896
 
897
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize post options -->' . "\n";
898
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
899
+ implode( ',', $metaboxes ) . ' {display:none !important;}</style>' . "\n";
900
 
901
  if ( ! empty( $metaboxes ) ) {
902
  echo $_mw_adminimize_admin_head;
948
 
949
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize links options -->' . "\n";
950
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
951
+ $link_options . ' {display:none !important;}</style>' . "\n";
952
 
953
  if ( ! empty( $link_options ) ) {
954
  echo $_mw_adminimize_admin_head;
1000
 
1001
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize WP Nav Menu options -->' . "\n";
1002
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
1003
+ $nav_menu_options . ' {display: none !important;}</style>' . "\n";
1004
 
1005
  if ( $nav_menu_options ) {
1006
  echo $_mw_adminimize_admin_head;
1052
 
1053
  $_mw_adminimize_admin_head .= '<!-- Set Adminimize Widget options -->' . "\n";
1054
  $_mw_adminimize_admin_head .= '<style type="text/css">' .
1055
+ $widget_options . ' {display: none !important;}</style>' . "\n";
1056
 
1057
  if ( $widget_options ) {
1058
  echo $_mw_adminimize_admin_head;
1118
  * @param array $links
1119
  * @param string $file
1120
  *
1121
+ * @return array $links
1122
  */
1123
  function _mw_adminimize_filter_plugin_meta( $links, $file ) {
1124
 
1426
  // global options
1427
  if ( isset( $_POST[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ] ) ) {
1428
  $adminimizeoptions[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ] =
1429
+ $_POST[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ];
1430
  } else {
1431
  $adminimizeoptions[ 'mw_adminimize_disabled_global_option_' . $role . '_items' ] = array();
1432
  }
adminimize_page.php CHANGED
@@ -4,9 +4,10 @@
4
  * @subpackage Settings page
5
  * @author Frank Bültge
6
  */
7
- if ( ! function_exists( 'add_action' ) ) {
8
- echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9
- exit;
 
10
  }
11
  /*
12
  // Export the options to local client.
@@ -17,19 +18,15 @@ if ( array_key_exists( '_mw_adminimize_export', $_GET ) ) {
17
  }*/
18
 
19
  function _mw_adminimize_options() {
20
- global $wpdb, $_wp_admin_css_colors, $wp_version, $wp_roles, $table_prefix;
21
-
22
- $_mw_adminimize_user_info = 0;
23
 
24
- // get array with userroles
25
- // also provide for the other files
26
- $user_roles = _mw_adminimize_get_all_user_roles();
27
- $user_roles_names = _mw_adminimize_get_all_user_roles_names();
28
 
29
  // update options
30
- if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
 
 
31
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_insert' )
32
- && $_POST[ '_mw_adminimize_save' ]
33
  ) {
34
 
35
  if ( function_exists( 'current_user_can' ) && current_user_can( 'manage_options' ) ) {
@@ -38,27 +35,34 @@ function _mw_adminimize_options() {
38
  _mw_adminimize_update();
39
  } else {
40
  $myErrors = new _mw_adminimize_message_class();
41
- $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
42
- '_mw_adminimize_access_denied'
43
- ) . '</p></div>';
 
 
44
  wp_die( $myErrors );
 
 
45
  }
46
  }
47
 
48
  // import options
49
- if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
 
 
50
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_import' )
51
- && $_POST[ '_mw_adminimize_save' ]
52
  ) {
53
 
54
  _mw_adminimize_import_json();
55
  }
56
 
57
  // Uninstall options
58
- if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
59
- && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_uninstall' )
60
- && ! array_key_exists( '_mw_adminimize_uninstall_yes', $_POST )
61
-
 
62
  ) {
63
  $myErrors = new _mw_adminimize_message_class();
64
  $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
@@ -67,11 +71,13 @@ function _mw_adminimize_options() {
67
  wp_die( $myErrors );
68
  }
69
 
70
- if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
71
- && array_key_exists( '_mw_adminimize_uninstall_yes', $_POST )
72
- && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_uninstall' )
73
- && $_POST[ '_mw_adminimize_uninstall' ]
74
- && $_POST[ '_mw_adminimize_uninstall_yes' ] === '_mw_adminimize_uninstall'
 
 
75
  ) {
76
  if ( function_exists( 'current_user_can' ) && current_user_can( 'manage_options' ) ) {
77
  check_admin_referer( 'mw_adminimize_nonce' );
@@ -93,46 +99,59 @@ function _mw_adminimize_options() {
93
  }
94
 
95
  // load theme user data
96
- if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
 
 
97
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' )
98
- && $_POST[ '_mw_adminimize_load' ]
99
  ) {
100
  if ( function_exists( 'current_user_can' ) && current_user_can( 'edit_users' ) ) {
101
  check_admin_referer( 'mw_adminimize_nonce' );
102
 
103
  $myErrors = new _mw_adminimize_message_class();
104
- $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error(
105
- '_mw_adminimize_load_theme'
106
- ) . '</p></div>';
 
 
107
  echo $myErrors;
108
  } else {
109
  $myErrors = new _mw_adminimize_message_class();
110
- $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
111
- '_mw_adminimize_access_denied'
112
- ) . '</p></div>';
 
 
113
  wp_die( $myErrors );
114
  }
115
  }
116
 
117
- if ( ( array_key_exists( '_mw_adminimize_action', $_POST )
 
 
118
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_set_theme' )
119
- && $_POST[ '_mw_adminimize_save' ]
120
  ) {
121
  if ( function_exists( 'current_user_can' ) && current_user_can( 'edit_users' ) ) {
122
  check_admin_referer( 'mw_adminimize_nonce' );
123
 
124
- _mw_adminimize_set_theme();
 
125
 
126
  $myErrors = new _mw_adminimize_message_class();
127
- $myErrors = '<div id="message" class="updated fade"><p>' . $myErrors->get_error(
128
- '_mw_adminimize_set_theme'
129
- ) . '</p></div>';
 
 
130
  echo $myErrors;
131
  } else {
132
  $myErrors = new _mw_adminimize_message_class();
133
- $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
134
- '_mw_adminimize_access_denied'
135
- ) . '</p></div>';
 
 
136
  wp_die( $myErrors );
137
  }
138
  }
@@ -144,9 +163,7 @@ function _mw_adminimize_options() {
144
  // Backend Options for all roles
145
  require_once 'inc-options/minimenu.php';
146
  ?>
147
- <form name="backend_option" method="post" id="_mw_adminimize_options" action="?page=<?php echo esc_attr(
148
- $_GET[ 'page' ]
149
- ); ?>">
150
  <?php
151
  // Adminimize Settings for the plugin.
152
  require_once 'inc-options/self_settings.php';
4
  * @subpackage Settings page
5
  * @author Frank Bültge
6
  */
7
+
8
+ // A rather more popular way to check if the file is being accessed directly.
9
+ if ( ! defined( 'ABSPATH' ) ) {
10
+ die( "Hi there! I'm just a part of plugin, not much I can do when called directly." );
11
  }
12
  /*
13
  // Export the options to local client.
18
  }*/
19
 
20
  function _mw_adminimize_options() {
 
 
 
21
 
22
+ // The removed data is never used.
 
 
 
23
 
24
  // update options
25
+ // Some indenting cleanups
26
+ if (
27
+ ( array_key_exists( '_mw_adminimize_action', $_POST )
28
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_insert' )
29
+ && $_POST[ '_mw_adminimize_save' ]
30
  ) {
31
 
32
  if ( function_exists( 'current_user_can' ) && current_user_can( 'manage_options' ) ) {
35
  _mw_adminimize_update();
36
  } else {
37
  $myErrors = new _mw_adminimize_message_class();
38
+ $myErrors = '<div id="message" class="error"><p>' .
39
+ $myErrors->get_error(
40
+ '_mw_adminimize_access_denied'
41
+ ) .
42
+ '</p></div>';
43
  wp_die( $myErrors );
44
+
45
+ // Some indenting cleanups
46
  }
47
  }
48
 
49
  // import options
50
+ // Some indenting cleanups
51
+ if (
52
+ ( array_key_exists( '_mw_adminimize_action', $_POST )
53
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_import' )
54
+ && $_POST[ '_mw_adminimize_save' ]
55
  ) {
56
 
57
  _mw_adminimize_import_json();
58
  }
59
 
60
  // Uninstall options
61
+ // Some indenting cleanups
62
+ if (
63
+ ( array_key_exists( '_mw_adminimize_action', $_POST )
64
+ && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_uninstall' )
65
+ && ! array_key_exists( '_mw_adminimize_uninstall_yes', $_POST )
66
  ) {
67
  $myErrors = new _mw_adminimize_message_class();
68
  $myErrors = '<div id="message" class="error"><p>' . $myErrors->get_error(
71
  wp_die( $myErrors );
72
  }
73
 
74
+ // Some indenting cleanups
75
+ if (
76
+ ( array_key_exists( '_mw_adminimize_action', $_POST )
77
+ && array_key_exists( '_mw_adminimize_uninstall_yes', $_POST )
78
+ && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_uninstall' )
79
+ && $_POST[ '_mw_adminimize_uninstall' ]
80
+ && $_POST[ '_mw_adminimize_uninstall_yes' ] === '_mw_adminimize_uninstall'
81
  ) {
82
  if ( function_exists( 'current_user_can' ) && current_user_can( 'manage_options' ) ) {
83
  check_admin_referer( 'mw_adminimize_nonce' );
99
  }
100
 
101
  // load theme user data
102
+ // Some indenting cleanups
103
+ if (
104
+ ( array_key_exists( '_mw_adminimize_action', $_POST )
105
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_load_theme' )
106
+ && $_POST[ '_mw_adminimize_load' ]
107
  ) {
108
  if ( function_exists( 'current_user_can' ) && current_user_can( 'edit_users' ) ) {
109
  check_admin_referer( 'mw_adminimize_nonce' );
110
 
111
  $myErrors = new _mw_adminimize_message_class();
112
+ $myErrors = '<div id="message" class="updated fade"><p>' .
113
+ $myErrors->get_error(
114
+ '_mw_adminimize_load_theme'
115
+ ) .
116
+ '</p></div>';
117
  echo $myErrors;
118
  } else {
119
  $myErrors = new _mw_adminimize_message_class();
120
+ $myErrors = '<div id="message" class="error"><p>' .
121
+ $myErrors->get_error(
122
+ '_mw_adminimize_access_denied'
123
+ ) .
124
+ '</p></div>';
125
  wp_die( $myErrors );
126
  }
127
  }
128
 
129
+ // Some indenting cleanups
130
+ if (
131
+ ( array_key_exists( '_mw_adminimize_action', $_POST )
132
  && $_POST[ '_mw_adminimize_action' ] === '_mw_adminimize_set_theme' )
133
+ && $_POST[ '_mw_adminimize_save' ]
134
  ) {
135
  if ( function_exists( 'current_user_can' ) && current_user_can( 'edit_users' ) ) {
136
  check_admin_referer( 'mw_adminimize_nonce' );
137
 
138
+ // _mw_adminimize_set_theme();
139
+ // This function isn't defined anywhere.
140
 
141
  $myErrors = new _mw_adminimize_message_class();
142
+ $myErrors = '<div id="message" class="updated fade"><p>' .
143
+ $myErrors->get_error(
144
+ '_mw_adminimize_set_theme'
145
+ ) .
146
+ '</p></div>';
147
  echo $myErrors;
148
  } else {
149
  $myErrors = new _mw_adminimize_message_class();
150
+ $myErrors = '<div id="message" class="error"><p>' .
151
+ $myErrors->get_error(
152
+ '_mw_adminimize_access_denied'
153
+ ) .
154
+ '</p></div>';
155
  wp_die( $myErrors );
156
  }
157
  }
163
  // Backend Options for all roles
164
  require_once 'inc-options/minimenu.php';
165
  ?>
166
+ <form name="backend_option" method="post" id="_mw_adminimize_options" action="?page=<?php echo esc_attr( $_GET[ 'page' ] ); ?>">
 
 
167
  <?php
168
  // Adminimize Settings for the plugin.
169
  require_once 'inc-options/self_settings.php';
inc-options/admin_bar.php CHANGED
@@ -135,7 +135,7 @@ if ( ! isset( $user_roles_names ) ) {
135
  </p>
136
 
137
  <p>
138
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
139
  style="margin:3px 0 0 30px;"><?php esc_attr_e(
140
  'scroll to top', 'adminimize'
141
  ); ?></a>
135
  </p>
136
 
137
  <p>
138
+ <a class="alignright button adminimize-scroltop" href="#"
139
  style="margin:3px 0 0 30px;"><?php esc_attr_e(
140
  'scroll to top', 'adminimize'
141
  ); ?></a>
inc-options/admin_bar_frontend.php CHANGED
@@ -139,7 +139,7 @@ if ( ! isset( $user_roles_names ) ) {
139
  </p>
140
 
141
  <p>
142
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
143
  style="margin:3px 0 0 30px;"><?php esc_attr_e(
144
  'scroll to top', 'adminimize'
145
  ); ?></a>
139
  </p>
140
 
141
  <p>
142
+ <a class="alignright button adminimize-scroltop" href="#"
143
  style="margin:3px 0 0 30px;"><?php esc_attr_e(
144
  'scroll to top', 'adminimize'
145
  ); ?></a>
inc-options/backend_options.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
  /**
 
 
3
  * @package Adminimize
4
  * @subpackage Backend Options
5
  * @author Frank Bültge
6
  */
 
7
  if ( ! function_exists( 'add_action' ) ) {
8
  echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9
  exit;
@@ -12,86 +15,150 @@ if ( ! function_exists( 'add_action' ) ) {
12
 
13
  <div id="poststuff" class="ui-sortable meta-box-sortables">
14
  <div class="postbox">
15
- <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
16
  <h3 class="hndle" id="backend_options"><?php esc_attr_e( 'Backend Options', 'adminimize' ); ?></h3>
17
  <div class="inside">
18
 
19
 
20
  <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
21
- <br class="clear" />
22
  <table summary="config" class="widefat">
23
  <tbody>
24
  <?php
25
  if ( _mw_adminimize_is_active_on_multisite() && function_exists( 'is_super_admin' )
26
- ) { ?>
 
27
  <tr valign="top">
28
  <td><?php esc_attr_e( 'Exclude Super Admin', 'adminimize' ); ?></td>
29
  <td>
30
- <?php $_mw_adminimize_exclude_super_admin = _mw_adminimize_get_option_value(
 
31
  '_mw_adminimize_exclude_super_admin'
32
- ); ?>
33
- <select name="_mw_adminimize_exclude_super_admin">
34
- <option value="0"<?php if ( $_mw_adminimize_exclude_super_admin === 0 ) {
35
- echo ' selected="selected"';
36
- } ?>><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
37
- <option value="1"<?php if ( $_mw_adminimize_exclude_super_admin === 1 ) {
38
- echo ' selected="selected"';
39
- } ?>><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
40
- </select> <?php esc_attr_e(
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  'Exclude the Super Admin on a WP Multisite Install from all limitations of this plugin.',
42
  'adminimize'
43
- ); ?>
 
44
  </td>
45
  </tr>
46
  <?php } ?>
47
  <tr valign="top">
48
  <td><?php esc_attr_e( 'User-Info', 'adminimize' ); ?></td>
49
  <td>
50
- <?php $_mw_adminimize_user_info = _mw_adminimize_get_option_value(
 
51
  '_mw_adminimize_user_info'
52
- ); ?>
53
- <select name="_mw_adminimize_user_info">
54
- <option value="0"<?php if ( $_mw_adminimize_user_info === 0 ) {
55
- echo ' selected="selected"';
56
- } ?>><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
57
- <option value="1"<?php if ( $_mw_adminimize_user_info === 1 ) {
58
- echo ' selected="selected"';
59
- } ?>><?php esc_attr_e( 'Hide', 'adminimize' ); ?></option>
60
- <option value="2"<?php if ( $_mw_adminimize_user_info === 2 ) {
61
- echo ' selected="selected"';
62
- } ?>><?php esc_attr_e( 'Only logout', 'adminimize' ); ?></option>
63
- <option value="3"<?php if ( $_mw_adminimize_user_info === 3 ) {
64
- echo ' selected="selected"';
65
- } ?>><?php esc_attr_e( 'User &amp; Logout', 'adminimize' ); ?></option>
66
- </select> <?php esc_attr_e(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  'The &quot;User-Info-area&quot; is on the top right side of the backend. You can hide or reduced show.',
68
  'adminimize'
69
- ); ?>
 
70
  </td>
71
  </tr>
72
- <?php if ( ( $_mw_adminimize_user_info === '' ) || ( $_mw_adminimize_user_info === 1 ) || ( $_mw_adminimize_user_info === 0 ) ) {
 
73
  $disabled_item = ' disabled="disabled"';
74
- } ?>
 
75
  <tr valign="top">
76
- <td><label for="_mw_adminimize_ui_redirect"><?php esc_attr_e( 'Change User-Info, redirect to', 'adminimize' ); ?></td>
 
 
77
  <td>
78
- <?php $_mw_adminimize_ui_redirect = (int) _mw_adminimize_get_option_value(
 
79
  '_mw_adminimize_ui_redirect'
80
- ); ?>
 
81
  <select name="_mw_adminimize_ui_redirect" id="_mw_adminimize_ui_redirect"
82
- <?php if ( isset( $disabled_item ) ) { echo $disabled_item; } ?>>
83
- <option value="0"<?php if ( $_mw_adminimize_ui_redirect === 0 ) {
84
- echo ' selected="selected"';} ?>>
 
 
 
 
 
 
 
 
 
 
 
85
  <?php esc_attr_e( 'Default', 'adminimize' ); ?>
86
  </option>
87
- <option value="1"<?php if ( $_mw_adminimize_ui_redirect === 1 ) {
88
- echo ' selected="selected"';} ?>>
 
 
 
 
 
89
  <?php esc_attr_e( 'Frontpage of the Blog', 'adminimize' ); ?>
90
  </option>
91
- </select> <?php esc_attr_e(
 
 
92
  'When the &quot;User-Info-area&quot; change it, then it is possible to change the redirect.',
93
  'adminimize'
94
- ); ?>
 
95
  </td>
96
  </tr>
97
  <tr valign="top">
@@ -99,80 +166,141 @@ if ( ! function_exists( 'add_action' ) ) {
99
  <td>
100
  <?php $_mw_adminimize_footer = (int) _mw_adminimize_get_option_value( '_mw_adminimize_footer' ); ?>
101
  <select name="_mw_adminimize_footer" id="_mw_adminimize_footer">
102
- <option value="0"<?php if ( 0 === $_mw_adminimize_footer ) {
103
- echo ' selected="selected"'; } ?>>
 
 
 
 
 
104
  <?php esc_attr_e( 'Default', 'adminimize' ); ?>
105
  </option>
106
- <option value="1"<?php if ( 1 === $_mw_adminimize_footer ) {
107
- echo ' selected="selected"';} ?>>
 
 
 
 
 
108
  <?php esc_attr_e( 'Hide', 'adminimize' ); ?>
109
  </option>
110
- </select> <?php esc_attr_e(
 
 
111
  'The Footer-area can hide, include all links and details.', 'adminimize'
112
- ); ?>
 
113
  </td>
114
  </tr>
115
  <tr valign="top">
116
  <td><?php esc_attr_e( 'Timestamp', 'adminimize' ); ?></td>
117
  <td>
118
- <?php $_mw_adminimize_timestamp = (int) _mw_adminimize_get_option_value(
 
119
  '_mw_adminimize_timestamp'
120
- ); ?>
121
- <select name="_mw_adminimize_timestamp">
122
- <option value="0"<?php if ( $_mw_adminimize_timestamp === 0 ) {
123
- echo ' selected="selected"';
124
- } ?>><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
125
- <option value="1"<?php if ( $_mw_adminimize_timestamp === 1 ) {
126
- echo ' selected="selected"';
127
- } ?>><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
128
- </select> <?php esc_attr_e(
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  'Opens the post timestamp editing fields without you having to click the "Edit" link every time.',
130
  'adminimize'
131
- ); ?>
 
132
  </td>
133
  </tr>
134
  <tr valign="top">
135
  <td><?php esc_attr_e( 'Category Height', 'adminimize' ); ?></td>
136
  <td>
137
- <?php $_mw_adminimize_cat_full = (int) _mw_adminimize_get_option_value(
 
138
  '_mw_adminimize_cat_full'
139
- ); ?>
140
- <select name="_mw_adminimize_cat_full">
141
- <option value="0"<?php if ( $_mw_adminimize_cat_full === 0 ) {
142
- echo ' selected="selected"';
143
- } ?>><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
144
- <option value="1"<?php if ( $_mw_adminimize_cat_full === 1 ) {
145
- echo ' selected="selected"';
146
- } ?>><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
147
- </select> <?php esc_attr_e(
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  'View the Meta Box with Categories in the full height, no scrollbar or whitespace.',
149
  'adminimize'
150
- ); ?>
 
151
  </td>
152
  </tr>
153
  <tr valign="top">
154
  <td><?php esc_attr_e( 'Advice in Footer', 'adminimize' ); ?></td>
155
  <td>
156
  <?php $_mw_adminimize_advice = (int) _mw_adminimize_get_option_value( '_mw_adminimize_advice' ); ?>
157
- <select name="_mw_adminimize_advice">
158
- <option value="0"<?php if ( $_mw_adminimize_advice === 0 ) {
159
- echo ' selected="selected"';
160
- } ?>><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
161
- <option value="1"<?php if ( $_mw_adminimize_advice === 1 ) {
162
- echo ' selected="selected"';
163
- } ?>><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
164
- </select>
 
 
 
 
 
 
 
 
 
 
165
  <br>
166
- <textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_advice_txt" id="_mw_adminimize_advice_txt"><?php echo _mw_adminimize_get_option_value( '_mw_adminimize_advice_txt' ); ?></textarea>
167
- <br /><?php esc_attr_e(
 
 
 
 
168
  'In the Footer you can display an advice for changing the Default-design, (x)HTML is possible.',
169
  'adminimize'
170
- ); ?>
 
171
  <code>a - (href, title), br, em, strong</code>
172
  </td>
173
  </tr>
174
  <?php
175
- // when remove dashboard
 
 
 
176
  foreach ( $user_roles as $role ) {
177
  $disabled_menu_[ $role ] = _mw_adminimize_get_option_value(
178
  'mw_adminimize_disabled_menu_' . $role . '_items'
@@ -184,6 +312,17 @@ if ( ! function_exists( 'add_action' ) ) {
184
 
185
  $disabled_menu_all = array();
186
  foreach ( $user_roles as $role ) {
 
 
 
 
 
 
 
 
 
 
 
187
  $disabled_menu_all[] = $disabled_menu_[ $role ];
188
  $disabled_menu_all[] = $disabled_submenu_[ $role ];
189
  }
@@ -196,49 +335,93 @@ if ( ! function_exists( 'add_action' ) ) {
196
  <tr valign="top">
197
  <td><?php esc_attr_e( 'Dashboard deactivate, redirect to', 'adminimize' ); ?></td>
198
  <td>
199
- <?php $_mw_adminimize_db_redirect = _mw_adminimize_get_option_value(
 
200
  '_mw_adminimize_db_redirect'
201
- ); ?>
202
- <select name="_mw_adminimize_db_redirect"<?php if ( isset( $disabled_item2 ) ) {
203
- echo $disabled_item2;
204
- } ?>>
205
- <option value="0"<?php if ( $_mw_adminimize_db_redirect === 0 ) {
206
- echo ' selected="selected"';
207
- } ?>><?php esc_attr_e( 'Default', 'adminimize' ); ?> (profile.php)
208
- </option>
209
- <option value="1"<?php if ( $_mw_adminimize_db_redirect === 1 ) {
210
- echo ' selected="selected"';
211
- } ?>><?php esc_attr_e( 'Manage Posts', 'adminimize' ); ?> (edit.php)
212
- </option>
213
- <option value="2"<?php if ( $_mw_adminimize_db_redirect === 2 ) {
214
- echo ' selected="selected"';
215
- } ?>><?php esc_attr_e( 'Manage Pages', 'adminimize' ); ?> (edit-pages.php)
216
- </option>
217
- <option value="3"<?php if ( $_mw_adminimize_db_redirect === 3 ) {
218
- echo ' selected="selected"';
219
- } ?>><?php esc_attr_e( 'Write Post', 'adminimize' ); ?> (post-new.php)
220
- </option>
221
- <option value="4"<?php if ( $_mw_adminimize_db_redirect === 4 ) {
222
- echo ' selected="selected"';
223
- } ?>><?php esc_attr_e( 'Write Page', 'adminimize' ); ?> (page-new.php)
224
- </option>
225
- <option value="5"<?php if ( $_mw_adminimize_db_redirect === 5 ) {
226
- echo ' selected="selected"';
227
- } ?>><?php esc_attr_e( 'Comments', 'adminimize' ); ?> (edit-comments.php)
228
- </option>
229
- <option value="6"<?php if ( $_mw_adminimize_db_redirect === 6 ) {
230
- echo ' selected="selected"';
231
- } ?>><?php esc_attr_e( 'Other Page', 'adminimize' ); ?></option>
232
- </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  <br>
234
- <textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_db_redirect_txt" id="_mw_adminimize_db_redirect_txt"><?php
235
- echo htmlspecialchars(
236
- stripslashes( _mw_adminimize_get_option_value( '_mw_adminimize_db_redirect_txt' ) )
237
- ); ?></textarea>
238
- <br /><?php esc_attr_e(
 
 
 
 
 
 
 
239
  'You have deactivated the Dashboard, please select a page for redirection or define custom url, include http://?',
240
  'adminimize'
241
- ); ?>
 
242
  </td>
243
  </tr>
244
  <?php
@@ -247,13 +430,20 @@ if ( ! function_exists( 'add_action' ) ) {
247
  </tbody>
248
  </table>
249
  <p id="submitbutton">
250
- <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
 
 
251
  'Update Options', 'adminimize'
252
- ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
 
 
253
  </p>
254
  <p>
255
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php
256
- esc_attr_e( 'scroll to top', 'adminimize' ); ?></a><br class="clear" />
 
 
 
257
  </p>
258
  </div>
259
  </div>
1
  <?php
2
  /**
3
+ * Backend options, options that works on all back end pages.
4
+ *
5
  * @package Adminimize
6
  * @subpackage Backend Options
7
  * @author Frank Bültge
8
  */
9
+
10
  if ( ! function_exists( 'add_action' ) ) {
11
  echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
12
  exit;
15
 
16
  <div id="poststuff" class="ui-sortable meta-box-sortables">
17
  <div class="postbox">
18
+ <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br/></div>
19
  <h3 class="hndle" id="backend_options"><?php esc_attr_e( 'Backend Options', 'adminimize' ); ?></h3>
20
  <div class="inside">
21
 
22
 
23
  <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
24
+ <br class="clear"/>
25
  <table summary="config" class="widefat">
26
  <tbody>
27
  <?php
28
  if ( _mw_adminimize_is_active_on_multisite() && function_exists( 'is_super_admin' )
29
+ ) {
30
+ ?>
31
  <tr valign="top">
32
  <td><?php esc_attr_e( 'Exclude Super Admin', 'adminimize' ); ?></td>
33
  <td>
34
+ <?php
35
+ $_mw_adminimize_exclude_super_admin = _mw_adminimize_get_option_value(
36
  '_mw_adminimize_exclude_super_admin'
37
+ );
38
+ ?>
39
+ <label>
40
+ <select name="_mw_adminimize_exclude_super_admin">
41
+ <option value="0"
42
+ <?php
43
+ if ( 0 === $_mw_adminimize_exclude_super_admin ) {
44
+ echo ' selected="selected"';
45
+ }
46
+ ?>
47
+ ><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
48
+ <option value="1"
49
+ <?php
50
+ if ( 1 === $_mw_adminimize_exclude_super_admin ) {
51
+ echo ' selected="selected"';
52
+ }
53
+ ?>
54
+ ><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
55
+ </select>
56
+ </label>
57
+ <?php
58
+ esc_attr_e(
59
  'Exclude the Super Admin on a WP Multisite Install from all limitations of this plugin.',
60
  'adminimize'
61
+ );
62
+ ?>
63
  </td>
64
  </tr>
65
  <?php } ?>
66
  <tr valign="top">
67
  <td><?php esc_attr_e( 'User-Info', 'adminimize' ); ?></td>
68
  <td>
69
+ <?php
70
+ $_mw_adminimize_user_info = _mw_adminimize_get_option_value(
71
  '_mw_adminimize_user_info'
72
+ );
73
+ ?>
74
+ <label>
75
+ <select name="_mw_adminimize_user_info">
76
+ <option value="0"
77
+ <?php
78
+ if ( 0 === $_mw_adminimize_user_info ) {
79
+ echo ' selected="selected"';
80
+ }
81
+ ?>
82
+ ><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
83
+ <option value="1"
84
+ <?php
85
+ if ( 1 === $_mw_adminimize_user_info ) {
86
+ echo ' selected="selected"';
87
+ }
88
+ ?>
89
+ ><?php esc_attr_e( 'Hide', 'adminimize' ); ?></option>
90
+ <option value="2"
91
+ <?php
92
+ if ( 2 === $_mw_adminimize_user_info ) {
93
+ echo ' selected="selected"';
94
+ }
95
+ ?>
96
+ ><?php esc_attr_e( 'Only logout', 'adminimize' ); ?></option>
97
+ <option value="3"
98
+ <?php
99
+ if ( 3 === $_mw_adminimize_user_info ) {
100
+ echo ' selected="selected"';
101
+ }
102
+ ?>
103
+ ><?php esc_attr_e( 'User &amp; Logout', 'adminimize' ); ?></option>
104
+ </select>
105
+ </label>
106
+ <?php
107
+ esc_attr_e(
108
  'The &quot;User-Info-area&quot; is on the top right side of the backend. You can hide or reduced show.',
109
  'adminimize'
110
+ );
111
+ ?>
112
  </td>
113
  </tr>
114
+ <?php
115
+ if ( ( '' === $_mw_adminimize_user_info ) || ( 1 === $_mw_adminimize_user_info ) || ( 0 === $_mw_adminimize_user_info ) ) {
116
  $disabled_item = ' disabled="disabled"';
117
+ }
118
+ ?>
119
  <tr valign="top">
120
+ <td><label
121
+ for="_mw_adminimize_ui_redirect"><?php esc_attr_e( 'Change User-Info, redirect to', 'adminimize' ); ?>
122
+ </td>
123
  <td>
124
+ <?php
125
+ $_mw_adminimize_ui_redirect = (int) _mw_adminimize_get_option_value(
126
  '_mw_adminimize_ui_redirect'
127
+ );
128
+ ?>
129
  <select name="_mw_adminimize_ui_redirect" id="_mw_adminimize_ui_redirect"
130
+ <?php
131
+ if ( isset( $disabled_item ) ) {
132
+ // phpcs:disable
133
+ echo $disabled_item;
134
+ }
135
+ ?>
136
+ >
137
+ <option value="0"
138
+ <?php
139
+ if ( 0 === $_mw_adminimize_ui_redirect ) {
140
+ echo ' selected="selected"';
141
+ }
142
+ ?>
143
+ >
144
  <?php esc_attr_e( 'Default', 'adminimize' ); ?>
145
  </option>
146
+ <option value="1"
147
+ <?php
148
+ if ( 1 === $_mw_adminimize_ui_redirect ) {
149
+ echo ' selected="selected"';
150
+ }
151
+ ?>
152
+ >
153
  <?php esc_attr_e( 'Frontpage of the Blog', 'adminimize' ); ?>
154
  </option>
155
+ </select>
156
+ <?php
157
+ esc_attr_e(
158
  'When the &quot;User-Info-area&quot; change it, then it is possible to change the redirect.',
159
  'adminimize'
160
+ );
161
+ ?>
162
  </td>
163
  </tr>
164
  <tr valign="top">
166
  <td>
167
  <?php $_mw_adminimize_footer = (int) _mw_adminimize_get_option_value( '_mw_adminimize_footer' ); ?>
168
  <select name="_mw_adminimize_footer" id="_mw_adminimize_footer">
169
+ <option value="0"
170
+ <?php
171
+ if ( 0 === $_mw_adminimize_footer ) {
172
+ echo ' selected="selected"';
173
+ }
174
+ ?>
175
+ >
176
  <?php esc_attr_e( 'Default', 'adminimize' ); ?>
177
  </option>
178
+ <option value="1"
179
+ <?php
180
+ if ( 1 === $_mw_adminimize_footer ) {
181
+ echo ' selected="selected"';
182
+ }
183
+ ?>
184
+ >
185
  <?php esc_attr_e( 'Hide', 'adminimize' ); ?>
186
  </option>
187
+ </select>
188
+ <?php
189
+ esc_attr_e(
190
  'The Footer-area can hide, include all links and details.', 'adminimize'
191
+ );
192
+ ?>
193
  </td>
194
  </tr>
195
  <tr valign="top">
196
  <td><?php esc_attr_e( 'Timestamp', 'adminimize' ); ?></td>
197
  <td>
198
+ <?php
199
+ $_mw_adminimize_timestamp = (int) _mw_adminimize_get_option_value(
200
  '_mw_adminimize_timestamp'
201
+ );
202
+ ?>
203
+ <label>
204
+ <select name="_mw_adminimize_timestamp">
205
+ <option value="0"
206
+ <?php
207
+ if ( 0 === $_mw_adminimize_timestamp ) {
208
+ echo ' selected="selected"';
209
+ }
210
+ ?>
211
+ ><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
212
+ <option value="1"
213
+ <?php
214
+ if ( 1 === $_mw_adminimize_timestamp ) {
215
+ echo ' selected="selected"';
216
+ }
217
+ ?>
218
+ ><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
219
+ </select>
220
+ </label>
221
+ <?php
222
+ esc_attr_e(
223
  'Opens the post timestamp editing fields without you having to click the "Edit" link every time.',
224
  'adminimize'
225
+ );
226
+ ?>
227
  </td>
228
  </tr>
229
  <tr valign="top">
230
  <td><?php esc_attr_e( 'Category Height', 'adminimize' ); ?></td>
231
  <td>
232
+ <?php
233
+ $_mw_adminimize_cat_full = (int) _mw_adminimize_get_option_value(
234
  '_mw_adminimize_cat_full'
235
+ );
236
+ ?>
237
+ <label>
238
+ <select name="_mw_adminimize_cat_full">
239
+ <option value="0"
240
+ <?php
241
+ if ( 0 === $_mw_adminimize_cat_full ) {
242
+ echo ' selected="selected"';
243
+ }
244
+ ?>
245
+ ><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
246
+ <option value="1"
247
+ <?php
248
+ if ( 1 === $_mw_adminimize_cat_full ) {
249
+ echo ' selected="selected"';
250
+ }
251
+ ?>
252
+ ><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
253
+ </select>
254
+ </label>
255
+ <?php
256
+ esc_attr_e(
257
  'View the Meta Box with Categories in the full height, no scrollbar or whitespace.',
258
  'adminimize'
259
+ );
260
+ ?>
261
  </td>
262
  </tr>
263
  <tr valign="top">
264
  <td><?php esc_attr_e( 'Advice in Footer', 'adminimize' ); ?></td>
265
  <td>
266
  <?php $_mw_adminimize_advice = (int) _mw_adminimize_get_option_value( '_mw_adminimize_advice' ); ?>
267
+ <label>
268
+ <select name="_mw_adminimize_advice">
269
+ <option value="0"
270
+ <?php
271
+ if ( 0 === $_mw_adminimize_advice ) {
272
+ echo ' selected="selected"';
273
+ }
274
+ ?>
275
+ ><?php esc_attr_e( 'Default', 'adminimize' ); ?></option>
276
+ <option value="1"
277
+ <?php
278
+ if ( 1 === $_mw_adminimize_advice ) {
279
+ echo ' selected="selected"';
280
+ }
281
+ ?>
282
+ ><?php esc_attr_e( 'Activate', 'adminimize' ); ?></option>
283
+ </select>
284
+ </label>
285
  <br>
286
+ <label for="_mw_adminimize_advice_txt"></label>
287
+ <textarea style="width: 85%;" class="code" rows="1" cols="60" name="_mw_adminimize_advice_txt"
288
+ id="_mw_adminimize_advice_txt"><?php echo _mw_adminimize_get_option_value( '_mw_adminimize_advice_txt' ); ?></textarea>
289
+ <br/>
290
+ <?php
291
+ esc_attr_e(
292
  'In the Footer you can display an advice for changing the Default-design, (x)HTML is possible.',
293
  'adminimize'
294
+ );
295
+ ?>
296
  <code>a - (href, title), br, em, strong</code>
297
  </td>
298
  </tr>
299
  <?php
300
+ if ( ! isset( $user_roles ) ) {
301
+ $user_roles = _mw_adminimize_get_all_user_roles();
302
+ }
303
+ // If the dashboard will remove.
304
  foreach ( $user_roles as $role ) {
305
  $disabled_menu_[ $role ] = _mw_adminimize_get_option_value(
306
  'mw_adminimize_disabled_menu_' . $role . '_items'
312
 
313
  $disabled_menu_all = array();
314
  foreach ( $user_roles as $role ) {
315
+ if ( ! isset( $disabled_menu_ ) ) {
316
+ $disabled_menu_[ $role ] = _mw_adminimize_get_option_value(
317
+ 'mw_adminimize_disabled_menu_' . $role . '_items'
318
+ );
319
+ }
320
+ if ( ! isset( $disabled_submenu_ ) ) {
321
+ $disabled_submenu_[ $role ] = _mw_adminimize_get_option_value(
322
+ 'mw_adminimize_disabled_submenu_' . $role . '_items'
323
+ );
324
+ }
325
+
326
  $disabled_menu_all[] = $disabled_menu_[ $role ];
327
  $disabled_menu_all[] = $disabled_submenu_[ $role ];
328
  }
335
  <tr valign="top">
336
  <td><?php esc_attr_e( 'Dashboard deactivate, redirect to', 'adminimize' ); ?></td>
337
  <td>
338
+ <?php
339
+ $_mw_adminimize_db_redirect = _mw_adminimize_get_option_value(
340
  '_mw_adminimize_db_redirect'
341
+ );
342
+ ?>
343
+ <label>
344
+ <select name="_mw_adminimize_db_redirect"
345
+ <?php
346
+ if ( isset( $disabled_item2 ) ) {
347
+ echo $disabled_item2;
348
+ }
349
+ ?>
350
+ >
351
+ <option value="0"
352
+ <?php
353
+ if ( $_mw_adminimize_db_redirect === 0 ) {
354
+ echo ' selected="selected"';
355
+ }
356
+ ?>
357
+ ><?php esc_attr_e( 'Default', 'adminimize' ); ?> (profile.php)
358
+ </option>
359
+ <option value="1"
360
+ <?php
361
+ if ( $_mw_adminimize_db_redirect === 1 ) {
362
+ echo ' selected="selected"';
363
+ }
364
+ ?>
365
+ ><?php esc_attr_e( 'Manage Posts', 'adminimize' ); ?> (edit.php)
366
+ </option>
367
+ <option value="2"
368
+ <?php
369
+ if ( $_mw_adminimize_db_redirect === 2 ) {
370
+ echo ' selected="selected"';
371
+ }
372
+ ?>
373
+ ><?php esc_attr_e( 'Manage Pages', 'adminimize' ); ?> (edit-pages.php)
374
+ </option>
375
+ <option value="3"
376
+ <?php
377
+ if ( $_mw_adminimize_db_redirect === 3 ) {
378
+ echo ' selected="selected"';
379
+ }
380
+ ?>
381
+ ><?php esc_attr_e( 'Write Post', 'adminimize' ); ?> (post-new.php)
382
+ </option>
383
+ <option value="4"
384
+ <?php
385
+ if ( $_mw_adminimize_db_redirect === 4 ) {
386
+ echo ' selected="selected"';
387
+ }
388
+ ?>
389
+ ><?php esc_attr_e( 'Write Page', 'adminimize' ); ?> (page-new.php)
390
+ </option>
391
+ <option value="5"
392
+ <?php
393
+ if ( $_mw_adminimize_db_redirect === 5 ) {
394
+ echo ' selected="selected"';
395
+ }
396
+ ?>
397
+ ><?php esc_attr_e( 'Comments', 'adminimize' ); ?> (edit-comments.php)
398
+ </option>
399
+ <option value="6"
400
+ <?php
401
+ if ( $_mw_adminimize_db_redirect === 6 ) {
402
+ echo ' selected="selected"';
403
+ }
404
+ ?>
405
+ ><?php esc_attr_e( 'Other Page', 'adminimize' ); ?></option>
406
+ </select>
407
+ </label>
408
  <br>
409
+ <label for="_mw_adminimize_db_redirect_txt"></label>
410
+ <textarea style="width: 85%;" class="code" rows="1" cols="60"
411
+ name="_mw_adminimize_db_redirect_txt" id="_mw_adminimize_db_redirect_txt">
412
+ <?php
413
+ echo htmlspecialchars(
414
+ stripslashes( _mw_adminimize_get_option_value( '_mw_adminimize_db_redirect_txt' ) )
415
+ );
416
+ ?>
417
+ </textarea>
418
+ <br/>
419
+ <?php
420
+ esc_attr_e(
421
  'You have deactivated the Dashboard, please select a page for redirection or define custom url, include http://?',
422
  'adminimize'
423
+ );
424
+ ?>
425
  </td>
426
  </tr>
427
  <?php
430
  </tbody>
431
  </table>
432
  <p id="submitbutton">
433
+ <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="
434
+ <?php
435
+ esc_attr_e(
436
  'Update Options', 'adminimize'
437
+ );
438
+ ?>
439
+ &raquo;"/><input type="hidden" name="page_options" value="'dofollow_timeout'"/>
440
  </p>
441
  <p>
442
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;">
443
+ <?php
444
+ esc_attr_e( 'scroll to top', 'adminimize' );
445
+ ?>
446
+ </a><br class="clear"/>
447
  </p>
448
  </div>
449
  </div>
inc-options/dashboard_options.php CHANGED
@@ -205,7 +205,7 @@ if ( ! function_exists( 'add_action' ) ) {
205
  <?php } // end if else $widgets ?>
206
 
207
  <p>
208
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
209
  'scroll to top', 'adminimize'
210
  ); ?></a><br class="clear" /></p>
211
 
205
  <?php } // end if else $widgets ?>
206
 
207
  <p>
208
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
209
  'scroll to top', 'adminimize'
210
  ); ?></a><br class="clear" /></p>
211
 
inc-options/deinstall_options.php CHANGED
@@ -16,24 +16,23 @@ if ( ! function_exists( 'add_action' ) ) {
16
  <div class="inside">
17
 
18
  <p><?php _e(
19
- 'Use this option for clean your database from all entries of this plugin. When you deactivate the plugin, the deinstall of the plugin <strong>clean not</strong> all entries in the database.',
20
  'adminimize'
21
- ); ?></p>
22
  <form name="deinstall_options" method="post" id="_mw_adminimize_options_deinstall" action="?page=<?php echo esc_attr(
23
  $_GET[ 'page' ]
24
  ); ?>">
25
  <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
26
  <p id="submitbutton">
27
- <input type="submit" name="_mw_adminimize_uninstall" value="<?php esc_attr_e(
28
- 'Delete Options', 'adminimize'
29
- ); ?> &raquo;" class="button-secondary" />
30
- <input type="checkbox" name="_mw_adminimize_uninstall_yes" value="_mw_adminimize_uninstall" />
31
  <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_uninstall" />
32
  </p>
33
  </form>
34
  <p>
35
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php
36
- esc_attr_e( 'scroll to top', 'adminimize' ); ?></a><br class="clear" />
 
37
  </p>
38
 
39
  </div>
16
  <div class="inside">
17
 
18
  <p><?php _e(
19
+ 'Use this option to clean your database from all the entries created by this plugin. Deactivating or uninstalling the plugin <strong>will not</strong> clean the database entries.',
20
  'adminimize'
21
+ ); // Some grammer correction ?></p>
22
  <form name="deinstall_options" method="post" id="_mw_adminimize_options_deinstall" action="?page=<?php echo esc_attr(
23
  $_GET[ 'page' ]
24
  ); ?>">
25
  <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
26
  <p id="submitbutton">
27
+ <input id="_mw_adminimize_uninstall_yes" type="checkbox" name="_mw_adminimize_uninstall_yes" value="_mw_adminimize_uninstall" /><label for="_mw_adminimize_uninstall_yes"><?php esc_html_e( 'Yes, I know the risks.','adminimize' ) ?><br class="clear"></label>
28
+ <input style="margin-top:15px" type="submit" name="_mw_adminimize_uninstall" value="<?php esc_attr_e( 'Delete Options', 'adminimize' ); ?> &raquo;" class="button-secondary" />
 
 
29
  <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_uninstall" />
30
  </p>
31
  </form>
32
  <p>
33
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;">
34
+ <?php esc_attr_e( 'scroll to top', 'adminimize' ); ?>
35
+ </a><br class="clear" />
36
  </p>
37
 
38
  </div>
inc-options/global_options.php CHANGED
@@ -1,9 +1,12 @@
1
  <?php
2
  /**
 
 
3
  * @package Adminimize
4
  * @subpackage Global Options
5
  * @author Frank Bültge
6
  */
 
7
  if ( ! function_exists( 'add_action' ) ) {
8
  echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9
  exit;
@@ -12,17 +15,21 @@ if ( ! function_exists( 'add_action' ) ) {
12
 
13
  <div id="poststuff" class="ui-sortable meta-box-sortables">
14
  <div class="postbox">
15
- <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
16
  <h3 class="hndle" id="global_options"><?php esc_attr_e( 'Global options', 'adminimize' ); ?></h3>
17
 
18
  <div class="inside">
19
- <br class="clear" />
20
 
21
  <table summary="config_edit_post" class="widefat">
22
  <colgroup>
23
  <?php
24
  $col = 0;
 
 
 
25
  foreach ( $user_roles_names as $role_name ) {
 
26
  echo '<col class="col' . $col . '">' . "\n";
27
  $col ++;
28
  }
@@ -32,25 +39,35 @@ if ( ! function_exists( 'add_action' ) ) {
32
  <tr>
33
  <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
34
  <?php
35
- foreach ( $user_roles_names as $role_name ) { ?>
36
- <th><?php esc_attr_e( 'Deactivate for', 'adminimize' );
37
- echo '<br/>' . $role_name; ?></th>
 
 
 
 
 
38
  <?php } ?>
39
  </tr>
40
  <tr>
41
  <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
42
  <?php
 
 
 
43
  foreach ( $user_roles as $role_slug ) {
44
  echo '<td class="num">';
45
- echo '<input id="select_all" class="global_options_' . $role_slug
46
- . '" type="checkbox" name="" value="" />';
47
  echo '</td>' . "\n";
48
- } ?>
 
49
  </tr>
50
  </thead>
51
 
52
  <tbody>
53
  <?php
 
54
  foreach ( $user_roles as $role ) {
55
  $disabled_global_option_[ $role ] = _mw_adminimize_get_option_value(
56
  'mw_adminimize_disabled_global_option_' . $role . '_items'
@@ -81,14 +98,14 @@ if ( ! function_exists( 'add_action' ) ) {
81
  $_mw_adminimize_own_values = preg_split( "/\r\n/", $_mw_adminimize_own_values );
82
  foreach ( (array) $_mw_adminimize_own_values as $key => $_mw_adminimize_own_value ) {
83
  $_mw_adminimize_own_value = trim( $_mw_adminimize_own_value );
84
- $global_options[] = $_mw_adminimize_own_value;
85
  }
86
 
87
  $_mw_adminimize_own_options = _mw_adminimize_get_option_value( '_mw_adminimize_own_options' );
88
  $_mw_adminimize_own_options = preg_split( "/\r\n/", $_mw_adminimize_own_options );
89
  foreach ( (array) $_mw_adminimize_own_options as $key => $_mw_adminimize_own_option ) {
90
  $_mw_adminimize_own_option = trim( $_mw_adminimize_own_option );
91
- $global_options_names[] = $_mw_adminimize_own_option;
92
  }
93
 
94
  $x = 0;
@@ -98,19 +115,19 @@ if ( ! function_exists( 'add_action' ) ) {
98
  continue;
99
  }
100
 
 
 
101
  $checked_user_role_ = array();
102
  foreach ( (array) $user_roles as $role ) {
103
- $checked_user_role_[ $role ] = ( isset( $disabled_global_option_[ $role ] )
104
- && in_array( $global_option, $disabled_global_option_[ $role ], true ) ) ? ' checked="checked"'
105
- : '';
106
  }
107
  echo '<tr>' . "\n";
108
  echo '<td>' . $global_options_names[ $index ] . ' <span>(' . $global_option . ')</span> </td>' . "\n";
109
  foreach ( (array) $user_roles as $role ) {
110
  echo '<td class="num"><input id="check_post' . $role . $x . '" class="global_options_'
111
- . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox"'
112
- . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_global_option_'
113
- . $role . '_items[]" value="' . $global_option . '" /></td>' . "\n";
114
  }
115
  echo '</tr>' . "\n";
116
  $x ++;
@@ -121,66 +138,104 @@ if ( ! function_exists( 'add_action' ) ) {
121
  </table>
122
 
123
  <?php
124
- //your own global options
125
  ?>
126
- <br style="margin-top: 10px;" />
127
  <table summary="config_edit_post" class="widefat">
128
  <thead>
129
  <tr>
130
- <th><?php esc_attr_e( 'Your own options', 'adminimize' );
 
 
 
 
 
 
 
 
131
  echo '<br />';
132
- esc_attr_e( 'Option name', 'adminimize' ); ?></th>
133
- <th><?php echo '<br />';
134
- esc_attr_e( 'Selector, ID or class', 'adminimize' ); ?></th>
135
  </tr>
136
  </thead>
137
 
138
  <tbody>
139
  <tr valign="top">
140
- <td colspan="2"><?php esc_attr_e(
 
 
141
  'It is possible to add your own IDs or classes from elements and tags. You can find IDs and classes with the FireBug Add-on for Firefox. Assign a value and the associate name per line.',
142
  'adminimize'
143
- ); ?></td>
 
 
144
  </tr>
145
  <tr valign="top">
146
  <td>
 
147
  <textarea name="_mw_adminimize_own_options" cols="60" rows="3"
148
- id="_mw_adminimize_own_options" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
149
- '_mw_adminimize_own_options'
150
- ); ?></textarea>
151
- <br />
152
- <?php esc_attr_e(
 
 
 
 
 
 
 
153
  'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
154
  'adminimize'
155
- ); ?>
 
156
  </td>
157
  <td>
 
158
  <textarea class="code" name="_mw_adminimize_own_values" cols="60" rows="3"
159
- id="_mw_adminimize_own_values" style="width: 95%;"><?php echo _mw_adminimize_get_option_value(
160
- '_mw_adminimize_own_values'
161
- ); ?></textarea>
162
- <br />
163
- <?php esc_attr_e(
 
 
 
 
 
 
 
164
  'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize'
165
- ); ?>
 
166
  </td>
167
  </tr>
168
  </tbody>
169
  </table>
170
 
171
  <p id="submitbutton">
172
- <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert" />
173
- <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="<?php esc_attr_e(
 
 
174
  'Update Options', 'adminimize'
175
- ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
 
 
176
  </p>
177
 
178
  <p>
179
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);"
180
- style="margin:3px 0 0 30px;"><?php esc_attr_e(
 
 
181
  'scroll to top', 'adminimize'
182
- ); ?></a>
183
- <br class="clear" />
 
 
184
  </p>
185
 
186
  </div>
1
  <?php
2
  /**
3
+ * Global options area on the settings page.
4
+ *
5
  * @package Adminimize
6
  * @subpackage Global Options
7
  * @author Frank Bültge
8
  */
9
+
10
  if ( ! function_exists( 'add_action' ) ) {
11
  echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
12
  exit;
15
 
16
  <div id="poststuff" class="ui-sortable meta-box-sortables">
17
  <div class="postbox">
18
+ <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br/></div>
19
  <h3 class="hndle" id="global_options"><?php esc_attr_e( 'Global options', 'adminimize' ); ?></h3>
20
 
21
  <div class="inside">
22
+ <br class="clear"/>
23
 
24
  <table summary="config_edit_post" class="widefat">
25
  <colgroup>
26
  <?php
27
  $col = 0;
28
+ if ( ! isset( $user_roles_names ) ) {
29
+ $user_roles_names = _mw_adminimize_get_all_user_roles_names();
30
+ }
31
  foreach ( $user_roles_names as $role_name ) {
32
+ // phpcs:disable
33
  echo '<col class="col' . $col . '">' . "\n";
34
  $col ++;
35
  }
39
  <tr>
40
  <th><?php esc_attr_e( 'Option', 'adminimize' ); ?></th>
41
  <?php
42
+ foreach ( $user_roles_names as $role_name ) {
43
+ ?>
44
+ <th>
45
+ <?php
46
+ esc_attr_e( 'Deactivate for', 'adminimize' );
47
+ echo '<br/>' . esc_html( $role_name );
48
+ ?>
49
+ </th>
50
  <?php } ?>
51
  </tr>
52
  <tr>
53
  <td><?php esc_attr_e( 'Select all', 'adminimize' ); ?></td>
54
  <?php
55
+ if ( ! isset( $user_roles ) ) {
56
+ $user_roles = _mw_adminimize_get_all_user_roles();
57
+ }
58
  foreach ( $user_roles as $role_slug ) {
59
  echo '<td class="num">';
60
+ echo '<input id="select_all" class="global_options_' . esc_attr( $role_slug )
61
+ . '" type="checkbox" name="" value="" />';
62
  echo '</td>' . "\n";
63
+ }
64
+ ?>
65
  </tr>
66
  </thead>
67
 
68
  <tbody>
69
  <?php
70
+ $disabled_global_option_ = array();
71
  foreach ( $user_roles as $role ) {
72
  $disabled_global_option_[ $role ] = _mw_adminimize_get_option_value(
73
  'mw_adminimize_disabled_global_option_' . $role . '_items'
98
  $_mw_adminimize_own_values = preg_split( "/\r\n/", $_mw_adminimize_own_values );
99
  foreach ( (array) $_mw_adminimize_own_values as $key => $_mw_adminimize_own_value ) {
100
  $_mw_adminimize_own_value = trim( $_mw_adminimize_own_value );
101
+ $global_options[] = $_mw_adminimize_own_value;
102
  }
103
 
104
  $_mw_adminimize_own_options = _mw_adminimize_get_option_value( '_mw_adminimize_own_options' );
105
  $_mw_adminimize_own_options = preg_split( "/\r\n/", $_mw_adminimize_own_options );
106
  foreach ( (array) $_mw_adminimize_own_options as $key => $_mw_adminimize_own_option ) {
107
  $_mw_adminimize_own_option = trim( $_mw_adminimize_own_option );
108
+ $global_options_names[] = $_mw_adminimize_own_option;
109
  }
110
 
111
  $x = 0;
115
  continue;
116
  }
117
 
118
+ $global_option = esc_attr( $global_option );
119
+
120
  $checked_user_role_ = array();
121
  foreach ( (array) $user_roles as $role ) {
122
+ $checked_user_role_[ $role ] = _mw_adminimize_is_checked( $global_option, $disabled_global_option_[ $role ] );
 
 
123
  }
124
  echo '<tr>' . "\n";
125
  echo '<td>' . $global_options_names[ $index ] . ' <span>(' . $global_option . ')</span> </td>' . "\n";
126
  foreach ( (array) $user_roles as $role ) {
127
  echo '<td class="num"><input id="check_post' . $role . $x . '" class="global_options_'
128
+ . preg_replace( '/[^a-z0-9_-]+/', '', $role ) . '" type="checkbox" '
129
+ . $checked_user_role_[ $role ] . ' name="mw_adminimize_disabled_global_option_'
130
+ . $role . '_items[]" value="' . $global_option . '" /></td>' . "\n";
131
  }
132
  echo '</tr>' . "\n";
133
  $x ++;
138
  </table>
139
 
140
  <?php
141
+ // your own global options.
142
  ?>
143
+ <br style="margin-top: 10px;"/>
144
  <table summary="config_edit_post" class="widefat">
145
  <thead>
146
  <tr>
147
+ <th>
148
+ <?php
149
+ esc_attr_e( 'Your own options', 'adminimize' );
150
+ echo '<br />';
151
+ esc_attr_e( 'Option name', 'adminimize' );
152
+ ?>
153
+ </th>
154
+ <th>
155
+ <?php
156
  echo '<br />';
157
+ esc_attr_e( 'Selector, ID or class', 'adminimize' );
158
+ ?>
159
+ </th>
160
  </tr>
161
  </thead>
162
 
163
  <tbody>
164
  <tr valign="top">
165
+ <td colspan="2">
166
+ <?php
167
+ esc_attr_e(
168
  'It is possible to add your own IDs or classes from elements and tags. You can find IDs and classes with the FireBug Add-on for Firefox. Assign a value and the associate name per line.',
169
  'adminimize'
170
+ );
171
+ ?>
172
+ </td>
173
  </tr>
174
  <tr valign="top">
175
  <td>
176
+ <label for="_mw_adminimize_own_options"></label>
177
  <textarea name="_mw_adminimize_own_options" cols="60" rows="3"
178
+ id="_mw_adminimize_own_options" style="width: 95%;">
179
+ <?php
180
+ // The function sanitize the output.
181
+ // phpcs:disable
182
+ echo _mw_adminimize_get_option_value(
183
+ '_mw_adminimize_own_options'
184
+ );
185
+ ?>
186
+ </textarea>
187
+ <br/>
188
+ <?php
189
+ esc_attr_e(
190
  'Possible nomination for ID or class. Separate multiple nominations through a carriage return.',
191
  'adminimize'
192
+ );
193
+ ?>
194
  </td>
195
  <td>
196
+ <label for="_mw_adminimize_own_values"></label>
197
  <textarea class="code" name="_mw_adminimize_own_values" cols="60" rows="3"
198
+ id="_mw_adminimize_own_values" style="width: 95%;">
199
+ <?php
200
+ // The function sanitize the output.
201
+ // phpcs:disable
202
+ echo _mw_adminimize_get_option_value(
203
+ '_mw_adminimize_own_values'
204
+ );
205
+ ?>
206
+ </textarea>
207
+ <br/>
208
+ <?php
209
+ esc_attr_e(
210
  'Possible IDs or classes. Separate multiple values through a carriage return.', 'adminimize'
211
+ );
212
+ ?>
213
  </td>
214
  </tr>
215
  </tbody>
216
  </table>
217
 
218
  <p id="submitbutton">
219
+ <input type="hidden" name="_mw_adminimize_action" value="_mw_adminimize_insert"/>
220
+ <input class="button button-primary" type="submit" name="_mw_adminimize_save" value="
221
+ <?php
222
+ esc_attr_e(
223
  'Update Options', 'adminimize'
224
+ );
225
+ ?>
226
+ &raquo;"/><input type="hidden" name="page_options" value="'dofollow_timeout'"/>
227
  </p>
228
 
229
  <p>
230
+ <a class="alignright button adminimize-scroltop" href="#"
231
+ style="margin:3px 0 0 30px;">
232
+ <?php
233
+ esc_attr_e(
234
  'scroll to top', 'adminimize'
235
+ );
236
+ ?>
237
+ </a>
238
+ <br class="clear"/>
239
  </p>
240
 
241
  </div>
inc-options/im_export_options.php CHANGED
@@ -85,7 +85,7 @@ if ( ! function_exists( 'add_action' ) ) {
85
  </form>
86
 
87
  <p>
88
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;">
89
  <?php esc_html_e(
90
  'scroll to top', 'adminimize'
91
  ); ?>
85
  </form>
86
 
87
  <p>
88
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;">
89
  <?php esc_html_e(
90
  'scroll to top', 'adminimize'
91
  ); ?>
inc-options/links_options.php CHANGED
@@ -175,7 +175,7 @@ if ( ! function_exists( 'add_action' ) ) {
175
  </p>
176
 
177
  <p>
178
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
179
  'scroll to top', 'adminimize'
180
  ); ?></a><br class="clear" /></p>
181
 
175
  </p>
176
 
177
  <p>
178
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
179
  'scroll to top', 'adminimize'
180
  ); ?></a><br class="clear" /></p>
181
 
inc-options/menu_options.php CHANGED
@@ -317,7 +317,7 @@ if ( ! function_exists( 'add_action' ) ) {
317
  </p>
318
 
319
  <p>
320
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
321
  'scroll to top', 'adminimize'
322
  ); ?></a><br class="clear" /></p>
323
 
317
  </p>
318
 
319
  <p>
320
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
321
  'scroll to top', 'adminimize'
322
  ); ?></a><br class="clear" /></p>
323
 
inc-options/minimenu.php CHANGED
@@ -19,7 +19,7 @@ if ( _mw_adminimize_is_active_on_multisite() ) {
19
  <h2><?php esc_attr_e( 'Adminimize', 'adminimize' );
20
  echo ' ' . $message; ?></h2>
21
  <br class="clear" />
22
- <div id="poststuff" class="ui-sortable meta-box-sortables">
23
  <div id="minimenu" class="postbox ">
24
  <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
25
  <h3 class="hndle" id="menu"><?php esc_attr_e( 'MiniMenu', 'adminimize' ) ?></h3>
@@ -203,7 +203,7 @@ if ( _mw_adminimize_is_active_on_multisite() ) {
203
  <p>&copy; Copyright 2008 - <?php echo date( 'Y' ); ?> <a href="http://bueltge.de">Frank B&uuml;ltge</a></p>
204
 
205
  <p>
206
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
207
  'scroll to top', 'adminimize'
208
  ); ?></a><br class="clear" /></p>
209
  </div>
19
  <h2><?php esc_attr_e( 'Adminimize', 'adminimize' );
20
  echo ' ' . $message; ?></h2>
21
  <br class="clear" />
22
+ <div id="poststuff" class="ui-sortable meta-box-sortables"><!-- The ID should be unique. Right now, all the option panels are sharing the $poststuff ID-->
23
  <div id="minimenu" class="postbox ">
24
  <div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'adminimize' ); ?>"><br /></div>
25
  <h3 class="hndle" id="menu"><?php esc_attr_e( 'MiniMenu', 'adminimize' ) ?></h3>
203
  <p>&copy; Copyright 2008 - <?php echo date( 'Y' ); ?> <a href="http://bueltge.de">Frank B&uuml;ltge</a></p>
204
 
205
  <p>
206
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
207
  'scroll to top', 'adminimize'
208
  ); ?></a><br class="clear" /></p>
209
  </div>
inc-options/self_settings.php CHANGED
@@ -81,7 +81,7 @@ if ( ! function_exists( 'add_action' ) ) {
81
  </p>
82
 
83
  <p>
84
- <a class="alignright button" href="javascript:void(0);"
85
  onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
86
  'scroll to top', 'adminimize'
87
  ); ?></a><br class="clear" />
81
  </p>
82
 
83
  <p>
84
+ <a class="alignright button adminimize-scroltop" href="#"
85
  onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
86
  'scroll to top', 'adminimize'
87
  ); ?></a><br class="clear" />
inc-options/theme_options.php CHANGED
@@ -24,7 +24,7 @@ if ( ! function_exists( 'add_action' ) ) {
24
  ); ?>">
25
  <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
26
  <p><?php esc_attr_e(
27
- 'For better peformance on sites with many users, you should load userlist data before making any changes in the theme options for users.',
28
  'adminimize'
29
  ); ?></p>
30
 
@@ -127,7 +127,7 @@ if ( ! function_exists( 'add_action' ) ) {
127
  <?php } ?>
128
 
129
  <p>
130
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
131
  'scroll to top', 'adminimize'
132
  ); ?></a><br class="clear" /></p>
133
  </div>
24
  ); ?>">
25
  <?php wp_nonce_field( 'mw_adminimize_nonce' ); ?>
26
  <p><?php esc_attr_e(
27
+ 'For better performance on sites with many users, you should load userlist data before making any changes in the theme options for users.',
28
  'adminimize'
29
  ); ?></p>
30
 
127
  <?php } ?>
128
 
129
  <p>
130
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
131
  'scroll to top', 'adminimize'
132
  ); ?></a><br class="clear" /></p>
133
  </div>
inc-options/widget_options.php CHANGED
@@ -187,7 +187,7 @@ if ( ! function_exists( 'add_action' ) ) {
187
  </p>
188
 
189
  <p>
190
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
191
  'scroll to top', 'adminimize'
192
  ); ?></a><br class="clear" /></p>
193
 
187
  </p>
188
 
189
  <p>
190
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
191
  'scroll to top', 'adminimize'
192
  ); ?></a><br class="clear" /></p>
193
 
inc-options/wp_nav_menu_options.php CHANGED
@@ -202,7 +202,7 @@ if ( ! function_exists( 'add_action' ) ) {
202
  </p>
203
 
204
  <p>
205
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
206
  'scroll to top', 'adminimize'
207
  ); ?></a><br class="clear" /></p>
208
 
202
  </p>
203
 
204
  <p>
205
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
206
  'scroll to top', 'adminimize'
207
  ); ?></a><br class="clear" /></p>
208
 
inc-options/write_cp_options.php CHANGED
@@ -132,9 +132,9 @@ foreach ( get_post_types( $args ) as $post_type ) {
132
  $metaboxes = array_merge( $metaboxes, $quickedit_areas );
133
 
134
  $metaboxes_names = array(
135
- esc_attr__( 'Help' ),
136
- esc_attr__( 'Screen Options' ),
137
- esc_attr__( 'Add New' ),
138
  esc_attr__( 'Permalink', 'adminimize' ),
139
  esc_attr__( 'Tags', 'adminimize' ),
140
  esc_attr__( 'Format', 'adminimize' ),
@@ -148,8 +148,8 @@ foreach ( get_post_types( $args ) as $post_type ) {
148
  esc_attr__( 'Word count', 'adminimize' ),
149
  esc_attr__( 'Post Slug', 'adminimize' ),
150
  esc_attr__( 'Publish Actions', 'adminimize' ),
151
- esc_attr__( 'Discussion' ),
152
- esc_attr__( 'HTML Editor Button' ),
153
  );
154
 
155
  if ( ! empty( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] ) ) {
@@ -321,7 +321,7 @@ foreach ( get_post_types( $args ) as $post_type ) {
321
  <input type="hidden" name="page_options" value="'dofollow_timeout'" />
322
  </p>
323
 
324
- <p><a class="alignright button" href="javascript:void(0);"
325
  onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;">
326
  <?php esc_attr_e( 'scroll to top', 'adminimize' ); ?></a>
327
  <br class="clear" />
132
  $metaboxes = array_merge( $metaboxes, $quickedit_areas );
133
 
134
  $metaboxes_names = array(
135
+ esc_attr__( 'Help', 'adminimize' ),
136
+ esc_attr__( 'Screen Options', 'adminimize' ),
137
+ esc_attr__( 'Add New', 'adminimize' ),
138
  esc_attr__( 'Permalink', 'adminimize' ),
139
  esc_attr__( 'Tags', 'adminimize' ),
140
  esc_attr__( 'Format', 'adminimize' ),
148
  esc_attr__( 'Word count', 'adminimize' ),
149
  esc_attr__( 'Post Slug', 'adminimize' ),
150
  esc_attr__( 'Publish Actions', 'adminimize' ),
151
+ esc_attr__( 'Discussion', 'adminimize' ),
152
+ esc_attr__( 'HTML Editor Button', 'adminimize' ),
153
  );
154
 
155
  if ( ! empty( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] ) ) {
321
  <input type="hidden" name="page_options" value="'dofollow_timeout'" />
322
  </p>
323
 
324
+ <a class="alignright button adminimize-scroltop" href="#"
325
  onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;">
326
  <?php esc_attr_e( 'scroll to top', 'adminimize' ); ?></a>
327
  <br class="clear" />
inc-options/write_page_options.php CHANGED
@@ -120,20 +120,20 @@ if ( ! function_exists( 'add_action' ) ) {
120
  $metaboxes_page = array_merge( $metaboxes_page, $quickedit_page_areas );
121
 
122
  $metaboxes_names_page = array(
123
- esc_attr__( 'Help' ),
124
- esc_attr__( 'Screen Options' ),
125
- esc_attr__( 'Add New' ),
126
  esc_attr__( 'Title', 'adminimize' ),
127
  esc_attr__( 'Permalink', 'adminimize' ),
128
- esc_attr__( 'Custom Fields' ),
129
  esc_attr__( 'Comments &amp; Pings', 'adminimize' ),
130
- esc_attr__( 'Date' ),
131
  esc_attr__( 'Password Protect This Page', 'adminimize' ),
132
  esc_attr__( 'Attributes', 'adminimize' ),
133
  esc_attr__( 'Page Template', 'adminimize' ),
134
  esc_attr__( 'Page Order', 'adminimize' ),
135
- esc_attr__( 'Page Author' ),
136
- esc_attr__( 'Page Revisions' ),
137
  esc_attr__( 'Related', 'adminimize' ),
138
  esc_attr__( 'Messages', 'adminimize' ),
139
  esc_attr__( 'h2: Advanced Options', 'adminimize' ),
@@ -270,7 +270,7 @@ if ( ! function_exists( 'add_action' ) ) {
270
  ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
271
  </p>
272
  <p>
273
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
274
  'scroll to top', 'adminimize'
275
  ); ?></a><br class="clear" /></p>
276
 
120
  $metaboxes_page = array_merge( $metaboxes_page, $quickedit_page_areas );
121
 
122
  $metaboxes_names_page = array(
123
+ esc_attr__( 'Help', 'adminimize' ),
124
+ esc_attr__( 'Screen Options', 'adminimize' ),
125
+ esc_attr__( 'Add New', 'adminimize' ),
126
  esc_attr__( 'Title', 'adminimize' ),
127
  esc_attr__( 'Permalink', 'adminimize' ),
128
+ esc_attr__( 'Custom Fields', 'adminimize' ),
129
  esc_attr__( 'Comments &amp; Pings', 'adminimize' ),
130
+ esc_attr__( 'Date', 'adminimize' ),
131
  esc_attr__( 'Password Protect This Page', 'adminimize' ),
132
  esc_attr__( 'Attributes', 'adminimize' ),
133
  esc_attr__( 'Page Template', 'adminimize' ),
134
  esc_attr__( 'Page Order', 'adminimize' ),
135
+ esc_attr__( 'Page Author', 'adminimize' ),
136
+ esc_attr__( 'Page Revisions', 'adminimize' ),
137
  esc_attr__( 'Related', 'adminimize' ),
138
  esc_attr__( 'Messages', 'adminimize' ),
139
  esc_attr__( 'h2: Advanced Options', 'adminimize' ),
270
  ); ?> &raquo;" /><input type="hidden" name="page_options" value="'dofollow_timeout'" />
271
  </p>
272
  <p>
273
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
274
  'scroll to top', 'adminimize'
275
  ); ?></a><br class="clear" /></p>
276
 
inc-options/write_post_options.php CHANGED
@@ -124,15 +124,15 @@ if ( ! function_exists( 'add_action' ) ) {
124
  $metaboxes = array_merge( $metaboxes, $quickedit_areas );
125
 
126
  $metaboxes_names = array(
127
- esc_attr__( 'Help' ),
128
- esc_attr__( 'Screen Options' ),
129
- esc_attr__( 'Add New' ),
130
  esc_attr__( 'Title', 'adminimize' ),
131
  esc_attr__( 'Permalink', 'adminimize' ),
132
  esc_attr__( 'Tags', 'adminimize' ),
133
  esc_attr__( 'Categories', 'adminimize' ),
134
  esc_attr__( 'Add New Category', 'adminimize' ),
135
- esc_attr__( 'Date' ),
136
  esc_attr__( 'Password Protect This Post', 'adminimize' ),
137
  esc_attr__( 'Related, Shortcuts', 'adminimize' ),
138
  esc_attr__( 'Messages', 'adminimize' ),
@@ -141,8 +141,8 @@ if ( ! function_exists( 'add_action' ) ) {
141
  esc_attr__( 'Word count', 'adminimize' ),
142
  esc_attr__( 'Post Slug', 'adminimize' ),
143
  esc_attr__( 'Publish Actions', 'adminimize' ),
144
- esc_attr__( 'Discussion' ),
145
- esc_attr__( 'HTML Editor Button' )
146
  );
147
 
148
  foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
@@ -273,7 +273,7 @@ if ( ! function_exists( 'add_action' ) ) {
273
  </p>
274
 
275
  <p>
276
- <a class="alignright button" href="javascript:void(0);" onclick="window.scrollTo(0,0);" style="margin:3px 0 0 30px;"><?php esc_attr_e(
277
  'scroll to top', 'adminimize'
278
  ); ?></a><br class="clear" /></p>
279
 
124
  $metaboxes = array_merge( $metaboxes, $quickedit_areas );
125
 
126
  $metaboxes_names = array(
127
+ esc_attr__( 'Help', 'adminimize' ),
128
+ esc_attr__( 'Screen Options', 'adminimize' ),
129
+ esc_attr__( 'Add New', 'adminimize' ),
130
  esc_attr__( 'Title', 'adminimize' ),
131
  esc_attr__( 'Permalink', 'adminimize' ),
132
  esc_attr__( 'Tags', 'adminimize' ),
133
  esc_attr__( 'Categories', 'adminimize' ),
134
  esc_attr__( 'Add New Category', 'adminimize' ),
135
+ esc_attr__( 'Date', 'adminimize' ),
136
  esc_attr__( 'Password Protect This Post', 'adminimize' ),
137
  esc_attr__( 'Related, Shortcuts', 'adminimize' ),
138
  esc_attr__( 'Messages', 'adminimize' ),
141
  esc_attr__( 'Word count', 'adminimize' ),
142
  esc_attr__( 'Post Slug', 'adminimize' ),
143
  esc_attr__( 'Publish Actions', 'adminimize' ),
144
+ esc_attr__( 'Discussion', 'adminimize' ),
145
+ esc_attr__( 'HTML Editor Button', 'adminimize' )
146
  );
147
 
148
  foreach ( $GLOBALS[ '_wp_post_type_features' ][ $post_type ] as $post_type_support => $key ) {
273
  </p>
274
 
275
  <p>
276
+ <a class="alignright button adminimize-scroltop" href="#" style="margin:3px 0 0 30px;"><?php esc_attr_e(
277
  'scroll to top', 'adminimize'
278
  ); ?></a><br class="clear" /></p>
279
 
inc-setup/admin-bar-items.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
  /**
 
 
3
  * @package Adminimize
4
  * @subpackage Admin Bar Items
5
  * @author Frank Bültge
@@ -31,27 +33,30 @@ function _mw_adminimize_get_admin_bar_nodes() {
31
  return;
32
  }
33
 
34
- /** @var $wp_admin_bar WP_Admin_Bar */
 
 
 
 
35
  global $wp_admin_bar;
36
 
37
  // @see: http://codex.wordpress.org/Function_Reference/get_nodes
38
  $all_toolbar_nodes = $wp_admin_bar->get_nodes();
39
 
40
- $settings = 'mw_adminimize_admin_bar_frontend_nodes';
41
- // Set string on settings for Admin Area.
42
- if ( is_admin() ) {
43
- $settings = 'mw_adminimize_admin_bar_nodes';
44
- }
45
-
46
  if ( $all_toolbar_nodes ) {
47
 
48
- // get all options
49
- $adminimizeoptions = _mw_adminimize_get_option_value();
 
 
 
 
 
 
50
 
51
- // add admin bar array
52
  $adminimizeoptions[ $settings ] = $all_toolbar_nodes;
53
 
54
- // update options
55
  _mw_adminimize_update_option( $adminimizeoptions );
56
  }
57
  }
@@ -85,23 +90,24 @@ function _mw_adminimize_change_admin_bar() {
85
  return;
86
  }
87
 
88
- /** @var $wp_admin_bar WP_Admin_Bar */
 
 
 
 
89
  global $wp_admin_bar;
90
 
91
  // Get current user data.
92
- $user = wp_get_current_user();
93
  if ( ! $user->roles ) {
94
  return;
95
  }
96
 
97
- // Get all roles of logged in user.
98
- $user_roles = $user->roles;
99
- //$user_roles = _mw_adminimize_get_all_user_roles();
100
  $disabled_admin_bar_option_ = array();
101
 
102
  $role_prefix = is_admin() ? 'mw_adminimize_disabled_admin_bar_' : 'mw_adminimize_disabled_admin_bar_frontend_';
103
 
104
- foreach ( $user_roles as $role ) {
105
  $disabled_admin_bar_option_[] = _mw_adminimize_get_option_value( $role_prefix . $role . '_items' );
106
  }
107
 
1
  <?php
2
  /**
3
+ * Get Admin Bar items and change them.
4
+ *
5
  * @package Adminimize
6
  * @subpackage Admin Bar Items
7
  * @author Frank Bültge
33
  return;
34
  }
35
 
36
+ /**
37
+ * Link to Admin Bar class to get the methods.
38
+ *
39
+ * @var $wp_admin_bar \WP_Admin_Bar
40
+ */
41
  global $wp_admin_bar;
42
 
43
  // @see: http://codex.wordpress.org/Function_Reference/get_nodes
44
  $all_toolbar_nodes = $wp_admin_bar->get_nodes();
45
 
 
 
 
 
 
 
46
  if ( $all_toolbar_nodes ) {
47
 
48
+ $settings = 'mw_adminimize_admin_bar_frontend_nodes';
49
+ // Set string on settings for Admin Area.
50
+ if ( is_admin() ) {
51
+ $settings = 'mw_adminimize_admin_bar_nodes';
52
+ }
53
+
54
+ // get all options.
55
+ $adminimizeoptions = (array) _mw_adminimize_get_option_value();
56
 
57
+ // add admin bar array.
58
  $adminimizeoptions[ $settings ] = $all_toolbar_nodes;
59
 
 
60
  _mw_adminimize_update_option( $adminimizeoptions );
61
  }
62
  }
90
  return;
91
  }
92
 
93
+ /**
94
+ * Link to Admin Bar class to get the methods.
95
+ *
96
+ * @var $wp_admin_bar \WP_Admin_Bar
97
+ */
98
  global $wp_admin_bar;
99
 
100
  // Get current user data.
101
+ $user = wp_get_current_user();
102
  if ( ! $user->roles ) {
103
  return;
104
  }
105
 
 
 
 
106
  $disabled_admin_bar_option_ = array();
107
 
108
  $role_prefix = is_admin() ? 'mw_adminimize_disabled_admin_bar_' : 'mw_adminimize_disabled_admin_bar_frontend_';
109
 
110
+ foreach ( $user->roles as $role ) {
111
  $disabled_admin_bar_option_[] = _mw_adminimize_get_option_value( $role_prefix . $role . '_items' );
112
  }
113
 
inc-setup/admin-footer.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
  /**
 
 
3
  * @package Adminimize
4
- * @subpackage Add Hint in Admin Footer
5
  * @author Frank Bültge
6
  */
7
 
@@ -14,13 +16,15 @@ if ( ! is_admin() ) {
14
  return;
15
  }
16
 
17
- // If is AJAX Call.
18
- if ( defined('DOING_AJAX') && DOING_AJAX ) {
19
  return;
20
  }
21
 
22
- // on init of WordPress
23
  add_action( 'admin_init', '_mw_adminimize_init_admin_footer' );
 
 
 
24
  function _mw_adminimize_init_admin_footer() {
25
 
26
  if ( (int) _mw_adminimize_get_option_value( '_mw_adminimize_advice' ) === 1 ) {
@@ -33,5 +37,5 @@ function _mw_adminimize_init_admin_footer() {
33
  */
34
  function _mw_adminimize_add_admin_footer() {
35
 
36
- echo _mw_adminimize_get_option_value( '_mw_adminimize_advice_txt' ) . '<br />';
37
- }
1
  <?php
2
  /**
3
+ * Add Hints in Admin Footer.
4
+ *
5
  * @package Adminimize
6
+ * @subpackage Add Hints in Admin Footer
7
  * @author Frank Bültge
8
  */
9
 
16
  return;
17
  }
18
 
19
+ // If is an AJAX Call.
20
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
21
  return;
22
  }
23
 
 
24
  add_action( 'admin_init', '_mw_adminimize_init_admin_footer' );
25
+ /**
26
+ * Hook in to admin footer to print message.
27
+ */
28
  function _mw_adminimize_init_admin_footer() {
29
 
30
  if ( (int) _mw_adminimize_get_option_value( '_mw_adminimize_advice' ) === 1 ) {
37
  */
38
  function _mw_adminimize_add_admin_footer() {
39
 
40
+ echo esc_html( _mw_adminimize_get_option_value( '_mw_adminimize_advice_txt' ) ) . '<br />';
41
+ }
inc-setup/dashboard.php CHANGED
@@ -29,17 +29,17 @@ function _mw_adminimize_update_dashboard_widgets() {
29
 
30
  // Only manage options users have the chance to update the settings.
31
  if ( ! current_user_can( 'manage_options' ) ) {
32
- return FALSE;
33
  }
34
 
35
- $adminimizeoptions = _mw_adminimize_get_option_value();
36
- $adminimizeoptions[ 'mw_adminimize_dashboard_widgets' ] = _mw_adminimize_get_dashboard_widgets();
37
 
38
  return _mw_adminimize_update_option( $adminimizeoptions );
39
  }
40
 
41
  // Return registered widgets; only on page index/dashboard :(
42
- add_action( 'wp_dashboard_setup', '_mw_adminimize_dashboard_setup', 9999 );
43
  /**
44
  * Set dashboard widget options.
45
  */
@@ -50,48 +50,39 @@ function _mw_adminimize_dashboard_setup() {
50
  return;
51
  }
52
 
53
- $user_roles = _mw_adminimize_get_all_user_roles();
54
-
 
 
55
  $disabled_dashboard_option_ = array();
 
 
 
56
  foreach ( $user_roles as $role ) {
57
- $disabled_dashboard_option_[ $role ] = _mw_adminimize_get_option_value(
58
  'mw_adminimize_disabled_dashboard_option_' . $role . '_items'
59
  );
60
  }
61
 
62
- $user = wp_get_current_user();
63
- // Support Multiple Roles for users.
64
- if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
65
- $disabled_dashboard_option_ = _mw_adminimize_get_duplicate( $disabled_dashboard_option_ );
66
- }
67
-
68
  foreach ( $user_roles as $role ) {
69
- if ( ! isset( $disabled_dashboard_option_[ $role ][ '0' ] ) ) {
70
- $disabled_dashboard_option_[ $role ][ '0' ] = '';
 
 
 
 
71
  }
72
  }
73
 
74
- // Get all widgets.
75
- $widgets = _mw_adminimize_get_dashboard_widgets();
76
- // Get current user data.
77
- $user = wp_get_current_user();
78
- // If the current user is not inside the roles, abort.
79
- if ( ! $user->roles ) {
80
- return;
81
  }
82
 
83
- foreach ( $user_roles as $role ) {
84
-
85
- if ( is_array( $user->roles )
86
- && is_array( $disabled_dashboard_option_[ $role ] )
87
- && in_array( $role, $user->roles, TRUE )
88
- && _mw_adminimize_current_user_has_role( $role )
89
- ) {
90
- foreach ( (array) $disabled_dashboard_option_[ $role ] as $widget ) {
91
- if ( isset( $widgets[ $widget ][ 'context' ] ) ) {
92
- remove_meta_box( $widget, 'dashboard', $widgets[ $widget ][ 'context' ] );
93
- }
94
- }
95
  }
96
  }
97
 
@@ -133,11 +124,11 @@ function _mw_adminimize_remove_custom_panels() {
133
  $disabled_dashboard_option_ = _mw_adminimize_get_duplicate( $disabled_dashboard_option_ );
134
  }
135
 
136
- if ( empty( $disabled_dashboard_option_[ 0 ] ) ) {
137
  return;
138
  }
139
 
140
- $selectors = implode( ', ', $disabled_dashboard_option_[ 0 ] );
141
  echo '<!-- Set Adminimize dashboard options -->' . "\n";
142
  echo '<style type="text/css">' . esc_attr( $selectors ) . ' {display:none !important;}</style>' . "\n";
143
  }
@@ -152,17 +143,17 @@ function _mw_adminimize_get_dashboard_widgets() {
152
  global $wp_meta_boxes;
153
 
154
  $widgets = array();
155
- if ( ! isset( $wp_meta_boxes[ 'dashboard' ] ) ) {
156
  return $widgets;
157
  }
158
 
159
- foreach ( (array) $wp_meta_boxes[ 'dashboard' ] as $context => $datas ) {
160
  foreach ( (array) $datas as $priority => $data ) {
161
  foreach ( (array) $data as $widget => $value ) {
162
  $widgets[ $widget ] = array(
163
  'id' => $widget,
164
  'title' => strip_tags(
165
- preg_replace( '/( |)<span.*span>/im', '', $value[ 'title' ] )
166
  ),
167
  'context' => $context,
168
  'priority' => $priority,
29
 
30
  // Only manage options users have the chance to update the settings.
31
  if ( ! current_user_can( 'manage_options' ) ) {
32
+ return false;
33
  }
34
 
35
+ $adminimizeoptions = _mw_adminimize_get_option_value();
36
+ $adminimizeoptions['mw_adminimize_dashboard_widgets'] = _mw_adminimize_get_dashboard_widgets();
37
 
38
  return _mw_adminimize_update_option( $adminimizeoptions );
39
  }
40
 
41
  // Return registered widgets; only on page index/dashboard :(
42
+ add_action( 'wp_dashboard_setup', '_mw_adminimize_dashboard_setup', PHP_INT_MAX );
43
  /**
44
  * Set dashboard widget options.
45
  */
50
  return;
51
  }
52
 
53
+ // Get all widgets.
54
+ $widgets = _mw_adminimize_get_dashboard_widgets();
55
+ $user_roles = _mw_adminimize_get_all_user_roles();
56
+ $disabled_dashboard_option = array();
57
  $disabled_dashboard_option_ = array();
58
+ $user = wp_get_current_user();
59
+
60
+ // Get settings for each role.
61
  foreach ( $user_roles as $role ) {
62
+ $disabled_dashboard_option_[ $role ] = (array) _mw_adminimize_get_option_value(
63
  'mw_adminimize_disabled_dashboard_option_' . $role . '_items'
64
  );
65
  }
66
 
 
 
 
 
 
 
67
  foreach ( $user_roles as $role ) {
68
+ if ( in_array( $role, $user->roles, false ) && _mw_adminimize_current_user_has_role( $role )
69
+ ) {
70
+ // Create array about all items with all affected roles, important for multiple roles.
71
+ foreach ( (array) $disabled_dashboard_option_[ $role ] as $dashboard_item ) {
72
+ $disabled_dashboard_option[] = $dashboard_item;
73
+ }
74
  }
75
  }
76
 
77
+ // Support Multiple Roles for users, if option is active.
78
+ if ( _mw_adminimize_get_option_value( 'mw_adminimize_multiple_roles' ) && 1 < count( $user->roles ) ) {
79
+ $disabled_dashboard_option = _mw_adminimize_get_duplicate( $disabled_dashboard_option );
 
 
 
 
80
  }
81
 
82
+ // Remove the dashboards widgets for the current active role.
83
+ foreach ( (array) $disabled_dashboard_option as $widget ) {
84
+ if ( isset( $widgets[ $widget ]['context'] ) ) {
85
+ remove_meta_box( $widget, 'dashboard', $widgets[ $widget ]['context'] );
 
 
 
 
 
 
 
 
86
  }
87
  }
88
 
124
  $disabled_dashboard_option_ = _mw_adminimize_get_duplicate( $disabled_dashboard_option_ );
125
  }
126
 
127
+ if ( empty( $disabled_dashboard_option_[0] ) ) {
128
  return;
129
  }
130
 
131
+ $selectors = implode( ', ', $disabled_dashboard_option_[0] );
132
  echo '<!-- Set Adminimize dashboard options -->' . "\n";
133
  echo '<style type="text/css">' . esc_attr( $selectors ) . ' {display:none !important;}</style>' . "\n";
134
  }
143
  global $wp_meta_boxes;
144
 
145
  $widgets = array();
146
+ if ( ! isset( $wp_meta_boxes['dashboard'] ) ) {
147
  return $widgets;
148
  }
149
 
150
+ foreach ( (array) $wp_meta_boxes['dashboard'] as $context => $datas ) {
151
  foreach ( (array) $datas as $priority => $data ) {
152
  foreach ( (array) $data as $widget => $value ) {
153
  $widgets[ $widget ] = array(
154
  'id' => $widget,
155
  'title' => strip_tags(
156
+ preg_replace( '/( |)<span.*span>/im', '', $value['title'] )
157
  ),
158
  'context' => $context,
159
  'priority' => $priority,
inc-setup/helping_hands.php CHANGED
@@ -1,10 +1,13 @@
1
  <?php
2
  /**
 
 
3
  * @package Adminimize
4
  * @subpackage Helping_Functions
5
  * @author Frank Bültge <frank@bueltge.de
6
  * @since 2016-01-22
7
  */
 
8
  if ( ! function_exists( 'add_action' ) ) {
9
  die( "Hi there! I'm just a part of plugin, not much I can do when called directly." );
10
  }
@@ -20,11 +23,11 @@ if ( ! function_exists( 'add_action' ) ) {
20
  function _mw_adminimize_recursive_in_array( $needle, $haystack ) {
21
 
22
  if ( '' === $haystack ) {
23
- return FALSE;
24
  }
25
 
26
  if ( ! $haystack ) {
27
- return FALSE;
28
  }
29
 
30
  foreach ( $haystack as $stalk ) {
@@ -33,11 +36,11 @@ function _mw_adminimize_recursive_in_array( $needle, $haystack ) {
33
  && _mw_adminimize_recursive_in_array( $needle, $stalk )
34
  )
35
  ) {
36
- return TRUE;
37
  }
38
  }
39
 
40
- return FALSE;
41
  }
42
 
43
  /**
@@ -63,11 +66,11 @@ function _mw_adminimize_in_arrays( $array1, $array2 ) {
63
  function _mw_adminimize_current_user_has_role( $role ) {
64
 
65
  $user = wp_get_current_user();
66
- if ( in_array( $role, (array) $user->roles, FALSE ) ) {
67
- return TRUE;
68
  }
69
 
70
- return FALSE;
71
  }
72
 
73
  /**
@@ -75,14 +78,14 @@ function _mw_adminimize_current_user_has_role( $role ) {
75
  * Set WP_DEBUG_DISPLAY in your wp-config.php to true for view debug messages inside the console.
76
  *
77
  * @param string | array | object
78
- * @param string $description
79
  *
80
  * @return string|void
81
  */
82
  function _mw_adminimize_debug( $data, $description = '' ) {
83
 
84
  // Don't run on export data of Adminimize settings.
85
- if ( isset( $_POST[ '_mw_adminimize_export' ] ) ) {
86
  return;
87
  }
88
 
@@ -96,9 +99,9 @@ function _mw_adminimize_debug( $data, $description = '' ) {
96
 
97
  // Buffering to solve problems with WP core, header() etc.
98
  ob_start();
99
- $output = 'console.info(' . json_encode( $description ) . ');';
100
  $output .= 'console.log(' . json_encode( $data ) . ');';
101
- $output = sprintf( '<script>%s</script>', $output );
102
 
103
  echo $output;
104
  }
@@ -112,9 +115,7 @@ function _mw_adminimize_debug( $data, $description = '' ) {
112
  */
113
  function _mw_adminimize_get_duplicate( $array ) {
114
 
115
- return array_unique(
116
- array_diff_assoc( $array, array_unique( $array ) )
117
- );
118
  }
119
 
120
  /**
@@ -165,32 +166,32 @@ function _mw_adminimize_check_page_access( $slug ) {
165
 
166
  // If this default behavior is deactivated.
167
  if ( _mw_adminimize_get_option_value( 'mw_adminimize_prevent_page_access' ) ) {
168
- return FALSE;
169
  }
170
 
171
- $url = basename( esc_url_raw( $_SERVER[ 'REQUEST_URI' ] ) );
172
  $url = htmlspecialchars( $url );
173
 
174
  if ( ! isset( $url ) ) {
175
- return FALSE;
176
  }
177
 
178
- $uri = parse_url( $url );
179
 
180
- if ( ! isset( $uri[ 'path' ] ) ) {
181
- return FALSE;
182
  }
183
 
184
  // URI without query parameter, like WP core edit.php.
185
- if ( ! isset( $uri[ 'query' ] ) && strpos( $uri[ 'path' ], $slug ) !== FALSE ) {
186
  add_action( 'load-' . $slug, '_mw_adminimize_block_page_access' );
187
- return TRUE;
188
  }
189
 
190
  // URL is equal the slug of WP menu.
191
  if ( $slug === $url ) {
192
- add_action( 'load-' . basename( $uri[ 'path' ] ), '_mw_adminimize_block_page_access' );
193
- return TRUE;
194
  }
195
  }
196
 
@@ -203,5 +204,26 @@ function _mw_adminimize_block_page_access() {
203
 
204
  $message = esc_attr__( 'Cheatin&#8217; uh? Sorry, you are not allowed to access this site.', 'adminimize' );
205
  $message = apply_filters( 'adminimize_nopage_access_message', $message );
206
- wp_die( $message );
207
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
  /**
3
+ * Helper functions.
4
+ *
5
  * @package Adminimize
6
  * @subpackage Helping_Functions
7
  * @author Frank Bültge <frank@bueltge.de
8
  * @since 2016-01-22
9
  */
10
+
11
  if ( ! function_exists( 'add_action' ) ) {
12
  die( "Hi there! I'm just a part of plugin, not much I can do when called directly." );
13
  }
23
  function _mw_adminimize_recursive_in_array( $needle, $haystack ) {
24
 
25
  if ( '' === $haystack ) {
26
+ return false;
27
  }
28
 
29
  if ( ! $haystack ) {
30
+ return false;
31
  }
32
 
33
  foreach ( $haystack as $stalk ) {
36
  && _mw_adminimize_recursive_in_array( $needle, $stalk )
37
  )
38
  ) {
39
+ return true;
40
  }
41
  }
42
 
43
+ return false;
44
  }
45
 
46
  /**
66
  function _mw_adminimize_current_user_has_role( $role ) {
67
 
68
  $user = wp_get_current_user();
69
+ if ( in_array( $role, (array) $user->roles, true ) ) {
70
+ return true;
71
  }
72
 
73
+ return false;
74
  }
75
 
76
  /**
78
  * Set WP_DEBUG_DISPLAY in your wp-config.php to true for view debug messages inside the console.
79
  *
80
  * @param string | array | object
81
+ * @param string $description
82
  *
83
  * @return string|void
84
  */
85
  function _mw_adminimize_debug( $data, $description = '' ) {
86
 
87
  // Don't run on export data of Adminimize settings.
88
+ if ( isset( $_POST['_mw_adminimize_export'] ) ) {
89
  return;
90
  }
91
 
99
 
100
  // Buffering to solve problems with WP core, header() etc.
101
  ob_start();
102
+ $output = 'console.info(' . json_encode( $description ) . ');';
103
  $output .= 'console.log(' . json_encode( $data ) . ');';
104
+ $output = sprintf( '<script>%s</script>', $output );
105
 
106
  echo $output;
107
  }
115
  */
116
  function _mw_adminimize_get_duplicate( $array ) {
117
 
118
+ return array_unique( array_map( 'unserialize', array_diff_assoc( array_map( 'serialize', $array), array_map( 'serialize', array_unique( $array, SORT_REGULAR ) ) ) ), SORT_REGULAR );
 
 
119
  }
120
 
121
  /**
166
 
167
  // If this default behavior is deactivated.
168
  if ( _mw_adminimize_get_option_value( 'mw_adminimize_prevent_page_access' ) ) {
169
+ return false;
170
  }
171
 
172
+ $url = basename( esc_url_raw( $_SERVER['REQUEST_URI'] ) );
173
  $url = htmlspecialchars( $url );
174
 
175
  if ( ! isset( $url ) ) {
176
+ return false;
177
  }
178
 
179
+ $uri = wp_parse_url( $url );
180
 
181
+ if ( ! isset( $uri['path'] ) ) {
182
+ return false;
183
  }
184
 
185
  // URI without query parameter, like WP core edit.php.
186
+ if ( ! isset( $uri['query'] ) && strpos( $uri['path'], $slug ) !== false ) {
187
  add_action( 'load-' . $slug, '_mw_adminimize_block_page_access' );
188
+ return true;
189
  }
190
 
191
  // URL is equal the slug of WP menu.
192
  if ( $slug === $url ) {
193
+ add_action( 'load-' . basename( $uri['path'] ), '_mw_adminimize_block_page_access' );
194
+ return true;
195
  }
196
  }
197
 
204
 
205
  $message = esc_attr__( 'Cheatin&#8217; uh? Sorry, you are not allowed to access this site.', 'adminimize' );
206
  $message = apply_filters( 'adminimize_nopage_access_message', $message );
207
+ wp_die( esc_html( $message ) );
208
+ }
209
+
210
+ /**
211
+ * Check option value string in array and get string back for active checkboxes.
212
+ *
213
+ * @param string $option String of option to check.
214
+ * @param array $haystack Array of all options.
215
+ *
216
+ * @return string String for checked input box or empty string.
217
+ */
218
+ function _mw_adminimize_is_checked( $option, $haystack ) {
219
+
220
+ if ( ! isset( $haystack ) ) {
221
+ return '';
222
+ }
223
+
224
+ if ( in_array( htmlspecialchars_decode( $option ), $haystack, true ) ) {
225
+ return ' checked="checked"';
226
+ }
227
+
228
+ return '';
229
+ }
inc-setup/import.php CHANGED
@@ -54,7 +54,6 @@ function _mw_adminimize_import_json() {
54
 
55
  $extension_allow = array( 'json', 'text/plain', 'text/html' );
56
  if ( false !== $extension && ! in_array( $extension, $extension_allow, false ) ) {
57
- var_dump('test');var_dump($extension);
58
  wp_die(
59
  sprintf(
60
  esc_attr__( 'Please upload a valid .json file, Extension check. Your file have the extension %s.', 'adminimize' ),
@@ -79,5 +78,6 @@ function _mw_adminimize_import_json() {
79
  unlink( $path );
80
 
81
  _mw_adminimize_update_option( $settings );
82
- wp_safe_redirect( get_option( 'siteurl' ) . '/wp-admin/options-general.php?page=adminimize-options' );
 
83
  }
54
 
55
  $extension_allow = array( 'json', 'text/plain', 'text/html' );
56
  if ( false !== $extension && ! in_array( $extension, $extension_allow, false ) ) {
 
57
  wp_die(
58
  sprintf(
59
  esc_attr__( 'Please upload a valid .json file, Extension check. Your file have the extension %s.', 'adminimize' ),
78
  unlink( $path );
79
 
80
  _mw_adminimize_update_option( $settings );
81
+ wp_safe_redirect( esc_url( site_url('/wp-admin/options-general.php?page=adminimize-options') ) );
82
+ exit();
83
  }
inc-setup/messages.php CHANGED
@@ -12,7 +12,7 @@ if ( ! is_admin() ) {
12
  }
13
 
14
  // If is AJAX Call.
15
- if ( defined('DOING_AJAX') && DOING_AJAX ) {
16
  return;
17
  }
18
 
@@ -23,7 +23,7 @@ class _mw_adminimize_message_class {
23
  */
24
  public function __construct() {
25
 
26
- $this->errors = new WP_Error();
27
  $this->initialize_errors();
28
  }
29
 
12
  }
13
 
14
  // If is AJAX Call.
15
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
16
  return;
17
  }
18
 
23
  */
24
  public function __construct() {
25
 
26
+ $this->errors = new WP_Error();
27
  $this->initialize_errors();
28
  }
29
 
inc-setup/remove-admin-bar.php CHANGED
@@ -1,15 +1,18 @@
1
  <?php
2
  /**
 
 
3
  * @package Adminimize
4
  * @subpackage Remove Admin Bar of > WP 3.3 Setup
5
  * @author Frank Bültge
6
  */
 
7
  if ( ! function_exists( 'add_action' ) ) {
8
  echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
9
  exit;
10
  }
11
 
12
- // on init of WordPress
13
  add_action( 'init', '_mw_adminimize_remove_admin_bar', 0 );
14
 
15
  /**
@@ -23,6 +26,11 @@ function _mw_adminimize_customize_admin_bar( array $admin_bar_keys ) {
23
  return;
24
  }
25
 
 
 
 
 
 
26
  global $wp_admin_bar;
27
 
28
  foreach ( $admin_bar_keys as $key ) {
@@ -30,7 +38,7 @@ function _mw_adminimize_customize_admin_bar( array $admin_bar_keys ) {
30
  }
31
  }
32
 
33
- /*
34
  * Remove my account item in admin bar >3.3
35
  */
36
  function _mw_adminimize_remove_my_account() {
@@ -120,7 +128,7 @@ function _mw_adminimize_set_logout_menu() {
120
  return;
121
  }
122
 
123
- // exclude super admin
124
  if ( _mw_adminimize_exclude_super_admin() ) {
125
  return;
126
  }
@@ -142,7 +150,7 @@ function _mw_adminimize_set_logout_menu() {
142
  }
143
 
144
  $_mw_adminimize_user_info = (int) _mw_adminimize_get_option_value( '_mw_adminimize_user_info' );
145
- // change user-info
146
  switch ( $_mw_adminimize_user_info ) {
147
  case 1:
148
  add_action( 'wp_before_admin_bar_render', '_mw_adminimize_remove_my_account' );
@@ -173,7 +181,7 @@ function _mw_adminimize_remove_admin_bar() {
173
  return;
174
  }
175
 
176
- // exclude super admin
177
  if ( _mw_adminimize_exclude_super_admin() ) {
178
  return;
179
  }
@@ -183,7 +191,7 @@ function _mw_adminimize_remove_admin_bar() {
183
  return;
184
  }
185
 
186
- $user_roles = _mw_adminimize_get_all_user_roles();
187
  $disabled_global_option_ = array();
188
 
189
  foreach ( $user_roles as $role ) {
@@ -193,19 +201,18 @@ function _mw_adminimize_remove_admin_bar() {
193
  }
194
 
195
  $mw_global_options = array();
196
- $user = wp_get_current_user();
197
 
198
  foreach ( $user_roles as $role ) {
199
 
200
- if ( in_array( $role, $user->roles, FALSE )
201
- && _mw_adminimize_current_user_has_role( $role )
202
  ) {
203
  // Create array about all items with all affected roles, important for multiple roles.
204
  foreach ( $disabled_global_option_[ $role ] as $global_item ) {
205
  $mw_global_options[] = $global_item;
206
  }
207
  }
208
-
209
  }
210
 
211
  // Support Multiple Roles for users.
@@ -213,10 +220,10 @@ function _mw_adminimize_remove_admin_bar() {
213
  $mw_global_options = _mw_adminimize_get_duplicate( $mw_global_options );
214
  }
215
 
216
- $remove_adminbar = FALSE;
217
  // Check for admin bar selector to set to remove the Admin Bar.
218
  if ( _mw_adminimize_recursive_in_array( '.show-admin-bar', $mw_global_options ) ) {
219
- $remove_adminbar = TRUE;
220
  }
221
 
222
  if ( $remove_adminbar ) {
@@ -233,19 +240,18 @@ function _mw_adminimize_remove_admin_bar() {
233
  remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
234
  remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
235
 
236
- // maybe also: 'wp_head'
237
  foreach ( array( 'wp_head', 'admin_head' ) as $hook ) {
238
  add_action(
239
  $hook,
240
- create_function(
241
- '',
242
- "echo '<style>body.admin-bar, body.admin-bar #wpcontent, body.admin-bar #adminmenu {
243
- padding-top: 0 !important;
244
- }
245
- html.wp-toolbar {
246
- padding-top: 0 !important;
247
- }</style>';"
248
- )
249
  );
250
  }
251
 
@@ -291,9 +297,10 @@ function _mw_adminimize_restore_links() {
291
  }
292
  </style>
293
  <div id="mw_adminimize_admin_bar">
294
- <?php echo '<a id="mw_title" href="' . home_url() . '" title="' . esc_attr__(
295
- get_bloginfo( 'name' )
296
- ) . '" target="_blank">' . get_bloginfo( 'name' ) . '</a>';
 
297
  ?>
298
  <div id="mw_adminimize_login">
299
  <?php
@@ -309,12 +316,12 @@ function _mw_adminimize_restore_links() {
309
  if ( is_multisite() && is_super_admin() ) {
310
  if ( ! is_network_admin() ) {
311
  echo '| <a href="' . network_admin_url() . '" title="' . esc_attr__(
312
- 'Network Admin'
313
- ) . '">' . esc_attr__( 'Network Admin' ) . '</a>';
314
  } else {
315
  echo '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__(
316
- 'Site Admin'
317
- ) . '">' . esc_attr__( 'Site Admin' ) . '</a>';
318
  }
319
  }
320
  }
@@ -323,7 +330,10 @@ function _mw_adminimize_restore_links() {
323
  || 2 === $_mw_adminimize_user_info
324
  || 3 === $_mw_adminimize_user_info
325
  ) {
326
- ?> | <?php echo '<a href="' . wp_logout_url() . '" title="' . esc_attr__(
 
 
 
327
  'Log Out'
328
  ) . '">' . esc_attr__(
329
  'Log Out'
1
  <?php
2
  /**
3
+ * Functions to remove the admin bar.
4
+ *
5
  * @package Adminimize
6
  * @subpackage Remove Admin Bar of > WP 3.3 Setup
7
  * @author Frank Bültge
8
  */
9
+
10
  if ( ! function_exists( 'add_action' ) ) {
11
  echo "Hi there! I'm just a part of plugin, not much I can do when called directly.";
12
  exit;
13
  }
14
 
15
+ // on init of WordPress.
16
  add_action( 'init', '_mw_adminimize_remove_admin_bar', 0 );
17
 
18
  /**
26
  return;
27
  }
28
 
29
+ /**
30
+ * Reference to the doc to know the method.
31
+ *
32
+ * @var \WP_Admin_Bar $wp_admin_bar
33
+ */
34
  global $wp_admin_bar;
35
 
36
  foreach ( $admin_bar_keys as $key ) {
38
  }
39
  }
40
 
41
+ /**
42
  * Remove my account item in admin bar >3.3
43
  */
44
  function _mw_adminimize_remove_my_account() {
128
  return;
129
  }
130
 
131
+ // exclude super admin.
132
  if ( _mw_adminimize_exclude_super_admin() ) {
133
  return;
134
  }
150
  }
151
 
152
  $_mw_adminimize_user_info = (int) _mw_adminimize_get_option_value( '_mw_adminimize_user_info' );
153
+ // change user-info.
154
  switch ( $_mw_adminimize_user_info ) {
155
  case 1:
156
  add_action( 'wp_before_admin_bar_render', '_mw_adminimize_remove_my_account' );
181
  return;
182
  }
183
 
184
+ // exclude super admin.
185
  if ( _mw_adminimize_exclude_super_admin() ) {
186
  return;
187
  }
191
  return;
192
  }
193
 
194
+ $user_roles = _mw_adminimize_get_all_user_roles();
195
  $disabled_global_option_ = array();
196
 
197
  foreach ( $user_roles as $role ) {
201
  }
202
 
203
  $mw_global_options = array();
204
+ $user = wp_get_current_user();
205
 
206
  foreach ( $user_roles as $role ) {
207
 
208
+ if ( in_array( $role, $user->roles, true )
209
+ && _mw_adminimize_current_user_has_role( $role )
210
  ) {
211
  // Create array about all items with all affected roles, important for multiple roles.
212
  foreach ( $disabled_global_option_[ $role ] as $global_item ) {
213
  $mw_global_options[] = $global_item;
214
  }
215
  }
 
216
  }
217
 
218
  // Support Multiple Roles for users.
220
  $mw_global_options = _mw_adminimize_get_duplicate( $mw_global_options );
221
  }
222
 
223
+ $remove_adminbar = false;
224
  // Check for admin bar selector to set to remove the Admin Bar.
225
  if ( _mw_adminimize_recursive_in_array( '.show-admin-bar', $mw_global_options ) ) {
226
+ $remove_adminbar = true;
227
  }
228
 
229
  if ( $remove_adminbar ) {
240
  remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 );
241
  remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 );
242
 
243
+ // maybe also: 'wp_head'.
244
  foreach ( array( 'wp_head', 'admin_head' ) as $hook ) {
245
  add_action(
246
  $hook,
247
+ function() {
248
+ echo '<style>body.admin-bar, body.admin-bar #wpcontent, body.admin-bar #adminmenu {
249
+ padding-top: 0 !important;
250
+ }
251
+ html.wp-toolbar {
252
+ padding-top: 0 !important;
253
+ }</style>';
254
+ }
 
255
  );
256
  }
257
 
297
  }
298
  </style>
299
  <div id="mw_adminimize_admin_bar">
300
+ <?php
301
+ echo '<a id="mw_title" href="' . home_url() . '" title="' . esc_attr__(
302
+ get_bloginfo( 'name' )
303
+ ) . '" target="_blank">' . get_bloginfo( 'name' ) . '</a>';
304
  ?>
305
  <div id="mw_adminimize_login">
306
  <?php
316
  if ( is_multisite() && is_super_admin() ) {
317
  if ( ! is_network_admin() ) {
318
  echo '| <a href="' . network_admin_url() . '" title="' . esc_attr__(
319
+ 'Network Admin'
320
+ ) . '">' . esc_attr__( 'Network Admin' ) . '</a>';
321
  } else {
322
  echo '| <a href="' . get_dashboard_url( get_current_user_id() ) . '" title="' . esc_attr__(
323
+ 'Site Admin'
324
+ ) . '">' . esc_attr__( 'Site Admin' ) . '</a>';
325
  }
326
  }
327
  }
330
  || 2 === $_mw_adminimize_user_info
331
  || 3 === $_mw_adminimize_user_info
332
  ) {
333
+ ?>
334
+ |
335
+ <?php
336
+ echo '<a href="' . wp_logout_url() . '" title="' . esc_attr__(
337
  'Log Out'
338
  ) . '">' . esc_attr__(
339
  'Log Out'
js/adminimize.js CHANGED
@@ -22,4 +22,19 @@ jQuery( document ).ready( function( $ ) {
22
  e.preventDefault();
23
  } );
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  } );
22
  e.preventDefault();
23
  } );
24
 
25
+ // Close every box other than the first, to keep the page clean.
26
+ $('.postbox:not(:first)').addClass('closed');
27
+
28
+ // Open the box when the user clicks the shortcut
29
+ $('#minimenu a').on('click',function(e){
30
+ var ID = $(this).attr('href');
31
+ $(ID).closest( '.postbox' ).removeClass('closed');
32
+ });
33
+
34
+ // Scroll to top
35
+ $('.adminimize-scroltop').on('click',function(e){
36
+ e.preventDefault();
37
+ $('html,body').animate({scrollTop:0},700);
38
+ });
39
+
40
  } );
js/adminimize.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(a){"use strict";a("thead input:checkbox").change(function(){var b=this.className,c="input:checkbox."+b;a(c).prop("checked",a(this).prop("checked"))}),a(".postbox h3").on("click",function(b){a(this).closest(".postbox").toggleClass("closed"),b.preventDefault()})});
1
+ jQuery(document).ready(function(a){"use strict";a("thead input:checkbox").change(function(){var b=this.className,c="input:checkbox."+b;a(c).prop("checked",a(this).prop("checked"))}),a(".postbox h3").on("click",function(b){a(this).closest(".postbox").toggleClass("closed"),b.preventDefault()}),a('.postbox:not(:first)').addClass('closed'),a('#minimenu a').on('click',function(e){var ID=a(this).attr('href');a(ID).closest('.postbox').removeClass('closed');}),a('.adminimize-scroltop').on('click',function(e){e.preventDefault();a('html,body').animate({scrollTop:0},700);});});
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Bueltge, inpsyde
3
  Donate link: https://www.paypal.me/FrankBueltge
4
  Tags: color, scheme, theme, admin, dashboard, color scheme, plugin, interface, ui, metabox, hide, editor, minimal, menu, customization, interface, administration, lite, light, usability, lightweight, layout, zen
5
  Requires at least: 4.0
6
- Tested up to: 4.9
7
- Stable tag: 1.11.4
8
 
9
  Adminimize that lets you hide 'unnecessary' items from the WordPress backend
10
 
@@ -40,6 +40,16 @@ Use the installer via back-end of your install or ...
40
  4. Administrator can go to `Settings` > `Adminimize` menu and configure the plugin (Menu, Sub-menu, Meta boxes, ...)
41
 
42
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
43
  1.11.4 (2017-12-14)
44
  * Fixed hide of menu items, if you use custom menu, see [wiki page](https://github.com/bueltge/Adminimize/wiki/Custom-Menu-Order)
45
  * Fixed Import/Export for different server environments.
3
  Donate link: https://www.paypal.me/FrankBueltge
4
  Tags: color, scheme, theme, admin, dashboard, color scheme, plugin, interface, ui, metabox, hide, editor, minimal, menu, customization, interface, administration, lite, light, usability, lightweight, layout, zen
5
  Requires at least: 4.0
6
+ Tested up to: 5.2
7
+ Stable tag: 1.11.5
8
 
9
  Adminimize that lets you hide 'unnecessary' items from the WordPress backend
10
 
40
  4. Administrator can go to `Settings` > `Adminimize` menu and configure the plugin (Menu, Sub-menu, Meta boxes, ...)
41
 
42
  == Changelog ==
43
+ 1.11.5 (2019-07-07)
44
+ * Fixed: Remove deprecated version for support of php 7.2 #109.
45
+ * Fixed: Dashboard removels for multible roles.
46
+ * Fixed: settings link.
47
+ * Maintenance: More solid page checks, codex issues.
48
+ * Maintenance: Remove Javascript for the settings page for scrolling top, simplify.
49
+ * Fixed: A little bid spelling is now fixed.
50
+ * Feature: Close every box other than the first, to keep the page clean.
51
+ # Fixed: Hide Meta Boxes on usage of multiple roles, Probs @filipecsweb.
52
+
53
  1.11.4 (2017-12-14)
54
  * Fixed hide of menu items, if you use custom menu, see [wiki page](https://github.com/bueltge/Adminimize/wiki/Custom-Menu-Order)
55
  * Fixed Import/Export for different server environments.