1. the location of the file icons (and the syntax for file names) should be documented (create a subdir named icons in the module directory)
2. a set of standard icons could be included with the module (look at http://drupal.org/files/issues/mimetypes-01.zip.txt). Also an icon for directories should be added to this set.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Susurrus’s picture

So I can't open that zip archive, if it is even a zip archive.

I've looked at the Tango icon set that Gnome uses because we need to use GPL-compatible icons. I would also like to change the icon folder location so that it's per theme, which makes a lot more sense than having just one icon set for the module, especially for a multisite Drupal setup. So I'd include standard file icons in /modules/filebrowser/icons and then users can override these with icons named correctly in a icons folder in their theme. That would make the most sense and keep the number of steps required to correctly install the module at 1.

clauded’s picture

The file can be opened with File Roller under Gnome (remove the txt extension). The icons are GPL. Anyway, your suggestion to use Tango icons is as good. It's also a good idea to be able to overide the icons with the theme.

I've also read somewhere that there should be a set of standard icons with Drupal 7 but we're not there yet...

Susurrus’s picture

I don't plan on updating Filebrowser for 7.x probably for another month. DB:TNG just landed, but it'll be a few weeks for the bugs to be sorted out and the docs to be updated. I plan on adding tests to Filebrowser before I update to 7.x so I can update the tests at the same time.

I can't open that zip file in OS X. I haven't checked out the icons in Tango recently, but they've been doing a good job fleshing out the set.

As for a basic set of icons we definitely need the following:
Text document
Unknown/Default
Image (any type)
PDF
Archive (tgz, zip, rar, etc.)

I think that this issue should just cover those icons for now and the framework for overriding icons. We can expand the set later and with the Unknown/Default icon, it shouldn't be a problem.

Susurrus’s picture

Looks like someone already did most of the work grabbing file icons for us:
http://compsci.ca/blog/dotproject-file-icons-mod/

Susurrus’s picture

FileSize
22.25 KB

So here's all the supported icons from the Tango Icon Library. 16px by 16px seems the right size. People could override the size by just putting custom icons in their theme.

So, now the question is how do we look up icons for a particular file....determining by MIME-type can't be trusted as that can't be guaranteed to work on a given system. We'll just have to use filetypes, so probably an associative array mapping file type endings (so in the case of a ".tpl.php" file it'd be "php") to the corresponding image. A file by the name of FILETYPE-icon.png would be looked for first and then this array so that new file types could be added just by adding new images and so that the existing defaults could be overridden. With the icons I've attached, I plan on mapping various file endings to the same icon (audio and video is a good example of this).

Susurrus’s picture

FileSize
4.83 KB
9.04 KB

Here's my first run at this. Supports a bunch of common audio/video/image formats as well as some plaintext, presentation, document, and spreadsheet formats. A folder, parent folder, and default icon have all been provided as well. Extract the icons in /icons in your theme or the filebrowser module directory and apply this patch.

clauded’s picture

The patch looks good. However I would provide a specific icon for PDF files because they are so prevalent (add 'pdf' => 'document-pdf' in the array and a document-pdf-icon.png file).

Also I wonder if a theme already has a icons subdir, would it be a good idea to name the icons something like fb-.pdf so they would be easily distinguished?

Susurrus’s picture

Version: 6.x-2.0-rc5 » 6.x-2.x-dev
Status: Active » Needs review

I haven't seen a suitable PDF icon, but I did want to add it. I don't see a need to add it to the mapping and just let the filename be named like a specific file extension.

I think fb-icon-*.png would be acceptable. It's not too long and clearly describes what the icon is for. I haven't seen any news on the icons directoryin 7.x and I'd really like to keep this compatible with that. Maybe we can try to push #138489: named and themed icons along?

Anonymous’s picture

Very good work. I've added two icons (executable and script + array) from the Tango package (#5). For my installation I renamed the files and the code to icon-$iconname.png. The modules/filebrowser/icons is a good place, imho. An extra PDF icon would be nice but there isn't an appropriate icon in the current Tango package (0.8.1).

Susurrus’s picture

You shouldn't need to modify the code at all to override the current defaults, just be more specific, unless you're using the mapping capabilities. I'd like to look into a way to extend this easily, but I think for now it's fine.

I was thinking of adding the executable (exe, sh, bat, etc.) and script icons (php, js, c, python, java), but the ones with Tango are so bland that they really aren't very descriptive and I don't think people would really understand them easily. Do you think we should add them?

Anonymous’s picture

Yes, I think we should add the two icons until we have new/better GPL-compatible ones.

clauded’s picture

FileSize
406 bytes

I'm a bit lost here : to display a pdf icon, we need to modify the array, right?

As for a Tangoish pdf icon, it's not created yet but we could use this one from my previous suggestion icon set.

Susurrus’s picture

