<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -44,6 +44,14 @@ function dav_admin_settings() {
     '#options'       =&gt; array(FALSE =&gt; t('Disabled'), TRUE =&gt; t('Enabled')),
     '#description'   =&gt; t('Whether to log debug/troubleshooting information on all DAV HTTP methods. Note that enabling this will have a negative impact on performance and you should never use this except for troubleshooting purposes. &lt;em&gt;Requires trace.module.&lt;/em&gt;'),
   );
+  $form['server']['dav_icons'] = array(
+    '#type'          =&gt; 'radios',
+    '#title'         =&gt; t('Enable web listing icons'),
+    '#default_value' =&gt; module_exists('file') ? (int)DAV_ICONS : FALSE,
+    '#options'       =&gt; array(FALSE =&gt; t('Disabled'), TRUE =&gt; t('Enabled')),
+    '#description'   =&gt; t('Whether to show MIME type icons next to files and directories when browsing the DAV listing in a web browser (i.e., using HTTP GET). &lt;em&gt;Requires FileFramework.&lt;/em&gt;'),
+    '#attributes'    =&gt; !module_exists('file') ? array('disabled' =&gt; 'disabled') : array(),
+  );
   $form['server']['dav_encode'] = array(
     '#type'          =&gt; 'textfield',
     '#title'         =&gt; t('Characters to encode'),</diff>
      <filename>dav.admin.inc</filename>
    </modified>
    <modified>
      <diff>@@ -17,6 +17,7 @@ define('DAV_CLIENT',      variable_get('dav_client', FALSE));
 define('DAV_DOT_FILES',   variable_get('dav_dot_files', TRUE));
 define('DAV_TRACE',       variable_get('dav_trace', FALSE));
 define('DAV_ENCODE',      variable_get('dav_encode', ' &amp;&lt;&gt;|'));
+define('DAV_ICONS',       variable_get('dav_icons', module_exists('file')));
 define('DAV_CRON',        variable_get('dav_cron', TRUE));
 
 define('DAV_WINDOWS_SERVER_DISCOVERY', variable_get('dav_windows_server_discovery', TRUE));</diff>
      <filename>dav.module</filename>
    </modified>
    <modified>
      <diff>@@ -72,7 +72,33 @@ function theme_dav_resource($path, $name, $resource) {
   $mtime = format_date($mtime, 'small');
   $slash = ($props['resourcetype'] == 'collection') ? '/' : '';
   $name = check_plain($name);
-  $link = '&lt;a href=&quot;./'. $name . $slash .'&quot; class=&quot;dav '. $type .'&quot;&gt;'. $name .'&lt;/a&gt;'. $slash;
+  if (DAV_ICONS) {
+    if ($props['getcontenttype'] == 'httpd/unix-directory') {
+      $icon .= drupal_get_path('module', 'file_browser');
+      $icon .= '/icons/folder.png&quot;';
+    }
+    else {
+      $type = $props['getcontenttype'];
+      /**
+       * Borrowed from FileFramework's file_mime_icon_for().
+       */
+      $handlers = file_get_mime_types();
+      $default_mime_types = file_default_mime_types();
+      $icon = is_array($handlers[$type]['icon']) ? reset($handlers[$type]['icon']) : $handlers[$type]['icon'];
+      $icon = isset($icon) ? $icon : (in_array(preg_replace('/([^\/]+).*/', '$1/*', $type), array_keys($default_mime_types)) ? $default_mime_types[preg_replace('/([^\/]+).*/', '$1/*', $type)]['icon'] : '');
+      /**
+       * End borrowed code.
+       */
+      $icon = drupal_get_path('module', 'file') .'/icons/'. $icon;
+    }
+    $image  = '&lt;img src=&quot;' . base_path() . $icon . '&quot; ';
+    $image .= 'valign=&quot;middle&quot; ';
+    $image .= 'alt=&quot;' . $type . '&quot; ';
+    $image .= 'title=&quot;' . $type . '&quot; ';
+    $image .= '/&gt; ';
+  }
+  
+  $link = $image . '&lt;a href=&quot;./'. $name . $slash .'&quot; class=&quot;dav '. $type .'&quot;&gt;'. $name .'&lt;/a&gt;'. $slash;
 
   return sprintf(DAV_LS_FORMAT . &quot;\n&quot;, $size, $mtime, $link);
 }</diff>
      <filename>dav.theme.inc</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1b1f0bc782d896da66a8dde29d60f5b3b599793a</id>
    </parent>
  </parents>
  <author>
    <name>Justin R. Miller</name>
    <email>incanus@codesorcery.net</email>
  </author>
  <url>http://github.com/incanus/drupal-dav/commit/55a668516c0f72f002536f7e5475e0a8e4b58f37</url>
  <id>55a668516c0f72f002536f7e5475e0a8e4b58f37</id>
  <committed-date>2008-11-07T19:03:26-08:00</committed-date>
  <authored-date>2008-11-07T19:03:26-08:00</authored-date>
  <message>added MIME type icons to web listing (i.e., HTTP GET) of DAV resources</message>
  <tree>21fcb4c409f31442fa4134451e338427eb10464e</tree>
  <committer>
    <name>Justin R. Miller</name>
    <email>incanus@codesorcery.net</email>
  </committer>
</commit>
