Forums | Mahara Community
Support
/
Display Full File Names
08 February 2010, 6:06
Hi
Our students have uploaded files where a selection of these files have long file names. The files names will not display the file's full title within a View for example. Can anyone direct me to the code where I can allow the full name of the files to be displayed?
Many thanks
Ali
09 February 2010, 18:37
They are all calls to functions called 'str_shorten_text' and 'str_shorten_html' spread about a bit in various bits of display code. You can use grep to find them all if you need to. For example, the call that shortens filenames in the 'files to download' block is in the file htdocs/artefact/file/blocktype/filedownload/lib.php.
You can just replace the call
str_shorten_text($artefact->get('title'), 20)
with
$artefact->get('title')
In other places the str_shorten call is inside a template, for example the one in the my files list is in htdocs/artefact/file/theme/raw/form/filelist.tpl; you'll need to replace
{assign var=displaytitle value=$file->title|str_shorten_text:34|escape}
with
{assign var=displaytitle value=$file->title|escape}
10 February 2010, 9:07
Thanks Richard,
This is what I was looking for, worked a treat.
Cheers
Ali