that icon would work. The array is only for mapping filetypes to the same icon. If you name your file right the icon will be displayed automatically.

Anonymous’s picture

we could use this one from my previous suggestion icon set

This PDF icon isn't suitable, imho. And it looks like an icon of an official Adobe program. ;-)

Susurrus’s picture

Status: Needs review » Fixed

Alright, I'm not adding icons for executables/executable-scripts or PDFs as I don't like the icons for them. I'd renamed the icons so the pattern is "fb-ICONNAME-icon.png".

clauded’s picture

Status: Fixed » Active

I've tested the latest dev build (v 1.9.2.8.2.33 2008/08/24 17:15:04) and I cannot override the icons with themed icons : I renamed the icons dir in the Filebrowser module, created one in my theme (with icons in it of course) but nothing is displayed. Can you reproduce the problem?

Susurrus’s picture

Status: Active » Postponed (maintainer needs more info)

You don't need to remove the icons directory in the filebrowser directory first of all. The point of the override is that you don't have to configure anything.

So I need more details. You had a file named X and you have an icon named Y that was of the form "fb-XFILEEXTENSION-icon.png" in the /icons directory of your theme.

Please fill in X and Y...

clauded’s picture

Do this simple test : copy the icons directory to the theme and remove the icons directory in the module. No icons will appear.

In the generated code, no icons were found : <td style="width:1%;"></td>.

clauded’s picture

FileSize
471 bytes

By the way, I created a Tangoish pdf icon.

Susurrus’s picture

clauded: I think I'm in agreement with BENNYSOFT where the icon is too much an Adobe icon. I think it should be more generic like maybe just say PDF in red on it instead of use the Adobe swoosh. What's the copyright on that swoosh-thing anyways?

clauded’s picture

FileSize
363 bytes

Oh well : PDF is an open standard created by Adobe. I don't think Adobe will sue anybody who use a logo that promote their company... Here's a link to the copyright on pdf icons : http://www.adobe.com/misc/linking.html#pdficon

Here's a dull PDF in red icon (is red also copyrighted by Adobe?)

;)

Now for the override, have you been able to reproduce the bug?

Anonymous’s picture

I don't think Adobe will sue anybody who use a logo that promote their company

Claude, Open Source and a corporate identity are different things. You can make your own icons and use these icons wherever you want. It's in your own responsibility.
This module can be used with Drupal on personal and corporate web sites and must use GPL-compatible icons. It's in the responsibility of the maintainer (Susurrus).

Here's a link to the copyright on pdf icons : http://www.adobe.com/misc/linking.html#pdficon

"The Adobe PDF file icon is provided solely as an indicator of an active link to a Portable Document Format file with a .pdf filename extension created using an Adobe Acrobat product."
What's with PDF creators of third parties?

#1 (distribution in a module), #3 (altering), #4-8 (can you guarantee this?), and #10 ("These guidelines do not give you permission to use any other Adobe logos, icons, or trademarks.") of these guidelines are against the use of any Adobe/PDF icon in this module, imho.

Why isn't the PDF icon in the Tango package? ;-)

is red also copyrighted by Adobe?

Not copyrighted but trademarked? :-P
It's not a joke: The Deutsche Telekom has the color magenta registered as a trademark in Germany (and maybe in other countries).

clauded’s picture

FileSize
432 bytes

If you read carefully Adobe's licence, you'll find it applies to the 2 icons presented on their website. This was not the case with the icons I proposed in the first place that were merely inspired by I don't know what.

So here's my final proposition : the icon in OpenOffice Tango icon set. Not sure what Sun has to say about this...

Susurrus’s picture

Title: File icons » Add PDF file icon
Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

I think I prefer the icon in #21 as it's easier to read, so let's go with that one.

As far as the bug, I haven't had a chance to figure it out. I'm moving out to California in a couple of days, so the next couple weeks will be pretty crazy for me.

Let's keep this issue about the PDF icon and create a new one about the bug.

stefan_seefeld’s picture

I'v been looking for a way to view *any* icon in directory nodes at all. Right now I don't see any. As this issue seems to be (almost) resolved, is there a chance to get a new release of this module out in the near future, containing all the new code that allows me to configure per-mime-type icons ?
Many thanks,
Stefan

Susurrus’s picture

The development branch that this issue pertains to contains this code as that's released nightly. I'll be releasing a final 2.0 version once all issues are resolved, until then use 6.x-2.x-dev.

Yoran’s picture

Status: Reviewed & tested by the community » Closed (fixed)

The way of handling icons changed a bit, now it's easy to add you own. Basicaly when searching an icon for a file, the module first get mime-type XXX/YYY. Icon will be :
module_path/icons/XXX-YYY.png
module_path/icons/XXX.png
theme_path/filebrowser/XXX-YYY.png
theme_path/filebrowser/XXX.png

Please, reopen this issue if this not filling your needs.