Forums | Mahara Community

Support /
Filenames shortened


anonymous profile picture
Account deleted
Posts: 78

31 March 2011, 8:39

When a user uploads a file to their files area and then places it in a view the filename gets shortened to about 15 or 16 characters, is there any way this can be increased or changed so that the end of the filename is removed rather than the middle.

Look forward to yoyr responses.

Kevin

anonymous profile picture
Account deleted
Posts: 808

06 April 2011, 17:13

Hi Kevin,

I'm afraid you can only change it if you're willing to make a simple modification to the code - this stuff is always in a call to the str_shorten_text function somewhere.  If you're interested let me know and I'll post the gory details here.

R.

anonymous profile picture
Account deleted
Posts: 78

08 April 2011, 5:33

Thanks Richard

I found the code and changed it, all is now rosy in the Mahara garden.

Kevin

anonymous profile picture
Account deleted
Posts: 3

24 November 2011, 8:11

Hi,

I would like to change the filename size limit too but I was not able to change the code by myself.

I tried changing the limit from 30 to 130 in these files:

artefact/file/lib.php:            $artefact->description = str_shorten_text($artefact->title, 30);
artefact/file/lib.php:            $artefact->description = str_shorten_text($folderdata->ownername . $path . $artefact->title, 30);
artefact/file/blocktype/folder/lib.php:        $artefact->description = str_shorten_text($folderdata->ownername . $path . $artefact->title, 30);
theme/raw/templates/edittags.tpl:    <a class="tag{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}edittags.php?tag={$t->tag|urlencode|safe}">{$t->tag|str_shorten_text:30}&nbsp;<span class="tagfreq">({$t->count})</span></a>
theme/raw/templates/tags.tpl:    <a id="tag:{$t->tag|urlencode|safe}" class="tag{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}tags.php?tag={$t->tag|urlencode|safe}">{$t->tag|str_shorten_text:30}&nbsp;<span class="tagfreq">({$t->count})</span></a>
theme/raw/templates/collectionnav.tpl:  <li{if $view->view == $viewid} class="selected"{/if}><a href="{$WWWROOT}view/view.php?id={$view->view}">{$view->title|str_shorten_text:30:true}</a></li>

 

Can someone please tell where I have to change the code to allow files with longer filenames?

thanks in advance,

Markus

anonymous profile picture
Account deleted
Posts: 808

24 November 2011, 14:44

Markus, if you just do a search you'll eventually find it.  The one for the main files area and file chooser in the block configuration forms is in htdocs/artefact/file/theme/raw/form/filelist.tpl

When displaying a view it's usually a different template for each block type, for example, to change the "files to download" block, you need to edit htdocs/artefact/file/blocktype/filedownload/theme/raw/filedownload.tpl

anonymous profile picture
Account deleted
Posts: 3

25 November 2011, 2:46

Thank you Richard, it's working.

6 results