Forum OpenACS Development: proposal to add string_truncate_middle to oacs core

I'm using string_truncate_middle (xotcl-request-monitor/tcl/throttle_mod-procs.tcl) on .LRN file-storage and forums. I think it's a very useful function that should be in oacs core (acs-tcl/tcl/text-html-procs.tcl), due to xotcl is not require to install .LRN.

On the other hand... .LRN improvement:

Why did I use it? some users have uploaded files with very long names (for instance: MODIFICACIONES_AL_REGLAMENTO_ELECTORAL_GENERAL_aprobado_por_el_Consejo_PROPUESTA_MODIFICACION_REGL_ELECTORAL_2008.doc), so the actual file storage listing breaks on small screens (even with 1024 pixels wide!!) So, the only thing I've found that works well is... truncating he file name on html text, and showing the complete name in a tooltip.

The reason not to cut the end of the file name is because of, sometimes, files start the same way but ends with a date, year, or something that changes (only at the end). Also the file extension, appears at the end.

---cutting the end:
MODIFICACIONES_AL_REGLAMENTO_ELECTORAL_...
MODIFICACIONES_AL_REGLAMENTO_ELECTORAL_...
MODIFICACIONES_AL_REGLAMENTO_ELECTORAL_...
---cutting the middle:
MODIFICACIONES_AL_REGL...ELECTORAL_2006.doc
MODIFICACIONES_AL_REGL...ELECTORAL_2007.odt
MODIFICACIONES_AL_REGL...ELECTORAL_2008.pdf

Anyway, I've added a package parameter (file-storage) to enable/disable the file name truncation with the maximum chars value (zero = not truncate). If that feature is interesting for .LRN I could upload the (really simple) code.

Collapse
Posted by Dave Bauer on
Sounds like a good idea to me.

Gustaf, any objection to move this?