Version Description
- Added support for OpenDocuments (does not include the graphic files within OpenDocument standards because this would not fit the document focus of this plugin)
Download this release
Release Info
Developer | dan.rossiter |
Plugin | Document Gallery |
Version | 0.8.5 |
Comparing to | |
See all releases |
Code changes from version 2.2.5 to 0.8.5
- LICENSE.txt +0 -339
- README.txt +0 -681
- admin/class-admin.php +0 -984
- assets/css/admin.css +0 -288
- assets/css/style.css +0 -65
- assets/icons/asc.png +0 -0
- assets/icons/audio.png +0 -0
- assets/icons/c.png +0 -0
- assets/icons/compressed.png +0 -0
- assets/icons/cpp.png +0 -0
- assets/icons/css.png +0 -0
- assets/icons/exec.png +0 -0
- assets/icons/h.png +0 -0
- assets/icons/html.png +0 -0
- assets/icons/ics.png +0 -0
- assets/icons/image.png +0 -0
- assets/icons/java.png +0 -0
- assets/icons/javascript.png +0 -0
- assets/icons/key.png +0 -0
- assets/icons/midi.png +0 -0
- assets/icons/missing.png +0 -0
- assets/icons/msaccess.png +0 -0
- assets/icons/msdoc.png +0 -0
- assets/icons/msppt.png +0 -0
- assets/icons/msxls.png +0 -0
- assets/icons/numbers.png +0 -0
- assets/icons/opendocument-graphics.png +0 -0
- assets/icons/opendocument-text.png +0 -0
- assets/icons/pages.png +0 -0
- assets/icons/pdf.png +0 -0
- assets/icons/rtf.png +0 -0
- assets/icons/rtx.png +0 -0
- assets/icons/shockwave.png +0 -0
- assets/icons/text.png +0 -0
- assets/icons/video.png +0 -0
- assets/icons/wordperfect.png +0 -0
- assets/js/admin.js +0 -93
- document-gallery.php +151 -357
- images/MSWD.png +0 -0
- images/PPT3.png +0 -0
- images/PowerPoint.png +0 -0
- images/Thumbs.db +0 -0
- images/XCEL.png +0 -0
- images/XLS8.png +0 -0
- images/excel.png +0 -0
- images/iTunes.png +0 -0
- images/mp3.png +0 -0
- assets/icons/opendocument-database.png → images/open-database.png +0 -0
- assets/icons/opendocument-formula.png → images/open-formula.png +0 -0
- assets/icons/opendocument-presentation.png → images/open-presentation.png +0 -0
- assets/icons/opendocument-spreadsheet.png → images/open-spreadsheet.png +0 -0
- images/open-text.png +0 -0
- images/pdf.png +0 -0
- images/word.png +0 -0
- images/zip.png +0 -0
- images/zip2.png +0 -0
- inc/class-document.php +0 -85
- inc/class-gallery.php +0 -656
- inc/class-image-editor-imagick.php +0 -66
- inc/class-logger.php +0 -228
- inc/class-setup.php +0 -284
- inc/class-thumber.php +0 -818
- languages/document-gallery-es_ES.mo +0 -0
- languages/document-gallery-es_ES.po +0 -264
- languages/document-gallery-fr_FR.mo +0 -0
- languages/document-gallery-fr_FR.po +0 -461
- languages/document-gallery-ru_RU.mo +0 -0
- languages/document-gallery-ru_RU.po +0 -432
- languages/document-gallery-sv_SE.mo +0 -0
- languages/document-gallery-sv_SE.po +0 -449
- languages/document-gallery-uk_UA.mo +0 -0
- languages/document-gallery-uk_UA.po +0 -432
- languages/document-gallery.pot +0 -414
- log/.htaccess +0 -4
- readme.txt +40 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- style.css +53 -0
LICENSE.txt
DELETED
@@ -1,339 +0,0 @@
|
|
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 |
-
|
282 |
-
How to Apply These Terms to Your New Programs
|
283 |
-
|
284 |
-
If you develop a new program, and you want it to be of the greatest
|
285 |
-
possible use to the public, the best way to achieve this is to make it
|
286 |
-
free software which everyone can redistribute and change under these terms.
|
287 |
-
|
288 |
-
To do so, attach the following notices to the program. It is safest
|
289 |
-
to attach them to the start of each source file to most effectively
|
290 |
-
convey the exclusion of warranty; and each file should have at least
|
291 |
-
the "copyright" line and a pointer to where the full notice is found.
|
292 |
-
|
293 |
-
<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,
|
302 |
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
-
GNU General Public License for more details.
|
305 |
-
|
306 |
-
You should have received a copy of the GNU General Public License along
|
307 |
-
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
-
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
-
|
310 |
-
Also add information on how to contact you by electronic and paper mail.
|
311 |
-
|
312 |
-
If the program is interactive, make it output a short notice like this
|
313 |
-
when it starts in an interactive mode:
|
314 |
-
|
315 |
-
Gnomovision version 69, Copyright (C) year name of author
|
316 |
-
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
-
This is free software, and you are welcome to redistribute it
|
318 |
-
under certain conditions; type `show c' for details.
|
319 |
-
|
320 |
-
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
-
parts of the General Public License. Of course, the commands you use may
|
322 |
-
be called something other than `show w' and `show c'; they could even be
|
323 |
-
mouse-clicks or menu items--whatever suits your program.
|
324 |
-
|
325 |
-
You should also get your employer (if you work as a programmer) or your
|
326 |
-
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
-
necessary. Here is a sample; alter the names:
|
328 |
-
|
329 |
-
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
-
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
-
|
332 |
-
<signature of Ty Coon>, 1 April 1989
|
333 |
-
Ty Coon, President of Vice
|
334 |
-
|
335 |
-
This General Public License does not permit incorporating your program into
|
336 |
-
proprietary programs. If your program is a subroutine library, you may
|
337 |
-
consider it more useful to permit linking proprietary applications with the
|
338 |
-
library. If this is what you want to do, use the GNU Lesser General
|
339 |
-
Public License instead of this License.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.txt
DELETED
@@ -1,681 +0,0 @@
|
|
1 |
-
=== Document Gallery ===
|
2 |
-
Contributors: dan.rossiter, demur
|
3 |
-
Tags: attachments, thumbnail, documents, gallery, MS office, pdf
|
4 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=EE5LWRLG933EN&lc=US&item_name=Document%20Gallery%20Plugin&item_number=document%2dgallery¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
5 |
-
Requires at least: 3.6
|
6 |
-
Tested up to: 4.0
|
7 |
-
Stable tag: 2.2.5
|
8 |
-
License: GPLv2
|
9 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
-
|
11 |
-
This plugin generates thumbnails for documents and displays them in a
|
12 |
-
gallery-like format for easy sharing.
|
13 |
-
|
14 |
-
== Description ==
|
15 |
-
|
16 |
-
This plugin allows the user to effortlessly create a gallery of documents and
|
17 |
-
other attached media, much like the gallery option already available for image
|
18 |
-
attachments.
|
19 |
-
|
20 |
-
Watch the following video for a brief demonstration of Document Gallery in action:
|
21 |
-
[youtube https://www.youtube.com/watch?v=pCQsx5z-uOU]
|
22 |
-
|
23 |
-
Read more in the **Installation** tab!
|
24 |
-
|
25 |
-
= Translation =
|
26 |
-
|
27 |
-
Document Gallery has to-date been translated into **5** languages, listed below.
|
28 |
-
|
29 |
-
* **French** — *Thanks, Marc Liotard and [Traffic Influence](http://www.trafic-influence.com/)!*
|
30 |
-
* **Russian** — *Thanks, [demur](http://wordpress.org/support/profile/demur)!*
|
31 |
-
* **Spanish** — *Thanks, Andrew Kurtis and [WebHostingHub](http://www.webhostinghub.com/)!*
|
32 |
-
* **Swedish** — *Thanks, [mepmepmep](http://wordpress.org/support/profile/mepmepmep)!*
|
33 |
-
* **Ukrainian** — *Thanks, [demur](http://wordpress.org/support/profile/demur)!*
|
34 |
-
|
35 |
-
= Developers =
|
36 |
-
|
37 |
-
Document Gallery includes features intended to make integration with other plugins
|
38 |
-
simple. See the bottom of the **Installation** tab for specific documentation on
|
39 |
-
the various features provided.
|
40 |
-
|
41 |
-
*If this plugin has helped you, please take a moment to [rate
|
42 |
-
it](http://wordpress.org/support/view/plugin-reviews/document-gallery#postform)!*
|
43 |
-
|
44 |
-
== Installation ==
|
45 |
-
|
46 |
-
1. Upload `document-gallery` to the `/wp-content/plugins/` directory
|
47 |
-
1. Activate the plugin through the 'Plugins' menu in WordPress
|
48 |
-
1. Place `[dg]` in any posts or pages you want a document gallery included. See
|
49 |
-
below for additional display options.
|
50 |
-
|
51 |
-
= Document Gallery Options =
|
52 |
-
|
53 |
-
In order to include all compatible documents from a given page or post, you
|
54 |
-
must include the following shortcode in the post: `[dg]`.
|
55 |
-
|
56 |
-
In addition to the default behavior, the plugin provides many options to
|
57 |
-
customize behavior with various attributes, seen below:
|
58 |
-
|
59 |
-
`[dg [fancy=<true/false>] [attachment_pg=<true/false>]
|
60 |
-
[category/custom_taxon_name=<**comma-separated list of taxon values**> [relation=<AND/OR>]]
|
61 |
-
[descriptions=<true/false>] [ids=<**comma-separated list of ID #s**>]
|
62 |
-
[images=<true/false>] [localpost=<true/false>] [order=<ASC/DESC>] [orderby=<**see below**>]]`
|
63 |
-
|
64 |
-
Though the shortcode above may seem far from "short," none of the attributes are
|
65 |
-
required and most users will find that the plugin meets your needs "out of the box"
|
66 |
-
without any added attributes.
|
67 |
-
|
68 |
-
**Default Values**
|
69 |
-
|
70 |
-
By default, document gallery will use `no descriptions`, `orderby menu_order`
|
71 |
-
, `ASC order`, `no attachment_pg links`, and `no images` from the `local post`
|
72 |
-
if you do not specify otherwise. These defaults can be configured in your dashboard
|
73 |
-
under `Settings -> Document Gallery`.
|
74 |
-
|
75 |
-
**Attachment Page Option** *(New in Version 1.1)*
|
76 |
-
|
77 |
-
This option determines whether each document icon will link to the actual file
|
78 |
-
or to its attachment page. If you want the user to be able to click on the
|
79 |
-
icon and directly rective the option to download then use `attachment_pg=false`
|
80 |
-
(the default). If you have information on the attachment page that you want the
|
81 |
-
link to go to, use `attachment_pg=true`.
|
82 |
-
|
83 |
-
**Categories/Custom Taxonomy Option** *(New in Version 1.4)*
|
84 |
-
|
85 |
-
With the `categories` option you are able to select attachments based on
|
86 |
-
their assigned category or any other
|
87 |
-
[custom taxon](http://codex.wordpress.org/Taxonomies). Categories
|
88 |
-
or any custom taxon can be referenced simply by including `category=category_value`
|
89 |
-
or `taxon_name=taxon_value`. Multiple values for a single taxon may be separated
|
90 |
-
by commas.
|
91 |
-
|
92 |
-
**Descriptions Option**
|
93 |
-
|
94 |
-
If `true`, each document will take its own line with the description displayed
|
95 |
-
alongside it.
|
96 |
-
|
97 |
-
*Note: this will use the `description` field, **not** the `caption`. Be
|
98 |
-
careful when entering your document data.*
|
99 |
-
|
100 |
-
**Fancy** *(New in Version 2.0)*
|
101 |
-
|
102 |
-
If `true`, we will try to generate a thumbnail for each document in the gallery.
|
103 |
-
The success in generating thumbs will depend mostly on what your server supports.
|
104 |
-
To fine-tune how thumbnails are generated, visit `Settings -> Document Gallery`
|
105 |
-
in your site's dashboard.
|
106 |
-
|
107 |
-
*NOTE: By default, the most universally-supported option for generating thumbnails,
|
108 |
-
[Google Drive Viewer](https://docs.google.com/viewer) is disabled by default
|
109 |
-
in order to protect your privacy, since using it requires sending your documents
|
110 |
-
to Google's servers. If you're not working with confidential documents, you are
|
111 |
-
encouraged to enable this for optimum performance.*
|
112 |
-
|
113 |
-
**Order Option**
|
114 |
-
|
115 |
-
This option works alongside the `orderby` option to determine whether the
|
116 |
-
documents are displayed in ascending or descending order.
|
117 |
-
|
118 |
-
**Orderby Option**
|
119 |
-
|
120 |
-
* `menu_order` - This is probably the one you want to use. Menu order is
|
121 |
-
the order that icons appear when seen in the Insert / Upload Media Gallery
|
122 |
-
dialog. To change this order, you simply drag the icons around until they
|
123 |
-
are where you want them. In earlier versions of WordPress, menu_order was
|
124 |
-
modified by the integer fields in the Insert / Upload Media Gallery dialog.
|
125 |
-
These fields no longer exist in recent releases.
|
126 |
-
* `title` - Order by title.
|
127 |
-
* `date` - Order by upload date.
|
128 |
-
* `modified` - Order by last modified date.
|
129 |
-
* `rand` - Random order.
|
130 |
-
* `ID` - Order by post id.
|
131 |
-
* `author` - Order by author.
|
132 |
-
* `name` - Order by attachment slug.
|
133 |
-
* `parent` - Order by post/page parent id.
|
134 |
-
(Only useful in conjunction with `localpost=false` option.)
|
135 |
-
* `comment_count` - Order by number of comments (available with WP >= 2.9).
|
136 |
-
* `none` - No order (available with Version 2.8).
|
137 |
-
* `post__in` - Preserve post ID order given in the post__in array.
|
138 |
-
|
139 |
-
**Images Option** *(New in Version 1.2)*
|
140 |
-
|
141 |
-
This option will tell the plugin to include all images attached to to a page or
|
142 |
-
post in addition to all documents.
|
143 |
-
|
144 |
-
**IDs Option** *(New in Version 1.2)*
|
145 |
-
|
146 |
-
This is an advanced option intended for experienced WordPress users. If this
|
147 |
-
option is used, the plugin will ignore attached documents, instead including
|
148 |
-
all attachments defined by the `ids` attribute (e.g.: `ids=10,2,4,42`).
|
149 |
-
|
150 |
-
*Note: If this attribute is used, the `order`, `orderby`, `images` and other
|
151 |
-
attributes which generally determine which attachments to include or how to
|
152 |
-
order them will be ignored. Order is defined by the order the ids are
|
153 |
-
provided.*
|
154 |
-
|
155 |
-
**Localpost Option** *(New in Version 1.4)*
|
156 |
-
|
157 |
-
By default a document gallery only looks at attachments of the page/post where
|
158 |
-
the `[dg]` shortcode is used. If you would like to search beyond that local scope,
|
159 |
-
you must set `localpost=false`.
|
160 |
-
|
161 |
-
This option would probably be useful especially when querying with the *category
|
162 |
-
or taxonomy* option, though it can be used with any options you chose.
|
163 |
-
|
164 |
-
**Relation Option** *(New in Version 1.4)*
|
165 |
-
|
166 |
-
The relation option should only be used when also using the *category or custom
|
167 |
-
taxonomy* option (see above). Additionally, this option is only effective in
|
168 |
-
WordPress installs version 3.1 or higher. Older versions cannot use this value
|
169 |
-
and will ignore it.
|
170 |
-
|
171 |
-
When using multiple taxa, this option allows you to decide whether the attachments
|
172 |
-
returned must meet all of the taxa_names specified (AND) or a minimum of one
|
173 |
-
match (OR).
|
174 |
-
|
175 |
-
= Customize Appearance =
|
176 |
-
|
177 |
-
The Default Document gallery will often fit quite well with whatever theme you
|
178 |
-
are using. But, if you want to change things, Document Gallery makes that easy.
|
179 |
-
Just navigate to `Settings -> Document Gallery` and put any custom CSS in the
|
180 |
-
provided text box.
|
181 |
-
|
182 |
-
See [`style.css`](http://plugins.svn.wordpress.org/document-gallery/trunk/assets/css/style.css)
|
183 |
-
for all of the ids and classes being used in a Document Gallery.
|
184 |
-
|
185 |
-
**Example**
|
186 |
-
|
187 |
-
Say I would like to include a border for the right and bottom of the document
|
188 |
-
icon, but only when descriptions are shown (to delineate the icon from the
|
189 |
-
description text). To do this, I would need to use the following CSS:
|
190 |
-
|
191 |
-
`.document-icon-wrapper.descriptions .document-icon{
|
192 |
-
border-right: 1px solid #37824A;
|
193 |
-
border-bottom: 1px solid #37824A;
|
194 |
-
}`
|
195 |
-
|
196 |
-
Now, if I wanted to modify that code to instead add the same border to all of
|
197 |
-
the document-icons, regardless of whether they have a description or not, I
|
198 |
-
would just change the first line, removing the descriptions class like so:
|
199 |
-
|
200 |
-
`.document-icon-wrapper .document-icon`
|
201 |
-
|
202 |
-
= Developers =
|
203 |
-
|
204 |
-
For those unfamiliar with content filters, [here is some
|
205 |
-
documentation](http://codex.wordpress.org/Plugin_API/Filter_Reference) that you
|
206 |
-
should read before continuing.
|
207 |
-
|
208 |
-
**Filter HTML Output**
|
209 |
-
|
210 |
-
In Documnet Gallery version 2.2, we've released a more powerful HTML
|
211 |
-
templating framework, making all generated output filterable, and thus
|
212 |
-
configurable, by developers wishing to control the gallery output. Three
|
213 |
-
different filters are provided in order to access the various segments
|
214 |
-
of a gallery: `dg_gallery_template`, `dg_row_template`, and `dg_icon_template`.
|
215 |
-
These filtered templates are used when dynamically generating output for each
|
216 |
-
gallery.
|
217 |
-
|
218 |
-
*NOTE: The `dg_doc_icon` has been deprecated with the release and is
|
219 |
-
scheduled to be removed in a future release. If you are using this
|
220 |
-
filter, you are encouraged to replace its usages with `dg_icon_template`.*
|
221 |
-
|
222 |
-
Each of the following filters provides an bool argument which indicates
|
223 |
-
whither the gallery being generated will display descriptions, which
|
224 |
-
allows you to handle galleries with and without descriptions differently.
|
225 |
-
|
226 |
-
If you wish to wrap your galleries in some additional content, the
|
227 |
-
`dg_gallery_template` is the tool for the job. With it you can include
|
228 |
-
content prior to or following your document galleries. The filter
|
229 |
-
exposes 1 special tag which is replaced during gallery generation
|
230 |
-
with data specific to that gallery. The tag is described below:
|
231 |
-
|
232 |
-
* **%rows%**: This tag is replaced by all of the document gallery rows.
|
233 |
-
Everything before this string will be rendered before the gallery and
|
234 |
-
everything after this string will be rendered following the gallery.
|
235 |
-
|
236 |
-
|
237 |
-
If you wish to modify how gallery rows are generated, `dg_row_template`,
|
238 |
-
is provided for this purpose. This filter gives you control at the row
|
239 |
-
level for how a gallery will be generated. The filter exposes 2 special tags
|
240 |
-
which are replaced during gallery generation with row-specific data.
|
241 |
-
These tags are as follows:
|
242 |
-
|
243 |
-
* **%class%**: The class attribute value for this row.
|
244 |
-
* **%icons%**: The icon data for this row.
|
245 |
-
|
246 |
-
|
247 |
-
If you wish to modify the HTML that wraps individual icons, the
|
248 |
-
`dg_icon_template` filter is what you will use. The filter is passed
|
249 |
-
two arguments which may be used to gain additional information about
|
250 |
-
the document that will be used in generating this icon. The first
|
251 |
-
argument is a bool value which indicates whether descriptions will
|
252 |
-
be used along with the icon and the second value is an integer WordPress
|
253 |
-
attachment ID which may be used to lookup any relevant information
|
254 |
-
you need specific to that document. The filter exposes 5 special tags
|
255 |
-
which are replaced during gallery generation with document-specific data.
|
256 |
-
These tags are as follows:
|
257 |
-
|
258 |
-
* **%link%**: The URL that will be loaded when the user clicks the icon.
|
259 |
-
* **%img%**: The URL pointing the the image that will be displayed.
|
260 |
-
* **%title%**: The human-readable title of the attachment.
|
261 |
-
* **%title_attribute%**: The escaped title (above), safe for using HTML tag attributes.
|
262 |
-
* **%description%**: The attachment description (only present when rendering descriptions).
|
263 |
-
|
264 |
-
|
265 |
-
**Filter Thumbnail Generation Methods**
|
266 |
-
|
267 |
-
Document Gallery provides the `dg_thumbers` filter, which allows developers to
|
268 |
-
add, remove, or even re-order which methods are used to generate a thumbnail
|
269 |
-
for a given attachment.
|
270 |
-
|
271 |
-
The value being filtered is an associative array with keys equal to a regular
|
272 |
-
expression matching all file extensions supported by the generator and values
|
273 |
-
equal to [callables](http://www.php.net/manual/en/language.types.callable.php)
|
274 |
-
which take an **attachment ID** and a **file page number** as arguments.
|
275 |
-
|
276 |
-
The callable given should return false if thumbnail generation fails or
|
277 |
-
a system path to a **temporary** copy of the generated image if generation
|
278 |
-
succeeds. The caller will manipulate the file at the returned path so **do not** pass
|
279 |
-
in a file path to the original copy of anything as it will be destroyed. Also, do not
|
280 |
-
worry about any image resizing or giving the file a sensible name as the caller
|
281 |
-
of your method will resize and rename the file before returning.
|
282 |
-
|
283 |
-
The following is an example taken from the Document Gallery source (with a few
|
284 |
-
modifications for ease of readability), where we add thumbnail generation for
|
285 |
-
all Audio/Video filetypes supported by WordPress:
|
286 |
-
|
287 |
-
`function dg_filter_thumbers($thumbers) {
|
288 |
-
$av_file_types = array_merge(wp_get_audio_extensions(), wp_get_video_extensions());
|
289 |
-
$exts = implode('|', $av_file_types);
|
290 |
-
$thumbers[$exts] = 'dg_get_audio_video_thumbnail';
|
291 |
-
}
|
292 |
-
add_filter('dg_thumbers', 'dg_filter_thumbers', 10);
|
293 |
-
|
294 |
-
function dg_get_audio_video_thumbnail($ID, $pg) {
|
295 |
-
include_once ABSPATH . 'wp-admin/includes/media.php';
|
296 |
-
|
297 |
-
$attachment = get_post($ID);
|
298 |
-
$doc_path = get_attached_file($ID);
|
299 |
-
|
300 |
-
// get the file metadata
|
301 |
-
if (preg_match('#^video/#', get_post_mime_type($attachment))) {
|
302 |
-
$metadata = wp_read_video_metadata($doc_path);
|
303 |
-
}
|
304 |
-
elseif (preg_match('#^audio/#', get_post_mime_type($attachment))) {
|
305 |
-
$metadata = wp_read_audio_metadata($doc_path);
|
306 |
-
}
|
307 |
-
|
308 |
-
// unsupported mime type || no embedded image present
|
309 |
-
if(!isset($metadata) || empty($metadata['image']['data'])) {
|
310 |
-
return false;
|
311 |
-
}
|
312 |
-
|
313 |
-
$ext = 'jpg';
|
314 |
-
switch ($metadata['image']['mime']) {
|
315 |
-
case 'image/gif':
|
316 |
-
$ext = 'gif';
|
317 |
-
break;
|
318 |
-
case 'image/png':
|
319 |
-
$ext = 'png';
|
320 |
-
break;
|
321 |
-
}
|
322 |
-
|
323 |
-
$tmp_dir = untrailingslashit(get_temp_dir());
|
324 |
-
$temp_file = $tmp_dir . DIRECTORY_SEPARATOR . wp_unique_filename($tmp_dir, md5(time()) . ".$ext");
|
325 |
-
|
326 |
-
if (!$fp = @fopen($temp_file, 'wb')) {
|
327 |
-
return false;
|
328 |
-
}
|
329 |
-
|
330 |
-
if (!@fwrite($fp, $metadata['image']['data'])) {
|
331 |
-
fclose($fp);
|
332 |
-
return false;
|
333 |
-
}
|
334 |
-
|
335 |
-
fclose($fp);
|
336 |
-
|
337 |
-
return $temp_file;
|
338 |
-
}`
|
339 |
-
|
340 |
-
== Frequently Asked Questions ==
|
341 |
-
|
342 |
-
|
343 |
-
= Q: Why is [insert thumbnail generation method] enabled on one of my WordPress installs, but not on another one? =
|
344 |
-
|
345 |
-
A: Document Gallery works very hard behind the scenes to ensure that it enables
|
346 |
-
as much as is possible for any given server, but some servers just can't do
|
347 |
-
some of the things that the plugin supports. Document Gallery detects when a
|
348 |
-
server can't do something (run Ghostscript, for example) and disables that option.
|
349 |
-
If you later modify your server to handle one of the thumbnail generation methods,
|
350 |
-
Document Gallery will notice this and re-enable the option on the settings page,
|
351 |
-
though you will need to go in and tell Document Gallery that it should use this
|
352 |
-
newly-enabled method.
|
353 |
-
|
354 |
-
= Q: Why is Ghostscript so much faster than Imagick? =
|
355 |
-
|
356 |
-
A: This comes down to how the two programs work. Imagick actually delegates
|
357 |
-
handling of PDFs to Ghostscript behind the scenes, but it doesn't do so
|
358 |
-
intelligently. Before passing off the PDF, it first reads the entire contents
|
359 |
-
of the PDF into memory. Since we only need a single page to generate the
|
360 |
-
thumbnail, this is much more work than is needed. Ghostscript, on the other hand,
|
361 |
-
can handle reading only one page into memory, thus doing much less work before
|
362 |
-
returning our thumbnail.
|
363 |
-
|
364 |
-
= Q: Why isn't Google Drive Viewer enabled by default? =
|
365 |
-
|
366 |
-
A: Google Drive Viewer is the most commonly-supported thumbnail generation method,
|
367 |
-
alongside the Audio/Video generation, but is disabled by default. The reason
|
368 |
-
for this is that in order to use this method, Document Gallery has to send your
|
369 |
-
document over to Google's servers, where Google will generate the thumbnail for
|
370 |
-
you. For most users, this shouldn't be a big deal, but since some users
|
371 |
-
retain sensitive documents on their site, this was made opt-in to avoid
|
372 |
-
compromising anyone's security. If you don't have sensitive documents, I
|
373 |
-
would recommend enabling it, since it's currently the only way to generate a
|
374 |
-
thumbnail for any of the Microsoft Office files, as well as some less common
|
375 |
-
file types.
|
376 |
-
|
377 |
-
== Screenshots ==
|
378 |
-
|
379 |
-
1. This is an example of "fancy" thumbnails. The images are a copy of the front
|
380 |
-
page for each document.
|
381 |
-
2. This is an example of multiple Document Galleries on a single page (using
|
382 |
-
the `ids` attribute). It also shows how images will appear in a Document
|
383 |
-
Gallery. Note that the description field supports HTML markup, so the
|
384 |
-
possibilities are endless!
|
385 |
-
3. This is how the Document Gallery looks with `descriptions=false` (default).
|
386 |
-
Note that the display inherits styling from your active theme.
|
387 |
-
|
388 |
-
== Changelog ==
|
389 |
-
|
390 |
-
= Features For The Future =
|
391 |
-
|
392 |
-
To see a list of features planned for the future as well as to propose your own
|
393 |
-
ideas for future Document Gallery development, take a look at our
|
394 |
-
[issue tracker](https://github.com/thenadz/document-gallery/issues).
|
395 |
-
|
396 |
-
= 2.2.5 =
|
397 |
-
* **Bug Fix:** Resolves a bug where document descriptions were not being displayed
|
398 |
-
correctly.
|
399 |
-
* **Translation:** Thanks, Marc Liotard and [Traffic Influence](http://www.trafic-influence.com/)
|
400 |
-
for updating the French translation to include new phrases throughout the plugin!
|
401 |
-
|
402 |
-
= 2.2.4 =
|
403 |
-
* **Translation:**: Thanks to [mepmepmep](http://wordpress.org/support/profile/mepmepmep)
|
404 |
-
who has just updated the Document Gallery Swedish translation!
|
405 |
-
|
406 |
-
= 2.2.3 =
|
407 |
-
* **Enhancement:** This will only be relevant to developers. `%descriptions%` tag
|
408 |
-
is now available in the `dg_icon_template` filter.
|
409 |
-
|
410 |
-
= 2.2.2 =
|
411 |
-
* **Bug Fix:** Resolves minor issue in `2.2.1` that resulted in a warning being
|
412 |
-
logged while interacting with the new thumbnail management table in the
|
413 |
-
Document Gallery settings.
|
414 |
-
|
415 |
-
= 2.2.1 =
|
416 |
-
* **Bug Fix:** PHP installs older than 5.3 were crashing with version 2.2. This release
|
417 |
-
patches the issue.
|
418 |
-
|
419 |
-
= 2.2 =
|
420 |
-
* **Note:** This release is the first release where development has been done by
|
421 |
-
multiple people. I would like to give a massive thank you to
|
422 |
-
[demur](http://wordpress.org/support/profile/demur) who has been an equal
|
423 |
-
partner throughout the development of this version. Couldn't have done it without you!
|
424 |
-
* **Note:** With multiple developing this project, it made sense to setup
|
425 |
-
a formal method to track issues and possible future enhancements. With this in mind
|
426 |
-
we've begun to maintain an [issue tracker](https://github.com/thenadz/document-gallery/issues).
|
427 |
-
Feel free to read through possible future features and even suggest new features
|
428 |
-
you would like to see!
|
429 |
-
* **Enhancement:** You can now view which thumbnails have been generated and manually
|
430 |
-
delete individual thumbnails from the Document Gallery settings page, located at
|
431 |
-
Dashboard -> Settings -> Document Gallery.
|
432 |
-
* **Enhancement:* The logging for Document Gallery is now **much** more advanced.
|
433 |
-
Logging can be configured and viewed directly from the Document Gallery settings
|
434 |
-
page.
|
435 |
-
* **Enhancement:** Max width and height of generated thumbnails is now configurable.
|
436 |
-
* **Enhancement:** We had a couple of reports of the Document Gallery options
|
437 |
-
being corrupted in some installs, so we added functionality to force validation
|
438 |
-
of option structure on save. This will not be of much use to most users, but
|
439 |
-
will help us track down some of the more difficult to reproduce bugs.
|
440 |
-
* **Enhancement:** For developers. New filters have been added to support modifying all
|
441 |
-
aspects of HTML generated by the plugin. Look at the Installation tab for documentation
|
442 |
-
on these new filters.
|
443 |
-
|
444 |
-
= 2.1.1 =
|
445 |
-
* **Translation:** Thanks to [mepmepmep](http://wordpress.org/support/profile/mepmepmep)
|
446 |
-
who has translated Document Gallery into Swedish!
|
447 |
-
* **Translation:** Thanks to Marc Liotard who has translated Document Gallery into French!
|
448 |
-
* **Note:** If you would like to help translate Document Gallery into another language,
|
449 |
-
get started [here](http://wordpress.org/support/topic/seeking-translators)!
|
450 |
-
* **Note:** This is an extremely minor release, but big changes are on the
|
451 |
-
way in version `2.2`! Stay tuned as it should be going live in the very
|
452 |
-
near future. Look for a complete makeover of the admin options including
|
453 |
-
lots of new ways to configure DG to best meet your needs!
|
454 |
-
|
455 |
-
= 2.1 =
|
456 |
-
* **Enhancement:** Document Gallery now supports
|
457 |
-
[multisite networks](http://codex.wordpress.org/Create_A_Network).
|
458 |
-
|
459 |
-
= 2.0.10 =
|
460 |
-
* **Enhancement:** Ghostscript detection should now work correctly on GoDaddy
|
461 |
-
and some other hosts that don't properly setup their executables.
|
462 |
-
* **Translation:** Thanks *again* to
|
463 |
-
[demur](http://wordpress.org/support/profile/demur) who has translated
|
464 |
-
Document Gallery into Russian and Ukrainian! If you would like to help
|
465 |
-
translate Document Gallery into another language, get started
|
466 |
-
[here](http://wordpress.org/support/topic/seeking-translators)!
|
467 |
-
|
468 |
-
= 2.0.9 =
|
469 |
-
* **Bug Fix:** The `order` attribute was documented and implemented as being `ASC`
|
470 |
-
or `DEC`, but the latter should actually have been `DESC`. Documentation and
|
471 |
-
implementation for this option has been corrected. Thanks again to
|
472 |
-
[demur](http://wordpress.org/support/profile/demur) for catching this!
|
473 |
-
|
474 |
-
= 2.0.8 =
|
475 |
-
* **Enhancement:** Ghostscript will now handle PS and EPS files if enabled.
|
476 |
-
* **Bug Fix:** There were a couple of issues in how the `ids` attribute was being
|
477 |
-
handled. Thanks, [demur](http://wordpress.org/support/profile/demur) for catching
|
478 |
-
these!
|
479 |
-
|
480 |
-
= 2.0.7 =
|
481 |
-
* **Bug Fix:** `2.0.6` did not fully resolve the bug described below. This should.
|
482 |
-
|
483 |
-
= 2.0.6 =
|
484 |
-
* **Bug Fix:** If DG failed to automagically detect the location of the
|
485 |
-
Ghostscript binary, manually setting the location did not enable using it.
|
486 |
-
Thanks for tracking this bug down,
|
487 |
-
[Chris](http://wordpress.org/support/profile/fredd500)!
|
488 |
-
* **Minor:** Included various enhancements in handling thumbnail generation
|
489 |
-
for image types.
|
490 |
-
* **Tested Up To:** Document Gallery has been tested in WP 3.9 (RC 1).
|
491 |
-
|
492 |
-
= 2.0.5 =
|
493 |
-
* **Bug Fix:** Rolling back part of CSS enhancments in 2.0.4 that were causing
|
494 |
-
errors on some servers. May revisit at a later date.
|
495 |
-
|
496 |
-
= 2.0.4 =
|
497 |
-
* **Enhancement:** Custom CSS is now loaded faster, meaning faster page loads
|
498 |
-
for your users. Tests are showing a speedup of around 30% over where it was
|
499 |
-
in the last release.
|
500 |
-
* **Enhancement:** All of the default icons were sent through
|
501 |
-
[Yahoo! Smush.it](http://www.smushit.com/ysmush.it/), giving a few percentage
|
502 |
-
points decrease in size. Thanks for the suggestion,
|
503 |
-
[wm](http://wordpress.org/support/profile/webbmasterpianise)!
|
504 |
-
|
505 |
-
= 2.0.3 =
|
506 |
-
* **Enhancement:** Now handles custom user CSS more securely.
|
507 |
-
* **Enhancement:** Now handles calling Ghostscript executable more securely.
|
508 |
-
* **Enhancement:** Now provides timing information for gallery generation
|
509 |
-
when running WordPress in [WP_DEBUG](https://codex.wordpress.org/WP_DEBUG)
|
510 |
-
mode. When enabled, DG will log to the PHP error log file.
|
511 |
-
* **Info:** Did you know that in tests I performed, Ghostscript (GS) performed
|
512 |
-
350% faster than using Imagick (IM)? Try testing with
|
513 |
-
[this file](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf),
|
514 |
-
which finished almost instantly using GS, but took multiple minutes when
|
515 |
-
using IM on my test server (results may vary). See new FAQ tab to find out why.
|
516 |
-
|
517 |
-
= 2.0.2 =
|
518 |
-
* **Bug Fix:** Imagick was actually never working... My bad -- it is now! Thanks to
|
519 |
-
[kaldimar](http://wordpress.org/support/profile/kaldimar) for reporting this.
|
520 |
-
* **Enhancement:** Document Gallery en el Español por Andrew de
|
521 |
-
[WebHostingHub](http://www.webhostinghub.com/). (To help translate to another
|
522 |
-
language, [see here](http://wordpress.org/support/topic/seeking-translators).)
|
523 |
-
|
524 |
-
= 2.0.1 =
|
525 |
-
* **Bug Fix:** Resolves issue with `2.0` where DG options were not properly
|
526 |
-
initialized when the plugin was updated. This caused the settings page to
|
527 |
-
behave oddly and many other things throughout to not work as expected when
|
528 |
-
you updated through the dashboard. Thanks to jawhite & rigbypa for
|
529 |
-
[reporting this](http://wordpress.org/support/topic/errors-after-updating-to-20)!
|
530 |
-
|
531 |
-
= 2.0 =
|
532 |
-
* **Enhancement:** This release is a **BIG** deal! We are introducing true
|
533 |
-
document thumbnails (rather than the boring static images that were the same
|
534 |
-
for every document), meaning that you will be able to generate and display
|
535 |
-
thumbnails for most of your documents so your users can see a preview of the
|
536 |
-
document before downloading. This has been
|
537 |
-
[months in development](http://wordpress.org/support/topic/pdf-thumbnails-instead-of-generic-icon)
|
538 |
-
and I really hope that you all enjoy it!
|
539 |
-
* **Enhancement:** Document Gallery now has a settings page where you can
|
540 |
-
configure the default options for your galleries and chose how thumbnails are
|
541 |
-
generated.
|
542 |
-
* **Enhancement:** Customizing CSS for your document gallery is now *much easier*.
|
543 |
-
If you want to add additional styling, just navigate to `Settings -> Document Gallery`
|
544 |
-
in your dashboard and enter valid CSS in the "Custom CSS" textbox. See the changes
|
545 |
-
instantly in your galleries!
|
546 |
-
* **Enhancement:** Entire plugin is now
|
547 |
-
[Internationalization-enabled](https://codex.wordpress.org/I18n_for_WordPress_Developers).
|
548 |
-
This means that we can now support users speaking all languages. If you are
|
549 |
-
interested in translating Document Gallery into a language that you speak,
|
550 |
-
please [let me know](http://wordpress.org/support/topic/seeking-translators)!
|
551 |
-
* **Enhancement:** This release saw much of the backend refactored to better
|
552 |
-
support future development. Nothing you will notice unless you're digging into
|
553 |
-
the code, but it will keep me sane long-term ;)
|
554 |
-
* **Note:** The thumbnail generation implementation works very hard to support
|
555 |
-
all hosting servers (including Unix and Windows systems). That said, I cannot
|
556 |
-
test on all hosts out there, so there is the potential for bugs to appear.
|
557 |
-
If you notice something that doesn't look right, please don't hesitate to
|
558 |
-
[report the issue](http://wordpress.org/support/plugin/document-gallery)
|
559 |
-
so that I can resolve it. Thanks!
|
560 |
-
|
561 |
-
= 1.4.3 =
|
562 |
-
* **Bug Fix:** Resolves minor bug introduced in version 1.4.2. Thanks, tkokholm!
|
563 |
-
|
564 |
-
= 1.4.2 =
|
565 |
-
* **Note:** This release includes an increase in the minimum WP version to 3.5.
|
566 |
-
If you have not yet upgraded to at least this version, you should consider doing
|
567 |
-
so as future releases include a number of *fantastic* new features as well as
|
568 |
-
many security improvements. If you chose not to upgrade, you must stay with
|
569 |
-
Document Gallery 1.4.1 or lower until you do. Sorry for the inconvenience!
|
570 |
-
* **Bug Fix:** Resolved icons being displayed differently depending on which
|
571 |
-
user was currently logged in. (Thanks to
|
572 |
-
[Sean](http://wordpress.org/support/topic/error-after-update-19?replies=12#post-5041251)
|
573 |
-
for reporting the issue.)
|
574 |
-
* **Enhancement:** A number of new icons were added (mainly for the iWork suite
|
575 |
-
and source code filetypes) and a number of pre-existing icons were removed if
|
576 |
-
they were very similar to another icon.
|
577 |
-
* **Under The Hood:** Many, many cool things. Stay tuned for a big reveal in the
|
578 |
-
coming weeks!
|
579 |
-
PS: If you're really curious, there are some clues in the source code ;)
|
580 |
-
|
581 |
-
= 1.4.1 =
|
582 |
-
* **Bug Fix:** This resolves a bug introduced in `1.4`, which caused a warning
|
583 |
-
to be thrown when no attributes were used (i.e.: `[dg]`). (Thanks to
|
584 |
-
[wtfbingo](http://wordpress.org/support/topic/error-after-update-19) for
|
585 |
-
pointing this out!)
|
586 |
-
|
587 |
-
= 1.4 =
|
588 |
-
|
589 |
-
* **New Feature:** This release features the addition of *category/taxonomy* support,
|
590 |
-
[as suggested by Pyo](http://wordpress.org/support/topic/sorting-documents-by-categorytag-or-other-taxonomy).
|
591 |
-
* **Under The Hood:** The plugin was completely rewritten for this release. Logic
|
592 |
-
was cleaned up to make maintenance easier and facilitate some *big* changes
|
593 |
-
planned for version 2.0 of Document Gallery.
|
594 |
-
|
595 |
-
= 1.3.1 =
|
596 |
-
|
597 |
-
* **Bug Fix:** This resolves a bug introduced in version `1.3`. (Thanks to JKChad
|
598 |
-
for pointing this out!)
|
599 |
-
|
600 |
-
= 1.3 =
|
601 |
-
|
602 |
-
* **New Feature:** It is now possible to filter the HTML produced to represent
|
603 |
-
each individual icon, making it possible to add extra attributes and other
|
604 |
-
modifications on the fly as document icons are generated. This will probably
|
605 |
-
only be of use to developers and people who don't mind getting their hands
|
606 |
-
dirty. *(See bottom **Installation** tab for more details.)*
|
607 |
-
* **Enhancement:** There have been a lot of optimizations to the underlying
|
608 |
-
plugin code to make it run more efficiently and be easier to read, if you
|
609 |
-
are so inclined.
|
610 |
-
* **Enhancement:** Changed how images, when included within the gallery, are
|
611 |
-
generated so that the format of the icon returned now matches the rest of
|
612 |
-
the icons.
|
613 |
-
|
614 |
-
= 1.2.1 =
|
615 |
-
|
616 |
-
* **Bug Fix:** Resolved issue with the `ids` attribute in `1.2` not working.
|
617 |
-
Sorry about that!
|
618 |
-
|
619 |
-
= 1.2 =
|
620 |
-
|
621 |
-
* **New Feature:** Images can now be included alongside documents in a
|
622 |
-
document gallery (using `images=true` attribute).
|
623 |
-
(Thanks for the suggestion, Luca!)
|
624 |
-
* **New Feature:** Attachment ids can now be explicitly listed, allowing for
|
625 |
-
documents not attached to a post or page to be included in a document
|
626 |
-
gallery (e.g.: `ids=2,42,57,1`). Note that no spaces should be included.
|
627 |
-
* **Enhancement:** The CSS stylesheet has been enhanced for more flexibility
|
628 |
-
in sizing icons.
|
629 |
-
|
630 |
-
= 1.1 =
|
631 |
-
|
632 |
-
* **New Feature:** Included option to link to the attachment page as well as
|
633 |
-
to the actual document.
|
634 |
-
* **Enhancement:** Added documentation for customizing the appearance of the plugin.
|
635 |
-
* **Enhancement:** Many improvements to the backend, including pretty HTML output
|
636 |
-
and best practice implementation in calls to WordPress core functions.
|
637 |
-
|
638 |
-
= 1.0.4 =
|
639 |
-
|
640 |
-
* **Bug Fix:** Removed extra `div` at bottom when number of documents is
|
641 |
-
evenly divisible by 4. (Thanks, joero4ri!)
|
642 |
-
|
643 |
-
= 1.0.3 =
|
644 |
-
|
645 |
-
* **Bug Fix:** Resolved issue with detecting plugin directory. (Thanks,
|
646 |
-
Brigitte!)
|
647 |
-
* **Enhancement:** Minor improvement to how linking to individual
|
648 |
-
documents is handled.
|
649 |
-
|
650 |
-
= 1.0.2 =
|
651 |
-
|
652 |
-
* **Bug Fix:** Merge for changes in 1.0 did not go through correctly so users
|
653 |
-
downloaded the old icon set which broke the plugin. Sorry about that, but
|
654 |
-
all is resolved with this release!
|
655 |
-
|
656 |
-
= 1.0.1 =
|
657 |
-
|
658 |
-
* **Bug Fix:** Resolved issue with long document titles being cut off in some themes.
|
659 |
-
|
660 |
-
= 1.0 =
|
661 |
-
|
662 |
-
* **New Feature:** Plugin now has **36 icons** representing **72 filetypes**!
|
663 |
-
* **Enhancement:** Optimized gallery generation (faster!)
|
664 |
-
* **Enhancement:** Added fallback to WordPress default icons if you happen to
|
665 |
-
include one of the few filetypes not yet supported.
|
666 |
-
* **Enhancement:** Changed shortcode to `[dg]` (`[document gallery]` will still
|
667 |
-
work for backward compatibility).
|
668 |
-
* **Enhancement:** Gave documentation some **much needed** revisions.
|
669 |
-
|
670 |
-
= 0.8.5 =
|
671 |
-
|
672 |
-
* **Enhancement:** Added support for
|
673 |
-
[OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument).
|
674 |
-
|
675 |
-
= 0.8 =
|
676 |
-
|
677 |
-
* **Release:** First public release of Document Gallery.
|
678 |
-
* **Feature:** Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a
|
679 |
-
given page or post.
|
680 |
-
* **Feature:** Documents can be ordered by a number of
|
681 |
-
different factors.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/class-admin.php
DELETED
@@ -1,984 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
DG_Admin::init();
|
5 |
-
|
6 |
-
class DG_Admin {
|
7 |
-
/**
|
8 |
-
* @var string The hook for the Document Gallery settings page.
|
9 |
-
*/
|
10 |
-
private static $hook;
|
11 |
-
|
12 |
-
/**
|
13 |
-
* @var string The current tab being rendered.
|
14 |
-
*/
|
15 |
-
private static $current;
|
16 |
-
|
17 |
-
/**
|
18 |
-
* @var multitype:string Associative array containing all tab names, keyed by tab slug.
|
19 |
-
*/
|
20 |
-
private static $tabs;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Initializes static values for this class.
|
24 |
-
*/
|
25 |
-
public static function init() {
|
26 |
-
if (empty(self::$tabs)) {
|
27 |
-
self::$tabs = array(
|
28 |
-
'General' => __('General', 'document-gallery'),
|
29 |
-
'Thumbnail' => __('Thumbnail Management', 'document-gallery'),
|
30 |
-
'Logging' => __('Logging', 'document-gallery'),
|
31 |
-
'Advanced' => __('Advanced', 'document-gallery'));
|
32 |
-
}
|
33 |
-
}
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Renders Document Gallery options page.
|
37 |
-
*/
|
38 |
-
public static function renderOptions() { ?>
|
39 |
-
<div class="wrap">
|
40 |
-
<h2>Document Gallery Settings</h2>
|
41 |
-
|
42 |
-
<h2 class="nav-tab-wrapper">
|
43 |
-
<?php foreach (self::$tabs as $tab => $name) {
|
44 |
-
$class = ($tab == self::$current) ? ' nav-tab-active' : '';
|
45 |
-
echo '<a class="nav-tab '.$tab.'-tab'.$class.'" href="?page=' . DG_OPTION_NAME . '&tab='.$tab.'">'.$name.'</a>';
|
46 |
-
} ?>
|
47 |
-
</h2>
|
48 |
-
|
49 |
-
<form method="post" action="options.php" id="tab-<?php echo self::$current?>">
|
50 |
-
<input type="hidden" name="<?php echo DG_OPTION_NAME; ?>[tab]" value="<?php echo self::$current; ?>" />
|
51 |
-
<?php
|
52 |
-
settings_fields(DG_OPTION_NAME);
|
53 |
-
do_settings_sections(DG_OPTION_NAME);
|
54 |
-
if (self::$current != 'Thumbnail' && self::$current != 'Logging') {
|
55 |
-
submit_button();
|
56 |
-
}
|
57 |
-
?>
|
58 |
-
</form>
|
59 |
-
|
60 |
-
</div>
|
61 |
-
<?php }
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Adds settings link to main plugin view.
|
65 |
-
*/
|
66 |
-
public static function addSettingsLink($links) {
|
67 |
-
$settings = '<a href="options-general.php?page=' . DG_OPTION_NAME . '">' .
|
68 |
-
__('Settings', 'document-gallery') . '</a>';
|
69 |
-
array_unshift($links, $settings);
|
70 |
-
return $links;
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Adds Document Gallery settings page to admin navigation.
|
75 |
-
*/
|
76 |
-
public static function addAdminPage() {
|
77 |
-
DG_Admin::$hook = add_options_page(
|
78 |
-
__('Document Gallery Settings', 'document-gallery'),
|
79 |
-
__('Document Gallery', 'document-gallery'),
|
80 |
-
'manage_options', DG_OPTION_NAME, array(__CLASS__, 'renderOptions'));
|
81 |
-
add_action('admin_enqueue_scripts', array(__CLASS__, 'enqueueScriptsAndStyles'));
|
82 |
-
}
|
83 |
-
|
84 |
-
/**
|
85 |
-
* Enqueues styles and scripts for the admin settings page.
|
86 |
-
*/
|
87 |
-
public static function enqueueScriptsAndStyles($hook) {
|
88 |
-
if ($hook !== DG_Admin::$hook) return;
|
89 |
-
|
90 |
-
wp_enqueue_style('document-gallery-admin', DG_URL . 'assets/css/admin.css', null, DG_VERSION);
|
91 |
-
wp_enqueue_script('document-gallery-admin', DG_URL . 'assets/js/admin.js', array('jquery'), DG_VERSION, true);
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Registers settings for the Document Gallery options page.
|
96 |
-
*/
|
97 |
-
public static function registerSettings() {
|
98 |
-
if (empty($_REQUEST['tab']) || !array_key_exists($_REQUEST['tab'], self::$tabs)) {
|
99 |
-
reset(self::$tabs);
|
100 |
-
self::$current = key(self::$tabs);
|
101 |
-
} else {
|
102 |
-
self::$current = $_REQUEST['tab'];
|
103 |
-
}
|
104 |
-
|
105 |
-
register_setting(DG_OPTION_NAME, DG_OPTION_NAME, array(__CLASS__, 'validateSettings'));
|
106 |
-
|
107 |
-
$funct = 'register' . self::$current . 'Settings';
|
108 |
-
DG_Admin::$funct();
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Registers settings for the general tab.
|
113 |
-
*/
|
114 |
-
private static function registerGeneralSettings() {
|
115 |
-
global $dg_options;
|
116 |
-
|
117 |
-
include_once DG_PATH . 'inc/class-gallery.php';
|
118 |
-
include_once DG_PATH . 'inc/class-thumber.php';
|
119 |
-
|
120 |
-
$defaults = $dg_options['gallery'];
|
121 |
-
$active = $dg_options['thumber']['active'];
|
122 |
-
|
123 |
-
add_settings_section(
|
124 |
-
'gallery_defaults', __('Default Settings', 'document-gallery'),
|
125 |
-
array(__CLASS__, 'renderDefaultSettingsSection'), DG_OPTION_NAME);
|
126 |
-
|
127 |
-
add_settings_section(
|
128 |
-
'thumbnail_generation', __('Thumbnail Generation', 'document-gallery'),
|
129 |
-
array(__CLASS__, 'renderThumberSection'), DG_OPTION_NAME);
|
130 |
-
|
131 |
-
add_settings_section(
|
132 |
-
'css', __('Custom CSS', 'document-gallery'),
|
133 |
-
array(__CLASS__, 'renderCssSection'), DG_OPTION_NAME);
|
134 |
-
|
135 |
-
add_settings_field(
|
136 |
-
'gallery_defaults_attachment_pg', 'attachment_pg',
|
137 |
-
array(__CLASS__, 'renderCheckboxField'),
|
138 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
139 |
-
array (
|
140 |
-
'label_for' => 'label_gallery_defaults_attachment_pg',
|
141 |
-
'name' => 'gallery_defaults][attachment_pg',
|
142 |
-
'value' => esc_attr($defaults['attachment_pg']),
|
143 |
-
'option_name' => DG_OPTION_NAME,
|
144 |
-
'description' => __('Link to attachment page rather than to file', 'document-gallery')
|
145 |
-
));
|
146 |
-
|
147 |
-
add_settings_field(
|
148 |
-
'gallery_defaults_descriptions', 'descriptions',
|
149 |
-
array(__CLASS__, 'renderCheckboxField'),
|
150 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
151 |
-
array (
|
152 |
-
'label_for' => 'label_gallery_defaults_descriptions',
|
153 |
-
'name' => 'gallery_defaults][descriptions',
|
154 |
-
'value' => esc_attr($defaults['descriptions']),
|
155 |
-
'option_name' => DG_OPTION_NAME,
|
156 |
-
'description' => __('Include document descriptions', 'document-gallery')
|
157 |
-
));
|
158 |
-
|
159 |
-
add_settings_field(
|
160 |
-
'gallery_defaults_fancy', 'fancy',
|
161 |
-
array(__CLASS__, 'renderCheckboxField'),
|
162 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
163 |
-
array (
|
164 |
-
'label_for' => 'label_gallery_defaults_fancy',
|
165 |
-
'name' => 'gallery_defaults][fancy',
|
166 |
-
'value' => esc_attr($defaults['fancy']),
|
167 |
-
'option_name' => DG_OPTION_NAME,
|
168 |
-
'description' => __('Use auto-generated document thumbnails', 'document-gallery')
|
169 |
-
));
|
170 |
-
|
171 |
-
add_settings_field(
|
172 |
-
'gallery_defaults_images', 'images',
|
173 |
-
array(__CLASS__, 'renderCheckboxField'),
|
174 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
175 |
-
array (
|
176 |
-
'label_for' => 'label_gallery_defaults_images',
|
177 |
-
'name' => 'gallery_defaults][images',
|
178 |
-
'value' => esc_attr($defaults['images']),
|
179 |
-
'option_name' => DG_OPTION_NAME,
|
180 |
-
'description' => __('Include image attachments in gallery', 'document-gallery')
|
181 |
-
));
|
182 |
-
|
183 |
-
add_settings_field(
|
184 |
-
'gallery_defaults_localpost', 'localpost',
|
185 |
-
array(__CLASS__, 'renderCheckboxField'),
|
186 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
187 |
-
array (
|
188 |
-
'label_for' => 'label_gallery_defaults_localpost',
|
189 |
-
'name' => 'gallery_defaults][localpost',
|
190 |
-
'value' => esc_attr($defaults['localpost']),
|
191 |
-
'option_name' => DG_OPTION_NAME,
|
192 |
-
'description' => __('Only look for attachments in post where [dg] is used', 'document-gallery')
|
193 |
-
));
|
194 |
-
|
195 |
-
add_settings_field(
|
196 |
-
'gallery_defaults_order', 'order',
|
197 |
-
array(__CLASS__, 'renderSelectField'),
|
198 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
199 |
-
array (
|
200 |
-
'label_for' => 'label_gallery_defaults_order',
|
201 |
-
'name' => 'gallery_defaults][order',
|
202 |
-
'value' => esc_attr($defaults['order']),
|
203 |
-
'options' => DG_Gallery::getOrderOptions(),
|
204 |
-
'option_name' => DG_OPTION_NAME,
|
205 |
-
'description' => __('Ascending or descending sorting of documents', 'document-gallery')
|
206 |
-
));
|
207 |
-
|
208 |
-
add_settings_field(
|
209 |
-
'gallery_defaults_orderby', 'orderby',
|
210 |
-
array(__CLASS__, 'renderSelectField'),
|
211 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
212 |
-
array (
|
213 |
-
'label_for' => 'label_gallery_defaults_orderby',
|
214 |
-
'name' => 'gallery_defaults][orderby',
|
215 |
-
'value' => esc_attr($defaults['orderby']),
|
216 |
-
'options' => DG_Gallery::getOrderbyOptions(),
|
217 |
-
'option_name' => DG_OPTION_NAME,
|
218 |
-
'description' => __('Which field to order documents by', 'document-gallery')
|
219 |
-
));
|
220 |
-
|
221 |
-
add_settings_field(
|
222 |
-
'gallery_defaults_relation', 'relation',
|
223 |
-
array(__CLASS__, 'renderSelectField'),
|
224 |
-
DG_OPTION_NAME, 'gallery_defaults',
|
225 |
-
array (
|
226 |
-
'label_for' => 'label_gallery_defaults_relation',
|
227 |
-
'name' => 'gallery_defaults][relation',
|
228 |
-
'value' => esc_attr($defaults['relation']),
|
229 |
-
'options' => DG_Gallery::getRelationOptions(),
|
230 |
-
'option_name' => DG_OPTION_NAME,
|
231 |
-
'description' => __('Whether matched documents must have all taxa_names (AND) or at least one (OR)', 'document-gallery')
|
232 |
-
));
|
233 |
-
|
234 |
-
add_settings_field(
|
235 |
-
'thumbnail_generation_av', 'Audio/Video',
|
236 |
-
array(__CLASS__, 'renderCheckboxField'),
|
237 |
-
DG_OPTION_NAME, 'thumbnail_generation',
|
238 |
-
array (
|
239 |
-
'label_for' => 'label_thumbnail_generation_av',
|
240 |
-
'name' => 'thumbnail_generation][av',
|
241 |
-
'value' => esc_attr($active['av']),
|
242 |
-
'option_name' => DG_OPTION_NAME,
|
243 |
-
'description' => esc_html__('Locally generate thumbnails for audio & video files.', 'document-gallery')
|
244 |
-
));
|
245 |
-
|
246 |
-
add_settings_field(
|
247 |
-
'thumbnail_generation_gs', 'Ghostscript',
|
248 |
-
array(__CLASS__, 'renderCheckboxField'),
|
249 |
-
DG_OPTION_NAME, 'thumbnail_generation',
|
250 |
-
array (
|
251 |
-
'label_for' => 'label_thumbnail_generation_gs',
|
252 |
-
'name' => 'thumbnail_generation][gs',
|
253 |
-
'value' => esc_attr($active['gs']),
|
254 |
-
'option_name' => DG_OPTION_NAME,
|
255 |
-
'description' => DG_Thumber::isGhostscriptAvailable()
|
256 |
-
? __('Use <a href="http://www.ghostscript.com/" target="_blank">Ghostscript</a> for faster local PDF processing (compared to Imagick).', 'document-gallery')
|
257 |
-
: __('Your server is not configured to run <a href="http://www.ghostscript.com/" target="_blank">Ghostscript</a>.', 'document-gallery'),
|
258 |
-
'disabled' => !DG_Thumber::isGhostscriptAvailable()
|
259 |
-
));
|
260 |
-
|
261 |
-
add_settings_field(
|
262 |
-
'thumbnail_generation_imagick', 'Imagick',
|
263 |
-
array(__CLASS__, 'renderCheckboxField'),
|
264 |
-
DG_OPTION_NAME, 'thumbnail_generation',
|
265 |
-
array (
|
266 |
-
'label_for' => 'label_thumbnail_generation_imagick',
|
267 |
-
'name' => 'thumbnail_generation][imagick',
|
268 |
-
'value' => esc_attr($active['imagick']),
|
269 |
-
'option_name' => DG_OPTION_NAME,
|
270 |
-
'description' => DG_Thumber::isImagickAvailable()
|
271 |
-
? __('Use <a href="http://www.php.net/manual/en/book.imagick.php" target="_blank">Imagick</a> to handle lots of filetypes locally.', 'document-gallery')
|
272 |
-
: __('Your server is not configured to run <a href="http://www.php.net/manual/en/book.imagick.php" target="_blank">Imagick</a>.', 'document-gallery'),
|
273 |
-
'disabled' => !DG_Thumber::isImagickAvailable()
|
274 |
-
));
|
275 |
-
|
276 |
-
add_settings_field(
|
277 |
-
'thumbnail_generation_google', 'Google Drive Viewer',
|
278 |
-
array(__CLASS__, 'renderCheckboxField'),
|
279 |
-
DG_OPTION_NAME, 'thumbnail_generation',
|
280 |
-
array (
|
281 |
-
'label_for' => 'label_thumbnail_generation_google',
|
282 |
-
'name' => 'thumbnail_generation][google',
|
283 |
-
'value' => esc_attr($active['google']),
|
284 |
-
'option_name' => DG_OPTION_NAME,
|
285 |
-
'description' => DG_Thumber::isGoogleDriveAvailable()
|
286 |
-
? __('Use <a href="https://drive.google.com/viewer" target="_blank">Google Drive Viewer</a> to generate thumbnails for MS Office files and many other file types remotely.', 'document-gallery')
|
287 |
-
: __('Your server does not allow remote HTTP access.', 'document-gallery'),
|
288 |
-
'disabled' => !DG_Thumber::isGoogleDriveAvailable()
|
289 |
-
));
|
290 |
-
|
291 |
-
add_settings_field(
|
292 |
-
'thumbnail_generation_width', 'Max Thumbnail Dimensions',
|
293 |
-
array(__CLASS__, 'renderMultiTextField'),
|
294 |
-
DG_OPTION_NAME, 'thumbnail_generation',
|
295 |
-
array (
|
296 |
-
array (
|
297 |
-
'label_for' => 'label_advanced_width',
|
298 |
-
'name' => 'thumbnail_generation][width',
|
299 |
-
'value' => esc_attr($dg_options['thumber']['width']),
|
300 |
-
'type' => 'number" min="1" step="1',
|
301 |
-
'option_name' => DG_OPTION_NAME,
|
302 |
-
'description' => ' x '),
|
303 |
-
array (
|
304 |
-
'label_for' => 'label_advanced_height',
|
305 |
-
'name' => 'thumbnail_generation][height',
|
306 |
-
'value' => esc_attr($dg_options['thumber']['height']),
|
307 |
-
'type' => 'number" min="1" step="1',
|
308 |
-
'option_name' => DG_OPTION_NAME,
|
309 |
-
'description' => __('The max width and height (in pixels) that thumbnails will be generated.', 'document-gallery'))
|
310 |
-
));
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Registers settings for the thumbnail management tab.
|
315 |
-
*/
|
316 |
-
private static function registerThumbnailSettings() {
|
317 |
-
add_settings_section(
|
318 |
-
'thumbnail_table', '',
|
319 |
-
array(__CLASS__, 'renderThumbnailSection'), DG_OPTION_NAME);
|
320 |
-
}
|
321 |
-
|
322 |
-
/**
|
323 |
-
* Registers settings for the logging tab.
|
324 |
-
*/
|
325 |
-
private static function registerLoggingSettings() {
|
326 |
-
add_settings_section(
|
327 |
-
'logging_table', '',
|
328 |
-
array(__CLASS__, 'renderLoggingSection'), DG_OPTION_NAME);
|
329 |
-
}
|
330 |
-
|
331 |
-
/**
|
332 |
-
* Registers settings for the advanced tab.
|
333 |
-
*/
|
334 |
-
private static function registerAdvancedSettings() {
|
335 |
-
global $dg_options;
|
336 |
-
|
337 |
-
add_settings_section(
|
338 |
-
'advanced', __('Advanced Thumbnail Generation', 'document-gallery'),
|
339 |
-
array(__CLASS__, 'renderAdvancedSection'), DG_OPTION_NAME);
|
340 |
-
|
341 |
-
add_settings_field(
|
342 |
-
'advanced_logging', 'Logging',
|
343 |
-
array(__CLASS__, 'renderCheckboxField'),
|
344 |
-
DG_OPTION_NAME, 'advanced',
|
345 |
-
array (
|
346 |
-
'label_for' => 'label_advanced_logging',
|
347 |
-
'name' => 'logging',
|
348 |
-
'value' => esc_attr($dg_options['logging']),
|
349 |
-
'option_name' => DG_OPTION_NAME,
|
350 |
-
'description' => __('Whether to log debug and error information related to Document Gallery.', 'document-gallery')
|
351 |
-
));
|
352 |
-
|
353 |
-
add_settings_field(
|
354 |
-
'advanced_validation', 'Option Validation',
|
355 |
-
array(__CLASS__, 'renderCheckboxField'),
|
356 |
-
DG_OPTION_NAME, 'advanced',
|
357 |
-
array (
|
358 |
-
'label_for' => 'label_advanced_validation',
|
359 |
-
'name' => 'validation',
|
360 |
-
'value' => esc_attr($dg_options['validation']),
|
361 |
-
'option_name' => DG_OPTION_NAME,
|
362 |
-
'description' => __('Whether option structure should be validated before save. This is not generally necessary.', 'document-gallery')
|
363 |
-
));
|
364 |
-
|
365 |
-
add_settings_field(
|
366 |
-
'advanced_thumb_timeout', 'Thumbnail Generation Timeout',
|
367 |
-
array(__CLASS__, 'renderTextField'),
|
368 |
-
DG_OPTION_NAME, 'advanced',
|
369 |
-
array (
|
370 |
-
'label_for' => 'label_advanced_thumb_timeout',
|
371 |
-
'name' => 'timeout',
|
372 |
-
'value' => esc_attr($dg_options['thumber']['timeout']),
|
373 |
-
'type' => 'number" min="1" step="1',
|
374 |
-
'option_name' => DG_OPTION_NAME,
|
375 |
-
'description' => __('Max number of seconds to wait for thumbnail generation before defaulting to filetype icons.', 'document-gallery') .
|
376 |
-
' <em>' . __('Note that generation will continue where timeout happened next time the gallery is loaded.', 'document-gallery') . '</em>'));
|
377 |
-
|
378 |
-
add_settings_field(
|
379 |
-
'advanced_gs', 'Ghostscript Absolute Path',
|
380 |
-
array(__CLASS__, 'renderTextField'),
|
381 |
-
DG_OPTION_NAME, 'advanced',
|
382 |
-
array (
|
383 |
-
'label_for' => 'label_advanced_gs',
|
384 |
-
'name' => 'gs',
|
385 |
-
'value' => esc_attr($dg_options['thumber']['gs']),
|
386 |
-
'option_name' => DG_OPTION_NAME,
|
387 |
-
'description' => $dg_options['thumber']['gs']
|
388 |
-
? __('Successfully auto-detected the location of Ghostscript.', 'document-gallery')
|
389 |
-
: __('Failed to auto-detect the location of Ghostscript.', 'document-gallery')
|
390 |
-
));
|
391 |
-
|
392 |
-
add_settings_section(
|
393 |
-
'advanced_options_dump', __('Options Array Dump', 'document-gallery'),
|
394 |
-
array(__CLASS__, 'renderOptionsDumpSection'), DG_OPTION_NAME);
|
395 |
-
}
|
396 |
-
|
397 |
-
/**
|
398 |
-
* Validates submitted options, sanitizing any invalid options.
|
399 |
-
* @param array $values User-submitted new options.
|
400 |
-
* @return array Sanitized new options.
|
401 |
-
*/
|
402 |
-
public static function validateSettings($values) {
|
403 |
-
if (empty($values['tab']) || !array_key_exists($values['tab'], self::$tabs)) {
|
404 |
-
reset(self::$tabs);
|
405 |
-
$values['tab'] = key(self::$tabs);
|
406 |
-
}
|
407 |
-
$funct = 'validate'.$values['tab'].'Settings';
|
408 |
-
unset($values['tab']);
|
409 |
-
return DG_Admin::$funct($values);
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Validates general settings, sanitizing any invalid options.
|
414 |
-
* @param array $values User-submitted new options.
|
415 |
-
* @return array Sanitized new options.
|
416 |
-
*/
|
417 |
-
private static function validateGeneralSettings($values) {
|
418 |
-
global $dg_options;
|
419 |
-
$ret = $dg_options;
|
420 |
-
|
421 |
-
include_once DG_PATH . 'inc/class-gallery.php';
|
422 |
-
|
423 |
-
$thumbs_cleared = false;
|
424 |
-
|
425 |
-
// handle gallery shortcode defaults
|
426 |
-
$errs = array();
|
427 |
-
$ret['gallery'] = DG_Gallery::sanitizeDefaults($values['gallery_defaults'], $errs);
|
428 |
-
|
429 |
-
foreach ($errs as $k => $v) {
|
430 |
-
add_settings_error(DG_OPTION_NAME, str_replace('_', '-', $k), $v);
|
431 |
-
}
|
432 |
-
|
433 |
-
// handle setting width
|
434 |
-
if (isset($values['thumbnail_generation']['width'])) {
|
435 |
-
$width = (int)$values['thumbnail_generation']['width'];
|
436 |
-
if ($width > 0) {
|
437 |
-
$ret['thumber']['width'] = $width;
|
438 |
-
} else {
|
439 |
-
add_settings_error(DG_OPTION_NAME, 'thumber-width',
|
440 |
-
__('Invalid width given: ', 'document-gallery') . $values['thumbnail_generation']['width']);
|
441 |
-
}
|
442 |
-
|
443 |
-
unset($values['thumbnail_generation']['width']);
|
444 |
-
}
|
445 |
-
|
446 |
-
// handle setting height
|
447 |
-
if (isset($values['thumbnail_generation']['height'])) {
|
448 |
-
$height = (int)$values['thumbnail_generation']['height'];
|
449 |
-
if ($height > 0) {
|
450 |
-
$ret['thumber']['height'] = $height;
|
451 |
-
} else {
|
452 |
-
add_settings_error(DG_OPTION_NAME, 'thumber-height',
|
453 |
-
__('Invalid height given: ', 'document-gallery') . $values['thumbnail_generation']['height']);
|
454 |
-
}
|
455 |
-
|
456 |
-
unset($values['thumbnail_generation']['width']);
|
457 |
-
}
|
458 |
-
|
459 |
-
// delete thumb cache to force regeneration if max dimensions changed
|
460 |
-
if ($ret['thumber']['width'] !== $dg_options['thumber']['width'] ||
|
461 |
-
$ret['thumber']['height'] !== $dg_options['thumber']['height']) {
|
462 |
-
foreach ($ret['thumber']['thumbs'] as $v) {
|
463 |
-
if (isset($v['thumber'])) {
|
464 |
-
@unlink($v['thumb_path']);
|
465 |
-
}
|
466 |
-
}
|
467 |
-
|
468 |
-
$ret['thumber']['thumbs'] = array();
|
469 |
-
$thumbs_cleared = true;
|
470 |
-
}
|
471 |
-
|
472 |
-
// handle setting the active thumbers
|
473 |
-
foreach (array_keys($ret['thumber']['active']) as $k) {
|
474 |
-
$ret['thumber']['active'][$k] = isset($values['thumbnail_generation'][$k]);
|
475 |
-
}
|
476 |
-
|
477 |
-
// if new thumbers available, clear failed thumbnails for retry
|
478 |
-
if (!$thumbs_cleared) {
|
479 |
-
foreach ($dg_options['thumber']['active'] as $k => $v) {
|
480 |
-
if (!$v && $ret['thumber']['active'][$k]) {
|
481 |
-
foreach ($dg_options['thumber']['thumbs'] as $k => $v) {
|
482 |
-
if (empty($v['thumber'])) {
|
483 |
-
unset($ret['thumber']['thumbs'][$k]);
|
484 |
-
}
|
485 |
-
}
|
486 |
-
break;
|
487 |
-
}
|
488 |
-
}
|
489 |
-
}
|
490 |
-
|
491 |
-
// handle modified CSS
|
492 |
-
if (trim($ret['css']['text']) !== trim($values['css'])) {
|
493 |
-
$ret['css']['text'] = trim($values['css']);
|
494 |
-
$ret['css']['version']++;
|
495 |
-
$ret['css']['last-modified'] = gmdate('D, d M Y H:i:s');
|
496 |
-
$ret['css']['etag'] = md5($ret['css']['last-modified']);
|
497 |
-
|
498 |
-
if (empty($ret['css']['text'])) {
|
499 |
-
unset($ret['css']['minified']);
|
500 |
-
} else {
|
501 |
-
$ret['css']['minified'] = DocumentGallery::compileCustomCss($ret['css']['text']);
|
502 |
-
}
|
503 |
-
}
|
504 |
-
|
505 |
-
return $ret;
|
506 |
-
}
|
507 |
-
|
508 |
-
/**
|
509 |
-
* Validates thumbnail management settings, sanitizing any invalid options.
|
510 |
-
* @param array $values User-submitted new options.
|
511 |
-
* @return array Sanitized new options.
|
512 |
-
*/
|
513 |
-
private static function validateThumbnailSettings($values) {
|
514 |
-
global $dg_options;
|
515 |
-
$ret = $dg_options;
|
516 |
-
|
517 |
-
if (isset($values['ids'])) {
|
518 |
-
$deleted = array_values(array_intersect(array_keys($dg_options['thumber']['thumbs']), $values['ids']));
|
519 |
-
|
520 |
-
foreach ($deleted as $k) {
|
521 |
-
if (isset($ret['thumber']['thumbs'][$k]['thumber'])) {
|
522 |
-
@unlink($ret['thumber']['thumbs'][$k]['thumb_path']);
|
523 |
-
}
|
524 |
-
|
525 |
-
unset($ret['thumber']['thumbs'][$k]);
|
526 |
-
}
|
527 |
-
|
528 |
-
if (isset($values['ajax'])) {
|
529 |
-
echo '[' . implode(',', $deleted) . ']';
|
530 |
-
add_filter('wp_redirect', array(__CLASS__, '_exit'), 1, 0);
|
531 |
-
}
|
532 |
-
}
|
533 |
-
|
534 |
-
return $ret;
|
535 |
-
}
|
536 |
-
|
537 |
-
/**
|
538 |
-
* Validates logging settings, sanitizing any invalid options.
|
539 |
-
* @param array $values User-submitted new options.
|
540 |
-
* @return array Sanitized new options.
|
541 |
-
*/
|
542 |
-
private static function validateLoggingSettings($values) {
|
543 |
-
global $dg_options;
|
544 |
-
if (isset($values['clearLog'])) {
|
545 |
-
DG_Logger::clearLog();
|
546 |
-
}
|
547 |
-
return $dg_options;
|
548 |
-
}
|
549 |
-
|
550 |
-
/**
|
551 |
-
* Validates advanced settings, sanitizing any invalid options.
|
552 |
-
* @param array $values User-submitted new options.
|
553 |
-
* @return array Sanitized new options.
|
554 |
-
*/
|
555 |
-
private static function validateAdvancedSettings($values) {
|
556 |
-
global $dg_options;
|
557 |
-
$ret = $dg_options;
|
558 |
-
|
559 |
-
// handle setting the Ghostscript path
|
560 |
-
if (isset($values['gs']) &&
|
561 |
-
0 != strcmp($values['gs'], $ret['thumber']['gs'])) {
|
562 |
-
if (false === strpos($values['gs'], ';')) {
|
563 |
-
$ret['thumber']['gs'] = $values['gs'];
|
564 |
-
} else {
|
565 |
-
add_settings_error(DG_OPTION_NAME, 'thumber-gs',
|
566 |
-
__('Invalid Ghostscript path given: ', 'document-gallery') . $values['gs']);
|
567 |
-
}
|
568 |
-
}
|
569 |
-
|
570 |
-
// handle setting timeout
|
571 |
-
if (isset($values['timeout'])) {
|
572 |
-
$timeout = (int)$values['timeout'];
|
573 |
-
if ($timeout > 0) {
|
574 |
-
$ret['thumber']['timeout'] = $timeout;
|
575 |
-
} else {
|
576 |
-
add_settings_error(DG_OPTION_NAME, 'thumber-timeout',
|
577 |
-
__('Invalid timeout given: ', 'document-gallery') . $values['timeout']);
|
578 |
-
}
|
579 |
-
}
|
580 |
-
|
581 |
-
// validation checkbox
|
582 |
-
$ret['validation'] = isset($values['validation']);
|
583 |
-
|
584 |
-
// logging checkbox
|
585 |
-
$ret['logging'] = isset($values['logging']);
|
586 |
-
|
587 |
-
return $ret;
|
588 |
-
}
|
589 |
-
|
590 |
-
/**
|
591 |
-
* @return bool Whether to register settings.
|
592 |
-
*/
|
593 |
-
public static function doRegisterSettings() {
|
594 |
-
if (!is_multisite()) {
|
595 |
-
$script = !empty($GLOBALS['pagenow']) ? $GLOBALS['pagenow'] : null;
|
596 |
-
} else {
|
597 |
-
$script = parse_url($_SERVER['REQUEST_URI']);
|
598 |
-
$script = basename($script['path']);
|
599 |
-
}
|
600 |
-
|
601 |
-
return !empty($script) && ('options-general.php' === $script || 'options.php' === $script);
|
602 |
-
}
|
603 |
-
|
604 |
-
/**
|
605 |
-
* Render the Default Settings section.
|
606 |
-
*/
|
607 |
-
public static function renderDefaultSettingsSection() { ?>
|
608 |
-
<p><?php _e('The following values will be used by default in the shortcode. You can still manually set each of these values in each individual shortcode.', 'document-gallery'); ?></p>
|
609 |
-
<?php }
|
610 |
-
|
611 |
-
/**
|
612 |
-
* Render the Thumber section.
|
613 |
-
*/
|
614 |
-
public static function renderThumberSection() { ?>
|
615 |
-
<p><?php _e('Select which tools to use when generating thumbnails.', 'document-gallery'); ?></p>
|
616 |
-
<?php }
|
617 |
-
|
618 |
-
/**
|
619 |
-
* Renders a text field for use when modifying the CSS to be printed in addition to the default CSS.
|
620 |
-
*/
|
621 |
-
public static function renderCssSection() {
|
622 |
-
global $dg_options; ?>
|
623 |
-
<p><?php printf(
|
624 |
-
__('Enter custom CSS styling for use with document galleries. To see which ids and classes you can style, take a look at <a href="%s" target="_blank">style.css</a>.'),
|
625 |
-
DG_URL . 'assets/css/style.css'); ?></p>
|
626 |
-
<table class="form-table">
|
627 |
-
<tbody>
|
628 |
-
<tr valign="top">
|
629 |
-
<td>
|
630 |
-
<textarea name="<?php echo DG_OPTION_NAME; ?>[css]" rows="10" cols="50" class="large-text code"><?php echo $dg_options['css']['text']; ?></textarea>
|
631 |
-
</td>
|
632 |
-
</tr>
|
633 |
-
</tbody>
|
634 |
-
</table>
|
635 |
-
<?php }
|
636 |
-
|
637 |
-
/**
|
638 |
-
* Render the Thumber Advanced section.
|
639 |
-
*/
|
640 |
-
public static function renderAdvancedSection() {
|
641 |
-
include_once DG_PATH . 'inc/class-thumber.php';?>
|
642 |
-
<p><?php _e('Unless you <em>really</em> know what you\'re doing, you should not touch these values.', 'document-gallery'); ?></p>
|
643 |
-
<?php if (!DG_Thumber::isExecAvailable()) : ?>
|
644 |
-
<p>
|
645 |
-
<em><?php _e('NOTE: <code>exec()</code> is not accessible. Ghostscript will not function.', 'document-gallery'); ?></em>
|
646 |
-
</p>
|
647 |
-
<?php endif; ?>
|
648 |
-
<?php }
|
649 |
-
|
650 |
-
/**
|
651 |
-
* Renders a readonly textfield containing a dump of current DG options.
|
652 |
-
*/
|
653 |
-
public static function renderOptionsDumpSection() {
|
654 |
-
global $dg_options; ?>
|
655 |
-
<p><?php
|
656 |
-
_e('The following <em>readonly text</em> should be provided when <a href="http://wordpress.org/support/plugin/document-gallery" target="_blank">reporting a bug</a>:', 'documet-gallery');
|
657 |
-
?></p>
|
658 |
-
<table class="form-table">
|
659 |
-
<tbody>
|
660 |
-
<tr valign="top">
|
661 |
-
<td>
|
662 |
-
<textarea readonly="true" rows="10" cols="50" id="options-dump" class="large-text code"><?php var_dump($dg_options); ?></textarea>
|
663 |
-
</td>
|
664 |
-
</tr>
|
665 |
-
</tbody>
|
666 |
-
</table>
|
667 |
-
<?php }
|
668 |
-
|
669 |
-
/**
|
670 |
-
* Render the Thumbnail table.
|
671 |
-
*/
|
672 |
-
public static function renderThumbnailSection() {
|
673 |
-
include_once DG_PATH . 'inc/class-thumber.php';
|
674 |
-
$options = DG_Thumber::getOptions();
|
675 |
-
|
676 |
-
$URL_params = array('page' => DG_OPTION_NAME, 'tab' => 'Thumbnail');
|
677 |
-
$att_ids = array();
|
678 |
-
|
679 |
-
if (isset($_REQUEST['orderby']) && in_array(strtolower($_REQUEST['orderby']), array('title', 'date'))) {
|
680 |
-
$orderby = strtolower($_REQUEST['orderby']);
|
681 |
-
$URL_params['orderby'] = $orderby;
|
682 |
-
|
683 |
-
switch ($orderby)
|
684 |
-
{
|
685 |
-
case 'date':
|
686 |
-
foreach ($options['thumbs'] as $key => $node) {
|
687 |
-
$keyArray[$key] = $node['timestamp'];
|
688 |
-
$options['thumbs'][$key]['thumb_id'] = $att_ids[] = $key;
|
689 |
-
}
|
690 |
-
break;
|
691 |
-
|
692 |
-
case 'title':
|
693 |
-
foreach ($options['thumbs'] as $key => $node) {
|
694 |
-
$keyArray[$key] = basename($node['thumb_path']);
|
695 |
-
$options['thumbs'][$key]['thumb_id'] = $att_ids[] = $key;
|
696 |
-
}
|
697 |
-
break;
|
698 |
-
}
|
699 |
-
|
700 |
-
$order = strtolower($_REQUEST['order']);
|
701 |
-
if (!isset($_REQUEST['order']) || !in_array($order, array('asc', 'desc'))) {
|
702 |
-
$order = 'asc';
|
703 |
-
}
|
704 |
-
$URL_params['order'] = $order;
|
705 |
-
|
706 |
-
if ($order == 'asc') {
|
707 |
-
array_multisort($keyArray, SORT_ASC, $options['thumbs']);
|
708 |
-
} else {
|
709 |
-
array_multisort($keyArray, SORT_DESC, $options['thumbs']);
|
710 |
-
}
|
711 |
-
} else {
|
712 |
-
$orderby = '';
|
713 |
-
foreach ($options['thumbs'] as $key => $node) {
|
714 |
-
$options['thumbs'][$key]['thumb_id'] = $att_ids[] = $key;
|
715 |
-
}
|
716 |
-
}
|
717 |
-
|
718 |
-
static $limit_options = array(10, 25, 75);
|
719 |
-
if (!isset($_REQUEST['limit']) || !in_array(intval($_REQUEST['limit']), $limit_options)) {
|
720 |
-
$limit = $limit_options[0];
|
721 |
-
} else {
|
722 |
-
$limit = intval($_REQUEST['limit']);
|
723 |
-
}
|
724 |
-
|
725 |
-
$URL_params['limit'] = $limit;
|
726 |
-
$select_limit = '';
|
727 |
-
foreach ($limit_options as $l_o) {
|
728 |
-
$select_limit .= '<option value="'.$l_o.'"'.selected($limit, $l_o, false).'>'.$l_o.'</option>'.PHP_EOL;
|
729 |
-
}
|
730 |
-
$thumbs_number = count($options['thumbs']);
|
731 |
-
$lastsheet = ceil($thumbs_number/$limit);
|
732 |
-
$sheet = isset($_REQUEST['sheet']) ? intval($_REQUEST['sheet']) : 1;
|
733 |
-
if ($sheet <= 0 || $sheet > $lastsheet) {
|
734 |
-
$sheet = 1;
|
735 |
-
}
|
736 |
-
|
737 |
-
$offset = ($sheet - 1) * $limit;
|
738 |
-
|
739 |
-
$att_ids = array_slice($att_ids, $offset, $limit);
|
740 |
-
$atts = get_posts(
|
741 |
-
array(
|
742 |
-
'post_type' => 'attachment',
|
743 |
-
'post_status' => 'inherit',
|
744 |
-
'numberposts' => -1,
|
745 |
-
'post__in' => $att_ids,
|
746 |
-
'orderby' => 'post__in'
|
747 |
-
));
|
748 |
-
$titles = array();
|
749 |
-
foreach ($atts as $att) {
|
750 |
-
$path_parts = pathinfo($att->guid);
|
751 |
-
$titles[$att->ID] = $att->post_title.'.'.$path_parts['extension'];
|
752 |
-
}
|
753 |
-
unset($atts);
|
754 |
-
|
755 |
-
$thead = '<tr>'.
|
756 |
-
'<th scope="col" class="manage-column column-cb check-column">'.
|
757 |
-
'<label class="screen-reader-text" for="cb-select-all-%1$d">'.__('Select All', 'document-gallery').'</label>'.
|
758 |
-
'<input id="cb-select-all-%1$d" type="checkbox">'.
|
759 |
-
'</th>'.
|
760 |
-
'<th scope="col" class="manage-column column-icon">'.__('Thumbnail', 'document-gallery').'</th>'.
|
761 |
-
'<th scope="col" class="manage-column column-title '.(($orderby != 'title')?'sortable desc':'sorted '.$order).'"><a href="?'.http_build_query(array_merge($URL_params, array('orderby'=>'title','order'=>(($orderby != 'title')?'asc':(($order == 'asc')?'desc':'asc'))))).'"><span>'.__('File name', 'document-gallery').'</span><span class="sorting-indicator"></span></th>'.
|
762 |
-
'<th scope="col" class="manage-column column-date '.(($orderby != 'date')?'sortable asc':'sorted '.$order).'"><a href="?'.http_build_query(array_merge($URL_params, array('orderby'=>'date','order'=>(($orderby != 'date')?'desc':(($order == 'asc')?'desc':'asc'))))).'"><span>'.__('Date', 'document-gallery').'</span><span class="sorting-indicator"></span></th>'.
|
763 |
-
'</tr>';
|
764 |
-
|
765 |
-
$pagination = '<div class="alignleft bulkactions"><button class="button action deleteSelected">'.__('Delete Selected', 'document-gallery').'</button></div><div class="tablenav-pages">'.
|
766 |
-
'<span class="displaying-num">'.
|
767 |
-
$thumbs_number.' '._n('item', 'items', $thumbs_number).
|
768 |
-
'</span>'.($lastsheet>1?
|
769 |
-
'<span class="pagination-links">'.
|
770 |
-
'<a class="first-page'.( $sheet==1 ? ' disabled' : '').'" title="'.__('Go to the first page', 'document-gallery').'"'.( $sheet==1 ? '' : ' href="?'.http_build_query($URL_params).'"').'>«</a>'.
|
771 |
-
'<a class="prev-page'.( $sheet==1 ? ' disabled' : '').'" title="'.__('Go to the previous page', 'document-gallery').'"'.( $sheet==1 ? '' : ' href="?'.http_build_query(array_merge($URL_params, array('sheet'=>$sheet-1))).'"').'>‹</a>'.
|
772 |
-
'<span class="paging-input">'.
|
773 |
-
'<input class="current-page" title="'.__('Current page', 'document-gallery').'" type="text" name="paged" value="'.$sheet.'" size="'.strlen($sheet).'" maxlength="'.strlen($sheet).'"> '.__('of', 'document-gallery').' <span class="total-pages">'.$lastsheet.'</span></span>'.
|
774 |
-
'<a class="next-page'.( $sheet==$lastsheet ? ' disabled' : '').'" title="'.__('Go to the next page', 'document-gallery').'"'.( $sheet==$lastsheet ? '' : ' href="?'.http_build_query(array_merge($URL_params, array('sheet'=>$sheet+1))).'"').'>›</a>'.
|
775 |
-
'<a class="last-page'.( $sheet==$lastsheet ? ' disabled' : '').'" title="'.__('Go to the last page', 'document-gallery').'"'.( $sheet==$lastsheet ? '' : ' href="?'.http_build_query(array_merge($URL_params, array('sheet'=>$lastsheet))).'"').'>»</a>'.
|
776 |
-
'</span>':' <b>|</b> ').
|
777 |
-
'<span class="displaying-num"><select dir="rtl" class="limit_per_page">'.$select_limit.'</select> '.__('items per page', 'document-gallery').'</span>'.
|
778 |
-
'</div>'.
|
779 |
-
'<br class="clear" />';
|
780 |
-
|
781 |
-
// Avoiding json_encode to avoid compatibility issues on some systems
|
782 |
-
$json_like = '';
|
783 |
-
foreach ($URL_params as $k => $v) {
|
784 |
-
$json_like .= '"'.$k.'":"'.$v.'",';
|
785 |
-
}
|
786 |
-
?>
|
787 |
-
|
788 |
-
<script type="text/javascript">
|
789 |
-
var URL_params = <?php echo '{'.trim($json_like,', ').'}'; ?>;
|
790 |
-
</script>
|
791 |
-
<div class="thumbs-list-wrapper">
|
792 |
-
<div>
|
793 |
-
<div class="tablenav top"><?php echo $pagination; ?></div>
|
794 |
-
<table id="ThumbsTable" class="wp-list-table widefat fixed media"
|
795 |
-
cellpadding="0" cellspacing="0">
|
796 |
-
<thead>
|
797 |
-
<?php printf($thead, 1); ?>
|
798 |
-
</thead>
|
799 |
-
<tfoot>
|
800 |
-
<?php printf($thead, 2); ?>
|
801 |
-
</tfoot>
|
802 |
-
<tbody><?php
|
803 |
-
$i = 0;
|
804 |
-
foreach ($options['thumbs'] as $v) {
|
805 |
-
if ($i < $offset) { $i++; continue; }
|
806 |
-
if (++$i > $offset + $limit) { break; }
|
807 |
-
|
808 |
-
$icon = isset($v['thumb_url']) ? $v['thumb_url'] : DG_URL . 'assets/icons/missing.png';
|
809 |
-
$title = isset($titles[$v['thumb_id']]) ? $titles[$v['thumb_id']] : '';
|
810 |
-
$date = DocumentGallery::localDateTimeFromTimestamp($v['timestamp']);
|
811 |
-
|
812 |
-
echo '<tr><td scope="row" class="check-column"><input type="checkbox" class="cb-ids" name="' . DG_OPTION_NAME . '[ids][]" value="' .
|
813 |
-
$v['thumb_id'].'"></td><td class="column-icon media-icon"><img src="' .
|
814 |
-
$icon.'" />'.'</td><td class="title column-title">' .
|
815 |
-
($title ? '<strong><a href="' . home_url('/?attachment_id='.$v['thumb_id']).'" target="_blank" title="'.__('View', 'document-gallery').' \'' .
|
816 |
-
$title.'\' '.__('attachment page', 'document-gallery').'">'.$title.'</a></strong>' : __('Attachment not found', 'document-gallery')) .
|
817 |
-
'</td><td class="date column-date">'.$date.'</td></tr>'.PHP_EOL;
|
818 |
-
} ?>
|
819 |
-
</tbody>
|
820 |
-
</table>
|
821 |
-
<div class="tablenav bottom"><?php echo $pagination; ?></div>
|
822 |
-
</div>
|
823 |
-
</div>
|
824 |
-
<?php }
|
825 |
-
/**
|
826 |
-
* Render the Logging table.
|
827 |
-
*/
|
828 |
-
public static function renderLoggingSection() {
|
829 |
-
$log_list = DG_Logger::readLog();
|
830 |
-
if ($log_list) {
|
831 |
-
$levels = array_map(array(__CLASS__, 'getLogLabelSpan'), array_keys(DG_LogLevel::getLogLevels()));
|
832 |
-
|
833 |
-
$thead = '<tr>'.
|
834 |
-
'<th scope="col" class="manage-column column-date"><span>'.__('Date', 'document-gallery').'</span></th>'.
|
835 |
-
'<th scope="col" class="manage-column column-level"><span>'.__('Level', 'document-gallery').'</span></th>'.
|
836 |
-
'<th scope="col" class="manage-column column-message"><span>'.__('Message', 'document-gallery').'</span></th>'.
|
837 |
-
'</tr>';
|
838 |
-
|
839 |
-
?>
|
840 |
-
<div class="log-list-wrapper">
|
841 |
-
<div>
|
842 |
-
<div class="tablenav top">
|
843 |
-
<div class="alignleft bulkactions">
|
844 |
-
<button class="action expandAll">
|
845 |
-
<?php echo __('Expand All', 'document-gallery'); ?>
|
846 |
-
</button>
|
847 |
-
<button class="action collapseAll">
|
848 |
-
<?php echo __('Collapse All', 'document-gallery'); ?>
|
849 |
-
</button>
|
850 |
-
</div>
|
851 |
-
<div class="levelSelector">
|
852 |
-
<input type="checkbox" id="allLevels" name="lswitch" value="all" checked />
|
853 |
-
<label for="allLevels" class="allLevels">ALL</label>
|
854 |
-
<?php
|
855 |
-
foreach (array_keys(DG_LogLevel::getLogLevels()) as $k) { ?>
|
856 |
-
<?php
|
857 |
-
$lower = strtolower($k);
|
858 |
-
$upper = strtoupper($k);
|
859 |
-
?>
|
860 |
-
<input type="checkbox" id="<?php echo $lower; ?>Level" name="lswitch" value="<?php echo $lower; ?>" checked />
|
861 |
-
<label for="<?php echo $lower; ?>Level" class="<?php echo $lower; ?>Level"><?php echo $upper; ?></label>
|
862 |
-
<?php }
|
863 |
-
?>
|
864 |
-
</div>
|
865 |
-
</div>
|
866 |
-
<table id="LogTable" class="wp-list-table widefat fixed media" cellpadding="0" cellspacing="0">
|
867 |
-
<thead>
|
868 |
-
<?php echo $thead; ?>
|
869 |
-
</thead>
|
870 |
-
<tfoot>
|
871 |
-
<?php echo $thead; ?>
|
872 |
-
</tfoot>
|
873 |
-
<tbody><?php
|
874 |
-
$i = 0;
|
875 |
-
foreach ($log_list as $v) {
|
876 |
-
$date = DocumentGallery::localDateTimeFromTimestamp($v[0]);
|
877 |
-
$v[2] = preg_replace('/ (attachment #)(\d+) /', ' <a href="' . home_url() . '/?attachment_id=\2" target="_blank">\1<strong>\2</strong></a> ', $v[2]);
|
878 |
-
$v[2] = preg_replace('/^(\(\w+::\w+\)) /', '<strong>\1</strong> ', $v[2]);
|
879 |
-
$v[2] = preg_replace('/(\(?\w+::\w+\)?)/m', '<i>\1</i>', $v[2]);
|
880 |
-
|
881 |
-
echo '<tr><td class="date column-date" data-sort-value="'.$v[0].'"><span class="logLabel date">'.$date.'</span></td>' .
|
882 |
-
'<td class="column-level">'.$levels[$v[1]].'</td>' .
|
883 |
-
'<td class="column-entry">'.(empty($v[3]) ? '<pre>'.$v[2].'</pre>' : '<div class="expander" title="Click to Expand"><pre>'.$v[2].'</pre><div><span class="dashicons dashicons-arrow-down-alt2"></span></div></div><div class="spoiler-body"><pre>'.$v[3].'</pre></div>').'</td>' .
|
884 |
-
'</tr>'.PHP_EOL;
|
885 |
-
} ?>
|
886 |
-
</tbody>
|
887 |
-
</table>
|
888 |
-
<div class="tablenav bottom">
|
889 |
-
<div class="alignright bulkactions">
|
890 |
-
<button class="button action clearLog" name = '<?php echo DG_OPTION_NAME; ?>[clearLog]' value = 'true'>
|
891 |
-
<?php echo __('Clear Log', 'document-gallery'); ?>
|
892 |
-
</button>
|
893 |
-
</div>
|
894 |
-
</div>
|
895 |
-
</div>
|
896 |
-
</div>
|
897 |
-
<?php } else {
|
898 |
-
echo '<div class="noLog">'.__('There are no log entries at this time.', 'document-gallery').'<br />'.__('For Your information:', 'document-gallery').' <strong><i>'.__('Logging', 'document-gallery').'</i></strong> '.(DG_Logger::logEnabled()?'<span class="loggingON">'.__('is turned ON', 'document-gallery').'!</span>':'<span class="loggingOFF">'.__('is turned OFF', 'document-gallery').'!</span>').'</div>';
|
899 |
-
}
|
900 |
-
}
|
901 |
-
|
902 |
-
/**
|
903 |
-
* Takes label name and returns SPAN tag.
|
904 |
-
* @param string $e label name.
|
905 |
-
* @return string SPAN tag
|
906 |
-
*/
|
907 |
-
private static function getLogLabelSpan($e) {
|
908 |
-
return '<span class="logLabel ' . strtolower($e) . '">' . strtoupper($e) . '</span>';
|
909 |
-
}
|
910 |
-
|
911 |
-
/**
|
912 |
-
* Render a checkbox field.
|
913 |
-
* @param array $args
|
914 |
-
*/
|
915 |
-
public static function renderCheckboxField($args) {
|
916 |
-
$args['disabled'] = isset($args['disabled']) ? $args['disabled'] : false;
|
917 |
-
printf('<label><input type="checkbox" value="1" name="%1$s[%2$s]" id="%3$s" %4$s %5$s/> %6$s</label>',
|
918 |
-
$args['option_name'],
|
919 |
-
$args['name'],
|
920 |
-
$args['label_for'],
|
921 |
-
checked($args['value'], 1, false),
|
922 |
-
$args['disabled'] ? 'disabled="disabled"' : '',
|
923 |
-
$args['description']);
|
924 |
-
}
|
925 |
-
|
926 |
-
/**
|
927 |
-
* Render a text field.
|
928 |
-
* @param array $args
|
929 |
-
*/
|
930 |
-
public static function renderTextField($args) {
|
931 |
-
printf('<input type="%1$s" value="%2$s" name="%3$s[%4$s]" id="%5$s" /> %6$s',
|
932 |
-
isset($args['type']) ? $args['type'] : 'text',
|
933 |
-
$args['value'],
|
934 |
-
$args['option_name'],
|
935 |
-
$args['name'],
|
936 |
-
$args['label_for'],
|
937 |
-
$args['description']);
|
938 |
-
}
|
939 |
-
|
940 |
-
/**
|
941 |
-
* Accepts a two-dimensional array where each inner array consists of valid arguments for renderTextField.
|
942 |
-
* @param array $args
|
943 |
-
*/
|
944 |
-
public static function renderMultiTextField($args) {
|
945 |
-
foreach ($args as $arg) {
|
946 |
-
self::renderTextField($arg);
|
947 |
-
}
|
948 |
-
}
|
949 |
-
|
950 |
-
/**
|
951 |
-
* Render a select field.
|
952 |
-
* @param array $args
|
953 |
-
*/
|
954 |
-
public static function renderSelectField($args) {
|
955 |
-
printf('<select name="%1$s[%2$s]" id="%3$s">',
|
956 |
-
$args['option_name'],
|
957 |
-
$args['name'],
|
958 |
-
$args['label_for']);
|
959 |
-
|
960 |
-
foreach ($args['options'] as $val) {
|
961 |
-
printf('<option value="%1$s" %2$s>%3$s</option>',
|
962 |
-
$val,
|
963 |
-
selected($val, $args['value'], false),
|
964 |
-
$val,
|
965 |
-
$args['description']);
|
966 |
-
}
|
967 |
-
|
968 |
-
print '</select> ' . $args['description'];
|
969 |
-
}
|
970 |
-
|
971 |
-
/**
|
972 |
-
* Wraps the PHP exit language construct.
|
973 |
-
*/
|
974 |
-
public static function _exit() {
|
975 |
-
exit;
|
976 |
-
}
|
977 |
-
|
978 |
-
/**
|
979 |
-
* Blocks instantiation. All functions are static.
|
980 |
-
*/
|
981 |
-
private function __construct() {
|
982 |
-
|
983 |
-
}
|
984 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin.css
DELETED
@@ -1,288 +0,0 @@
|
|
1 |
-
div.thumbs-list-wrapper, div.log-list-wrapper{
|
2 |
-
text-align:center;
|
3 |
-
margin-top: 1.5em;
|
4 |
-
}
|
5 |
-
div.thumbs-list-wrapper>div, div.log-list-wrapper>div{
|
6 |
-
margin: 0 auto;
|
7 |
-
display: inline-block;
|
8 |
-
}
|
9 |
-
#ThumbsTable, #LogTable{
|
10 |
-
border: none;
|
11 |
-
box-shadow: none;
|
12 |
-
-webkit-box-shadow: none;
|
13 |
-
-moz-box-shadow: none;
|
14 |
-
border-radius: 10px;
|
15 |
-
-webkit-border-radius: 10px;
|
16 |
-
-moz-border-radius: 10px;
|
17 |
-
background: #B9C9FE;
|
18 |
-
color: #039;
|
19 |
-
width: auto;
|
20 |
-
margin: 10px auto;
|
21 |
-
}
|
22 |
-
#ThumbsTable tbody, #LogTable tbody {
|
23 |
-
background: #e8edff;
|
24 |
-
color: #669;
|
25 |
-
}
|
26 |
-
#ThumbsTable>tbody>tr:hover, #LogTable>tbody>tr:hover {
|
27 |
-
background: #d0dafd;
|
28 |
-
}
|
29 |
-
#ThumbsTable>tbody>tr:not(:last-child) td, #LogTable>tbody>tr:not(:last-child) td {
|
30 |
-
border-bottom-color: #b9c9fe;
|
31 |
-
border-bottom-style: solid;
|
32 |
-
border-bottom-width: 1px;
|
33 |
-
}
|
34 |
-
#ThumbsTable td, #ThumbsTable th, #LogTable td, #LogTable th{
|
35 |
-
text-align: center;
|
36 |
-
vertical-align: middle;
|
37 |
-
margin: 0;
|
38 |
-
padding: 4px;
|
39 |
-
}
|
40 |
-
#LogTable td {
|
41 |
-
text-align: left;
|
42 |
-
}
|
43 |
-
td.title.column-title{
|
44 |
-
text-align: left !important;
|
45 |
-
}
|
46 |
-
#ThumbsTable img{
|
47 |
-
display: block;
|
48 |
-
margin: 5px auto;
|
49 |
-
}
|
50 |
-
#LogTable td > pre, .spoiler-body > pre, .expander pre, .collapser pre {
|
51 |
-
margin: 0;
|
52 |
-
display: inline-block;
|
53 |
-
white-space: pre-line;
|
54 |
-
}
|
55 |
-
tr.selected{
|
56 |
-
background: #B6ADCE;
|
57 |
-
}
|
58 |
-
tr.selected:hover{
|
59 |
-
background: #D8D3E5 !important;
|
60 |
-
}
|
61 |
-
.column-date, .column-level, .check-column, .column-icon {
|
62 |
-
white-space: nowrap;
|
63 |
-
}
|
64 |
-
.column-entry, .column-title {
|
65 |
-
width: 100%;
|
66 |
-
}
|
67 |
-
.nav-tab:before, .deleteSelected:before, .clearLog:before, .expandAll:before, .collapseAll:before, .logLabel.date:before, .collapser:after, .expander:after{
|
68 |
-
display: inline-block;
|
69 |
-
-webkit-font-smoothing: antialiased;
|
70 |
-
font: normal 20px/1 'dashicons';
|
71 |
-
vertical-align: text-bottom;
|
72 |
-
padding-right: 5px;
|
73 |
-
}
|
74 |
-
.General-tab:before{
|
75 |
-
content: '\f108';
|
76 |
-
}
|
77 |
-
.Thumbnail-tab:before{
|
78 |
-
content: '\f233';
|
79 |
-
}
|
80 |
-
.Logging-tab:before{
|
81 |
-
content: '\f163';
|
82 |
-
}
|
83 |
-
.Advanced-tab:before{
|
84 |
-
content: '\f332';
|
85 |
-
}
|
86 |
-
.deleteSelected:before, .clearLog:before{
|
87 |
-
content: '\f182';
|
88 |
-
}
|
89 |
-
.expandAll:before {
|
90 |
-
content: '\f211';
|
91 |
-
}
|
92 |
-
.collapseAll:before {
|
93 |
-
content: '\f506';
|
94 |
-
}
|
95 |
-
.expandAll, .collapseAll {
|
96 |
-
display: none;
|
97 |
-
}
|
98 |
-
#ThumbsTable .title a:after, #LogTable>tbody a:after{
|
99 |
-
content: '\f504';
|
100 |
-
display: inline-block;
|
101 |
-
-webkit-font-smoothing: antialiased;
|
102 |
-
font-family: 'dashicons';
|
103 |
-
font-size: inherit;
|
104 |
-
font-style: normal;
|
105 |
-
font-variant: normal;
|
106 |
-
font-weight: normal;
|
107 |
-
line-height: 1;
|
108 |
-
vertical-align: inherit;
|
109 |
-
padding-left: 5px;
|
110 |
-
}
|
111 |
-
#LogTable>tbody a {
|
112 |
-
-webkit-transition: none;
|
113 |
-
transition: none;
|
114 |
-
text-decoration: none;
|
115 |
-
outline: 0;
|
116 |
-
}
|
117 |
-
#LogTable>tbody pre strong {
|
118 |
-
font-weight: bolder;
|
119 |
-
}
|
120 |
-
#LogTable>tbody a:active, #LogTable>tbody a:hover {
|
121 |
-
color: #2ea2cc;
|
122 |
-
}
|
123 |
-
.levelSelector {
|
124 |
-
float: right;
|
125 |
-
}
|
126 |
-
.logLabel {
|
127 |
-
padding: 0 10px;
|
128 |
-
color: #fff !important;
|
129 |
-
text-decoration: none;
|
130 |
-
font-weight: bolder;
|
131 |
-
border: none !important;
|
132 |
-
float:left;
|
133 |
-
margin-left: 1px;
|
134 |
-
margin-top: 1px;
|
135 |
-
-webkit-border-radius: 100px;
|
136 |
-
-moz-border-radius: 100px;
|
137 |
-
border-radius: 100px;
|
138 |
-
cursor: context-menu;
|
139 |
-
}
|
140 |
-
.logLabel.warning {
|
141 |
-
background: #F89406;
|
142 |
-
}
|
143 |
-
.logLabel.detail {
|
144 |
-
background: #3A87AD;
|
145 |
-
}
|
146 |
-
.logLabel.error {
|
147 |
-
background: #CC0000;
|
148 |
-
}
|
149 |
-
.logLabel.date {
|
150 |
-
background: #999999;
|
151 |
-
white-space: nowrap;
|
152 |
-
font-weight: inherit;
|
153 |
-
}
|
154 |
-
.logLabel.date:before{
|
155 |
-
font-size: inherit;
|
156 |
-
vertical-align: middle;
|
157 |
-
padding-bottom: 0.2em;
|
158 |
-
content: '\f469';
|
159 |
-
}
|
160 |
-
.spoiler-body {
|
161 |
-
padding: 1px 6px 2px;
|
162 |
-
display: none;
|
163 |
-
border-top: 1px solid #C3CBD1;
|
164 |
-
background: #F5F5F5;
|
165 |
-
}
|
166 |
-
.column-entry {
|
167 |
-
text-align: left !important;
|
168 |
-
}
|
169 |
-
.expander pre, .collapser pre {
|
170 |
-
vertical-align: middle;
|
171 |
-
float: left;
|
172 |
-
white-space: pre-wrap;
|
173 |
-
}
|
174 |
-
.expander, .collapser {
|
175 |
-
display: table;
|
176 |
-
vertical-align: middle;
|
177 |
-
width: 100%;
|
178 |
-
cursor: pointer;
|
179 |
-
}
|
180 |
-
.expander > div, .collapser > div {
|
181 |
-
display: table-cell;
|
182 |
-
vertical-align: middle;
|
183 |
-
height: 100%;
|
184 |
-
}
|
185 |
-
.dashicons.dashicons-arrow-down-alt2, .dashicons.dashicons-arrow-up-alt2 {
|
186 |
-
float: right;
|
187 |
-
padding-right: 15px;
|
188 |
-
}
|
189 |
-
.levelSelector > * {
|
190 |
-
-webkit-touch-callout: none;
|
191 |
-
-webkit-user-select: none;
|
192 |
-
-khtml-user-select: none;
|
193 |
-
-moz-user-select: none;
|
194 |
-
-ms-user-select: none;
|
195 |
-
user-select: none;
|
196 |
-
}
|
197 |
-
.levelSelector > input[type=checkbox] {
|
198 |
-
display:none;
|
199 |
-
}
|
200 |
-
.levelSelector > input[type=checkbox] + label {
|
201 |
-
color: #6B6B6B;
|
202 |
-
font-weight: bolder;
|
203 |
-
margin: 4px 0px;
|
204 |
-
overflow: auto;
|
205 |
-
text-align: center;
|
206 |
-
padding: 3px 8px;
|
207 |
-
display: table-cell;
|
208 |
-
background-color: #f5f5f5;
|
209 |
-
background-image: -moz-linear-gradient(top,#fff,#e6e6e6);
|
210 |
-
background-image: -webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));
|
211 |
-
background-image: -webkit-linear-gradient(top,#fff,#e6e6e6);
|
212 |
-
background-image: -o-linear-gradient(top,#fff,#e6e6e6);
|
213 |
-
background-image: linear-gradient(to bottom,#fff,#e6e6e6);
|
214 |
-
background-repeat: repeat-x;
|
215 |
-
border: 1px solid #ccc;
|
216 |
-
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
217 |
-
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);
|
218 |
-
border-bottom-color: #b3b3b3;
|
219 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);
|
220 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
221 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
|
222 |
-
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
|
223 |
-
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);
|
224 |
-
}
|
225 |
-
.levelSelector > input[type=checkbox] + label:first-of-type {
|
226 |
-
border-top-left-radius: 4px;
|
227 |
-
border-bottom-left-radius: 4px;
|
228 |
-
}
|
229 |
-
.levelSelector > input[type=checkbox] + label:last-of-type {
|
230 |
-
border-top-right-radius: 4px;
|
231 |
-
border-bottom-right-radius: 4px;
|
232 |
-
}
|
233 |
-
.levelSelector > input[type=checkbox]:checked + label {
|
234 |
-
background-image: none;
|
235 |
-
outline: 0;
|
236 |
-
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);
|
237 |
-
-moz-box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);
|
238 |
-
box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);
|
239 |
-
}
|
240 |
-
.levelSelector > input[type=checkbox] + label.errorLevel {
|
241 |
-
color: #CC0000;
|
242 |
-
}
|
243 |
-
.levelSelector > input[type=checkbox]:checked + label.errorLevel {
|
244 |
-
background-color: #CC0000;
|
245 |
-
color: #fff;
|
246 |
-
}
|
247 |
-
.levelSelector > input[type=checkbox] + label.warningLevel {
|
248 |
-
color: #F89406;
|
249 |
-
}
|
250 |
-
.levelSelector > input[type=checkbox]:checked + label.warningLevel {
|
251 |
-
background-color: #F89406;
|
252 |
-
color: #fff;
|
253 |
-
}
|
254 |
-
.levelSelector > input[type=checkbox] + label.detailLevel {
|
255 |
-
color: #3A87AD;
|
256 |
-
}
|
257 |
-
.levelSelector > input[type=checkbox]:checked + label.detailLevel {
|
258 |
-
background-color: #3A87AD;
|
259 |
-
color: #fff;
|
260 |
-
}
|
261 |
-
.noLog {
|
262 |
-
font-size: x-large;
|
263 |
-
display: block;
|
264 |
-
width: 100%;
|
265 |
-
text-align: center;
|
266 |
-
margin-top: 20ex;
|
267 |
-
line-height: 150%;
|
268 |
-
}
|
269 |
-
.loggingON, .loggingOFF {
|
270 |
-
font-weight: bolder;
|
271 |
-
}
|
272 |
-
.loggingON {
|
273 |
-
color: green;
|
274 |
-
}
|
275 |
-
.loggingOFF {
|
276 |
-
color: red;
|
277 |
-
}
|
278 |
-
th input{
|
279 |
-
margin-left: 0 !important;
|
280 |
-
margin-top: 1px !important;
|
281 |
-
}
|
282 |
-
td input{
|
283 |
-
margin-right: 0 !important;
|
284 |
-
}
|
285 |
-
|
286 |
-
textarea[readonly], input[readonly], select[readonly] {
|
287 |
-
background-color: #dcdcdc;
|
288 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/style.css
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
div.document-icon{ text-align: center; }
|
2 |
-
|
3 |
-
div.document-icon img{
|
4 |
-
max-width: 89px;
|
5 |
-
max-height: 89px;
|
6 |
-
border: none;
|
7 |
-
}
|
8 |
-
|
9 |
-
div.document-icon a{
|
10 |
-
font-size: 10px;
|
11 |
-
line-height: 12px;
|
12 |
-
}
|
13 |
-
|
14 |
-
div.document-icon{ margin: 5px 0 0; }
|
15 |
-
|
16 |
-
/* WITHOUT DESCRIPTION */
|
17 |
-
div.document-icon{
|
18 |
-
display: inline-block;
|
19 |
-
vertical-align: top;
|
20 |
-
overflow: hidden;
|
21 |
-
/* percents round up in some browsers, making
|
22 |
-
only 3 icons fit per line so can't use 25% */
|
23 |
-
width: 24.5%;
|
24 |
-
}
|
25 |
-
div.document-icon-wrapper{
|
26 |
-
width: 100%;
|
27 |
-
padding: 0;
|
28 |
-
text-align: left;
|
29 |
-
}
|
30 |
-
/* END WITHOUT DESCRIPTION */
|
31 |
-
|
32 |
-
/* WITH DESCRIPTION */
|
33 |
-
div.descriptions.document-icon-wrapper div.document-icon{
|
34 |
-
max-width: 115px;
|
35 |
-
padding: 0;
|
36 |
-
padding-right: 3px;
|
37 |
-
float: left;
|
38 |
-
}
|
39 |
-
|
40 |
-
div.descriptions.document-icon-wrapper{
|
41 |
-
vertical-align: middle;
|
42 |
-
text-align: inherit;
|
43 |
-
}
|
44 |
-
|
45 |
-
div.descriptions.document-icon-wrapper img{
|
46 |
-
max-width: 65px;
|
47 |
-
max-height: 65px;
|
48 |
-
}
|
49 |
-
|
50 |
-
/* clearfix */
|
51 |
-
/* can't depend on theme having a clearfix class,
|
52 |
-
so build it into dg css */
|
53 |
-
div.descriptions.document-icon-wrapper:before,
|
54 |
-
div.descriptions.document-icon-wrapper:after{
|
55 |
-
content: "";
|
56 |
-
display: table;
|
57 |
-
}
|
58 |
-
|
59 |
-
div.descriptions.document-icon-wrapper:after{
|
60 |
-
clear: both;
|
61 |
-
}
|
62 |
-
div.descriptions.document-icon-wrapper{
|
63 |
-
zoom: 1; /* For IE 6/7 (trigger hasLayout) */
|
64 |
-
}
|
65 |
-
/* END WITH DESCRIPTION */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/icons/asc.png
DELETED
Binary file
|
assets/icons/audio.png
DELETED
Binary file
|
assets/icons/c.png
DELETED
Binary file
|
assets/icons/compressed.png
DELETED
Binary file
|
assets/icons/cpp.png
DELETED
Binary file
|
assets/icons/css.png
DELETED
Binary file
|
assets/icons/exec.png
DELETED
Binary file
|
assets/icons/h.png
DELETED
Binary file
|
assets/icons/html.png
DELETED
Binary file
|
assets/icons/ics.png
DELETED
Binary file
|
assets/icons/image.png
DELETED
Binary file
|
assets/icons/java.png
DELETED
Binary file
|
assets/icons/javascript.png
DELETED
Binary file
|
assets/icons/key.png
DELETED
Binary file
|
assets/icons/midi.png
DELETED
Binary file
|
assets/icons/missing.png
DELETED
Binary file
|
assets/icons/msaccess.png
DELETED
Binary file
|
assets/icons/msdoc.png
DELETED
Binary file
|
assets/icons/msppt.png
DELETED
Binary file
|
assets/icons/msxls.png
DELETED
Binary file
|
assets/icons/numbers.png
DELETED
Binary file
|
assets/icons/opendocument-graphics.png
DELETED
Binary file
|
assets/icons/opendocument-text.png
DELETED
Binary file
|
assets/icons/pages.png
DELETED
Binary file
|
assets/icons/pdf.png
DELETED
Binary file
|
assets/icons/rtf.png
DELETED
Binary file
|
assets/icons/rtx.png
DELETED
Binary file
|
assets/icons/shockwave.png
DELETED
Binary file
|
assets/icons/text.png
DELETED
Binary file
|
assets/icons/video.png
DELETED
Binary file
|
assets/icons/wordperfect.png
DELETED
Binary file
|
assets/js/admin.js
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
jQuery('.cb-ids').change(function() {
|
3 |
-
if(jQuery(this).is(':checked')) {
|
4 |
-
jQuery(this).closest('tr').addClass('selected');
|
5 |
-
}
|
6 |
-
else {
|
7 |
-
jQuery(this).closest('tr').removeClass('selected');
|
8 |
-
}
|
9 |
-
});
|
10 |
-
jQuery('th input:checkbox').change(function() {
|
11 |
-
if(jQuery(this).is(':checked')) {
|
12 |
-
jQuery('#ThumbsTable tbody tr').addClass('selected');
|
13 |
-
}
|
14 |
-
else {
|
15 |
-
jQuery('#ThumbsTable tbody tr').removeClass('selected');
|
16 |
-
}
|
17 |
-
});
|
18 |
-
jQuery('input.current-page').bind('keypress', {}, function(e) {
|
19 |
-
var code = (e.keyCode ? e.keyCode : e.which);
|
20 |
-
if (code == 13) { //Enter keycode
|
21 |
-
e.preventDefault();
|
22 |
-
jQuery(location).attr('href','?'+jQuery.param(jQuery.extend(URL_params,{ sheet: this.value })));
|
23 |
-
}
|
24 |
-
});
|
25 |
-
jQuery('select.limit_per_page').change(function() {
|
26 |
-
jQuery(location).attr('href','?'+jQuery.param(jQuery.extend(URL_params,{ limit: this.value })));
|
27 |
-
});
|
28 |
-
jQuery('#tab-Thumbnail').submit( function (event) {
|
29 |
-
event.preventDefault();
|
30 |
-
if (jQuery('.cb-ids:checked').length > 0) {
|
31 |
-
var a = jQuery(this).attr('action');
|
32 |
-
var b = jQuery(this).serialize() + '&document_gallery%5Bajax%5D=true';
|
33 |
-
jQuery.post(a, b, function(response) {
|
34 |
-
if (response.indexOf("\n") == -1) {
|
35 |
-
var result = eval(response);
|
36 |
-
for (var index in result) {
|
37 |
-
jQuery('input[type=checkbox][value='+result[index]+']').closest('tr').fadeOut('slow', 0.00, function() {jQuery(this).slideUp('slow', function() {jQuery(this).remove();});});
|
38 |
-
}
|
39 |
-
} else {
|
40 |
-
console.log('Invalid response from server:');
|
41 |
-
console.log(response);
|
42 |
-
}
|
43 |
-
} ).fail(function() {
|
44 |
-
console.log( 'Problem in reaching the server' );
|
45 |
-
});
|
46 |
-
}
|
47 |
-
return false;
|
48 |
-
});
|
49 |
-
|
50 |
-
jQuery('#tab-Advanced #options-dump').click(function() {
|
51 |
-
jQuery(this).select();
|
52 |
-
});
|
53 |
-
|
54 |
-
function toggleSpoiler() {
|
55 |
-
var sel = getSelection().toString();
|
56 |
-
if(!sel){
|
57 |
-
jQuery(this).next().slideToggle('slow');
|
58 |
-
jQuery(this).find('.dashicons').toggleClass('dashicons-arrow-down-alt2 dashicons-arrow-up-alt2');
|
59 |
-
jQuery(this).toggleClass('expander collapser');
|
60 |
-
jQuery(this).attr('title', (jQuery(this).hasClass('expander') ? 'Click to Expand' : 'Click to Collapse'));
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
jQuery('.expander').click(toggleSpoiler);
|
65 |
-
|
66 |
-
if (jQuery('.spoiler-body').length)
|
67 |
-
{
|
68 |
-
jQuery('.expandAll, .collapseAll').addClass('button');
|
69 |
-
jQuery('.expandAll').click(function(e) {
|
70 |
-
e.preventDefault();
|
71 |
-
jQuery('.expander').trigger('click');
|
72 |
-
});
|
73 |
-
jQuery('.collapseAll').click(function(e) {
|
74 |
-
e.preventDefault();
|
75 |
-
jQuery('.collapser').trigger('click');
|
76 |
-
});
|
77 |
-
}
|
78 |
-
|
79 |
-
jQuery('.levelSelector input').change(function() {
|
80 |
-
if (jQuery(this).val() == 'all') {
|
81 |
-
jQuery('.levelSelector input').not("[value='all']").prop('checked', jQuery(this).is(':checked'));
|
82 |
-
jQuery(this).is(':checked') ? jQuery('#LogTable tbody tr').show() : jQuery('#LogTable tbody tr').hide();
|
83 |
-
}
|
84 |
-
else {
|
85 |
-
jQuery(this).is(':checked') ? jQuery('#LogTable tbody tr:has(span.'+jQuery(this).val()+')').show() : jQuery('#LogTable tbody tr:has(span.'+jQuery(this).val()+')').hide();
|
86 |
-
if ( (jQuery('.levelSelector input:checked').not("[value='all']").length + 1) == jQuery('.levelSelector input[type="checkbox"]').length ) {
|
87 |
-
jQuery('.levelSelector input[value="all"]').prop('checked', true);
|
88 |
-
} else {
|
89 |
-
jQuery('.levelSelector input[value="all"]').prop('checked', false);
|
90 |
-
}
|
91 |
-
}
|
92 |
-
});
|
93 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document-gallery.php
CHANGED
@@ -1,362 +1,156 @@
|
|
1 |
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
/*
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
*/
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
define('DG_BASENAME', plugin_basename(__FILE__));
|
19 |
-
define('DG_URL', plugin_dir_url(__FILE__));
|
20 |
-
define('DG_PATH', plugin_dir_path(__FILE__));
|
21 |
-
define('DG_WPINC_PATH', ABSPATH . WPINC . '/');
|
22 |
-
define('DG_WPADMIN_PATH', ABSPATH . 'wp-admin/');
|
23 |
-
|
24 |
-
// init DG options for use throughout plugin
|
25 |
-
global $dg_options;
|
26 |
-
define('DG_OPTION_NAME', 'document_gallery');
|
27 |
-
$dg_options = get_option(DG_OPTION_NAME, null);
|
28 |
-
|
29 |
-
// logging functionality
|
30 |
-
include_once DG_PATH . 'inc/class-logger.php';
|
31 |
-
|
32 |
-
// handle activation, updates, and uninstallation
|
33 |
-
include_once DG_PATH . 'inc/class-setup.php';
|
34 |
-
register_activation_hook(__FILE__, array('DG_Setup', 'activate'));
|
35 |
-
add_action('wpmu_new_blog', array('DG_Setup','activateNewBlog'));
|
36 |
-
register_uninstall_hook(__FILE__, array('DG_Setup', 'uninstall'));
|
37 |
-
DG_Setup::maybeUpdate();
|
38 |
-
|
39 |
-
// validate options if desired
|
40 |
-
if ($dg_options['validation']) {
|
41 |
-
add_action('init', array('DocumentGallery', 'addValidation'));
|
42 |
}
|
43 |
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
? $dg_options
|
181 |
-
: get_blog_option($blog, DG_OPTION_NAME, null);
|
182 |
-
}
|
183 |
-
|
184 |
-
/**
|
185 |
-
* @param multitype:unknown $options
|
186 |
-
* @param int $blog ID of the blog to be set in multisite env.
|
187 |
-
*/
|
188 |
-
public static function setOptions($options, $blog = null) {
|
189 |
-
if (is_null($blog)) {
|
190 |
-
global $dg_options;
|
191 |
-
update_option(DG_OPTION_NAME, $options);
|
192 |
-
$dg_options = $options;
|
193 |
-
} else {
|
194 |
-
update_blog_option($blog, DG_OPTION_NAME, $options);
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
/**
|
199 |
-
* @param int $blog ID of the blog to be deleted in multisite env.
|
200 |
-
*/
|
201 |
-
public static function deleteOptions($blog = null) {
|
202 |
-
if (is_null($blog)) {
|
203 |
-
delete_option(DG_OPTION_NAME);
|
204 |
-
} else {
|
205 |
-
delete_blog_option($blog, DG_OPTION_NAME);
|
206 |
-
}
|
207 |
-
}
|
208 |
-
|
209 |
-
/**
|
210 |
-
* Adds hook to validate DG options every time save is attempted.
|
211 |
-
*/
|
212 |
-
public static function addValidation() {
|
213 |
-
add_filter('pre_update_option_' . DG_OPTION_NAME, array('DocumentGallery', 'validateOptionsStructure'), 10, 2);
|
214 |
-
}
|
215 |
-
|
216 |
-
/**
|
217 |
-
* Checks whether the given options match the option schema.
|
218 |
-
* @param multivar $new The new options to be validated.
|
219 |
-
* @param multivar $old The old options.
|
220 |
-
* @return array The options to be saved.
|
221 |
-
*/
|
222 |
-
public static function validateOptionsStructure($new, $old) {
|
223 |
-
if (self::isValidOptionsStructure($new)) {
|
224 |
-
$ret = $new;
|
225 |
-
} else {
|
226 |
-
$ret = $old;
|
227 |
-
DG_Logger::writeLog(DG_LogLevel::Error, 'Attempted to save invalid options.' . PHP_EOL . print_r($new, true), true, true);
|
228 |
-
}
|
229 |
-
|
230 |
-
return $ret;
|
231 |
-
}
|
232 |
-
|
233 |
-
/**
|
234 |
-
* @param multivar|unknown $o The options structure to validate.
|
235 |
-
* @param multivar $schema The schema to validate against (note that only keys matter -- non-array values are ignored).
|
236 |
-
* @return bool Whether the given options structure matches the schema.
|
237 |
-
*/
|
238 |
-
private static function isValidOptionsStructure($o, $schema = null) {
|
239 |
-
if (is_null($schema)) {
|
240 |
-
include_once DG_PATH . 'inc/class-setup.php';
|
241 |
-
$schema = DG_Setup::getDefaultOptions(true);
|
242 |
-
}
|
243 |
-
|
244 |
-
// simple checks first
|
245 |
-
$valid = is_array($o) && (count($schema) === count($o));
|
246 |
-
|
247 |
-
if ($valid) {
|
248 |
-
foreach ($schema as $sk => $sv) {
|
249 |
-
$valid = array_key_exists($sk, $o);
|
250 |
-
if (is_array($sv) && !empty($sv)) {
|
251 |
-
$valid = $valid && self::isValidOptionsStructure($o[$sk], $sv);
|
252 |
-
}
|
253 |
-
|
254 |
-
if (!$valid) {
|
255 |
-
break;
|
256 |
-
}
|
257 |
-
}
|
258 |
-
}
|
259 |
-
|
260 |
-
return $valid;
|
261 |
-
}
|
262 |
-
|
263 |
-
/**
|
264 |
-
* Function takes a GMT timestamp and returns a date/time string in the
|
265 |
-
* current timezone and WP format.
|
266 |
-
* @param int $timestamp The GMT timestamp to translate.
|
267 |
-
* @return string The local time in the WP date/time format.
|
268 |
-
*/
|
269 |
-
public static function localDateTimeFromTimestamp($timestamp) {
|
270 |
-
static $gmt_offet = null;
|
271 |
-
static $wp_format = null;
|
272 |
-
if (is_null($gmt_offet)) {
|
273 |
-
$gmt_offet = get_option('gmt_offset');
|
274 |
-
$wp_format = get_option('date_format').' '.get_option('time_format');
|
275 |
-
}
|
276 |
-
|
277 |
-
return date($wp_format, $timestamp + $gmt_offet * 3600);
|
278 |
-
}
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Compiles any custom CSS plus the default CSS together,
|
282 |
-
* minifying in the process.
|
283 |
-
* @param string $custom The custom CSS to compile.
|
284 |
-
* @return string Compiled CSS, including both standard and any custom.
|
285 |
-
*/
|
286 |
-
public static function compileCustomCss($custom) {
|
287 |
-
$css = file_get_contents(DG_PATH . 'assets/css/style.css');
|
288 |
-
$css .= str_replace('>', '>', esc_html($custom));
|
289 |
-
|
290 |
-
return $css;
|
291 |
-
}
|
292 |
-
|
293 |
-
/**
|
294 |
-
* Removes all comments & space from CSS string.
|
295 |
-
* Source: http://stackoverflow.com/a/15195752/866618
|
296 |
-
*/
|
297 |
-
private static function minifyCss($css) {
|
298 |
-
# remove comments first (simplifies the other regex)
|
299 |
-
$re1 = <<<EOS
|
300 |
-
(?sx)
|
301 |
-
# quotes
|
302 |
-
(
|
303 |
-
"(?:[^"\\]++|\\.)*+"
|
304 |
-
| '(?:[^'\\]++|\\.)*+'
|
305 |
-
)
|
306 |
-
|
|
307 |
-
# comments
|
308 |
-
/\* (?> .*? \*/ )
|
309 |
-
EOS;
|
310 |
-
|
311 |
-
$re2 = <<<EOS
|
312 |
-
(?six)
|
313 |
-
# quotes
|
314 |
-
(
|
315 |
-
"(?:[^"\\]++|\\.)*+"
|
316 |
-
| '(?:[^'\\]++|\\.)*+'
|
317 |
-
)
|
318 |
-
|
|
319 |
-
# ; before } (and the spaces after it while we're here)
|
320 |
-
\s*+ ; \s*+ ( } ) \s*+
|
321 |
-
|
|
322 |
-
# all spaces around meta chars/operators
|
323 |
-
\s*+ ( [*$~^|]?+= | [{};,>~+-] | !important\b ) \s*+
|
324 |
-
|
|
325 |
-
# spaces right of ( [ :
|
326 |
-
( [[(:] ) \s++
|
327 |
-
|
|
328 |
-
# spaces left of ) ]
|
329 |
-
\s++ ( [])] )
|
330 |
-
|
|
331 |
-
# spaces left (and right) of :
|
332 |
-
\s++ ( : ) \s*+
|
333 |
-
# but not in selectors: not followed by a {
|
334 |
-
(?!
|
335 |
-
(?>
|
336 |
-
[^{}"']++
|
337 |
-
| "(?:[^"\\]++|\\.)*+"
|
338 |
-
| '(?:[^'\\]++|\\.)*+'
|
339 |
-
)*+
|
340 |
-
{
|
341 |
-
)
|
342 |
-
|
|
343 |
-
# spaces at beginning/end of string
|
344 |
-
^ \s++ | \s++ \z
|
345 |
-
|
|
346 |
-
# double spaces to single
|
347 |
-
(\s)\s+
|
348 |
-
EOS;
|
349 |
-
|
350 |
-
$css = preg_replace("%$re1%", '$1', $css);
|
351 |
-
return preg_replace("%$re2%", '$1$2$3$4$5$6$7', $css);
|
352 |
-
}
|
353 |
-
|
354 |
-
/**
|
355 |
-
* Blocks instantiation. All functions are static.
|
356 |
-
*/
|
357 |
-
private function __construct() {
|
358 |
-
|
359 |
-
}
|
360 |
}
|
361 |
-
|
362 |
-
?>
|
1 |
<?php
|
|
|
|
|
2 |
/*
|
3 |
+
Plugin Name: Document Gallery
|
4 |
+
Description: Display non-images in gallery format on page.
|
5 |
+
Version: 0.8.5
|
6 |
+
Author: Dan Rossiter
|
7 |
+
Author URI: http://danrossiter.org/
|
8 |
+
License: GPL2
|
9 |
+
*/
|
10 |
+
|
11 |
+
/* much credit to: tgrayimages.com/automate-file-attachments-on-your-wordpress-posts/ */
|
12 |
+
add_action( 'wp_print_styles', 'add_header_css');
|
13 |
+
|
14 |
+
function add_header_css() {
|
15 |
+
wp_enqueue_style('document-gallery-css', plugins_url('style.css', __FILE__));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
|
18 |
+
function get_attachment_icons($atts){
|
19 |
+
extract(shortcode_atts(array(
|
20 |
+
'descriptions' => FALSE,
|
21 |
+
'echo' => FALSE,
|
22 |
+
'orderby' => 'menu_order',
|
23 |
+
'order' => 'ASC'
|
24 |
+
), $atts));
|
25 |
+
|
26 |
+
if($descriptions){
|
27 |
+
$sAttachmentString = "<table id='documentIconsWrapper'> \n";
|
28 |
+
} else{
|
29 |
+
$sAttachmentString = "<div id='documentIconsWrapper'> \n";
|
30 |
+
}
|
31 |
+
$args = array(
|
32 |
+
'numberposts' => -1,
|
33 |
+
'orderby' => $orderby,
|
34 |
+
'order' => $order,
|
35 |
+
'post_type' => 'attachment',
|
36 |
+
'post_mime_type' => 'application',
|
37 |
+
'post_parent' => get_the_ID() );
|
38 |
+
|
39 |
+
if ( $attachments = get_posts($args) ){
|
40 |
+
$count = 0;
|
41 |
+
foreach( $attachments as $attachment ){ //setup array for more than one file attachment
|
42 |
+
$attachment_url = wp_get_attachment_url($attachment->ID);
|
43 |
+
$attachment_name_array = explode("/",$attachment_url);
|
44 |
+
$attachment_title = wp_get_attachment_link($attachment->ID);
|
45 |
+
|
46 |
+
if($descriptions){
|
47 |
+
$sAttachmentString .= "<tr><td class='documentIcons'><a href='$attachment_url'>";
|
48 |
+
} else{
|
49 |
+
$sAttachmentString .= "<div class='documentIcons'><a href='$attachment_url'>";
|
50 |
+
}
|
51 |
+
|
52 |
+
switch(get_post_mime_type( $attachment->ID )){
|
53 |
+
case 'application/pdf': // pdf files
|
54 |
+
$sAttachmentString .= "<img src='".plugins_url('images/pdf.png', __FILE__)."'/>";
|
55 |
+
break;
|
56 |
+
case 'application/msword': // word files
|
57 |
+
$sAttachmentString .= "<img src='".plugins_url('images/word.png' , __FILE__)."'/>";
|
58 |
+
break;
|
59 |
+
case 'application/vnd.ms-powerpoint': // powerpoint files
|
60 |
+
$sAttachmentString .= "<img src='".plugins_url('images/PowerPoint.png' , __FILE__)."'/>";
|
61 |
+
break;
|
62 |
+
case 'application/vnd.ms-excel': // excel files
|
63 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/XLS8.png' , __FILE__)."'/>";
|
64 |
+
break;
|
65 |
+
case 'application/zip': // zip files
|
66 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/zip.png' , __FILE__)."'/>";
|
67 |
+
break;
|
68 |
+
case 'application/vnd.oasis.opendocument.text': // OpenDocument (text)
|
69 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/open-text.png' , __FILE__)."'/>";
|
70 |
+
break;
|
71 |
+
case 'application/vnd.oasis.opendocument.spreadsheet': // OpenDocument (spreadsheet)
|
72 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/open-spreadsheet.png' , __FILE__)."'/>";
|
73 |
+
break;
|
74 |
+
case 'application/vnd.oasis.opendocument.presentation': // OpenDocument (presentation)
|
75 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/open-presentation.png' , __FILE__)."'/>";
|
76 |
+
break;
|
77 |
+
case 'application/vnd.oasis.opendocument.database': // OpenDocument (database)
|
78 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/open-database.png' , __FILE__)."'/>";
|
79 |
+
break;
|
80 |
+
case 'application/vnd.oasis.opendocument.formula': // OpenDocument (formula)
|
81 |
+
$sAttachmentString .= "<img src='".plugins_url( 'images/open-formula.png' , __FILE__)."'/>";
|
82 |
+
break;
|
83 |
+
default:
|
84 |
+
continue;
|
85 |
+
}
|
86 |
+
|
87 |
+
$sAttachmentString .= "</a><br><a href='$attachment_url'>$attachment_title</a>";
|
88 |
+
if($descriptions){
|
89 |
+
$sAttachmentString .= "</td><td valign='top'><p>$attachment->post_content</p></td></tr>";
|
90 |
+
}else{
|
91 |
+
$sAttachmentString .= "</div>";
|
92 |
+
if(++$count % 4 == 0)
|
93 |
+
$sAttachmentString .= "<hr>";
|
94 |
+
}
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
//Audio Files
|
99 |
+
/*$mp3s = get_children(array( //do only if there are attachments of these qualifications
|
100 |
+
'post_parent' => get_the_ID(),
|
101 |
+
'post_type' => 'attachment',
|
102 |
+
'numberposts' => -1,
|
103 |
+
'post_mime_type' => 'audio', //MIME Type condition
|
104 |
+
) );
|
105 |
+
|
106 |
+
if (!empty($mp3s)) :
|
107 |
+
$sAttachmentString .= "<ul class='audiofiles'>";
|
108 |
+
foreach($mp3s as $mp3) :
|
109 |
+
$sAttachmentString .= "<li>";
|
110 |
+
if(!empty($mp3->post_title)) : //checking to make sure the post title isn't empty
|
111 |
+
$sAttachmentString .= "<h4 class='title'>".$mp3->post_title."</h4>";
|
112 |
+
endif;
|
113 |
+
|
114 |
+
if(!empty($mp3->post_content)) : //checking to make sure something exists in post_content (description)
|
115 |
+
$sAttachmentString .= "<p class='description'>".$mp3->post_content."</p>";
|
116 |
+
endif;
|
117 |
+
|
118 |
+
$sAttachmentString .= "<object width='470' height='24' id='single".$mp3->ID."' name='single".$mp3->ID."'>";
|
119 |
+
$sAttachmentString .= "<param name='movie' value='player.swf'>";
|
120 |
+
$sAttachmentString .= "<param name='allowfullscreen' value='true'>";
|
121 |
+
$sAttachmentString .= "<param name='allowscriptaccess' value='always'>";
|
122 |
+
$sAttachmentString .= "<param name='wmode' value='transparent'>";
|
123 |
+
$sAttachmentString .= "<param name='flashvars' value='file=".$mp3->guid."'>";
|
124 |
+
$sAttachmentString .= "<embed ";
|
125 |
+
$sAttachmentString .= "id='single".$mp3->ID."' ";
|
126 |
+
$sAttachmentString .= "name='single".$mp3->ID."' ";
|
127 |
+
$sAttachmentString .= "src='".get_bloginfo('template_directory')."/jw/player.swf' ";
|
128 |
+
$sAttachmentString .= "width='470' ";
|
129 |
+
$sAttachmentString .= "height='24' ";
|
130 |
+
$sAttachmentString .= "bgcolor='#ffffff' ";
|
131 |
+
$sAttachmentString .= "allowscriptaccess='always' ";
|
132 |
+
$sAttachmentString .= "allowfullscreen='true' ";
|
133 |
+
$sAttachmentString .= "flashvars='file=".$mp3->guid."' ";
|
134 |
+
|
135 |
+
$sAttachmentString .= "/>";
|
136 |
+
$sAttachmentString .= "</object>";
|
137 |
+
$sAttachmentString .= "<a href='".$mp3->guid."'>Download</a>";
|
138 |
+
$sAttachmentString .= "</li>";
|
139 |
+
endforeach;
|
140 |
+
$sAttachmentString .= "</ul>";
|
141 |
+
endif;*/
|
142 |
+
|
143 |
+
if($descriptions){
|
144 |
+
$sAttachmentString .= "</table>";
|
145 |
+
}else{
|
146 |
+
$sAttachmentString .= "</div>";
|
147 |
+
}
|
148 |
+
/*$finalString = implode('', $sAttachmentString);*/
|
149 |
+
if($echo){
|
150 |
+
/*echo $finalString;*/
|
151 |
+
echo $sAttachmentString;
|
152 |
+
}
|
153 |
+
return $sAttachmentString; /*$finalString;*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
+
add_shortcode('document gallery', 'get_attachment_icons');
|
156 |
+
?>
|
images/MSWD.png
ADDED
Binary file
|
images/PPT3.png
ADDED
Binary file
|
images/PowerPoint.png
ADDED
Binary file
|
images/Thumbs.db
ADDED
Binary file
|
images/XCEL.png
ADDED
Binary file
|
images/XLS8.png
ADDED
Binary file
|
images/excel.png
ADDED
Binary file
|
images/iTunes.png
ADDED
Binary file
|
images/mp3.png
ADDED
Binary file
|
assets/icons/opendocument-database.png → images/open-database.png
RENAMED
Binary file
|
assets/icons/opendocument-formula.png → images/open-formula.png
RENAMED
Binary file
|
assets/icons/opendocument-presentation.png → images/open-presentation.png
RENAMED
Binary file
|
assets/icons/opendocument-spreadsheet.png → images/open-spreadsheet.png
RENAMED
Binary file
|
images/open-text.png
ADDED
Binary file
|
images/pdf.png
ADDED
Binary file
|
images/word.png
ADDED
Binary file
|
images/zip.png
ADDED
Binary file
|
images/zip2.png
ADDED
Binary file
|
inc/class-document.php
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Holds data specific to a given document.
|
6 |
-
*
|
7 |
-
* @author drossiter
|
8 |
-
*/
|
9 |
-
class DG_Document {
|
10 |
-
|
11 |
-
/*==========================================================================
|
12 |
-
* PRIVATE FIELDS
|
13 |
-
*=========================================================================*/
|
14 |
-
|
15 |
-
// general document data
|
16 |
-
private $description, $gallery, $ID, $link, $title, $title_attribute;
|
17 |
-
|
18 |
-
/*==========================================================================
|
19 |
-
* INIT GALLERY
|
20 |
-
*=========================================================================*/
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Constructs instance of Document.
|
24 |
-
* @param type $attachment Attachment object used to initalize fields.
|
25 |
-
* @param type $gallery Instance of Gallery class.
|
26 |
-
*/
|
27 |
-
public function __construct($attachment, $gallery) {
|
28 |
-
include_once DG_PATH . 'inc/class-thumber.php';
|
29 |
-
|
30 |
-
// init general document data
|
31 |
-
$this->gallery = $gallery;
|
32 |
-
$this->description = $attachment->post_content;
|
33 |
-
$this->ID = $attachment->ID;
|
34 |
-
$this->link = $gallery->linkToAttachmentPg()
|
35 |
-
? get_attachment_link($attachment->ID)
|
36 |
-
: wp_get_attachment_url($attachment->ID);
|
37 |
-
$this->title = get_the_title($attachment->ID);
|
38 |
-
$this->title_attribute = esc_attr(strip_tags($this->title));
|
39 |
-
}
|
40 |
-
|
41 |
-
/*==========================================================================
|
42 |
-
* OUTPUT HTML STRING
|
43 |
-
*=========================================================================*/
|
44 |
-
|
45 |
-
/**
|
46 |
-
* Returns HTML representing this Document.
|
47 |
-
* @filter dg_icon_template Filters the DG icon HTML. Passes a single
|
48 |
-
* bool value indicating whether the gallery is using descriptions or not.
|
49 |
-
* @filter dg_doc_icon Deprecated. To be removed in a future relesase.
|
50 |
-
* @return string
|
51 |
-
*/
|
52 |
-
public function __toString() {
|
53 |
-
$thumb = $this->gallery->useFancyThumbs()
|
54 |
-
? DG_Thumber::getThumbnail($this->ID)
|
55 |
-
: DG_Thumber::getDefaultThumbnail($this->ID);
|
56 |
-
|
57 |
-
$repl = array($this->link, $thumb, $this->title_attribute, $this->title);
|
58 |
-
$find = array('%link%', '%img%', '%title_attribute%', '%title%');
|
59 |
-
$description = '';
|
60 |
-
|
61 |
-
// if descriptions then add filterable tag and value to replaced tag
|
62 |
-
if ($this->gallery->useDescriptions()) {
|
63 |
-
$repl[] = $this->description;
|
64 |
-
$find[] = '%description%';
|
65 |
-
$description = ' <p>%description%</p>';
|
66 |
-
}
|
67 |
-
|
68 |
-
// allow developers to filter icon output
|
69 |
-
$doc_icon = apply_filters(
|
70 |
-
'dg_icon_template',
|
71 |
-
' <div class="document-icon">' . PHP_EOL .
|
72 |
-
' <a href="%link%"><img src="%img%" title="%title_attribute%" alt="%title_attribute%" /><br>%title%</a>' . PHP_EOL .
|
73 |
-
' </div>' . PHP_EOL .
|
74 |
-
$description,
|
75 |
-
$this->gallery->useDescriptions(),
|
76 |
-
$this->ID);
|
77 |
-
|
78 |
-
$core = str_replace($find, $repl, $doc_icon);
|
79 |
-
|
80 |
-
// deprecated: users may filter icon here
|
81 |
-
return apply_filters('dg_doc_icon', $core, $this->ID, $this->gallery->useDescriptions());
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/class-gallery.php
DELETED
@@ -1,656 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
DG_Gallery::init();
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Holds data specific to a given document gallery.
|
8 |
-
*
|
9 |
-
* @author drossiter
|
10 |
-
*/
|
11 |
-
class DG_Gallery {
|
12 |
-
|
13 |
-
/*==========================================================================
|
14 |
-
* PRIVATE FIELDS
|
15 |
-
*=========================================================================*/
|
16 |
-
|
17 |
-
private $atts, $taxa;
|
18 |
-
private $docs = array();
|
19 |
-
private $errs = array();
|
20 |
-
|
21 |
-
// templates for HTML output
|
22 |
-
private static $no_docs = null;
|
23 |
-
private static $comment = null;
|
24 |
-
|
25 |
-
private static $binary_err = null;
|
26 |
-
|
27 |
-
/*==========================================================================
|
28 |
-
* PUBLIC FUNCTIONS
|
29 |
-
*=========================================================================*/
|
30 |
-
|
31 |
-
/**
|
32 |
-
* @return bool Whether to link to attachment pg.
|
33 |
-
*/
|
34 |
-
public function linkToAttachmentPg() {
|
35 |
-
return $this->atts['attachment_pg'];
|
36 |
-
}
|
37 |
-
|
38 |
-
/**
|
39 |
-
* @return bool Whether to use "fancy" thumbnails.
|
40 |
-
*/
|
41 |
-
public function useFancyThumbs() {
|
42 |
-
return $this->atts['fancy'];
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* @return bool Whether descriptions should be included in output.
|
47 |
-
*/
|
48 |
-
public function useDescriptions() {
|
49 |
-
return $this->atts['descriptions'];
|
50 |
-
}
|
51 |
-
|
52 |
-
/*==========================================================================
|
53 |
-
* GET AND SET OPTIONS
|
54 |
-
*=========================================================================*/
|
55 |
-
|
56 |
-
/**
|
57 |
-
* @param int $blog The blog we're retrieving options for (null => current blog).
|
58 |
-
* @return multitype:unknown Gets gallery branch of DG options array.
|
59 |
-
*/
|
60 |
-
public static function getOptions($blog = null) {
|
61 |
-
$options = DocumentGallery::getOptions($blog);
|
62 |
-
return $options['gallery'];
|
63 |
-
}
|
64 |
-
|
65 |
-
/**
|
66 |
-
* @param multitype:unknown $options New value for gallery branch of DG options array.
|
67 |
-
* @param int $blog The blog we're retrieving options for (null => current blog).
|
68 |
-
*/
|
69 |
-
public static function setOptions($options, $blog = null) {
|
70 |
-
$dg_options = DocumentGallery::getOptions($blog);
|
71 |
-
$dg_options['gallery'] = $options;
|
72 |
-
DocumentGallery::setOptions($dg_options, $blog);
|
73 |
-
}
|
74 |
-
|
75 |
-
/*==========================================================================
|
76 |
-
* INIT GALLERY
|
77 |
-
*=========================================================================*/
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Initializes static values for this class.
|
81 |
-
*/
|
82 |
-
public static function init() {
|
83 |
-
if (is_null(self::$comment))
|
84 |
-
{
|
85 |
-
self::$comment =
|
86 |
-
PHP_EOL . '<!-- ' . __('Generated using Document Gallery. Get yours here: ', 'document-gallery') .
|
87 |
-
'http://wordpress.org/extend/plugins/document-gallery -->' . PHP_EOL;
|
88 |
-
self::$no_docs = '<!-- ' . __('No attachments to display. How boring! :(', 'document-gallery') . ' -->';
|
89 |
-
self::$binary_err = __('The %s parameter may only be "%s" or "%s." You entered "%s."', 'document-gallery');
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
/**
|
94 |
-
* Builds a gallery object with attributes passed.
|
95 |
-
* @param multitype:string $atts Array of attributes used in shortcode.
|
96 |
-
*/
|
97 |
-
public function __construct($atts) {
|
98 |
-
// empty string is passed when no arguments are given, but constructor expects an array
|
99 |
-
$atts = empty($atts) ? array() : $atts;
|
100 |
-
$defaults = self::getOptions();
|
101 |
-
|
102 |
-
// values used to construct tax query (may be empty)
|
103 |
-
$this->taxa = array_diff_key($atts, $defaults);
|
104 |
-
|
105 |
-
// all recognized attributes go here
|
106 |
-
$this->atts = shortcode_atts($defaults, $atts);
|
107 |
-
|
108 |
-
// goes through all values in $this->atts, setting $this->errs as needed
|
109 |
-
$this->atts = self::sanitizeDefaults($this->atts, $this->errs);
|
110 |
-
|
111 |
-
// query DB for all documents requested
|
112 |
-
include_once DG_PATH . 'inc/class-document.php';
|
113 |
-
try {
|
114 |
-
$docs = $this->getDocuments();
|
115 |
-
|
116 |
-
foreach($docs as $doc) {
|
117 |
-
$this->docs[] = new DG_Document($doc, $this);
|
118 |
-
}
|
119 |
-
} catch(InvalidArgumentException $e) {
|
120 |
-
// errors will be printed in __toString()
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
/**
|
125 |
-
* Cleans up user input, making sure we don't pass crap on to WP core.
|
126 |
-
* @param multitype:string $defaults The defaults array to sanitize.
|
127 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
128 |
-
*/
|
129 |
-
public static function sanitizeDefaults($defaults, &$errs) {
|
130 |
-
$old_defaults = self::getOptions();
|
131 |
-
|
132 |
-
// remove invalid keys
|
133 |
-
$defaults = array_intersect_key($defaults, $old_defaults);
|
134 |
-
|
135 |
-
// add any missing keys
|
136 |
-
foreach ($old_defaults as $k => $v) {
|
137 |
-
if (!isset($defaults[$k])) {
|
138 |
-
if (is_bool($v)) {
|
139 |
-
// checkbox
|
140 |
-
$defaults[$k] = false;
|
141 |
-
} else {
|
142 |
-
// missing value
|
143 |
-
$defaults[$k] = $v;
|
144 |
-
}
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
$defaults['attachment_pg'] = self::sanitizeAttachmentPg($defaults['attachment_pg'], $err);
|
149 |
-
if (isset($err)) {
|
150 |
-
$errs['attachment_pg'] = $err;
|
151 |
-
unset($err);
|
152 |
-
}
|
153 |
-
|
154 |
-
$defaults['descriptions'] = self::sanitizeDescriptions($defaults['descriptions'], $err);
|
155 |
-
if (isset($err)) {
|
156 |
-
$errs['descriptions'] = $err;
|
157 |
-
unset($err);
|
158 |
-
}
|
159 |
-
|
160 |
-
$defaults['fancy'] = self::sanitizeFancy($defaults['fancy'], $err);
|
161 |
-
if (isset($err)) {
|
162 |
-
$errs['fancy'] = $err;
|
163 |
-
unset($err);
|
164 |
-
}
|
165 |
-
|
166 |
-
$defaults['ids'] = self::sanitizeIds($defaults['ids'], $err);
|
167 |
-
if (isset($err)) {
|
168 |
-
$errs['ids'] = $err;
|
169 |
-
unset($err);
|
170 |
-
}
|
171 |
-
|
172 |
-
$defaults['images'] = self::sanitizeImages($defaults['images'], $err);
|
173 |
-
if (isset($err)) {
|
174 |
-
$errs['images'] = $err;
|
175 |
-
unset($err);
|
176 |
-
}
|
177 |
-
|
178 |
-
$defaults['localpost'] = self::sanitizeLocalpost($defaults['localpost'], $err);
|
179 |
-
if (isset($err)) {
|
180 |
-
$errs['localpost'] = $err;
|
181 |
-
unset($err);
|
182 |
-
}
|
183 |
-
|
184 |
-
$defaults['order'] = self::sanitizeOrder($defaults['order'], $err);
|
185 |
-
if (isset($err)) {
|
186 |
-
$errs['order'] = $err;
|
187 |
-
unset($err);
|
188 |
-
}
|
189 |
-
|
190 |
-
$defaults['orderby'] = self::sanitizeOrderby($defaults['orderby'], $err);
|
191 |
-
if (isset($err)) {
|
192 |
-
$errs['orderby'] = $err;
|
193 |
-
unset($err);
|
194 |
-
}
|
195 |
-
|
196 |
-
$defaults['relation'] = self::sanitizeRelation($defaults['relation'], $err);
|
197 |
-
if (isset($err)) {
|
198 |
-
$errs['relation'] = $err;
|
199 |
-
unset($err);
|
200 |
-
}
|
201 |
-
|
202 |
-
return $defaults;
|
203 |
-
}
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Takes the provided value and returns a sanitized value.
|
207 |
-
* @param string $value The attachment_pg value to be sanitized.
|
208 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
209 |
-
* @return bool The sanitized attachment_pg value.
|
210 |
-
*/
|
211 |
-
private static function sanitizeAttachmentPg($value, &$err) {
|
212 |
-
$defaults = self::getOptions();
|
213 |
-
$ret = $defaults['attachment_pg'];
|
214 |
-
|
215 |
-
$attachment_pg = self::toBool($value);
|
216 |
-
|
217 |
-
if(is_null($attachment_pg)) {
|
218 |
-
$err = sprintf(self::$binary_err, 'attachment_pg', 'true', 'false', $value);
|
219 |
-
} else {
|
220 |
-
$ret = $attachment_pg;
|
221 |
-
}
|
222 |
-
|
223 |
-
return $ret;
|
224 |
-
}
|
225 |
-
|
226 |
-
/**
|
227 |
-
* Takes the provided value and returns a sanitized value.
|
228 |
-
* @param string $value The descriptions value to be sanitized.
|
229 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
230 |
-
* @return bool The sanitized descriptions value.
|
231 |
-
*/
|
232 |
-
private static function sanitizeDescriptions($value, &$err) {
|
233 |
-
$defaults = self::getOptions();
|
234 |
-
$ret = $defaults['descriptions'];
|
235 |
-
|
236 |
-
$descriptions = self::toBool($value);
|
237 |
-
|
238 |
-
if(is_null($descriptions)) {
|
239 |
-
$err = sprintf(self::$binary_err, 'descriptions', 'true', 'false', $value);
|
240 |
-
} else {
|
241 |
-
$ret = $descriptions;
|
242 |
-
}
|
243 |
-
|
244 |
-
return $ret;
|
245 |
-
}
|
246 |
-
|
247 |
-
/**
|
248 |
-
* Takes the provided value and returns a sanitized value.
|
249 |
-
* @param string $value The fancy value to be sanitized.
|
250 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
251 |
-
* @return bool The sanitized fancy value.
|
252 |
-
*/
|
253 |
-
private static function sanitizeFancy($value, &$err) {
|
254 |
-
$defaults = self::getOptions();
|
255 |
-
$ret = $defaults['fancy'];
|
256 |
-
|
257 |
-
$fancy = self::toBool($value);
|
258 |
-
|
259 |
-
if(is_null($fancy)) {
|
260 |
-
$err = sprintf(self::$binary_err, 'fancy', 'true', 'false', $value);
|
261 |
-
} else {
|
262 |
-
$ret = $fancy;
|
263 |
-
}
|
264 |
-
|
265 |
-
return $ret;
|
266 |
-
}
|
267 |
-
|
268 |
-
/**
|
269 |
-
* Takes the provided value and returns a sanitized value.
|
270 |
-
* @param string $value The ids value to be sanitized.
|
271 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
272 |
-
* @return bool|multitype:int The sanitized ids value.
|
273 |
-
*/
|
274 |
-
private static function sanitizeIds($value, &$err) {
|
275 |
-
$defaults = self::getOptions();
|
276 |
-
$ret = $defaults['ids'];
|
277 |
-
|
278 |
-
if(false === self::toBool($value)) {
|
279 |
-
$ret = false;
|
280 |
-
} else {
|
281 |
-
$value = trim($value);
|
282 |
-
$ids = $value ? explode(',', $value) : array();
|
283 |
-
$bad = array_filter($ids, array(__CLASS__, 'negativeInt'));
|
284 |
-
|
285 |
-
if(!empty($bad)) {
|
286 |
-
$err = _n('The following ID is invalid: ',
|
287 |
-
'The following IDs are invalid: ',
|
288 |
-
count($bad), 'document-gallery') . implode(', ', $bad);
|
289 |
-
} else {
|
290 |
-
$ret = $ids;
|
291 |
-
}
|
292 |
-
}
|
293 |
-
|
294 |
-
return $ret;
|
295 |
-
}
|
296 |
-
|
297 |
-
/**
|
298 |
-
* Takes the provided value and returns a sanitized value.
|
299 |
-
* @param string $value The images value to be sanitized.
|
300 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
301 |
-
* @return bool The sanitized images value.
|
302 |
-
*/
|
303 |
-
private static function sanitizeImages($value, &$err) {
|
304 |
-
$defaults = self::getOptions();
|
305 |
-
$ret = $defaults['images'];
|
306 |
-
|
307 |
-
$images = self::toBool($value);
|
308 |
-
|
309 |
-
if(is_null($images)) {
|
310 |
-
$err = sprintf(self::$binary_err, 'images', 'true', 'false', $value);
|
311 |
-
} else {
|
312 |
-
$ret = $images;
|
313 |
-
}
|
314 |
-
|
315 |
-
return $ret;
|
316 |
-
}
|
317 |
-
|
318 |
-
/**
|
319 |
-
* Takes the provided value and returns a sanitized value.
|
320 |
-
* @param string $value The localpost value to be sanitized.
|
321 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
322 |
-
* @return bool The sanitized localpost value.
|
323 |
-
*/
|
324 |
-
private static function sanitizeLocalpost($value, &$err) {
|
325 |
-
$defaults = self::getOptions();
|
326 |
-
$ret = $defaults['localpost'];
|
327 |
-
|
328 |
-
$localpost = self::toBool($value);
|
329 |
-
|
330 |
-
if(is_null($localpost)) {
|
331 |
-
$err = sprintf(self::$binary_err, 'localpost', 'true', 'false', $value);
|
332 |
-
} else {
|
333 |
-
$ret = $localpost;
|
334 |
-
}
|
335 |
-
|
336 |
-
return $ret;
|
337 |
-
}
|
338 |
-
|
339 |
-
/**
|
340 |
-
* Takes the provided value and returns a sanitized value.
|
341 |
-
* @param string $value The order value to be sanitized.
|
342 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
343 |
-
* @return string The sanitized order value.
|
344 |
-
*/
|
345 |
-
private static function sanitizeOrder($value, &$err) {
|
346 |
-
$defaults = self::getOptions();
|
347 |
-
$ret = $defaults['order'];
|
348 |
-
|
349 |
-
$order = strtoupper($value);
|
350 |
-
if(!in_array($order, self::getOrderOptions())) {
|
351 |
-
$err = sprintf(self::$binary_err, 'order', 'ASC', 'DESC', $value);
|
352 |
-
} else {
|
353 |
-
$ret = $order;
|
354 |
-
}
|
355 |
-
|
356 |
-
return $ret;
|
357 |
-
}
|
358 |
-
|
359 |
-
/**
|
360 |
-
* @return multitype:string The valid options for order parameter.
|
361 |
-
*/
|
362 |
-
public static function getOrderOptions() {
|
363 |
-
return array('ASC', 'DESC');
|
364 |
-
}
|
365 |
-
|
366 |
-
/**
|
367 |
-
* Takes the provided value and returns a sanitized value.
|
368 |
-
* @param string $value The orderby value to be sanitized.
|
369 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
370 |
-
* @return string The sanitized orderby value.
|
371 |
-
*/
|
372 |
-
private static function sanitizeOrderby($value, &$err) {
|
373 |
-
$defaults = self::getOptions();
|
374 |
-
$ret = $defaults['orderby'];
|
375 |
-
|
376 |
-
$orderby = 'ID' === strtoupper($value) ? 'ID' : strtolower($value);
|
377 |
-
if (!in_array($orderby, self::getOrderbyOptions())) {
|
378 |
-
$err = sprintf(
|
379 |
-
__('The orderby value entered, "%s," is not valid.', 'document-gallery'),
|
380 |
-
$value);
|
381 |
-
} else {
|
382 |
-
$ret = $orderby;
|
383 |
-
}
|
384 |
-
|
385 |
-
return $ret;
|
386 |
-
}
|
387 |
-
|
388 |
-
/**
|
389 |
-
* @return multitype:string The valid options for orderby parameter.
|
390 |
-
*/
|
391 |
-
public static function getOrderbyOptions() {
|
392 |
-
return array('author', 'comment_count', 'date', 'ID',
|
393 |
-
'menu_order', 'modified', 'name', 'none',
|
394 |
-
'parent', 'post__in', 'rand', 'title');
|
395 |
-
}
|
396 |
-
|
397 |
-
/**
|
398 |
-
* Takes the provided value and returns a sanitized value.
|
399 |
-
* @param string $value The relation value to be sanitized.
|
400 |
-
* @param multitype:string &$errs The array of errors, which will be appended with any errors found.
|
401 |
-
* @return string The sanitized relation value.
|
402 |
-
*/
|
403 |
-
private static function sanitizeRelation($value, &$err) {
|
404 |
-
$defaults = self::getOptions();
|
405 |
-
$ret = $defaults['relation'];
|
406 |
-
|
407 |
-
$relation = strtoupper($value);
|
408 |
-
if(!in_array($relation, self::getRelationOptions())) {
|
409 |
-
$err = sprintf(self::$binary_err, 'relation', 'AND', 'OR', $value);
|
410 |
-
} else {
|
411 |
-
$ret = $relation;
|
412 |
-
}
|
413 |
-
|
414 |
-
return $ret;
|
415 |
-
}
|
416 |
-
|
417 |
-
/**
|
418 |
-
* @return multitype:string The valid options for relation parameter.
|
419 |
-
*/
|
420 |
-
public static function getRelationOptions() {
|
421 |
-
return array('AND', 'OR');
|
422 |
-
}
|
423 |
-
|
424 |
-
/**
|
425 |
-
* Gets all valid Documents based on the attributes passed by the user.
|
426 |
-
* @return multitype:unknown Contains all documents matching the query.
|
427 |
-
* @throws InvalidArgumentException Thrown when $this->errs is not empty.
|
428 |
-
*/
|
429 |
-
private function getDocuments() {
|
430 |
-
$mime_types = array('application', 'video', 'text', 'audio');
|
431 |
-
if ($this->atts['images']) {
|
432 |
-
$mime_types[] = 'image';
|
433 |
-
}
|
434 |
-
|
435 |
-
$query = array(
|
436 |
-
'numberposts' => -1,
|
437 |
-
'orderby' => $this->atts['orderby'],
|
438 |
-
'order' => $this->atts['order'],
|
439 |
-
'post_status' => 'any',
|
440 |
-
'post_type' => 'attachment',
|
441 |
-
'post_mime_type' => implode(',', $mime_types));
|
442 |
-
|
443 |
-
$query['post_parent'] =
|
444 |
-
$this->atts['localpost']
|
445 |
-
&& ($post = get_post()) ? $post->ID : '';
|
446 |
-
|
447 |
-
$this->setTaxa($query);
|
448 |
-
|
449 |
-
if(!empty($this->errs)) {
|
450 |
-
throw new InvalidArgumentException();
|
451 |
-
}
|
452 |
-
|
453 |
-
return (false !== $this->atts['ids'])
|
454 |
-
? $this->getAttachmentsByIds()
|
455 |
-
: get_posts($query);
|
456 |
-
}
|
457 |
-
|
458 |
-
/**
|
459 |
-
* Function loops through all attributes passed that did not match
|
460 |
-
* self::$defaults. If they are the name of a taxonomy, they are plugged
|
461 |
-
* into the query, otherwise $this->errs is appended with an error string.
|
462 |
-
* @global string $wp_version Determines which tax query to use.
|
463 |
-
* @param multitype:unknown $query Query to insert tax query into.
|
464 |
-
*/
|
465 |
-
private function setTaxa(&$query) {
|
466 |
-
if(!empty($this->taxa)) {
|
467 |
-
$taxa = array();
|
468 |
-
|
469 |
-
// only include relation if we have multiple taxa
|
470 |
-
if(count($this->taxa) > 1) {
|
471 |
-
$taxa['relation'] = $this->atts['relation'];
|
472 |
-
}
|
473 |
-
|
474 |
-
foreach ($this->taxa as $taxon => $terms) {
|
475 |
-
$terms = $this->getTermIdsByNames($taxon, explode(',', $terms));
|
476 |
-
|
477 |
-
$taxa[] = array(
|
478 |
-
'taxonomy' => $taxon,
|
479 |
-
'field' => 'id',
|
480 |
-
'terms' => $terms
|
481 |
-
);
|
482 |
-
}
|
483 |
-
|
484 |
-
// create nested structure
|
485 |
-
$query['tax_query'] = $taxa;
|
486 |
-
}
|
487 |
-
}
|
488 |
-
|
489 |
-
/*==========================================================================
|
490 |
-
* HELPER FUNCTIONS
|
491 |
-
*=========================================================================*/
|
492 |
-
|
493 |
-
/**
|
494 |
-
* Returns an array of term ids when provided with a list of term names.
|
495 |
-
* Also appends an entry onto $errs if any invalid names are found.
|
496 |
-
* @param string $taxon The taxon these terms are a member of.
|
497 |
-
* @param multitype:string $term_names Terms to retrieve.
|
498 |
-
* @return multitype:string All matched terms.
|
499 |
-
*/
|
500 |
-
private function getTermIdsByNames($taxon, $term_names) {
|
501 |
-
return $this->getTermXByNames('term_id', $taxon, $term_names);
|
502 |
-
}
|
503 |
-
|
504 |
-
/**
|
505 |
-
* Returns an array of term slugs when provided with a list of term names.
|
506 |
-
* Also appends an entry onto $errs if any invalid names are found.
|
507 |
-
* @param string $taxon The taxon these terms are a member of.
|
508 |
-
* @param multitype:string $term_names Terms to retrieve.
|
509 |
-
* @return multitype:string All matched terms.
|
510 |
-
*/
|
511 |
-
private function getTermSlugsByNames($taxon, $term_names) {
|
512 |
-
return $this->getTermXByNames('slug', $taxon, $term_names);
|
513 |
-
}
|
514 |
-
|
515 |
-
/**
|
516 |
-
* Returns a list of x, where x may be any of the fields within a
|
517 |
-
* term object, when provided with a list of term names (not slugs).
|
518 |
-
* (http://codex.wordpress.org/Function_Reference/get_term_by#Return_Values)
|
519 |
-
*
|
520 |
-
* Also appends an entry onto $errs if any invalid names are found.
|
521 |
-
* @param string $x Field to retrieve from matched term.
|
522 |
-
* @param string $taxon The taxon these terms are a member of.
|
523 |
-
* @param multitype:string $term_names Terms to retrieve.
|
524 |
-
* @return multitype:string All matched terms.
|
525 |
-
*/
|
526 |
-
private function getTermXByNames($x, $taxon, $term_names) {
|
527 |
-
$ret = array();
|
528 |
-
|
529 |
-
foreach ($term_names as $name) {
|
530 |
-
if (($term = get_term_by('name', $name, $taxon))) {
|
531 |
-
$ret[] = $term->{$x};
|
532 |
-
} else {
|
533 |
-
$this->errs[] = sprintf(__('%s is not a valid term name in %s.',
|
534 |
-
'document-gallery'), $name, $taxon);
|
535 |
-
}
|
536 |
-
}
|
537 |
-
|
538 |
-
return $ret;
|
539 |
-
}
|
540 |
-
|
541 |
-
/**
|
542 |
-
* Given a list of IDs, all attachments represented by these IDs are returned.
|
543 |
-
* @return multitype:Post The posts matched.
|
544 |
-
*/
|
545 |
-
private function getAttachmentsByIds() {
|
546 |
-
$args = array(
|
547 |
-
'post_type' => 'attachment',
|
548 |
-
'post_status' => 'inherit',
|
549 |
-
'numberposts' => -1,
|
550 |
-
'post__in' => $this->atts['ids'],
|
551 |
-
'orderby' => 'post__in'
|
552 |
-
);
|
553 |
-
|
554 |
-
return count($args['post__in']) ? get_posts($args) : array();
|
555 |
-
}
|
556 |
-
|
557 |
-
/**
|
558 |
-
* Function returns false for positive ints, true otherwise.
|
559 |
-
* @param string $var could be anything.
|
560 |
-
* @return boolean indicating whether $var is not a positive int.
|
561 |
-
*/
|
562 |
-
private static function negativeInt($var) {
|
563 |
-
return !is_numeric($var) // isn't numeric
|
564 |
-
|| (int)$var != $var // isn't int
|
565 |
-
|| (int)$var < 0; // isn't positive
|
566 |
-
}
|
567 |
-
|
568 |
-
/**
|
569 |
-
* Converts provided value to bool.
|
570 |
-
* @param unknown $val To be converted.
|
571 |
-
* @return bool|NULL Bool value if can be parsed, else NULL.
|
572 |
-
*/
|
573 |
-
private static function toBool($val) {
|
574 |
-
if (is_bool($val)) {
|
575 |
-
return $val;
|
576 |
-
}
|
577 |
-
|
578 |
-
if (is_string($val)) {
|
579 |
-
$val = strtolower($val);
|
580 |
-
if ('true' === $val || '1' === $val) {
|
581 |
-
return true;
|
582 |
-
}
|
583 |
-
|
584 |
-
if ('false' === $val || '0' === $val) {
|
585 |
-
return false;
|
586 |
-
}
|
587 |
-
}
|
588 |
-
|
589 |
-
if (is_null($val)) {
|
590 |
-
return false;
|
591 |
-
}
|
592 |
-
|
593 |
-
return null;
|
594 |
-
}
|
595 |
-
|
596 |
-
/*==========================================================================
|
597 |
-
* OUTPUT HTML STRING
|
598 |
-
*=========================================================================*/
|
599 |
-
|
600 |
-
/**
|
601 |
-
* @filter dg_gallery_template Allows the user to filter anything content surrounding the generated gallery.
|
602 |
-
* @filter dg_row_template Filters the outer DG wrapper HTML. Passes a single
|
603 |
-
* bool value indicating whether the gallery is using descriptions or not.
|
604 |
-
* @return string HTML representing this Gallery.
|
605 |
-
*/
|
606 |
-
public function __toString() {
|
607 |
-
static $find = null;
|
608 |
-
if (is_null($find)) {
|
609 |
-
$find = array('%class%', '%icons%');
|
610 |
-
}
|
611 |
-
|
612 |
-
if(!empty($this->errs)) {
|
613 |
-
return '<p>' . implode('</p><p>', $this->errs) . '</p>';
|
614 |
-
}
|
615 |
-
|
616 |
-
if(empty($this->docs)) {
|
617 |
-
return self::$no_docs;
|
618 |
-
}
|
619 |
-
|
620 |
-
$icon_wrapper = apply_filters(
|
621 |
-
'dg_row_template',
|
622 |
-
'<div class="%class%">'. PHP_EOL . '%icons%' . PHP_EOL . '</div>' . PHP_EOL,
|
623 |
-
$this->useDescriptions());
|
624 |
-
|
625 |
-
$core = '';
|
626 |
-
$classes = array('document-icon-wrapper');
|
627 |
-
if($this->useDescriptions()) {
|
628 |
-
$classes[] = 'descriptions';
|
629 |
-
}
|
630 |
-
|
631 |
-
$repl = array(implode(' ', $classes));
|
632 |
-
if($this->useDescriptions()) {
|
633 |
-
foreach($this->docs as $doc) {
|
634 |
-
$repl[1] = $doc;
|
635 |
-
$core .= str_replace($find, $repl, $icon_wrapper);
|
636 |
-
}
|
637 |
-
} else {
|
638 |
-
for($i = 0; $i < count($this->docs); $i+=4) {
|
639 |
-
$repl[1] = '';
|
640 |
-
|
641 |
-
$min = min($i+4, count($this->docs));
|
642 |
-
for($x = $i; $x < $min; $x++) {
|
643 |
-
$repl[1] .= $this->docs[$x];
|
644 |
-
}
|
645 |
-
|
646 |
-
$core .= str_replace($find, $repl, $icon_wrapper);
|
647 |
-
}
|
648 |
-
}
|
649 |
-
|
650 |
-
// allow user to wrap gallery output
|
651 |
-
$gallery = apply_filters('dg_gallery_template', '%rows%', $this->useDescriptions());
|
652 |
-
return self::$comment . str_replace('%rows%', $core, $gallery);
|
653 |
-
}
|
654 |
-
}
|
655 |
-
|
656 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/class-image-editor-imagick.php
DELETED
@@ -1,66 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
include_once DG_WPINC_PATH . 'class-wp-image-editor.php';
|
5 |
-
include_once DG_WPINC_PATH . 'class-wp-image-editor-imagick.php';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Extends WP_Image_Editor_Imagick to support specifying which
|
9 |
-
* page to open for an Imagick file.
|
10 |
-
*
|
11 |
-
* @author drossiter
|
12 |
-
*/
|
13 |
-
class DG_Image_Editor_Imagick extends WP_Image_Editor_Imagick {
|
14 |
-
/**
|
15 |
-
* @var int The 0-indexed pg number
|
16 |
-
*/
|
17 |
-
private $pg;
|
18 |
-
|
19 |
-
/**
|
20 |
-
* @param str $file
|
21 |
-
* @param int $pg The 0-indexed pg number to edit.
|
22 |
-
*/
|
23 |
-
public function __construct($file, $pg = null) {
|
24 |
-
parent::__construct($file);
|
25 |
-
$this->pg = $pg;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Loads the filepath into Imagick object.
|
30 |
-
*/
|
31 |
-
public function load() {
|
32 |
-
$ret = parent::load();
|
33 |
-
|
34 |
-
// set correct page number
|
35 |
-
if (!is_wp_error($ret) && !is_null($this->pg)
|
36 |
-
&& is_callable(array($this->image, 'setIteratorIndex'))) {
|
37 |
-
$err = __('Failed to set Imagick page number');
|
38 |
-
|
39 |
-
// setIteratorIndex() should return false on failure, but I've found
|
40 |
-
// reports of it throwing an error so handling both cases.
|
41 |
-
// NOTE: I've also seen it fail and return true, so we may not
|
42 |
-
// log anything on failure...
|
43 |
-
try {
|
44 |
-
if (!$this->image->setIteratorIndex($this->pg)) {
|
45 |
-
DG_Logger::writeLog(DG_LogLevel::Error, $err . '.');
|
46 |
-
}
|
47 |
-
} catch(Exception $e) {
|
48 |
-
DG_Logger::writeLog(DG_LogLevel::Error, $err . ': ' . $e->getMessage());
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
return $ret;
|
53 |
-
}
|
54 |
-
|
55 |
-
/**
|
56 |
-
* @return array/bool The formats supported by Imagick, or false
|
57 |
-
*/
|
58 |
-
public static function query_formats() {
|
59 |
-
try {
|
60 |
-
return @Imagick::queryFormats();
|
61 |
-
} catch (Exception $ex) {
|
62 |
-
return false;
|
63 |
-
}
|
64 |
-
}
|
65 |
-
}
|
66 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/class-logger.php
DELETED
@@ -1,228 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Encapsulates the logic required to maintain and read log files.
|
6 |
-
*/
|
7 |
-
class DG_Logger {
|
8 |
-
/**
|
9 |
-
* Appends DG log file if logging is enabled. The following format is used for each line:
|
10 |
-
* datetime | level | entry | stacktrace (optional)
|
11 |
-
*
|
12 |
-
* @param int The level of serverity (should be passed using DG_LogLevel consts).
|
13 |
-
* @param string $entry Value to be logged.
|
14 |
-
* @param bool $stacktrace Whether to include full stack trace.
|
15 |
-
* @param bool $force Whether to ignore logging flag and log no matter what.
|
16 |
-
*/
|
17 |
-
public static function writeLog($level, $entry, $stacktrace = false, $force = false) {
|
18 |
-
if ($force || self::logEnabled()) {
|
19 |
-
$fp = fopen(self::getLogFileName(), 'a');
|
20 |
-
if (false !== $fp) {
|
21 |
-
$fields = array(time(), $level, $entry);
|
22 |
-
|
23 |
-
$trace = debug_backtrace(false);
|
24 |
-
if ($stacktrace) {
|
25 |
-
unset($trace[0]);
|
26 |
-
|
27 |
-
$trace_str = '';
|
28 |
-
$i = 1;
|
29 |
-
|
30 |
-
foreach($trace as $node) {
|
31 |
-
$trace_str .= "#$i ";
|
32 |
-
|
33 |
-
$file = '';
|
34 |
-
if (isset($node['file'])) {
|
35 |
-
// convert to relative path from WP root
|
36 |
-
$file = str_replace(ABSPATH, '', $node['file']);
|
37 |
-
}
|
38 |
-
|
39 |
-
if (isset($node['line'])) {
|
40 |
-
$file .= "({$node['line']})";
|
41 |
-
}
|
42 |
-
|
43 |
-
if ($file) {
|
44 |
-
$trace_str .= "$file: ";
|
45 |
-
}
|
46 |
-
|
47 |
-
if(isset($node['class'])) {
|
48 |
-
$trace_str .= "{$node['class']}{$node['type']}";
|
49 |
-
}
|
50 |
-
|
51 |
-
if (isset($node['function'])) {
|
52 |
-
$args = '';
|
53 |
-
if (isset($node['args'])) {
|
54 |
-
$args = implode(', ', array_map(array(__CLASS__, 'print_r'), $node['args']));
|
55 |
-
}
|
56 |
-
|
57 |
-
$trace_str .= "{$node['function']}($args)" . PHP_EOL;
|
58 |
-
}
|
59 |
-
$i++;
|
60 |
-
}
|
61 |
-
|
62 |
-
$fields[] = $trace_str;
|
63 |
-
} else {
|
64 |
-
// Remove first item from backtrace as it's this function which is redundant.
|
65 |
-
$caller = $trace[1];
|
66 |
-
$caller = (isset($caller['class']) ? $caller['class'] : '') . $caller['type'] . $caller['function'];
|
67 |
-
$fields[2] = '(' . $caller . ') ' . $fields[2];
|
68 |
-
}
|
69 |
-
|
70 |
-
fputcsv($fp, $fields);
|
71 |
-
fclose($fp);
|
72 |
-
} // TODO: else
|
73 |
-
}
|
74 |
-
}
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Reads the current blog's log file, placing the values in to a 2-dimensional array.
|
78 |
-
* @param int $skip How many lines to skip before returning rows.
|
79 |
-
* @param int $limit Max number of lines to read.
|
80 |
-
* @return multitype:multitype:string|null The rows from the log file or null if failed to open log.
|
81 |
-
*/
|
82 |
-
public static function readLog($skip = 0, $limit = PHP_INT_MAX) {
|
83 |
-
$ret = null;
|
84 |
-
$fp = @fopen(self::getLogFileName(), 'r');
|
85 |
-
|
86 |
-
if ($fp !== false) {
|
87 |
-
$ret = array();
|
88 |
-
while (count($ret) < $limit && ($fields = fgetcsv($fp)) !== false) {
|
89 |
-
if ($skip > 0) {
|
90 |
-
$skip--;
|
91 |
-
continue;
|
92 |
-
}
|
93 |
-
|
94 |
-
if (!is_null($fields)) {
|
95 |
-
$ret[] = $fields;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
}
|
99 |
-
|
100 |
-
return $ret;
|
101 |
-
}
|
102 |
-
|
103 |
-
/**
|
104 |
-
* Clears the log file for the active blog.
|
105 |
-
*/
|
106 |
-
public static function clearLog() {
|
107 |
-
// we don't care if the file actually exists -- it won't when we're done
|
108 |
-
@unlink(self::getLogFileName());
|
109 |
-
}
|
110 |
-
|
111 |
-
/**
|
112 |
-
* @return bool Whether debug logging is currently enabled.
|
113 |
-
*/
|
114 |
-
public static function logEnabled() {
|
115 |
-
global $dg_options;
|
116 |
-
return $dg_options['logging'];
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* @return string Full path to log file for current blog.
|
121 |
-
*/
|
122 |
-
private static function getLogFileName() {
|
123 |
-
return DG_PATH . 'log/' . get_current_blog_id() . '.log';
|
124 |
-
}
|
125 |
-
|
126 |
-
/**
|
127 |
-
* Wraps print_r passing true for the return argument.
|
128 |
-
* @param unknown $v Value to be printed.
|
129 |
-
* @return string Printed value.
|
130 |
-
*/
|
131 |
-
private static function print_r($v) {
|
132 |
-
return print_r($v, true);
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
/**
|
137 |
-
* LogLevel acts as an enumeration of all possible log levels.
|
138 |
-
*/
|
139 |
-
class DG_LogLevel {
|
140 |
-
/**
|
141 |
-
* @var int Log level for anything that doesn't indicate a problem.
|
142 |
-
*/
|
143 |
-
const Detail = 0;
|
144 |
-
|
145 |
-
/**
|
146 |
-
* @var int Log level for anything that is a minor issue.
|
147 |
-
*/
|
148 |
-
const Warning = 1;
|
149 |
-
|
150 |
-
/**
|
151 |
-
* @var int Log level for when something went wrong.
|
152 |
-
*/
|
153 |
-
const Error = 2;
|
154 |
-
|
155 |
-
/**
|
156 |
-
* @var ReflectionClass Backs the getter.
|
157 |
-
*/
|
158 |
-
private static $ref = null;
|
159 |
-
|
160 |
-
/**
|
161 |
-
* @return ReflectionClass Instance of reflection class for this class.
|
162 |
-
*/
|
163 |
-
private static function getReflectionClass() {
|
164 |
-
if (is_null(self::$ref)) {
|
165 |
-
self::$ref = new ReflectionClass(__CLASS__);
|
166 |
-
}
|
167 |
-
|
168 |
-
return self::$ref;
|
169 |
-
}
|
170 |
-
|
171 |
-
/**
|
172 |
-
* @var multitype Backs the getter.
|
173 |
-
*/
|
174 |
-
private static $levels = null;
|
175 |
-
|
176 |
-
/**
|
177 |
-
* @return multitype Associative array containing all log level names mapped to their int value.
|
178 |
-
*/
|
179 |
-
public static function getLogLevels() {
|
180 |
-
if (is_null(self::$levels)) {
|
181 |
-
$ref = self::getReflectionClass();
|
182 |
-
self::$levels = $ref->getConstants();
|
183 |
-
}
|
184 |
-
|
185 |
-
return self::$levels;
|
186 |
-
}
|
187 |
-
|
188 |
-
/**
|
189 |
-
* @param string $name Name to be checked for validity.
|
190 |
-
* @return bool Whether given name represents valid log level.
|
191 |
-
*/
|
192 |
-
public static function isValidName($name) {
|
193 |
-
return array_key_exists($name, self::getLogLevels());
|
194 |
-
}
|
195 |
-
|
196 |
-
/**
|
197 |
-
* @param int $value Value to be checked for validity.
|
198 |
-
* @return bool Whether given value represents valid log level.
|
199 |
-
*/
|
200 |
-
public static function isValidValue($value) {
|
201 |
-
return (false !== array_search($value, self::getLogLevels()));
|
202 |
-
}
|
203 |
-
|
204 |
-
/**
|
205 |
-
* @param string $name The name for which to retrieve a value.
|
206 |
-
* @return int|null The value associated with the given name.
|
207 |
-
*/
|
208 |
-
public static function getValueByName($name) {
|
209 |
-
$levels = self::getLogLevels();
|
210 |
-
return array_key_exists($name, self::getLogLevels()) ? $levels[$name] : null;
|
211 |
-
}
|
212 |
-
|
213 |
-
/**
|
214 |
-
* @param int $value The value for which to retrieve a name.
|
215 |
-
* @return string|null The name associated with the given value.
|
216 |
-
*/
|
217 |
-
public static function getNameByValue($value) {
|
218 |
-
$ret = array_search($value, self::getLogLevels());
|
219 |
-
return (false !== $ret) ? $ret : null;
|
220 |
-
}
|
221 |
-
|
222 |
-
/**
|
223 |
-
* Blocks instantiation. All functions are static.
|
224 |
-
*/
|
225 |
-
private function __construct() {
|
226 |
-
|
227 |
-
}
|
228 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/class-setup.php
DELETED
@@ -1,284 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Holds functions that handle DG setup / uninstallation.
|
6 |
-
*
|
7 |
-
* @author drossiter
|
8 |
-
*/
|
9 |
-
class DG_Setup {
|
10 |
-
|
11 |
-
/**
|
12 |
-
* The default DG options to be used on install and when validating structure of options.
|
13 |
-
* @param $skeleton bool When true, expensive values are not calculated. Only keys may be trusted when returning skeleton.
|
14 |
-
* @return array Contains default options for DG.
|
15 |
-
*/
|
16 |
-
public static function getDefaultOptions($skeleton = false) {
|
17 |
-
include_once DG_PATH . 'inc/class-thumber.php';
|
18 |
-
|
19 |
-
$date = $etag = $gs = null;
|
20 |
-
if (!$skeleton) {
|
21 |
-
$date = gmdate('D, d M Y H:i:s');
|
22 |
-
$etag = md5($date);
|
23 |
-
$gs = DG_Thumber::getGhostscriptExecutable();
|
24 |
-
}
|
25 |
-
|
26 |
-
return array(
|
27 |
-
'thumber' => array(
|
28 |
-
// cached thumbnails, keyed by post ID
|
29 |
-
'thumbs' => array(),
|
30 |
-
|
31 |
-
// Ghostscript path
|
32 |
-
'gs' => $gs,
|
33 |
-
|
34 |
-
// which thumbnail generation methods are available
|
35 |
-
'active' => DG_Thumber::getDefaultThumbers($skeleton),
|
36 |
-
|
37 |
-
// max width to generate thumbnails
|
38 |
-
'width' => 200,
|
39 |
-
|
40 |
-
// max height to generate thumbnails
|
41 |
-
'height' => 200,
|
42 |
-
|
43 |
-
// time after which to quite trying to generate new thumbanils for gallery
|
44 |
-
'timeout' => 30
|
45 |
-
),
|
46 |
-
'gallery' => array(
|
47 |
-
// default: link directly to file (true to link to attachment pg)
|
48 |
-
'attachment_pg' => false,
|
49 |
-
|
50 |
-
// include the attachment description in output
|
51 |
-
'descriptions' => false,
|
52 |
-
|
53 |
-
// include thumbnail of actual document in gallery display
|
54 |
-
'fancy' => true,
|
55 |
-
|
56 |
-
// comma-separated list of attachment ids
|
57 |
-
'ids' => false,
|
58 |
-
|
59 |
-
// if true, all images attached to current page will be included also
|
60 |
-
'images' => false,
|
61 |
-
|
62 |
-
// include just attached to the post using shortcode
|
63 |
-
'localpost' => true,
|
64 |
-
|
65 |
-
// ascending/descending order for included documents
|
66 |
-
'order' => 'ASC',
|
67 |
-
|
68 |
-
// which property to order by
|
69 |
-
'orderby' => 'menu_order',
|
70 |
-
|
71 |
-
// AND or OR
|
72 |
-
'relation' => 'AND'
|
73 |
-
),
|
74 |
-
'css' => array(
|
75 |
-
// plain text of CSS to be edited by user
|
76 |
-
'text' => '',
|
77 |
-
|
78 |
-
// "minified" text to be rendered on pages
|
79 |
-
'minified' => '',
|
80 |
-
|
81 |
-
// date/time last modified
|
82 |
-
'last-modified' => $date,
|
83 |
-
|
84 |
-
// used when telling browser whether to load from cache
|
85 |
-
'etag' => $etag,
|
86 |
-
|
87 |
-
// used in cache busting after user modifies CSS
|
88 |
-
'version' => 0
|
89 |
-
),
|
90 |
-
|
91 |
-
// current DG version
|
92 |
-
'version' => DG_VERSION,
|
93 |
-
|
94 |
-
// whether to validate DG option structure on save
|
95 |
-
'validation' => false,
|
96 |
-
|
97 |
-
// whether to logging DG activity
|
98 |
-
'logging' => false
|
99 |
-
);
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* Runs every page load, updates as needed.
|
104 |
-
*/
|
105 |
-
public static function maybeUpdate() {
|
106 |
-
global $dg_options;
|
107 |
-
|
108 |
-
// do update
|
109 |
-
if (null != $dg_options && DG_VERSION !== $dg_options['version']) {
|
110 |
-
$blogs = array(null);
|
111 |
-
|
112 |
-
if (is_multisite()) {
|
113 |
-
global $wpdb;
|
114 |
-
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
115 |
-
}
|
116 |
-
|
117 |
-
foreach ($blogs as $blog) {
|
118 |
-
self::_update($blog);
|
119 |
-
}
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Runs when update is needed, updating the given blog. If blog is null,
|
125 |
-
* active blog is updated.
|
126 |
-
* @param int $blog Blog to update or null if updating current blog.
|
127 |
-
*/
|
128 |
-
private static function _update($blog) {
|
129 |
-
$options = DocumentGallery::getOptions($blog);
|
130 |
-
if (is_null($options)) return;
|
131 |
-
|
132 |
-
// version-specific updates
|
133 |
-
self::twoPointTwo($options);
|
134 |
-
|
135 |
-
// update plugin version
|
136 |
-
$options['version'] = DG_VERSION;
|
137 |
-
|
138 |
-
// setup CSS
|
139 |
-
$options['css']['minified'] = isset($options['css']['text'])
|
140 |
-
? DocumentGallery::compileCustomCss($options['css']['text'])
|
141 |
-
: '';
|
142 |
-
$options['css']['last-modified'] = gmdate('D, d M Y H:i:s');
|
143 |
-
$options['css']['etag'] = md5($options['css']['last-modified']);
|
144 |
-
|
145 |
-
// remove previously-failed thumbs
|
146 |
-
$thumbs = $options['thumber']['thumbs'];
|
147 |
-
foreach ($thumbs as $k => $v) {
|
148 |
-
if (empty($v['thumber'])) {
|
149 |
-
unset($options['thumber']['thumbs'][$k]);
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
DocumentGallery::setOptions($options, $blog);
|
154 |
-
}
|
155 |
-
|
156 |
-
/**
|
157 |
-
* The 'created_timestamp' key in each thumb record is being moved
|
158 |
-
* to 'timestamp' as part of a move to store timestamp for failed
|
159 |
-
* thumbnails in addition to successful ones.
|
160 |
-
*
|
161 |
-
* The defaults sub-branch in the gallery branch is being flattened into its parent.
|
162 |
-
*
|
163 |
-
* @param array $options The options to be modified.
|
164 |
-
*/
|
165 |
-
private static function twoPointTwo(&$options) {
|
166 |
-
if (version_compare($options['version'], '2.2', '<')) {
|
167 |
-
$thumbs = array();
|
168 |
-
|
169 |
-
// "created_timestamp" moving to just "timestamp"
|
170 |
-
foreach ($options['thumber']['thumbs'] as $id => $thumb) {
|
171 |
-
if (false === $thumb) continue;
|
172 |
-
|
173 |
-
$thumbs[$id] = array(
|
174 |
-
'timestamp' => $thumb['created_timestamp'],
|
175 |
-
'thumb_url' => $thumb['thumb_url'],
|
176 |
-
'thumb_path' => $thumb['thumb_path'],
|
177 |
-
'thumber' => $thumb['thumber']
|
178 |
-
);
|
179 |
-
}
|
180 |
-
|
181 |
-
$options['thumber']['thumbs'] = $thumbs;
|
182 |
-
|
183 |
-
// adding default thumbnail generation timeout
|
184 |
-
$options['thumber']['timeout'] = 30;
|
185 |
-
|
186 |
-
// flatten out "defaults" level
|
187 |
-
$options['gallery'] = $options['gallery']['defaults'];
|
188 |
-
|
189 |
-
// adding "validation" branch
|
190 |
-
$options['validation'] = false;
|
191 |
-
|
192 |
-
// adding "logging" branch
|
193 |
-
$options['logging'] = false;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Sets up Document Gallery on all blog(s) activated.
|
199 |
-
* @param bool $networkwide Whether this is a network-wide update (multisite only).
|
200 |
-
*/
|
201 |
-
public static function activate($networkwide) {
|
202 |
-
$blogs = array(null);
|
203 |
-
|
204 |
-
if (is_multisite()) {
|
205 |
-
// check if it is a network activation
|
206 |
-
if ($networkwide) {
|
207 |
-
global $wpdb;
|
208 |
-
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
209 |
-
}
|
210 |
-
}
|
211 |
-
|
212 |
-
foreach ($blogs as $blog) {
|
213 |
-
self::_activate($blog);
|
214 |
-
}
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* Hooked into wpmu_new_blog to handle activating a new blog when plugin
|
219 |
-
* is already network activated.
|
220 |
-
* See discussion: https://core.trac.wordpress.org/ticket/14170
|
221 |
-
* @param int $blog Blog ID.
|
222 |
-
*/
|
223 |
-
public static function activateNewBlog($blog) {
|
224 |
-
if (is_plugin_active_for_network(DG_BASENAME)) {
|
225 |
-
self::_activate($blog);
|
226 |
-
}
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Runs activation setup for Document Gallery on all blog(s) it is activated on.
|
231 |
-
* @param int $blog Blog to update or null if updating current blog.
|
232 |
-
*/
|
233 |
-
private static function _activate($blog) {
|
234 |
-
$options = DocumentGallery::getOptions($blog);
|
235 |
-
|
236 |
-
// first activation
|
237 |
-
if (is_null($options)) {
|
238 |
-
DocumentGallery::setOptions(self::getDefaultOptions(), $blog);
|
239 |
-
}
|
240 |
-
}
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Runs when DG is uninstalled.
|
244 |
-
*/
|
245 |
-
public static function uninstall() {
|
246 |
-
if (!current_user_can('activate_plugins')) return;
|
247 |
-
check_admin_referer('bulk-plugins');
|
248 |
-
|
249 |
-
$blogs = array(null);
|
250 |
-
|
251 |
-
if (is_multisite()) {
|
252 |
-
global $wpdb;
|
253 |
-
$blogs = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
254 |
-
}
|
255 |
-
|
256 |
-
foreach ($blogs as $blog) {
|
257 |
-
self::_uninstall($blog);
|
258 |
-
}
|
259 |
-
}
|
260 |
-
/**
|
261 |
-
* Runs when DG is uninstalled for an individual blog.
|
262 |
-
*/
|
263 |
-
private static function _uninstall($blog) {
|
264 |
-
$options = DG_Thumber::getOptions($blog);
|
265 |
-
if (is_null($options)) return;
|
266 |
-
|
267 |
-
foreach ($options['thumbs'] as $val) {
|
268 |
-
if (isset($val['thumber'])) {
|
269 |
-
@unlink($val['thumb_path']);
|
270 |
-
}
|
271 |
-
}
|
272 |
-
|
273 |
-
DocumentGallery::deleteOptions($blog);
|
274 |
-
}
|
275 |
-
|
276 |
-
/**
|
277 |
-
* Blocks instantiation. All functions are static.
|
278 |
-
*/
|
279 |
-
private function __construct() {
|
280 |
-
|
281 |
-
}
|
282 |
-
}
|
283 |
-
|
284 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/class-thumber.php
DELETED
@@ -1,818 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
defined('WPINC') OR exit;
|
3 |
-
|
4 |
-
/**
|
5 |
-
* Thumber wraps the functionality required to
|
6 |
-
* generate thumbnails for arbitrary documents.
|
7 |
-
*
|
8 |
-
* @author drossiter
|
9 |
-
*/
|
10 |
-
class DG_Thumber {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Returns the default mapping of thumber slug to whether it is active or not.
|
14 |
-
* @param $skeleton bool When true, values that require computation will be
|
15 |
-
* skipped. Useful when only structure of options is needed.
|
16 |
-
* @return array
|
17 |
-
*/
|
18 |
-
public static function getDefaultThumbers($skeleton = false) {
|
19 |
-
$gs_active = $imagick_active = null;
|
20 |
-
if (!$skeleton) {
|
21 |
-
$gs_active = (bool)self::getGhostscriptExecutable();
|
22 |
-
$imagick_active = self::isImagickAvailable();
|
23 |
-
}
|
24 |
-
|
25 |
-
return array('av' => true, 'gs' => $gs_active,
|
26 |
-
'imagick' => $imagick_active, 'google' => false);
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Wraps generation of thumbnails for various attachment filetypes.
|
31 |
-
*
|
32 |
-
* @param int $ID Document ID
|
33 |
-
* @param int $pg Page number to get thumb from.
|
34 |
-
* @return str URL to the thumbnail.
|
35 |
-
*/
|
36 |
-
public static function getThumbnail($ID, $pg = 1) {
|
37 |
-
static $start = null;
|
38 |
-
if (is_null($start)) {
|
39 |
-
$start = time();
|
40 |
-
}
|
41 |
-
|
42 |
-
$options = self::getOptions();
|
43 |
-
|
44 |
-
// if we haven't saved a thumb, generate one
|
45 |
-
if (empty($options['thumbs'][$ID])) {
|
46 |
-
// prevent page timing out or user waiting too long for page
|
47 |
-
if ((time() - $start) > $options['timeout']) {
|
48 |
-
return self::getDefaultThumbnail($ID, $pg);
|
49 |
-
}
|
50 |
-
|
51 |
-
// do the processing
|
52 |
-
$file = get_attached_file($ID);
|
53 |
-
|
54 |
-
foreach (self::getThumbers() as $ext_preg => $thumber) {
|
55 |
-
$ext_preg = '!\.(' . $ext_preg . ')$!i';
|
56 |
-
|
57 |
-
if (preg_match($ext_preg, $file)) {
|
58 |
-
if (DG_Logger::logEnabled()) {
|
59 |
-
$toLog = sprintf(__('Attempting to generate thumbnail for attachment #%d with (%s)',
|
60 |
-
'document-gallery'), $ID, is_array($thumber) ? implode('::',$thumber) : print_r($thumber, true));
|
61 |
-
DG_Logger::writeLog(DG_LogLevel::Detail, $toLog);
|
62 |
-
}
|
63 |
-
|
64 |
-
if ($thumb = self::getThumbnailTemplate($thumber, $ID, $pg)) {
|
65 |
-
$options['thumbs'][$ID] = array(
|
66 |
-
'timestamp' => time(),
|
67 |
-
'thumb_url' => $thumb['url'],
|
68 |
-
'thumb_path' => $thumb['path'],
|
69 |
-
'thumber' => $thumber
|
70 |
-
);
|
71 |
-
self::setOptions($options);
|
72 |
-
break;
|
73 |
-
}
|
74 |
-
}
|
75 |
-
}
|
76 |
-
}
|
77 |
-
|
78 |
-
$new = empty($options['thumbs'][$ID]);
|
79 |
-
if ($new || empty($options['thumbs'][$ID]['thumber'])) {
|
80 |
-
if ($new) {
|
81 |
-
$options['thumbs'][$ID] = array('timestamp' => time());
|
82 |
-
self::setOptions($options);
|
83 |
-
}
|
84 |
-
|
85 |
-
// fallback to default thumb for attachment type
|
86 |
-
$url = self::getDefaultThumbnail($ID, $pg);
|
87 |
-
} else {
|
88 |
-
// use generated thumbnail
|
89 |
-
$url = $options['thumbs'][$ID]['thumb_url'];
|
90 |
-
}
|
91 |
-
|
92 |
-
return $url;
|
93 |
-
}
|
94 |
-
|
95 |
-
/*==========================================================================
|
96 |
-
* AUDIO VIDEO THUMBNAILS
|
97 |
-
*=========================================================================*/
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Uses wp_read_video_metadata() and wp_read_audio_metadata() to retrieve
|
101 |
-
* an embedded image to use as a thumbnail.
|
102 |
-
*
|
103 |
-
* @param str $ID The attachment ID to retrieve thumbnail from.
|
104 |
-
* @param int $pg Unused.
|
105 |
-
* @return bool|str False on failure, URL to thumb on success.
|
106 |
-
*/
|
107 |
-
public static function getAudioVideoThumbnail($ID, $pg = 1) {
|
108 |
-
include_once DG_WPADMIN_PATH . 'includes/media.php';
|
109 |
-
|
110 |
-
$attachment = get_post($ID);
|
111 |
-
$doc_path = get_attached_file($ID);
|
112 |
-
|
113 |
-
if (preg_match('#^video/#', get_post_mime_type($attachment))) {
|
114 |
-
$metadata = wp_read_video_metadata($doc_path);
|
115 |
-
}
|
116 |
-
elseif (preg_match('#^audio/#', get_post_mime_type($attachment))) {
|
117 |
-
$metadata = wp_read_audio_metadata($doc_path);
|
118 |
-
}
|
119 |
-
|
120 |
-
// unsupported mime type || no embedded image present
|
121 |
-
if(!isset($metadata) || empty($metadata['image']['data'])) {
|
122 |
-
return false;
|
123 |
-
}
|
124 |
-
|
125 |
-
$ext = 'jpg';
|
126 |
-
switch ($metadata['image']['mime']) {
|
127 |
-
case 'image/gif':
|
128 |
-
$ext = 'gif';
|
129 |
-
break;
|
130 |
-
case 'image/png':
|
131 |
-
$ext = 'png';
|
132 |
-
break;
|
133 |
-
}
|
134 |
-
|
135 |
-
$temp_file = self::getTempFile($ext);
|
136 |
-
|
137 |
-
if (!$fp = @fopen($temp_file, 'wb')) {
|
138 |
-
DG_Logger::writeLog(DG_LogLevel::Error, __('Could not open file: ', 'document-gallery') . $temp_file);
|
139 |
-
return false;
|
140 |
-
}
|
141 |
-
|
142 |
-
if (!@fwrite($fp, $metadata['image']['data'])) {
|
143 |
-
DG_Logger::writeLog(DG_LogLevel::Error, __('Could not write file: ', 'document-gallery') . $temp_file);
|
144 |
-
fclose($fp);
|
145 |
-
return false;
|
146 |
-
}
|
147 |
-
|
148 |
-
fclose($fp);
|
149 |
-
|
150 |
-
return $temp_file;
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @return array All extensions supported by WP Audio Video Media metadata.
|
155 |
-
*/
|
156 |
-
private static function getAudioVideoExts() {
|
157 |
-
return array_merge(wp_get_audio_extensions(), wp_get_video_extensions());
|
158 |
-
}
|
159 |
-
|
160 |
-
/*==========================================================================
|
161 |
-
* IMAGICK THUMBNAILS
|
162 |
-
*=========================================================================*/
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Uses WP_Image_Editor_Imagick to generate thumbnails.
|
166 |
-
*
|
167 |
-
* @param int $ID The attachment ID to retrieve thumbnail from.
|
168 |
-
* @param int $pg The page to get the thumbnail of.
|
169 |
-
* @return bool|str False on failure, URL to thumb on success.
|
170 |
-
*/
|
171 |
-
public static function getImagickThumbnail($ID, $pg = 1) {
|
172 |
-
include_once DG_PATH . 'inc/class-image-editor-imagick.php';
|
173 |
-
|
174 |
-
$doc_path = get_attached_file($ID);
|
175 |
-
$img = new DG_Image_Editor_Imagick($doc_path, $pg - 1);
|
176 |
-
$err = $img->load();
|
177 |
-
if(is_wp_error($err)) {
|
178 |
-
DG_Logger::writeLog(
|
179 |
-
DG_LogLevel::Error,
|
180 |
-
__('Failed to open file in Imagick: ', 'document-gallery') .
|
181 |
-
$err->get_error_message());
|
182 |
-
return false;
|
183 |
-
}
|
184 |
-
|
185 |
-
$temp_file = self::getTempFile();
|
186 |
-
|
187 |
-
$err = $img->save($temp_file, 'image/png');
|
188 |
-
if (is_wp_error($err)) {
|
189 |
-
DG_Logger::writeLog(
|
190 |
-
DG_LogLevel::Error,
|
191 |
-
__('Failed to save image in Imagick: ', 'document-gallery') .
|
192 |
-
$err->get_error_message());
|
193 |
-
return false;
|
194 |
-
}
|
195 |
-
|
196 |
-
return $temp_file;
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* @return bool Whether WP_Image_Editor_Imagick can be used on this system.
|
201 |
-
*/
|
202 |
-
public static function isImagickAvailable() {
|
203 |
-
static $ret = null;
|
204 |
-
|
205 |
-
if (is_null($ret)) {
|
206 |
-
include_once DG_WPINC_PATH . 'class-wp-image-editor.php';
|
207 |
-
include_once DG_WPINC_PATH . 'class-wp-image-editor-imagick.php';
|
208 |
-
$ret = WP_Image_Editor_Imagick::test();
|
209 |
-
}
|
210 |
-
|
211 |
-
return $ret;
|
212 |
-
}
|
213 |
-
|
214 |
-
/*==========================================================================
|
215 |
-
* GHOSTSCRIPT THUMBNAILS
|
216 |
-
*=========================================================================*/
|
217 |
-
|
218 |
-
/**
|
219 |
-
* Get thumbnail for document with given ID using Ghostscript. Imagick could
|
220 |
-
* also handle this, but is *much* slower.
|
221 |
-
*
|
222 |
-
* @param int $ID The attachment ID to retrieve thumbnail from.
|
223 |
-
* @param int $pg The page number to make thumbnail of -- index starts at 1.
|
224 |
-
* @return bool|str False on failure, URL to thumb on success.
|
225 |
-
*/
|
226 |
-
public static function getGhostscriptThumbnail($ID, $pg = 1) {
|
227 |
-
static $gs = null;
|
228 |
-
|
229 |
-
if (is_null($gs)) {
|
230 |
-
$options = self::getOptions();
|
231 |
-
$gs = $options['gs'];
|
232 |
-
|
233 |
-
if (false !== $gs) {
|
234 |
-
$gs = escapeshellarg($gs) . ' -sDEVICE=png16m -dFirstPage=%d'
|
235 |
-
. ' -dLastPage=%d -dBATCH -dNOPAUSE -dPDFFitPage -sOutputFile=%s %s';
|
236 |
-
}
|
237 |
-
}
|
238 |
-
|
239 |
-
if (false === $gs) {
|
240 |
-
return false;
|
241 |
-
}
|
242 |
-
|
243 |
-
$doc_path = get_attached_file($ID);
|
244 |
-
$temp_path = self::getTempFile();
|
245 |
-
|
246 |
-
exec(sprintf($gs, $pg, $pg, $temp_path, $doc_path), $out, $ret);
|
247 |
-
|
248 |
-
if ($ret != 0) {
|
249 |
-
DG_Logger::writeLog(DG_LogLevel::Error, __('Ghostscript failed: ', 'document-gallery') . print_r($out));
|
250 |
-
@unlink($temp_path);
|
251 |
-
return false;
|
252 |
-
}
|
253 |
-
|
254 |
-
return $temp_path;
|
255 |
-
}
|
256 |
-
|
257 |
-
/**
|
258 |
-
* @return array All extensions supported by Ghostscript.
|
259 |
-
*/
|
260 |
-
private static function getGhostscriptExts() {
|
261 |
-
return array('pdf', 'ps', 'eps');
|
262 |
-
}
|
263 |
-
|
264 |
-
/**
|
265 |
-
* Dynamically determines whether we may call gs through exec().
|
266 |
-
*
|
267 |
-
* NOTE: This does not check the options for gs path. Don't use in
|
268 |
-
* thumbnail generation as it's slow and not configurable.
|
269 |
-
*
|
270 |
-
* @return bool|str If available, returns exe path. False otherwise.
|
271 |
-
*/
|
272 |
-
public static function getGhostscriptExecutable() {
|
273 |
-
static $executable = null;
|
274 |
-
|
275 |
-
if (is_null($executable)) {
|
276 |
-
// we must be able to exec()
|
277 |
-
$executable = self::isExecAvailable();
|
278 |
-
if (!$executable) return $executable;
|
279 |
-
|
280 |
-
// find on Windows system
|
281 |
-
if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
|
282 |
-
// look for environment variable
|
283 |
-
$executable = getenv('GSC');
|
284 |
-
if ($executable) return $executable;
|
285 |
-
|
286 |
-
// hope GS in the path
|
287 |
-
$executable = exec('where gswin*c.exe');
|
288 |
-
if (!empty($executable)) return $executable;
|
289 |
-
|
290 |
-
// look directly in filesystem
|
291 |
-
// 64- or 32-bit binary
|
292 |
-
$executable = exec('dir /o:n/s/b "C:\Program Files\gs\*gswin*c.exe"');
|
293 |
-
if (!empty($executable)) {
|
294 |
-
return $executable;
|
295 |
-
}
|
296 |
-
|
297 |
-
// 32-bit binary on 64-bit OS
|
298 |
-
$executable = exec('dir /o:n/s/b "C:\Program Files (x86)\gs\*gswin32c.exe"');
|
299 |
-
$executable = empty($executable) ? false : $executable;
|
300 |
-
return $executable;
|
301 |
-
}
|
302 |
-
|
303 |
-
// handle Linux systems
|
304 |
-
$executable = exec('which gs');
|
305 |
-
if (!empty($executable)) {
|
306 |
-
return $executable;
|
307 |
-
}
|
308 |
-
|
309 |
-
// GoDaddy and others aren't setup in such a way that
|
310 |
-
// the above works so we need to fallback to a direct
|
311 |
-
// filesystem check
|
312 |
-
$executable = file_exists('/usr/bin/gs') ? '/usr/bin/gs' : false;
|
313 |
-
|
314 |
-
return $executable;
|
315 |
-
}
|
316 |
-
|
317 |
-
return $executable;
|
318 |
-
}
|
319 |
-
|
320 |
-
/**
|
321 |
-
* @return bool Whether we can use the GS executable.
|
322 |
-
*/
|
323 |
-
public static function isGhostscriptAvailable() {
|
324 |
-
static $ret = null;
|
325 |
-
|
326 |
-
if (is_null($ret)) {
|
327 |
-
$options = self::getOptions();
|
328 |
-
$ret = $options['gs'] && self::isExecAvailable();
|
329 |
-
}
|
330 |
-
|
331 |
-
return $ret;
|
332 |
-
}
|
333 |
-
|
334 |
-
/*==========================================================================
|
335 |
-
* GOOGLE DRIVE VIEWER THUMBNAILS
|
336 |
-
*=========================================================================*/
|
337 |
-
|
338 |
-
/**
|
339 |
-
* Get thumbnail for document with given ID from Google Drive Viewer.
|
340 |
-
*
|
341 |
-
* NOTE: Caller must verify that extension is supported.
|
342 |
-
*
|
343 |
-
* @param str $ID The attachment ID to retrieve thumbnail for.
|
344 |
-
* @param int $pg The page number to make thumbnail of -- index starts at 1.
|
345 |
-
* @return bool|str False on failure, URL to thumb on success.
|
346 |
-
*/
|
347 |
-
public static function getGoogleDriveThumbnail($ID, $pg = 1) {
|
348 |
-
// User agent for Lynx 2.8.7rel.2 -- Why? Because I can.
|
349 |
-
static $user_agent = 'Lynx/2.8.7rel.2 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/1.0.0a';
|
350 |
-
static $timeout = 60;
|
351 |
-
|
352 |
-
$google_viewer = 'https://docs.google.com/viewer?url=%s&a=bi&pagenumber=%d&w=%d';
|
353 |
-
$doc_url = wp_get_attachment_url($ID);
|
354 |
-
if (!$doc_url) {
|
355 |
-
return false;
|
356 |
-
}
|
357 |
-
|
358 |
-
$temp_file = self::getTempFile();
|
359 |
-
|
360 |
-
// args for use in HTTP request
|
361 |
-
$args = array(
|
362 |
-
'timeout' => $timeout, // these requests can take a LONG time
|
363 |
-
'redirection' => 5,
|
364 |
-
'httpversion' => '1.0',
|
365 |
-
'user-agent' => $user_agent,
|
366 |
-
'blocking' => true,
|
367 |
-
'headers' => array(),
|
368 |
-
'cookies' => array(),
|
369 |
-
'body' => null,
|
370 |
-
'compress' => false,
|
371 |
-
'decompress' => true,
|
372 |
-
'sslverify' => true,
|
373 |
-
'stream' => true,
|
374 |
-
'filename' => $temp_file
|
375 |
-
);
|
376 |
-
|
377 |
-
// prevent PHP timeout before HTTP completes
|
378 |
-
@set_time_limit($timeout);
|
379 |
-
|
380 |
-
$options = self::getOptions();
|
381 |
-
$google_viewer = sprintf($google_viewer, urlencode($doc_url), (int)$pg, $options['width']);
|
382 |
-
|
383 |
-
// get thumbnail from Google Drive Viewer & check for error on return
|
384 |
-
$response = wp_remote_get($google_viewer, $args);
|
385 |
-
|
386 |
-
if (is_wp_error($response) || !preg_match('/[23][0-9]{2}/', $response['response']['code'])) {
|
387 |
-
DG_Logger::writeLog(DG_LogLevel::Warning, __('Failed to retrieve thumbnail from Google: ', 'document-gallery') .
|
388 |
-
(is_wp_error($response)
|
389 |
-
? $response->get_error_message()
|
390 |
-
: $response['response']['message']));
|
391 |
-
|
392 |
-
@unlink($temp_file);
|
393 |
-
return false;
|
394 |
-
}
|
395 |
-
|
396 |
-
return $temp_file;
|
397 |
-
}
|
398 |
-
|
399 |
-
/**
|
400 |
-
* @return array All extensions supported by Google Drive Viewer.
|
401 |
-
*/
|
402 |
-
private static function getGoogleDriveExts() {
|
403 |
-
return array(
|
404 |
-
'tiff', 'bmp', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
|
405 |
-
'pdf', 'pages', 'ai', 'psd', 'dxf', 'svg', 'eps', 'ps', 'ttf'
|
406 |
-
);
|
407 |
-
}
|
408 |
-
|
409 |
-
/**
|
410 |
-
* TODO: Currently always returns true.
|
411 |
-
* @return bool Whether Google Drive can access files on this system.
|
412 |
-
*/
|
413 |
-
public static function isGoogleDriveAvailable() {
|
414 |
-
return true;
|
415 |
-
}
|
416 |
-
|
417 |
-
/*==========================================================================
|
418 |
-
* DEFAULT THUMBNAILS
|
419 |
-
*=========================================================================*/
|
420 |
-
|
421 |
-
/**
|
422 |
-
* Get thumbnail for document with given ID from default images.
|
423 |
-
*
|
424 |
-
* @param str $ID The attachment ID to retrieve thumbnail from.
|
425 |
-
* @param int $pg Unused.
|
426 |
-
* @return str URL to thumbnail.
|
427 |
-
*/
|
428 |
-
public static function getDefaultThumbnail($ID, $pg = 1) {
|
429 |
-
$options = self::getOptions();
|
430 |
-
$width = $options['width'];
|
431 |
-
$height = $options['height'];
|
432 |
-
$icon_url = DG_URL . 'assets/icons/';
|
433 |
-
|
434 |
-
$url = wp_get_attachment_url($ID);
|
435 |
-
$ext = self::getExt($url);
|
436 |
-
|
437 |
-
// handle images
|
438 |
-
if ($icon = image_downsize($ID, array($width, $height))) {
|
439 |
-
$icon = $icon[0];
|
440 |
-
}
|
441 |
-
// default extension icon
|
442 |
-
elseif ($name = self::getDefaultIcon($ext)) {
|
443 |
-
$icon = $icon_url . $name;
|
444 |
-
}
|
445 |
-
// fallback to standard WP icons
|
446 |
-
elseif (!$icon = wp_mime_type_icon($ID)) {
|
447 |
-
// everything failed. This is bad...
|
448 |
-
$icon = $icon_url . 'missing.png';
|
449 |
-
}
|
450 |
-
|
451 |
-
return $icon;
|
452 |
-
}
|
453 |
-
|
454 |
-
/**
|
455 |
-
* Returns the name of the image to represent the filetype given.
|
456 |
-
*
|
457 |
-
* @param str $ext
|
458 |
-
* @return str
|
459 |
-
*/
|
460 |
-
private static function getDefaultIcon($ext) {
|
461 |
-
// Maps file ext to default image name.
|
462 |
-
static $exts = array(
|
463 |
-
// Most Common First
|
464 |
-
'pdf' => 'pdf.png',
|
465 |
-
|
466 |
-
// MS Office
|
467 |
-
'doc|docx|docm|dotx|dotm' => 'msdoc.png',
|
468 |
-
'ppt|pot|pps|pptx|pptm|ppsx|ppsm|potx|potm|ppam|sldx|sldm' => 'msppt.png',
|
469 |
-
'xla|xls|xlt|xlw|xlsx|xlsm|xlsb|xltx|xltm|xlam' => 'msxls.png',
|
470 |
-
'mdb' => 'msaccess.png',
|
471 |
-
|
472 |
-
// iWork
|
473 |
-
'key' => 'key.png',
|
474 |
-
'numbers' => 'numbers.png',
|
475 |
-
'pages' => 'pages.png',
|
476 |
-
|
477 |
-
// Images
|
478 |
-
'jpg|jpeg|jpe|gif|png|bmp|tif|tiff|ico' => 'image.png',
|
479 |
-
|
480 |
-
// Video formats
|
481 |
-
'asf|asx|wmv|wmx|wm|avi|divx|flv|mov' => 'video.png',
|
482 |
-
'qt|mpeg|mpg|mpe|mp4|m4v|ogv|webm|mkv' => 'video.png',
|
483 |
-
|
484 |
-
// Audio formats
|
485 |
-
'mp3|m4a|m4b|ra|ram|wav|ogg|oga|wma|wax|mka' => 'audio.png',
|
486 |
-
'midi|mid' => 'midi.png',
|
487 |
-
|
488 |
-
// Text formats
|
489 |
-
'txt|tsv|csv' => 'text.png',
|
490 |
-
'rtx' => 'rtx.png',
|
491 |
-
'rtf' => 'rtf.png',
|
492 |
-
'ics' => 'ics.png',
|
493 |
-
'wp|wpd' => 'wordperfect.png',
|
494 |
-
|
495 |
-
// Programming
|
496 |
-
'html|htm' => 'html.png',
|
497 |
-
'css' => 'css.png',
|
498 |
-
'js' => 'javascript.png',
|
499 |
-
'class' => 'java.png',
|
500 |
-
'asc' => 'asc.png',
|
501 |
-
'c' => 'c.png',
|
502 |
-
'cc|cpp' => 'cpp.png',
|
503 |
-
'h' => 'h.png',
|
504 |
-
|
505 |
-
// Msc application formats
|
506 |
-
'zip|tar|gzip|gz|bz2|tgz|7z|rar' => 'compressed.png',
|
507 |
-
'exe' => 'exec.png',
|
508 |
-
'swf' => 'shockwave.png',
|
509 |
-
|
510 |
-
// OpenDocument formats
|
511 |
-
'odt' => 'opendocument-text.png',
|
512 |
-
'odp' => 'opendocument-presentation.png',
|
513 |
-
'ods' => 'opendocument-spreadsheet.png',
|
514 |
-
'odg' => 'opendocument-graphics.png',
|
515 |
-
'odb' => 'opendocument-database.png',
|
516 |
-
'odf' => 'opendocument-formula.png'
|
517 |
-
);
|
518 |
-
|
519 |
-
foreach ($exts as $ext_preg => $icon) {
|
520 |
-
$ext_preg = '!(' . $ext_preg . ')$!i';
|
521 |
-
if (preg_match($ext_preg, $ext)) {
|
522 |
-
return $icon;
|
523 |
-
}
|
524 |
-
}
|
525 |
-
|
526 |
-
return false;
|
527 |
-
}
|
528 |
-
|
529 |
-
/*==========================================================================
|
530 |
-
* GENERAL THUMBNAIL HELPER FUNCTIONS
|
531 |
-
*=========================================================================*/
|
532 |
-
|
533 |
-
/**
|
534 |
-
* @return array WP_Post objects for each attachment that has been processed.
|
535 |
-
*/
|
536 |
-
public static function getThumbed() {
|
537 |
-
$options = self::getOptions();
|
538 |
-
$args = array(
|
539 |
-
'post_type' => 'attachment',
|
540 |
-
'post_status' => 'inherit',
|
541 |
-
'post_per_page' => -1,
|
542 |
-
'post__in' => array_keys($options['thumbs'])
|
543 |
-
);
|
544 |
-
|
545 |
-
return count($args['post__in']) ? get_posts($args) : array();
|
546 |
-
}
|
547 |
-
|
548 |
-
/**
|
549 |
-
* Key: Attachment ID
|
550 |
-
* Val: array
|
551 |
-
* + timestamp - When the thumbnail was generated (or generation failed).
|
552 |
-
* + thumb_path - System path to thumbnail image.
|
553 |
-
* + thumb_url - URL pointing to the thumbnail for this document.
|
554 |
-
* + thumber - Generator used to create thumb OR false if failed to gen.
|
555 |
-
* @return array|null Thumber options from DB or null if options not initialized.
|
556 |
-
*/
|
557 |
-
public static function getOptions($blog = null) {
|
558 |
-
$options = DocumentGallery::getOptions($blog);
|
559 |
-
return $options['thumber'];
|
560 |
-
}
|
561 |
-
|
562 |
-
/**
|
563 |
-
* Key: Attachment ID
|
564 |
-
* Val: array
|
565 |
-
* + timestamp - When the thumbnail was generated (or generation failed).
|
566 |
-
* + thumb_path - System path to thumbnail image.
|
567 |
-
* + thumb_url - URL pointing to the thumbnail for this document.
|
568 |
-
* + thumber - Generator used to create thumb OR false if failed to gen.
|
569 |
-
* @param array $options Thumber options to store in DB
|
570 |
-
*/
|
571 |
-
private static function setOptions($options, $blog = null) {
|
572 |
-
$dg_options = DocumentGallery::getOptions($blog);
|
573 |
-
$dg_options['thumber'] = $options;
|
574 |
-
DocumentGallery::setOptions($dg_options, $blog);
|
575 |
-
}
|
576 |
-
|
577 |
-
/**
|
578 |
-
* @filter dg_thumbers Allows developers to filter the Thumbers used
|
579 |
-
* for specific filetypes. Index is the regex to match file extensions
|
580 |
-
* supported and the value is anything that can be accepted by call_user_func().
|
581 |
-
* The function must take two parameters, 1st is the int ID of the attachment
|
582 |
-
* to get a thumbnail for, 2nd is the page to take a thumbnail of
|
583 |
-
* (may not be relevant for some filetypes).
|
584 |
-
*
|
585 |
-
* @return array
|
586 |
-
*/
|
587 |
-
private static function getThumbers() {
|
588 |
-
static $thumbers = null;
|
589 |
-
|
590 |
-
if (is_null($thumbers)) {
|
591 |
-
$options = self::getOptions();
|
592 |
-
$active = $options['active'];
|
593 |
-
$thumbers = array();
|
594 |
-
|
595 |
-
// Audio/Video embedded images
|
596 |
-
if ($active['av']) {
|
597 |
-
$exts = implode('|', self::getAudioVideoExts());
|
598 |
-
$thumbers[$exts] = array(__CLASS__, 'getAudioVideoThumbnail');
|
599 |
-
}
|
600 |
-
|
601 |
-
// Ghostscript
|
602 |
-
if ($active['gs'] && self::isGhostscriptAvailable()) {
|
603 |
-
$exts = implode('|', self::getGhostscriptExts());
|
604 |
-
$thumbers[$exts] = array(__CLASS__, 'getGhostscriptThumbnail');
|
605 |
-
}
|
606 |
-
|
607 |
-
// Imagick
|
608 |
-
if ($active['imagick'] && self::isImagickAvailable()) {
|
609 |
-
include_once DG_PATH . 'inc/class-image-editor-imagick.php';
|
610 |
-
if ($exts = DG_Image_Editor_Imagick::query_formats()) {
|
611 |
-
$exts = implode('|', $exts);
|
612 |
-
$thumbers[$exts] = array(__CLASS__, 'getImagickThumbnail');
|
613 |
-
}
|
614 |
-
}
|
615 |
-
|
616 |
-
// Google Drive Viewer
|
617 |
-
if ($active['google']) {
|
618 |
-
$exts = implode('|', self::getGoogleDriveExts());
|
619 |
-
$thumbers[$exts] = array(__CLASS__, 'getGoogleDriveThumbnail');
|
620 |
-
}
|
621 |
-
|
622 |
-
// allow users to filter thumbers used
|
623 |
-
$thumbers = apply_filters('dg_thumbers', $thumbers);
|
624 |
-
|
625 |
-
// strip out anything that can't be called
|
626 |
-
$thumbers = array_filter($thumbers, 'is_callable');
|
627 |
-
|
628 |
-
// log which thumbers are being used
|
629 |
-
if (DG_Logger::logEnabled()) {
|
630 |
-
if (count($thumbers) > 0) {
|
631 |
-
$entry = __('Thumbnail Generators: ', 'document-gallery');
|
632 |
-
foreach ($thumbers as $k => $v) {
|
633 |
-
$thumber = is_array($v) ? implode('::', $v) : print_r($v, true);
|
634 |
-
|
635 |
-
// TODO: The following works for all internal regexes, but may have unpredictable
|
636 |
-
// results if developer adds additional thumbnail generators using different regexes
|
637 |
-
$filetypes = str_replace('|', ', ', $k);
|
638 |
-
|
639 |
-
$entry .= PHP_EOL . "$thumber: $filetypes";
|
640 |
-
}
|
641 |
-
} else {
|
642 |
-
$entry = __('No thumbnail generators enabled.', 'document-gallery');
|
643 |
-
}
|
644 |
-
DG_Logger::writeLog(DG_LogLevel::Detail, $entry);
|
645 |
-
}
|
646 |
-
}
|
647 |
-
|
648 |
-
return $thumbers;
|
649 |
-
}
|
650 |
-
|
651 |
-
/**
|
652 |
-
* Template that handles generating a thumbnail.
|
653 |
-
*
|
654 |
-
* @param callable $generator Takes ID and pg and returns path to temp file or false.
|
655 |
-
* @param int $ID ID for the attachment that we need a thumbnail for.
|
656 |
-
* @param int $pg Page number of the attachment to get a thumbnail for.
|
657 |
-
* @return bool|array Array containing 'url' and 'path' values or false.
|
658 |
-
*/
|
659 |
-
public static function getThumbnailTemplate($generator, $ID, $pg = 1) {
|
660 |
-
// delegate thumbnail generation to $generator
|
661 |
-
if (false === ($temp_path = call_user_func($generator, $ID, $pg))) {
|
662 |
-
return false;
|
663 |
-
}
|
664 |
-
|
665 |
-
// get some useful stuff
|
666 |
-
$doc_path = get_attached_file($ID);
|
667 |
-
$doc_url = wp_get_attachment_url($ID);
|
668 |
-
$dirname = dirname($doc_path);
|
669 |
-
$basename = basename($doc_path);
|
670 |
-
if (false === ($len = strrpos($basename, '.'))) {
|
671 |
-
$len = strlen($basename);
|
672 |
-
}
|
673 |
-
$extless = substr($basename, 0, $len);
|
674 |
-
$ext = self::getExt($temp_path);
|
675 |
-
|
676 |
-
$thumb_name = self::getUniqueThumbName($dirname, $extless, $ext);
|
677 |
-
$thumb_path = $dirname . DIRECTORY_SEPARATOR . $thumb_name;
|
678 |
-
|
679 |
-
// scale generated image down
|
680 |
-
$img = wp_get_image_editor($temp_path);
|
681 |
-
|
682 |
-
if (is_wp_error($img)) {
|
683 |
-
DG_Logger::writeLog(
|
684 |
-
DG_LogLevel::Error,
|
685 |
-
__('Failed to get image editor: ', 'document-gallery') .
|
686 |
-
$img->get_error_message());
|
687 |
-
return false;
|
688 |
-
}
|
689 |
-
|
690 |
-
$options = self::getOptions();
|
691 |
-
$img->resize($options['width'], $options['height'], false);
|
692 |
-
$err = $img->save($thumb_path);
|
693 |
-
|
694 |
-
if (is_wp_error($err)) {
|
695 |
-
DG_Logger::writeLog(
|
696 |
-
DG_LogLevel::Error,
|
697 |
-
__('Failed to save image: ', 'document-gallery') .
|
698 |
-
$err->get_error_message());
|
699 |
-
return false;
|
700 |
-
}
|
701 |
-
|
702 |
-
// do some cleanup
|
703 |
-
@unlink($temp_path);
|
704 |
-
self::deleteThumbMeta($ID);
|
705 |
-
|
706 |
-
return array(
|
707 |
-
'path' => $thumb_path,
|
708 |
-
'url' => preg_replace('#'.preg_quote($basename).'$#', $thumb_name, $doc_url));
|
709 |
-
}
|
710 |
-
|
711 |
-
/**
|
712 |
-
* Caller should handle removal of the temp file when finished.
|
713 |
-
*
|
714 |
-
* @param str $ext
|
715 |
-
*/
|
716 |
-
private static function getTempFile($ext = 'png') {
|
717 |
-
static $base = null;
|
718 |
-
static $tmp;
|
719 |
-
|
720 |
-
if (is_null($base)) {
|
721 |
-
$base = md5(time());
|
722 |
-
$tmp = untrailingslashit(get_temp_dir());
|
723 |
-
}
|
724 |
-
|
725 |
-
return $tmp . DIRECTORY_SEPARATOR . wp_unique_filename($tmp, "$base.$ext");
|
726 |
-
}
|
727 |
-
|
728 |
-
/**
|
729 |
-
* Constructs name for file's thumbnail, ensuring that it does not conflict
|
730 |
-
* with any existing file.
|
731 |
-
*
|
732 |
-
* @param str $dirname Directory where the document is located.
|
733 |
-
* @param str $extless Base name, less the extension.
|
734 |
-
* @param str $ext The extension of the image to be created.
|
735 |
-
* @return str Name unique within the directory given, derived from the basename given.
|
736 |
-
*/
|
737 |
-
private static function getUniqueThumbName($dirname, $extless, $ext = 'png') {
|
738 |
-
return wp_unique_filename($dirname, str_replace('.', '-', $extless) . '-thumb.' . $ext);
|
739 |
-
}
|
740 |
-
|
741 |
-
/**
|
742 |
-
* Removes the existing thumbnail/document meta for the attachment(s)
|
743 |
-
* with the ID(s), if such a thumbnails exists.
|
744 |
-
*
|
745 |
-
* @param int|array $ids
|
746 |
-
*/
|
747 |
-
public static function deleteThumbMeta($ids) {
|
748 |
-
$options = self::getOptions();
|
749 |
-
$modified = false;
|
750 |
-
|
751 |
-
foreach ((array)$ids as $id) {
|
752 |
-
if (isset($options['thumbs'][$id])) {
|
753 |
-
if (isset($options['thumbs'][$id]['thumber'])) {
|
754 |
-
@unlink($options['thumbs'][$id]['thumb_path']);
|
755 |
-
}
|
756 |
-
|
757 |
-
unset($options['thumbs'][$id]);
|
758 |
-
$modified = true;
|
759 |
-
}
|
760 |
-
}
|
761 |
-
|
762 |
-
if ($modified) { self::setOptions($options); }
|
763 |
-
}
|
764 |
-
|
765 |
-
/**
|
766 |
-
* Checks whether exec() may be used.
|
767 |
-
* Source: http://stackoverflow.com/a/12980534/866618
|
768 |
-
*
|
769 |
-
* @return bool Whether exec() is available.
|
770 |
-
*/
|
771 |
-
public static function isExecAvailable() {
|
772 |
-
static $available = null;
|
773 |
-
|
774 |
-
if (is_null($available)) {
|
775 |
-
$available = true;
|
776 |
-
|
777 |
-
if (ini_get('safe_mode')) {
|
778 |
-
$available = false;
|
779 |
-
} else {
|
780 |
-
$d = ini_get('disable_functions');
|
781 |
-
$s = ini_get('suhosin.executor.func.blacklist');
|
782 |
-
if ("$d$s") {
|
783 |
-
$array = preg_split('/,\s*/', "$d,$s");
|
784 |
-
$available = !in_array('exec', $array);
|
785 |
-
}
|
786 |
-
}
|
787 |
-
}
|
788 |
-
|
789 |
-
return $available;
|
790 |
-
}
|
791 |
-
|
792 |
-
/**
|
793 |
-
* Formerly achieved with wp_check_filetype(), but it was only returning
|
794 |
-
* valid results if the active user had permission to upload the given filetype.
|
795 |
-
*
|
796 |
-
* @param str $filename Name of the file to get extension from.
|
797 |
-
* @return str|bool Returns the file extension on success, false on failure.
|
798 |
-
*/
|
799 |
-
private static function getExt($filename) {
|
800 |
-
foreach (array_keys(wp_get_mime_types()) as $ext_preg) {
|
801 |
-
$ext_preg = '!\.(' . $ext_preg . ')$!i';
|
802 |
-
if (preg_match($ext_preg, $filename, $ext_matches)) {
|
803 |
-
return $ext_matches[1];
|
804 |
-
}
|
805 |
-
}
|
806 |
-
|
807 |
-
return false;
|
808 |
-
}
|
809 |
-
|
810 |
-
/**
|
811 |
-
* Blocks instantiation. All functions are static.
|
812 |
-
*/
|
813 |
-
private function __construct() {
|
814 |
-
|
815 |
-
}
|
816 |
-
}
|
817 |
-
|
818 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/document-gallery-es_ES.mo
DELETED
Binary file
|
languages/document-gallery-es_ES.po
DELETED
@@ -1,264 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Document Gallery
|
2 |
-
# This file is distributed under the same license as the Document Gallery package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Document Gallery 2.0.2\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/document-gallery\n"
|
7 |
-
"POT-Creation-Date: 2014-03-22 07:07:30+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2014-09-12 19:47-0600\n"
|
12 |
-
"Last-Translator: Dan Rossiter <dan.rossiters@gmail.com>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"X-Generator: Poedit 1.6.9\n"
|
15 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
-
"Language: es\n"
|
17 |
-
|
18 |
-
#: admin/class-admin.php:27
|
19 |
-
msgid "Settings"
|
20 |
-
msgstr "Configuración"
|
21 |
-
|
22 |
-
#: admin/class-admin.php:37
|
23 |
-
msgid "Document Gallery Settings"
|
24 |
-
msgstr "Configuración de Document Gallery"
|
25 |
-
|
26 |
-
#. Plugin Name of the plugin/theme
|
27 |
-
#: admin/class-admin.php:38
|
28 |
-
msgid "Document Gallery"
|
29 |
-
msgstr "Document Gallery"
|
30 |
-
|
31 |
-
#: admin/class-admin.php:67
|
32 |
-
msgid "Default Settings"
|
33 |
-
msgstr "Configuración por Defecto"
|
34 |
-
|
35 |
-
#: admin/class-admin.php:71
|
36 |
-
msgid "Thumbnail Generation"
|
37 |
-
msgstr "Generación de Miniaturas"
|
38 |
-
|
39 |
-
#: admin/class-admin.php:75
|
40 |
-
msgid "Custom CSS"
|
41 |
-
msgstr "CSS Personalizado"
|
42 |
-
|
43 |
-
#: admin/class-admin.php:79
|
44 |
-
msgid "Advanced Thumbnail Generation"
|
45 |
-
msgstr "Generación Avanzada de Miniatura "
|
46 |
-
|
47 |
-
#: admin/class-admin.php:91
|
48 |
-
msgid "Link to attachment page rather than to file"
|
49 |
-
msgstr "Enlace a la página del adjunto en lugar de al archivo"
|
50 |
-
|
51 |
-
#: admin/class-admin.php:103
|
52 |
-
msgid "Include document descriptions"
|
53 |
-
msgstr "Incluir descripciones de documentos"
|
54 |
-
|
55 |
-
#: admin/class-admin.php:115
|
56 |
-
msgid "Use auto-generated document thumbnails"
|
57 |
-
msgstr "Usar miniaturas de documento generadas automáticamente"
|
58 |
-
|
59 |
-
#: admin/class-admin.php:127
|
60 |
-
msgid "Include image attachments in gallery"
|
61 |
-
msgstr "Incluir adjuntos de imágenes en la galería"
|
62 |
-
|
63 |
-
#: admin/class-admin.php:139
|
64 |
-
msgid "Only look for attachments in post where [dg] is used"
|
65 |
-
msgstr "Buscar sólo los archivos adjuntos en correos donde se utiliza [dg]"
|
66 |
-
|
67 |
-
#: admin/class-admin.php:152
|
68 |
-
msgid "Ascending or descending sorting of documents"
|
69 |
-
msgstr "Clasificación de documentos ascendente o descendente"
|
70 |
-
|
71 |
-
#: admin/class-admin.php:165
|
72 |
-
msgid "Which field to order documents by"
|
73 |
-
msgstr "Qué campo para ordenar los documentos por"
|
74 |
-
|
75 |
-
#: admin/class-admin.php:178
|
76 |
-
msgid ""
|
77 |
-
"Whether matched documents must have all taxa_names (AND) or at least one (OR)"
|
78 |
-
msgstr ""
|
79 |
-
"Si los documentos coincidentes deben tener todos taxa_names (AND) o por lo "
|
80 |
-
"menos uno (OR)"
|
81 |
-
|
82 |
-
#: admin/class-admin.php:190
|
83 |
-
msgid "Locally generate thumbnails for audio & video files."
|
84 |
-
msgstr "Generar localmente las miniaturas para los archivos de audio y vídeo."
|
85 |
-
|
86 |
-
#: admin/class-admin.php:203
|
87 |
-
msgid ""
|
88 |
-
"Use <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
89 |
-
"a> for faster local PDF processing (compared to Imagick)."
|
90 |
-
msgstr ""
|
91 |
-
"Usar <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
92 |
-
"a> para acelerar el procesamiento local de PDF (en comparación con Imagick)."
|
93 |
-
|
94 |
-
#: admin/class-admin.php:204
|
95 |
-
msgid ""
|
96 |
-
"Your server is not configured to run <a href=\"http://www.ghostscript.com/\" "
|
97 |
-
"target=\"_blank\">Ghostscript</a>."
|
98 |
-
msgstr ""
|
99 |
-
"Su servidor no está configurado para ejecutar <a href=\"http://www."
|
100 |
-
"ghostscript.com/\" target=\"_blank\">Ghostscript</a>."
|
101 |
-
|
102 |
-
#: admin/class-admin.php:218
|
103 |
-
msgid ""
|
104 |
-
"Use <a href=\"http://www.php.net/manual/en/book.imagick.php\" target=\"_blank"
|
105 |
-
"\">Imagick</a> to handle lots of filetypes locally."
|
106 |
-
msgstr ""
|
107 |
-
"Usar <a href=\"http://www.php.net/manual/es/book.imagick.php\" target="
|
108 |
-
"\"_blank\">Imagick</a> para manejar una gran cantidad de tipos de archivos "
|
109 |
-
"localmente."
|
110 |
-
|
111 |
-
#: admin/class-admin.php:219
|
112 |
-
msgid ""
|
113 |
-
"Your server is not configured to run <a href=\"http://www.php.net/manual/en/"
|
114 |
-
"book.imagick.php\" target=\"_blank\">Imagick</a>."
|
115 |
-
msgstr ""
|
116 |
-
"Su servidor no está configurado para ejecutar <a href=\"http://www.php.net/"
|
117 |
-
"manual/es/book.imagick.php\" target=\"_blank\">Imagick</a>."
|
118 |
-
|
119 |
-
#: admin/class-admin.php:233
|
120 |
-
msgid ""
|
121 |
-
"Use <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
122 |
-
"Drive Viewer</a> to generate thumbnails for MS Office files and many other "
|
123 |
-
"file types remotely."
|
124 |
-
msgstr ""
|
125 |
-
"Usar <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
126 |
-
"Drive Viewer</a> para generar imágenes en miniatura para archivos de MS "
|
127 |
-
"Office y muchos otros tipos de archivos de forma remota."
|
128 |
-
|
129 |
-
#: admin/class-admin.php:234
|
130 |
-
msgid "Your server does not allow remote HTTP access."
|
131 |
-
msgstr "Su servidor no permite el acceso HTTP remoto."
|
132 |
-
|
133 |
-
#: admin/class-admin.php:248
|
134 |
-
msgid "Successfully auto-detected the location of Ghostscript."
|
135 |
-
msgstr "La ubicación de Ghostscript fue auto-detectada con éxito."
|
136 |
-
|
137 |
-
#: admin/class-admin.php:249
|
138 |
-
msgid "Failed to auto-detect the location of Ghostscript."
|
139 |
-
msgstr "Fallo al auto-detectar la localización de Ghostscript."
|
140 |
-
|
141 |
-
#: admin/class-admin.php:257
|
142 |
-
msgid ""
|
143 |
-
"The following values will be used by default in the shortcode. You can still "
|
144 |
-
"manually set each of these values in each individual shortcode."
|
145 |
-
msgstr ""
|
146 |
-
"Los siguientes valores se utilizarán por defecto en el código corto. Todavía "
|
147 |
-
"se puede configurar manualmente cada uno de estos valores en cada código "
|
148 |
-
"corto individualmente."
|
149 |
-
|
150 |
-
#: admin/class-admin.php:264
|
151 |
-
msgid "Select which tools to use when generating thumbnails."
|
152 |
-
msgstr ""
|
153 |
-
"Seleccione las herramientas que se utilizan en la generación de imágenes en "
|
154 |
-
"miniatura."
|
155 |
-
|
156 |
-
#: admin/class-admin.php:270
|
157 |
-
msgid ""
|
158 |
-
"Enter custom CSS styling for use with document galleries. To see which ids "
|
159 |
-
"and classes you can style, take a look at <a href=\"%s\" target=\"_blank"
|
160 |
-
"\">style.css</a>."
|
161 |
-
msgstr ""
|
162 |
-
"Introduzca un estilo CSS personalizado para su uso con galerías de "
|
163 |
-
"documentos. Para ver los identificadores de clases de estilo, vea <a href="
|
164 |
-
"\"%s\" target=\"_blank\">style.css</a>."
|
165 |
-
|
166 |
-
#: admin/class-admin.php:288
|
167 |
-
msgid ""
|
168 |
-
"Unless you <em>really</em> know what you're doing, you should not touch "
|
169 |
-
"these values."
|
170 |
-
msgstr ""
|
171 |
-
"A menos que usted <em>realmente</em> sepa lo que está haciendo, no debe "
|
172 |
-
"tocar estos valores."
|
173 |
-
|
174 |
-
#: admin/class-admin.php:290
|
175 |
-
msgid ""
|
176 |
-
"NOTE: <code>exec()</code> is not accessible. Ghostscript will not function."
|
177 |
-
msgstr ""
|
178 |
-
"NOTA: <code>exec()</code> no está accesible. Ghostscript no funcionará."
|
179 |
-
|
180 |
-
#: admin/class-admin.php:387
|
181 |
-
msgid "Failed to update CSS file."
|
182 |
-
msgstr "Falló actualizar el archivo CSS."
|
183 |
-
|
184 |
-
#: admin/class-admin.php:398
|
185 |
-
msgid "Invalid Ghostscript path given: "
|
186 |
-
msgstr "Camino dado de Ghostscript inválido:"
|
187 |
-
|
188 |
-
#: inc/class-gallery.php:88
|
189 |
-
msgid "Generated using Document Gallery. Get yours here: "
|
190 |
-
msgstr "Generado usando Document Gallery. Obtenga el suyo aquí:"
|
191 |
-
|
192 |
-
#: inc/class-gallery.php:91
|
193 |
-
msgid "No attachments to display. How boring! :("
|
194 |
-
msgstr "No hay adjuntos a mostrar. ¡Qué aburrido! :("
|
195 |
-
|
196 |
-
#: inc/class-gallery.php:92
|
197 |
-
msgid "The %s parameter may only be \"%s\" or \"%s.\" You entered \"%s.\""
|
198 |
-
msgstr "El parámetro %s puede ser solo \"%s\" o \"%s.\" Usted entró \"%s.\""
|
199 |
-
|
200 |
-
#: inc/class-gallery.php:263
|
201 |
-
msgid "The following ID is invalid: "
|
202 |
-
msgid_plural "The following IDs are invalid: "
|
203 |
-
msgstr[0] "El ID siguiente no es válido:"
|
204 |
-
msgstr[1] "Los IDs siguientes son válidos:"
|
205 |
-
|
206 |
-
#: inc/class-gallery.php:329
|
207 |
-
msgid "The orderby value entered, \"%s,\" is not valid."
|
208 |
-
msgstr "El valor orderby entrado, \"%s,\" no es válido."
|
209 |
-
|
210 |
-
#: inc/class-gallery.php:438
|
211 |
-
msgid "The following attributes are invalid: "
|
212 |
-
msgstr "Los siguientes atributos son inválidos:"
|
213 |
-
|
214 |
-
#: inc/class-gallery.php:488
|
215 |
-
msgid "%s is not a valid term name in %s."
|
216 |
-
msgstr "%s no es un nombre de término válido en %s."
|
217 |
-
|
218 |
-
#: inc/class-thumber.php:131
|
219 |
-
msgid "Could not open file: "
|
220 |
-
msgstr "No se pudo abrir el archivo:"
|
221 |
-
|
222 |
-
#: inc/class-thumber.php:136
|
223 |
-
msgid "Could not write file: "
|
224 |
-
msgstr "No se pudo escribir el archivo:"
|
225 |
-
|
226 |
-
#: inc/class-thumber.php:174
|
227 |
-
msgid "Failed to open file in Imagick: "
|
228 |
-
msgstr "Falló abrir imagen en Imagick:"
|
229 |
-
|
230 |
-
#: inc/class-thumber.php:184
|
231 |
-
msgid "Failed to save image in Imagick: "
|
232 |
-
msgstr "Falló salvar imagen en Imagick:"
|
233 |
-
|
234 |
-
#: inc/class-thumber.php:244
|
235 |
-
msgid "Ghostscript failed: "
|
236 |
-
msgstr "Falló Ghostscript:"
|
237 |
-
|
238 |
-
#: inc/class-thumber.php:357
|
239 |
-
msgid "Failed to retrieve thumbnail from Google: "
|
240 |
-
msgstr "Falló obtener miniatura desde Google:"
|
241 |
-
|
242 |
-
#: inc/class-thumber.php:644
|
243 |
-
msgid "Failed to get image editor: "
|
244 |
-
msgstr "Falló obtener el editor de imagen:"
|
245 |
-
|
246 |
-
#: inc/class-thumber.php:655
|
247 |
-
msgid "Failed to save image: "
|
248 |
-
msgstr "Falló salvar la imagen:"
|
249 |
-
|
250 |
-
#. Description of the plugin/theme
|
251 |
-
msgid ""
|
252 |
-
"Display non-images (and images) in gallery format on a page or post with the "
|
253 |
-
"[dg] shortcode."
|
254 |
-
msgstr ""
|
255 |
-
"Mostrar los archivos que no son imágenes (e imágenes) en formato de galería "
|
256 |
-
"en una página o post con el código corto [dg]."
|
257 |
-
|
258 |
-
#. Author of the plugin/theme
|
259 |
-
msgid "Dan Rossiter"
|
260 |
-
msgstr "Dan Rossiter"
|
261 |
-
|
262 |
-
#. Author URI of the plugin/theme
|
263 |
-
msgid "http://danrossiter.org/"
|
264 |
-
msgstr "http://danrossiter.org/"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/document-gallery-fr_FR.mo
DELETED
Binary file
|
languages/document-gallery-fr_FR.po
DELETED
@@ -1,461 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Document Gallery
|
2 |
-
# This file is distributed under the same license as the Document Gallery package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Document Gallery 2.2\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/document-gallery\n"
|
7 |
-
"POT-Creation-Date: 2014-09-23 02:11:20+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2014-10-16 23:23-0600\n"
|
12 |
-
"Last-Translator: Marc LIOTARD <tech@trafic-influence.com>\n"
|
13 |
-
"Language-Team: Trafic d'influence <tech@trafic-influence.com>\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n"
|
15 |
-
"Language: fr_FR\n"
|
16 |
-
"X-Generator: Poedit 1.6.9\n"
|
17 |
-
|
18 |
-
#: admin/class-admin.php:28
|
19 |
-
msgid "General"
|
20 |
-
msgstr "Général"
|
21 |
-
|
22 |
-
#: admin/class-admin.php:29
|
23 |
-
msgid "Thumbnail Management"
|
24 |
-
msgstr "Gestion des miniatures"
|
25 |
-
|
26 |
-
#: admin/class-admin.php:30 admin/class-admin.php:904
|
27 |
-
msgid "Logging"
|
28 |
-
msgstr "Journalisation"
|
29 |
-
|
30 |
-
#: admin/class-admin.php:31
|
31 |
-
msgid "Advanced"
|
32 |
-
msgstr "Avancé"
|
33 |
-
|
34 |
-
#: admin/class-admin.php:68
|
35 |
-
msgid "Settings"
|
36 |
-
msgstr "Paramètres"
|
37 |
-
|
38 |
-
#: admin/class-admin.php:78
|
39 |
-
msgid "Document Gallery Settings"
|
40 |
-
msgstr "Paramétrage de Document Gallery"
|
41 |
-
|
42 |
-
#. Plugin Name of the plugin/theme
|
43 |
-
#: admin/class-admin.php:79
|
44 |
-
msgid "Document Gallery"
|
45 |
-
msgstr "Document Gallery"
|
46 |
-
|
47 |
-
#: admin/class-admin.php:124
|
48 |
-
msgid "Default Settings"
|
49 |
-
msgstr "Paramètres par défaut"
|
50 |
-
|
51 |
-
#: admin/class-admin.php:128
|
52 |
-
msgid "Thumbnail Generation"
|
53 |
-
msgstr "Génération des miniatures"
|
54 |
-
|
55 |
-
#: admin/class-admin.php:132
|
56 |
-
msgid "Custom CSS"
|
57 |
-
msgstr "CSS personnalisé"
|
58 |
-
|
59 |
-
#: admin/class-admin.php:144
|
60 |
-
msgid "Link to attachment page rather than to file"
|
61 |
-
msgstr "Lier vers la page média plutôt que vers le fichier"
|
62 |
-
|
63 |
-
#: admin/class-admin.php:156
|
64 |
-
msgid "Include document descriptions"
|
65 |
-
msgstr "Inclure la description des médias"
|
66 |
-
|
67 |
-
#: admin/class-admin.php:168
|
68 |
-
msgid "Use auto-generated document thumbnails"
|
69 |
-
msgstr "Utiliser des miniatures générées automatiquement"
|
70 |
-
|
71 |
-
#: admin/class-admin.php:180
|
72 |
-
msgid "Include image attachments in gallery"
|
73 |
-
msgstr "Inclure les images dans la galerie"
|
74 |
-
|
75 |
-
#: admin/class-admin.php:192
|
76 |
-
msgid "Only look for attachments in post where [dg] is used"
|
77 |
-
msgstr ""
|
78 |
-
"Afficher uniquement les médias liés à l'article où le shortcode [dg] est "
|
79 |
-
"utilisé"
|
80 |
-
|
81 |
-
#: admin/class-admin.php:205
|
82 |
-
msgid "Ascending or descending sorting of documents"
|
83 |
-
msgstr "Tri ascendant ou descendant des médias"
|
84 |
-
|
85 |
-
#: admin/class-admin.php:218
|
86 |
-
msgid "Which field to order documents by"
|
87 |
-
msgstr "Champ utilisé pour classer les médias"
|
88 |
-
|
89 |
-
#: admin/class-admin.php:231
|
90 |
-
msgid ""
|
91 |
-
"Whether matched documents must have all taxa_names (AND) or at least one (OR)"
|
92 |
-
msgstr ""
|
93 |
-
"Permet de définir si les documents qui coïncident doivent avoir toutes les "
|
94 |
-
"taxa_names (AND) ou au moins une (OR)"
|
95 |
-
|
96 |
-
#: admin/class-admin.php:243
|
97 |
-
msgid "Locally generate thumbnails for audio & video files."
|
98 |
-
msgstr ""
|
99 |
-
"Générer localement les miniatures pour les médias de type audio et vidéo."
|
100 |
-
|
101 |
-
#: admin/class-admin.php:256
|
102 |
-
msgid ""
|
103 |
-
"Use <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
104 |
-
"a> for faster local PDF processing (compared to Imagick)."
|
105 |
-
msgstr ""
|
106 |
-
"Utiliser <a href=\"http://www.ghostscript.com/\" target=\"_blank"
|
107 |
-
"\">Ghostscript</a> pour accélérer le traitement des PDF localement (en "
|
108 |
-
"comparaison avec Imagick)."
|
109 |
-
|
110 |
-
#: admin/class-admin.php:257
|
111 |
-
msgid ""
|
112 |
-
"Your server is not configured to run <a href=\"http://www.ghostscript.com/\" "
|
113 |
-
"target=\"_blank\">Ghostscript</a>."
|
114 |
-
msgstr ""
|
115 |
-
"Votre serveur n'est pas configuré pour exécuter <a href=\"http://www."
|
116 |
-
"ghostscript.com/\" target=\"_blank\">Ghostscript</a>."
|
117 |
-
|
118 |
-
#: admin/class-admin.php:271
|
119 |
-
msgid ""
|
120 |
-
"Use <a href=\"http://www.php.net/manual/en/book.imagick.php\" target=\"_blank"
|
121 |
-
"\">Imagick</a> to handle lots of filetypes locally."
|
122 |
-
msgstr ""
|
123 |
-
"Utiliser <a href=\"http://www.php.net/manual/es/book.imagick.php\" target="
|
124 |
-
"\"_blank\">Imagick</a> pour traiter la majeure partie des types de fichier "
|
125 |
-
"localement."
|
126 |
-
|
127 |
-
#: admin/class-admin.php:272
|
128 |
-
msgid ""
|
129 |
-
"Your server is not configured to run <a href=\"http://www.php.net/manual/en/"
|
130 |
-
"book.imagick.php\" target=\"_blank\">Imagick</a>."
|
131 |
-
msgstr ""
|
132 |
-
"Votre serveur n'est pas configuré pour exécuter <a href=\"http://www.php.net/"
|
133 |
-
"manual/es/book.imagick.php\" target=\"_blank\">Imagick</a>."
|
134 |
-
|
135 |
-
#: admin/class-admin.php:286
|
136 |
-
msgid ""
|
137 |
-
"Use <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
138 |
-
"Drive Viewer</a> to generate thumbnails for MS Office files and many other "
|
139 |
-
"file types remotely."
|
140 |
-
msgstr ""
|
141 |
-
"Utiliser <a href=\"https://drive.google.com/viewer\" target=\"_blank"
|
142 |
-
"\">Google Drive Viewer</a> pour générer les miniatures des fichiers MS "
|
143 |
-
"Office et autres types de fichiers."
|
144 |
-
|
145 |
-
#: admin/class-admin.php:287
|
146 |
-
msgid "Your server does not allow remote HTTP access."
|
147 |
-
msgstr ""
|
148 |
-
"Votre serveur n'est pas configuré pour gérer les accès HTTP à distance."
|
149 |
-
|
150 |
-
#: admin/class-admin.php:309
|
151 |
-
msgid "The max width and height (in pixels) that thumbnails will be generated."
|
152 |
-
msgstr ""
|
153 |
-
"La hauteur et largeur maximale (en pixels) dans laquelle les miniatures "
|
154 |
-
"seront générées."
|
155 |
-
|
156 |
-
#: admin/class-admin.php:338
|
157 |
-
msgid "Advanced Thumbnail Generation"
|
158 |
-
msgstr "Génération de miniatures avancée"
|
159 |
-
|
160 |
-
#: admin/class-admin.php:350
|
161 |
-
msgid "Whether to log debug and error information related to Document Gallery."
|
162 |
-
msgstr ""
|
163 |
-
"Pour activer les logs de debug et informations d'erreurs relatives à "
|
164 |
-
"Document Gallery."
|
165 |
-
|
166 |
-
#: admin/class-admin.php:362
|
167 |
-
msgid ""
|
168 |
-
"Whether option structure should be validated before save. This is not "
|
169 |
-
"generally necessary."
|
170 |
-
msgstr ""
|
171 |
-
"Dans le cas où les options doivent être validées avant enregistrement. Ce "
|
172 |
-
"n'est pas nécessaire généralement."
|
173 |
-
|
174 |
-
#: admin/class-admin.php:375
|
175 |
-
msgid ""
|
176 |
-
"Max number of seconds to wait for thumbnail generation before defaulting to "
|
177 |
-
"filetype icons."
|
178 |
-
msgstr ""
|
179 |
-
"Temps maximum d'attente en secondes avant l'abandon de la génération de la "
|
180 |
-
"miniature au profit des icônes par défaut."
|
181 |
-
|
182 |
-
#: admin/class-admin.php:376
|
183 |
-
msgid ""
|
184 |
-
"Note that generation will continue where timeout happened next time the "
|
185 |
-
"gallery is loaded."
|
186 |
-
msgstr ""
|
187 |
-
"Notez que la génération se poursuivra la prochaine fois que la galerie sera "
|
188 |
-
"chargée."
|
189 |
-
|
190 |
-
#: admin/class-admin.php:388
|
191 |
-
msgid "Successfully auto-detected the location of Ghostscript."
|
192 |
-
msgstr "GhostScript localisé automatiquement avec succès."
|
193 |
-
|
194 |
-
#: admin/class-admin.php:389
|
195 |
-
msgid "Failed to auto-detect the location of Ghostscript."
|
196 |
-
msgstr "Impossible de localiser Ghostscript."
|
197 |
-
|
198 |
-
#: admin/class-admin.php:393
|
199 |
-
msgid "Options Array Dump"
|
200 |
-
msgstr "Export des options"
|
201 |
-
|
202 |
-
#: admin/class-admin.php:440
|
203 |
-
msgid "Invalid width given: "
|
204 |
-
msgstr "Largeur invalide :"
|
205 |
-
|
206 |
-
#: admin/class-admin.php:453
|
207 |
-
msgid "Invalid height given: "
|
208 |
-
msgstr "Hauteur invalide :"
|
209 |
-
|
210 |
-
#: admin/class-admin.php:566
|
211 |
-
msgid "Invalid Ghostscript path given: "
|
212 |
-
msgstr "Chemin de Ghostscript invalide :"
|
213 |
-
|
214 |
-
#: admin/class-admin.php:577
|
215 |
-
msgid "Invalid timeout given: "
|
216 |
-
msgstr "Délai invalide :"
|
217 |
-
|
218 |
-
#: admin/class-admin.php:608
|
219 |
-
msgid ""
|
220 |
-
"The following values will be used by default in the shortcode. You can still "
|
221 |
-
"manually set each of these values in each individual shortcode."
|
222 |
-
msgstr ""
|
223 |
-
"Les valeurs suivantes seront utilisées par défaut dans le shortcode [dg]. "
|
224 |
-
"Vous pouvez néanmoins paramétrer manuellement ces valeurs pour chaque "
|
225 |
-
"shortcode individuel."
|
226 |
-
|
227 |
-
#: admin/class-admin.php:615
|
228 |
-
msgid "Select which tools to use when generating thumbnails."
|
229 |
-
msgstr "Choisir les outils utilisés pour la génération des miniatures."
|
230 |
-
|
231 |
-
#: admin/class-admin.php:624
|
232 |
-
msgid ""
|
233 |
-
"Enter custom CSS styling for use with document galleries. To see which ids "
|
234 |
-
"and classes you can style, take a look at <a href=\"%s\" target=\"_blank"
|
235 |
-
"\">style.css</a>."
|
236 |
-
msgstr ""
|
237 |
-
"Saisissez vos classes CSS personnalisées pour votre usage de Document "
|
238 |
-
"Gallery. Pour voir le détail des classes et id à restyler, jetez un oeil au "
|
239 |
-
"fichier <a href=\"%s\" target=\"_blank\">style.css</a>."
|
240 |
-
|
241 |
-
#: admin/class-admin.php:644
|
242 |
-
msgid ""
|
243 |
-
"Unless you <em>really</em> know what you're doing, you should not touch "
|
244 |
-
"these values."
|
245 |
-
msgstr ""
|
246 |
-
"A moins de <em>vraiment</em> savoir ce que vous faites, vous ne devriez pas "
|
247 |
-
"modifier ces valeurs."
|
248 |
-
|
249 |
-
#: admin/class-admin.php:647
|
250 |
-
msgid ""
|
251 |
-
"NOTE: <code>exec()</code> is not accessible. Ghostscript will not function."
|
252 |
-
msgstr ""
|
253 |
-
"NOTE : <code>exec()</code> n'est pas accessible. Ghostscript ne fonctionnera "
|
254 |
-
"pas."
|
255 |
-
|
256 |
-
#: admin/class-admin.php:658
|
257 |
-
msgid ""
|
258 |
-
"The following <em>readonly text</em> should be provided when <a href="
|
259 |
-
"\"http://wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
260 |
-
"\">reporting a bug</a>:"
|
261 |
-
msgstr ""
|
262 |
-
"Le <em>readonly text</em> suivant devra être fourni lors d'un <a href="
|
263 |
-
"\"http://wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
264 |
-
"\">rapport de bug</a> :"
|
265 |
-
|
266 |
-
#: admin/class-admin.php:759
|
267 |
-
msgid "Select All"
|
268 |
-
msgstr "Tout sélectionner"
|
269 |
-
|
270 |
-
#: admin/class-admin.php:762
|
271 |
-
msgid "Thumbnail"
|
272 |
-
msgstr "Miniature"
|
273 |
-
|
274 |
-
#: admin/class-admin.php:763
|
275 |
-
msgid "File name"
|
276 |
-
msgstr "Nom de fichier"
|
277 |
-
|
278 |
-
#: admin/class-admin.php:764 admin/class-admin.php:839
|
279 |
-
msgid "Date"
|
280 |
-
msgstr "Date"
|
281 |
-
|
282 |
-
#: admin/class-admin.php:767
|
283 |
-
msgid "Delete Selected"
|
284 |
-
msgstr "Effacer les sélectionnés"
|
285 |
-
|
286 |
-
#: admin/class-admin.php:769
|
287 |
-
msgid "item"
|
288 |
-
msgid_plural "items"
|
289 |
-
msgstr[0] "élément"
|
290 |
-
msgstr[1] "éléments"
|
291 |
-
|
292 |
-
#: admin/class-admin.php:772
|
293 |
-
msgid "Go to the first page"
|
294 |
-
msgstr "Première page"
|
295 |
-
|
296 |
-
#: admin/class-admin.php:773
|
297 |
-
msgid "Go to the previous page"
|
298 |
-
msgstr "Page précédente"
|
299 |
-
|
300 |
-
#: admin/class-admin.php:775
|
301 |
-
msgid "Current page"
|
302 |
-
msgstr "Page actuelle"
|
303 |
-
|
304 |
-
#: admin/class-admin.php:775
|
305 |
-
msgid "of"
|
306 |
-
msgstr "sur"
|
307 |
-
|
308 |
-
#: admin/class-admin.php:776
|
309 |
-
msgid "Go to the next page"
|
310 |
-
msgstr "Page suivante"
|
311 |
-
|
312 |
-
#: admin/class-admin.php:777
|
313 |
-
msgid "Go to the last page"
|
314 |
-
msgstr "Dernière page"
|
315 |
-
|
316 |
-
#: admin/class-admin.php:779
|
317 |
-
msgid "items per page"
|
318 |
-
msgstr "éléments pas page"
|
319 |
-
|
320 |
-
#: admin/class-admin.php:818
|
321 |
-
msgid "View"
|
322 |
-
msgstr "Voir"
|
323 |
-
|
324 |
-
#: admin/class-admin.php:819
|
325 |
-
msgid "attachment page"
|
326 |
-
msgstr "page des médias"
|
327 |
-
|
328 |
-
#: admin/class-admin.php:819
|
329 |
-
msgid "Attachment not found"
|
330 |
-
msgstr "Média introuvable"
|
331 |
-
|
332 |
-
#: admin/class-admin.php:840
|
333 |
-
msgid "Level"
|
334 |
-
msgstr "Niveau"
|
335 |
-
|
336 |
-
#: admin/class-admin.php:841
|
337 |
-
msgid "Message"
|
338 |
-
msgstr "Message"
|
339 |
-
|
340 |
-
#: admin/class-admin.php:850
|
341 |
-
msgid "Expand All"
|
342 |
-
msgstr "Tout déplier"
|
343 |
-
|
344 |
-
#: admin/class-admin.php:853
|
345 |
-
msgid "Collapse All"
|
346 |
-
msgstr "Tout replier"
|
347 |
-
|
348 |
-
#: admin/class-admin.php:897
|
349 |
-
msgid "Clear Log"
|
350 |
-
msgstr "Effacer les logs"
|
351 |
-
|
352 |
-
#: admin/class-admin.php:904
|
353 |
-
msgid "There are no log entries at this time."
|
354 |
-
msgstr "Il n'y aucune entrée de log pour l'instant."
|
355 |
-
|
356 |
-
#: admin/class-admin.php:904
|
357 |
-
msgid "For Your information:"
|
358 |
-
msgstr "Information :"
|
359 |
-
|
360 |
-
#: admin/class-admin.php:904
|
361 |
-
msgid "is turned ON"
|
362 |
-
msgstr "est activé"
|
363 |
-
|
364 |
-
#: admin/class-admin.php:904
|
365 |
-
msgid "is turned OFF"
|
366 |
-
msgstr "n'est PAS activé"
|
367 |
-
|
368 |
-
#: inc/class-gallery.php:85
|
369 |
-
msgid "Generated using Document Gallery. Get yours here: "
|
370 |
-
msgstr "Génération réalisée avec Document Gallery. Obtenez votre version ici :"
|
371 |
-
|
372 |
-
#: inc/class-gallery.php:88
|
373 |
-
msgid "No attachments to display. How boring! :("
|
374 |
-
msgstr "Aucun média à afficher... Quel ennui ! :("
|
375 |
-
|
376 |
-
#: inc/class-gallery.php:89
|
377 |
-
msgid "The %s parameter may only be \"%s\" or \"%s.\" You entered \"%s.\""
|
378 |
-
msgstr ""
|
379 |
-
"Le paramètre %s ne peut être que \"%s\" ou \"%s.\" Vous avez saisi \"%s.\""
|
380 |
-
|
381 |
-
#: inc/class-gallery.php:285
|
382 |
-
msgid "The following ID is invalid: "
|
383 |
-
msgid_plural "The following IDs are invalid: "
|
384 |
-
msgstr[0] "L'ID suivant est invalide :"
|
385 |
-
msgstr[1] "Les ID suivants sont invalides :"
|
386 |
-
|
387 |
-
#: inc/class-gallery.php:378
|
388 |
-
msgid "The orderby value entered, \"%s,\" is not valid."
|
389 |
-
msgstr "La valeur orderby saisie, \"%s,\" est invalide."
|
390 |
-
|
391 |
-
#: inc/class-gallery.php:532
|
392 |
-
msgid "%s is not a valid term name in %s."
|
393 |
-
msgstr "%s n'est pas un terme valide dans %s."
|
394 |
-
|
395 |
-
#: inc/class-image-editor-imagick.php:37
|
396 |
-
msgid "Failed to set Imagick page number"
|
397 |
-
msgstr "Impossible de définir le numéro de page Imagick"
|
398 |
-
|
399 |
-
#: inc/class-thumber.php:59
|
400 |
-
msgid "Attempting to generate thumbnail for attachment #%d with (%s)"
|
401 |
-
msgstr "Tentative de génération de la miniature pour le média #%d avec '%s'"
|
402 |
-
|
403 |
-
#: inc/class-thumber.php:138
|
404 |
-
msgid "Could not open file: "
|
405 |
-
msgstr "Impossible d'ouvrir le fichier :"
|
406 |
-
|
407 |
-
#: inc/class-thumber.php:143
|
408 |
-
msgid "Could not write file: "
|
409 |
-
msgstr "Impossible d'écrire le fichier :"
|
410 |
-
|
411 |
-
#: inc/class-thumber.php:180
|
412 |
-
msgid "Failed to open file in Imagick: "
|
413 |
-
msgstr "Impossible d'ouvrir le fichier dans Imagick :"
|
414 |
-
|
415 |
-
#: inc/class-thumber.php:191
|
416 |
-
msgid "Failed to save image in Imagick: "
|
417 |
-
msgstr "Impossible d'enregistrer l'image dans Imagick :"
|
418 |
-
|
419 |
-
#: inc/class-thumber.php:249
|
420 |
-
msgid "Ghostscript failed: "
|
421 |
-
msgstr "Échec Ghostscript :"
|
422 |
-
|
423 |
-
#: inc/class-thumber.php:387
|
424 |
-
msgid "Failed to retrieve thumbnail from Google: "
|
425 |
-
msgstr "Impossible d'obtenir la miniature depuis Google :"
|
426 |
-
|
427 |
-
#: inc/class-thumber.php:631
|
428 |
-
msgid "Thumbnail Generators: "
|
429 |
-
msgstr "Générateurs de miniature :"
|
430 |
-
|
431 |
-
#: inc/class-thumber.php:642
|
432 |
-
msgid "No thumbnail generators enabled."
|
433 |
-
msgstr "Aucun générateur de miniature activé."
|
434 |
-
|
435 |
-
#: inc/class-thumber.php:685
|
436 |
-
msgid "Failed to get image editor: "
|
437 |
-
msgstr "Impossible d'obtenir l'éditeur d'image :"
|
438 |
-
|
439 |
-
#: inc/class-thumber.php:697
|
440 |
-
msgid "Failed to save image: "
|
441 |
-
msgstr "Impossible d'enregistrer l'image :"
|
442 |
-
|
443 |
-
#. Plugin URI of the plugin/theme
|
444 |
-
msgid "http://wordpress.org/extend/plugins/document-gallery/"
|
445 |
-
msgstr "http://wordpress.org/extend/plugins/document-gallery/"
|
446 |
-
|
447 |
-
#. Description of the plugin/theme
|
448 |
-
msgid ""
|
449 |
-
"Display non-images (and images) in gallery format on a page or post with the "
|
450 |
-
"[dg] shortcode."
|
451 |
-
msgstr ""
|
452 |
-
"Affiche les médias de type documents (et images) au format galerie dans une "
|
453 |
-
"page ou un article grâce au shortcode [dg]."
|
454 |
-
|
455 |
-
#. Author of the plugin/theme
|
456 |
-
msgid "Dan Rossiter"
|
457 |
-
msgstr "Dan Rossiter"
|
458 |
-
|
459 |
-
#. Author URI of the plugin/theme
|
460 |
-
msgid "http://danrossiter.org/"
|
461 |
-
msgstr "http://danrossiter.org/"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/document-gallery-ru_RU.mo
DELETED
Binary file
|
languages/document-gallery-ru_RU.po
DELETED
@@ -1,432 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Document Gallery
|
2 |
-
# This file is distributed under the same license as the Document Gallery package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Document Gallery 2.2\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/document-gallery\n"
|
7 |
-
"POT-Creation-Date: 2014-09-04 02:15:50+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2014-09-12 19:42-0600\n"
|
12 |
-
"Last-Translator: Dan Rossiter <dan.rossiters@gmail.com>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"X-Generator: Poedit 1.6.9\n"
|
15 |
-
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
16 |
-
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
17 |
-
"Language: ru_RU\n"
|
18 |
-
|
19 |
-
#: admin/class-admin.php:28
|
20 |
-
msgid "General"
|
21 |
-
msgstr "Основные"
|
22 |
-
|
23 |
-
#: admin/class-admin.php:29
|
24 |
-
msgid "Thumbnail Management"
|
25 |
-
msgstr "Управление миниатюрами"
|
26 |
-
|
27 |
-
#: admin/class-admin.php:30
|
28 |
-
msgid "Logging"
|
29 |
-
msgstr "Журнал событий"
|
30 |
-
|
31 |
-
#: admin/class-admin.php:31
|
32 |
-
msgid "Advanced"
|
33 |
-
msgstr "Для опытных пользователей"
|
34 |
-
|
35 |
-
#: admin/class-admin.php:68
|
36 |
-
msgid "Settings"
|
37 |
-
msgstr "Настройки"
|
38 |
-
|
39 |
-
#: admin/class-admin.php:78
|
40 |
-
msgid "Document Gallery Settings"
|
41 |
-
msgstr "Настройки Document Gallery"
|
42 |
-
|
43 |
-
#. Plugin Name of the plugin/theme
|
44 |
-
#: admin/class-admin.php:79
|
45 |
-
msgid "Document Gallery"
|
46 |
-
msgstr "Document Gallery"
|
47 |
-
|
48 |
-
#: admin/class-admin.php:124
|
49 |
-
msgid "Default Settings"
|
50 |
-
msgstr "Настройки по умолчанию"
|
51 |
-
|
52 |
-
#: admin/class-admin.php:128
|
53 |
-
msgid "Thumbnail Generation"
|
54 |
-
msgstr "Создание миниатюр"
|
55 |
-
|
56 |
-
#: admin/class-admin.php:132
|
57 |
-
msgid "Custom CSS"
|
58 |
-
msgstr "Индивидуальные CSS"
|
59 |
-
|
60 |
-
#: admin/class-admin.php:144
|
61 |
-
msgid "Link to attachment page rather than to file"
|
62 |
-
msgstr "Ссылка на страницу вложения, а не на сам файл"
|
63 |
-
|
64 |
-
#: admin/class-admin.php:156
|
65 |
-
msgid "Include document descriptions"
|
66 |
-
msgstr "Включать описания документов"
|
67 |
-
|
68 |
-
#: admin/class-admin.php:168
|
69 |
-
msgid "Use auto-generated document thumbnails"
|
70 |
-
msgstr "Использовать автоматически создаваемые миниатюры документов"
|
71 |
-
|
72 |
-
#: admin/class-admin.php:180
|
73 |
-
msgid "Include image attachments in gallery"
|
74 |
-
msgstr "Включать прикрепленные к посту картинки в галерею"
|
75 |
-
|
76 |
-
#: admin/class-admin.php:192
|
77 |
-
msgid "Only look for attachments in post where [dg] is used"
|
78 |
-
msgstr "Искать вложения только в постах, где используется [dg]"
|
79 |
-
|
80 |
-
#: admin/class-admin.php:205
|
81 |
-
msgid "Ascending or descending sorting of documents"
|
82 |
-
msgstr "Сортировка документов по возрастанию или по убыванию"
|
83 |
-
|
84 |
-
#: admin/class-admin.php:218
|
85 |
-
msgid "Which field to order documents by"
|
86 |
-
msgstr "По какому полю сортировать документы"
|
87 |
-
|
88 |
-
#: admin/class-admin.php:231
|
89 |
-
msgid ""
|
90 |
-
"Whether matched documents must have all taxa_names (AND) or at least one (OR)"
|
91 |
-
msgstr ""
|
92 |
-
"Искать документы, принадлежащие всем категориям (AND) перечисленным в "
|
93 |
-
"параметре category, также возможно использование taxon_name, или хотя бы "
|
94 |
-
"одной (OR)"
|
95 |
-
|
96 |
-
#: admin/class-admin.php:243
|
97 |
-
msgid "Locally generate thumbnails for audio & video files."
|
98 |
-
msgstr "Локально создавать миниатюры для аудио и видео файлов."
|
99 |
-
|
100 |
-
#: admin/class-admin.php:256
|
101 |
-
msgid ""
|
102 |
-
"Use <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
103 |
-
"a> for faster local PDF processing (compared to Imagick)."
|
104 |
-
msgstr ""
|
105 |
-
"Использовать <a href=\"http://www.ghostscript.com/\" target=\"_blank"
|
106 |
-
"\">Ghostscript</a> для более быстрой локальной обработки PDF (в сравнении с "
|
107 |
-
"Imagick)."
|
108 |
-
|
109 |
-
#: admin/class-admin.php:257
|
110 |
-
msgid ""
|
111 |
-
"Your server is not configured to run <a href=\"http://www.ghostscript.com/\" "
|
112 |
-
"target=\"_blank\">Ghostscript</a>."
|
113 |
-
msgstr ""
|
114 |
-
"Ваш сервер не настроен для использования <a href=\"http://www.ghostscript."
|
115 |
-
"com/\" target=\"_blank\">Ghostscript</a>."
|
116 |
-
|
117 |
-
#: admin/class-admin.php:271
|
118 |
-
msgid ""
|
119 |
-
"Use <a href=\"http://www.php.net/manual/en/book.imagick.php\" target=\"_blank"
|
120 |
-
"\">Imagick</a> to handle lots of filetypes locally."
|
121 |
-
msgstr ""
|
122 |
-
"Использовать <a href=\"http://www.php.net/manual/ru/book.imagick.php\" "
|
123 |
-
"target=\"_blank\">Imagick</a> для локальной обработки множества типов файлов."
|
124 |
-
|
125 |
-
#: admin/class-admin.php:272
|
126 |
-
msgid ""
|
127 |
-
"Your server is not configured to run <a href=\"http://www.php.net/manual/en/"
|
128 |
-
"book.imagick.php\" target=\"_blank\">Imagick</a>."
|
129 |
-
msgstr ""
|
130 |
-
"Ваш сервер не настроен для использования <a href=\"http://www.php.net/manual/"
|
131 |
-
"ru/book.imagick.php\" target=\"_blank\">Imagick</a>."
|
132 |
-
|
133 |
-
#: admin/class-admin.php:286
|
134 |
-
msgid ""
|
135 |
-
"Use <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
136 |
-
"Drive Viewer</a> to generate thumbnails for MS Office files and many other "
|
137 |
-
"file types remotely."
|
138 |
-
msgstr ""
|
139 |
-
"Использовать <a href=\"https://drive.google.com/viewer\" target=\"_blank"
|
140 |
-
"\">Google Drive Viewer</a> для создания миниатюр файлов MS Office и многих "
|
141 |
-
"других типов файлов удалённо."
|
142 |
-
|
143 |
-
#: admin/class-admin.php:287
|
144 |
-
msgid "Your server does not allow remote HTTP access."
|
145 |
-
msgstr "Ваш сервер не разрешает удаленные HTTP обращения."
|
146 |
-
|
147 |
-
#: admin/class-admin.php:309
|
148 |
-
msgid "The max width and height (in pixels) that thumbnails will be generated."
|
149 |
-
msgstr ""
|
150 |
-
"Максимальная ширина и высота (в пикселях) с которыми будут создаваться "
|
151 |
-
"миниатюры."
|
152 |
-
|
153 |
-
#: admin/class-admin.php:336
|
154 |
-
msgid "Advanced Thumbnail Generation"
|
155 |
-
msgstr "Создание миниатюр"
|
156 |
-
|
157 |
-
#: admin/class-admin.php:348
|
158 |
-
msgid "Whether to log debug and error information related to Document Gallery."
|
159 |
-
msgstr ""
|
160 |
-
"Вести ли журнал отладки и информации об ошибках имеющих отношение к Document "
|
161 |
-
"Gallery."
|
162 |
-
|
163 |
-
#: admin/class-admin.php:360
|
164 |
-
msgid ""
|
165 |
-
"Whether option structure should be validated before save. This is not "
|
166 |
-
"generally necessary."
|
167 |
-
msgstr ""
|
168 |
-
"Проверять ли структуру выбранных настроек при сохранении. Как правило в этом "
|
169 |
-
"нет необходимости."
|
170 |
-
|
171 |
-
#: admin/class-admin.php:373
|
172 |
-
msgid ""
|
173 |
-
"Max number of seconds to wait for thumbnail generation before defaulting to "
|
174 |
-
"filetype icons."
|
175 |
-
msgstr ""
|
176 |
-
"Максимальное количество секунд ожидания при создании миниатюры до "
|
177 |
-
"использования иконки по умолчанию."
|
178 |
-
|
179 |
-
#: admin/class-admin.php:374
|
180 |
-
msgid ""
|
181 |
-
"Note that generation will continue where timeout happened next time the "
|
182 |
-
"gallery is loaded."
|
183 |
-
msgstr ""
|
184 |
-
"Обратите внимание, что создание продолжится с того места, где оно было "
|
185 |
-
"приостановлено, при следующем обращении к галереи."
|
186 |
-
|
187 |
-
#: admin/class-admin.php:386
|
188 |
-
msgid "Successfully auto-detected the location of Ghostscript."
|
189 |
-
msgstr "Успешно автоматически определено местонахождение Ghostscript."
|
190 |
-
|
191 |
-
#: admin/class-admin.php:387
|
192 |
-
msgid "Failed to auto-detect the location of Ghostscript."
|
193 |
-
msgstr "Не удалось автоматически определить местонахождение Ghostscript."
|
194 |
-
|
195 |
-
#: admin/class-admin.php:391
|
196 |
-
msgid "Options Array Dump"
|
197 |
-
msgstr "Дамп массива установленных настроек"
|
198 |
-
|
199 |
-
#: admin/class-admin.php:438
|
200 |
-
msgid "Invalid width given: "
|
201 |
-
msgstr "Задана неверная ширина: "
|
202 |
-
|
203 |
-
#: admin/class-admin.php:451
|
204 |
-
msgid "Invalid height given: "
|
205 |
-
msgstr "Задана неверная высота: "
|
206 |
-
|
207 |
-
#: admin/class-admin.php:562
|
208 |
-
msgid "Invalid Ghostscript path given: "
|
209 |
-
msgstr "Задан неверный путь Ghostscript: "
|
210 |
-
|
211 |
-
#: admin/class-admin.php:573
|
212 |
-
msgid "Invalid timeout given: "
|
213 |
-
msgstr "Задано неверное время ожидания: "
|
214 |
-
|
215 |
-
#: admin/class-admin.php:604
|
216 |
-
msgid ""
|
217 |
-
"The following values will be used by default in the shortcode. You can still "
|
218 |
-
"manually set each of these values in each individual shortcode."
|
219 |
-
msgstr ""
|
220 |
-
"Следующие значения будут использоваться шорткодом [dg] по умолчанию. При "
|
221 |
-
"этом вручную можно установить любые из этих значений в каждом конкретном "
|
222 |
-
"экземпляре шорткода."
|
223 |
-
|
224 |
-
#: admin/class-admin.php:611
|
225 |
-
msgid "Select which tools to use when generating thumbnails."
|
226 |
-
msgstr "Выберите, какие инструменты использовать для создании миниатюр."
|
227 |
-
|
228 |
-
#: admin/class-admin.php:620
|
229 |
-
#, c-format
|
230 |
-
msgid ""
|
231 |
-
"Enter custom CSS styling for use with document galleries. To see which ids "
|
232 |
-
"and classes you can style, take a look at <a href=\"%s\" target=\"_blank"
|
233 |
-
"\">style.css</a>."
|
234 |
-
msgstr ""
|
235 |
-
"Введите индивидуальные CSS стили для использования с галереями документов. "
|
236 |
-
"Чтобы увидеть, какие селекторы стоит использовать, посмотрите на <a href=\"%s"
|
237 |
-
"\" target=\"_blank\">style.css</a>."
|
238 |
-
|
239 |
-
#: admin/class-admin.php:640
|
240 |
-
msgid ""
|
241 |
-
"Unless you <em>really</em> know what you're doing, you should not touch "
|
242 |
-
"these values."
|
243 |
-
msgstr ""
|
244 |
-
"Не стоит менять этих значений, за исключением случаев когда Вы "
|
245 |
-
"<em>действительно</em> знаете что делаете."
|
246 |
-
|
247 |
-
#: admin/class-admin.php:643
|
248 |
-
msgid ""
|
249 |
-
"NOTE: <code>exec()</code> is not accessible. Ghostscript will not function."
|
250 |
-
msgstr ""
|
251 |
-
"ВНИМАНИЕ: <code>exec()</code> недоступный. Ghostscript не будет работать."
|
252 |
-
|
253 |
-
#: admin/class-admin.php:654
|
254 |
-
msgid ""
|
255 |
-
"The following <em>readonly text</em> should be provided when <a href="
|
256 |
-
"\"http://wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
257 |
-
"\">reporting a bug</a>:"
|
258 |
-
msgstr ""
|
259 |
-
"Нижеследующий <em>доступный только для чтения текст</em> должен быть "
|
260 |
-
"предоставлен при <a href=\"http://wordpress.org/support/plugin/document-"
|
261 |
-
"gallery\" target=\"_blank\">сообщении об ошибке</a>:"
|
262 |
-
|
263 |
-
#: admin/class-admin.php:755
|
264 |
-
msgid "Select All"
|
265 |
-
msgstr "Выбрать всё"
|
266 |
-
|
267 |
-
#: admin/class-admin.php:758
|
268 |
-
msgid "Thumbnail"
|
269 |
-
msgstr "Миниатюра"
|
270 |
-
|
271 |
-
#: admin/class-admin.php:759
|
272 |
-
msgid "File name"
|
273 |
-
msgstr "Имя файла"
|
274 |
-
|
275 |
-
#: admin/class-admin.php:760
|
276 |
-
msgid "Date"
|
277 |
-
msgstr "Дата"
|
278 |
-
|
279 |
-
#: admin/class-admin.php:763
|
280 |
-
msgid "Delete Selected"
|
281 |
-
msgstr "Удалить выбранные"
|
282 |
-
|
283 |
-
#: admin/class-admin.php:765
|
284 |
-
msgid "item"
|
285 |
-
msgid_plural "items"
|
286 |
-
msgstr[0] "запись"
|
287 |
-
msgstr[1] "записи"
|
288 |
-
msgstr[2] "записей"
|
289 |
-
|
290 |
-
#: admin/class-admin.php:768
|
291 |
-
msgid "Go to the first page"
|
292 |
-
msgstr "Перейти к первой странице"
|
293 |
-
|
294 |
-
#: admin/class-admin.php:769
|
295 |
-
msgid "Go to the previous page"
|
296 |
-
msgstr "Перейти к предыдущей странице"
|
297 |
-
|
298 |
-
#: admin/class-admin.php:771
|
299 |
-
msgid "Current page"
|
300 |
-
msgstr "Текущая страница"
|
301 |
-
|
302 |
-
#: admin/class-admin.php:771
|
303 |
-
msgid "of"
|
304 |
-
msgstr "из"
|
305 |
-
|
306 |
-
#: admin/class-admin.php:772
|
307 |
-
msgid "Go to the next page"
|
308 |
-
msgstr "Перейти к следующей странице"
|
309 |
-
|
310 |
-
#: admin/class-admin.php:773
|
311 |
-
msgid "Go to the last page"
|
312 |
-
msgstr "Перейти к последней странице"
|
313 |
-
|
314 |
-
#: admin/class-admin.php:775
|
315 |
-
msgid "items per page"
|
316 |
-
msgstr "записей на странице"
|
317 |
-
|
318 |
-
#: admin/class-admin.php:808
|
319 |
-
msgid "View"
|
320 |
-
msgstr "Посмотреть страницу вложения"
|
321 |
-
|
322 |
-
#: admin/class-admin.php:809
|
323 |
-
msgid "attachment page"
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: admin/class-admin.php:809
|
327 |
-
msgid "Attachment not found"
|
328 |
-
msgstr "Вложение не найдено"
|
329 |
-
|
330 |
-
#: inc/class-gallery.php:85
|
331 |
-
msgid "Generated using Document Gallery. Get yours here: "
|
332 |
-
msgstr ""
|
333 |
-
"Сгенерировано используя Document Gallery. Понравилось? Получите Вашу копию "
|
334 |
-
"здесь: "
|
335 |
-
|
336 |
-
#: inc/class-gallery.php:88
|
337 |
-
msgid "No attachments to display. How boring! :("
|
338 |
-
msgstr "Ни одного вложения для отображения. Скукотища! :("
|
339 |
-
|
340 |
-
#: inc/class-gallery.php:89
|
341 |
-
#, c-format
|
342 |
-
msgid "The %s parameter may only be \"%s\" or \"%s.\" You entered \"%s.\""
|
343 |
-
msgstr ""
|
344 |
-
"Параметр %s может принимать только значения \"%s\" или \"%s.\" Вы же ввели "
|
345 |
-
"\"%s.\""
|
346 |
-
|
347 |
-
#: inc/class-gallery.php:285
|
348 |
-
msgid "The following ID is invalid: "
|
349 |
-
msgid_plural "The following IDs are invalid: "
|
350 |
-
msgstr[0] "Следующий идентификатор (ID) недействительный: "
|
351 |
-
msgstr[1] "Следующие идентификаторы (IDs) недействительны: "
|
352 |
-
msgstr[2] "Следующие идентификаторы (IDs) недействительны: "
|
353 |
-
|
354 |
-
#: inc/class-gallery.php:378
|
355 |
-
#, c-format
|
356 |
-
msgid "The orderby value entered, \"%s,\" is not valid."
|
357 |
-
msgstr "Указанное значение параметра orderby, \"%s,\" недопустимо."
|
358 |
-
|
359 |
-
#: inc/class-gallery.php:532
|
360 |
-
#, c-format
|
361 |
-
msgid "%s is not a valid term name in %s."
|
362 |
-
msgstr "Определение %s не является допустимым значением параметра %s."
|
363 |
-
|
364 |
-
#: inc/class-image-editor-imagick.php:37
|
365 |
-
msgid "Failed to set Imagick page number"
|
366 |
-
msgstr "Не удалось установить номер страницы в Imagick"
|
367 |
-
|
368 |
-
#: inc/class-thumber.php:59
|
369 |
-
#, c-format
|
370 |
-
msgid "Attempting to generate thumbnail for attachment #%d with '%s'"
|
371 |
-
msgstr "Попытка создания миниатюры для вложения №%d с помощью '%s'"
|
372 |
-
|
373 |
-
#: inc/class-thumber.php:138
|
374 |
-
msgid "Could not open file: "
|
375 |
-
msgstr "Не удалось открыть файл: "
|
376 |
-
|
377 |
-
#: inc/class-thumber.php:143
|
378 |
-
msgid "Could not write file: "
|
379 |
-
msgstr "Не удалось записать файл: "
|
380 |
-
|
381 |
-
#: inc/class-thumber.php:180
|
382 |
-
msgid "Failed to open file in Imagick: "
|
383 |
-
msgstr "Не удалось открыть файл в Imagick: "
|
384 |
-
|
385 |
-
#: inc/class-thumber.php:191
|
386 |
-
msgid "Failed to save image in Imagick: "
|
387 |
-
msgstr "Не удалось сохранить изображение в Imagick: "
|
388 |
-
|
389 |
-
#: inc/class-thumber.php:249
|
390 |
-
msgid "Ghostscript failed: "
|
391 |
-
msgstr "Сбой в Ghostscript: "
|
392 |
-
|
393 |
-
#: inc/class-thumber.php:387
|
394 |
-
msgid "Failed to retrieve thumbnail from Google: "
|
395 |
-
msgstr "Не удалось получить от Google миниатюру: "
|
396 |
-
|
397 |
-
#: inc/class-thumber.php:631
|
398 |
-
msgid "Thumbnail Generators: "
|
399 |
-
msgstr "Генераторы миниатюр: "
|
400 |
-
|
401 |
-
#: inc/class-thumber.php:636
|
402 |
-
msgid "No thumbnail generators enabled."
|
403 |
-
msgstr "Отсутствуют включенные генераторы миниатюр."
|
404 |
-
|
405 |
-
#: inc/class-thumber.php:679
|
406 |
-
msgid "Failed to get image editor: "
|
407 |
-
msgstr ""
|
408 |
-
"Сбой при попытке использовании графического редактора (WP_Image_Editor): "
|
409 |
-
|
410 |
-
#: inc/class-thumber.php:691
|
411 |
-
msgid "Failed to save image: "
|
412 |
-
msgstr "Не удалось сохранить изображение: "
|
413 |
-
|
414 |
-
#. Plugin URI of the plugin/theme
|
415 |
-
msgid "http://wordpress.org/extend/plugins/document-gallery/"
|
416 |
-
msgstr "http://wordpress.org/extend/plugins/document-gallery/"
|
417 |
-
|
418 |
-
#. Description of the plugin/theme
|
419 |
-
msgid ""
|
420 |
-
"Display non-images (and images) in gallery format on a page or post with the "
|
421 |
-
"[dg] shortcode."
|
422 |
-
msgstr ""
|
423 |
-
"Отображение не-изображений (а также изображений) в виде галерей на страницах "
|
424 |
-
"и в записях с помощью шорткода [dg]."
|
425 |
-
|
426 |
-
#. Author of the plugin/theme
|
427 |
-
msgid "Dan Rossiter"
|
428 |
-
msgstr "Dan Rossiter"
|
429 |
-
|
430 |
-
#. Author URI of the plugin/theme
|
431 |
-
msgid "http://danrossiter.org/"
|
432 |
-
msgstr "http://danrossiter.org/"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/document-gallery-sv_SE.mo
DELETED
Binary file
|
languages/document-gallery-sv_SE.po
DELETED
@@ -1,449 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Document Gallery
|
2 |
-
# This file is distributed under the same license as the Document Gallery package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Document Gallery 2.2\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/document-gallery\n"
|
7 |
-
"POT-Creation-Date: 2014-09-23 02:11:20+00:00\n"
|
8 |
-
"PO-Revision-Date: 2014-10-13 16:57+0100\n"
|
9 |
-
"Last-Translator: P. E.\n"
|
10 |
-
"Language-Team: P. E.\n"
|
11 |
-
"Language: sv_SE\n"
|
12 |
-
"MIME-Version: 1.0\n"
|
13 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
-
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
16 |
-
"X-Generator: Poedit 1.6.9\n"
|
17 |
-
|
18 |
-
#: admin/class-admin.php:28
|
19 |
-
msgid "General"
|
20 |
-
msgstr "Generellt"
|
21 |
-
|
22 |
-
#: admin/class-admin.php:29
|
23 |
-
msgid "Thumbnail Management"
|
24 |
-
msgstr "Miniatyrhantering"
|
25 |
-
|
26 |
-
#: admin/class-admin.php:30 admin/class-admin.php:904
|
27 |
-
msgid "Logging"
|
28 |
-
msgstr "Loggning"
|
29 |
-
|
30 |
-
#: admin/class-admin.php:31
|
31 |
-
msgid "Advanced"
|
32 |
-
msgstr "Avancerat"
|
33 |
-
|
34 |
-
#: admin/class-admin.php:68
|
35 |
-
msgid "Settings"
|
36 |
-
msgstr "Inställningar"
|
37 |
-
|
38 |
-
#: admin/class-admin.php:78
|
39 |
-
msgid "Document Gallery Settings"
|
40 |
-
msgstr "Document Gallery Inställningar"
|
41 |
-
|
42 |
-
#. Plugin Name of the plugin/theme
|
43 |
-
#: admin/class-admin.php:79
|
44 |
-
msgid "Document Gallery"
|
45 |
-
msgstr "Document Gallery"
|
46 |
-
|
47 |
-
#: admin/class-admin.php:124
|
48 |
-
msgid "Default Settings"
|
49 |
-
msgstr "Standardinställningar"
|
50 |
-
|
51 |
-
#: admin/class-admin.php:128
|
52 |
-
msgid "Thumbnail Generation"
|
53 |
-
msgstr "Miniatyrgenerering"
|
54 |
-
|
55 |
-
#: admin/class-admin.php:132
|
56 |
-
msgid "Custom CSS"
|
57 |
-
msgstr "Anpassad CSS"
|
58 |
-
|
59 |
-
#: admin/class-admin.php:144
|
60 |
-
msgid "Link to attachment page rather than to file"
|
61 |
-
msgstr "Länka till sida för bilaga istället för direkt till filen"
|
62 |
-
|
63 |
-
#: admin/class-admin.php:156
|
64 |
-
msgid "Include document descriptions"
|
65 |
-
msgstr "Ta med dokumentbeskrivningar"
|
66 |
-
|
67 |
-
#: admin/class-admin.php:168
|
68 |
-
msgid "Use auto-generated document thumbnails"
|
69 |
-
msgstr "Använd autogenererade dokumentminiatyrer"
|
70 |
-
|
71 |
-
#: admin/class-admin.php:180
|
72 |
-
msgid "Include image attachments in gallery"
|
73 |
-
msgstr "Ta med bildbilagor i galleriet"
|
74 |
-
|
75 |
-
#: admin/class-admin.php:192
|
76 |
-
msgid "Only look for attachments in post where [dg] is used"
|
77 |
-
msgstr "Sök endast efter bilagor i inlägg där kortkoden [dg] har använts"
|
78 |
-
|
79 |
-
#: admin/class-admin.php:205
|
80 |
-
msgid "Ascending or descending sorting of documents"
|
81 |
-
msgstr "Stigande eller fallande dokumentsortering"
|
82 |
-
|
83 |
-
#: admin/class-admin.php:218
|
84 |
-
msgid "Which field to order documents by"
|
85 |
-
msgstr "Det fält som dokumenten skall sorteras efter"
|
86 |
-
|
87 |
-
#: admin/class-admin.php:231
|
88 |
-
msgid ""
|
89 |
-
"Whether matched documents must have all taxa_names (AND) or at least one (OR)"
|
90 |
-
msgstr ""
|
91 |
-
"Ifall matchade dokument måste ha alla taxa_names (AND) eller minst ett (OR)"
|
92 |
-
|
93 |
-
#: admin/class-admin.php:243
|
94 |
-
msgid "Locally generate thumbnails for audio & video files."
|
95 |
-
msgstr "Generera miniatyrer för audio- & videofiler lokalt."
|
96 |
-
|
97 |
-
#: admin/class-admin.php:256
|
98 |
-
msgid ""
|
99 |
-
"Use <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
100 |
-
"a> for faster local PDF processing (compared to Imagick)."
|
101 |
-
msgstr ""
|
102 |
-
"Använd <a href=\"http://www.ghostscript.com/\" target=\"_blank"
|
103 |
-
"\">Ghostscript</a> för snabbare lokal PDF-behandling (jämfört med Imagick)."
|
104 |
-
|
105 |
-
#: admin/class-admin.php:257
|
106 |
-
msgid ""
|
107 |
-
"Your server is not configured to run <a href=\"http://www.ghostscript.com/\" "
|
108 |
-
"target=\"_blank\">Ghostscript</a>."
|
109 |
-
msgstr ""
|
110 |
-
"Din server är inte konfigurerad att köra <a href=\"http://www.ghostscript."
|
111 |
-
"com/\" target=\"_blank\">Ghostscript</a>."
|
112 |
-
|
113 |
-
#: admin/class-admin.php:271
|
114 |
-
msgid ""
|
115 |
-
"Use <a href=\"http://www.php.net/manual/en/book.imagick.php\" target=\"_blank"
|
116 |
-
"\">Imagick</a> to handle lots of filetypes locally."
|
117 |
-
msgstr ""
|
118 |
-
"Anänd <a href=\"http://www.php.net/manual/en/book.imagick.php\" target="
|
119 |
-
"\"_blank\">Imagick</a> för att hantera mängder av filtyper lokalt."
|
120 |
-
|
121 |
-
#: admin/class-admin.php:272
|
122 |
-
msgid ""
|
123 |
-
"Your server is not configured to run <a href=\"http://www.php.net/manual/en/"
|
124 |
-
"book.imagick.php\" target=\"_blank\">Imagick</a>."
|
125 |
-
msgstr ""
|
126 |
-
"Din server är inte konfigurerad att köra <a href=\"http://www.php.net/manual/"
|
127 |
-
"en/book.imagick.php\" target=\"_blank\">Imagick</a>."
|
128 |
-
|
129 |
-
#: admin/class-admin.php:286
|
130 |
-
msgid ""
|
131 |
-
"Use <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
132 |
-
"Drive Viewer</a> to generate thumbnails for MS Office files and many other "
|
133 |
-
"file types remotely."
|
134 |
-
msgstr ""
|
135 |
-
"Använd <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
136 |
-
"Drive Viewer</a> för att generera miniatyrer för MS Office-dokument samt "
|
137 |
-
"många andra filtyper externt."
|
138 |
-
|
139 |
-
#: admin/class-admin.php:287
|
140 |
-
msgid "Your server does not allow remote HTTP access."
|
141 |
-
msgstr "Din server tillåter inte externt HTTP-tillträde."
|
142 |
-
|
143 |
-
#: admin/class-admin.php:309
|
144 |
-
msgid "The max width and height (in pixels) that thumbnails will be generated."
|
145 |
-
msgstr "Max bredd och höjd (i pixlar) för genererade miniatyrer."
|
146 |
-
|
147 |
-
#: admin/class-admin.php:338
|
148 |
-
msgid "Advanced Thumbnail Generation"
|
149 |
-
msgstr "Avancerad Miniatyrgenerering"
|
150 |
-
|
151 |
-
#: admin/class-admin.php:350
|
152 |
-
msgid "Whether to log debug and error information related to Document Gallery."
|
153 |
-
msgstr ""
|
154 |
-
"Ifall debug- och felinformation relaterat till Document Gallery skall loggas."
|
155 |
-
|
156 |
-
#: admin/class-admin.php:362
|
157 |
-
msgid ""
|
158 |
-
"Whether option structure should be validated before save. This is not "
|
159 |
-
"generally necessary."
|
160 |
-
msgstr ""
|
161 |
-
"Ifall alternativstruktur skall valideras innan nedsparning. Detta är "
|
162 |
-
"generellt ej nödvändigt."
|
163 |
-
|
164 |
-
#: admin/class-admin.php:375
|
165 |
-
msgid ""
|
166 |
-
"Max number of seconds to wait for thumbnail generation before defaulting to "
|
167 |
-
"filetype icons."
|
168 |
-
msgstr ""
|
169 |
-
"Max antal sekunder att vänta på miniatyrgenerering innan standard "
|
170 |
-
"filtypsikoner används."
|
171 |
-
|
172 |
-
#: admin/class-admin.php:376
|
173 |
-
msgid ""
|
174 |
-
"Note that generation will continue where timeout happened next time the "
|
175 |
-
"gallery is loaded."
|
176 |
-
msgstr ""
|
177 |
-
"Notera att genereringen kommer att fortsätta därifrån den avbröts av "
|
178 |
-
"tidsgränsen nästa gång galleriet laddas."
|
179 |
-
|
180 |
-
#: admin/class-admin.php:388
|
181 |
-
msgid "Successfully auto-detected the location of Ghostscript."
|
182 |
-
msgstr "Hittade platsen för Ghostscript automatiskt."
|
183 |
-
|
184 |
-
#: admin/class-admin.php:389
|
185 |
-
msgid "Failed to auto-detect the location of Ghostscript."
|
186 |
-
msgstr "Kunde inte hitta platsen för Ghostscript automatiskt."
|
187 |
-
|
188 |
-
#: admin/class-admin.php:393
|
189 |
-
msgid "Options Array Dump"
|
190 |
-
msgstr "Dumpning av Alternativmatris"
|
191 |
-
|
192 |
-
#: admin/class-admin.php:440
|
193 |
-
msgid "Invalid width given: "
|
194 |
-
msgstr "Ogiltig bredd angiven:"
|
195 |
-
|
196 |
-
#: admin/class-admin.php:453
|
197 |
-
msgid "Invalid height given: "
|
198 |
-
msgstr "Ogiltig höjd angiven:"
|
199 |
-
|
200 |
-
#: admin/class-admin.php:566
|
201 |
-
msgid "Invalid Ghostscript path given: "
|
202 |
-
msgstr "Ogiltig sökväg till Ghostscript angiven:"
|
203 |
-
|
204 |
-
#: admin/class-admin.php:577
|
205 |
-
msgid "Invalid timeout given: "
|
206 |
-
msgstr "Ogiltig tidsgräns angiven:"
|
207 |
-
|
208 |
-
#: admin/class-admin.php:608
|
209 |
-
msgid ""
|
210 |
-
"The following values will be used by default in the shortcode. You can still "
|
211 |
-
"manually set each of these values in each individual shortcode."
|
212 |
-
msgstr ""
|
213 |
-
"Följande värden kommer att användas som standard i kortkoden. Du kan "
|
214 |
-
"fortfarande sätta varje värde, i varje kortkod, manuellt."
|
215 |
-
|
216 |
-
#: admin/class-admin.php:615
|
217 |
-
msgid "Select which tools to use when generating thumbnails."
|
218 |
-
msgstr "Välj vilka verktyg som skall användas vid miniatyrgenerering."
|
219 |
-
|
220 |
-
#: admin/class-admin.php:624
|
221 |
-
msgid ""
|
222 |
-
"Enter custom CSS styling for use with document galleries. To see which ids "
|
223 |
-
"and classes you can style, take a look at <a href=\"%s\" target=\"_blank"
|
224 |
-
"\">style.css</a>."
|
225 |
-
msgstr ""
|
226 |
-
"Ange anpassad CSS-stil att använda för dokumentgallerier. För att se vilka "
|
227 |
-
"ID:n och klasser du kan använda, ta en titt på <a href=\"%s\" target=\"_blank"
|
228 |
-
"\">style.css</a>."
|
229 |
-
|
230 |
-
#: admin/class-admin.php:644
|
231 |
-
msgid ""
|
232 |
-
"Unless you <em>really</em> know what you're doing, you should not touch "
|
233 |
-
"these values."
|
234 |
-
msgstr ""
|
235 |
-
"Om du inte <em>verkligen</em> vet vad du gör så bör du lämna dessa värden "
|
236 |
-
"orörda."
|
237 |
-
|
238 |
-
#: admin/class-admin.php:647
|
239 |
-
msgid ""
|
240 |
-
"NOTE: <code>exec()</code> is not accessible. Ghostscript will not function."
|
241 |
-
msgstr ""
|
242 |
-
"NOTERA: <code>exec()</code> är ej tillgängligt. Ghostscript kommer inte att "
|
243 |
-
"fungera."
|
244 |
-
|
245 |
-
#: admin/class-admin.php:658
|
246 |
-
msgid ""
|
247 |
-
"The following <em>readonly text</em> should be provided when <a href="
|
248 |
-
"\"http://wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
249 |
-
"\">reporting a bug</a>:"
|
250 |
-
msgstr ""
|
251 |
-
"Följande <em>skrivskyddade text</em> skall skickas med vid <a href=\"http://"
|
252 |
-
"wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
253 |
-
"\">buggrapportering</a>:"
|
254 |
-
|
255 |
-
#: admin/class-admin.php:759
|
256 |
-
msgid "Select All"
|
257 |
-
msgstr "Välj Alla"
|
258 |
-
|
259 |
-
#: admin/class-admin.php:762
|
260 |
-
msgid "Thumbnail"
|
261 |
-
msgstr "Miniatyr"
|
262 |
-
|
263 |
-
#: admin/class-admin.php:763
|
264 |
-
msgid "File name"
|
265 |
-
msgstr "Filnamn"
|
266 |
-
|
267 |
-
#: admin/class-admin.php:764 admin/class-admin.php:839
|
268 |
-
msgid "Date"
|
269 |
-
msgstr "Datum"
|
270 |
-
|
271 |
-
#: admin/class-admin.php:767
|
272 |
-
msgid "Delete Selected"
|
273 |
-
msgstr "Ta Bort Valda"
|
274 |
-
|
275 |
-
#: admin/class-admin.php:769
|
276 |
-
msgid "item"
|
277 |
-
msgid_plural "items"
|
278 |
-
msgstr[0] "objekt"
|
279 |
-
msgstr[1] "objekt"
|
280 |
-
|
281 |
-
#: admin/class-admin.php:772
|
282 |
-
msgid "Go to the first page"
|
283 |
-
msgstr "Gå till första sidan"
|
284 |
-
|
285 |
-
#: admin/class-admin.php:773
|
286 |
-
msgid "Go to the previous page"
|
287 |
-
msgstr "Gå till föregående sida"
|
288 |
-
|
289 |
-
#: admin/class-admin.php:775
|
290 |
-
msgid "Current page"
|
291 |
-
msgstr "Aktuell sida"
|
292 |
-
|
293 |
-
#: admin/class-admin.php:775
|
294 |
-
msgid "of"
|
295 |
-
msgstr "av"
|
296 |
-
|
297 |
-
#: admin/class-admin.php:776
|
298 |
-
msgid "Go to the next page"
|
299 |
-
msgstr "Gå till nästa sida"
|
300 |
-
|
301 |
-
#: admin/class-admin.php:777
|
302 |
-
msgid "Go to the last page"
|
303 |
-
msgstr "Gå till sista sidan"
|
304 |
-
|
305 |
-
#: admin/class-admin.php:779
|
306 |
-
msgid "items per page"
|
307 |
-
msgstr "objekt per sida"
|
308 |
-
|
309 |
-
#: admin/class-admin.php:818
|
310 |
-
msgid "View"
|
311 |
-
msgstr "Visa"
|
312 |
-
|
313 |
-
#: admin/class-admin.php:819
|
314 |
-
msgid "attachment page"
|
315 |
-
msgstr "sida för bilaga"
|
316 |
-
|
317 |
-
#: admin/class-admin.php:819
|
318 |
-
msgid "Attachment not found"
|
319 |
-
msgstr "Bilaga hittades ej"
|
320 |
-
|
321 |
-
#: admin/class-admin.php:840
|
322 |
-
msgid "Level"
|
323 |
-
msgstr "Nivå"
|
324 |
-
|
325 |
-
#: admin/class-admin.php:841
|
326 |
-
msgid "Message"
|
327 |
-
msgstr "Meddelande"
|
328 |
-
|
329 |
-
#: admin/class-admin.php:850
|
330 |
-
msgid "Expand All"
|
331 |
-
msgstr "Expandera Alla"
|
332 |
-
|
333 |
-
#: admin/class-admin.php:853
|
334 |
-
msgid "Collapse All"
|
335 |
-
msgstr "Fäll ihop Alla"
|
336 |
-
|
337 |
-
#: admin/class-admin.php:897
|
338 |
-
msgid "Clear Log"
|
339 |
-
msgstr "Rensa Logg"
|
340 |
-
|
341 |
-
#: admin/class-admin.php:904
|
342 |
-
msgid "There are no log entries at this time."
|
343 |
-
msgstr "Det finns för närvarande inga loggposter."
|
344 |
-
|
345 |
-
#: admin/class-admin.php:904
|
346 |
-
msgid "For Your information:"
|
347 |
-
msgstr "För Din vetskap:"
|
348 |
-
|
349 |
-
#: admin/class-admin.php:904
|
350 |
-
msgid "is turned ON"
|
351 |
-
msgstr "är PÅSLAGEN"
|
352 |
-
|
353 |
-
#: admin/class-admin.php:904
|
354 |
-
msgid "is turned OFF"
|
355 |
-
msgstr "är AVSTÄNGD"
|
356 |
-
|
357 |
-
#: inc/class-gallery.php:85
|
358 |
-
msgid "Generated using Document Gallery. Get yours here: "
|
359 |
-
msgstr "Genererat med Document Gallery. Skaffa det här: "
|
360 |
-
|
361 |
-
#: inc/class-gallery.php:88
|
362 |
-
msgid "No attachments to display. How boring! :("
|
363 |
-
msgstr "Inga bilagor att visa. Så tråkigt! :("
|
364 |
-
|
365 |
-
#: inc/class-gallery.php:89
|
366 |
-
msgid "The %s parameter may only be \"%s\" or \"%s.\" You entered \"%s.\""
|
367 |
-
msgstr "Parametern %s får endast vara \"%s\" eller \"%s.\" Du angav \"%s.\""
|
368 |
-
|
369 |
-
#: inc/class-gallery.php:285
|
370 |
-
msgid "The following ID is invalid: "
|
371 |
-
msgid_plural "The following IDs are invalid: "
|
372 |
-
msgstr[0] "Följande ID är ogiltigt:"
|
373 |
-
msgstr[1] "Följande ID:n är ogiltiga:"
|
374 |
-
|
375 |
-
#: inc/class-gallery.php:378
|
376 |
-
msgid "The orderby value entered, \"%s,\" is not valid."
|
377 |
-
msgstr "Värdet som angävs för sortering, \"%s,\" är ogiltigt."
|
378 |
-
|
379 |
-
#: inc/class-gallery.php:532
|
380 |
-
msgid "%s is not a valid term name in %s."
|
381 |
-
msgstr "%s är ej ett giltigt termnamn i %s."
|
382 |
-
|
383 |
-
#: inc/class-image-editor-imagick.php:37
|
384 |
-
msgid "Failed to set Imagick page number"
|
385 |
-
msgstr "Kunde inte sätta Imagick sidnummer"
|
386 |
-
|
387 |
-
#: inc/class-thumber.php:59
|
388 |
-
msgid "Attempting to generate thumbnail for attachment #%d with (%s)"
|
389 |
-
msgstr "Försöker generera miniatyr för bilagan #%d med (%s)"
|
390 |
-
|
391 |
-
#: inc/class-thumber.php:138
|
392 |
-
msgid "Could not open file: "
|
393 |
-
msgstr "Kunde inte öppna fil:"
|
394 |
-
|
395 |
-
#: inc/class-thumber.php:143
|
396 |
-
msgid "Could not write file: "
|
397 |
-
msgstr "Kunde inte skriva till fil:"
|
398 |
-
|
399 |
-
#: inc/class-thumber.php:180
|
400 |
-
msgid "Failed to open file in Imagick: "
|
401 |
-
msgstr "Kunde inte öppna fil i Imagick:"
|
402 |
-
|
403 |
-
#: inc/class-thumber.php:191
|
404 |
-
msgid "Failed to save image in Imagick: "
|
405 |
-
msgstr "Kunde inte spara bild i Imagick:"
|
406 |
-
|
407 |
-
#: inc/class-thumber.php:249
|
408 |
-
msgid "Ghostscript failed: "
|
409 |
-
msgstr "Ghostscript misslyckades:"
|
410 |
-
|
411 |
-
#: inc/class-thumber.php:387
|
412 |
-
msgid "Failed to retrieve thumbnail from Google: "
|
413 |
-
msgstr "Kunde inte hämta miniatyr från Google:"
|
414 |
-
|
415 |
-
#: inc/class-thumber.php:631
|
416 |
-
msgid "Thumbnail Generators: "
|
417 |
-
msgstr "Miniatyrgeneratorer:"
|
418 |
-
|
419 |
-
#: inc/class-thumber.php:642
|
420 |
-
msgid "No thumbnail generators enabled."
|
421 |
-
msgstr "Inga miniatyrgeneratorer aktiverade."
|
422 |
-
|
423 |
-
#: inc/class-thumber.php:685
|
424 |
-
msgid "Failed to get image editor: "
|
425 |
-
msgstr "Kunde inte hämta bildredigerare:"
|
426 |
-
|
427 |
-
#: inc/class-thumber.php:697
|
428 |
-
msgid "Failed to save image: "
|
429 |
-
msgstr "Kunde inte spara bild:"
|
430 |
-
|
431 |
-
#. Plugin URI of the plugin/theme
|
432 |
-
msgid "http://wordpress.org/extend/plugins/document-gallery/"
|
433 |
-
msgstr "http://wordpress.org/extend/plugins/document-gallery/"
|
434 |
-
|
435 |
-
#. Description of the plugin/theme
|
436 |
-
msgid ""
|
437 |
-
"Display non-images (and images) in gallery format on a page or post with the "
|
438 |
-
"[dg] shortcode."
|
439 |
-
msgstr ""
|
440 |
-
"Visa dokument (och bilder) i galleriformat på en sida eller i ett inlägg med "
|
441 |
-
"kortkoden [dg]."
|
442 |
-
|
443 |
-
#. Author of the plugin/theme
|
444 |
-
msgid "Dan Rossiter"
|
445 |
-
msgstr "Dan Rossiter"
|
446 |
-
|
447 |
-
#. Author URI of the plugin/theme
|
448 |
-
msgid "http://danrossiter.org/"
|
449 |
-
msgstr "http://danrossiter.org/"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/document-gallery-uk_UA.mo
DELETED
Binary file
|
languages/document-gallery-uk_UA.po
DELETED
@@ -1,432 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Document Gallery
|
2 |
-
# This file is distributed under the same license as the Document Gallery package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Document Gallery 2.2\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/document-gallery\n"
|
7 |
-
"POT-Creation-Date: 2014-09-04 02:15:50+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2014-09-12 19:42-0600\n"
|
12 |
-
"Last-Translator: Dan Rossiter <dan.rossiters@gmail.com>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
"X-Generator: Poedit 1.6.9\n"
|
15 |
-
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
16 |
-
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
|
17 |
-
"Language: uk_UA\n"
|
18 |
-
|
19 |
-
#: admin/class-admin.php:28
|
20 |
-
msgid "General"
|
21 |
-
msgstr "Загальні"
|
22 |
-
|
23 |
-
#: admin/class-admin.php:29
|
24 |
-
msgid "Thumbnail Management"
|
25 |
-
msgstr "Керування мініатюрами"
|
26 |
-
|
27 |
-
#: admin/class-admin.php:30
|
28 |
-
msgid "Logging"
|
29 |
-
msgstr "Журнал подій"
|
30 |
-
|
31 |
-
#: admin/class-admin.php:31
|
32 |
-
msgid "Advanced"
|
33 |
-
msgstr "Для досвідчених користувачів"
|
34 |
-
|
35 |
-
#: admin/class-admin.php:68
|
36 |
-
msgid "Settings"
|
37 |
-
msgstr "Параметри"
|
38 |
-
|
39 |
-
#: admin/class-admin.php:78
|
40 |
-
msgid "Document Gallery Settings"
|
41 |
-
msgstr "Параметри Document Gallery"
|
42 |
-
|
43 |
-
#. Plugin Name of the plugin/theme
|
44 |
-
#: admin/class-admin.php:79
|
45 |
-
msgid "Document Gallery"
|
46 |
-
msgstr "Document Gallery"
|
47 |
-
|
48 |
-
#: admin/class-admin.php:124
|
49 |
-
msgid "Default Settings"
|
50 |
-
msgstr "Типові параметри"
|
51 |
-
|
52 |
-
#: admin/class-admin.php:128
|
53 |
-
msgid "Thumbnail Generation"
|
54 |
-
msgstr "Утворення мініатюр"
|
55 |
-
|
56 |
-
#: admin/class-admin.php:132
|
57 |
-
msgid "Custom CSS"
|
58 |
-
msgstr "Особисті CSS"
|
59 |
-
|
60 |
-
#: admin/class-admin.php:144
|
61 |
-
msgid "Link to attachment page rather than to file"
|
62 |
-
msgstr "Посилання на сторінку прикріпленого до запису файла, а не на сам файл"
|
63 |
-
|
64 |
-
#: admin/class-admin.php:156
|
65 |
-
msgid "Include document descriptions"
|
66 |
-
msgstr "Додавати описи документів"
|
67 |
-
|
68 |
-
#: admin/class-admin.php:168
|
69 |
-
msgid "Use auto-generated document thumbnails"
|
70 |
-
msgstr "Використовувати автоматично згенеровані мініатюри документів"
|
71 |
-
|
72 |
-
#: admin/class-admin.php:180
|
73 |
-
msgid "Include image attachments in gallery"
|
74 |
-
msgstr "Включати прикріплені до посту зображення в галерею"
|
75 |
-
|
76 |
-
#: admin/class-admin.php:192
|
77 |
-
msgid "Only look for attachments in post where [dg] is used"
|
78 |
-
msgstr "Шукати прикріплені файли лише у записах, де використовується [dg]"
|
79 |
-
|
80 |
-
#: admin/class-admin.php:205
|
81 |
-
msgid "Ascending or descending sorting of documents"
|
82 |
-
msgstr "Сортування документів за зростанням або за спаданням"
|
83 |
-
|
84 |
-
#: admin/class-admin.php:218
|
85 |
-
msgid "Which field to order documents by"
|
86 |
-
msgstr "За яким полем сортувати документи"
|
87 |
-
|
88 |
-
#: admin/class-admin.php:231
|
89 |
-
msgid ""
|
90 |
-
"Whether matched documents must have all taxa_names (AND) or at least one (OR)"
|
91 |
-
msgstr ""
|
92 |
-
"Шукати документи, що належать всім категоріям (AND) перерахованим в "
|
93 |
-
"параметрі category, також можливе використання taxon_name, або хоча б однієї "
|
94 |
-
"(OR)"
|
95 |
-
|
96 |
-
#: admin/class-admin.php:243
|
97 |
-
msgid "Locally generate thumbnails for audio & video files."
|
98 |
-
msgstr "Локально утворювати мініатюри для аудіо та відео файлів."
|
99 |
-
|
100 |
-
#: admin/class-admin.php:256
|
101 |
-
msgid ""
|
102 |
-
"Use <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
103 |
-
"a> for faster local PDF processing (compared to Imagick)."
|
104 |
-
msgstr ""
|
105 |
-
"Використовувати <a href=\"http://www.ghostscript.com/\" target=\"_blank"
|
106 |
-
"\">Ghostscript</a> для більш швидкої локальної обробки PDF (порівняно з "
|
107 |
-
"Imagick)."
|
108 |
-
|
109 |
-
#: admin/class-admin.php:257
|
110 |
-
msgid ""
|
111 |
-
"Your server is not configured to run <a href=\"http://www.ghostscript.com/\" "
|
112 |
-
"target=\"_blank\">Ghostscript</a>."
|
113 |
-
msgstr ""
|
114 |
-
"Ваш сервер не налаштований для використання <a href=\"http://www.ghostscript."
|
115 |
-
"com/\" target=\"_blank\">Ghostscript</a>."
|
116 |
-
|
117 |
-
#: admin/class-admin.php:271
|
118 |
-
msgid ""
|
119 |
-
"Use <a href=\"http://www.php.net/manual/en/book.imagick.php\" target=\"_blank"
|
120 |
-
"\">Imagick</a> to handle lots of filetypes locally."
|
121 |
-
msgstr ""
|
122 |
-
"Використовувати <a href=\"http://www.php.net/manual/en/book.imagick.php\" "
|
123 |
-
"target=\"_blank\">Imagick</a> для локальної обробки великої кількості типів "
|
124 |
-
"файлів."
|
125 |
-
|
126 |
-
#: admin/class-admin.php:272
|
127 |
-
msgid ""
|
128 |
-
"Your server is not configured to run <a href=\"http://www.php.net/manual/en/"
|
129 |
-
"book.imagick.php\" target=\"_blank\">Imagick</a>."
|
130 |
-
msgstr ""
|
131 |
-
"Ваш сервер не налаштований для використання <a href=\"http://www.php.net/"
|
132 |
-
"manual/en/book.imagick.php\" target=\"_blank\">Imagick</a>."
|
133 |
-
|
134 |
-
#: admin/class-admin.php:286
|
135 |
-
msgid ""
|
136 |
-
"Use <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
137 |
-
"Drive Viewer</a> to generate thumbnails for MS Office files and many other "
|
138 |
-
"file types remotely."
|
139 |
-
msgstr ""
|
140 |
-
"Використовувати <a href=\"https://drive.google.com/viewer\" target=\"_blank"
|
141 |
-
"\">Google Drive Viewer</a> для утворення мініатюр файлів MS Office та "
|
142 |
-
"багатьох інших типів файлів віддалено."
|
143 |
-
|
144 |
-
#: admin/class-admin.php:287
|
145 |
-
msgid "Your server does not allow remote HTTP access."
|
146 |
-
msgstr "Ваш сервер не дозволяє віддалені HTTP запити."
|
147 |
-
|
148 |
-
#: admin/class-admin.php:309
|
149 |
-
msgid "The max width and height (in pixels) that thumbnails will be generated."
|
150 |
-
msgstr ""
|
151 |
-
"Максимальна ширина і висота (у пікселях) з якими будуть утворюватися "
|
152 |
-
"мініатюри."
|
153 |
-
|
154 |
-
#: admin/class-admin.php:336
|
155 |
-
msgid "Advanced Thumbnail Generation"
|
156 |
-
msgstr "Утворення мініатюр"
|
157 |
-
|
158 |
-
#: admin/class-admin.php:348
|
159 |
-
msgid "Whether to log debug and error information related to Document Gallery."
|
160 |
-
msgstr ""
|
161 |
-
"Чи вести журнал налагоджування та інформації щодо помилок які мають "
|
162 |
-
"відношення до Document Gallery."
|
163 |
-
|
164 |
-
#: admin/class-admin.php:360
|
165 |
-
msgid ""
|
166 |
-
"Whether option structure should be validated before save. This is not "
|
167 |
-
"generally necessary."
|
168 |
-
msgstr ""
|
169 |
-
"Чи перевіряти структуру обраних налаштувань при збереженні. Як правило в "
|
170 |
-
"цьому нема потреби."
|
171 |
-
|
172 |
-
#: admin/class-admin.php:373
|
173 |
-
msgid ""
|
174 |
-
"Max number of seconds to wait for thumbnail generation before defaulting to "
|
175 |
-
"filetype icons."
|
176 |
-
msgstr ""
|
177 |
-
"Максимальна кількість секунд очікування при утворенні мініатюри до "
|
178 |
-
"використання іконки за замовчуванням."
|
179 |
-
|
180 |
-
#: admin/class-admin.php:374
|
181 |
-
msgid ""
|
182 |
-
"Note that generation will continue where timeout happened next time the "
|
183 |
-
"gallery is loaded."
|
184 |
-
msgstr ""
|
185 |
-
"Зверніть увагу, що утворення продовжиться з того місця, де воно було "
|
186 |
-
"призупинене, при наступному зверненні до галереї."
|
187 |
-
|
188 |
-
#: admin/class-admin.php:386
|
189 |
-
msgid "Successfully auto-detected the location of Ghostscript."
|
190 |
-
msgstr "Успішно автоматично визначено місцезнаходження Ghostscript."
|
191 |
-
|
192 |
-
#: admin/class-admin.php:387
|
193 |
-
msgid "Failed to auto-detect the location of Ghostscript."
|
194 |
-
msgstr "Не вдалося автоматично визначити місцезнаходження Ghostscript."
|
195 |
-
|
196 |
-
#: admin/class-admin.php:391
|
197 |
-
msgid "Options Array Dump"
|
198 |
-
msgstr "Дамп масиву обраних налаштувань"
|
199 |
-
|
200 |
-
#: admin/class-admin.php:438
|
201 |
-
msgid "Invalid width given: "
|
202 |
-
msgstr "Задана невірна ширина: "
|
203 |
-
|
204 |
-
#: admin/class-admin.php:451
|
205 |
-
msgid "Invalid height given: "
|
206 |
-
msgstr "Задана невірна висота: "
|
207 |
-
|
208 |
-
#: admin/class-admin.php:562
|
209 |
-
msgid "Invalid Ghostscript path given: "
|
210 |
-
msgstr "Задано невірний шлях Ghostscript: "
|
211 |
-
|
212 |
-
#: admin/class-admin.php:573
|
213 |
-
msgid "Invalid timeout given: "
|
214 |
-
msgstr "Задано невірний час очікування: "
|
215 |
-
|
216 |
-
#: admin/class-admin.php:604
|
217 |
-
msgid ""
|
218 |
-
"The following values will be used by default in the shortcode. You can still "
|
219 |
-
"manually set each of these values in each individual shortcode."
|
220 |
-
msgstr ""
|
221 |
-
"Наступні значення будуть використовуватися шорткодом [dg] як типові. При "
|
222 |
-
"цьому вручну можна встановити будь-які з цих значень в кожному конкретному "
|
223 |
-
"екземплярі шорткоду."
|
224 |
-
|
225 |
-
#: admin/class-admin.php:611
|
226 |
-
msgid "Select which tools to use when generating thumbnails."
|
227 |
-
msgstr "Оберіть, які інструменти використовувати для утворення мініатюр."
|
228 |
-
|
229 |
-
#: admin/class-admin.php:620
|
230 |
-
#, c-format
|
231 |
-
msgid ""
|
232 |
-
"Enter custom CSS styling for use with document galleries. To see which ids "
|
233 |
-
"and classes you can style, take a look at <a href=\"%s\" target=\"_blank"
|
234 |
-
"\">style.css</a>."
|
235 |
-
msgstr ""
|
236 |
-
"Внесіть особисті CSS стилі для використання з галереями документів. Щоб "
|
237 |
-
"побачити, які селектори варто використовувати, зверніть увагу на <a href=\"%s"
|
238 |
-
"\" target=\"_blank\">style.css</a>."
|
239 |
-
|
240 |
-
#: admin/class-admin.php:640
|
241 |
-
msgid ""
|
242 |
-
"Unless you <em>really</em> know what you're doing, you should not touch "
|
243 |
-
"these values."
|
244 |
-
msgstr ""
|
245 |
-
"Не варто міняти цих значень, за винятком випадків коли Ви <em>насправді</em> "
|
246 |
-
"знаєте що робите."
|
247 |
-
|
248 |
-
#: admin/class-admin.php:643
|
249 |
-
msgid ""
|
250 |
-
"NOTE: <code>exec()</code> is not accessible. Ghostscript will not function."
|
251 |
-
msgstr "УВАГА: <code>exec()</code> недосяжний. Ghostscript не працюватиме."
|
252 |
-
|
253 |
-
#: admin/class-admin.php:654
|
254 |
-
msgid ""
|
255 |
-
"The following <em>readonly text</em> should be provided when <a href="
|
256 |
-
"\"http://wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
257 |
-
"\">reporting a bug</a>:"
|
258 |
-
msgstr ""
|
259 |
-
"Наведений нижче <em>доступний тільки для читання текст</em> має бути наданий "
|
260 |
-
"при <a href=\"http://wordpress.org/support/plugin/document-gallery\" target="
|
261 |
-
"\"_blank\">повідомленні про помилку</a>:"
|
262 |
-
|
263 |
-
#: admin/class-admin.php:755
|
264 |
-
msgid "Select All"
|
265 |
-
msgstr "Вибрати всі"
|
266 |
-
|
267 |
-
#: admin/class-admin.php:758
|
268 |
-
msgid "Thumbnail"
|
269 |
-
msgstr "Мініатюра"
|
270 |
-
|
271 |
-
#: admin/class-admin.php:759
|
272 |
-
msgid "File name"
|
273 |
-
msgstr "Назва файла"
|
274 |
-
|
275 |
-
#: admin/class-admin.php:760
|
276 |
-
msgid "Date"
|
277 |
-
msgstr "Дата"
|
278 |
-
|
279 |
-
#: admin/class-admin.php:763
|
280 |
-
msgid "Delete Selected"
|
281 |
-
msgstr "Вилучити вибрані"
|
282 |
-
|
283 |
-
#: admin/class-admin.php:765
|
284 |
-
msgid "item"
|
285 |
-
msgid_plural "items"
|
286 |
-
msgstr[0] "елемент"
|
287 |
-
msgstr[1] "елемента"
|
288 |
-
msgstr[2] "елементів"
|
289 |
-
|
290 |
-
#: admin/class-admin.php:768
|
291 |
-
msgid "Go to the first page"
|
292 |
-
msgstr "Перейти до першої сторінки"
|
293 |
-
|
294 |
-
#: admin/class-admin.php:769
|
295 |
-
msgid "Go to the previous page"
|
296 |
-
msgstr "Перейти до попередньої сторінки"
|
297 |
-
|
298 |
-
#: admin/class-admin.php:771
|
299 |
-
msgid "Current page"
|
300 |
-
msgstr "Поточна сторінка"
|
301 |
-
|
302 |
-
#: admin/class-admin.php:771
|
303 |
-
msgid "of"
|
304 |
-
msgstr "з"
|
305 |
-
|
306 |
-
#: admin/class-admin.php:772
|
307 |
-
msgid "Go to the next page"
|
308 |
-
msgstr "Перейти до наступної сторінки"
|
309 |
-
|
310 |
-
#: admin/class-admin.php:773
|
311 |
-
msgid "Go to the last page"
|
312 |
-
msgstr "Перейти до останньої сторінки"
|
313 |
-
|
314 |
-
#: admin/class-admin.php:775
|
315 |
-
msgid "items per page"
|
316 |
-
msgstr "елементів на сторінці"
|
317 |
-
|
318 |
-
#: admin/class-admin.php:808
|
319 |
-
msgid "View"
|
320 |
-
msgstr "Переглянути сторінку вкладення"
|
321 |
-
|
322 |
-
#: admin/class-admin.php:809
|
323 |
-
msgid "attachment page"
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: admin/class-admin.php:809
|
327 |
-
msgid "Attachment not found"
|
328 |
-
msgstr "Вкладення не знайдено"
|
329 |
-
|
330 |
-
#: inc/class-gallery.php:85
|
331 |
-
msgid "Generated using Document Gallery. Get yours here: "
|
332 |
-
msgstr ""
|
333 |
-
"Згенеровано використовуючи Document Gallery. Сподобалось? Отримайте Вашу "
|
334 |
-
"копію тут: "
|
335 |
-
|
336 |
-
#: inc/class-gallery.php:88
|
337 |
-
msgid "No attachments to display. How boring! :("
|
338 |
-
msgstr "Жодного вкладення для відображення. Нудьга! :("
|
339 |
-
|
340 |
-
#: inc/class-gallery.php:89
|
341 |
-
#, c-format
|
342 |
-
msgid "The %s parameter may only be \"%s\" or \"%s.\" You entered \"%s.\""
|
343 |
-
msgstr ""
|
344 |
-
"Параметр %s може приймати тільки значення \"%s\" або \"%s.\" Ви ж ввели \"%s."
|
345 |
-
"\""
|
346 |
-
|
347 |
-
#: inc/class-gallery.php:285
|
348 |
-
msgid "The following ID is invalid: "
|
349 |
-
msgid_plural "The following IDs are invalid: "
|
350 |
-
msgstr[0] "Наступний ідентифікатор (ID) недійсний: "
|
351 |
-
msgstr[1] "Наступні ідентифікатори (IDs) недійсні: "
|
352 |
-
msgstr[2] "Наступні ідентифікатори (IDs) недійсні: "
|
353 |
-
|
354 |
-
#: inc/class-gallery.php:378
|
355 |
-
#, c-format
|
356 |
-
msgid "The orderby value entered, \"%s,\" is not valid."
|
357 |
-
msgstr "Задане значення параметра orderby, \"%s,\" неприпустиме."
|
358 |
-
|
359 |
-
#: inc/class-gallery.php:532
|
360 |
-
#, c-format
|
361 |
-
msgid "%s is not a valid term name in %s."
|
362 |
-
msgstr "%s не є припустимим значенням параметра %s."
|
363 |
-
|
364 |
-
#: inc/class-image-editor-imagick.php:37
|
365 |
-
msgid "Failed to set Imagick page number"
|
366 |
-
msgstr "Не вдалося встановити номер сторінки в Imagick"
|
367 |
-
|
368 |
-
#: inc/class-thumber.php:59
|
369 |
-
#, c-format
|
370 |
-
msgid "Attempting to generate thumbnail for attachment #%d with '%s'"
|
371 |
-
msgstr "Спроба утворення мініатюри для вкладення №%d за допомоги '%s'"
|
372 |
-
|
373 |
-
#: inc/class-thumber.php:138
|
374 |
-
msgid "Could not open file: "
|
375 |
-
msgstr "Не вдалося відкрити файл: "
|
376 |
-
|
377 |
-
#: inc/class-thumber.php:143
|
378 |
-
msgid "Could not write file: "
|
379 |
-
msgstr "Не вдалося записати файл: "
|
380 |
-
|
381 |
-
#: inc/class-thumber.php:180
|
382 |
-
msgid "Failed to open file in Imagick: "
|
383 |
-
msgstr "Не вдалося відкрити файл в Imagick: "
|
384 |
-
|
385 |
-
#: inc/class-thumber.php:191
|
386 |
-
msgid "Failed to save image in Imagick: "
|
387 |
-
msgstr "Не вдалося зберегти зображення в Imagick: "
|
388 |
-
|
389 |
-
#: inc/class-thumber.php:249
|
390 |
-
msgid "Ghostscript failed: "
|
391 |
-
msgstr "Ghostscript вийшов із ладу: "
|
392 |
-
|
393 |
-
#: inc/class-thumber.php:387
|
394 |
-
msgid "Failed to retrieve thumbnail from Google: "
|
395 |
-
msgstr "Не вдалося отримати від Google мініатюру: "
|
396 |
-
|
397 |
-
#: inc/class-thumber.php:631
|
398 |
-
msgid "Thumbnail Generators: "
|
399 |
-
msgstr "Генератори мініатюр: "
|
400 |
-
|
401 |
-
#: inc/class-thumber.php:636
|
402 |
-
msgid "No thumbnail generators enabled."
|
403 |
-
msgstr "Відсутні підключені генератори мініатюр."
|
404 |
-
|
405 |
-
#: inc/class-thumber.php:679
|
406 |
-
msgid "Failed to get image editor: "
|
407 |
-
msgstr ""
|
408 |
-
"Невдача при спробі використання графічного редактора (WP_Image_Editor): "
|
409 |
-
|
410 |
-
#: inc/class-thumber.php:691
|
411 |
-
msgid "Failed to save image: "
|
412 |
-
msgstr "Не вдалося зберегти зображення: "
|
413 |
-
|
414 |
-
#. Plugin URI of the plugin/theme
|
415 |
-
msgid "http://wordpress.org/extend/plugins/document-gallery/"
|
416 |
-
msgstr "http://wordpress.org/extend/plugins/document-gallery/"
|
417 |
-
|
418 |
-
#. Description of the plugin/theme
|
419 |
-
msgid ""
|
420 |
-
"Display non-images (and images) in gallery format on a page or post with the "
|
421 |
-
"[dg] shortcode."
|
422 |
-
msgstr ""
|
423 |
-
"Відображення не-зображень (а також зображень) у вигляді галерей на сторінках "
|
424 |
-
"та в записах за допомогою шорткоду [dg]."
|
425 |
-
|
426 |
-
#. Author of the plugin/theme
|
427 |
-
msgid "Dan Rossiter"
|
428 |
-
msgstr "Dan Rossiter"
|
429 |
-
|
430 |
-
#. Author URI of the plugin/theme
|
431 |
-
msgid "http://danrossiter.org/"
|
432 |
-
msgstr "http://danrossiter.org/"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/document-gallery.pot
DELETED
@@ -1,414 +0,0 @@
|
|
1 |
-
# Copyright (C) 2014 Document Gallery
|
2 |
-
# This file is distributed under the same license as the Document Gallery package.
|
3 |
-
msgid ""
|
4 |
-
msgstr ""
|
5 |
-
"Project-Id-Version: Document Gallery 2.2.5\n"
|
6 |
-
"Report-Msgid-Bugs-To: http://wordpress.org/tag/document-gallery\n"
|
7 |
-
"POT-Creation-Date: 2014-10-17 04:20:59+00:00\n"
|
8 |
-
"MIME-Version: 1.0\n"
|
9 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
-
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
|
12 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
-
|
15 |
-
#: admin/class-admin.php:28
|
16 |
-
msgid "General"
|
17 |
-
msgstr ""
|
18 |
-
|
19 |
-
#: admin/class-admin.php:29
|
20 |
-
msgid "Thumbnail Management"
|
21 |
-
msgstr ""
|
22 |
-
|
23 |
-
#: admin/class-admin.php:30 admin/class-admin.php:898
|
24 |
-
msgid "Logging"
|
25 |
-
msgstr ""
|
26 |
-
|
27 |
-
#: admin/class-admin.php:31
|
28 |
-
msgid "Advanced"
|
29 |
-
msgstr ""
|
30 |
-
|
31 |
-
#: admin/class-admin.php:68
|
32 |
-
msgid "Settings"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: admin/class-admin.php:78
|
36 |
-
msgid "Document Gallery Settings"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#. #-#-#-#-# plugin.pot (Document Gallery 2.2.5) #-#-#-#-#
|
40 |
-
#. Plugin Name of the plugin/theme
|
41 |
-
#: admin/class-admin.php:79
|
42 |
-
msgid "Document Gallery"
|
43 |
-
msgstr ""
|
44 |
-
|
45 |
-
#: admin/class-admin.php:124
|
46 |
-
msgid "Default Settings"
|
47 |
-
msgstr ""
|
48 |
-
|
49 |
-
#: admin/class-admin.php:128
|
50 |
-
msgid "Thumbnail Generation"
|
51 |
-
msgstr ""
|
52 |
-
|
53 |
-
#: admin/class-admin.php:132
|
54 |
-
msgid "Custom CSS"
|
55 |
-
msgstr ""
|
56 |
-
|
57 |
-
#: admin/class-admin.php:144
|
58 |
-
msgid "Link to attachment page rather than to file"
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: admin/class-admin.php:156
|
62 |
-
msgid "Include document descriptions"
|
63 |
-
msgstr ""
|
64 |
-
|
65 |
-
#: admin/class-admin.php:168
|
66 |
-
msgid "Use auto-generated document thumbnails"
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: admin/class-admin.php:180
|
70 |
-
msgid "Include image attachments in gallery"
|
71 |
-
msgstr ""
|
72 |
-
|
73 |
-
#: admin/class-admin.php:192
|
74 |
-
msgid "Only look for attachments in post where [dg] is used"
|
75 |
-
msgstr ""
|
76 |
-
|
77 |
-
#: admin/class-admin.php:205
|
78 |
-
msgid "Ascending or descending sorting of documents"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: admin/class-admin.php:218
|
82 |
-
msgid "Which field to order documents by"
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: admin/class-admin.php:231
|
86 |
-
msgid ""
|
87 |
-
"Whether matched documents must have all taxa_names (AND) or at least one (OR)"
|
88 |
-
msgstr ""
|
89 |
-
|
90 |
-
#: admin/class-admin.php:243
|
91 |
-
msgid "Locally generate thumbnails for audio & video files."
|
92 |
-
msgstr ""
|
93 |
-
|
94 |
-
#: admin/class-admin.php:256
|
95 |
-
msgid ""
|
96 |
-
"Use <a href=\"http://www.ghostscript.com/\" target=\"_blank\">Ghostscript</"
|
97 |
-
"a> for faster local PDF processing (compared to Imagick)."
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: admin/class-admin.php:257
|
101 |
-
msgid ""
|
102 |
-
"Your server is not configured to run <a href=\"http://www.ghostscript.com/\" "
|
103 |
-
"target=\"_blank\">Ghostscript</a>."
|
104 |
-
msgstr ""
|
105 |
-
|
106 |
-
#: admin/class-admin.php:271
|
107 |
-
msgid ""
|
108 |
-
"Use <a href=\"http://www.php.net/manual/en/book.imagick.php\" target=\"_blank"
|
109 |
-
"\">Imagick</a> to handle lots of filetypes locally."
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#: admin/class-admin.php:272
|
113 |
-
msgid ""
|
114 |
-
"Your server is not configured to run <a href=\"http://www.php.net/manual/en/"
|
115 |
-
"book.imagick.php\" target=\"_blank\">Imagick</a>."
|
116 |
-
msgstr ""
|
117 |
-
|
118 |
-
#: admin/class-admin.php:286
|
119 |
-
msgid ""
|
120 |
-
"Use <a href=\"https://drive.google.com/viewer\" target=\"_blank\">Google "
|
121 |
-
"Drive Viewer</a> to generate thumbnails for MS Office files and many other "
|
122 |
-
"file types remotely."
|
123 |
-
msgstr ""
|
124 |
-
|
125 |
-
#: admin/class-admin.php:287
|
126 |
-
msgid "Your server does not allow remote HTTP access."
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
#: admin/class-admin.php:309
|
130 |
-
msgid "The max width and height (in pixels) that thumbnails will be generated."
|
131 |
-
msgstr ""
|
132 |
-
|
133 |
-
#: admin/class-admin.php:338
|
134 |
-
msgid "Advanced Thumbnail Generation"
|
135 |
-
msgstr ""
|
136 |
-
|
137 |
-
#: admin/class-admin.php:350
|
138 |
-
msgid "Whether to log debug and error information related to Document Gallery."
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: admin/class-admin.php:362
|
142 |
-
msgid ""
|
143 |
-
"Whether option structure should be validated before save. This is not "
|
144 |
-
"generally necessary."
|
145 |
-
msgstr ""
|
146 |
-
|
147 |
-
#: admin/class-admin.php:375
|
148 |
-
msgid ""
|
149 |
-
"Max number of seconds to wait for thumbnail generation before defaulting to "
|
150 |
-
"filetype icons."
|
151 |
-
msgstr ""
|
152 |
-
|
153 |
-
#: admin/class-admin.php:376
|
154 |
-
msgid ""
|
155 |
-
"Note that generation will continue where timeout happened next time the "
|
156 |
-
"gallery is loaded."
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: admin/class-admin.php:388
|
160 |
-
msgid "Successfully auto-detected the location of Ghostscript."
|
161 |
-
msgstr ""
|
162 |
-
|
163 |
-
#: admin/class-admin.php:389
|
164 |
-
msgid "Failed to auto-detect the location of Ghostscript."
|
165 |
-
msgstr ""
|
166 |
-
|
167 |
-
#: admin/class-admin.php:393
|
168 |
-
msgid "Options Array Dump"
|
169 |
-
msgstr ""
|
170 |
-
|
171 |
-
#: admin/class-admin.php:440
|
172 |
-
msgid "Invalid width given: "
|
173 |
-
msgstr ""
|
174 |
-
|
175 |
-
#: admin/class-admin.php:453
|
176 |
-
msgid "Invalid height given: "
|
177 |
-
msgstr ""
|
178 |
-
|
179 |
-
#: admin/class-admin.php:566
|
180 |
-
msgid "Invalid Ghostscript path given: "
|
181 |
-
msgstr ""
|
182 |
-
|
183 |
-
#: admin/class-admin.php:577
|
184 |
-
msgid "Invalid timeout given: "
|
185 |
-
msgstr ""
|
186 |
-
|
187 |
-
#: admin/class-admin.php:608
|
188 |
-
msgid ""
|
189 |
-
"The following values will be used by default in the shortcode. You can still "
|
190 |
-
"manually set each of these values in each individual shortcode."
|
191 |
-
msgstr ""
|
192 |
-
|
193 |
-
#: admin/class-admin.php:615
|
194 |
-
msgid "Select which tools to use when generating thumbnails."
|
195 |
-
msgstr ""
|
196 |
-
|
197 |
-
#: admin/class-admin.php:624
|
198 |
-
msgid ""
|
199 |
-
"Enter custom CSS styling for use with document galleries. To see which ids "
|
200 |
-
"and classes you can style, take a look at <a href=\"%s\" target=\"_blank"
|
201 |
-
"\">style.css</a>."
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
#: admin/class-admin.php:642
|
205 |
-
msgid ""
|
206 |
-
"Unless you <em>really</em> know what you're doing, you should not touch "
|
207 |
-
"these values."
|
208 |
-
msgstr ""
|
209 |
-
|
210 |
-
#: admin/class-admin.php:645
|
211 |
-
msgid ""
|
212 |
-
"NOTE: <code>exec()</code> is not accessible. Ghostscript will not function."
|
213 |
-
msgstr ""
|
214 |
-
|
215 |
-
#: admin/class-admin.php:656
|
216 |
-
msgid ""
|
217 |
-
"The following <em>readonly text</em> should be provided when <a href="
|
218 |
-
"\"http://wordpress.org/support/plugin/document-gallery\" target=\"_blank"
|
219 |
-
"\">reporting a bug</a>:"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
-
#: admin/class-admin.php:757
|
223 |
-
msgid "Select All"
|
224 |
-
msgstr ""
|
225 |
-
|
226 |
-
#: admin/class-admin.php:760
|
227 |
-
msgid "Thumbnail"
|
228 |
-
msgstr ""
|
229 |
-
|
230 |
-
#: admin/class-admin.php:761
|
231 |
-
msgid "File name"
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: admin/class-admin.php:762 admin/class-admin.php:834
|
235 |
-
msgid "Date"
|
236 |
-
msgstr ""
|
237 |
-
|
238 |
-
#: admin/class-admin.php:765
|
239 |
-
msgid "Delete Selected"
|
240 |
-
msgstr ""
|
241 |
-
|
242 |
-
#: admin/class-admin.php:767
|
243 |
-
msgid "item"
|
244 |
-
msgid_plural "items"
|
245 |
-
msgstr[0] ""
|
246 |
-
msgstr[1] ""
|
247 |
-
|
248 |
-
#: admin/class-admin.php:770
|
249 |
-
msgid "Go to the first page"
|
250 |
-
msgstr ""
|
251 |
-
|
252 |
-
#: admin/class-admin.php:771
|
253 |
-
msgid "Go to the previous page"
|
254 |
-
msgstr ""
|
255 |
-
|
256 |
-
#: admin/class-admin.php:773
|
257 |
-
msgid "Current page"
|
258 |
-
msgstr ""
|
259 |
-
|
260 |
-
#: admin/class-admin.php:773
|
261 |
-
msgid "of"
|
262 |
-
msgstr ""
|
263 |
-
|
264 |
-
#: admin/class-admin.php:774
|
265 |
-
msgid "Go to the next page"
|
266 |
-
msgstr ""
|
267 |
-
|
268 |
-
#: admin/class-admin.php:775
|
269 |
-
msgid "Go to the last page"
|
270 |
-
msgstr ""
|
271 |
-
|
272 |
-
#: admin/class-admin.php:777
|
273 |
-
msgid "items per page"
|
274 |
-
msgstr ""
|
275 |
-
|
276 |
-
#: admin/class-admin.php:815
|
277 |
-
msgid "View"
|
278 |
-
msgstr ""
|
279 |
-
|
280 |
-
#: admin/class-admin.php:816
|
281 |
-
msgid "attachment page"
|
282 |
-
msgstr ""
|
283 |
-
|
284 |
-
#: admin/class-admin.php:816
|
285 |
-
msgid "Attachment not found"
|
286 |
-
msgstr ""
|
287 |
-
|
288 |
-
#: admin/class-admin.php:835
|
289 |
-
msgid "Level"
|
290 |
-
msgstr ""
|
291 |
-
|
292 |
-
#: admin/class-admin.php:836
|
293 |
-
msgid "Message"
|
294 |
-
msgstr ""
|
295 |
-
|
296 |
-
#: admin/class-admin.php:845
|
297 |
-
msgid "Expand All"
|
298 |
-
msgstr ""
|
299 |
-
|
300 |
-
#: admin/class-admin.php:848
|
301 |
-
msgid "Collapse All"
|
302 |
-
msgstr ""
|
303 |
-
|
304 |
-
#: admin/class-admin.php:891
|
305 |
-
msgid "Clear Log"
|
306 |
-
msgstr ""
|
307 |
-
|
308 |
-
#: admin/class-admin.php:898
|
309 |
-
msgid "There are no log entries at this time."
|
310 |
-
msgstr ""
|
311 |
-
|
312 |
-
#: admin/class-admin.php:898
|
313 |
-
msgid "For Your information:"
|
314 |
-
msgstr ""
|
315 |
-
|
316 |
-
#: admin/class-admin.php:898
|
317 |
-
msgid "is turned ON"
|
318 |
-
msgstr ""
|
319 |
-
|
320 |
-
#: admin/class-admin.php:898
|
321 |
-
msgid "is turned OFF"
|
322 |
-
msgstr ""
|
323 |
-
|
324 |
-
#: inc/class-gallery.php:86
|
325 |
-
msgid "Generated using Document Gallery. Get yours here: "
|
326 |
-
msgstr ""
|
327 |
-
|
328 |
-
#: inc/class-gallery.php:88
|
329 |
-
msgid "No attachments to display. How boring! :("
|
330 |
-
msgstr ""
|
331 |
-
|
332 |
-
#: inc/class-gallery.php:89
|
333 |
-
msgid "The %s parameter may only be \"%s\" or \"%s.\" You entered \"%s.\""
|
334 |
-
msgstr ""
|
335 |
-
|
336 |
-
#: inc/class-gallery.php:286
|
337 |
-
msgid "The following ID is invalid: "
|
338 |
-
msgid_plural "The following IDs are invalid: "
|
339 |
-
msgstr[0] ""
|
340 |
-
msgstr[1] ""
|
341 |
-
|
342 |
-
#: inc/class-gallery.php:379
|
343 |
-
msgid "The orderby value entered, \"%s,\" is not valid."
|
344 |
-
msgstr ""
|
345 |
-
|
346 |
-
#: inc/class-gallery.php:533
|
347 |
-
msgid "%s is not a valid term name in %s."
|
348 |
-
msgstr ""
|
349 |
-
|
350 |
-
#: inc/class-image-editor-imagick.php:37
|
351 |
-
msgid "Failed to set Imagick page number"
|
352 |
-
msgstr ""
|
353 |
-
|
354 |
-
#: inc/class-thumber.php:59
|
355 |
-
msgid "Attempting to generate thumbnail for attachment #%d with (%s)"
|
356 |
-
msgstr ""
|
357 |
-
|
358 |
-
#: inc/class-thumber.php:138
|
359 |
-
msgid "Could not open file: "
|
360 |
-
msgstr ""
|
361 |
-
|
362 |
-
#: inc/class-thumber.php:143
|
363 |
-
msgid "Could not write file: "
|
364 |
-
msgstr ""
|
365 |
-
|
366 |
-
#: inc/class-thumber.php:180
|
367 |
-
msgid "Failed to open file in Imagick: "
|
368 |
-
msgstr ""
|
369 |
-
|
370 |
-
#: inc/class-thumber.php:191
|
371 |
-
msgid "Failed to save image in Imagick: "
|
372 |
-
msgstr ""
|
373 |
-
|
374 |
-
#: inc/class-thumber.php:249
|
375 |
-
msgid "Ghostscript failed: "
|
376 |
-
msgstr ""
|
377 |
-
|
378 |
-
#: inc/class-thumber.php:387
|
379 |
-
msgid "Failed to retrieve thumbnail from Google: "
|
380 |
-
msgstr ""
|
381 |
-
|
382 |
-
#: inc/class-thumber.php:631
|
383 |
-
msgid "Thumbnail Generators: "
|
384 |
-
msgstr ""
|
385 |
-
|
386 |
-
#: inc/class-thumber.php:642
|
387 |
-
msgid "No thumbnail generators enabled."
|
388 |
-
msgstr ""
|
389 |
-
|
390 |
-
#: inc/class-thumber.php:685
|
391 |
-
msgid "Failed to get image editor: "
|
392 |
-
msgstr ""
|
393 |
-
|
394 |
-
#: inc/class-thumber.php:697
|
395 |
-
msgid "Failed to save image: "
|
396 |
-
msgstr ""
|
397 |
-
|
398 |
-
#. Plugin URI of the plugin/theme
|
399 |
-
msgid "http://wordpress.org/extend/plugins/document-gallery/"
|
400 |
-
msgstr ""
|
401 |
-
|
402 |
-
#. Description of the plugin/theme
|
403 |
-
msgid ""
|
404 |
-
"Display non-images (and images) in gallery format on a page or post with the "
|
405 |
-
"[dg] shortcode."
|
406 |
-
msgstr ""
|
407 |
-
|
408 |
-
#. Author of the plugin/theme
|
409 |
-
msgid "Dan Rossiter"
|
410 |
-
msgstr ""
|
411 |
-
|
412 |
-
#. Author URI of the plugin/theme
|
413 |
-
msgid "http://danrossiter.org/"
|
414 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log/.htaccess
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
<FilesMatch "\.(htaccess|log)$">
|
2 |
-
Order Allow,Deny
|
3 |
-
Deny from all
|
4 |
-
</FilesMatch>
|
|
|
|
|
|
|
|
readme.txt
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: dan.rossiter
|
3 |
+
Tags: documents, gallery
|
4 |
+
Requires at least: 2.6
|
5 |
+
Stable tag: 0.8.5
|
6 |
+
License: GPLv2 or later
|
7 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
8 |
+
|
9 |
+
This plugin allows the user to easily include documents (ie: PDF, MS Word, MS PowerPoint, MS Excel, and ZIP files)
|
10 |
+
directly into their page or post.
|
11 |
+
|
12 |
+
== Installation ==
|
13 |
+
|
14 |
+
1. Upload `document-gallery` to the `/wp-content/plugins/` directory
|
15 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress
|
16 |
+
1. Place `[document gallery]` in any posts or pages you want a document gallery included. See below for additional display options.
|
17 |
+
|
18 |
+
= Document Gallery Options =
|
19 |
+
|
20 |
+
In order to include all compatible docuements from a given page or post, you must include
|
21 |
+
the following shortcode in the post:
|
22 |
+
|
23 |
+
`[document gallery <descriptions=[true or false]> <orderby=[menu_order, date, rand]> <order=[ASC or DEC]>]`
|
24 |
+
|
25 |
+
Using just `[document gallery]` is equivalent to `[document gallery descriptions=false orderby=menu_order order=ASC]`.
|
26 |
+
|
27 |
+
== Screenshots ==
|
28 |
+
|
29 |
+
1. This is how the Document Gallery looks with `descriptions=false` (default). Note that the display inherits styling from your active theme.
|
30 |
+
2. This is how the Document Gallery looks with `descriptions=true`. The descriptions are auto-populated using the description field from when you upload the document.
|
31 |
+
|
32 |
+
== Changelog ==
|
33 |
+
|
34 |
+
= 0.8.5 =
|
35 |
+
* Added support for [OpenDocuments](http://en.wikipedia.org/wiki/OpenDocument) (does not include the graphic files within OpenDocument standards because this would not fit the document focus of this plugin)
|
36 |
+
|
37 |
+
= 0.8 =
|
38 |
+
* First public release of Document Gallery.
|
39 |
+
* Displays PDF, Word, PowerPoint, Excel, and ZIP documents from a given page or post.
|
40 |
+
* Documents can be ordered by a number of different factors.
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
DELETED
Binary file
|
style.css
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.documentIcons{ text-align: center; }
|
2 |
+
|
3 |
+
.documentIcons img{
|
4 |
+
border: none;
|
5 |
+
}
|
6 |
+
|
7 |
+
.documentIcons a{
|
8 |
+
font-size: 10px;
|
9 |
+
line-height: 12px;
|
10 |
+
}
|
11 |
+
|
12 |
+
/* WITHOUT DESCRIPTION */
|
13 |
+
div.documentIcons{
|
14 |
+
float: left;
|
15 |
+
min-height: 125px;
|
16 |
+
max-height: 145px;
|
17 |
+
overflow: hidden;
|
18 |
+
padding: 10px 0;
|
19 |
+
width: 25%;
|
20 |
+
}
|
21 |
+
div#documentIconsWrapper hr{
|
22 |
+
border: none;
|
23 |
+
width: 100%;
|
24 |
+
height: 0;
|
25 |
+
padding: 0;
|
26 |
+
margin: 0;
|
27 |
+
}
|
28 |
+
/* END WITHOUT DESCRIPTION */
|
29 |
+
|
30 |
+
/* WITH DESCRIPTION */
|
31 |
+
td.documentIcons{ width: 115px; }
|
32 |
+
table#documentIconsWrapper{ border-collapse: collapse; }
|
33 |
+
|
34 |
+
table#documentIconsWrapper,
|
35 |
+
table#documentIconsWrapper tbody,
|
36 |
+
table#documentIconsWrapper tr,
|
37 |
+
table#documentIconsWrapper p{
|
38 |
+
width: 100%;
|
39 |
+
padding: 0;
|
40 |
+
margin: 0;
|
41 |
+
border: none;
|
42 |
+
}
|
43 |
+
|
44 |
+
table#documentIconsWrapper td{
|
45 |
+
padding: 5px 4px 3px;
|
46 |
+
vertical-align: middle;
|
47 |
+
}
|
48 |
+
|
49 |
+
table .documentIcons img{
|
50 |
+
width: 65px;
|
51 |
+
height: 65px;
|
52 |
+
}
|
53 |
+
/* END WITH DESCRIPTION */
|