Révision 13755f8d
Ajouté par Benjamin Luce il y a presque 9 ans
drupal7/sites/all/modules/ddblock/CHANGELOG.txt | ||
---|---|---|
1 |
/* |
|
2 |
* Change Log for ddblock module |
|
3 |
*/ |
|
4 |
2011-OCT-17 |
|
5 |
#1258820 fix timeout of 0 not used |
|
6 |
#1258820 fix speed of 0 not used |
|
7 |
#1258780 use custom.substr(0,1) instead of custom[0] to compare first character to prevent error in IE7 |
|
8 |
Check if scrollable pager element is available before using jquery methods on the object |
|
9 |
Add option to use scrollable pager 70, 80 and 90 in ddblock.admin.js |
|
10 |
|
|
11 |
2011-JUL-25 |
|
12 |
Adjust readme.txt |
|
13 |
|
|
14 |
2011-JUL-23 |
|
15 |
#1226554 fix pause on hover always used in basic options |
|
16 |
|
|
17 |
2011-JUL-18 |
|
18 |
Add easing support for slide and slidetext using jquery UI |
|
19 |
#1190082 improve help text for choosing content types |
|
20 |
add nr_of_items functionality for custom pager |
|
21 |
adjust nr_of_items help text |
|
22 |
improve help text for before and after effects |
|
23 |
Cycle plugin now via libraries |
|
24 |
|
|
25 |
2011-FEB-14 |
|
26 |
#1058868 Adjust install.txt |
|
27 |
bug-fix Add pagerPosition to javascript settings for horizontal/vertical scrollable pager |
|
28 |
bug-fix Add pager_toggle to variables given to content template file to toggle the pager on/off |
|
29 |
bug-fix add hyphen (-) to mask for finding size-xxx files |
|
30 |
|
|
31 |
2011-FEB-11 |
|
32 |
#1049556 fix delete of blocks |
|
33 |
#1053996 fix warnings when no images |
|
34 |
#1055048 fix remove extra slide div not closed |
|
35 |
#1054488 fix remove extra commit button on config page |
|
36 |
|
|
37 |
2011-JAN-29 |
|
38 |
Fixed redirects after forms are submitted |
|
39 |
Rename function _dir_scan_directory to _ddblock_dir_scan_directory |
|
40 |
Fixed Notice: Undefined property: stdClass::$ddblock_enabled on delete form |
|
41 |
Fixed db_affected_rows() does not exist anymore in Drupal 7 |
|
42 |
Cleanup CHANGELOG.TXT file |
|
43 |
|
|
44 |
2011-JAN-25 |
|
45 |
Initial version |
|
46 |
|
drupal7/sites/all/modules/ddblock/INSTALL.txt | ||
---|---|---|
1 |
|
|
2 |
REQUIREMENTS |
|
3 |
------------ |
|
4 |
* Javascript-enabled web browser |
|
5 |
libraries module |
|
6 |
|
|
7 |
For advanced options |
|
8 |
|
|
9 |
* Views module (optional) <http://drupal.org/project/views> |
|
10 |
|
|
11 |
PRE-REQUISITES |
|
12 |
-------------- |
|
13 |
* If you are upgrading from a previous version, please |
|
14 |
|
|
15 |
- Delete the previous ddblock module directory |
|
16 |
|
|
17 |
- Read notes about important changes that may affect your site or theme in |
|
18 |
CHANGELOG.txt. |
|
19 |
|
|
20 |
UPGRADING |
|
21 |
--------- |
|
22 |
* ddblock for drupal 7 uses new theme packages. |
|
23 |
* ddblock for drupal 7 does not use preprocess functions in the theme anymore |
|
24 |
you need to delete existing preprocess functions from the template.php file. |
|
25 |
* To download and install the new themes see: |
|
26 |
DDBLOCK THEMES INSTALLATION |
|
27 |
|
|
28 |
INSTALLATION |
|
29 |
------------ |
|
30 |
|
|
31 |
DYNAMIC DISPLAY BLOCK INSTALLATION |
|
32 |
---------------------------------- |
|
33 |
* Download the jquery cycle plugin from http://malsup.com/jquery/cycle/download.html |
|
34 |
(use jquery.cycle.all.min.js (packed version) or jquery.cycle.all.js, tested till version 2.99) |
|
35 |
|
|
36 |
* Install the jquery cycle plugin in /sites/all/libraries/jquery.cycle/ |
|
37 |
|
|
38 |
|
|
39 |
* Download, extract and copy the ddblock folder to your sites/all/modules directory. |
|
40 |
|
|
41 |
* Enable the module at Administer >> Site building >> Modules. |
|
42 |
|
|
43 |
* Run update.php if you upgrade the module from a previous version. |
|
44 |
|
|
45 |
For more information about configuration, see README.txt of the ddblock. |
|
46 |
|
|
47 |
|
|
48 |
DDBLOCK THEMES INSTALLATION |
|
49 |
--------------------------- |
|
50 |
* Download the theme package (upright10p-60p.rar) from http://ddblock.myalbums.biz/download |
|
51 |
Make sure you download the version for Drupal 7 |
|
52 |
|
|
53 |
* Extract the rar file to a temporary directory |
|
54 |
|
|
55 |
* Copy the custom directory with all subdirectories to the theme directory of the |
|
56 |
theme you use. (which is probably at sites/all/themes/[YOUR_THEME_NAME]) |
|
57 |
|
|
58 |
DDBLOCK EXAMPLE CONTENT TYPE AND VIEW |
|
59 |
------------------------------------- |
|
60 |
Create a content type e.g. "Slideshow Item" with the fields |
|
61 |
|
|
62 |
Label field |
|
63 |
----- ----- |
|
64 |
Title title |
|
65 |
Image field_image |
|
66 |
Slide Text field_slide_text |
|
67 |
Pager Text field_pager_text |
|
68 |
Body body |
|
69 |
|
|
70 |
Create a view using these fields |
|
71 |
|
|
72 |
DDBLOCK MODULE CONFIGURATION |
|
73 |
---------------------------- |
|
74 |
Choose a slideshow theme |
|
75 |
Map fields from the view to slideshow theme fields |
|
76 |
Configure the other slideshow settings |
|
77 |
Save the block |
|
78 |
|
|
79 |
Place the block in a region of your overall theme. |
drupal7/sites/all/modules/ddblock/LICENSE.txt | ||
---|---|---|
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. |
drupal7/sites/all/modules/ddblock/README.txt | ||
---|---|---|
1 |
SUMMARY |
|
2 |
------- |
|
3 |
The Dynamic display block module enables you to create blocks to present content |
|
4 |
in a dynamic way. For creating slideshow effects it uses the jQuery Cycle plug-in. |
|
5 |
|
|
6 |
There are four ways to specify content for the Dynamic display block module: |
|
7 |
|
|
8 |
* A folder containing image files |
|
9 |
* A node from a content type with multiple input |
|
10 |
* Views |
|
11 |
* An instance of any created block |
|
12 |
|
|
13 |
Several effects and other setting can be set in the configuration settings of the |
|
14 |
Dynamic display block module. |
|
15 |
|
|
16 |
|
|
17 |
REQUIREMENTS |
|
18 |
------------ |
|
19 |
Libraries module |
|
20 |
|
|
21 |
|
|
22 |
INSTALLATION |
|
23 |
------------ |
|
24 |
See INSTALL.txt |
|
25 |
|
|
26 |
|
|
27 |
CONFIGURATION |
|
28 |
------------- |
|
29 |
Step by step tutorials at: |
|
30 |
http://ddblock.myalbums.biz/node/1974 (Drupal 7 - Basic slideshow tutorial) |
|
31 |
http://ddblock.myalbums.biz/node/1971 (Drupal 7 - Advanced slideshow tutorial) |
|
32 |
|
|
33 |
|
|
34 |
PERMISSIONS |
|
35 |
----------- |
|
36 |
* Configure user permissions at: admin > people > permissions |
|
37 |
|
|
38 |
- administer dynamic display blocks: |
|
39 |
|
|
40 |
- view dynamic display blocks: |
|
41 |
|
|
42 |
|
|
43 |
CONTACT |
|
44 |
------- |
|
45 |
Original idea cycle module by roopletheme - http://drupal.org/user/164625 |
|
46 |
|
|
47 |
Major rewrite by current Maintainers: |
|
48 |
* Philip Blaauw (ppblaauw) - http://drupal.org/user/155138 |
|
49 |
|
|
50 |
We also offer installation, development, theming, customization. |
|
51 |
You can contact us via the contact form on http://ddblock.myalbums.biz. |
|
52 |
or via email to ppblaauw (at) gmail.com |
drupal7/sites/all/modules/ddblock/css/ddblock.css | ||
---|---|---|
1 |
/* deafult dynamic display block */ |
|
2 |
div.block-ddblock .ddblock-container { |
|
3 |
clear:both; |
|
4 |
position: relative; |
|
5 |
} |
|
6 |
|
|
7 |
div.block-ddblock div.slider.overflow-visible{ |
|
8 |
overflow:visible!important; |
|
9 |
} |
|
10 |
/* default dynamic display block number pager */ |
|
11 |
div.block-ddblock .ddblock-number-pager a.activeSlide { |
|
12 |
background: #88f; |
|
13 |
} |
|
14 |
div.block-ddblock .ddblock-number-pager a:focus { |
|
15 |
outline: none; |
|
16 |
} |
|
17 |
div.block-ddblock .ddblock-number-pager { |
|
18 |
/* padding-bottom: 3px; /* margin between bottom of pager and content */ |
|
19 |
position: relative; |
|
20 |
left: 0; |
|
21 |
display: block; |
|
22 |
} |
|
23 |
div.block-ddblock .ddblock-number-pager a { |
|
24 |
margin: 0 2px 2px 0; /* margin right and bottom between pagers */ |
|
25 |
padding: 0px 6px; /* pading left and right inside pager */ |
|
26 |
border: 1px solid #ccc; |
|
27 |
background: #fc0; |
|
28 |
text-decoration: none; |
|
29 |
display: block; |
|
30 |
float: left; |
|
31 |
font-size:.9em; /* adjust fontsize */ |
|
32 |
} |
|
33 |
div.block-ddblock .ddblock-number-pager { |
|
34 |
display:block; |
|
35 |
position:relative; |
|
36 |
} |
|
37 |
div.block-ddblock .ddblock-number-pager ul { |
|
38 |
list-style-type:none; |
|
39 |
margin:0!important; |
|
40 |
padding:0!important; |
|
41 |
} |
|
42 |
div.block-ddblock .ddblock-number-pager ul li { |
|
43 |
background:#fff!important; |
|
44 |
display:inline; |
|
45 |
list-style-type:none!important; |
|
46 |
margin:0!important; |
|
47 |
padding:0!important; |
|
48 |
} |
|
49 |
div.block-ddblock .ddblock-number-pager ul li a.pager-link{ |
|
50 |
background:#fc0; |
|
51 |
border:1px solid #ccc; |
|
52 |
display:block; |
|
53 |
float:left; |
|
54 |
font-family:Tahoma,Arial,sans-serif; |
|
55 |
font-size:.7em; |
|
56 |
font-weight:bold; |
|
57 |
height:15px; |
|
58 |
line-height:15px; |
|
59 |
margin:0 2px 0 0; |
|
60 |
text-align:center; |
|
61 |
text-decoration:none!important; |
|
62 |
width:15px; |
|
63 |
} |
|
64 |
div.block-ddblock .ddblock-number-pager ul li a.activeSlide{ |
|
65 |
background:#999; |
|
66 |
color:#fff!important; |
|
67 |
} |
|
68 |
div.block-ddblock .ddblock-number-pager ul li a:focus{ |
|
69 |
outline:none; |
|
70 |
} |
|
71 |
div.block-ddblock .ddblock-number-pager ul li a.pager-link:hover{ |
|
72 |
background:#999; |
|
73 |
color:#fff!important; |
|
74 |
} |
|
75 |
div.block-ddblock .ddblock-number-pager ul li a.prev, |
|
76 |
div.block-ddblock .ddblock-number-pager ul li a.next{ |
|
77 |
background:#fc0; |
|
78 |
border:1px solid #ccc; |
|
79 |
display:block; |
|
80 |
float:left; |
|
81 |
font-family:Tahoma,Arial,sans-serif; |
|
82 |
font-size:.8em; |
|
83 |
font-weight:bold; |
|
84 |
height:15px; |
|
85 |
line-height:15px; |
|
86 |
margin:0 2px 0 0; |
|
87 |
text-align:center; |
|
88 |
text-decoration:none!important; |
|
89 |
width:30px; |
|
90 |
} |
|
91 |
|
|
92 |
/* default dynamic display block prev-next pager */ |
|
93 |
div.block-ddblock .ddblock-prev-next-pager a.activeSlide { |
|
94 |
background: #88f; |
|
95 |
} |
|
96 |
div.block-ddblock .ddblock-prev-next-pager a:focus { |
|
97 |
outline: none; |
|
98 |
} |
|
99 |
div.block-ddblock .ddblock-prev-next-pager { |
|
100 |
/* padding-bottom: 3px; /* margin between bottom of pager and content */ |
|
101 |
position: relative; |
|
102 |
left: 0; |
|
103 |
display: block; |
|
104 |
} |
|
105 |
div.block-ddblock .ddblock-prev-next-pager a { |
|
106 |
background: #fc0; |
|
107 |
border: 1px solid #ccc; |
|
108 |
display: block; |
|
109 |
float: left; |
|
110 |
font-size:.9em; /* adjust fontsize */ |
|
111 |
height:15px; |
|
112 |
line-height:15px; |
|
113 |
margin: 0 2px 2px 0; /* margin right and bottom between pagers */ |
|
114 |
padding: 0px 6px; /* pading left and right inside pager */ |
|
115 |
text-decoration: none; |
|
116 |
width:30px; |
|
117 |
} |
|
118 |
|
|
119 |
/* default dynamic display block image pager */ |
|
120 |
div.block-ddblock .ddblock-image-pager a.activeSlide { |
|
121 |
background: #ddd; |
|
122 |
} |
|
123 |
div.block-ddblock .ddblock-image-pager a:focus { |
|
124 |
outline: none; |
|
125 |
} |
|
126 |
div.block-ddblock ul.ddblock-image-pager { |
|
127 |
margin: 0 0 3px 0; |
|
128 |
padding: 0; |
|
129 |
line-height:1em; |
|
130 |
} |
|
131 |
div.block-ddblock .ddblock-image-pager li { |
|
132 |
/* width: 61px; /*width of list item 55 from picture width + 2 X 3px padding*/ |
|
133 |
float: left; |
|
134 |
margin: 0 3px 3px 0; /* margin right and bottom between pagers */ |
|
135 |
padding: 0; |
|
136 |
list-style: none; |
|
137 |
border: 1px solid #ccc; |
|
138 |
background: #fff; |
|
139 |
} |
|
140 |
div.block-ddblock .ddblock-image-pager li a { |
|
141 |
/* width: 55px; /* width of list item*/ |
|
142 |
/* height: 55px; /*height of list item*/ |
|
143 |
padding: 3px; |
|
144 |
display: block; |
|
145 |
background: #fff; |
|
146 |
} |
|
147 |
div.block-ddblock .ddblock-image-pager li img { |
|
148 |
border: none; |
|
149 |
display: inline; |
|
150 |
margin: 0 !important; |
|
151 |
padding: 0 !important; |
|
152 |
} |
|
153 |
|
|
154 |
div.block-ddblock ul.ddblock-image-pager {display:block;position:relative;} |
|
155 |
div.block-ddblock ul.ddblock-image-pager {list-style-type:none;margin:0!important;padding:0!important;} |
|
156 |
div.block-ddblock ul.ddblock-image-pager li {background:#fff!important;display:inline;list-style:none!important;padding:0!important;} |
|
157 |
div.block-ddblock ul.ddblock-image-pager li a.pager-link{background:#fff;border:1px solid #ccc;display:block;float:left;font-family:Tahoma,Arial,sans-serif;font-size:.7em;font-weight:bold;height:55px;line-height:55px;margin:0 2px 2px 0;padding:3px;text-align:center;text-decoration:none!important;width:55px;} |
|
158 |
div.block-ddblock ul.ddblock-image-pager li a.activeSlide{background:#ddd;color:#fff!important;} |
|
159 |
div.block-ddblock ul.ddblock-image-pager li a:focus{outline:none;} |
|
160 |
div.block-ddblock ul.ddblock-image-pager li a.pager-link:hover{background:#ddd;color:#fff!important;} |
|
161 |
|
|
162 |
div.block-ddblock ul.ddblock-image-pager li a.prev{background:#fff!important;display:inline;list-style:none!important;padding:0!important;} |
|
163 |
div.block-ddblock ul.ddblock-image-pager li a.next{background:#fff!important;display:inline;list-style:none!important;padding:0!important;} |
|
164 |
|
|
165 |
|
|
166 |
/* default dynamic display block custom pager */ |
|
167 |
div.block-ddblock .ddblock-custom-pager a.activeSlide { |
|
168 |
background: #eee; |
|
169 |
} |
|
170 |
div.block-ddblock .ddblock-custom-pager a:focus { |
|
171 |
outline: none; |
|
172 |
} |
|
173 |
|
|
174 |
/********************* previous next pager on slide **********************/ |
|
175 |
div.block-ddblock div.pager-slide{ |
|
176 |
height: 50px; |
|
177 |
position: absolute; |
|
178 |
top:130px; |
|
179 |
width:50px; |
|
180 |
z-index:50; |
|
181 |
} |
|
182 |
div.block-ddblock div.pager-slide a{ |
|
183 |
display:block; |
|
184 |
height:50px; |
|
185 |
opacity: 0.7; |
|
186 |
width:50px; |
|
187 |
} |
|
188 |
div.block-ddblock div.next-container a.next{ |
|
189 |
background: url(_images/next.png) no-repeat; |
|
190 |
} |
|
191 |
div.block-ddblock div.prev-container a.prev{ |
|
192 |
background: url(_images/prev.png) no-repeat; |
|
193 |
} |
|
194 |
div.block-ddblock div.next-container a.next:hover{ |
|
195 |
background: url(_images/next.png) no-repeat; |
|
196 |
opacity:1; |
|
197 |
} |
|
198 |
div.block-ddblock div.prev-container a.prev:hover{ |
|
199 |
background: url(_images/prev.png) no-repeat; |
|
200 |
opacity:1; |
|
201 |
} |
|
202 |
div.block-ddblock div.pager-slide a:focus{ |
|
203 |
outline:none; |
|
204 |
} |
|
205 |
/********************* previous next pager on slide **********************/ |
|
206 |
div.block-ddblock div.prev-container{left:5px;} |
|
207 |
div.block-ddblock div.next-container{left:128px;} |
drupal7/sites/all/modules/ddblock/css/ddblock_instance_admin.css | ||
---|---|---|
1 |
.ddblock-target { |
|
2 |
float:left; |
|
3 |
margin-right:10px; |
|
4 |
} |
|
5 |
.ddblock-target label, |
|
6 |
.ddblock-source label { |
|
7 |
display:none; |
|
8 |
} |
|
9 |
.form-item { |
|
10 |
margin: 0 0 5px!important; |
|
11 |
padding: 0!important; |
|
12 |
} |
drupal7/sites/all/modules/ddblock/ddblock-cycle-block-content.tpl.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/* |
|
4 |
* @file |
|
5 |
* Default theme implementation to display a dynamic display blocks from a dynamic display block instance. |
|
6 |
* |
|
7 |
* Available variables: |
|
8 |
* - $origin: Original module of the block. |
|
9 |
* - $delta: Block number of the block. |
|
10 |
* - $pager: Pager type to add the dynamic display block. |
|
11 |
* - $pager_height: Pager container height. |
|
12 |
* - $pager_width: Pager container width. |
|
13 |
* - $imgcache_pager_item: Image cache preset name for the pager item. |
|
14 |
* - $content: themed content. |
|
15 |
* |
|
16 |
* notes: don't change the ID names, they are used by the jQuery script. |
|
17 |
*/ |
|
18 |
$settings = $ddblock_cycle_slider_settings; |
|
19 |
|
|
20 |
?> |
|
21 |
|
|
22 |
<!-- block content. --> |
|
23 |
<div id="ddblock-<?php print $settings['delta']; ?>" class="ddblock-contents clearfix" style="visibility:hidden"> |
|
24 |
|
|
25 |
<div class="ddblock-content clearfix"> |
|
26 |
|
|
27 |
<?php if ($content): ?> |
|
28 |
|
|
29 |
<?php if (($settings['pager'] == 'number-pager')): ?> |
|
30 |
<!-- number pager. --> |
|
31 |
<div id="ddblock-<?php print $settings['pager'] ."-". $settings['delta'] ?>" class="ddblock-<?php print $settings['pager'] ?> ddblock-pager clearfix" style="height: <?php print $settings['pager_height']; ?>px; width:<?php print $settings['pager_width']; ?>px;"> |
|
32 |
<?php $item_counter=1; ?> |
|
33 |
<ul> |
|
34 |
<?php foreach ($content['slide_image'] as $item): ?> |
|
35 |
<li class="number-pager-item"> |
|
36 |
<a href="#" class="pager-link" title="click to navigate to topic"> |
|
37 |
<?php print $item_counter; ?> |
|
38 |
</a> |
|
39 |
</li> |
|
40 |
<?php $item_counter++;?> |
|
41 |
<?php endforeach; ?> |
|
42 |
</ul> |
|
43 |
</div> |
|
44 |
<?php endif; ?> |
|
45 |
|
|
46 |
<?php if (($settings['pager'] == 'image-pager')): ?> |
|
47 |
|
|
48 |
<!-- image pager. --> |
|
49 |
<ul id="ddblock-<?php print $settings['pager'] ."-". $settings['delta'] ?>" class="ddblock-<?php print $settings['pager'] ?> ddblock-pager clearfix" style="height: <?php print $settings['pager_height'] ?>px; width:<?php print $settings['pager_width'] ?>px;"> |
|
50 |
<?php foreach ($content['pager_image'] as $image_file): ?> |
|
51 |
<li> |
|
52 |
<a href="#" title="click to navigate to topic"><?php print $image_file; ?></a> |
|
53 |
</li> |
|
54 |
<?php endforeach; ?> |
|
55 |
</ul> |
|
56 |
<?php endif; ?> |
|
57 |
|
|
58 |
<?php if ($settings['pager'] == 'prev-next-pager'): ?> |
|
59 |
<!-- prev next pager. --> |
|
60 |
<div id="ddblock-<?php print $settings['pager'] ."-". $settings['delta'] ?>" class="ddblock-<?php print $settings['pager'] ?> ddblock-pager clearfix" style="height: <?php print $settings['pager_height'] ?>px; width:<?php print $settings['pager_width'] ?>px;"> |
|
61 |
<a id="prev" class="prev" href="#">Prev</a> |
|
62 |
<a id="next" class="next" href="#">Next</a> |
|
63 |
</div> |
|
64 |
<?php endif; ?> |
|
65 |
|
|
66 |
<?php if ($settings['output_type'] == 'images') : ?> |
|
67 |
<div class="ddblock-container clearfix"> |
|
68 |
<div class="slider"> |
|
69 |
<?php foreach ($content['slide_image'] as $image_file): ?> |
|
70 |
<div class="slide"><?php print $image_file; ?></div> |
|
71 |
<?php endforeach; ?> |
|
72 |
</div> |
|
73 |
<!-- prev/next pager on slide --> |
|
74 |
<?php if ($settings['pager2'] == 1): ?> |
|
75 |
<div class="pager-slide prev-container prev-container-<?php print $settings['pager_position'] ?>"> |
|
76 |
<a class="prev" href="#"><?php print $settings['pager2_slide_prev']?></a> |
|
77 |
</div> |
|
78 |
<div class="pager-slide next-container next-container-<?php print $settings['pager_position'] ?>"> |
|
79 |
<a class="next" href="#"><?php print $settings['pager2_slide_next'] ?></a> |
|
80 |
</div> |
|
81 |
<?php endif; ?> |
|
82 |
</div> |
|
83 |
<?php endif; ?> |
|
84 |
|
|
85 |
<?php if ($settings['output_type'] == 'content_array') : ?> |
|
86 |
<div class="ddblock-container"> |
|
87 |
<?php foreach ($content as $item): ?> |
|
88 |
<?php print($item); ?> |
|
89 |
<?php endforeach; ?> |
|
90 |
<!-- prev/next pager on slide --> |
|
91 |
<?php if ($settings['pager2'] == 1): ?> |
|
92 |
<div class="pager-slide prev-container prev-container-<?php print $settings['pager_position'] ?>"> |
|
93 |
<a class="prev" href="#"><?php print $settings['pager2_slide_prev']?></a> |
|
94 |
</div> |
|
95 |
<div class="pager-slide next-container next-container-<?php print $settings['pager_position'] ?>"> |
|
96 |
<a class="next" href="#"><?php print $settings['pager2_slide_next'] ?></a> |
|
97 |
</div> |
|
98 |
<?php endif; ?> |
|
99 |
</div> |
|
100 |
<?php endif; ?> |
|
101 |
|
|
102 |
<?php if ($settings['output_type'] == 'view_content') : ?> |
|
103 |
<div class="ddblock-container"> |
|
104 |
<?php print($content); ?> |
|
105 |
</div> |
|
106 |
<?php endif; ?> |
|
107 |
<?php endif; ?> |
|
108 |
</div> |
|
109 |
</div> |
drupal7/sites/all/modules/ddblock/ddblock-cycle-pager-content.tpl.php | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file |
|
5 |
* Default theme implementation to display a dynamic display blocks from a dynamic display block instance. |
|
6 |
* |
|
7 |
* Available variables: |
|
8 |
* - $delta: Block number of the block. |
|
9 |
* - $pager: Add a pager to the dynamic display block. |
|
10 |
* - $pager_height: Height of the container of the pager. |
|
11 |
* - $pager_width: Width of the container of the pager. |
|
12 |
* - $pager_position: position of the slider (top | bottom) |
|
13 |
* - $content: themed content |
|
14 |
* |
|
15 |
* notes: don't change the ID names, they are used by the jQuery script. |
|
16 |
*/ |
|
17 |
$number_of_items = 6; |
|
18 |
$number_of_items_per_row=3; |
|
19 |
$settings = $ddblock_cycle_pager_settings; |
|
20 |
?> |
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
<?php if ($settings['pager'] == 'custom-pager'): ?> |
|
25 |
<?php if ($settings['pager_position'] == 'bottom' || $settings['pager_position'] == 'both'): ?> |
|
26 |
<div class="spacer-horizontal"><b></b></div> |
|
27 |
<?php endif; ?> |
|
28 |
<div id="ddblock-pager-<?php print $settings['delta'] ?>" class="<?php print $settings['pager'] ?>" class="clear-block border"> |
|
29 |
<div class="<?php print $settings['pager'] ?>-inner" class="clear-block border"> |
|
30 |
<?php if ($pager_items): ?> |
|
31 |
<?php $item_counter=0; ?> |
|
32 |
<?php foreach ($pager_items as $pager_item): ?> |
|
33 |
<div class="<?php print $settings['pager'] ?>-item <?php print $settings['pager'] ?>-item-<?php print $item_counter ?>"> |
|
34 |
<div class="<?php print $settings['pager'] ?>-item-inner"> |
|
35 |
<a href="#" title="navigate to topic"><?php print $pager_item['image']; ?><?php print $pager_item['text']; ?></a> |
|
36 |
</div> |
|
37 |
</div> |
|
38 |
<?php $item_counter++; if ($item_counter == $number_of_items_per_row):?> |
|
39 |
<div class="spacer-horizontal"><b></b></div> |
|
40 |
<?php else: ?> |
|
41 |
<div class="spacer-vertical"></div> |
|
42 |
<?php endif; ?> |
|
43 |
<?php endforeach; ?> |
|
44 |
<?php endif; ?> |
|
45 |
</div> <!-- pager-inner--> |
|
46 |
</div> <!-- pager--> |
|
47 |
<?php if ($settings['pager_position'] == 'top' || $settings['pager_position'] == 'both'): ?> |
|
48 |
<div class="spacer-horizontal"><b></b></div> |
|
49 |
<?php endif; ?> |
|
50 |
<?php endif; ?> |
drupal7/sites/all/modules/ddblock/ddblock.admin.inc | ||
---|---|---|
1 |
<?php |
|
2 |
|
|
3 |
/** |
|
4 |
* @file |
|
5 |
* admin blocks of the ddblock module. |
|
6 |
* |
|
7 |
*/ |
|
8 |
|
|
9 |
/** |
|
10 |
* Form with overview of all dynamic display blocks to manage and to add dynamic display blocks. |
|
11 |
*/ |
|
12 |
function ddblock_block_add_form($form, &$form_state) { |
|
13 |
|
|
14 |
// get dynamic display block. |
|
15 |
$rows = array(); |
|
16 |
$blocks = ddblock_get_blocks(NULL); |
|
17 |
|
|
18 |
foreach ($blocks as $block) { |
|
19 |
$rows[] = array( |
|
20 |
'name' => check_plain($block->title), |
|
21 |
'edit' => l(t('Edit'), "admin/structure/ddblock/edit/$block->delta"), |
|
22 |
'delete' => l(t('Delete'), "admin/structure/ddblock/delete/$block->delta"), |
|
23 |
'block' => l(t('Configure block'), "admin/structure/block/manage/ddblock/$block->delta/configure"), |
|
24 |
); |
|
25 |
} |
|
26 |
if (empty($rows)) { |
|
27 |
$rows[] = array(array( |
|
28 |
'data' => t('No dynamic display blocks available.'), |
|
29 |
'colspan' => '4', |
|
30 |
)); |
|
31 |
} |
|
32 |
|
|
33 |
$header = array(t('Name'), array( |
|
34 |
'data' => t('Operation'), |
|
35 |
'colspan' => '3', |
|
36 |
)); |
|
37 |
$output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('id' => 'dynamic display block'))); |
|
38 |
|
|
39 |
$form = array(); |
|
40 |
$form['list'] = array( |
|
41 |
'#type' => 'fieldset', |
|
42 |
'#title' => t('Dynamic display blocks'), |
|
43 |
'#collapsible' => TRUE, |
|
44 |
); |
|
45 |
$form['list']['table'] = array( |
|
46 |
'#type' => 'item', |
|
47 |
'#prefix' => '<div>', |
|
48 |
'#markup' => $output, |
|
49 |
'#suffix' => '</div>', |
|
50 |
); |
|
51 |
|
|
52 |
// add dynamic display block. |
|
53 |
$form['block'] = array( |
|
54 |
'#type' => 'fieldset', |
|
55 |
'#title' => t('Add dynamic display block.'), |
|
56 |
); |
|
57 |
|
|
58 |
$form['block']['title'] = array( |
|
59 |
'#type' => 'textfield', |
|
60 |
'#title' => t('Block title'), |
|
61 |
'#description' => t('A block with this same name will be created.'), |
|
62 |
'#default_value' => '', |
|
63 |
'#required' => TRUE, |
|
64 |
); |
|
65 |
|
|
66 |
$form['block']['op'] = array( |
|
67 |
'#type' => 'submit', |
|
68 |
'#value' => t('Add block'), |
|
69 |
); |
|
70 |
|
|
71 |
return $form; |
|
72 |
} |
|
73 |
|
|
74 |
/** |
|
75 |
* Validate "Add Block" form. |
|
76 |
*/ |
|
77 |
function ddblock_block_add_form_validate($form, &$form_state) { |
|
78 |
$blocks = ddblock_get_blocks(NULL); |
|
79 |
$block_titles = array(); |
|
80 |
foreach ($blocks as $block) { |
|
81 |
$block_titles[] = $block->title; |
|
82 |
} |
|
83 |
|
|
84 |
if (!empty($block_titles)) { |
|
85 |
// Check if name is unique |
|
86 |
if (in_array($form_state['values']['title'], $block_titles)) { |
|
87 |
form_set_error('', t('Dynamic display block %s already exists. Please use a different name.', array('%s' => $form_state['values']['title']))); |
|
88 |
} |
|
89 |
} |
|
90 |
} |
|
91 |
/** |
|
92 |
* Add dynamic display block to database from "Add Block" form. |
|
93 |
*/ |
|
94 |
function ddblock_block_add_form_submit($form, &$form_state) { |
|
95 |
$id = db_insert('ddblock_block') |
|
96 |
->fields(array( |
|
97 |
'title' => $form_state['values']['title'], |
|
98 |
'module' => 'ddblock', |
|
99 |
)) |
|
100 |
->execute(); |
|
101 |
|
|
102 |
drupal_set_message(t('Dynamic display block %s added.', array('%s' => $form_state['values']['title']))); |
|
103 |
} |
|
104 |
|
|
105 |
/** |
|
106 |
* Edit block form. |
|
107 |
*/ |
|
108 |
function ddblock_block_edit_form($form, &$form_state, $delta) { |
|
109 |
$block = ddblock_get_blocks($delta); |
|
110 |
$form = array(); |
|
111 |
|
|
112 |
$form['delta'] = array( |
|
113 |
'#type' => 'hidden', |
|
114 |
'#value' => $delta, |
|
115 |
); |
|
116 |
|
|
117 |
$form['title'] = array( |
|
118 |
'#type' => 'textfield', |
|
119 |
'#title' => t('Block title'), |
|
120 |
'#description' => t('The block name must be unique.'), |
|
121 |
'#default_value' => $block->title, |
|
122 |
'#required' => TRUE, |
|
123 |
); |
|
124 |
|
|
125 |
$form['op'] = array( |
|
126 |
'#type' => 'submit', |
|
127 |
'#value' => t('Save'), |
|
128 |
); |
|
129 |
|
|
130 |
return $form; |
|
131 |
} |
|
132 |
|
|
133 |
/** |
|
134 |
* Validate edit block form. |
|
135 |
*/ |
|
136 |
function ddblock_block_edit_form_validate($form, &$form_state) { |
|
137 |
$blocks = ddblock_get_blocks(NULL); |
|
138 |
$block_titles = array(); |
|
139 |
foreach ($blocks as $block) { |
|
140 |
$block_titles[$block->delta] = $block->title; |
|
141 |
} |
|
142 |
|
|
143 |
// Remove current blockname to prevent false error. |
|
144 |
unset($block_titles[$form_state['values']['delta']]); |
|
145 |
|
|
146 |
if (!empty($block_titles)) { |
|
147 |
// Check if name is unique. |
|
148 |
if (in_array($form_state['values']['title'], $block_titles)) { |
|
149 |
form_set_error('', t('Dynamic display block %s already exists. Please use a different name.', array('%s' => $form_state['values']['title']))); |
|
150 |
} |
|
151 |
} |
|
152 |
} |
|
153 |
|
|
154 |
/** |
|
155 |
* Submit edit block form. |
|
156 |
*/ |
|
157 |
function ddblock_block_edit_form_submit($form, &$form_state) { |
|
158 |
db_update('ddblock_block') |
|
159 |
->fields(array( |
|
160 |
'title' => $form_state['values']['title'], |
|
161 |
)) |
|
162 |
->condition('delta', $form_state['values']['delta']) |
|
163 |
->execute(); |
|
164 |
|
|
165 |
drupal_set_message(t('Dynamic display block block updated.')); |
|
166 |
$form_state['redirect'] = 'admin/structure/ddblock'; |
|
167 |
return $form; |
|
168 |
} |
|
169 |
|
|
170 |
/** |
|
171 |
* Delete block form. |
|
172 |
*/ |
|
173 |
function ddblock_block_confirm_delete_form($form, &$form_state, $delta) { |
|
174 |
$block = ddblock_get_blocks($delta); |
|
175 |
if (empty($block)) { |
|
176 |
drupal_set_message(t('The block with delta @delta was not found.', array('@delta' => $delta)), 'error'); |
|
177 |
return array(); |
|
178 |
} |
|
179 |
else { |
|
180 |
if ($block->enabled == 1) { |
|
181 |
|
|
182 |
//The question to ask the user. |
|
183 |
$question = t('Are you sure you want to delete the dynamic display block instance %title?', array('%title' => $block->title)); |
|
184 |
} |
|
185 |
else { |
|
186 |
//The question to ask the user. |
|
187 |
$question = t('Are you sure you want to delete the dynamic display block %title?', array('%title' => $block->title)); |
|
188 |
} |
|
189 |
// The page to go to if the user denies the action. |
|
190 |
$path = 'admin/structure/ddblock'; |
|
191 |
|
|
192 |
// Additional text to display (defaults to "This action cannot be undone."). |
|
193 |
$description = t('This action cannot be undone.'); |
|
194 |
|
|
195 |
// A caption for the button which confirms the action. |
|
196 |
$yes = t('Delete'); |
|
197 |
|
|
198 |
// A caption for the link which denies the action. |
|
199 |
$no = t('Cancel'); |
|
200 |
|
|
201 |
// set delta value to use in submit function. |
|
202 |
$form['delta'] = array( |
|
203 |
'#type' => 'value', |
|
204 |
'#value' => $delta, |
|
205 |
); |
|
206 |
|
|
207 |
// set original module value to use in submit function. |
|
208 |
$form['origin'] = array( |
|
209 |
'#type' => 'value', |
|
210 |
'#value' => $block->module, |
|
211 |
); |
|
212 |
|
|
213 |
// set the redirect path value to use in submit function. |
|
214 |
$form_state['redirect'] = $path; |
|
215 |
return confirm_form( |
|
216 |
$form, |
|
217 |
$question, |
|
218 |
$path, |
|
219 |
$description, |
|
220 |
$yes, |
|
221 |
$no |
|
222 |
); |
|
223 |
} |
|
224 |
} |
|
225 |
|
|
226 |
/** |
|
227 |
* Delete a dynamic display block or dynamic display block instance. |
|
228 |
*/ |
|
229 |
function ddblock_block_confirm_delete_form_submit($form, &$form_state) { |
|
230 |
|
|
231 |
if (ddblock_block_confirm_delete($form_state['values']['delta'])) { |
|
232 |
if ($form_state['values']['origin'] == 'ddblock') { |
|
233 |
$succes_message = t('Dynamic display block successfully deleted!'); |
|
234 |
} |
|
235 |
else { |
|
236 |
$succes_message = t('Dynamic display block instance successfully deleted!'); |
|
237 |
} |
|
238 |
drupal_set_message($succes_message); |
|
239 |
} |
|
240 |
else { |
|
241 |
if ($form_state['values']['origin'] == 'ddblock') { |
|
242 |
$failure_message = t('There was a problem deleting the dynamic display block'); |
|
243 |
} |
|
244 |
else { |
|
245 |
$failure_message = t('There was a problem deleting the dynamic display block instance'); |
|
246 |
} |
|
247 |
drupal_set_message($failure_message); |
|
248 |
} |
|
249 |
$form_state['redirect'] = 'admin/structure/ddblock'; |
|
250 |
return $form; |
|
251 |
} |
|
252 |
|
|
253 |
/** |
|
254 |
* Delete a dynamic display block or dynamic display block instance from the database. |
|
255 |
*/ |
|
256 |
/*function ddblock_block_confirm_delete($delta) { |
|
257 |
$result = db_delete('ddblock_block') |
|
258 |
->condition('delta', (int) $delta) |
|
259 |
->execute(); |
|
260 |
if (ctype_digit($delta)) { |
|
261 |
_block_rehash(); |
|
262 |
// variable_del includes a clear cache. |
|
263 |
variable_del('ddblock_block_ddblock_' . $delta . '_cycle_settings'); |
|
264 |
return TRUE; |
|
265 |
} |
|
266 |
else { |
|
267 |
return FALSE; |
|
268 |
} |
|
269 |
} |
|
270 |
*/ |
|
271 |
function ddblock_block_confirm_delete($delta) { |
|
272 |
_block_rehash(); |
|
273 |
$result = db_delete('ddblock_block') |
|
274 |
->condition('delta', (int) $delta) |
|
275 |
->execute(); |
|
276 |
|
|
277 |
$result = db_delete('block') |
|
278 |
->condition('module', 'ddblock') |
|
279 |
->condition('delta', $delta) |
|
280 |
->execute(); |
|
281 |
|
|
282 |
// variable_del includes a clear cache. |
|
283 |
variable_del('ddblock_block_ddblock_' . $delta . '_settings'); |
|
284 |
variable_del('ddblock_block_ddblock_' . $delta . '_cycle_settings'); |
|
285 |
variable_del('ddblock_block_ddblock_' . $delta . '_cycle_mapping_settings'); |
|
286 |
|
|
287 |
return TRUE; |
|
288 |
} |
|
289 |
|
|
290 |
/** |
|
291 |
* Dynamic display block settings form for setting the content types to be used with the dynamic display block module. |
|
292 |
*/ |
|
293 |
function ddblock_settings_form($form, &$form_state) { |
|
294 |
$form = array(); |
|
295 |
// get a list of all available content types, names parameter is used to get an associative array of content type names. |
|
296 |
// the key is the machine-readable name of the content type and the value the human-readable name of the content type. |
|
297 |
$content_types = node_type_get_names(); |
|
298 |
|
|
299 |
$form['ddblock_node_type'] = array( |
|
300 |
'#type' => 'checkboxes', |
|
301 |
'#title' => t('Content types'), |
|
302 |
'#description' => t('The content type(s) that can be used with the dynamic display block module.'), |
|
303 |
'#default_value' => variable_get('ddblock_node_type', array()), |
|
304 |
'#options' => $content_types, |
|
305 |
'#multiple' => TRUE, |
|
306 |
'#required' => FALSE, |
|
307 |
); |
|
308 |
|
|
309 |
// Fetch blocks directly from modules using block.module function. |
|
310 |
$blocks = _block_rehash(); |
|
311 |
|
|
312 |
// Sort blocks how we want them. |
|
313 |
usort($blocks, 'ddblock_block_sort'); |
|
314 |
|
|
315 |
// Turn $blocks into form options of available blocks. |
|
316 |
$options = array(); |
|
317 |
foreach ($blocks as $block) { |
|
318 |
// Don't include ddblock module blocks in the list. |
|
319 |
if ($block['module'] != 'ddblock') { |
|
320 |
$options[$block['module'] . ':' . $block['delta'] . ':' . $block['info']] = $block['module'] . ' - ' . $block['info']; |
|
321 |
} |
|
322 |
} |
|
323 |
|
|
324 |
$form['ddblock_blocks'] = array( |
|
325 |
'#type' => 'checkboxes', |
|
326 |
'#title' => t('Blocks'), |
|
327 |
'#description' => t('The block(s) that can be used with the dynamic display block module.'), |
|
328 |
'#default_value' => variable_get('ddblock_blocks', array()), |
|
329 |
'#options' => $options, |
|
330 |
'#multiple' => TRUE, |
|
331 |
'#required' => FALSE, |
|
332 |
); |
|
333 |
|
|
334 |
|
|
335 |
$form_state['redirect'] = 'admin/structure/ddblock/list'; |
|
336 |
|
|
337 |
return system_settings_form($form); |
|
338 |
} |
drupal7/sites/all/modules/ddblock/ddblock.class.php | ||
---|---|---|
1 |
<?php |
|
2 |
class ddblockConfigurationSettings { |
|
3 |
|
|
4 |
/** |
|
5 |
* @var array default configuration settings |
|
6 |
*/ |
|
7 |
protected $settings = array( |
|
8 |
'content_type' => array('format' => '%s', 'value' => 'none'), |
|
9 |
'folder' => array('format' => '%s', 'value' => 'images/ddblock'), |
|
10 |
'ignore_files' => array('format' => '%s', 'value' => ''), |
|
11 |
'input_type' => array('format' => '%s', 'value' => 'images'), |
|
12 |
'nodes' => array('format' => '%s', 'value' => ''), |
|
13 |
'node_body_teaser' => array('format' => '%s', 'value' => 'body'), |
|
14 |
'order' => array('format' => '%s', 'value' => 'asc'), |
|
15 |
'output' => array('format' => '%s', 'value' => 'view_content'), |
|
16 |
'widget' => array('format' => '%s', 'value' => 'cycle'), |
|
17 |
); |
|
18 |
|
|
19 |
public function __construct (Array $settings) { |
|
20 |
foreach ($settings as $key => $value) { |
|
21 |
$this->__set($key, $value); |
|
22 |
} |
|
23 |
} |
|
24 |
|
|
25 |
/** |
|
26 |
* Use overload functions to get and set $settings |
|
27 |
* |
|
28 |
* Keys passed to the set function should be keys that already |
|
29 |
* exist in the settings array. |
|
30 |
*/ |
|
31 |
public function __set($key, $value) { |
|
32 |
if (!array_key_exists($key, $this->settings)) { |
|
33 |
return; |
|
34 |
} |
|
35 |
$this->settings[$key]['value'] = sprintf($this->settings[$key]['format'], $value); |
|
36 |
} |
|
37 |
|
|
38 |
/** |
|
39 |
* Use overload functions to get and set $settings |
|
40 |
*/ |
|
41 |
public function __get($key) { |
|
42 |
if (!array_key_exists($key, $this->settings)) { |
|
43 |
return null; |
|
44 |
} |
|
45 |
return $this->settings[$key]['value']; |
|
46 |
} |
|
47 |
|
|
48 |
/** |
|
49 |
* Alternate function to __get |
|
50 |
*/ |
|
51 |
public function get($key, $default) { |
|
52 |
return ($this->__get($key) !== NULL) ? $this->__get($key) : $default; |
|
53 |
} |
|
54 |
|
|
55 |
public function settings() { |
|
56 |
$settings = array(); |
|
57 |
foreach ($this->settings as $key => $value) { |
|
58 |
$settings[$key] = $value['value']; |
|
59 |
} |
|
60 |
return $settings; |
|
61 |
} |
|
62 |
} |
|
63 |
|
|
64 |
class ddblockCycleConfigurationSettings { |
|
65 |
|
|
66 |
/** |
|
67 |
* @var array default configuration settings |
|
68 |
*/ |
|
69 |
protected $settings = array( |
|
70 |
'advanced' => array('format' => '%d', 'value' => 1), |
|
71 |
'container_advanced' => array('format' => '%s', 'value' => 'div.slide'), |
|
72 |
'container_basic' => array('format' => '%s', 'value' => 'div.slide'), |
|
73 |
'custom_jquery' => array('format' => '%s', 'value' => ''), |
|
74 |
'fx' => array('format' => '%s', 'value' => 'fade'), |
|
75 |
'easing_out' => array('format' => '%s', 'value' => 'linear'), |
|
76 |
'easing_in' => array('format' => '%s', 'value' => 'linear'), |
|
77 |
'height' => array('format' => '%d', 'value' => 195), |
|
78 |
'image_height' => array('format' => '%d', 'value' => 183), |
|
79 |
'image_width' => array('format' => '%d', 'value' => 183), |
|
80 |
'image_style_toggle' => array('format' => '%d', 'value' => 0), |
|
81 |
'image_style_slide' => array('format' => '%s', 'value' => '<none>'), |
|
82 |
'image_style_pager_item' => array('format' => '%s', 'value' => '<none>'), |
|
83 |
'max_image' => array('format' => '%d', 'value' => 5), |
|
84 |
'next' => array('format' => '%d', 'value' => 0), |
|
85 |
'nr_of_pager_items' => array('format' => '%d', 'value' => 4), |
|
86 |
'overflow' => array('format' => '%d', 'value' => 1), |
|
87 |
'pager' => array('format' => '%s', 'value' => 'none'), |
|
88 |
'pager_container' => array('format' => '%s', 'value' => 'pager-item'), |
|
89 |
'pager_disable_click' => array('format' => '%d', 'value' => 1), |
|
90 |
'pager_event' => array('format' => '%s', 'value' => 'click'), |
|
91 |
'pager_fast' => array('format' => '%d', 'value' => 1), |
|
92 |
'pager_height' => array('format' => '%d', 'value' => 25), |
|
93 |
'pager_pause' => array('format' => '%d', 'value' => 1), |
|
94 |
'pager_width' => array('format' => '%d', 'value' => 195), |
|
95 |
'pager_position' => array('format' => '%s', 'value' => 'top'), |
|
96 |
'pager_prev_next_loop' => array('format' => '%d', 'value' => 1), |
|
97 |
'pager_scrollable_loop' => array('format' => '%d', 'value' => 1), |
|
98 |
'pager_toggle' => array('format' => '%d', 'value' => 1), |
|
99 |
'pager2' => array('format' => '%d', 'value' => 0), |
|
100 |
'pager2_event' => array('format' => '%s', 'value' => 'click'), |
|
101 |
'pager2_slide_prev' => array('format' => '%s', 'value' => ''), |
|
102 |
'pager2_slide_next' => array('format' => '%s', 'value' => ''), |
|
103 |
'pager2_slide_hide' => array('format' => '%d', 'value' => 0), |
|
104 |
'pause' => array('format' => '%d', 'value' => 1), |
|
105 |
'slide_text' => array('format' => '%d', 'value' => 1), |
|
106 |
'slide_text_after_effect' => array('format' => '%s', 'value' => 'fadeIn'), |
|
107 |
'slide_text_after_speed' => array('format' => '%d', 'value' => 1000), |
|
108 |
'slide_text_after_easing' => array('format' => '%s', 'value' => 'linear'), |
|
109 |
'slide_text_before_effect' => array('format' => '%s', 'value' => 'fadeOut'), |
|
110 |
'slide_text_before_speed' => array('format' => '%d', 'value' => 250), |
|
111 |
'slide_text_before_easing' => array('format' => '%s', 'value' => 'linear'), |
|
112 |
'slide_text_container' => array('format' => '%s', 'value' => 'div.slide-text'), |
|
113 |
'slide_text_jquery' => array('format' => '%d', 'value' => 0), |
|
114 |
'slide_text_position' => array('format' => '%s', 'value' => 'bottom'), |
|
115 |
'speed' => array('format' => '%d', 'value' => 500), |
|
116 |
'template' => array('format' => '%s', 'value' => 'none'), |
|
117 |
'template_size' => array('format' => '%s', 'value' => 'default'), |
|
118 |
'timeout' => array('format' => '%d', 'value' => 5000), |
|
119 |
'width' => array('format' => '%d', 'value' => 195), |
|
120 |
); |
|
121 |
|
|
122 |
public function __construct (Array $settings) { |
|
123 |
foreach ($settings as $key => $value) { |
|
124 |
$this->__set($key, $value); |
|
125 |
} |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* Use overload functions to get and set $settings |
|
130 |
* |
|
131 |
* Keys passed to the set function should be keys that already |
|
132 |
* exist in the settings array. |
|
133 |
*/ |
|
134 |
public function __set($key, $value) { |
|
135 |
if (!array_key_exists($key, $this->settings)) { |
|
136 |
return; |
|
137 |
} |
|
138 |
$this->settings[$key]['value'] = sprintf($this->settings[$key]['format'], $value); |
|
139 |
} |
|
140 |
|
|
141 |
/** |
|
142 |
* Use overload functions to get and set $settings |
|
143 |
*/ |
|
144 |
public function __get($key) { |
|
145 |
if (!array_key_exists($key, $this->settings)) { |
|
146 |
return null; |
|
147 |
} |
|
148 |
return $this->settings[$key]['value']; |
|
149 |
} |
|
150 |
|
|
151 |
/** |
|
152 |
* Alternate function to __get |
|
153 |
*/ |
|
154 |
public function get($key, $default) { |
|
155 |
return ($this->__get($key) !== NULL) ? $this->__get($key) : $default; |
|
156 |
} |
|
157 |
|
|
158 |
public function settings() { |
|
159 |
$settings = array(); |
|
160 |
foreach ($this->settings as $key => $value) { |
|
161 |
$settings[$key] = $value['value']; |
|
162 |
} |
|
163 |
return $settings; |
|
164 |
} |
|
165 |
} |
|
166 |
|
|
167 |
class ddblockCycleMappingSettings { |
|
168 |
|
|
169 |
/** |
|
170 |
* @var array default configuration settings |
|
171 |
*/ |
|
172 |
protected $settings = array( |
|
173 |
0 => array('target' => 'node_id', 'source' => '', ), |
|
174 |
1 => array('target' => 'slide_image', 'source' => '', ), |
|
175 |
2 => array('target' => 'slide_title', 'source' => '', ), |
|
176 |
3 => array('target' => 'slide_text', 'source' => '', ), |
|
177 |
4 => array('target' => 'slide_read_more', 'source' => '', ), |
|
178 |
5 => array('target' => 'pager_image', 'source' => '', ), |
|
179 |
6 => array('target' => 'pager_text', 'source' => '', ), |
Formats disponibles : Unified diff
Deletion of Dynamic Display Block (ddblock) because of vulnerability