Index: modules/asset_content.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/asset/modules/asset_content.inc,v
retrieving revision 1.1.2.10
diff -u -p -u -p -r1.1.2.10 asset_content.inc
--- modules/asset_content.inc	15 Sep 2008 10:07:41 -0000	1.1.2.10
+++ modules/asset_content.inc	9 Dec 2008 22:36:56 -0000
@@ -47,22 +47,50 @@ function asset_field_settings($op, $fiel
  * Implementation of cck hook_field_formatter_info()
  */
 function asset_field_formatter_info() {
-  return array(
+  $formatters = array(
     'default' => array(
-      'label' => 'Default',
+      'label' => t('Default'),
       'field types' => array('asset'),
     ),
   );
+
+  $asset_formatters = asset_get_formatters();
+  foreach ($asset_formatters as $type) {
+    foreach ($type as $ext) {
+      foreach ($ext as $formatter) {
+        $formatters[$formatter['module'] .':'. $formatter['format']] = array(
+          'label' => $formatter['name'],
+          'field types' => array('asset'),
+        );
+        $formatters[$formatter['module'] .':'. $formatter['format'] .':link'] = array(
+          'label' => $formatter['name'] . ' with link',
+          'field types' => array('asset'),
+        );
+      }
+    }
+  }
+
+  return $formatters;
 }
 
 /**
+ * Implementation of hook_field_formatter().
  * Prepare an individual item for viewing in a browser.
  */
 function asset_field_formatter($field, $item, $formatter, $node) {
-  $teaser = (arg(0) == 'node' && is_numeric(arg(1))) ? FALSE : TRUE;
-  if(!empty($item['aid'])) {
-    return asset_lightbox(array($item), FALSE, $teaser);
+  $asset = asset_load($item['aid']);
+  $formatter_options = asset_formatter_options($asset->type, $asset->extension);
+  list($module, $format, $link) = explode(':', $formatter);
+  if (!isset($formatter_options[$module .':'. $format])) {
+    // If not a valid format for this extension then use the default format for this extension instead
+    list($module, $format) = explode(':', asset_get_default_formatter($asset->type, $asset->extension, true));
+    $link = FALSE;
+  }
+  $html = module_invoke($module, 'asset_formatter', 'render', $asset, array('format' => $format));
+  if ($link) {
+    return l($html, 'node/'. $node->nid, array(), NULL, NULL, FALSE, TRUE);
   }
+  return $html;
 }
 
 /**
