Index: plugins/linkit_file/linkit_file.info
===================================================================
RCS file: plugins/linkit_file/linkit_file.info
diff -N plugins/linkit_file/linkit_file.info
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plugins/linkit_file/linkit_file.info	5 Nov 2010 13:20:29 -0000
@@ -0,0 +1,6 @@
+; $Id$
+name = Linkit File
+description = Extend Linkit with files
+core = 6.x
+package = Linkit
+dependencies[] = "linkit"
\ No newline at end of file
Index: plugins/linkit_file/linkit_file.module
===================================================================
RCS file: plugins/linkit_file/linkit_file.module
diff -N plugins/linkit_file/linkit_file.module
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ plugins/linkit_file/linkit_file.module	5 Nov 2010 13:20:29 -0000
@@ -0,0 +1,48 @@
+<?php 
+// $Id$
+
+/**
+ * @file
+ * Extend Linkit with files.
+ */
+
+
+/**
+ * Implementation of hook_linkit_load_plugins().
+ */
+function linkit_file_linkit_load_plugins($string) {
+  $matches = array();
+  
+  // Get files.
+  $result = db_query_range("SELECT f.fid, f.filename, f.filepath FROM {files} f WHERE f.filename LIKE LOWER('%%%s%%%') AND f.status = 1", $string, 0, 10);
+  while ($file = db_fetch_object($result)) {
+    $matches['file'][] = array(
+      'title' => $file->filename,
+      'path' => file_create_url($file->filepath),
+      'information' => array(
+        'type' => 'File',
+      ),
+    );
+  }
+
+  return $matches;
+}
+
+/**
+ * Implementation of hook_linkit_get_search_styled_link().
+ */
+function linkit_file_linkit_get_search_styled_link($string) {
+  return;
+}
+
+/**
+ * Implementation of hook_linkit_info_plugins().
+ * 
+ * This is used by linkit_permissions
+ */
+function linkit_file_linkit_info_plugins() {
+  $return['linkit_file'] = array(
+    'type' => 'file',
+  );
+  return $return;
+}
\ No newline at end of file
