<?php
header('Content-type: text/css');
include("../../prefs.php");
$icons = array("gif"=>"picture.gif",
"jpg"=>"picture.gif",
"jpeg"=>"picture.gif",
"bmp"=>"picture.gif",
"png"=>"picture.gif",
"mp3"=>"sound.gif",
"mov"=>"video.gif",
"aif"=>"sound.gif",
"aiff"=>"sound.gif",
"wav"=>"sound.gif",
"swf"=>"video.gif",
"mpg"=>"video.gif",
"avi"=>"video.gif",
"mpeg"=>"video.gif",
"mid"=>"sound.gif",
"m4a"=>"sound.gif",
"flv"=>"video.gif",
"mp4"=>"video.gif",
"html"=>"file.gif",
"htm"=>"file.gif",
"txt"=>"txt.gif",
"css"=>"file.gif",
"php"=>"file.gif",
"php3"=>"file.gif",
"php4"=>"file.gif",
"asp"=>"file.gif",
"js"=>"file.gif",
"pdf"=>"pdf.gif",
"doc"=>"page_white_word.gif",
"zip"=>"file.gif",
"sit"=>"file.gif",
"rar"=>"file.gif",
"rm"=>"file.gif",
"ram"=>"file.gif"
);
$allFiles = array();
for($i=0; $i<count($imgTypes); $i++){
array_push($allFiles,$imgTypes[$i]);
}
for($i=0; $i<count($embedTypes); $i++){
array_push($allFiles,$embedTypes[$i]);
}
for($i=0; $i<count($htmlTypes); $i++){
array_push($allFiles,$htmlTypes[$i]);
}
for($i=0; $i<count($phpTypes); $i++){
array_push($allFiles,$phpTypes[$i]);
}
for($i=0; $i<count($miscTypes); $i++){
array_push($allFiles,$miscTypes[$i]);
}
function addArray(&$array, $key, $val)
{
$tempArray = array($key => $val);
$array = array_merge ($array, $tempArray);
}
// add the default file.gif icon for any file type thatr doesn't have an
// icon set in the list above
for($i = 0; $i<count($allFiles);$i++){
if(!isset($icons[$allFiles[$i]])){
addArray($icons,$allFiles[$i], "file.gif");
}
}
foreach($icons as $key => $value){
echo "
li.file.icon_$key{ background:silver url(\"icons/$value\") 2px 2px no-repeat; }
li.file_open.icon_$key{ background:#fc6 url(\"icons/$value\") 2px 2px no-repeat; }
";
}
?>