How to view more file-types in JCE 1.5.1

Posted by: gbluma

Tagged in: Untagged 

JCE is a great tool. It works far better than the default tiny_mce that ships with Joomla. Problem is, it still has a few little bugs here and there--and in this case a lack of configurability.

JCE has a default set of file-types is recognizes as usable for inserting, as a link, into content. These include:

html, htm, doc, docx, ppt, rtf, xls, txt, gif, jpeg, jpg, png, pdf, swf, mov, mpeg, mpg, avi, asf, asx, dcr, flv, wmv, wav, mp3

But what if you want to add a new one--like V-Card files? (.vcf)

In order to do this we need ot edit one of the core files in JCE.

on line 11 of joomla/plugins/editors/jce/tiny_mce/plugins/browser/classes/browser.php change:

var $_ext = 'xml=xml;html=htm,html;word=doc,docx;powerpoint=ppt;excel=xls;
text=txt,rtf;image=gif,jpeg,jpg,png;acrobat=pdf;archive=zip,tar,gz;
flash=swf;winrar=rar;quicktime=mov,mp4,qt;windowsmedia=wmv,asx,asf,avi;
audio=wav,mp3,aiff;openoffice=odt,odg,odp,ods,odf';

to:

var $_ext = 'xml=xml;html=htm,html;word=doc,docx;powerpoint=ppt;excel=xls;
text=txt,rtf;image=gif,jpeg,jpg,png;acrobat=pdf;archive=zip,tar,gz;
flash=swf;winrar=rar;quicktime=mov,mp4,qt;windowsmedia=wmv,asx,asf,avi;
audio=wav,mp3,aiff;openoffice=odt,odg,odp,ods,odf;vcard=vcf';

and then on line 86 of the same file change:

return $this->getPluginParam( 'browser_extensions_viewable', 
'html,htm,doc,docx,ppt,rtf,xls,txt,gif,jpeg,jpg,png,pdf,swf,
mov,mpeg,mpg,avi,asf,asx,dcr,flv,wmv,wav,mp3' );

to:

return $this->getPluginParam( 'browser_extensions_viewable', 
'html,htm,doc,docx,ppt,rtf,xls,txt,gif,jpeg,jpg,png,pdf,swf,
mov,mpeg,mpg,avi,asf,asx,dcr,flv,wmv,wav,mp3,vcf' );
Comments (0)add comment

Leave a Comment

busy