use proper extras url for file icons

This commit is contained in:
Graham Knop 2008-08-14 15:45:05 +00:00
parent 478dc1d085
commit d721cafc8e
2 changed files with 137 additions and 134 deletions

View file

@ -241,25 +241,23 @@ Renders a file upload control.
sub toHtml { sub toHtml {
my $self = shift; my $self = shift;
my $i18n = WebGUI::International->new($self->session); my $i18n = WebGUI::International->new($self->session);
my $uploadControl = undef; my $uploadControl = '';
my $storage = $self->getStorageLocation; my $storage = $self->getStorageLocation;
my @files = @{ $storage->getFiles } if (defined $storage); my @files = @{ $storage->getFiles } if (defined $storage);
my $maxFiles = $self->get('maxAttachments') - scalar(@files); my $maxFiles = $self->get('maxAttachments') - scalar(@files);
if ($maxFiles > 0) { if ($maxFiles > 0) {
$uploadControl = '<script type="text/javascript" src="'.$self->session->url->extras('FileUploadControl.js') .'"></script>'; $self->session->style->setScript($self->session->url->extras('FileUploadControl.js'),{type=>"text/javascript"});
$self->session->style->setScript($self->session->url->extras('fileIcons.js'),{type=>"text/javascript"});
$uploadControl .= '<noscript> $uploadControl = '<script type="text/javascript">'
. sprintf(q!var uploader = new FileUploadControl("%s", fileIcons, "%s","%d", "%s"); uploader.addRow();!
</noscript>'; , $self->get("name")."_file", $i18n->get("removeLabel"), $maxFiles, $self->get("size"))
$uploadControl .= '<script type="text/javascript" src="'.$self->session->url->extras('fileIcons.js') .'"</script>'; . '</script>'
$uploadControl .= '<script type="text/javascript">'; . WebGUI::Form::Hidden->new($self->session, {
$uploadControl .= sprintf q!var uploader = new FileUploadControl("%s", fileIcons, "%s","%d", "%s"); uploader.addRow(); </script>! name => $self->privateName('action'),
, $self->get("name")."_file", $i18n->get("removeLabel"), $maxFiles, $self->get("size"); value => 'upload',
$uploadControl .= WebGUI::Form::Hidden->new($self->session, { id => $self->get('id')
name => $self->privateName('action'), })->toHtml
value => 'upload', . "<br />";
id => $self->get('id')
})->toHtml()."<br />";
} }
else { else {
$uploadControl .= WebGUI::Form::Hidden->new($self->session, { $uploadControl .= WebGUI::Form::Hidden->new($self->session, {

View file

@ -1,119 +1,124 @@
var fileIcons = new Array(); var fileIcons;
fileIcons["p65"] = "/extras/fileIcons/p65.gif"; (function(){
fileIcons["exe"] = "/extras/fileIcons/exe.gif"; var extras = getWebguiProperty('extrasURL');
fileIcons["class"] = "/extras/fileIcons/class.gif"; fileIcons = {
fileIcons["xls"] = "/extras/fileIcons/xls.gif"; "123" : extras + "fileIcons/123.gif",
fileIcons["dia"] = "/extras/fileIcons/dia.gif"; "abw" : extras + "fileIcons/abw.gif",
fileIcons["hqx"] = "/extras/fileIcons/hqx.gif"; "ace" : extras + "fileIcons/ace.gif",
fileIcons["mp3"] = "/extras/fileIcons/mp3.gif"; "ai" : extras + "fileIcons/ai.gif",
fileIcons["js"] = "/extras/fileIcons/js.gif"; "arj" : extras + "fileIcons/arj.gif",
fileIcons["arj"] = "/extras/fileIcons/arj.gif"; "as" : extras + "fileIcons/as.gif",
fileIcons["ace"] = "/extras/fileIcons/ace.gif"; "avi" : extras + "fileIcons/avi.gif",
fileIcons["sxc"] = "/extras/fileIcons/sxc.gif"; "aw" : extras + "fileIcons/aw.gif",
fileIcons["cnf"] = "/extras/fileIcons/cnf.gif"; "bat" : extras + "fileIcons/bat.gif",
fileIcons["pict"] = "/extras/fileIcons/pict.gif"; "bmp" : extras + "fileIcons/bmp.gif",
fileIcons["rar"] = "/extras/fileIcons/rar.gif"; "cab" : extras + "fileIcons/cab.gif",
fileIcons["gz"] = "/extras/fileIcons/gz.gif"; "cif" : extras + "fileIcons/cif.gif",
fileIcons["ai"] = "/extras/fileIcons/ai.gif"; "class" : extras + "fileIcons/class.gif",
fileIcons["xlt"] = "/extras/fileIcons/xlt.gif"; "cnf" : extras + "fileIcons/cnf.gif",
fileIcons["jar"] = "/extras/fileIcons/jar.gif"; "com" : extras + "fileIcons/com.gif",
fileIcons["mov"] = "/extras/fileIcons/mov.gif"; "conf" : extras + "fileIcons/conf.gif",
fileIcons["cab"] = "/extras/fileIcons/cab.gif"; "config" : extras + "fileIcons/config.gif",
fileIcons["png"] = "/extras/fileIcons/png.gif"; "css" : extras + "fileIcons/css.gif",
fileIcons["sxg"] = "/extras/fileIcons/sxg.gif"; "csv" : extras + "fileIcons/csv.gif",
fileIcons["sxi"] = "/extras/fileIcons/sxi.gif"; "dia" : extras + "fileIcons/dia.gif",
fileIcons["dot"] = "/extras/fileIcons/dot.gif"; "doc" : extras + "fileIcons/doc.gif",
fileIcons["tiff"] = "/extras/fileIcons/tiff.gif"; "dot" : extras + "fileIcons/dot.gif",
fileIcons["tif"] = "/extras/fileIcons/tif.gif"; "dwf" : extras + "fileIcons/dwf.gif",
fileIcons["ppt"] = "/extras/fileIcons/ppt.gif"; "dwg" : extras + "fileIcons/dwg.gif",
fileIcons["stc"] = "/extras/fileIcons/stc.gif"; "dxf" : extras + "fileIcons/dxf.gif",
fileIcons["pic"] = "/extras/fileIcons/pic.gif"; "eps" : extras + "fileIcons/eps.gif",
fileIcons["psd"] = "/extras/fileIcons/psd.gif"; "exe" : extras + "fileIcons/exe.gif",
fileIcons["java"] = "/extras/fileIcons/java.gif"; "gif" : extras + "fileIcons/gif.gif",
fileIcons["123"] = "/extras/fileIcons/123.gif"; "gnumeric" : extras + "fileIcons/gnumeric.gif",
fileIcons["swf"] = "/extras/fileIcons/swf.gif"; "gz" : extras + "fileIcons/gz.gif",
fileIcons["mpeg"] = "/extras/fileIcons/mpeg.gif"; "hqx" : extras + "fileIcons/hqx.gif",
fileIcons["sdc"] = "/extras/fileIcons/sdc.gif"; "htm" : extras + "fileIcons/htm.gif",
fileIcons["log"] = "/extras/fileIcons/log.gif"; "html" : extras + "fileIcons/html.gif",
fileIcons["mrproject"] = "/extras/fileIcons/mrproject.gif"; "indd" : extras + "fileIcons/indd.gif",
fileIcons["wri"] = "/extras/fileIcons/wri.gif"; "iso" : extras + "fileIcons/iso.gif",
fileIcons["readme"] = "/extras/fileIcons/readme.gif"; "jar" : extras + "fileIcons/jar.gif",
fileIcons["as"] = "/extras/fileIcons/as.gif"; "java" : extras + "fileIcons/java.gif",
fileIcons["dwg"] = "/extras/fileIcons/dwg.gif"; "jpeg" : extras + "fileIcons/jpeg.gif",
fileIcons["tgz"] = "/extras/fileIcons/tgz.gif"; "jpg" : extras + "fileIcons/jpg.gif",
fileIcons["lyx"] = "/extras/fileIcons/lyx.gif"; "js" : extras + "fileIcons/js.gif",
fileIcons["css"] = "/extras/fileIcons/css.gif"; "kpr" : extras + "fileIcons/kpr.gif",
fileIcons["sxd"] = "/extras/fileIcons/sxd.gif"; "ksp" : extras + "fileIcons/ksp.gif",
fileIcons["wk3"] = "/extras/fileIcons/wk3.gif"; "kwd" : extras + "fileIcons/kwd.gif",
fileIcons["mpp"] = "/extras/fileIcons/mpp.gif"; "log" : extras + "fileIcons/log.gif",
fileIcons["sti"] = "/extras/fileIcons/sti.gif"; "lyx" : extras + "fileIcons/lyx.gif",
fileIcons["rtf"] = "/extras/fileIcons/rtf.gif"; "m3u" : extras + "fileIcons/m3u.gif",
fileIcons["sdw"] = "/extras/fileIcons/sdw.gif"; "mdb" : extras + "fileIcons/mdb.gif",
fileIcons["eps"] = "/extras/fileIcons/eps.gif"; "mif" : extras + "fileIcons/mif.gif",
fileIcons["xla"] = "/extras/fileIcons/xla.gif"; "mov" : extras + "fileIcons/mov.gif",
fileIcons["cif"] = "/extras/fileIcons/cif.gif"; "mp3" : extras + "fileIcons/mp3.gif",
fileIcons["pps"] = "/extras/fileIcons/pps.gif"; "mpeg" : extras + "fileIcons/mpeg.gif",
fileIcons["sylk"] = "/extras/fileIcons/sylk.gif"; "mpg" : extras + "fileIcons/mpg.gif",
fileIcons["kpr"] = "/extras/fileIcons/kpr.gif"; "mpp" : extras + "fileIcons/mpp.gif",
fileIcons["sdp"] = "/extras/fileIcons/sdp.gif"; "mrproject" : extras + "fileIcons/mrproject.gif",
fileIcons["gnumeric"] = "/extras/fileIcons/gnumeric.gif"; "oleo" : extras + "fileIcons/oleo.gif",
fileIcons["gif"] = "/extras/fileIcons/gif.gif"; "p65" : extras + "fileIcons/p65.gif",
fileIcons["sea"] = "/extras/fileIcons/sea.gif"; "pdf" : extras + "fileIcons/pdf.gif",
fileIcons["ksp"] = "/extras/fileIcons/ksp.gif"; "pic" : extras + "fileIcons/pic.gif",
fileIcons["tab"] = "/extras/fileIcons/tab.gif"; "pict" : extras + "fileIcons/pict.gif",
fileIcons["tar"] = "/extras/fileIcons/tar.gif"; "pif" : extras + "fileIcons/pif.gif",
fileIcons["sdd"] = "/extras/fileIcons/sdd.gif"; "pm" : extras + "fileIcons/pm.gif",
fileIcons["pdf"] = "/extras/fileIcons/pdf.gif"; "png" : extras + "fileIcons/png.gif",
fileIcons["jpg"] = "/extras/fileIcons/jpg.gif"; "pps" : extras + "fileIcons/pps.gif",
fileIcons["aw"] = "/extras/fileIcons/aw.gif"; "ppt" : extras + "fileIcons/ppt.gif",
fileIcons["txt"] = "/extras/fileIcons/txt.gif"; "ps" : extras + "fileIcons/ps.gif",
fileIcons["m3u"] = "/extras/fileIcons/m3u.gif"; "psd" : extras + "fileIcons/psd.gif",
fileIcons["sql"] = "/extras/fileIcons/sql.gif"; "psp" : extras + "fileIcons/psp.gif",
fileIcons["ram"] = "/extras/fileIcons/ram.gif"; "ra" : extras + "fileIcons/ra.gif",
fileIcons["com"] = "/extras/fileIcons/com.gif"; "ram" : extras + "fileIcons/ram.gif",
fileIcons["pm"] = "/extras/fileIcons/pm.gif"; "rar" : extras + "fileIcons/rar.gif",
fileIcons["htm"] = "/extras/fileIcons/htm.gif"; "readme" : extras + "fileIcons/readme.gif",
fileIcons["mdb"] = "/extras/fileIcons/mdb.gif"; "rpm" : extras + "fileIcons/rpm.gif",
fileIcons["ra"] = "/extras/fileIcons/ra.gif"; "rtf" : extras + "fileIcons/rtf.gif",
fileIcons["conf"] = "/extras/fileIcons/conf.gif"; "rtx" : extras + "fileIcons/rtx.gif",
fileIcons["iso"] = "/extras/fileIcons/iso.gif"; "sdc" : extras + "fileIcons/sdc.gif",
fileIcons["bat"] = "/extras/fileIcons/bat.gif"; "sdd" : extras + "fileIcons/sdd.gif",
fileIcons["doc"] = "/extras/fileIcons/doc.gif"; "sdp" : extras + "fileIcons/sdp.gif",
fileIcons["indd"] = "/extras/fileIcons/indd.gif"; "sdw" : extras + "fileIcons/sdw.gif",
fileIcons["dxf"] = "/extras/fileIcons/dxf.gif"; "sea" : extras + "fileIcons/sea.gif",
fileIcons["vdx"] = "/extras/fileIcons/vdx.gif"; "sit" : extras + "fileIcons/sit.gif",
fileIcons["slk"] = "/extras/fileIcons/slk.gif"; "slk" : extras + "fileIcons/slk.gif",
fileIcons["xlc"] = "/extras/fileIcons/xlc.gif"; "sql" : extras + "fileIcons/sql.gif",
fileIcons["unknown"] = "/extras/fileIcons/unknown.gif"; "stc" : extras + "fileIcons/stc.gif",
fileIcons[".svn"] = "/extras/fileIcons/.svn"; "sti" : extras + "fileIcons/sti.gif",
fileIcons["oleo"] = "/extras/fileIcons/oleo.gif"; "stw" : extras + "fileIcons/stw.gif",
fileIcons["tsv"] = "/extras/fileIcons/tsv.gif"; "swf" : extras + "fileIcons/swf.gif",
fileIcons["abw"] = "/extras/fileIcons/abw.gif"; "sxc" : extras + "fileIcons/sxc.gif",
fileIcons["wk4"] = "/extras/fileIcons/wk4.gif"; "sxd" : extras + "fileIcons/sxd.gif",
fileIcons["mpg"] = "/extras/fileIcons/mpg.gif"; "sxg" : extras + "fileIcons/sxg.gif",
fileIcons["sxm"] = "/extras/fileIcons/sxm.gif"; "sxi" : extras + "fileIcons/sxi.gif",
fileIcons["rpm"] = "/extras/fileIcons/rpm.gif"; "sxm" : extras + "fileIcons/sxm.gif",
fileIcons["pif"] = "/extras/fileIcons/pif.gif"; "sxw" : extras + "fileIcons/sxw.gif",
fileIcons["rtx"] = "/extras/fileIcons/rtx.gif"; "sylk" : extras + "fileIcons/sylk.gif",
fileIcons["vsd"] = "/extras/fileIcons/vsd.gif"; "tab" : extras + "fileIcons/tab.gif",
fileIcons["kwd"] = "/extras/fileIcons/kwd.gif"; "tar" : extras + "fileIcons/tar.gif",
fileIcons["jpeg"] = "/extras/fileIcons/jpeg.gif"; "tgz" : extras + "fileIcons/tgz.gif",
fileIcons["ps"] = "/extras/fileIcons/ps.gif"; "tif" : extras + "fileIcons/tif.gif",
fileIcons["wk1"] = "/extras/fileIcons/wk1.gif"; "tiff" : extras + "fileIcons/tiff.gif",
fileIcons["wav"] = "/extras/fileIcons/wav.gif"; "tsv" : extras + "fileIcons/tsv.gif",
fileIcons["mif"] = "/extras/fileIcons/mif.gif"; "txt" : extras + "fileIcons/txt.gif",
fileIcons["bmp"] = "/extras/fileIcons/bmp.gif"; "unknown" : extras + "fileIcons/unknown.gif",
fileIcons["sxw"] = "/extras/fileIcons/sxw.gif"; "vdx" : extras + "fileIcons/vdx.gif",
fileIcons["z"] = "/extras/fileIcons/z.gif"; "vsd" : extras + "fileIcons/vsd.gif",
fileIcons["dwf"] = "/extras/fileIcons/dwf.gif"; "wav" : extras + "fileIcons/wav.gif",
fileIcons["zip"] = "/extras/fileIcons/zip.gif"; "wk1" : extras + "fileIcons/wk1.gif",
fileIcons["csv"] = "/extras/fileIcons/csv.gif"; "wk3" : extras + "fileIcons/wk3.gif",
fileIcons["stw"] = "/extras/fileIcons/stw.gif"; "wk4" : extras + "fileIcons/wk4.gif",
fileIcons["xld"] = "/extras/fileIcons/xld.gif"; "wks" : extras + "fileIcons/wks.gif",
fileIcons["html"] = "/extras/fileIcons/html.gif"; "wri" : extras + "fileIcons/wri.gif",
fileIcons["avi"] = "/extras/fileIcons/avi.gif"; "xla" : extras + "fileIcons/xla.gif",
fileIcons["xml"] = "/extras/fileIcons/xml.gif"; "xlc" : extras + "fileIcons/xlc.gif",
fileIcons["wks"] = "/extras/fileIcons/wks.gif"; "xld" : extras + "fileIcons/xld.gif",
fileIcons["psp"] = "/extras/fileIcons/psp.gif"; "xls" : extras + "fileIcons/xls.gif",
fileIcons["config"] = "/extras/fileIcons/config.gif"; "xlt" : extras + "fileIcons/xlt.gif",
fileIcons["sit"] = "/extras/fileIcons/sit.gif"; "xml" : extras + "fileIcons/xml.gif",
"z" : extras + "fileIcons/z.gif",
"zip" : extras + "fileIcons/zip.gif"
};
})();