Description (copied from project page)
"Gallery link is a module which place a link on your site which triggers a slideshow.
Installation
- Download fancybox 1.3.4 from fancybox.net
- Unzip the archive and put the fancybox folder inside into
sites/all/libraries
(sojquery.fancybox-1.3.4.pack.jsis located atsites/all/libraries/fancybox/jquery.fancybox-1.3.4.pack.js)
Usage
There are some functions which you can use:
theme('gallery_link', $items, $link_text, $style, $link_options = array(), $fancybox_options = array());
Returns a link which triggers a slideshow
$items - Is an array which contains the images. (optional) You can add 'title' to each element which will be used as caption in the fancybox
$link_text - This is the text of the trigger link
$style - The images will be display with this image style
$link_options - (optional) Here can you pass an array which is structured like the options from the l() function
$fancybox_options - (optional) Here you can pass an array which defines the fancybox options (http://fancybox.net/api)
TODO
Example
$images = array();
$images[] = array('file' => 'http://drupal.org/files/druplicon.small_.png', 'title' => 'just druplicon');
$images[] = array('file' => 5, 'title' => 'nice five');
$images[] = array('file' => '/themes/garland/logo.png');
$link_options = array(
'attributes' => array(
'class' => 'foo',
),
);
$fancybox_options = array(
'overlayColor' => '#fff',
);
return theme('gallery_link', $images, t('Click to open gallery'), 'large' $link_options, $fancybox_options);
}
So we get a link with the label "Click to open gallery" and on click it triggers a gallery displaying our three images with the image style "large"."
Project Page
http://drupal.org/sandbox/yan_nick/1340136
Repository
git clone http://git.drupal.org/sandbox/yan_nick/1340136.git gallery_link
Versions
Drupal 7
There is no similar module.
| Comment | File | Size | Author |
|---|---|---|---|
| #47 | drupalcs-result.txt | 2.61 KB | klausi |
| #28 | pareview_result.txt | 2.4 KB | doitDave |
Comments
Comment #0.0
yannickooChanged tag.
Comment #1
klausiwrong branch name, 6.x-1.0 should be 6.x-1.x. And remove the 6.x-1.0 tag, it points to an old commit that surely will not be your 1.0 version.
Comment #1.0
yannickoo$fid -> $file
Comment #1.1
yannickooChanged theme function and git repo.
Comment #1.2
yannickooAdded $fancybox_options support
Comment #2
yannickooI deleted the tag "6.x-1.0" and the branch "6.x-1.0" but it even apperas in the select list in the git introductions :/ – Can you tell me how to remove it?Branch "6.x-1.0" is deleted.
Comment #3
yannickooCan we submit my module now?
Comment #4
raynimmo commentedAutomated Review
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Code Reviews
When running the Coder module make sure that it is set to 'minor'. There are also a host of optional add ons that run with Coder and help to spot errors in your code such as Coder Tough Love, the Translation Template Extractor and Text Review to name some of the more popular ones. There is also a really good script called PAReview.sh that does a great job of spotting errors, its still a sandbox project though so is liable to changes.
Manual Review
@filedocumentation block is missing in the module file, see Doxygen and comment formatting conventions with regards to documenting filesgallery_link.module - line 39
Dont escape apostrophes instead change your outer quotation marks. Using an escape can create trouble for translators.
t('Imagecache preset %preset doesn\'t exist.')becomes
t("Imagecache preset %preset doesn't exist.")Other than those points above everything seems kinda clean.
Good luck with the rest of your review.
Comment #5
yannickooSo I fixed that and now my module should be fine :)
Comment #6
doitDave commentedHi,
is there a reason you apply for the review process with more than one module? As of http://drupal.org/node/1011698 this is meant to be a one-time process (so one successful application is enough to achieve full project access).
As the review queue is long and there far more applications than active reviewers (which is a real issue IMO and could be solved if more applicants would do reviews theirselves ;)), please decide whether you want rather this project here or #1330914: [D6] Taxonomy term color to be pursued and close the one you do not decide for.
No offense, I hope you understand!
-dave
Comment #7
yannickooNo problem dave, I want to have this one here. Taxonomy term color can be reviews later ;)
Comment #8
yannickooComment #9
tr commentedAll your files end with a blank line. This is wrong. Use Drupal core as an example and you will see that no core files have trailing blank lines.
Comment #10
yannickooComment #11
tr commented... and yours end with TWO newlines. Again, look at core Drupal to see how it differs from what you've done.
Comment #12
yannickooThat wasn't my intention – Fixed it :)
Comment #13
tr commentedComment #14
jthorson commentedand
Can you update your docblock to explain the optional 'title' key? I don't know where this is coming from, so I can't verify whether it should be run through check_plain() or not (though I suspect it should).
Comment #15
klausiREADME.txt has used two newlines at the end, which was wrong and is correct now. But now you have removed the single newlines from the other files as well which is not correct.
Comment #16
tr commented@klausi: ? What you are saying is obviously not true. Looking at this project as of commit 0da5857b, README.txt currently has a blank line at the end (TWO \n characters), while all the other files have only a single \n (ASCII 0x0A) at the end, as needed and required by the coding standards. This is easy to verify by using hexdump on the files, and I have attached the output below for you to see (make sure you're looking at the right commit). hexdump doesn't interpret the files, it just shows the binary contents, so there is no mistaking what's currently in there. If you see something different, it's because of the editor and/or IDE you're using, which I suspect is Windows-based if it doesn't deal with line endings properly.
Regardless, here is not the right place to discuss problems with PAReview.sh. I suggest we continue this in #1340276: Newline test.
last line of hexdump of gallery_link.info. Note there is exactly one newline at the end:
last line of hexdump of gallery_link.js. Note there is exactly one newline at the end:
last line of hexdump of gallery_link.module. Note there is exactly one newline at the end:
last line of hexdump of README.txt. Note there are two newlines at the end:
Comment #17
yannickooSorry guys but I have only one new line in README.txt, gallery_link.info, gallery_link.js, gallery_link.module.
Can you look again on it?
Comment #18
yannickooComment #19
jthorson commentedThe newline issue has been addressed.
yan_nick:
Can you address my comment in #14? Shouldn't take much, just a tweak of the function documentation - and possibly sanitation of the $title variable. (We discussed this in IRC earlier this week, but it doesn't look like it made your code ... though if you feel it's not required, then just explain why.)
Thanks!
Comment #19.0
yannickooChanged git repo.
Comment #19.1
yannickooChanged description for $items.
Comment #20
yannickooOkay, it's explained now.
Comment #21
jthorson commentedWhere does 'title' come from? Is it user supplied code which is then output to the screen without sanitization?
If so, than this is a XSS vulnerability, which is a show-stopper from the 'application review' perspective.
Comment #22
yannickooNo, it's fixed now:
I thought it's better to use filter_xss() but if other users want to use this module to displaying images from users check_plain() is better so that their users cannot add html code to the descriptions (titles).
Comment #23
yannickooComment #24
doitDave commentedYes, with user provided input it is always best choice to use check_plain. You never know who will be using your module, in which scope and with which permissions granted to whom. (If that is too tough at one place, you will soon enough receive an issue report from someone. Better safe than sorry!) I will have a closer look in this relation in the next round, unless someone else is faster ;)
Your project page shows that you have taken care of it, I like that! Probably it would even improve with one or two screenshots (but does not need to). Also you have already read into the Drupal JS API. Good! :)
Same for doxygen function blocks - except that you omit @return statements, as e.g. in http://drupalcode.org/sandbox/yan_nick/1340136.git/blob/refs/heads/6.x-1... although your function does return something.
I have ran the most recent review script releases on your code; find the results attached.
hth,
dave
Comment #25
jthorson commenteddoItDave:
Our discussion was whether the module would allow html captions ... so in this case, filter_xss() is probably fine; as check_plain() would eliminate that possibility.
Good catch on the @return statements ... these should be added to the function documentation.
Comment #26
yannickooThanks for your reviews! I want to use check_plain(). Later I can add an option where users can set whether html is allowed or not. But per default I want check_plain().
I added @return to the doxygen block.
All is clear then right?
Comment #27
doitDave commentedWell well, just because the pareview script was wrong on the line endings thing it is not the case that it and drupalcs would not provide important information... didn't you check the latest result? .-(
@jthorson Ok, I was not sure.
Comment #28
doitDave commentedWaaah... I should really attach files once I promise to. Argh!
Here you go.
Comment #29
yannickooSo,
substris nowdrupal_substrand the trailing space in line 4 was removed.Can anybody explain me what's wrong with:
watchdog('gallery_link', t("Imagecache preset %preset doesn't exist.", array('%preset' => $preset)), array(), WATCHDOG_ERROR);Comment #30
jthorson commentedLooks like a false positive to me.Example from user.module:
watchdog('user', 'New user: %name (%email).', array('%name' => $name, '%email' => $mail), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit'));Note: No t() call.
Comment #31
yannickooMeans my code is right and klausi's PAReview.sh was wrong?
Comment #32
jthorson commentedSee edit above.
Comment #33
yannickooOkay, that's fixed now!
Comment #34
jthorson commentedStill missing in documentation ... but the reason is that dblog uses t() when displaying the messages ... so wrapping them in t() when saving to the database results in double-translation.
Comment #35
jthorson commentedOoops ... crosspost.
Comment #36
yannickooSorry jthorson but I doesn't understand what do you mean. I should wrap $message in t() function when I've got two variables or what is "double-translation"?
Comment #37
jthorson commentedMy understanding is that you don't need to use t() in the watchdog() command (which inserts the message into the database), because the t() will be applied when the value is read from the database on output.
Comment #38
yannickooAh okay, understand it. But now everything is clear and this here is reviewed and tested by the community right?
Comment #39
doitDave commentedAutomated review (Please keep in mind that this is primarily a high level check that does not replace but, after all, eases the review process. There is no guarantee that no other issues could show up in a more in-depth manual follow-up review.)
Review of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Manual review:
Did we just miss all that before? Have you changed so much recently?
hth, dave
Comment #40
yannickooThank you for your review dave. I extended my module and it has some new functionality now. I will fix all these "errors" ASAP.
Yannick
Comment #41
yannickooOkay dave, I updated the gallery_link.module file. Can you review it again?
Yannick :)
Comment #42
jthorson commented$path = url("file_directory_path()/imagecache/$preset/$path");Just a matter of precedence, but I'd probably update this to read
$path = url(file_directory_path() . "/imagecache/" . $preset . "/" . $path);... it becomes more clear to me how the string is being assembled.Comment #43
yannickoo@jthorson in comment #39 you can see that I shouldn't concat the imagecache strings.
What should I do now?
Comment #44
patrickd commentedReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Source: http://ventral.org/pareview - PAReview.sh online service
Comment #45
yannickooThanks patrickd, it's fixed now!
Comment #46
yannickoo@jthorson as you can see I had to remove string concat.
Comment #47
klausiReview of the 6.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.
manual review:
Comment #48
yannickooOkay I fixed all your errors. Can anybody review it again?
Comment #48.0
yannickooChanged description for $items.
Comment #48.1
yannickoo-> Drupal 7
Comment #48.2
rudiedirkx commentedD6, not D7
Comment #49
jthorson commentedThis application has had plenty of reviewers look at it, and quick and consistent response from the applicant. There's no reason this should sit for 7 weeks without feedback ... on behalf of the Drupal community, my apologies to yannickoo (and let's push this through!)
Comment #50
patrickd commentedYep, right, let's get this done. (assigning before mlncn commes and takes it :P)
Comment #51
yannickooMade my day ♥ I'm so happy that this project is finally RTBC!
Comment #52
patrickd commentedcall_user_func_array('array_merge', $fancybox_options);should not be needed afterwards)I'm pretty sure yannick is up to the task and steadily increasing his drupal knowledge to become a great maintainer ;-)
So, thanks for your contribution and welcome to the community of project contributors on drupal.org!
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #53.0
(not verified) commentedD7
Comment #54
avpaderno