This patch add a 3 new options:
description: set descript.ion filename which is ".descript.ion" by default
name: you can customize the displayed name
title: you can customize the title (browser show up in a tooltip)

In name and title you can use the following tokens:
%f -> filename with extension e.g. LICENSE.txt,
%b -> filename without extension e.g. LICENSE
%e -> extension e.g. txt,
%m -> metainfo (read from description)
%mf -> metainfo, or if no metainfo than filename
%mb -> metainfo or basename
%lf, %lb, %le, %mlf, %mlb -> use lovercase filename, basename, extension e.g. license.txt
%uf, %ub, %ue, %muf, %mub -> use uppercase e.g. LICENSE.TXT

descript.ion files are standard BBS descript.ion files:

The format of descript.ion files is very simple. It is a text file, with lines in the format of:
<filename><single space><arbitrary description>
For example:
DESCRIPT.ION Mapping of file names to descriptions
It is now possible for filenames to have spaces in them, so the format has evolved a little to additionally include:
<“quoted filename”><single space><arbitrary description>

CommentFileSizeAuthor
filetree_description.diff5.86 KBszaszg
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joelstein’s picture

Status: Active » Fixed

Great idea! Thanks for the patch. I modified a few things.

I added four new options—dirname, dirtitle, filename, and filetitle—instead of just name and title, so you can use different patterns for directories and files.

I'm not a fan of the cryptic short tokens, so I used some longer ones: %filename, %basename, and %extension. I also used Drupal's token system to define and replace these, instead of the parse function you provided. I did not add uppercase/lowercase support, but would be happy to consider it in a new issue.

Lastly, I added .descript.ion support. I did not create this as a token, since I figured that if you are using .descript.ion, you can change the filenames there to whatever you want. So, if the .descript.ion file is present and your directory or file is "described", it will override the above options.

Committed to 7.x-1.x:
http://drupal.org/commitlog/commit/16200/ecc8aed2bbf23c366aaaeb6d24d2f2a...

A new release and a backport to D6 will be coming shortly.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.