<?php
/* $Id: settings.inc.php,v 1.5 2003/10/20 10:09:41 k-fish Exp $ */

$mime_drivers = array();
$driver_settings = array();

$driver_settings['files_forbidden_mime'] = array(
					      "method" => "text",
					      "name" => "files_forbidden_mime",
					      "type" => "str",
					      "default" => "application/x-msdos-program",
					      "description" => "forbidden MIME types"
					      );

if ($dir = @opendir(ROOTPATH . "/modules/files/inc/mime/Viewer/")) {
    while (($file = readdir($dir)) !== false) {
        if(($file != 'default.php') &&
	   ($file != 'php.php') &&
	   ($file != 'text.php') &&
	   ($file != 'images.php') &&
	   (strpos($file, ".php")>0))
	    $mime_drivers[] = substr($file, 0, strpos($file, "."));
    }
    closedir($dir);
    sort($mime_drivers);
}

while(list($k, $v) = each($mime_drivers)){
    $driver_settings['mime_'.$v.'_enable'] = array(
					      "method" => "checkbox",
					      "name" => Lang::getLanguageString('enable').': '.$v,
					      "translate" => false,
					      "type" => "int",
					      "description" => "enable MIME viewer",
					      "default" => "1",
					      );
    $driver_settings['mime_'.$v.'_binary'] = array(
					      "method" => "text",
					      "name" => "binary",
					      "type" => "str",
					      "description" => "MIME viewer binary"
					      );
}

$driver_settings['mime_deb_binary']['default'] = '/usr/bin/dpkg';
$driver_settings['mime_enscript_binary']['default'] = '/usr/bin/enscript';
$driver_settings['mime_mp3_binary']['default'] = '/usr/bin/mp3info';
$driver_settings['mime_msexcel_binary']['default'] = '/usr/bin/xlhtml';
$driver_settings['mime_mspowerpoint_binary']['default'] = '/usr/bin/ppthtml';
$driver_settings['mime_msword_binary']['default'] = '/usr/bin/wvHtml';
$driver_settings['mime_rar_binary']['default'] = '/usr/bin/rar';
$driver_settings['mime_rpm_binary']['default'] = '/usr/bin/rpm';
$driver_settings['mime_tgz_binary']['default'] = '/bin/tar';
$driver_settings['mime_zip_binary']['default'] = '/usr/bin/zipinfo';

$driver_settings['title'] = "files_mime_settings";
$driver_settings['admin'] = true;
$settings["files"] = array("gensettings" => $driver_settings);
?>
