plainblack.com
Username Password
search
Bookmark and Share

Attachment Type Icons

One thing you probably notice about WebGUI if you’ve ever uploaded a file to it is that it automatically displays an icon representing the type of document you’ve uploaded. The icons are always the icon you’d see in Windows Explorer or Mac Finder when looking at files on those operating systems.

Unfortunately there is no way for WebGUI to automatically extract the icons from the files that are uploaded, so it has to do a little bit of magic to fool you into thinking that’s what it has done.

In your WebGUI installation, take a look at the contents of this folder:

 

/data/WebGUI/www/extras/fileIcons

 

You’ll notice there are a few dozen small image files in that folder. Each file is an icon for a file type.

 

Adding New File Types

Why would there be a chapter in this book about attachment type icons unless you could modify them! The good news here is that WebGUI’s internal code knows nothing about these icons except for the folder they are in. Therefore you can add new types. For example, you may have a CAD system in-house that use to create drawings, and then upload those drawings to your intranet that’s built on WebGUI. WebGUI has no way of knowing what every program out there is, so this enables you to add your own icons for the programs that your organization uses in house. Here’s how:

  1. Create an image file that is 16 pixels wide, and 16 pixels tall, which includes the icon for the document type you’d like to add.

  2. Save that file as a GIF with a filename of extension.gif where the word extension is replaced with the document’s normal file extension. For example, a Microsoft Word® document has an extension of doc.

  3. Place the image into /data/WebGUI/www/extras/fileIcons.

That’s all there is to it. Any files you’ve already uploaded with that extension, will now start using that icon. Likewise any files you upload in the future that use that extension will also use that icon.

You can add as many icons for as many programs as you like in this way. If it’s a common program and you think that it’s icon should be added to the core then you can file an RFE for it. See the More Resources chapter later in this book on how to submit an RFE.

Keywords:

Search | Most Popular | Recent Changes | Wiki Home
© 2018 Plain Black Corporation | All Rights Reserved