Index: navigate/navigate.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate.info,v
retrieving revision 1.2
diff -u -p -r1.2 navigate.info
--- navigate/navigate.info	27 Oct 2008 17:51:04 -0000	1.2
+++ navigate/navigate.info	7 Nov 2008 22:28:22 -0000
@@ -1,6 +1,6 @@
-; $Id: navigate.info,v 1.2 2008/10/27 17:51:04 stompeers Exp $
-name = Navigate
-description = Adds a framework for supplying navigation tools to Drupal
-package = Navigate
-dependencies = jquery_update
-version = VERSION
+; $Id: navigate.info,v 1.2 2008/10/27 17:51:04 stompeers Exp $
+name = Navigate
+description = Adds a framework for supplying navigation tools to Drupal
+package = Navigate
+dependencies = jquery_update
+version = VERSION
Index: navigate/navigate.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate.install,v
retrieving revision 1.4
diff -u -p -r1.4 navigate.install
--- navigate/navigate.install	5 Nov 2008 22:57:01 -0000	1.4
+++ navigate/navigate.install	7 Nov 2008 22:28:22 -0000
@@ -1,54 +1,54 @@
-<?php
-// $Id: navigate.install,v 1.4 2008/11/05 22:57:01 stompeers Exp $
-
-
-/**
- * @file
- * Navigate installation file
- */
-
-
-/**
- * Implementation of hook_install().
- */
-function navigate_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {navigate_cache} (
-        uid int(11) NOT NULL,
-        content longtext NOT NULL
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
-      );
-      db_query("CREATE TABLE {navigate_user_settings} (
-        uid int(11) NOT NULL,
-        name varchar(250) NOT NULL,
-        value text NOT NULL,
-        wid int(11) NOT NULL
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
-      );
-      db_query("CREATE TABLE {navigate_widgets} (
-        wid int(11) NOT NULL,
-        uid int(11) NOT NULL,
-        type varchar(250) NOT NULL,
-        weight int(11) NOT NULL,
-        module varchar(250) NOT NULL
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */"
-      );
-      break;
-    db_query("UPDATE {system} SET weight = 100 WHERE name = 'navigate'");
-  }
-  drupal_set_message(t('Navigate has been installed. To use navigate, click the semi-hidden icon in the upper left hand corner of the screen. For more help, visit '. l('/admin/help/navigate', 'admin/help/navigate') .'. Make sure to enable it for your users in '. l('access control', 'admin/user/access') .'.'));
-}
-
-
-/**
- * Implementation of hook_uninstall().
- */
-function navigate_uninstall() {
-  db_query("DELETE FROM {variable} WHERE name LIKE 'navigate_%'");
-  db_query('DROP TABLE {navigate_cache}');
-  db_query('DROP TABLE {navigate_user_settings}');
-  db_query('DROP TABLE {navigate_widgets}');
-  drupal_set_message(t('Navigate variables and tables have been removed.'));
-}
+<?php
+// $Id: navigate.install,v 1.4 2008/11/05 22:57:01 stompeers Exp $
+
+
+/**
+ * @file
+ * Navigate installation file
+ */
+
+
+/**
+ * Implementation of hook_install().
+ */
+function navigate_install() {
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      db_query("CREATE TABLE {navigate_cache} (
+        uid int(11) NOT NULL,
+        content longtext NOT NULL
+      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
+      );
+      db_query("CREATE TABLE {navigate_user_settings} (
+        uid int(11) NOT NULL,
+        name varchar(250) NOT NULL,
+        value text NOT NULL,
+        wid int(11) NOT NULL
+      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
+      );
+      db_query("CREATE TABLE {navigate_widgets} (
+        wid int(11) NOT NULL,
+        uid int(11) NOT NULL,
+        type varchar(250) NOT NULL,
+        weight int(11) NOT NULL,
+        module varchar(250) NOT NULL
+      ) /*!40100 DEFAULT CHARACTER SET utf8 */"
+      );
+      break;
+    db_query("UPDATE {system} SET weight = 100 WHERE name = 'navigate'");
+  }
+  drupal_set_message(t('Navigate has been installed. To use navigate, click the semi-hidden icon in the upper left hand corner of the screen. For more help, visit '. l('/admin/help/navigate', 'admin/help/navigate') .'. Make sure to enable it for your users in '. l('access control', 'admin/user/access') .'.'));
+}
+
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function navigate_uninstall() {
+  db_query("DELETE FROM {variable} WHERE name LIKE 'navigate_%'");
+  db_query('DROP TABLE {navigate_cache}');
+  db_query('DROP TABLE {navigate_user_settings}');
+  db_query('DROP TABLE {navigate_widgets}');
+  drupal_set_message(t('Navigate variables and tables have been removed.'));
+}
Index: navigate/navigate.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate.js,v
retrieving revision 1.6
diff -u -p -r1.6 navigate.js
--- navigate/navigate.js	6 Nov 2008 01:46:43 -0000	1.6
+++ navigate/navigate.js	7 Nov 2008 22:28:22 -0000
@@ -10,41 +10,41 @@ $(document).ready(function(){
  * This is run on document load ready and when any widget is added. Widget class is passed via 'item'
  */
 function navigate_load_bind_widgets(item) {
-  
+
   // Set item if it's not set
   item = navigate_item_default(item);
-  
+
   // Bind events to on/off buttons
   navigate_bind_toggle_buttons(item);
-  
+
   // Bind events to callback buttons
   navigate_bind_callback_buttons(item);
-  
+
   // Bind events to text inputs
   navigate_bind_text_inputs(item);
-  
+
   // Bind events to close button
   navigate_bind_widget_close();
-  
+
   // Bind events to textarea
   navigate_bind_textareas();
-  
+
    // Bind event to widget settings button
   $(item + ' .navigate-widget-settings-button').click(function() {
     $(this).parent().find('.navigate-widget-settings-outer').slideToggle('slow', function() { navigate_cache_save();});
   });
-  
+
   // Add select all on text inputs
   $(item + " .navigate-select-all").focus(function () {
     $(this).select();
   });
-  
+
   // Bind doubleclick for title change
   navigate_bind_title_change(item);
-  
+
   // Add tooltips
   navigate_add_tooltips();
-  
+
 }
 
 
@@ -116,16 +116,16 @@ function navigate_bind_widget_close() {
  * Binds events and various errata after page is loaded
  */
 function navigate_load() {
-  
+
   // Bind click events to buttons and inputs to all widgets
   navigate_load_bind_widgets();
-  
+
   // Bind click event to widget list (if visible)
   navigate_bind_add_widget_list();
-  
+
   // Run pngFix for IE6
   $('.navigate').pngFix();
-  
+
    // Make widgets sortable using their title as the handle
   $(".navigate-all-widgets").sortable({
       cursor: "move",
@@ -169,10 +169,10 @@ function navigate_load() {
       }
     });
   });
-  
+
   // Add tooltips
   navigate_add_tooltips()
-  
+
   // Bind event to text input to save the value of the input.
   // Since the .val() and .attr() functions don't change the actual html of an input,
   // we have to add a hidden input with the value of the text field, and then replace the text field with the value
@@ -184,7 +184,7 @@ function navigate_load() {
       $(this).val($("input[rel='" + rel + "']").val());
     }
   });
-  
+
   // Clear user cache when button is clicked
   $('.navigate-clear-cache').click(function() {
     $.ajax({
@@ -198,16 +198,16 @@ function navigate_load() {
         }
       });
   });
-  
+
 
   // Run pngFix on switch button
   $('#navigate-switch-outer').pngFix();
- 
+
   // Add select all on text inputs with select all specified
   $(".navigate-select-all").focus(function () {
     $(this).select();
   });
-  
+
     // Bind events to switch button
   $("#navigate-switch").click(function () {
     // Close
@@ -229,15 +229,15 @@ function navigate_load() {
       $("#navigate-switch").animate({ marginLeft: "-195px", marginTop: "0px"}, "slow");
       $(".navigate-loading").animate({ marginLeft: "-30px"}, "slow");
     }
-    
+
   });
-  
-  
-  // Bind click event to acklowledgement link 
+
+
+  // Bind click event to acklowledgement link
   $(".navigate-acknowledgement-switch").click(function () {
     $('.navigate-acknowledgement').slideToggle('slow');
   });
-  
+
   // Bind doubleclick event to title
   $('.navigate-title').dblclick(function() {
     $('.navigate-shorten').slideToggle('fast', function() {
@@ -252,12 +252,12 @@ function navigate_load() {
  */
 function navigate_bind_toggle_buttons(item) {
   item = navigate_item_default(item);
-  
+
   $(item + ' .navigate-button-outer').each(function() {
     var wid = navigate_widget_id(this);
     var widget = this;
     $(this).children().click(function() {
-      
+
       // Grab all variables from hidden inputs
       var on = $(widget).find('.on').val();
       var off = $(widget).find('.off').val();
@@ -265,7 +265,7 @@ function navigate_bind_toggle_buttons(it
       var required = $(widget).find('.required').val();
       var callback = $(widget).find('.callback').val();
       var val;
-      
+
       // If it's a group
       if ($(widget).find('.group').length > 0) {
         var group = $(widget).find('.group').val();
@@ -285,7 +285,7 @@ function navigate_bind_toggle_buttons(it
         });
         val = on;
         $(this).addClass('navigate-button-on');
-      
+
       // If not a group
       } else {
         // If it's just a callback
@@ -334,13 +334,13 @@ function navigate_bind_text_inputs(item)
   item = navigate_item_default(item);
   var search_timeout = undefined;
   $(item + ' .navigate-text-input-outer').each(function() {
-    
+
     var wid = navigate_widget_id(this);
     var widget = this;
     var callback = $(widget).children('.callback').val();
     var name = $(widget).children('.name').val();
     var text_input = this;
-    
+
     $(this).find('input').bind('keyup', function(e) {
       var input_name = $(text_input).children('div').children('input').attr('name');
       var id = $(text_input).children('div').children('input').attr('id');
@@ -354,7 +354,7 @@ function navigate_bind_text_inputs(item)
             $(this).val('');
             $('.' + holder_id).remove();
             var new_input = '<div  class="' + holder_id + '"><input rel="' + id + '" type="hidden" name="' + input_name + '" value="' + val + '" /></div>';
-            $(text_input).parent().append(new_input);          
+            $(text_input).parent().append(new_input);
             //navigate_variable_set(name, '', wid);
           }
         }
@@ -363,14 +363,14 @@ function navigate_bind_text_inputs(item)
                 clearTimeout(search_timeout);
         }
         var $this = this;
-        
+
         // Set timeout to save input text when typing is paused
         search_timeout = setTimeout(function() {
           search_timeout = undefined;
           var val = $(text_input).children('div').children('input').val();
           $('.' + holder_id).remove();
           var new_input = '<div  class="' + holder_id + '"><input rel="' + id + '" type="hidden" name="' + input_name + '" value="' + val + '" /></div>';
-          $(text_input).parent().append(new_input);          
+          $(text_input).parent().append(new_input);
           navigate_variable_set(name, val, wid);
           navigate_cache_save();
         }, 500);
@@ -426,7 +426,7 @@ function navigate_add_tooltips() {
  * Set a variable
  */
 function navigate_variable_set(name, val, wid) {
-  
+
   // Save the variable in a database
   navigate_queue_add();
    $.ajax({
@@ -465,10 +465,10 @@ function navigate_queue_subtract() {
  * Save html to cache
  */
 function navigate_cache_save() {
-  
+
   // Refresh tooltips, added here for convenience so widgets don't have to call it on laoding
   navigate_add_tooltips();
-  
+
   navigate_queue_add();
   $.ajax({
       url: $("#navigate_process_url").val(),
Index: navigate/navigate.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate.module,v
retrieving revision 1.7
diff -u -p -r1.7 navigate.module
--- navigate/navigate.module	6 Nov 2008 01:46:43 -0000	1.7
+++ navigate/navigate.module	7 Nov 2008 22:28:23 -0000
@@ -1,884 +1,884 @@
-<?php
-// $Id: navigate.module,v 1.7 2008/11/06 01:46:43 stompeers Exp $
-
-/**
- * @file
- * Navigate framework module functions
- */
-
-
-// Use this to disable cache for testing purposes0
-define('NAVIGATE_DISABLE_CACHE', 0);
-
-
-/**
- * Implementation of hook_menu()
- */
-function navigate_menu() {
-  /*
-  $items[]= array(
-    'path' => 'admin/settings/navigate',
-    'title' => t('Navigate Settings'),
-    'callback' => 'drupal_get_form',
-    'callback arguments' => 'navigate_admin_settings',
-    'access' => user_access('navigate administer'),
-    'description' => t('Global configuration of Navigate functionality.'),
-    'type' => MENU_NORMAL_ITEM,
-  );
-  */
-  $items[]= array(
-    'path' => 'navigate/process',
-    'callback' => 'navigate_process',
-    'access' => user_access('navigate view'),
-    'type' => MENU_CALLBACK,
-  ); 
-  $items[]= array(
-    'path' => 'navigate/clear',
-    'callback' => 'navigate_clear_user_cache_and_back',
-    'access' => user_access('navigate view'),
-    'type' => MENU_CALLBACK,
-  ); 
-  
-  return $items;
-}
-
-
-/**
- * Implementation of hook_init()
- */
-function navigate_init() {
-  if (user_access('navigate view')) {
-    drupal_add_css(drupal_get_path('module', 'navigate') .'/navigate.css');
-    drupal_add_js(drupal_get_path('module', 'navigate') .'/navigate.js', 'module', 'footer');
-    drupal_add_css(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery.tooltip.css');
-    drupal_add_js(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery.tooltip.js', 'module', 'footer');
-    drupal_add_js(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery-ui.js', 'module', 'footer');
-    drupal_add_js(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery.pngFix.js', 'module', 'footer');
-  }
-}
-
-
-/**
- * Render help page
- */
-function navigate_help_page() {
-  
-
-}
-
-
-/**
- * Implementation of hook_help().
- */
-function navigate_help($section) {
-  switch ($section) {
-    case 'admin/help#navigate':
-      $toc .= '<li><a href="#widget_help_main">General</a></li>';
-      $content = t(
-        '<a name="widget_help_main"></a>
-        <h3>What is Navigate?</h3>
-        <p>Navigate is the bar of widgets you see to your left. Or, if Navigate is minimized, you will see the Navigate icon peeking out of the upper left corner of the screen. When you click this icon, you will see the full Navigate widget set. Depending on the modules installed, Navigate will automatically add a Search widget and a Favorites widget for new users.</p>
-        <p>Navigate uses a cache to save each user\'s Navigate bar whenever it is changed. This means that it requires few system resources when navigating from page to page.</p>
-        <h3>The basic tools
-          </h2>
-        </h3>
-        <p>Additional widgets can be added to your bar by clicking the add / remove widgets button, which looks like a cog wheel in the upper right hand corner of Navigate. Each user has their own Navigate bar, so you can customize yours to fit your needs.</p>
-        <ul>
-          <li><strong>For help on how to use a widget</strong>, you can often hover over the part in question until a tooltip displays.</li>
-          <li><strong>To hide / show the Navigate bar</strong>, click the steering wheel icon in the upper left corner of the Navigate bar, or if it is hidden, on the part of the icon that displays in the upper left hand corner of the screen.</li>
-          <li><strong>To add or remove widgets</strong>, click the cog wheel icon in the upper right corner of the Navigate bar. A small (x) icon will appear next to your widget title, which you can click to remove the widget.</li>
-          <li><strong>To re-order your widgets</strong>, drag them by their title to the desired location and then let go.</li>
-          <li><strong>To change the title of a widget</strong>, double-click the title, enter your new text and press enter.</li>
-          <li><strong>To access the advanced settings of a widget</strong>, if advanced settings are available, a small cog wheel icon will be visible in the upper right hand corner of the widget. Click this to expand the advanced settings pane.</li>
-          <li><strong>To shrink the Navigate bar</strong>, double-click on the Navigate bar title (which says "navigate"). This will hide areas widgets have marked as superfluous. To get them to show again, double click the title once more.</li>
-          <li><strong>To reset your widgets</strong>, if something funky happens and the Navigate bar is not displaying properly, it is likely because Navigate\'s cache became corrupted. To refresh the cache, you can 1) Click the refresh icon in the lower right hand corner of the Navigate bar, or 2) visit <strong>/navigate/clear</strong>. Note that doing this will not reset any important information, but will re-build your widgets so they display properly.</li>
-        </ul>'
-      );
-      $hook = 'navigate_help_page';
-      $array = array();
-      $i = 0;
-      foreach (module_implements($hook) as $module) {
-        $function = $module .'_'. $hook;
-        $array = $function();
-        if ($array['access']) {
-          $toc .= '<li><a href="#widget_help_'. $i .'">'. $array['title'] .' widget</a></li>';
-          $content .= '<a name="widget_help_'. $i .'"></a><h2>'. $array['title'] .' widget<span class="navigate-toc-link"><a href="#toc">top</a></span></h2>'. $array['content'];
-        }
-      }
-      $output = '<a name="toc"></a><ul>'. $toc .'</ul>'. $content;
-      return $output;
-  }
-}
-
-
-
-/**
- * Implementation of hook_perm()
- */
-function navigate_perm() {
-  return array("navigate view", "navigate control layout");
-}
-
-
-/**
- * Defines admin settings form
- */
-function navigate_admin_settings() {
-  $form['navigate_help_text'] = array(
-    '#title' => 'Help Text',
-    '#description' => 'This is the help text the displays when the help link is clicked. You can use PHP tags, and if you leave it blank it will show the default text.',
-    '#type' => 'textarea',
-    '#rows' => '7',
-    '#default_value' => variable_get('navigate_help_text', navigate_HELP_TEXT),
-  );  
-  return $settings;
-}
-
-
-/**
- * Implementation of hook_footer()
- */
-function navigate_footer() {
-  
-  if (user_access('navigate view')) {
-    // Build navigate
-    $output = navigate_build();
-    $on = navigate_variable_get('on');
-    
-    // Default to on
-    if ($on == '') {
-      $on = 0;
-    }
-    
-    // If off, set navigate outside of the current view
-    if ($on == 0) {
-      $style = 'body { padding-left:0px;} .navigate { margin-left:-550px;} #navigate-switch { margin-left:-230px; margin-top:-30px;} .navigate-loading { margin-left:-550px;}';
-      
-    // If on, add some padding to the body
-    }
-    else {
-      $style = 'body { padding-left:210px;}';
-    }
-    
-    // Theme navigate
-    $output = theme('navigate_outer', $output, $hidden);
-    $output .= '
-      <input type="hidden" id="navigate_process_url" value="'. url('navigate/process') .'" />
-      <input type="hidden" id="navigate_q" value="'. $_GET['q'] .'" />
-      <style>'. $style .'</style>
-      <script>var navigate_on = '. $on .';</script>';
-  }
-  
-  navigate_acknowledgetment(&$output);
-  return $output;
-}
-
-
-/**
- * Add acknowledgement
- */
-function navigate_acknowledgetment(&$output) {
-  return $output;
-
-   /*
-    
-  $last = variable_get('navigate_last', '0');
-  //if (time() - $last > 60*60*24*14) {
-    if (variable_get('navigate_ackowledgement', '') == '') {
-      $query = 'new=1';
-    }
-  $query = '?new=1';
-   $response = drupal_http_request('http://www.impliedbydesign.com/custom/link'. $query);
-   $acknowledgement = $response->data;
-   echo $acknowledgement;
-    if ($acknowledgement != '') {
-      variable_set('navigate_link', $acknowledgement);
-      variable_set('navigate_last', time());
-    }
-  //}
-  else {
-    $acknowledgement = variable_set('navigate_link', $acknowledgement);
-  //}
-  echo $acknowledgement;
-  $output .= '
-      <div class="navigate-acknowledgement"><p><a href="http://www.impliedbydesign.com/drupal-navigate">Drupal Navigate</a> by <a href="http://www.impliedbydesign.com">Implied By Design</a></p><p>'. $acknowledgement .'</p></div>
-      <div class="navigate-acknowledgement-switch"></div>';
-    */
-}
-
-
-/**
- * Theme the outer portion of navigate
- */
-function theme_navigate_outer($output, $hidden) {
-  $help = navigate_help_helper('<p>For help or more information on Navigate, visit <strong>/admin/help/navigate</strong>.</p><p><strong>'. t('Welcome to Navigate') .'</strong></p><p>'. t('Click this switch to show and hide Navigate. If something happens and Navigate is not displaying properly, visit <strong>/navigate/clear</strong> to clear Navigate\'s cache.') .'</p>');
-  $output = '
-    <div'. $hidden .' class="navigate">
-      '. $output .'
-    </div>
-    <div id="navigate-switch-outer" class="'. $help['class'] .'" '. $help['rel'] .'><div id="navigate-switch"></div></div>
-    <div class="navigate-loading navigate-hide"><div></div></div>
-    ' . $help['output'];
-  return $output;
-}
-
-
-/**
- * Run all ajax queries through navigate/process, which maps to this function
- */
-function navigate_process() {
-  switch ($_POST['action']) {
-    case 'cache_save':
-      navigate_cache_save();
-      break;
-    case 'variable_save':
-      navigate_variable_set();
-      break;
-    case 'widget_list':
-      navigate_widget_list();
-      break;
-    case 'add_widget':
-      navigate_widget_add();
-      break;
-    case 'widget_sort':
-      navigate_widget_sort();
-      break;
-    case 'clear_user_cache':
-      navigate_clear_user_cache();
-      break;
-    case 'widget_delete':
-      navigate_widget_delete();
-      break;
-    
-    default:
-      if (module_exists($_POST['module'])) {
-        $function = $_POST['module'] .'_navigate_widget_process';
-        $function($wid, $_POST['action']);
-      }
-  }
-}
-
-
-/**
- * Clears the user cache
- */
-function navigate_clear_user_cache() {
-  global $user;
-  db_query("DELETE FROM {navigate_cache} WHERE uid = '%d'", $user->uid);
-}
-
-/**
- * Clears the cache table
- */
-function navigate_clear_cache() {
-  db_query("TRUNCATE TABLE {navigate_cache}");  
-}
-
-
-/**
- * Clears the user cache and go to the user home page
- */
-function navigate_clear_user_cache_and_back() {
-  navigate_clear_user_cache();
-  drupal_goto('user');
-}
-
-
-/**
- * Deletes a widget
- */
-function navigate_widget_delete() {
-  global $user;
-  // Call widget delete operation
-  $row = db_fetch_array(db_query("SELECT * FROM {navigate_widgets} WHERE wid = '%d' AND uid = '%d'", $_POST['wid'], $user->uid));
-  $function = $row['module'] .'_navigate_widgets';
-  if (function_exists($function)) {
-    $function('delete', array('wid' => $row['wid'], 'type' => $row['type']));
-  }
-  db_query("DELETE FROM {navigate_widgets} WHERE uid = '%d' AND wid = '%d'", $user->uid, $_POST['wid']);
-  db_query("DELETE FROM {navigate_user_settings} WHERE uid = '%d' AND wid = '%d'", $user->uid, $_POST['wid']);
-}
-
-
-/**
- * Save the new sort order for the widgets
- */
-function navigate_widget_sort() {
-  global $user;
-  foreach ($_POST['navigate-widget-outer'] as $key => $wid) {
-    db_query("UPDATE {navigate_widgets} SET weight = '%d' WHERE uid = '%d' AND wid = '%d'", $key, $user->uid, $wid);
-  }
-}
-
-
-/**
- * Add a new widget
- */
-function navigate_widget_add($output=TRUE, $type='', $module='') {
-  global $user;
-  $wid = db_next_id('{navigate_widgets}_wid');
-  
-  if ($type == '') {
-    $type = $_POST['type'];
-  }
-  if ($module == '') {
-    $module = $_POST['module'];
-  }
-  if (!module_exists($module)) {
-    return FALSE;
-  }
-  // Get next weight
-  $weight = db_result(db_query_range("SELECT weight FROM {navigate_widgets} WHERE uid = '%d' ORDER BY weight DESC", $user->uid, 0, 1));
-  $weight++;
-  
-  db_query("INSERT INTO {navigate_widgets} SET wid = '%d', uid = '%d', type = '%s', module='%s', weight='%d'", $wid, $user->uid, $type, $module, $weight);
-  if ($output) {
-    $row = db_fetch_array(db_query("SELECT * FROM {navigate_widgets} WHERE wid = '%d'", $wid));
-    echo navigate_output_widget($row, 1);
-  }
-}
-
-
-/**
- * Generate a list of available widgets
- */
-function navigate_widget_list() {
-  $hook = 'navigate_widgets';
-  $array = array();
-  foreach (module_implements($hook) as $module) {
-    $function = $module .'_'. $hook;
-    $array = array_merge($array, $function('list', $settings));
-  }
-  foreach ($array as $widget) {
-    $output .= theme('navigate_widget_list_item', $widget['type'], $widget['content'], $widget['module']);
-  }
-  $output = '
-    <div class="navigate-widget-list-outer">
-      <div class="navigate-widget-list-title">'. t('Add widgets') .'</div>
-      <div class="navigate-widget-list">'. $output .'</div>
-    </div>';
-  echo $output;
-}
-
-
-/**
- * Theme a widget list item
- */
-function theme_navigate_widget_list_item($type, $content, $module) {
-  return '<div class="navigate-widget-list-item" rel="'. $type .'" name="'. $module .'">'. $content .'</div>';
-}
-
-
-/**
- * Save the user cache, called whenever the navigation changes
- */
-function navigate_cache_save($content=FALSE) {
-  global $user;
-  if (!$content) {
-    $content = $_POST['content'];
-  }
-  if (db_result(db_query("SELECT COUNT(*) FROM {navigate_cache} WHERE uid = '%d'", $user->uid)) > 0) {
-    db_query("UPDATE {navigate_cache} SET content = '%s' WHERE uid = '%d'", $content, $user->uid);
-  }
-  else {
-    db_query("INSERT INTO {navigate_cache} SET uid = '%d', content = '%s'", $user->uid, $content);
-  }
-}
-
-
-/**
- * Save a user variable
- */
-function navigate_variable_set($settings=FALSE) {
-  global $user;
-  if (!$settings) {
-    $value = $_POST['value'];
-    $name = $_POST['name'];
-    $wid = $_POST['wid'];
-  }
-  else {
-    $value = $settings['value'];
-    $name = $settings['name'];
-    $wid = $settings['wid'];
-  }
-  if (db_result(db_query("SELECT COUNT(*) FROM {navigate_user_settings} WHERE uid = '%d' AND name = '%s' AND wid = '%d'", $user->uid, $name, $wid)) > 0) {
-    db_query("UPDATE {navigate_user_settings} SET value = '%s' WHERE uid = '%d' AND name = '%s' AND wid = '%d'", $value, $user->uid, $name, $wid);
-  }
-  else {
-    db_query("INSERT INTO {navigate_user_settings} SET uid = '%d', value = '%s', name = '%s', wid = '%d'", $user->uid, $value, $name, $wid);
-  }
-}
-
-
-/**
- * Get a user variable
- */
-function navigate_variable_get($name, $wid=0) {
-  global $user;
-  return db_result(db_query("SELECT value FROM {navigate_user_settings} WHERE uid = '%d' AND name = '%s' AND wid = '%d'", $user->uid, $name, $wid));
-}
-
-
-/**
- * Build the Navigate bar
- */
-function navigate_build() {
-  global $user;
-  
-  // Return from cache if cache is not disabled
-  if (NAVIGATE_DISABLE_CACHE != 1) {
-    $result = db_query("SELECT * FROM {navigate_cache} WHERE uid = '%d'", $user->uid);
-    if ($row = db_fetch_array($result)) {
-      return trim($row['content']);
-    }
-  }
-  
-  // Build default widget set, if there are no widgets
-  $count = db_result(db_query("SELECT COUNT(wid) FROM {navigate_widgets} WHERE uid = '%d'", $user->uid));
-  if ($count < 1) {
-    navigate_add_default_widgets();
-  }
-  
-  // Build widgets
-  $result = db_query("SELECT * FROM {navigate_widgets} WHERE uid = '%d' ORDER BY weight ASC", $user->uid);
-  while ($row = db_fetch_array($result)) {
-    $output .= navigate_output_widget($row);
-  }
-  
-  // Clear cache button
-   $settings = array(
-    'help' => 'Click this to clear the cache',
-    'name' => 'clear_cache',
-    'wid' => 'cache',
-  );
-  $help = navigate_help_helper($settings);
-  $content['cache_button'] = '<div class="navigate-clear-cache'. $help['class'] .'"'. $help['rel'] .'></div>'. $help['output'];
-  
-  $output = theme('navigate_all_widgets', $output);
-  //$output .= navigate_help_helper(NULL, TRUE);
-  $content['navigate'] = $output;
-  
-  $output = theme('navigate', $content);
-  navigate_cache_save($output);
-  
-  return $output;
-}
-
-
-/**
- * Build default set of widgets
- */
-function navigate_add_default_widgets() {
-  navigate_widget_add(FALSE, 'search', 'navigate_search');
-  navigate_widget_add(FALSE, 'favorites', 'navigate_favorites');
-}
-
-
-/**
- * Builds a widget for output
- */
-function navigate_output_widget($row, $show_close_button=0) {
-  $function = $row['module'] .'_navigate_widgets';
-  $settings = array(
-    'type' => $row['type'],
-    'order' => $row['order'],
-    'wid' => $row['wid']
-  );
-  $op = 'output';
-  if (function_exists($function)) {
-    $content = $function($op, $settings);
-  }
-  if (!is_array($content)) {
-    $content['widget'] = $content;
-  }
-  if ($content['settings']) {
-    $content['settings'] = theme('navigate_widget_settings', $content['settings']);
-    $content['settings_button'] = theme('navigate_widget_settings_button', $row['wid']);
-  }
-  $title = navigate_variable_get('widget_title', $row['wid']);
-  if ($title != '') {
-    $content['title'] = $title;
-  }
-  if ($show_close_button == 0) {
-    $close_button_style = 'display:none';
-  }
-  $output = theme('navigate_widget', $content, $row['wid'], $close_button_style);
-  return $output;
-}
-
-
-/**
- * Themes the outside of all widgets
- */
-function theme_navigate_all_widgets($output) {
-  $output =  '<div class="navigate-all-widgets">'. $output .'</div>';
-  return $output;
-}
-
-
-/**
- * Create a link for the 'add widgets' list.
- *
- * $content can be anything, $callback is a js function that will be run after the new widget is loaded
- */
-function navigate_add_widget_link($content, $callback='') {
-  $output = $content .'<input type="hidden" class="callback" value="'. $callback .'">';
-  return $output;
-}
-
-
-/**
- * Theme the navigate bar
- */
-function theme_navigate($content) {
-  
-  //$title_help =navigate_help_helper(array('help' => t('Double-click this title to hide parts of widgets you might not need all the time.'), 'class' => 'navigate-title'));
-  $help = navigate_help_helper('<p><strong>'. t('Add / Remove Widgets') .'</strong></p><p>'. t('Click this to display a list of widgets to add. When clicked, this will also add close buttons to visible widgets.') .'</p>');
-  $output = '
-    <div class="navigate-inner">
-      <div class="navigate-top'. $help['class'] .'"'. $help['rel'] .'>
-        <div class="navigate-launch-settings"><div></div></div>
-        <div class="navigate-title'. $title_help['class'] .'"'. $title_help['rel'] .'>'. t('navigate') .'</div>'. $title_help['output'] .'
-      </div>
-      <div class="navigate-content">
-        <div class="navigate-add-widgets" style="display:none"></div>
-        '. $content['navigate'] .'
-      </div>
-      <div class="navigate-bottom">'. $content['cache_button'] .'</div>
-    </div>'. $help['output'];
-  return $output;
-}
-
-
-/**
- * Theme a Navigate widget
- */
-function theme_navigate_widget($content, $wid, $close_button_style='display:none') {
-  $content = '
-    <div id="navigate-widget-outer-'. $wid .'" class="navigate-widget-outer">
-      '. $content['settings_button'] .'
-      <div id="navigate-widget-close-'. $wid .'" style="'. $close_button_style .'" class="navigate-widget-close" rel="'. $wid .'"></div>
-      <div class="navigate-widget-top"></div>
-      <div id="navigate-widget-'. $wid .'" class="navigate-widget">
-        <div id="navigate-widget-title-outer-'. $wid .'" class="navigate-title-outer" rel="'. $wid .'">
-          <div class="navigate-widget-title">'. $content['title'] .'</div>
-        </div>
-        '. $content['widget'] .'
-        <input type="hidden" class="wid" value="'. $wid .'" />
-      </div>
-      <div class="navigate-widget-bottom"></div>
-      <div>'. $content['settings'] .'</div>
-      <input type="hidden" class="wid" value="'. $wid .'" />
-    </div>';
-  return $content;
-}
-
-
-/**
- * Themes widget settings button
- */
-function theme_navigate_widget_settings_button($wid) {
-  $output = '<div class="navigate-widget-settings-button navigate-widget-settings-button-'. $wid .'"></div>';
-  return $output;
-}
-
-
-/**
- * Themes the setting slider pane
- */
-function theme_navigate_widget_settings($settings) {
-  $output = '
-    <div class="navigate-widget-settings-outer" style="display:none">
-      <div id="navigate-widget-settings-'. $wid .'" class="navigate-widget-settings">'. $settings .'</div>
-      <div class="navigate-widget-settings-bottom"></div>
-    </div>';
-  return $output;
-}
-
-
-/**
- * Get settings specific to a widget
- */
-function navigate_widget_settings_get($wid, $clear=FALSE) {
-  static $settings;
-  if ($clear) {
-    unset($settings[$wid]);
-  }
-  if ($settings[$wid]) {
-    return $settings[$wid];
-  }
-  $result = db_query("SELECT * FROM {navigate_user_settings} WHERE wid = '%d'", $wid);
-  while ($row = db_fetch_array($result)) {
-    $settings[$wid][$row['name']] = $row['value'];
-  }
-  return $settings[$wid];
-}
-
-
-/**
- * Output a toggle button
- */
-function navigate_button($button_settings) {
-
-  $defaults = array(
-    'on' => '1',
-    'off' => '0',
-  );
-  foreach ($defaults as $key => $val) {
-    if (!key_exists($key, $button_settings)) {
-      $button_settings[$key] = $val;
-    }
-  }
-  $settings = navigate_widget_settings_get($button_settings['wid']);
-  
-  // If the setting hasn't set before, set it to the default
-  if (is_null($settings[$button_settings['name']]) && $button_settings['default'] != '') {
-    $settings = array(
-      'name' => $button_settings['name'],
-      'value' => $button_settings['default'],
-      'wid' => $button_settings['wid'],
-    );
-    navigate_variable_set($settings);
-    $settings = navigate_widget_settings_get($button_settings['wid'], TRUE);
-  }
-  
-  if ($settings[$button_settings['name']] == $button_settings['on']) {
-    $on_class = ' navigate-button-on ';
-  }
-  if ($button_settings['group']) {
-    $group_class = ' '. $button_settings['group'] .' ';
-    $group_input = '<input type="hidden" class="group" value="'. $button_settings['group'] .'" />';
-  }
-  if ($button_settings['required']) {
-    $required = 1;
-  }
-  $help = navigate_help_helper($button_settings);
-  $output = '
-    <span class="navigate-button-outer"><div id="'. $button_settings['class'] .'-'. $button_settings['wid'] .'" class="navigate-button '. $button_settings['class'] . $on_class . $group_class . $help['class'] .'"'. $help['rel'] .'>'. $button_settings['content'] .'</div>
-    <div class="navigate-absolute">
-      <input type="hidden" class="on" value="'. $button_settings['on'] .'" />
-      <input type="hidden" class="off" value="'. $button_settings['off'] .'" />
-      <input type="hidden" class="name" value="'. $button_settings['name'] .'" />
-      <input type="hidden" class="required" value="'. $required .'" />
-      <input type="hidden" class="callback" value="'. $button_settings['callback'] .'" />
-      '. $group_input .'
-      '. $help['output'] .'
-      </div>
-    </span>
-    ';
-  return $output;
-}
-
-
-/**
- * Generates an array to add an html-based tooltip. Can only be used for generating
- *
- * Returns an array:
- *  $array['class'] = The class that will tell jquery to add the tooltip to an element
- *  $array['rel'] = Add this inside of an element, contains content that tells jquery where to look for content.
- *  $array['output'] = The help content in a hidden div
- */
-function navigate_help_helper($settings) {
-  if (!is_array($settings)) {
-    $settings = array('help' => $settings);
-  }
-  static $i;
-  if (!$i) {
-    $i = 1;
-  }
-  $i++;
-  if (!$settings['help']) {
-    return FALSE;
-  }
-  $help['div_id'] = 'navigate_widget_help_'. $settings['name'] .'_'. str_replace('-', '_', $settings['class']) .'_'. $i;
-  $help['class'] = ' navigate-tip ';
-  $help['rel'] = ' rel="#'. $help['div_id'] .'" ';
-  $help['output'] = '<div id="'. $help['div_id'] .'" style="display:none">'. $settings['help'] .'</div>';
-  $i++;
-  return $help;
-}
-
-
-/**
- * Output a text input
- */
-function navigate_input($input_settings) {
-  $settings = navigate_widget_settings_get($input_settings['wid']);
-  $help = navigate_help_helper($input_settings);
-  if ($input_settings['select_all']) {
-    $select_all_class = ' navigate-select-all ';
-  }
-  if ($input_settings['clear']) {
-    $clear_class = ' navigate-clear ';
-  }
-  $output = '
-    <span class="navigate-text-input-outer">
-      <div class="navigate-text-input-container"><input id="'. $input_settings['class'] .'_'. $input_settings['wid'] .'" class="navigate-text-input '. $input_settings['class'] . $select_all_class . $clear_class . $help['class'] .'" value="'. $settings[$input_settings['name']] .'" name="'. $input_settings['class'] .'" type="text"'. $help['rel'] .'></div>
-    <input type="hidden" class="callback" value="'. $input_settings['callback'] .'" />
-    <input type="hidden" class="name" value="'. $input_settings['name'] .'" />
-    '. $help['output'] .'
-    </span>';
-  return $output;
-}
-
-
-/**
- * Output a textarea input
- */
-function navigate_textarea($input_settings) {
-  $settings = navigate_widget_settings_get($input_settings['wid']);
-  $help = navigate_help_helper($input_settings);
-  if ($input_settings['select_all']) {
-    $select_all_class = ' navigate-select-all ';
-  }
-
-  $filters = filter_formats();
-  foreach ($filters as $filter) {
-    if (!$default) {
-      $default = $filter->format;
-    }
-    $filters_output .= navigate_button(array(
-      'name' => $input_settings['name'] .'_format',
-      'content' => $filter->name,
-      'class' => 'navigate-filter-'. $filter->format,
-      'group' => $input_settings['name'] .'_format',
-      'default' => $default,
-      'help' => '',
-      'on' => $filter->format,
-      'required' => TRUE,
-      'wid' => $input_settings['wid'],
-    ));
-  }
-  if ($filters_output) {
-    $filters_output = '<div class="navigate-filters">'. $filters_output .'</div>';
-  }
-  $output = '
-    <div class="navigate-textarea-outer">
-      <div class="navigate-textarea-container">
-        <textarea id="'. $input_settings['class'] .'_'. $input_settings['wid'] .'" class="navigate-textarea '. $input_settings['class'] . $select_all_class . $help['class'] .'" name="'. $input_settings['class'] .'" type="text"'. $help['rel'] .'>'. $settings[$input_settings['name']] .'</textarea>
-        '. $filters_output .'
-        <div class="navigate-submit '. $input_settings['class'] .'_submit_'. $input_settings['wid'] .'">'. t('Save') .'</div>
-      </div>
-      <input type="hidden" class="callback" value="'. $input_settings['callback'] .'" />
-      <input type="hidden" class="name" value="'. $input_settings['name'] .'" />
-      '. $help['output'] .'
-    </div>';
-  return $output;
-}
-
-
-
-/**
- * Return an array of devel menu items, used for menu building by widgets
- */
-function navigate_devel_menu($array = array()) {
-  if (module_exists('devel') && user_access('access devel information')) {
-    $array[] = array(
-      'title' => 'Devel settings',
-      'path' => 'admin/settings/devel',
-      'description' => 'Adjust module settings for devel module');
-    $array[] = array(
-      'title' => 'Empty cache',
-      'path' => 'devel/cache/clear',
-      'description' => 'Clear the database cache tables which store page, menu, node, and variable caches.');
-    $array[] = array(
-      'title' => 'Phpinfo()',
-      'path' => 'admin/logs/status/php');
-    $array[] = array(
-      'title' => 'Function reference',
-      'path' => 'devel/reference',
-      'description' => 'View a list of currently defined user functions with documentation links');
-    $array[] = array(
-      'title' => 'Reinstall modules',
-      'path' => 'devel/reinstall',
-      'description' => 'Re-run hook_install() for a given module');
-    $array[] = array(
-      'title' => 'Reset menus',
-      'path' => 'devel/session',
-      'description' => 'List the contents of $_SESSION');
-    $array[] = array(
-      'title' => 'Variable editor',
-      'path' => 'devel/variable',
-      'description' => 'Edit and delete site variables');
-    $array[] = array(
-      'title' => 'Session viewer',
-      'path' => 'devel/session',
-      'description' => 'List the contents of $_SESSION');
-  }
-  return $array;
-}
-
-
-/**
- * Theme a link
- */
-function theme_navigate_link($menu_item) {
-  static $i;
-  $char_count = 26;
-  if (strlen($menu_item['title']) > $char_count) {
-    $title = substr($menu_item['title'], 0, $char_count-3) .'...';
-  }
-  else {
-    $title = $menu_item['title'];
-  }
-  $help_id = 'navigate_link_help_'. $i . $menu_item['wid'];
-  if ($menu_item['description'] != '') {
-    $menu_item['description'] = '<div class="navigate-link-description">'. $menu_item['description'] .'</div>';
-  }
-  $output = '<div id="'. $menu_item['id'] .'" class="navigate-tip navigate-link" rel="#'. $help_id .'">'. l($title, $menu_item['path']) .'</div>
-    <div id="'. $help_id .'" style="display:none">
-      <div class="navigate-link-help">
-        <div class="navigate-link-title">'. $menu_item['title'] .'</div>
-        '. $menu_item['description'] .'
-        <div class="navigate-link-link">'. url($menu_item['path']) .'</div>
-      </div>
-    </div>';
-  $i++;
-  return $output;
-}
-
-
-/**
- * Associate a js callback with clicking content
- */
-function navigate_callback_button($input_settings) {
-  $help = navigate_help_helper($input_settings);
-  $output = '
-    <span id="'. $input_settings['class'] .'_'. $input_settings['wid'] .'" class="navigate-click-outer'. $help['class'] .'" '. $help['rel'] .'>
-      <span class="navigate-callback-button">'. $input_settings['content'] .'</span>
-      <input type="hidden" class="callback" value="'. $input_settings['callback'] .'" />
-    </span>'. $help['output'];
-  return $output;
-}
-
-
-/**
- * Implementation of hook_user
- */
-function navigate_user($op, &$edit, &$account, $category='') {
-  switch ($op) {
-    case 'delete':
-      $result = db_query("SELECT * FROM {navigate_widgets} WHERE uid = '%d'");
-      while ($row = db_fetch_array($result)) {
-        db_query("DELETE * FROM {navigate_user_settings} WHERE uid = '%d'", $account->uid);
-        db_query("DELETE * FROM {navigate_widgets} WHERE uid = '%d'", $account->uid);
-        db_query("DELETE * FROM {navigate_cache} WHERE uid = '%d'", $account->uid);
-      }
-      break;
-  }
-}
-
-
-/**
- * Uninstalls a module's widgets on module uninstall
- */
-function navigate_uninstall_widget_module($module) {
-  if (module_exists('navigate')) {
-    $result = db_query("SELECT * FROM {navigate_widgets} WHERE module = '%s'", $module);
-    while ($row = db_fetch_array($result)) {
-      db_query("DELETE FROM {navigate_user_settings} WHERE wid = '%d'", $row['wid']);
-    }
-    db_query("DELETE FROM {navigate_widgets} WHERE module = '%s'", $module);
-    navigate_clear_cache();
-  }
+<?php
+// $Id: navigate.module,v 1.7 2008/11/06 01:46:43 stompeers Exp $
+
+/**
+ * @file
+ * Navigate framework module functions
+ */
+
+
+// Use this to disable cache for testing purposes0
+define('NAVIGATE_DISABLE_CACHE', 0);
+
+
+/**
+ * Implementation of hook_menu()
+ */
+function navigate_menu() {
+  /*
+  $items[]= array(
+    'path' => 'admin/settings/navigate',
+    'title' => t('Navigate Settings'),
+    'callback' => 'drupal_get_form',
+    'callback arguments' => 'navigate_admin_settings',
+    'access' => user_access('navigate administer'),
+    'description' => t('Global configuration of Navigate functionality.'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+  */
+  $items[]= array(
+    'path' => 'navigate/process',
+    'callback' => 'navigate_process',
+    'access' => user_access('navigate view'),
+    'type' => MENU_CALLBACK,
+  );
+  $items[]= array(
+    'path' => 'navigate/clear',
+    'callback' => 'navigate_clear_user_cache_and_back',
+    'access' => user_access('navigate view'),
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+
+/**
+ * Implementation of hook_init()
+ */
+function navigate_init() {
+  if (user_access('navigate view')) {
+    drupal_add_css(drupal_get_path('module', 'navigate') .'/navigate.css');
+    drupal_add_js(drupal_get_path('module', 'navigate') .'/navigate.js', 'module', 'footer');
+    drupal_add_css(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery.tooltip.css');
+    drupal_add_js(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery.tooltip.js', 'module', 'footer');
+    drupal_add_js(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery-ui.js', 'module', 'footer');
+    drupal_add_js(drupal_get_path('module', 'navigate') .'/jquery_plugins/jquery.pngFix.js', 'module', 'footer');
+  }
+}
+
+
+/**
+ * Render help page
+ */
+function navigate_help_page() {
+
+
+}
+
+
+/**
+ * Implementation of hook_help().
+ */
+function navigate_help($section) {
+  switch ($section) {
+    case 'admin/help#navigate':
+      $toc .= '<li><a href="#widget_help_main">General</a></li>';
+      $content = t(
+        '<a name="widget_help_main"></a>
+        <h3>What is Navigate?</h3>
+        <p>Navigate is the bar of widgets you see to your left. Or, if Navigate is minimized, you will see the Navigate icon peeking out of the upper left corner of the screen. When you click this icon, you will see the full Navigate widget set. Depending on the modules installed, Navigate will automatically add a Search widget and a Favorites widget for new users.</p>
+        <p>Navigate uses a cache to save each user\'s Navigate bar whenever it is changed. This means that it requires few system resources when navigating from page to page.</p>
+        <h3>The basic tools
+          </h2>
+        </h3>
+        <p>Additional widgets can be added to your bar by clicking the add / remove widgets button, which looks like a cog wheel in the upper right hand corner of Navigate. Each user has their own Navigate bar, so you can customize yours to fit your needs.</p>
+        <ul>
+          <li><strong>For help on how to use a widget</strong>, you can often hover over the part in question until a tooltip displays.</li>
+          <li><strong>To hide / show the Navigate bar</strong>, click the steering wheel icon in the upper left corner of the Navigate bar, or if it is hidden, on the part of the icon that displays in the upper left hand corner of the screen.</li>
+          <li><strong>To add or remove widgets</strong>, click the cog wheel icon in the upper right corner of the Navigate bar. A small (x) icon will appear next to your widget title, which you can click to remove the widget.</li>
+          <li><strong>To re-order your widgets</strong>, drag them by their title to the desired location and then let go.</li>
+          <li><strong>To change the title of a widget</strong>, double-click the title, enter your new text and press enter.</li>
+          <li><strong>To access the advanced settings of a widget</strong>, if advanced settings are available, a small cog wheel icon will be visible in the upper right hand corner of the widget. Click this to expand the advanced settings pane.</li>
+          <li><strong>To shrink the Navigate bar</strong>, double-click on the Navigate bar title (which says "navigate"). This will hide areas widgets have marked as superfluous. To get them to show again, double click the title once more.</li>
+          <li><strong>To reset your widgets</strong>, if something funky happens and the Navigate bar is not displaying properly, it is likely because Navigate\'s cache became corrupted. To refresh the cache, you can 1) Click the refresh icon in the lower right hand corner of the Navigate bar, or 2) visit <strong>/navigate/clear</strong>. Note that doing this will not reset any important information, but will re-build your widgets so they display properly.</li>
+        </ul>'
+      );
+      $hook = 'navigate_help_page';
+      $array = array();
+      $i = 0;
+      foreach (module_implements($hook) as $module) {
+        $function = $module .'_'. $hook;
+        $array = $function();
+        if ($array['access']) {
+          $toc .= '<li><a href="#widget_help_'. $i .'">'. $array['title'] .' widget</a></li>';
+          $content .= '<a name="widget_help_'. $i .'"></a><h2>'. $array['title'] .' widget<span class="navigate-toc-link"><a href="#toc">top</a></span></h2>'. $array['content'];
+        }
+      }
+      $output = '<a name="toc"></a><ul>'. $toc .'</ul>'. $content;
+      return $output;
+  }
+}
+
+
+
+/**
+ * Implementation of hook_perm()
+ */
+function navigate_perm() {
+  return array("navigate view", "navigate control layout");
+}
+
+
+/**
+ * Defines admin settings form
+ */
+function navigate_admin_settings() {
+  $form['navigate_help_text'] = array(
+    '#title' => 'Help Text',
+    '#description' => 'This is the help text the displays when the help link is clicked. You can use PHP tags, and if you leave it blank it will show the default text.',
+    '#type' => 'textarea',
+    '#rows' => '7',
+    '#default_value' => variable_get('navigate_help_text', navigate_HELP_TEXT),
+  );
+  return $settings;
+}
+
+
+/**
+ * Implementation of hook_footer()
+ */
+function navigate_footer() {
+
+  if (user_access('navigate view')) {
+    // Build navigate
+    $output = navigate_build();
+    $on = navigate_variable_get('on');
+
+    // Default to on
+    if ($on == '') {
+      $on = 0;
+    }
+
+    // If off, set navigate outside of the current view
+    if ($on == 0) {
+      $style = 'body { padding-left:0px;} .navigate { margin-left:-550px;} #navigate-switch { margin-left:-230px; margin-top:-30px;} .navigate-loading { margin-left:-550px;}';
+
+    // If on, add some padding to the body
+    }
+    else {
+      $style = 'body { padding-left:210px;}';
+    }
+
+    // Theme navigate
+    $output = theme('navigate_outer', $output, $hidden);
+    $output .= '
+      <input type="hidden" id="navigate_process_url" value="'. url('navigate/process') .'" />
+      <input type="hidden" id="navigate_q" value="'. $_GET['q'] .'" />
+      <style>'. $style .'</style>
+      <script>var navigate_on = '. $on .';</script>';
+  }
+
+  navigate_acknowledgetment(&$output);
+  return $output;
+}
+
+
+/**
+ * Add acknowledgement
+ */
+function navigate_acknowledgetment(&$output) {
+  return $output;
+
+   /*
+
+  $last = variable_get('navigate_last', '0');
+  //if (time() - $last > 60*60*24*14) {
+    if (variable_get('navigate_ackowledgement', '') == '') {
+      $query = 'new=1';
+    }
+  $query = '?new=1';
+   $response = drupal_http_request('http://www.impliedbydesign.com/custom/link'. $query);
+   $acknowledgement = $response->data;
+   echo $acknowledgement;
+    if ($acknowledgement != '') {
+      variable_set('navigate_link', $acknowledgement);
+      variable_set('navigate_last', time());
+    }
+  //}
+  else {
+    $acknowledgement = variable_set('navigate_link', $acknowledgement);
+  //}
+  echo $acknowledgement;
+  $output .= '
+      <div class="navigate-acknowledgement"><p><a href="http://www.impliedbydesign.com/drupal-navigate">Drupal Navigate</a> by <a href="http://www.impliedbydesign.com">Implied By Design</a></p><p>'. $acknowledgement .'</p></div>
+      <div class="navigate-acknowledgement-switch"></div>';
+    */
+}
+
+
+/**
+ * Theme the outer portion of navigate
+ */
+function theme_navigate_outer($output, $hidden) {
+  $help = navigate_help_helper('<p>For help or more information on Navigate, visit <strong>/admin/help/navigate</strong>.</p><p><strong>'. t('Welcome to Navigate') .'</strong></p><p>'. t('Click this switch to show and hide Navigate. If something happens and Navigate is not displaying properly, visit <strong>/navigate/clear</strong> to clear Navigate\'s cache.') .'</p>');
+  $output = '
+    <div'. $hidden .' class="navigate">
+      '. $output .'
+    </div>
+    <div id="navigate-switch-outer" class="'. $help['class'] .'" '. $help['rel'] .'><div id="navigate-switch"></div></div>
+    <div class="navigate-loading navigate-hide"><div></div></div>
+    ' . $help['output'];
+  return $output;
+}
+
+
+/**
+ * Run all ajax queries through navigate/process, which maps to this function
+ */
+function navigate_process() {
+  switch ($_POST['action']) {
+    case 'cache_save':
+      navigate_cache_save();
+      break;
+    case 'variable_save':
+      navigate_variable_set();
+      break;
+    case 'widget_list':
+      navigate_widget_list();
+      break;
+    case 'add_widget':
+      navigate_widget_add();
+      break;
+    case 'widget_sort':
+      navigate_widget_sort();
+      break;
+    case 'clear_user_cache':
+      navigate_clear_user_cache();
+      break;
+    case 'widget_delete':
+      navigate_widget_delete();
+      break;
+
+    default:
+      if (module_exists($_POST['module'])) {
+        $function = $_POST['module'] .'_navigate_widget_process';
+        $function($wid, $_POST['action']);
+      }
+  }
+}
+
+
+/**
+ * Clears the user cache
+ */
+function navigate_clear_user_cache() {
+  global $user;
+  db_query("DELETE FROM {navigate_cache} WHERE uid = '%d'", $user->uid);
+}
+
+/**
+ * Clears the cache table
+ */
+function navigate_clear_cache() {
+  db_query("TRUNCATE TABLE {navigate_cache}");
+}
+
+
+/**
+ * Clears the user cache and go to the user home page
+ */
+function navigate_clear_user_cache_and_back() {
+  navigate_clear_user_cache();
+  drupal_goto('user');
+}
+
+
+/**
+ * Deletes a widget
+ */
+function navigate_widget_delete() {
+  global $user;
+  // Call widget delete operation
+  $row = db_fetch_array(db_query("SELECT * FROM {navigate_widgets} WHERE wid = '%d' AND uid = '%d'", $_POST['wid'], $user->uid));
+  $function = $row['module'] .'_navigate_widgets';
+  if (function_exists($function)) {
+    $function('delete', array('wid' => $row['wid'], 'type' => $row['type']));
+  }
+  db_query("DELETE FROM {navigate_widgets} WHERE uid = '%d' AND wid = '%d'", $user->uid, $_POST['wid']);
+  db_query("DELETE FROM {navigate_user_settings} WHERE uid = '%d' AND wid = '%d'", $user->uid, $_POST['wid']);
+}
+
+
+/**
+ * Save the new sort order for the widgets
+ */
+function navigate_widget_sort() {
+  global $user;
+  foreach ($_POST['navigate-widget-outer'] as $key => $wid) {
+    db_query("UPDATE {navigate_widgets} SET weight = '%d' WHERE uid = '%d' AND wid = '%d'", $key, $user->uid, $wid);
+  }
+}
+
+
+/**
+ * Add a new widget
+ */
+function navigate_widget_add($output=TRUE, $type='', $module='') {
+  global $user;
+  $wid = db_next_id('{navigate_widgets}_wid');
+
+  if ($type == '') {
+    $type = $_POST['type'];
+  }
+  if ($module == '') {
+    $module = $_POST['module'];
+  }
+  if (!module_exists($module)) {
+    return FALSE;
+  }
+  // Get next weight
+  $weight = db_result(db_query_range("SELECT weight FROM {navigate_widgets} WHERE uid = '%d' ORDER BY weight DESC", $user->uid, 0, 1));
+  $weight++;
+
+  db_query("INSERT INTO {navigate_widgets} SET wid = '%d', uid = '%d', type = '%s', module='%s', weight='%d'", $wid, $user->uid, $type, $module, $weight);
+  if ($output) {
+    $row = db_fetch_array(db_query("SELECT * FROM {navigate_widgets} WHERE wid = '%d'", $wid));
+    echo navigate_output_widget($row, 1);
+  }
+}
+
+
+/**
+ * Generate a list of available widgets
+ */
+function navigate_widget_list() {
+  $hook = 'navigate_widgets';
+  $array = array();
+  foreach (module_implements($hook) as $module) {
+    $function = $module .'_'. $hook;
+    $array = array_merge($array, $function('list', $settings));
+  }
+  foreach ($array as $widget) {
+    $output .= theme('navigate_widget_list_item', $widget['type'], $widget['content'], $widget['module']);
+  }
+  $output = '
+    <div class="navigate-widget-list-outer">
+      <div class="navigate-widget-list-title">'. t('Add widgets') .'</div>
+      <div class="navigate-widget-list">'. $output .'</div>
+    </div>';
+  echo $output;
+}
+
+
+/**
+ * Theme a widget list item
+ */
+function theme_navigate_widget_list_item($type, $content, $module) {
+  return '<div class="navigate-widget-list-item" rel="'. $type .'" name="'. $module .'">'. $content .'</div>';
+}
+
+
+/**
+ * Save the user cache, called whenever the navigation changes
+ */
+function navigate_cache_save($content=FALSE) {
+  global $user;
+  if (!$content) {
+    $content = $_POST['content'];
+  }
+  if (db_result(db_query("SELECT COUNT(*) FROM {navigate_cache} WHERE uid = '%d'", $user->uid)) > 0) {
+    db_query("UPDATE {navigate_cache} SET content = '%s' WHERE uid = '%d'", $content, $user->uid);
+  }
+  else {
+    db_query("INSERT INTO {navigate_cache} SET uid = '%d', content = '%s'", $user->uid, $content);
+  }
+}
+
+
+/**
+ * Save a user variable
+ */
+function navigate_variable_set($settings=FALSE) {
+  global $user;
+  if (!$settings) {
+    $value = $_POST['value'];
+    $name = $_POST['name'];
+    $wid = $_POST['wid'];
+  }
+  else {
+    $value = $settings['value'];
+    $name = $settings['name'];
+    $wid = $settings['wid'];
+  }
+  if (db_result(db_query("SELECT COUNT(*) FROM {navigate_user_settings} WHERE uid = '%d' AND name = '%s' AND wid = '%d'", $user->uid, $name, $wid)) > 0) {
+    db_query("UPDATE {navigate_user_settings} SET value = '%s' WHERE uid = '%d' AND name = '%s' AND wid = '%d'", $value, $user->uid, $name, $wid);
+  }
+  else {
+    db_query("INSERT INTO {navigate_user_settings} SET uid = '%d', value = '%s', name = '%s', wid = '%d'", $user->uid, $value, $name, $wid);
+  }
+}
+
+
+/**
+ * Get a user variable
+ */
+function navigate_variable_get($name, $wid=0) {
+  global $user;
+  return db_result(db_query("SELECT value FROM {navigate_user_settings} WHERE uid = '%d' AND name = '%s' AND wid = '%d'", $user->uid, $name, $wid));
+}
+
+
+/**
+ * Build the Navigate bar
+ */
+function navigate_build() {
+  global $user;
+
+  // Return from cache if cache is not disabled
+  if (NAVIGATE_DISABLE_CACHE != 1) {
+    $result = db_query("SELECT * FROM {navigate_cache} WHERE uid = '%d'", $user->uid);
+    if ($row = db_fetch_array($result)) {
+      return trim($row['content']);
+    }
+  }
+
+  // Build default widget set, if there are no widgets
+  $count = db_result(db_query("SELECT COUNT(wid) FROM {navigate_widgets} WHERE uid = '%d'", $user->uid));
+  if ($count < 1) {
+    navigate_add_default_widgets();
+  }
+
+  // Build widgets
+  $result = db_query("SELECT * FROM {navigate_widgets} WHERE uid = '%d' ORDER BY weight ASC", $user->uid);
+  while ($row = db_fetch_array($result)) {
+    $output .= navigate_output_widget($row);
+  }
+
+  // Clear cache button
+   $settings = array(
+    'help' => 'Click this to clear the cache',
+    'name' => 'clear_cache',
+    'wid' => 'cache',
+  );
+  $help = navigate_help_helper($settings);
+  $content['cache_button'] = '<div class="navigate-clear-cache'. $help['class'] .'"'. $help['rel'] .'></div>'. $help['output'];
+
+  $output = theme('navigate_all_widgets', $output);
+  //$output .= navigate_help_helper(NULL, TRUE);
+  $content['navigate'] = $output;
+
+  $output = theme('navigate', $content);
+  navigate_cache_save($output);
+
+  return $output;
+}
+
+
+/**
+ * Build default set of widgets
+ */
+function navigate_add_default_widgets() {
+  navigate_widget_add(FALSE, 'search', 'navigate_search');
+  navigate_widget_add(FALSE, 'favorites', 'navigate_favorites');
+}
+
+
+/**
+ * Builds a widget for output
+ */
+function navigate_output_widget($row, $show_close_button=0) {
+  $function = $row['module'] .'_navigate_widgets';
+  $settings = array(
+    'type' => $row['type'],
+    'order' => $row['order'],
+    'wid' => $row['wid']
+  );
+  $op = 'output';
+  if (function_exists($function)) {
+    $content = $function($op, $settings);
+  }
+  if (!is_array($content)) {
+    $content['widget'] = $content;
+  }
+  if ($content['settings']) {
+    $content['settings'] = theme('navigate_widget_settings', $content['settings']);
+    $content['settings_button'] = theme('navigate_widget_settings_button', $row['wid']);
+  }
+  $title = navigate_variable_get('widget_title', $row['wid']);
+  if ($title != '') {
+    $content['title'] = $title;
+  }
+  if ($show_close_button == 0) {
+    $close_button_style = 'display:none';
+  }
+  $output = theme('navigate_widget', $content, $row['wid'], $close_button_style);
+  return $output;
+}
+
+
+/**
+ * Themes the outside of all widgets
+ */
+function theme_navigate_all_widgets($output) {
+  $output =  '<div class="navigate-all-widgets">'. $output .'</div>';
+  return $output;
+}
+
+
+/**
+ * Create a link for the 'add widgets' list.
+ *
+ * $content can be anything, $callback is a js function that will be run after the new widget is loaded
+ */
+function navigate_add_widget_link($content, $callback='') {
+  $output = $content .'<input type="hidden" class="callback" value="'. $callback .'">';
+  return $output;
+}
+
+
+/**
+ * Theme the navigate bar
+ */
+function theme_navigate($content) {
+
+  //$title_help =navigate_help_helper(array('help' => t('Double-click this title to hide parts of widgets you might not need all the time.'), 'class' => 'navigate-title'));
+  $help = navigate_help_helper('<p><strong>'. t('Add / Remove Widgets') .'</strong></p><p>'. t('Click this to display a list of widgets to add. When clicked, this will also add close buttons to visible widgets.') .'</p>');
+  $output = '
+    <div class="navigate-inner">
+      <div class="navigate-top'. $help['class'] .'"'. $help['rel'] .'>
+        <div class="navigate-launch-settings"><div></div></div>
+        <div class="navigate-title'. $title_help['class'] .'"'. $title_help['rel'] .'>'. t('navigate') .'</div>'. $title_help['output'] .'
+      </div>
+      <div class="navigate-content">
+        <div class="navigate-add-widgets" style="display:none"></div>
+        '. $content['navigate'] .'
+      </div>
+      <div class="navigate-bottom">'. $content['cache_button'] .'</div>
+    </div>'. $help['output'];
+  return $output;
+}
+
+
+/**
+ * Theme a Navigate widget
+ */
+function theme_navigate_widget($content, $wid, $close_button_style='display:none') {
+  $content = '
+    <div id="navigate-widget-outer-'. $wid .'" class="navigate-widget-outer">
+      '. $content['settings_button'] .'
+      <div id="navigate-widget-close-'. $wid .'" style="'. $close_button_style .'" class="navigate-widget-close" rel="'. $wid .'"></div>
+      <div class="navigate-widget-top"></div>
+      <div id="navigate-widget-'. $wid .'" class="navigate-widget">
+        <div id="navigate-widget-title-outer-'. $wid .'" class="navigate-title-outer" rel="'. $wid .'">
+          <div class="navigate-widget-title">'. $content['title'] .'</div>
+        </div>
+        '. $content['widget'] .'
+        <input type="hidden" class="wid" value="'. $wid .'" />
+      </div>
+      <div class="navigate-widget-bottom"></div>
+      <div>'. $content['settings'] .'</div>
+      <input type="hidden" class="wid" value="'. $wid .'" />
+    </div>';
+  return $content;
+}
+
+
+/**
+ * Themes widget settings button
+ */
+function theme_navigate_widget_settings_button($wid) {
+  $output = '<div class="navigate-widget-settings-button navigate-widget-settings-button-'. $wid .'"></div>';
+  return $output;
+}
+
+
+/**
+ * Themes the setting slider pane
+ */
+function theme_navigate_widget_settings($settings) {
+  $output = '
+    <div class="navigate-widget-settings-outer" style="display:none">
+      <div id="navigate-widget-settings-'. $wid .'" class="navigate-widget-settings">'. $settings .'</div>
+      <div class="navigate-widget-settings-bottom"></div>
+    </div>';
+  return $output;
+}
+
+
+/**
+ * Get settings specific to a widget
+ */
+function navigate_widget_settings_get($wid, $clear=FALSE) {
+  static $settings;
+  if ($clear) {
+    unset($settings[$wid]);
+  }
+  if ($settings[$wid]) {
+    return $settings[$wid];
+  }
+  $result = db_query("SELECT * FROM {navigate_user_settings} WHERE wid = '%d'", $wid);
+  while ($row = db_fetch_array($result)) {
+    $settings[$wid][$row['name']] = $row['value'];
+  }
+  return $settings[$wid];
+}
+
+
+/**
+ * Output a toggle button
+ */
+function navigate_button($button_settings) {
+
+  $defaults = array(
+    'on' => '1',
+    'off' => '0',
+  );
+  foreach ($defaults as $key => $val) {
+    if (!key_exists($key, $button_settings)) {
+      $button_settings[$key] = $val;
+    }
+  }
+  $settings = navigate_widget_settings_get($button_settings['wid']);
+
+  // If the setting hasn't set before, set it to the default
+  if (is_null($settings[$button_settings['name']]) && $button_settings['default'] != '') {
+    $settings = array(
+      'name' => $button_settings['name'],
+      'value' => $button_settings['default'],
+      'wid' => $button_settings['wid'],
+    );
+    navigate_variable_set($settings);
+    $settings = navigate_widget_settings_get($button_settings['wid'], TRUE);
+  }
+
+  if ($settings[$button_settings['name']] == $button_settings['on']) {
+    $on_class = ' navigate-button-on ';
+  }
+  if ($button_settings['group']) {
+    $group_class = ' '. $button_settings['group'] .' ';
+    $group_input = '<input type="hidden" class="group" value="'. $button_settings['group'] .'" />';
+  }
+  if ($button_settings['required']) {
+    $required = 1;
+  }
+  $help = navigate_help_helper($button_settings);
+  $output = '
+    <span class="navigate-button-outer"><div id="'. $button_settings['class'] .'-'. $button_settings['wid'] .'" class="navigate-button '. $button_settings['class'] . $on_class . $group_class . $help['class'] .'"'. $help['rel'] .'>'. $button_settings['content'] .'</div>
+    <div class="navigate-absolute">
+      <input type="hidden" class="on" value="'. $button_settings['on'] .'" />
+      <input type="hidden" class="off" value="'. $button_settings['off'] .'" />
+      <input type="hidden" class="name" value="'. $button_settings['name'] .'" />
+      <input type="hidden" class="required" value="'. $required .'" />
+      <input type="hidden" class="callback" value="'. $button_settings['callback'] .'" />
+      '. $group_input .'
+      '. $help['output'] .'
+      </div>
+    </span>
+    ';
+  return $output;
+}
+
+
+/**
+ * Generates an array to add an html-based tooltip. Can only be used for generating
+ *
+ * Returns an array:
+ *  $array['class'] = The class that will tell jquery to add the tooltip to an element
+ *  $array['rel'] = Add this inside of an element, contains content that tells jquery where to look for content.
+ *  $array['output'] = The help content in a hidden div
+ */
+function navigate_help_helper($settings) {
+  if (!is_array($settings)) {
+    $settings = array('help' => $settings);
+  }
+  static $i;
+  if (!$i) {
+    $i = 1;
+  }
+  $i++;
+  if (!$settings['help']) {
+    return FALSE;
+  }
+  $help['div_id'] = 'navigate_widget_help_'. $settings['name'] .'_'. str_replace('-', '_', $settings['class']) .'_'. $i;
+  $help['class'] = ' navigate-tip ';
+  $help['rel'] = ' rel="#'. $help['div_id'] .'" ';
+  $help['output'] = '<div id="'. $help['div_id'] .'" style="display:none">'. $settings['help'] .'</div>';
+  $i++;
+  return $help;
+}
+
+
+/**
+ * Output a text input
+ */
+function navigate_input($input_settings) {
+  $settings = navigate_widget_settings_get($input_settings['wid']);
+  $help = navigate_help_helper($input_settings);
+  if ($input_settings['select_all']) {
+    $select_all_class = ' navigate-select-all ';
+  }
+  if ($input_settings['clear']) {
+    $clear_class = ' navigate-clear ';
+  }
+  $output = '
+    <span class="navigate-text-input-outer">
+      <div class="navigate-text-input-container"><input id="'. $input_settings['class'] .'_'. $input_settings['wid'] .'" class="navigate-text-input '. $input_settings['class'] . $select_all_class . $clear_class . $help['class'] .'" value="'. $settings[$input_settings['name']] .'" name="'. $input_settings['class'] .'" type="text"'. $help['rel'] .'></div>
+    <input type="hidden" class="callback" value="'. $input_settings['callback'] .'" />
+    <input type="hidden" class="name" value="'. $input_settings['name'] .'" />
+    '. $help['output'] .'
+    </span>';
+  return $output;
+}
+
+
+/**
+ * Output a textarea input
+ */
+function navigate_textarea($input_settings) {
+  $settings = navigate_widget_settings_get($input_settings['wid']);
+  $help = navigate_help_helper($input_settings);
+  if ($input_settings['select_all']) {
+    $select_all_class = ' navigate-select-all ';
+  }
+
+  $filters = filter_formats();
+  foreach ($filters as $filter) {
+    if (!$default) {
+      $default = $filter->format;
+    }
+    $filters_output .= navigate_button(array(
+      'name' => $input_settings['name'] .'_format',
+      'content' => $filter->name,
+      'class' => 'navigate-filter-'. $filter->format,
+      'group' => $input_settings['name'] .'_format',
+      'default' => $default,
+      'help' => '',
+      'on' => $filter->format,
+      'required' => TRUE,
+      'wid' => $input_settings['wid'],
+    ));
+  }
+  if ($filters_output) {
+    $filters_output = '<div class="navigate-filters">'. $filters_output .'</div>';
+  }
+  $output = '
+    <div class="navigate-textarea-outer">
+      <div class="navigate-textarea-container">
+        <textarea id="'. $input_settings['class'] .'_'. $input_settings['wid'] .'" class="navigate-textarea '. $input_settings['class'] . $select_all_class . $help['class'] .'" name="'. $input_settings['class'] .'" type="text"'. $help['rel'] .'>'. $settings[$input_settings['name']] .'</textarea>
+        '. $filters_output .'
+        <div class="navigate-submit '. $input_settings['class'] .'_submit_'. $input_settings['wid'] .'">'. t('Save') .'</div>
+      </div>
+      <input type="hidden" class="callback" value="'. $input_settings['callback'] .'" />
+      <input type="hidden" class="name" value="'. $input_settings['name'] .'" />
+      '. $help['output'] .'
+    </div>';
+  return $output;
+}
+
+
+
+/**
+ * Return an array of devel menu items, used for menu building by widgets
+ */
+function navigate_devel_menu($array = array()) {
+  if (module_exists('devel') && user_access('access devel information')) {
+    $array[] = array(
+      'title' => 'Devel settings',
+      'path' => 'admin/settings/devel',
+      'description' => 'Adjust module settings for devel module');
+    $array[] = array(
+      'title' => 'Empty cache',
+      'path' => 'devel/cache/clear',
+      'description' => 'Clear the database cache tables which store page, menu, node, and variable caches.');
+    $array[] = array(
+      'title' => 'Phpinfo()',
+      'path' => 'admin/logs/status/php');
+    $array[] = array(
+      'title' => 'Function reference',
+      'path' => 'devel/reference',
+      'description' => 'View a list of currently defined user functions with documentation links');
+    $array[] = array(
+      'title' => 'Reinstall modules',
+      'path' => 'devel/reinstall',
+      'description' => 'Re-run hook_install() for a given module');
+    $array[] = array(
+      'title' => 'Reset menus',
+      'path' => 'devel/session',
+      'description' => 'List the contents of $_SESSION');
+    $array[] = array(
+      'title' => 'Variable editor',
+      'path' => 'devel/variable',
+      'description' => 'Edit and delete site variables');
+    $array[] = array(
+      'title' => 'Session viewer',
+      'path' => 'devel/session',
+      'description' => 'List the contents of $_SESSION');
+  }
+  return $array;
+}
+
+
+/**
+ * Theme a link
+ */
+function theme_navigate_link($menu_item) {
+  static $i;
+  $char_count = 26;
+  if (strlen($menu_item['title']) > $char_count) {
+    $title = substr($menu_item['title'], 0, $char_count-3) .'...';
+  }
+  else {
+    $title = $menu_item['title'];
+  }
+  $help_id = 'navigate_link_help_'. $i . $menu_item['wid'];
+  if ($menu_item['description'] != '') {
+    $menu_item['description'] = '<div class="navigate-link-description">'. $menu_item['description'] .'</div>';
+  }
+  $output = '<div id="'. $menu_item['id'] .'" class="navigate-tip navigate-link" rel="#'. $help_id .'">'. l($title, $menu_item['path']) .'</div>
+    <div id="'. $help_id .'" style="display:none">
+      <div class="navigate-link-help">
+        <div class="navigate-link-title">'. $menu_item['title'] .'</div>
+        '. $menu_item['description'] .'
+        <div class="navigate-link-link">'. url($menu_item['path']) .'</div>
+      </div>
+    </div>';
+  $i++;
+  return $output;
+}
+
+
+/**
+ * Associate a js callback with clicking content
+ */
+function navigate_callback_button($input_settings) {
+  $help = navigate_help_helper($input_settings);
+  $output = '
+    <span id="'. $input_settings['class'] .'_'. $input_settings['wid'] .'" class="navigate-click-outer'. $help['class'] .'" '. $help['rel'] .'>
+      <span class="navigate-callback-button">'. $input_settings['content'] .'</span>
+      <input type="hidden" class="callback" value="'. $input_settings['callback'] .'" />
+    </span>'. $help['output'];
+  return $output;
+}
+
+
+/**
+ * Implementation of hook_user
+ */
+function navigate_user($op, &$edit, &$account, $category='') {
+  switch ($op) {
+    case 'delete':
+      $result = db_query("SELECT * FROM {navigate_widgets} WHERE uid = '%d'");
+      while ($row = db_fetch_array($result)) {
+        db_query("DELETE * FROM {navigate_user_settings} WHERE uid = '%d'", $account->uid);
+        db_query("DELETE * FROM {navigate_widgets} WHERE uid = '%d'", $account->uid);
+        db_query("DELETE * FROM {navigate_cache} WHERE uid = '%d'", $account->uid);
+      }
+      break;
+  }
+}
+
+
+/**
+ * Uninstalls a module's widgets on module uninstall
+ */
+function navigate_uninstall_widget_module($module) {
+  if (module_exists('navigate')) {
+    $result = db_query("SELECT * FROM {navigate_widgets} WHERE module = '%s'", $module);
+    while ($row = db_fetch_array($result)) {
+      db_query("DELETE FROM {navigate_user_settings} WHERE wid = '%d'", $row['wid']);
+    }
+    db_query("DELETE FROM {navigate_widgets} WHERE module = '%s'", $module);
+    navigate_clear_cache();
+  }
 }
\ No newline at end of file
Index: navigate/jquery_plugins/jquery.pngFix.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/jquery_plugins/jquery.pngFix.js,v
retrieving revision 1.1
diff -u -p -r1.1 jquery.pngFix.js
--- navigate/jquery_plugins/jquery.pngFix.js	25 Oct 2008 22:22:45 -0000	1.1
+++ navigate/jquery_plugins/jquery.pngFix.js	7 Nov 2008 22:28:23 -0000
@@ -1,11 +1,11 @@
-/**
- * --------------------------------------------------------------------
- * jQuery-Plugin "pngFix"
- * Version: 1.1, 11.09.2007
- * by Andreas Eberhard, andreas.eberhard@gmail.com
- *                      http://jquery.andreaseberhard.de/
- *
- * Copyright (c) 2007 Andreas Eberhard
- * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
- */
+/**
+ * --------------------------------------------------------------------
+ * jQuery-Plugin "pngFix"
+ * Version: 1.1, 11.09.2007
+ * by Andreas Eberhard, andreas.eberhard@gmail.com
+ *                      http://jquery.andreaseberhard.de/
+ *
+ * Copyright (c) 2007 Andreas Eberhard
+ * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
+ */
 eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(s($){3.1s.1k=s(j){j=3.1a({12:\'1m.1j\'},j);8 k=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 5.5")!=-1);8 l=(n.P=="r 10 Z"&&U(n.v)==4&&n.v.E("14 6.0")!=-1);o(3.17.16&&(k||l)){3(2).L("1r[@m$=.M]").z(s(){3(2).7(\'q\',3(2).q());3(2).7(\'p\',3(2).p());8 a=\'\';8 b=\'\';8 c=(3(2).7(\'K\'))?\'K="\'+3(2).7(\'K\')+\'" \':\'\';8 d=(3(2).7(\'A\'))?\'A="\'+3(2).7(\'A\')+\'" \':\'\';8 e=(3(2).7(\'C\'))?\'C="\'+3(2).7(\'C\')+\'" \':\'\';8 f=(3(2).7(\'B\'))?\'B="\'+3(2).7(\'B\')+\'" \':\'\';8 g=(3(2).7(\'R\'))?\'1d:\'+3(2).7(\'R\')+\';\':\'\';8 h=(3(2).1c().7(\'1b\'))?\'19:18;\':\'\';o(2.9.y){a+=\'y:\'+2.9.y+\';\';2.9.y=\'\'}o(2.9.t){a+=\'t:\'+2.9.t+\';\';2.9.t=\'\'}o(2.9.w){a+=\'w:\'+2.9.w+\';\';2.9.w=\'\'}8 i=(2.9.15);b+=\'<x \'+c+d+e+f;b+=\'9="13:11;1q-1p:1o-1n;O:W-V;N:1l;\'+g+h;b+=\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\';b+=\'J:I:H.r.G\'+\'(m=\\\'\'+3(2).7(\'m\')+\'\\\', D=\\\'F\\\');\';b+=i+\'"></x>\';o(a!=\'\'){b=\'<x 9="13:11;O:W-V;\'+a+h+\'q:\'+3(2).q()+\'u;\'+\'p:\'+3(2).p()+\'u;\'+\'">\'+b+\'</x>\'}3(2).1i();3(2).1h(b)});3(2).L("*").z(s(){8 a=3(2).T(\'N-S\');o(a.E(".M")!=-1){8 b=a.X(\'1g("\')[1].X(\'")\')[0];3(2).T(\'N-S\',\'1f\');3(2).Q(0).Y.J="I:H.r.G(m=\'"+b+"\',D=\'F\')"}});3(2).L("1e[@m$=.M]").z(s(){8 a=3(2).7(\'m\');3(2).Q(0).Y.J=\'I:H.r.G\'+\'(m=\\\'\'+a+\'\\\', D=\\\'F\\\');\';3(2).7(\'m\',j.12)})}1t 3}})(3);',62,92,'||this|jQuery||||attr|var|style|||||||||||||src|navigator|if|height|width|Microsoft|function|padding|px|appVersion|margin|span|border|each|class|alt|title|sizingMethod|indexOf|scale|AlphaImageLoader|DXImageTransform|progid|filter|id|find|png|background|display|appName|get|align|image|css|parseInt|block|inline|split|runtimeStyle|Explorer|Internet|relative|blankgif|position|MSIE|cssText|msie|browser|hand|cursor|extend|href|parent|float|input|none|url|after|hide|gif|pngFix|transparent|blank|line|pre|space|white|img|fn|return'.split('|'),0,{}))
\ No newline at end of file
Index: navigate/jquery_plugins/jquery.tooltip.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/jquery_plugins/jquery.tooltip.css,v
retrieving revision 1.1
diff -u -p -r1.1 jquery.tooltip.css
--- navigate/jquery_plugins/jquery.tooltip.css	25 Oct 2008 22:22:45 -0000	1.1
+++ navigate/jquery_plugins/jquery.tooltip.css	7 Nov 2008 22:28:23 -0000
@@ -1,9 +1,9 @@
-#tooltip {
-	position: absolute;
-	z-index: 3000;
-	border: 1px solid #111;
-	background-color: #eee;
+#tooltip {
+	position: absolute;
+	z-index: 3000;
+	border: 1px solid #111;
+	background-color: #eee;
 	padding: 5px;
 	opacity: 0.85;
-}
-#tooltip h3, #tooltip div { margin: 0; }
+}
+#tooltip h3, #tooltip div { margin: 0; }
Index: navigate/jquery_plugins/jquery.tooltip.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/jquery_plugins/jquery.tooltip.js,v
retrieving revision 1.1
diff -u -p -r1.1 jquery.tooltip.js
--- navigate/jquery_plugins/jquery.tooltip.js	25 Oct 2008 22:22:45 -0000	1.1
+++ navigate/jquery_plugins/jquery.tooltip.js	7 Nov 2008 22:28:23 -0000
@@ -7,7 +7,7 @@
  * Copyright (c) 2006 - 2008 Jörn Zaefferer
  *
  * $Id: jquery.tooltip.js,v 1.1 2008/10/25 22:22:45 stompeers Exp $
- * 
+ *
  * Dual licensed under the MIT and GPL licenses:
  *   http://www.opensource.org/licenses/mit-license.php
  *   http://www.gnu.org/licenses/gpl.html
Index: navigate/navigate_custom/navigate_custom.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_custom/navigate_custom.info,v
retrieving revision 1.1
diff -u -p -r1.1 navigate_custom.info
--- navigate/navigate_custom/navigate_custom.info	27 Oct 2008 17:51:04 -0000	1.1
+++ navigate/navigate_custom/navigate_custom.info	7 Nov 2008 22:28:23 -0000
@@ -1,6 +1,6 @@
-; $Id: navigate_custom.info,v 1.1 2008/10/27 17:51:04 stompeers Exp $
-name = Navigate Custom
-description = Adds a Navigate widget for adding custom html / php code.
-package = Navigate
-dependencies = navigate
-version = VERSION
+; $Id: navigate_custom.info,v 1.1 2008/10/27 17:51:04 stompeers Exp $
+name = Navigate Custom
+description = Adds a Navigate widget for adding custom html / php code.
+package = Navigate
+dependencies = navigate
+version = VERSION
\ No newline at end of file
Index: navigate/navigate_custom/navigate_custom.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_custom/navigate_custom.install,v
retrieving revision 1.3
diff -u -p -r1.3 navigate_custom.install
--- navigate/navigate_custom/navigate_custom.install	5 Nov 2008 03:26:34 -0000	1.3
+++ navigate/navigate_custom/navigate_custom.install	7 Nov 2008 22:28:23 -0000
@@ -1,15 +1,15 @@
-<?php
-// $Id: navigate_custom.install,v 1.3 2008/11/05 03:26:34 stompeers Exp $
-
-/**
- * @file
- * Navigate Custom widget installation file 
- */
-
-/**
- * Implementation of hook_uninstall().
- */
-function navigate_custom_uninstall() {
-  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
-  navigate_uninstall_widget_module('navigate_custom');
-}
+<?php
+// $Id: navigate_custom.install,v 1.3 2008/11/05 03:26:34 stompeers Exp $
+
+/**
+ * @file
+ * Navigate Custom widget installation file
+ */
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function navigate_custom_uninstall() {
+  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
+  navigate_uninstall_widget_module('navigate_custom');
+}
\ No newline at end of file
Index: navigate/navigate_custom/navigate_custom.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_custom/navigate_custom.js,v
retrieving revision 1.1
diff -u -p -r1.1 navigate_custom.js
--- navigate/navigate_custom/navigate_custom.js	27 Oct 2008 17:51:04 -0000	1.1
+++ navigate/navigate_custom/navigate_custom.js	7 Nov 2008 22:28:23 -0000
@@ -17,9 +17,9 @@ function navigate_custom_load(item) {
  */
 function navigate_custom_save(wid) {
   var callback = 'navigate_custom_msg';
-  
+
   $('.navigate-custom-output-' + wid).animate({'opacity': 0.4});
-  
+
   var query_array = new Array();
   query_array['module'] = 'navigate_custom';
   query_array['action'] = 'save';
@@ -36,4 +36,4 @@ function navigate_custom_msg(msg, wid) {
   $('.navigate-custom-output-' + wid).animate({'opacity': 1}, function() {
     navigate_cache_save();
   });
-}
+}
\ No newline at end of file
Index: navigate/navigate_custom/navigate_custom.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_custom/navigate_custom.module,v
retrieving revision 1.2
diff -u -p -r1.2 navigate_custom.module
--- navigate/navigate_custom/navigate_custom.module	4 Nov 2008 19:56:30 -0000	1.2
+++ navigate/navigate_custom/navigate_custom.module	7 Nov 2008 22:28:23 -0000
@@ -1,137 +1,137 @@
-<?php
-// $Id: navigate_custom.module,v 1.2 2008/11/04 19:56:30 stompeers Exp $
-
-/**
- * @file
- * Produces the Navigate Custom code widget
- */
-
-/**
- * Implementation of hook_init()
- */
-function navigate_custom_init() {
-  if (user_access('navigate_custom view')) {
-    drupal_add_js(drupal_get_path('module', 'navigate_custom') .'/navigate_custom.js', 'module', 'footer');
-    drupal_add_css(drupal_get_path('module', 'navigate_custom') .'/navigate_custom.css');
-  }
-}
-
-
-/**
- * Implementation of hook_navigation_widgets
- */
-function navigate_custom_navigate_widgets($op, $settings) {
-  switch ($op) {
-    case 'output':
-      switch ($settings['type']) {
-        case 'custom':
-          return navigate_custom_widget($settings['wid']);
-          break;
-      }
-      break;
-    
-    case 'list':
-      return array(
-        array(
-          'type' => 'custom',
-          'module' => 'navigate_custom',
-          'content' => navigate_add_widget_link('<div class="navigate-custom-icon"></div>', 'navigate_custom_load'),
-        ),
-      );
-    
-    case 'delete':
-      break;
-  }
-}
-
-
-/**
- * Generate search widget
- */
-function navigate_custom_widget($wid) {
-  $settings = navigate_widget_settings_get($wid);
-
-  $inputs['content']  = navigate_textarea(array(
-    'name' => 'content',
-    'class' => 'navigate-content-input',
-    'filters' => 'true',
-    'callback' => 'navigate_custom_save',
-    'help' => 'Type your custom code in here',
-    'wid' => $wid,
-  ));
-  
-  $output = theme('navigate_custom_widget', $inputs, $wid);
-  return $output;
-}
-
-
-/**
- * Theme search widget
- */
-function theme_navigate_custom_widget($inputs, $wid) {
-  $content['widget'] = '
-    <div class="navigate-custom-output navigate-custom-output-'. $wid .'">'. navigate_custom_output($wid) .'</div>';
-  $content['title'] = t('Custom');
-  $content['settings'] = '
-    <div class="navigate-custom-inputs">
-      <div class="navigate-custom-input-outer">
-        '. $inputs['content'] .'
-      </div>
-    </div>';
-    
-  return $content;
-}
-
-
-/**
- * Implementation of hook_perm()
- */
-function navigate_custom_perm() {
-  return array("navigate_custom use");
-}
-
-
-/**
- * Implementation of hook_navigate_widget_process()
- */
-function navigate_custom_navigate_widget_process($wid, $action) {
-  switch ($action) {
-    case 'save':
-      echo navigate_custom_save();
-      break;
-  }
-}
-
-
-/**
- * Save the content of a custom widget
- */
-function navigate_custom_save() {
-  $output = navigate_custom_output($_POST['wid']);
-  return $output;
-}
-
-
-/**
- * Output the saved content
- */
-function navigate_custom_output($wid) {
-  $settings = navigate_widget_settings_get($wid);
-  if ($settings['content'] == '') {
-    $settings['content'] = t('Click this widget\'s settings button to change this content.');
-  }
-  $output = check_markup($settings['content'], $settings['content_format']);
-  return $output;
-}
-
-
-
-/**
- * Implementation of hook_navigate_help_page()
- */
-function navigate_custom_navigate_help_page() {
-  $help['content'] = t('<p>The Custom widget allows you to add arbitrary code to your Navigate bar, based on what input filters you have available to you. This includes PHP code, for example, if you are allowed to use that filter. Click the settings icon in the upper right hand corner of the widget to display a textbox where you can add your code.</p>');
-  $help['title'] = 'Custom';
-  $help['access'] = user_access('navigate_custom use');
-  return $help;
+<?php
+// $Id: navigate_custom.module,v 1.2 2008/11/04 19:56:30 stompeers Exp $
+
+/**
+ * @file
+ * Produces the Navigate Custom code widget
+ */
+
+/**
+ * Implementation of hook_init()
+ */
+function navigate_custom_init() {
+  if (user_access('navigate_custom view')) {
+    drupal_add_js(drupal_get_path('module', 'navigate_custom') .'/navigate_custom.js', 'module', 'footer');
+    drupal_add_css(drupal_get_path('module', 'navigate_custom') .'/navigate_custom.css');
+  }
+}
+
+
+/**
+ * Implementation of hook_navigation_widgets
+ */
+function navigate_custom_navigate_widgets($op, $settings) {
+  switch ($op) {
+    case 'output':
+      switch ($settings['type']) {
+        case 'custom':
+          return navigate_custom_widget($settings['wid']);
+          break;
+      }
+      break;
+
+    case 'list':
+      return array(
+        array(
+          'type' => 'custom',
+          'module' => 'navigate_custom',
+          'content' => navigate_add_widget_link('<div class="navigate-custom-icon"></div>', 'navigate_custom_load'),
+        ),
+      );
+
+    case 'delete':
+      break;
+  }
+}
+
+
+/**
+ * Generate search widget
+ */
+function navigate_custom_widget($wid) {
+  $settings = navigate_widget_settings_get($wid);
+
+  $inputs['content']  = navigate_textarea(array(
+    'name' => 'content',
+    'class' => 'navigate-content-input',
+    'filters' => 'true',
+    'callback' => 'navigate_custom_save',
+    'help' => 'Type your custom code in here',
+    'wid' => $wid,
+  ));
+
+  $output = theme('navigate_custom_widget', $inputs, $wid);
+  return $output;
+}
+
+
+/**
+ * Theme search widget
+ */
+function theme_navigate_custom_widget($inputs, $wid) {
+  $content['widget'] = '
+    <div class="navigate-custom-output navigate-custom-output-'. $wid .'">'. navigate_custom_output($wid) .'</div>';
+  $content['title'] = t('Custom');
+  $content['settings'] = '
+    <div class="navigate-custom-inputs">
+      <div class="navigate-custom-input-outer">
+        '. $inputs['content'] .'
+      </div>
+    </div>';
+
+  return $content;
+}
+
+
+/**
+ * Implementation of hook_perm()
+ */
+function navigate_custom_perm() {
+  return array("navigate_custom use");
+}
+
+
+/**
+ * Implementation of hook_navigate_widget_process()
+ */
+function navigate_custom_navigate_widget_process($wid, $action) {
+  switch ($action) {
+    case 'save':
+      echo navigate_custom_save();
+      break;
+  }
+}
+
+
+/**
+ * Save the content of a custom widget
+ */
+function navigate_custom_save() {
+  $output = navigate_custom_output($_POST['wid']);
+  return $output;
+}
+
+
+/**
+ * Output the saved content
+ */
+function navigate_custom_output($wid) {
+  $settings = navigate_widget_settings_get($wid);
+  if ($settings['content'] == '') {
+    $settings['content'] = t('Click this widget\'s settings button to change this content.');
+  }
+  $output = check_markup($settings['content'], $settings['content_format']);
+  return $output;
+}
+
+
+
+/**
+ * Implementation of hook_navigate_help_page()
+ */
+function navigate_custom_navigate_help_page() {
+  $help['content'] = t('<p>The Custom widget allows you to add arbitrary code to your Navigate bar, based on what input filters you have available to you. This includes PHP code, for example, if you are allowed to use that filter. Click the settings icon in the upper right hand corner of the widget to display a textbox where you can add your code.</p>');
+  $help['title'] = 'Custom';
+  $help['access'] = user_access('navigate_custom use');
+  return $help;
 }
\ No newline at end of file
Index: navigate/navigate_favorites/navigate_favorites.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_favorites/navigate_favorites.info,v
retrieving revision 1.2
diff -u -p -r1.2 navigate_favorites.info
--- navigate/navigate_favorites/navigate_favorites.info	27 Oct 2008 17:51:05 -0000	1.2
+++ navigate/navigate_favorites/navigate_favorites.info	7 Nov 2008 22:28:23 -0000
@@ -1,6 +1,6 @@
-; $Id: navigate_favorites.info,v 1.2 2008/10/27 17:51:05 stompeers Exp $
-name = Navigate Favorites
-description = Adds a favorites widget to the Navigate module
-package = Navigate
-dependencies = navigate
-version = VERSION
+; $Id: navigate_favorites.info,v 1.2 2008/10/27 17:51:05 stompeers Exp $
+name = Navigate Favorites
+description = Adds a favorites widget to the Navigate module
+package = Navigate
+dependencies = navigate
+version = VERSION
Index: navigate/navigate_favorites/navigate_favorites.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_favorites/navigate_favorites.install,v
retrieving revision 1.4
diff -u -p -r1.4 navigate_favorites.install
--- navigate/navigate_favorites/navigate_favorites.install	5 Nov 2008 03:26:32 -0000	1.4
+++ navigate/navigate_favorites/navigate_favorites.install	7 Nov 2008 22:28:23 -0000
@@ -1,39 +1,39 @@
-<?php
-// $Id: navigate_favorites.install,v 1.4 2008/11/05 03:26:32 stompeers Exp $
-
-
-/**
- * @file
- * Navigate Favorites widget installation file 
- */
-
-
-/**
- * Implementation of hook_install().
- */
-function navigate_favorites_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {navigate_favorites} (
-        fav_id int(11) NOT NULL,
-        wid int(11) NOT NULL,
-        uid int(11) NOT NULL,
-        name varchar(200) NOT NULL,
-        path text NOT NULL,
-        weight int(11) NOT NULL
-      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
-      );
-  }
-}
-
-
-/**
- * Implementation of hook_uninstall().
- */
-function navigate_favorites_uninstall() {
-  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
-  db_query("DROP TABLE {navigate_favorites}");
-  navigate_uninstall_widget_module('navigate_favorites');
-
-}
+<?php
+// $Id: navigate_favorites.install,v 1.4 2008/11/05 03:26:32 stompeers Exp $
+
+
+/**
+ * @file
+ * Navigate Favorites widget installation file
+ */
+
+
+/**
+ * Implementation of hook_install().
+ */
+function navigate_favorites_install() {
+  switch ($GLOBALS['db_type']) {
+    case 'mysql':
+    case 'mysqli':
+      db_query("CREATE TABLE {navigate_favorites} (
+        fav_id int(11) NOT NULL,
+        wid int(11) NOT NULL,
+        uid int(11) NOT NULL,
+        name varchar(200) NOT NULL,
+        path text NOT NULL,
+        weight int(11) NOT NULL
+      ) /*!40100 DEFAULT CHARACTER SET utf8 */;"
+      );
+  }
+}
+
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function navigate_favorites_uninstall() {
+  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
+  db_query("DROP TABLE {navigate_favorites}");
+  navigate_uninstall_widget_module('navigate_favorites');
+
+}
Index: navigate/navigate_favorites/navigate_favorites.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_favorites/navigate_favorites.js,v
retrieving revision 1.3
diff -u -p -r1.3 navigate_favorites.js
--- navigate/navigate_favorites/navigate_favorites.js	4 Nov 2008 19:56:20 -0000	1.3
+++ navigate/navigate_favorites/navigate_favorites.js	7 Nov 2008 22:28:23 -0000
@@ -23,7 +23,7 @@ function navigate_favorites_load(item) {
       navigate_process(wid, query_array, 'navigate_cache_save');
     }
   });
-  
+
   // Load delete links
   $(item + '.navigate-favorites-delete').click(function() {
     var callback = 'navigate_favorites_msg';
@@ -35,7 +35,7 @@ function navigate_favorites_load(item) {
     query_array['fav_id'] = $(this).children('.navigate-favorites-id').val();
     navigate_process(wid, query_array, callback);
   });
-  
+
   // Bind click to delete buttons
   navigate_favorites_bind_delete(item);
 }
@@ -54,9 +54,9 @@ function navigate_favorites_bind_delete(
     query_array['action'] = 'remove';
     query_array['fav_id'] = $(this).children('.navigate-favorites-id').val();
     navigate_process(wid, query_array, callback);
-    
+
   });
-  
+
   // Show delete links when hovering
   $(item + '.navigate-favorites-link-outer').hover(
     function() {
@@ -74,9 +74,9 @@ function navigate_favorites_bind_delete(
  */
 function navigate_favorites_add(wid) {
   var callback = 'navigate_favorites_msg';
-  
+
   $('.navigate-favorites-list-' + wid).animate({'opacity': 0.4});
-  
+
   var query_array = new Array();
   query_array['module'] = 'navigate_favorites';
   query_array['action'] = 'add';
Index: navigate/navigate_favorites/navigate_favorites.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_favorites/navigate_favorites.module,v
retrieving revision 1.3
diff -u -p -r1.3 navigate_favorites.module
--- navigate/navigate_favorites/navigate_favorites.module	4 Nov 2008 19:56:20 -0000	1.3
+++ navigate/navigate_favorites/navigate_favorites.module	7 Nov 2008 22:28:23 -0000
@@ -1,225 +1,225 @@
-<?php
-// $Id: navigate_favorites.module,v 1.3 2008/11/04 19:56:20 stompeers Exp $
-
-/**
- * @file
- * Produces the Navigate Favorites widget
- */
-
-/**
- * Implementation of hook_init()
- */
-function navigate_favorites_init() {
-  if (user_access('navigate_favorites use')) {
-    drupal_add_js(drupal_get_path('module', 'navigate_favorites') .'/navigate_favorites.js', 'module', 'footer');
-    drupal_add_css(drupal_get_path('module', 'navigate_favorites') .'/navigate_favorites.css');
-  }
-}
-
-
-/**
- * Implementation of hook_navigation_widgets
- */
-function navigate_favorites_navigate_widgets($op, $settings) {
-  switch ($op) {
-    case 'output':
-      switch ($settings['type']) {
-        case 'favorites':
-          return navigate_favorites_widget($settings['wid']);
-          break;
-      }
-      break;
-    
-    case 'list':
-      return array(
-        array(
-          'type' => 'favorites',
-          'module' => 'navigate_favorites',
-          'content' => navigate_add_widget_link('<div class="navigate-favorites-icon"></div>', 'navigate_favorites_load'),
-        ),
-      );
-    
-    case 'delete':
-      navigate_favorites_delete_widget($settings['wid']);
-      break;
-  }
-}
-
-
-/**
- * Delete a favorites widget
- */
-function navigate_favorites_delete_widget($wid) {
-  db_query("DELETE FROM {navigate_favorites} WHERE wid = '%d'", $wid);
-}
-
-
-/**
- * Generate favorites widget
- */
-function navigate_favorites_widget($wid) {
-  $settings = navigate_widget_settings_get($wid);
-
-  $inputs['favorite_name']  = navigate_input(array(
-    'name' => 'favorite_name',
-    'class' => 'navigate-favorite-name',
-    'select_all' => TRUE,
-    'clear' => TRUE,
-    'callback' => 'navigate_favorites_add',
-    'help' => 'Type a description for this page and click enter to add it to your favorites.<br /><br />For advanced users, use the following format to add a group of links:<br /><strong>Title One|path/to/page;Title Two|path/to/page</strong>',
-    'wid' => $wid,
-  ));
-  
-  $inputs['favorite_button'] = navigate_callback_button(array(
-    'class' => 'navigate-favorites-add',
-    'callback' => 'navigate_favorites_add',
-    'content' => '<div class="navigate-favorites-add navigate-submit">'. t('Add') .'</div>',
-    'help' => 'Click to add favorite.',
-  ));
-  
-  $output = theme('navigate_favorites_widget', $inputs, $wid);
-  return $output;
-}
-
-
-/**
- * Theme favorites widget
- */
-function theme_navigate_favorites_widget($inputs, $wid) {
-  $content['widget'] = '
-    <div class="navigate-shorten navigate-favorites-inputs">
-      <div class="navigate-favorites-input-outer">
-        '. $inputs['favorite_button'] .'
-        '. $inputs['favorite_name'] .'
-      </div>
-    </div>
-    <div class="navigate-favorites-list navigate-favorites-list-'. $wid .'">'. navigate_favorites_output($wid) .'</div>';
-  $content['title'] = t('Favorites');
-    
-  return $content;
-}
-
-
-/**
- * Implementation of hook_perm()
- */
-function navigate_favorites_perm() {
-  return array("navigate_favorites use");
-}
-
-
-/**
- * Implementation of hook_navigate_widget_process()
- */
-function navigate_favorites_navigate_widget_process($wid, $action) {
-  switch ($action) {
-    case 'add':
-      navigate_favorites_add();
-      break;
-    case 'remove':
-      navigate_favorites_remove();
-      break;
-    case 'sort':
-      navigate_favorites_sort();
-      break;
-  }
-}
-
-
-/**
- * Add a new favorite
- */
-function navigate_favorites_add() {
-  global $user;
-  
-  
-  // Get next weight
-  $weight = db_result(db_query_range("SELECT weight FROM {navigate_favorites} WHERE uid = '%d' AND wid = '%d' ORDER BY weight DESC", $user->uid, $_POST['wid'], 0, 1));
-  $weight++;
-  
-  // Get path. If there is a | in the name, use the right-side as the path
-  $name = $_POST['name'];
-  $path = $_POST['return'];
-  if (strpos($_POST['name'], '|') !== FALSE) {
-    $items = explode(';', $_POST['name']);
-    foreach ($items as $item) {
-      $fav_id = db_next_id('{navigate_favorites}_fav_id');
-      $path_array = explode('|', $item);
-      $name = $path_array[0];
-      $path = $path_array[1];
-      db_query("INSERT INTO {navigate_favorites} SET fav_id = '%d', uid = '%d', wid = '%d', name = '%s', path = '%s', weight = '%d'", $fav_id, $user->uid, $_POST['wid'], $name, $path, $weight);
-    }
-  }
-  else {
-    $fav_id = db_next_id('{navigate_favorites}_fav_id');
-    db_query("INSERT INTO {navigate_favorites} SET fav_id = '%d', uid = '%d', wid = '%d', name = '%s', path = '%s', weight = '%d'", $fav_id, $user->uid, $_POST['wid'], $name, $path, $weight);
-  }
-  
-  $output = navigate_favorites_output($_POST['wid']);
-  echo $output;
-}
-
-function navigate_favorites_output($wid) {
-  $result = db_query("SELECT * FROM {navigate_favorites} WHERE wid = '%d' ORDER BY weight ASC", $wid);
-  while ($row = db_fetch_array($result)) {
-    $output .= '
-      <div id="navigate_favorites_id_'. $row['fav_id'] .'" class="navigate-favorites-link-outer">
-        <div class="navigate-favorites-delete">x<input type="hidden" class="navigate-favorites-id" value="'. $row['fav_id'] .'" /></div>
-        '. theme_navigate_link(array('title' => $row['name'], 'path' => $row['path'], 'wid' => $wid)) .'
-      </div>';
-  }
-  return $output;
-}
-
-
-/**
- * Remove a favorite
- */
-function navigate_favorites_remove() {
-  global $user;
-  db_query("DELETE FROM {navigate_favorites} WHERE uid = '%d' AND fav_id = '%d'", $user->uid, $_POST['fav_id']);
-  $output = navigate_favorites_output($_POST['wid']);
-  echo $output;
-}
-
-
-/**
- * Save the re-sorting of favorites
- */
-function navigate_favorites_sort() {
-  $i = 1;
-  foreach ($_POST['navigate_favorites_id'] as $fav_id) {
-    db_query("UPDATE {navigate_favorites} SET weight = '%d' WHERE fav_id = '%d'", $i, $fav_id);
-    $i++;
-  }
-}
-
-
-/**
- * Implementation of hook_user
- */
-function navigate_favorites_user($op, &$edit, &$account, $category='') {
-  switch ($op) {
-    case 'delete':
-      db_query("DELETE * FROM {navigate_favorites} WHERE uid = '%d'", $account->uid);
-      break;
-  }
-}
-
-
-/**
- * Implementation of hook_navigate_help_page()
- */
-function navigate_favorites_navigate_help_page() {
-  $help['content'] = t('<p>The Favorites widget allows you to keep a shortlist of your favorite locations on the current Drupal site. Here\'s a quick list of functionality:</p>
-<ul>
-  <li><strong>To add a favorite</strong>, navigate to the page you want to add. Then fill in a title in the Favorites text box and click Add or press enter.</li>
-  <li><strong>To add a favorite to another site, or a url you can\'t navigate to</strong>, use the following format to type the favorite into the text box: <strong>Title of favorite|url/of/favorite</strong>. Note that that is a pipe character dividing the title and the url. For a url on your site, don\'t include a backslash at the beginning. For a url to another site, use the full url. For example: <strong>Example site|http://www.example.com</strong>. To add multiple favorites, use a semicolon separator, as in: Link 1|link/1;Link 2|link/2;Link 3...</li>
-  <li><strong>To re-order favorites</strong>, drag the favorite link to the new location and drop it.</li>
-  <li><strong>To delete a favorit</strong>e, hover over the link until you see a white \'x\', then click the x.</li>
-</ul>
-');
-  $help['title'] = 'Favorites';
-  $help['access'] = user_access('navigate_favorites use');
-  return $help;
+<?php
+// $Id: navigate_favorites.module,v 1.3 2008/11/04 19:56:20 stompeers Exp $
+
+/**
+ * @file
+ * Produces the Navigate Favorites widget
+ */
+
+/**
+ * Implementation of hook_init()
+ */
+function navigate_favorites_init() {
+  if (user_access('navigate_favorites use')) {
+    drupal_add_js(drupal_get_path('module', 'navigate_favorites') .'/navigate_favorites.js', 'module', 'footer');
+    drupal_add_css(drupal_get_path('module', 'navigate_favorites') .'/navigate_favorites.css');
+  }
+}
+
+
+/**
+ * Implementation of hook_navigation_widgets
+ */
+function navigate_favorites_navigate_widgets($op, $settings) {
+  switch ($op) {
+    case 'output':
+      switch ($settings['type']) {
+        case 'favorites':
+          return navigate_favorites_widget($settings['wid']);
+          break;
+      }
+      break;
+
+    case 'list':
+      return array(
+        array(
+          'type' => 'favorites',
+          'module' => 'navigate_favorites',
+          'content' => navigate_add_widget_link('<div class="navigate-favorites-icon"></div>', 'navigate_favorites_load'),
+        ),
+      );
+
+    case 'delete':
+      navigate_favorites_delete_widget($settings['wid']);
+      break;
+  }
+}
+
+
+/**
+ * Delete a favorites widget
+ */
+function navigate_favorites_delete_widget($wid) {
+  db_query("DELETE FROM {navigate_favorites} WHERE wid = '%d'", $wid);
+}
+
+
+/**
+ * Generate favorites widget
+ */
+function navigate_favorites_widget($wid) {
+  $settings = navigate_widget_settings_get($wid);
+
+  $inputs['favorite_name']  = navigate_input(array(
+    'name' => 'favorite_name',
+    'class' => 'navigate-favorite-name',
+    'select_all' => TRUE,
+    'clear' => TRUE,
+    'callback' => 'navigate_favorites_add',
+    'help' => 'Type a description for this page and click enter to add it to your favorites.<br /><br />For advanced users, use the following format to add a group of links:<br /><strong>Title One|path/to/page;Title Two|path/to/page</strong>',
+    'wid' => $wid,
+  ));
+
+  $inputs['favorite_button'] = navigate_callback_button(array(
+    'class' => 'navigate-favorites-add',
+    'callback' => 'navigate_favorites_add',
+    'content' => '<div class="navigate-favorites-add navigate-submit">'. t('Add') .'</div>',
+    'help' => 'Click to add favorite.',
+  ));
+
+  $output = theme('navigate_favorites_widget', $inputs, $wid);
+  return $output;
+}
+
+
+/**
+ * Theme favorites widget
+ */
+function theme_navigate_favorites_widget($inputs, $wid) {
+  $content['widget'] = '
+    <div class="navigate-shorten navigate-favorites-inputs">
+      <div class="navigate-favorites-input-outer">
+        '. $inputs['favorite_button'] .'
+        '. $inputs['favorite_name'] .'
+      </div>
+    </div>
+    <div class="navigate-favorites-list navigate-favorites-list-'. $wid .'">'. navigate_favorites_output($wid) .'</div>';
+  $content['title'] = t('Favorites');
+
+  return $content;
+}
+
+
+/**
+ * Implementation of hook_perm()
+ */
+function navigate_favorites_perm() {
+  return array("navigate_favorites use");
+}
+
+
+/**
+ * Implementation of hook_navigate_widget_process()
+ */
+function navigate_favorites_navigate_widget_process($wid, $action) {
+  switch ($action) {
+    case 'add':
+      navigate_favorites_add();
+      break;
+    case 'remove':
+      navigate_favorites_remove();
+      break;
+    case 'sort':
+      navigate_favorites_sort();
+      break;
+  }
+}
+
+
+/**
+ * Add a new favorite
+ */
+function navigate_favorites_add() {
+  global $user;
+
+
+  // Get next weight
+  $weight = db_result(db_query_range("SELECT weight FROM {navigate_favorites} WHERE uid = '%d' AND wid = '%d' ORDER BY weight DESC", $user->uid, $_POST['wid'], 0, 1));
+  $weight++;
+
+  // Get path. If there is a | in the name, use the right-side as the path
+  $name = $_POST['name'];
+  $path = $_POST['return'];
+  if (strpos($_POST['name'], '|') !== FALSE) {
+    $items = explode(';', $_POST['name']);
+    foreach ($items as $item) {
+      $fav_id = db_next_id('{navigate_favorites}_fav_id');
+      $path_array = explode('|', $item);
+      $name = $path_array[0];
+      $path = $path_array[1];
+      db_query("INSERT INTO {navigate_favorites} SET fav_id = '%d', uid = '%d', wid = '%d', name = '%s', path = '%s', weight = '%d'", $fav_id, $user->uid, $_POST['wid'], $name, $path, $weight);
+    }
+  }
+  else {
+    $fav_id = db_next_id('{navigate_favorites}_fav_id');
+    db_query("INSERT INTO {navigate_favorites} SET fav_id = '%d', uid = '%d', wid = '%d', name = '%s', path = '%s', weight = '%d'", $fav_id, $user->uid, $_POST['wid'], $name, $path, $weight);
+  }
+
+  $output = navigate_favorites_output($_POST['wid']);
+  echo $output;
+}
+
+function navigate_favorites_output($wid) {
+  $result = db_query("SELECT * FROM {navigate_favorites} WHERE wid = '%d' ORDER BY weight ASC", $wid);
+  while ($row = db_fetch_array($result)) {
+    $output .= '
+      <div id="navigate_favorites_id_'. $row['fav_id'] .'" class="navigate-favorites-link-outer">
+        <div class="navigate-favorites-delete">x<input type="hidden" class="navigate-favorites-id" value="'. $row['fav_id'] .'" /></div>
+        '. theme_navigate_link(array('title' => $row['name'], 'path' => $row['path'], 'wid' => $wid)) .'
+      </div>';
+  }
+  return $output;
+}
+
+
+/**
+ * Remove a favorite
+ */
+function navigate_favorites_remove() {
+  global $user;
+  db_query("DELETE FROM {navigate_favorites} WHERE uid = '%d' AND fav_id = '%d'", $user->uid, $_POST['fav_id']);
+  $output = navigate_favorites_output($_POST['wid']);
+  echo $output;
+}
+
+
+/**
+ * Save the re-sorting of favorites
+ */
+function navigate_favorites_sort() {
+  $i = 1;
+  foreach ($_POST['navigate_favorites_id'] as $fav_id) {
+    db_query("UPDATE {navigate_favorites} SET weight = '%d' WHERE fav_id = '%d'", $i, $fav_id);
+    $i++;
+  }
+}
+
+
+/**
+ * Implementation of hook_user
+ */
+function navigate_favorites_user($op, &$edit, &$account, $category='') {
+  switch ($op) {
+    case 'delete':
+      db_query("DELETE * FROM {navigate_favorites} WHERE uid = '%d'", $account->uid);
+      break;
+  }
+}
+
+
+/**
+ * Implementation of hook_navigate_help_page()
+ */
+function navigate_favorites_navigate_help_page() {
+  $help['content'] = t('<p>The Favorites widget allows you to keep a shortlist of your favorite locations on the current Drupal site. Here\'s a quick list of functionality:</p>
+<ul>
+  <li><strong>To add a favorite</strong>, navigate to the page you want to add. Then fill in a title in the Favorites text box and click Add or press enter.</li>
+  <li><strong>To add a favorite to another site, or a url you can\'t navigate to</strong>, use the following format to type the favorite into the text box: <strong>Title of favorite|url/of/favorite</strong>. Note that that is a pipe character dividing the title and the url. For a url on your site, don\'t include a backslash at the beginning. For a url to another site, use the full url. For example: <strong>Example site|http://www.example.com</strong>. To add multiple favorites, use a semicolon separator, as in: Link 1|link/1;Link 2|link/2;Link 3...</li>
+  <li><strong>To re-order favorites</strong>, drag the favorite link to the new location and drop it.</li>
+  <li><strong>To delete a favorit</strong>e, hover over the link until you see a white \'x\', then click the x.</li>
+</ul>
+');
+  $help['title'] = 'Favorites';
+  $help['access'] = user_access('navigate_favorites use');
+  return $help;
 }
\ No newline at end of file
Index: navigate/navigate_menu/jquery.treeview.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_menu/jquery.treeview.css,v
retrieving revision 1.2
diff -u -p -r1.2 jquery.treeview.css
--- navigate/navigate_menu/jquery.treeview.css	5 Nov 2008 03:26:36 -0000	1.2
+++ navigate/navigate_menu/jquery.treeview.css	7 Nov 2008 22:28:23 -0000
@@ -1,67 +1,67 @@
-.treeview { 
+.treeview {
 	padding: 0;
 	margin: 0;
 	list-style: none;
 }
 
-.treeview ul, .treeview ul ul { 
+.treeview ul, .treeview ul ul {
 	padding-left:20px;
 	margin:0px;
-}
-
-.treeview .hitarea {
-	background: url(images/treeview-default.gif) -64px -25px no-repeat;
-	height: 16px;
-	width: 16px;
-	float: left;
-	cursor: pointer;
-}
-/* fix for IE6 */
-* html .hitarea {
-	display: inline;
+}
+
+.treeview .hitarea {
+	background: url(images/treeview-default.gif) -64px -25px no-repeat;
+	height: 16px;
+	width: 16px;
+	float: left;
+	cursor: pointer;
+}
+/* fix for IE6 */
+* html .hitarea {
+	display: inline;
 	float:none;
-}
-
-.treeview li { 
-	margin: 0;
-	padding: 3px 0pt 3px 16px;
-}
-
-.treeview a.selected {
-	background-color: #eee;
-}
-
-#treecontrol { margin: 1em 0; display: none; }
-
-.treeview .hover { color: red; cursor: pointer; }
-
-.treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; }
-.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
-
-.treeview .expandable-hitarea { background-position: -80px -3px; }
-
-.treeview li.last { background-position: 0 -1766px }
-.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); }  
+}
+
+.treeview li {
+	margin: 0;
+	padding: 3px 0pt 3px 16px;
+}
+
+.treeview a.selected {
+	background-color: #eee;
+}
+
+#treecontrol { margin: 1em 0; display: none; }
+
+.treeview .hover { color: red; cursor: pointer; }
+
+.treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; }
+.treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; }
+
+.treeview .expandable-hitarea { background-position: -80px -3px; }
+
+.treeview li.last { background-position: 0 -1766px }
+.treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); }
 .treeview li.lastCollapsable { background-position: 0 -111px }
-.treeview li.lastExpandable { background-position: -32px -67px }
-
+.treeview li.lastExpandable { background-position: -32px -67px }
+
 .treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; }
-
-.treeview-red li { background-image: url(images/treeview-red-line.gif); }
-.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); } 
-
-.treeview-black li { background-image: url(images/treeview-black-line.gif); }
-.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); }  
-
-.treeview-gray li { background-image: url(images/treeview-gray-line.gif) !important; }
-.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); } 
-
-.treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); }
-.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); } 
-
-
-.filetree li { padding: 3px 0 2px 16px; }
-.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
-.filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; }
-.filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; }
-.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; }
+
+.treeview-red li { background-image: url(images/treeview-red-line.gif); }
+.treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); }
+
+.treeview-black li { background-image: url(images/treeview-black-line.gif); }
+.treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); }
+
+.treeview-gray li { background-image: url(images/treeview-gray-line.gif) !important; }
+.treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); }
+
+.treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); }
+.treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); }
+
+
+.filetree li { padding: 3px 0 2px 16px; }
+.filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; }
+.filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; }
+.filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; }
+.filetree span.file { background: url(images/file.gif) 0 0 no-repeat; }
Index: navigate/navigate_menu/navigate_menu.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_menu/navigate_menu.info,v
retrieving revision 1.1
diff -u -p -r1.1 navigate_menu.info
--- navigate/navigate_menu/navigate_menu.info	27 Oct 2008 17:51:05 -0000	1.1
+++ navigate/navigate_menu/navigate_menu.info	7 Nov 2008 22:28:23 -0000
@@ -1,6 +1,6 @@
-; $Id: navigate_menu.info,v 1.1 2008/10/27 17:51:05 stompeers Exp $
-name = Navigate Menu
-description = Adds a Navigate widget for displaying a menu tree.
-package = Navigate
-dependencies = navigate
-version = VERSION
+; $Id: navigate_menu.info,v 1.1 2008/10/27 17:51:05 stompeers Exp $
+name = Navigate Menu
+description = Adds a Navigate widget for displaying a menu tree.
+package = Navigate
+dependencies = navigate
+version = VERSION
Index: navigate/navigate_menu/navigate_menu.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_menu/navigate_menu.install,v
retrieving revision 1.3
diff -u -p -r1.3 navigate_menu.install
--- navigate/navigate_menu/navigate_menu.install	5 Nov 2008 03:26:36 -0000	1.3
+++ navigate/navigate_menu/navigate_menu.install	7 Nov 2008 22:28:23 -0000
@@ -1,17 +1,17 @@
-<?php
-// $Id: navigate_menu.install,v 1.3 2008/11/05 03:26:36 stompeers Exp $
-
-
-/**
- * @file
- * Navigate Menu widget installation file 
- */
-
-
-/**
- * Implementation of hook_uninstall().
- */
-function navigate_menu_uninstall() {
-  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
-  navigate_uninstall_widget_module('navigate_menu');
-}
+<?php
+// $Id: navigate_menu.install,v 1.3 2008/11/05 03:26:36 stompeers Exp $
+
+
+/**
+ * @file
+ * Navigate Menu widget installation file
+ */
+
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function navigate_menu_uninstall() {
+  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
+  navigate_uninstall_widget_module('navigate_menu');
+}
Index: navigate/navigate_menu/navigate_menu.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_menu/navigate_menu.js,v
retrieving revision 1.1
diff -u -p -r1.1 navigate_menu.js
--- navigate/navigate_menu/navigate_menu.js	27 Oct 2008 17:51:05 -0000	1.1
+++ navigate/navigate_menu/navigate_menu.js	7 Nov 2008 22:28:23 -0000
@@ -9,7 +9,7 @@ $(document).ready(function(){
  */
 function navigate_menu_load(item) {
   item = navigate_item_default(item);
-  
+
   $(item + ".navigate-menu-list").each(function() {
     var wid = $(this).parents('.navigate-widget-outer').children('.wid').val();
     $(this).treeview({
@@ -27,9 +27,9 @@ function navigate_menu_load(item) {
  */
 function navigate_menu_load_menu(wid) {
   var callback = 'navigate_menu_msg';
-  
+
   $('.navigate-menu-output-' + wid).animate({'opacity': 0.4});
-  
+
   var query_array = new Array();
   query_array['module'] = 'navigate_menu';
   query_array['action'] = 'load';
Index: navigate/navigate_menu/navigate_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_menu/navigate_menu.module,v
retrieving revision 1.2
diff -u -p -r1.2 navigate_menu.module
--- navigate/navigate_menu/navigate_menu.module	4 Nov 2008 19:56:25 -0000	1.2
+++ navigate/navigate_menu/navigate_menu.module	7 Nov 2008 22:28:23 -0000
@@ -1,180 +1,180 @@
-<?php
-// $Id: navigate_menu.module,v 1.2 2008/11/04 19:56:25 stompeers Exp $
-
-/**
- * @file
- * Produces the Navigate Menu widget
- */
-
-/**
- * Implementation of hook_init()
- */
-function navigate_menu_init() {
-  if (user_access('navigate_menu use')) {
-    drupal_add_js(drupal_get_path('module', 'navigate_menu') .'/navigate_menu.js', 'module', 'footer');
-    drupal_add_js(drupal_get_path('module', 'navigate_menu') .'/jquery.treeview.js', 'module', 'footer');
-    drupal_add_js(drupal_get_path('module', 'navigate_menu') .'/jquery.cookie.js', 'module', 'footer');
-    drupal_add_css(drupal_get_path('module', 'navigate_menu') .'/navigate_menu.css');
-    drupal_add_css(drupal_get_path('module', 'navigate_menu') .'/jquery.treeview.css');
-  }
-}
-
-
-/**
- * Implementation of hook_navigation_widgets
- */
-function navigate_menu_navigate_widgets($op, $settings) {
-  switch ($op) {
-    case 'output':
-      switch ($settings['type']) {
-        case 'menu':
-          return navigate_menu_widget($settings['wid']);
-          break;
-      }
-      break;
-    
-    case 'list':
-      return array(
-        array(
-          'type' => 'menu',
-          'module' => 'navigate_menu',
-          'content' => navigate_add_widget_link('<div class="navigate-menu-icon"></div>', 'navigate_menu_load'),
-        ),
-      );
-    
-    case 'delete':
-      break;
-  }
-}
-
-
-/**
- * Generate menu widget
- */
-function navigate_menu_widget($wid) {
-  $settings = navigate_widget_settings_get($wid);
-  if (!$settings['mid']) {
-     // Generate a list of possible parents.
-    $options = menu_parent_options($item['mid'], variable_get('menu_parent_items', 0));
-
-    $form['menu'] = array(
-      '#type' => 'select',
-      '#options' => $options,
-      '#parents' => array(),
-    );
-    $inputs['menu'] = drupal_render($form['menu']);
-    
-    $inputs['load'] = navigate_callback_button(array(
-      'class' => 'navigate-menu-load',
-      'callback' => 'navigate_menu_load_menu',
-      'content' => '<div class="navigate-menu-load-button navigate-submit">'. t('Load') .'</div>',
-      'help' => 'Click to load this menu.',
-    ));
-  }
-  else {
-    $inputs['menu'] = navigate_menu_output($wid);
-  }
-  
-  $output = theme('navigate_menu_widget', $inputs, $wid);
-  return $output;
-}
-
-
-/**
- * Theme search widget
- */
-function theme_navigate_menu_widget($inputs, $wid) {
-  $content['widget'] = '
-   <div class="navigate-menu-output navigate-menu-output-'. $wid .'">'. $inputs['menu'] . $inputs['load'] .'</div>';
-  $content['title'] = t('Menu');
-    
-  return $content;
-}
-
-
-/**
- * Implementation of hook_perm()
- */
-function navigate_menu_perm() {
-  return array("navigate_menu use");
-}
-
-
-/**
- * Implementation of hook_navigate_widget_process()
- */
-function navigate_menu_navigate_widget_process($wid, $action) {
-  switch ($action) {
-    case 'load':
-      echo navigate_menu_load();
-      break;
-  }
-}
-
-
-/**
- * Output a rendered menu
- */
-function navigate_menu_load() {
-  $output = navigate_menu_output($_POST['wid']);
-  return $output;
-}
-
-
-/**
- * Output the saved content
- */
-function navigate_menu_output($wid) {
-  $settings = navigate_widget_settings_get($wid);
-  if ($_POST['mid']) {
-    navigate_variable_set(array('value' => $_POST['mid'], 'name' => 'mid', 'wid' => $_POST['wid']));
-    $mid = $_POST['mid'];
-  }
-  elseif ($settings['mid']) {
-    $mid = $settings['mid'];
-  }
-  if ($mid) {
-    $output = '<div class="navigate-menu-outer"><ul class="navigate-menu-list treeview-gray navigate-menu-list-'. $wid .'">'. navigate_menu_tree($mid) .'</ul></div>';
-  }
-  return $output;
-}
-
-
-/**
- * Renders a menu
- */
-function navigate_menu_tree($pid = 1) {
-  $menu = menu_get_menu();
-  $output = '';
-
-  if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
-    foreach ($menu['visible'][$pid]['children'] as $mid) {
-      $type = isset($menu['visible'][$mid]['type']) ? $menu['visible'][$mid]['type'] : NULL;
-      $children = isset($menu['visible'][$mid]['children']) ? $menu['visible'][$mid]['children'] : NULL;
-      $output .= theme('menu_item', $mid, navigate_menu_theme_menu_tree($mid), count($children) == 0);
-    }
-  }
-
-  return $output;
-}  
-
-
-/**
- * Themes menu items, borrowed from the simplemenu module
- */
-function navigate_menu_theme_menu_tree($pid = 1) {
-  if ($tree = navigate_menu_tree($pid)) {
-    return '<ul>'. $tree .'</ul>';
-  }
-}
-
-
-/**
- * Implementation of hook_navigate_help_page()
- */
-function navigate_menu_navigate_help_page() {
-  $help['content'] = t('<p>The Menu widget allows you add an expandable menu widget to your Navigate bar. After adding a Menu widget, you willl see a select box with a menu listing. Select the menu you would like to load and click the "Load" button to load it into the widget. Once a menu is loaded, there are no additional settings.</p>');
-  $help['title'] = 'Menu';
-  $help['access'] = user_access('navigate_menu use');
-  return $help;
+<?php
+// $Id: navigate_menu.module,v 1.2 2008/11/04 19:56:25 stompeers Exp $
+
+/**
+ * @file
+ * Produces the Navigate Menu widget
+ */
+
+/**
+ * Implementation of hook_init()
+ */
+function navigate_menu_init() {
+  if (user_access('navigate_menu use')) {
+    drupal_add_js(drupal_get_path('module', 'navigate_menu') .'/navigate_menu.js', 'module', 'footer');
+    drupal_add_js(drupal_get_path('module', 'navigate_menu') .'/jquery.treeview.js', 'module', 'footer');
+    drupal_add_js(drupal_get_path('module', 'navigate_menu') .'/jquery.cookie.js', 'module', 'footer');
+    drupal_add_css(drupal_get_path('module', 'navigate_menu') .'/navigate_menu.css');
+    drupal_add_css(drupal_get_path('module', 'navigate_menu') .'/jquery.treeview.css');
+  }
+}
+
+
+/**
+ * Implementation of hook_navigation_widgets
+ */
+function navigate_menu_navigate_widgets($op, $settings) {
+  switch ($op) {
+    case 'output':
+      switch ($settings['type']) {
+        case 'menu':
+          return navigate_menu_widget($settings['wid']);
+          break;
+      }
+      break;
+
+    case 'list':
+      return array(
+        array(
+          'type' => 'menu',
+          'module' => 'navigate_menu',
+          'content' => navigate_add_widget_link('<div class="navigate-menu-icon"></div>', 'navigate_menu_load'),
+        ),
+      );
+
+    case 'delete':
+      break;
+  }
+}
+
+
+/**
+ * Generate menu widget
+ */
+function navigate_menu_widget($wid) {
+  $settings = navigate_widget_settings_get($wid);
+  if (!$settings['mid']) {
+     // Generate a list of possible parents.
+    $options = menu_parent_options($item['mid'], variable_get('menu_parent_items', 0));
+
+    $form['menu'] = array(
+      '#type' => 'select',
+      '#options' => $options,
+      '#parents' => array(),
+    );
+    $inputs['menu'] = drupal_render($form['menu']);
+
+    $inputs['load'] = navigate_callback_button(array(
+      'class' => 'navigate-menu-load',
+      'callback' => 'navigate_menu_load_menu',
+      'content' => '<div class="navigate-menu-load-button navigate-submit">'. t('Load') .'</div>',
+      'help' => 'Click to load this menu.',
+    ));
+  }
+  else {
+    $inputs['menu'] = navigate_menu_output($wid);
+  }
+
+  $output = theme('navigate_menu_widget', $inputs, $wid);
+  return $output;
+}
+
+
+/**
+ * Theme search widget
+ */
+function theme_navigate_menu_widget($inputs, $wid) {
+  $content['widget'] = '
+   <div class="navigate-menu-output navigate-menu-output-'. $wid .'">'. $inputs['menu'] . $inputs['load'] .'</div>';
+  $content['title'] = t('Menu');
+
+  return $content;
+}
+
+
+/**
+ * Implementation of hook_perm()
+ */
+function navigate_menu_perm() {
+  return array("navigate_menu use");
+}
+
+
+/**
+ * Implementation of hook_navigate_widget_process()
+ */
+function navigate_menu_navigate_widget_process($wid, $action) {
+  switch ($action) {
+    case 'load':
+      echo navigate_menu_load();
+      break;
+  }
+}
+
+
+/**
+ * Output a rendered menu
+ */
+function navigate_menu_load() {
+  $output = navigate_menu_output($_POST['wid']);
+  return $output;
+}
+
+
+/**
+ * Output the saved content
+ */
+function navigate_menu_output($wid) {
+  $settings = navigate_widget_settings_get($wid);
+  if ($_POST['mid']) {
+    navigate_variable_set(array('value' => $_POST['mid'], 'name' => 'mid', 'wid' => $_POST['wid']));
+    $mid = $_POST['mid'];
+  }
+  elseif ($settings['mid']) {
+    $mid = $settings['mid'];
+  }
+  if ($mid) {
+    $output = '<div class="navigate-menu-outer"><ul class="navigate-menu-list treeview-gray navigate-menu-list-'. $wid .'">'. navigate_menu_tree($mid) .'</ul></div>';
+  }
+  return $output;
+}
+
+
+/**
+ * Renders a menu
+ */
+function navigate_menu_tree($pid = 1) {
+  $menu = menu_get_menu();
+  $output = '';
+
+  if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
+    foreach ($menu['visible'][$pid]['children'] as $mid) {
+      $type = isset($menu['visible'][$mid]['type']) ? $menu['visible'][$mid]['type'] : NULL;
+      $children = isset($menu['visible'][$mid]['children']) ? $menu['visible'][$mid]['children'] : NULL;
+      $output .= theme('menu_item', $mid, navigate_menu_theme_menu_tree($mid), count($children) == 0);
+    }
+  }
+
+  return $output;
+}
+
+
+/**
+ * Themes menu items, borrowed from the simplemenu module
+ */
+function navigate_menu_theme_menu_tree($pid = 1) {
+  if ($tree = navigate_menu_tree($pid)) {
+    return '<ul>'. $tree .'</ul>';
+  }
+}
+
+
+/**
+ * Implementation of hook_navigate_help_page()
+ */
+function navigate_menu_navigate_help_page() {
+  $help['content'] = t('<p>The Menu widget allows you add an expandable menu widget to your Navigate bar. After adding a Menu widget, you willl see a select box with a menu listing. Select the menu you would like to load and click the "Load" button to load it into the widget. Once a menu is loaded, there are no additional settings.</p>');
+  $help['title'] = 'Menu';
+  $help['access'] = user_access('navigate_menu use');
+  return $help;
 }
\ No newline at end of file
Index: navigate/navigate_search/navigate_search.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_search/navigate_search.css,v
retrieving revision 1.2
diff -u -p -r1.2 navigate_search.css
--- navigate/navigate_search/navigate_search.css	26 Oct 2008 07:12:43 -0000	1.2
+++ navigate/navigate_search/navigate_search.css	7 Nov 2008 22:28:23 -0000
@@ -5,7 +5,7 @@
   float:right;
   width:50px;
   font-size:10px;
-  margin-top:-6px;  
+  margin-top:-6px;
 }
 .navigate-search-types .navigate-button {
   padding:0px;
Index: navigate/navigate_search/navigate_search.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_search/navigate_search.info,v
retrieving revision 1.2
diff -u -p -r1.2 navigate_search.info
--- navigate/navigate_search/navigate_search.info	27 Oct 2008 17:51:05 -0000	1.2
+++ navigate/navigate_search/navigate_search.info	7 Nov 2008 22:28:23 -0000
@@ -1,6 +1,6 @@
-; $Id: navigate_search.info,v 1.2 2008/10/27 17:51:05 stompeers Exp $
-name = Navigate Search
-description = Adds a search widget to the Navigate module
-package = Navigate
-dependencies = navigate
-version = VERSION
+; $Id: navigate_search.info,v 1.2 2008/10/27 17:51:05 stompeers Exp $
+name = Navigate Search
+description = Adds a search widget to the Navigate module
+package = Navigate
+dependencies = navigate
+version = VERSION
Index: navigate/navigate_search/navigate_search.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_search/navigate_search.install,v
retrieving revision 1.4
diff -u -p -r1.4 navigate_search.install
--- navigate/navigate_search/navigate_search.install	5 Nov 2008 03:26:33 -0000	1.4
+++ navigate/navigate_search/navigate_search.install	7 Nov 2008 22:28:23 -0000
@@ -1,17 +1,17 @@
-<?php
-// $Id: navigate_search.install,v 1.4 2008/11/05 03:26:33 stompeers Exp $
-
-
-/**
- * @file
- * Navigate Search widget installation file 
- */
-
-
-/**
- * Implementation of hook_uninstall().
- */
-function navigate_search_uninstall() {
-  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
-  navigate_uninstall_widget_module('navigate_search');
-}
+<?php
+// $Id: navigate_search.install,v 1.4 2008/11/05 03:26:33 stompeers Exp $
+
+
+/**
+ * @file
+ * Navigate Search widget installation file
+ */
+
+
+/**
+ * Implementation of hook_uninstall().
+ */
+function navigate_search_uninstall() {
+  include_once(drupal_get_path('module', 'navigate') .'/navigate.module');
+  navigate_uninstall_widget_module('navigate_search');
+}
Index: navigate/navigate_search/navigate_search.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_search/navigate_search.js,v
retrieving revision 1.2
diff -u -p -r1.2 navigate_search.js
--- navigate/navigate_search/navigate_search.js	26 Oct 2008 00:45:08 -0000	1.2
+++ navigate/navigate_search/navigate_search.js	7 Nov 2008 22:28:23 -0000
@@ -6,13 +6,13 @@
  */
 function navigate_search_process(wid) {
   var callback = 'navigate_search_process_msg';
-  
+
   var query_array = new Array();
   query_array['module'] = 'navigate_search';
   query_array['action'] = 'search';
   query_array['phrase'] = $('#navigate-search-phrase_' + wid).val();
   $('.navigate-search-results-' + wid).slideUp('slow', function () {
-    
+
     // Run through navigate_process so the API can handle the query string
     navigate_process(wid, query_array, callback);
   });
@@ -28,5 +28,5 @@ function navigate_search_process_msg(msg
     $('.navigate-search-results-' + wid).removeAttr('style'); // slideUp and slideDown add some styles we need to get rid of before saving
     navigate_cache_save();
   });
-  
+
 }
Index: navigate/navigate_search/navigate_search.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/navigate/navigate_search/navigate_search.module,v
retrieving revision 1.5
diff -u -p -r1.5 navigate_search.module
--- navigate/navigate_search/navigate_search.module	4 Nov 2008 19:56:23 -0000	1.5
+++ navigate/navigate_search/navigate_search.module	7 Nov 2008 22:28:23 -0000
@@ -1,349 +1,349 @@
-<?php
-// $Id: navigate_search.module,v 1.5 2008/11/04 19:56:23 stompeers Exp $
-
-/**
- * @file
- * Produces the Navigate Search widget
- */
-
-/**
- * Implementation of hook_init()
- */
-function navigate_search_init() {
-  if (user_access('navigate_search search content') || user_access('navigate_search search menu')) {
-    drupal_add_js(drupal_get_path('module', 'navigate_search') .'/navigate_search.js', 'module', 'footer');
-    drupal_add_css(drupal_get_path('module', 'navigate_search') .'/navigate_search.css');
-  }
-}
-
-
-/**
- * Implementation of hook_navigation_widgets
- */
-function navigate_search_navigate_widgets($op, $settings) {
-  switch ($op) {
-    case 'output':
-      switch ($settings['type']) {
-        case 'search':
-          return navigate_search_widget($settings['wid']);
-          break;
-      }
-      break;
-    
-    case 'list':
-      return array(
-        array(
-          'type' => 'search',
-          'module' => 'navigate_search',
-          'content' => navigate_add_widget_link('<div class="navigate-search-icon"></div>', ''),
-        ),
-      );
-      break;
-  }
-}
-
-
-/**
- * Generate search widget
- */
-function navigate_search_widget($wid) {
-  $settings = navigate_widget_settings_get($wid);
-  
-  if (user_access('navigate_search search menu')) {
-    $inputs['menu']  = navigate_button(array(
-      'name' => 'menu',
-      'content' => t('menu'),
-      'class' => 'navigate-search-menu',
-      'default' => '1',
-      'on' => 1,
-      'off' => 0,
-      'help' => 'When this is checked, searching will search menu items.',
-      'wid' => $wid,
-    ));
-  }
-  
-  if (user_access('navigate_search search content')) {
-    $inputs['quick']  = navigate_button(array(
-      'name' => 'type',
-      'content' => t('Quick'),
-      'class' => 'navigate-search-quick',
-      'group' => 'navigate_search_type',
-      'default' => 'quick',
-      'help' => 'When selected, this will search titles for your search phrase.',
-      'on' => 'quick',
-      'wid' => $wid,
-    ));
-    $inputs['full']  = navigate_button(array(
-      'name' => 'type',
-      'content' => t('Full'),
-      'class' => 'navigate-search-full',
-      'group' => 'navigate_search_type',
-      'default' => 'quick',
-      'help' => 'When selected, the search will be done using the site\'s search functions. This means that you will need to run cron.php before this will return any results.',
-      'on' => 'full',
-      'wid' => $wid,
-    ));
-  }
-  
-  $inputs['search']  = navigate_input(array(
-    'name' => 'search_phrase',
-    'class' => 'navigate-search-phrase',
-    'select_all' => TRUE,
-    'callback' => 'navigate_search_process',
-    'help' => 'Type a search phrase and press Enter to submit.',
-    'wid' => $wid,
-  ));
-  
-  $inputs['search_button'] = navigate_callback_button(array(
-    'class' => 'navigate-search-button',
-    'callback' => 'navigate_search_process',
-    'content' => '<div class="navigate-search-button"></div>',
-    'help' => 'Click to run search.',
-  ));
-  
-  // Get content types
-  $result = db_query('SELECT type FROM {node_type}');
-  while ($row = db_fetch_array($result)) {
-    $content_type_inputs[$row['type']]  = navigate_button(array(
-      'name' => 'content_type_'. $row['type'],
-      'content' => ucwords(str_replace('_', ' ', $row['type'])),
-      'class' => 'navigate-content-type-'. $row['type'],
-      'default' => 1,
-      'on' => 1,
-      'wid' => $wid,
-    ));
-  }
-  
-  $output = theme('navigate_search_widget', $inputs, $content_type_inputs, $wid);
-  return $output;
-}
-
-
-/**
- * Theme search widget
- */
-function theme_navigate_search_widget($inputs, $content_type_inputs, $wid) {
-  //navigate_button('menu', t('menu'), 'navigate-search-menu', $wid);
-  $content['widget'] = '
-    <div class="navigate-search-top-row navigate-shorten">
-      <div class="navigate-search-input-outer">
-        '. $inputs['search_button'] .'
-        '. $inputs['search'] .'
-      </div>
-    </div>
-    <div class="navigate-search-services navigate-shorten">
-      <span class="navigate-search-content">Content: </span>
-      '. $inputs['quick'] .'
-      '. $inputs['full'] .'
-      <span class="navigate-search-divider"></span>
-      '. $inputs['menu'] .'
-    </div>
-    <div style="display:none" class="navigate-search-results navigate-results navigate-search-results-'. $wid .'"></div>';
-  $content['title'] = t('Search');
-  foreach ($content_type_inputs as $type) {
-    $content_types  .= '<div class="navigate-search-content-type">'. $type .'</div>';
-  }
-  $content['settings'] = '<div class="navigate-widget-label">Content types to search:</div><div class="navigate-search-content-types">'. $content_types .'</div>';
-    
-  return $content;
-}
-
-
-/**
- * Implementation of hook_perm()
- */
-function navigate_search_perm() {
-  return array("navigate_search search content", "navigate_search search menu");
-}
-
-
-/**
- * Implementation of hook_navigate_widget_process()
- */
-function navigate_search_navigate_widget_process($wid, $action) {
-  switch ($action) {
-    case 'search':
-      navigate_search_search();
-  }
-}
-
-
-function navigate_search_search() {
-  
-  global $_navigate_search_matches;
-  $settings = navigate_widget_settings_get($_POST['wid']);
-  
-  foreach ($settings as $key => $val) {
-    if (strpos($key, 'content_type_') !== FALSE && $val == 1) {
-      $types[] = str_replace('content_type_', '', $key);
-    }
-  }
-  
-  $phrase = check_plain($_POST['phrase']);
-  
-  if ($phrase == '') {
-    return FALSE;
-  }
-  
-  // Quick content search
-  if (user_access('navigate_search search content')) {
-    // Search content
-    if ($settings['type'] == 'quick') {
-      $search_content = TRUE;
-      
-      // Search by title
-      $divider = '<div class="navigate-divider"> </div>';
-  
-      $search_array = explode(' ', $phrase);
-      foreach ($search_array as $value) {
-        $search_query .= $and .' title LIKE "%%%s%" ';
-        $search_values[] = $value;
-        $and = ' AND ';
-      }
-      
-      // Get types
-      foreach ($types as $type) {
-        $type_query .= $or .' type="%s" ';
-        $search_values[] = $type;
-        $or = ' OR ';
-      }
-      if ($type_query) {
-        $type_query = ' AND ('. $type_query .') ';
-      }
-      
-      // Full query
-      if ($search_query) {
-        $full_query = 'SELECT title,nid FROM {node} WHERE ('. $search_query .') '. $type_query .' ORDER BY {node}.changed DESC, {node}.title ASC';
-      }
-      $result = db_query_range($full_query, $search_values, 0, 50);
-      while ($row = db_fetch_array($result)) {
-        $menu_item = array(
-          'path' => 'node/'. $row['nid'],
-          'title' => $row['title'],
-        );
-        $menu_item['wid'] = $_POST['wid'];
-        $content_matches .= theme('navigate_link', $menu_item);
-        $content_results = TRUE;
-      }
-    
-    // Full content search
-    }
-    elseif ($settings['type'] ==  'full') {
-      if (strlen($phrase) < 3) {
-        $output .= '<div>'. t('Please enter a longer phrase') .'</div>';
-        $divider = '<div class="navigate-divider"> </div>';
-      }
-      else {
-        $search_content = TRUE;
-        
-        // Search using drupal search
-        $divider = '<div class="navigate-divider"> </div>';
-    
-        // Get types
-        if ($types) {
-          $types_key = ' type:'. implode(',', $types);
-        }
-        
-        //$phrase .= ' type:page ';
-        $results = module_invoke('node', 'search', 'search', $phrase . $types_key);
-        foreach ($results as $result) {
-          $menu_item = array(
-            'path' => 'node/'. $result['node']->nid,
-            'title' => $result['title'],
-            'description' => '<div><span class="navigate-link-label">Type</span>: '. $result['type'] .'</div>'. $result['snippet'],
-          );
-          $menu_item['wid'] = $_POST['wid'];
-          $content_matches .= theme('navigate_link', $menu_item);
-          $content_results = TRUE;
-        }
-      }
-    }
-    
-    if ($search_content) {
-      if (!$content_results) {
-        $output .= '<div>'. t('No content results') .'</div>';
-      }
-      else {
-        $output .= '<div class="navigate-widget-label">Content matches:</div>'. $content_matches;
-      }
-    }
-  }
-  
-  // Search menu items
-  if (user_access('navigate_search search menu')) {
-    // Search menu
-    if ($settings['menu'] == 1) {
-      $output .= $divider;
-      navigate_search_menu_tree();
-      $_navigate_search_matches = navigate_devel_menu($_navigate_search_matches);
-      
-      $phrase_array = explode(' ', $phrase);
-      foreach ($_navigate_search_matches as $menu_item) {
-        $searchable = $menu_item['title'] .' '. $menu_item['path'] .' '. $menu_item['description'];
-        $match = 1;
-        foreach ($phrase_array as $phrase) {
-          if (stripos($searchable, $phrase, 0) === FALSE) {
-            $match = 0;
-          }
-        }
-        if ($match != 0) {
-          $menu_item['wid'] = $wid;
-          $menu_matches .= theme('navigate_link', $menu_item);
-          $menu_results = TRUE;
-        }
-      }
-      if (!$menu_results) {
-        $output .= '<div>'. t('No menu results') .'</div>';
-      }
-      else {
-        $output .= '<div class="navigate-widget-label">Menu matches:</div>'. $menu_matches;
-      }
-    }
-  }
-
-  echo $output;
-}
-
-
-
-/**
- * Create an array of all menu items
- */
-function navigate_search_menu_tree($pid = 1) {
-  global $_navigate_search_matches;
-  $menu = menu_get_menu();
-  if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
-    foreach ($menu['visible'][$pid]['children'] as $mid) {
-      $_navigate_search_matches[] = menu_get_item($mid);
-      navigate_menu_sub_tree($mid);
-    }
-  }
-}
-
-
-/**
- * Used with navigate_search_menu_tree to iterate through menu
- */
-function navigate_menu_sub_tree($pid = 1) {
-  $tree = navigate_search_menu_tree($pid);
-}
-
-
-/**
- * Implementation of hook_navigate_help_page()
- */
-function navigate_search_navigate_help_page() {
-  $help['access'] = FALSE;
-  if (user_access('navigate_search search content') || user_access('navigate_search search menu')) {
-    $help['access'] = TRUE;
-  }
-  $help['content'] = t('<p>The Search widget allows a user to search content and / or menu items. To use, type a word or two in the search box, and then presses enter or click the search icon to conduct the search. You can use partial words in your search as well. Here\'s a quick rundown of the settings:</p>
-<ul>
-  <li><strong>Quick</strong>: Search content by title. It\'s quick and doesn\'t require that you have the search module installed or set up.</li>
-  <li><strong>Full</strong>: Uses the search module to conduct a site search. A more powerful search mechanism, but might not be up to date if you haven\'t run cron recently.</li>
-  <li><strong>Menu</strong>: Searches the menu for the keywords chosen.</li>
-  <li><strong>Advanced settings</strong>: You can select which content types to search in the advanced settings pane.</li>
-</ul>');
-  $help['title'] = 'Search';
-  return $help;
-}
+<?php
+// $Id: navigate_search.module,v 1.5 2008/11/04 19:56:23 stompeers Exp $
+
+/**
+ * @file
+ * Produces the Navigate Search widget
+ */
+
+/**
+ * Implementation of hook_init()
+ */
+function navigate_search_init() {
+  if (user_access('navigate_search search content') || user_access('navigate_search search menu')) {
+    drupal_add_js(drupal_get_path('module', 'navigate_search') .'/navigate_search.js', 'module', 'footer');
+    drupal_add_css(drupal_get_path('module', 'navigate_search') .'/navigate_search.css');
+  }
+}
+
+
+/**
+ * Implementation of hook_navigation_widgets
+ */
+function navigate_search_navigate_widgets($op, $settings) {
+  switch ($op) {
+    case 'output':
+      switch ($settings['type']) {
+        case 'search':
+          return navigate_search_widget($settings['wid']);
+          break;
+      }
+      break;
+
+    case 'list':
+      return array(
+        array(
+          'type' => 'search',
+          'module' => 'navigate_search',
+          'content' => navigate_add_widget_link('<div class="navigate-search-icon"></div>', ''),
+        ),
+      );
+      break;
+  }
+}
+
+
+/**
+ * Generate search widget
+ */
+function navigate_search_widget($wid) {
+  $settings = navigate_widget_settings_get($wid);
+
+  if (user_access('navigate_search search menu')) {
+    $inputs['menu']  = navigate_button(array(
+      'name' => 'menu',
+      'content' => t('menu'),
+      'class' => 'navigate-search-menu',
+      'default' => '1',
+      'on' => 1,
+      'off' => 0,
+      'help' => 'When this is checked, searching will search menu items.',
+      'wid' => $wid,
+    ));
+  }
+
+  if (user_access('navigate_search search content')) {
+    $inputs['quick']  = navigate_button(array(
+      'name' => 'type',
+      'content' => t('Quick'),
+      'class' => 'navigate-search-quick',
+      'group' => 'navigate_search_type',
+      'default' => 'quick',
+      'help' => 'When selected, this will search titles for your search phrase.',
+      'on' => 'quick',
+      'wid' => $wid,
+    ));
+    $inputs['full']  = navigate_button(array(
+      'name' => 'type',
+      'content' => t('Full'),
+      'class' => 'navigate-search-full',
+      'group' => 'navigate_search_type',
+      'default' => 'quick',
+      'help' => 'When selected, the search will be done using the site\'s search functions. This means that you will need to run cron.php before this will return any results.',
+      'on' => 'full',
+      'wid' => $wid,
+    ));
+  }
+
+  $inputs['search']  = navigate_input(array(
+    'name' => 'search_phrase',
+    'class' => 'navigate-search-phrase',
+    'select_all' => TRUE,
+    'callback' => 'navigate_search_process',
+    'help' => 'Type a search phrase and press Enter to submit.',
+    'wid' => $wid,
+  ));
+
+  $inputs['search_button'] = navigate_callback_button(array(
+    'class' => 'navigate-search-button',
+    'callback' => 'navigate_search_process',
+    'content' => '<div class="navigate-search-button"></div>',
+    'help' => 'Click to run search.',
+  ));
+
+  // Get content types
+  $result = db_query('SELECT type FROM {node_type}');
+  while ($row = db_fetch_array($result)) {
+    $content_type_inputs[$row['type']]  = navigate_button(array(
+      'name' => 'content_type_'. $row['type'],
+      'content' => ucwords(str_replace('_', ' ', $row['type'])),
+      'class' => 'navigate-content-type-'. $row['type'],
+      'default' => 1,
+      'on' => 1,
+      'wid' => $wid,
+    ));
+  }
+
+  $output = theme('navigate_search_widget', $inputs, $content_type_inputs, $wid);
+  return $output;
+}
+
+
+/**
+ * Theme search widget
+ */
+function theme_navigate_search_widget($inputs, $content_type_inputs, $wid) {
+  //navigate_button('menu', t('menu'), 'navigate-search-menu', $wid);
+  $content['widget'] = '
+    <div class="navigate-search-top-row navigate-shorten">
+      <div class="navigate-search-input-outer">
+        '. $inputs['search_button'] .'
+        '. $inputs['search'] .'
+      </div>
+    </div>
+    <div class="navigate-search-services navigate-shorten">
+      <span class="navigate-search-content">Content: </span>
+      '. $inputs['quick'] .'
+      '. $inputs['full'] .'
+      <span class="navigate-search-divider"></span>
+      '. $inputs['menu'] .'
+    </div>
+    <div style="display:none" class="navigate-search-results navigate-results navigate-search-results-'. $wid .'"></div>';
+  $content['title'] = t('Search');
+  foreach ($content_type_inputs as $type) {
+    $content_types  .= '<div class="navigate-search-content-type">'. $type .'</div>';
+  }
+  $content['settings'] = '<div class="navigate-widget-label">Content types to search:</div><div class="navigate-search-content-types">'. $content_types .'</div>';
+
+  return $content;
+}
+
+
+/**
+ * Implementation of hook_perm()
+ */
+function navigate_search_perm() {
+  return array("navigate_search search content", "navigate_search search menu");
+}
+
+
+/**
+ * Implementation of hook_navigate_widget_process()
+ */
+function navigate_search_navigate_widget_process($wid, $action) {
+  switch ($action) {
+    case 'search':
+      navigate_search_search();
+  }
+}
+
+
+function navigate_search_search() {
+
+  global $_navigate_search_matches;
+  $settings = navigate_widget_settings_get($_POST['wid']);
+
+  foreach ($settings as $key => $val) {
+    if (strpos($key, 'content_type_') !== FALSE && $val == 1) {
+      $types[] = str_replace('content_type_', '', $key);
+    }
+  }
+
+  $phrase = check_plain($_POST['phrase']);
+
+  if ($phrase == '') {
+    return FALSE;
+  }
+
+  // Quick content search
+  if (user_access('navigate_search search content')) {
+    // Search content
+    if ($settings['type'] == 'quick') {
+      $search_content = TRUE;
+
+      // Search by title
+      $divider = '<div class="navigate-divider"> </div>';
+
+      $search_array = explode(' ', $phrase);
+      foreach ($search_array as $value) {
+        $search_query .= $and .' title LIKE "%%%s%" ';
+        $search_values[] = $value;
+        $and = ' AND ';
+      }
+
+      // Get types
+      foreach ($types as $type) {
+        $type_query .= $or .' type="%s" ';
+        $search_values[] = $type;
+        $or = ' OR ';
+      }
+      if ($type_query) {
+        $type_query = ' AND ('. $type_query .') ';
+      }
+
+      // Full query
+      if ($search_query) {
+        $full_query = 'SELECT title,nid FROM {node} WHERE ('. $search_query .') '. $type_query .' ORDER BY {node}.changed DESC, {node}.title ASC';
+      }
+      $result = db_query_range($full_query, $search_values, 0, 50);
+      while ($row = db_fetch_array($result)) {
+        $menu_item = array(
+          'path' => 'node/'. $row['nid'],
+          'title' => $row['title'],
+        );
+        $menu_item['wid'] = $_POST['wid'];
+        $content_matches .= theme('navigate_link', $menu_item);
+        $content_results = TRUE;
+      }
+
+    // Full content search
+    }
+    elseif ($settings['type'] ==  'full') {
+      if (strlen($phrase) < 3) {
+        $output .= '<div>'. t('Please enter a longer phrase') .'</div>';
+        $divider = '<div class="navigate-divider"> </div>';
+      }
+      else {
+        $search_content = TRUE;
+
+        // Search using drupal search
+        $divider = '<div class="navigate-divider"> </div>';
+
+        // Get types
+        if ($types) {
+          $types_key = ' type:'. implode(',', $types);
+        }
+
+        //$phrase .= ' type:page ';
+        $results = module_invoke('node', 'search', 'search', $phrase . $types_key);
+        foreach ($results as $result) {
+          $menu_item = array(
+            'path' => 'node/'. $result['node']->nid,
+            'title' => $result['title'],
+            'description' => '<div><span class="navigate-link-label">Type</span>: '. $result['type'] .'</div>'. $result['snippet'],
+          );
+          $menu_item['wid'] = $_POST['wid'];
+          $content_matches .= theme('navigate_link', $menu_item);
+          $content_results = TRUE;
+        }
+      }
+    }
+
+    if ($search_content) {
+      if (!$content_results) {
+        $output .= '<div>'. t('No content results') .'</div>';
+      }
+      else {
+        $output .= '<div class="navigate-widget-label">Content matches:</div>'. $content_matches;
+      }
+    }
+  }
+
+  // Search menu items
+  if (user_access('navigate_search search menu')) {
+    // Search menu
+    if ($settings['menu'] == 1) {
+      $output .= $divider;
+      navigate_search_menu_tree();
+      $_navigate_search_matches = navigate_devel_menu($_navigate_search_matches);
+
+      $phrase_array = explode(' ', $phrase);
+      foreach ($_navigate_search_matches as $menu_item) {
+        $searchable = $menu_item['title'] .' '. $menu_item['path'] .' '. $menu_item['description'];
+        $match = 1;
+        foreach ($phrase_array as $phrase) {
+          if (stripos($searchable, $phrase, 0) === FALSE) {
+            $match = 0;
+          }
+        }
+        if ($match != 0) {
+          $menu_item['wid'] = $wid;
+          $menu_matches .= theme('navigate_link', $menu_item);
+          $menu_results = TRUE;
+        }
+      }
+      if (!$menu_results) {
+        $output .= '<div>'. t('No menu results') .'</div>';
+      }
+      else {
+        $output .= '<div class="navigate-widget-label">Menu matches:</div>'. $menu_matches;
+      }
+    }
+  }
+
+  echo $output;
+}
+
+
+
+/**
+ * Create an array of all menu items
+ */
+function navigate_search_menu_tree($pid = 1) {
+  global $_navigate_search_matches;
+  $menu = menu_get_menu();
+  if (isset($menu['visible'][$pid]) && $menu['visible'][$pid]['children']) {
+    foreach ($menu['visible'][$pid]['children'] as $mid) {
+      $_navigate_search_matches[] = menu_get_item($mid);
+      navigate_menu_sub_tree($mid);
+    }
+  }
+}
+
+
+/**
+ * Used with navigate_search_menu_tree to iterate through menu
+ */
+function navigate_menu_sub_tree($pid = 1) {
+  $tree = navigate_search_menu_tree($pid);
+}
+
+
+/**
+ * Implementation of hook_navigate_help_page()
+ */
+function navigate_search_navigate_help_page() {
+  $help['access'] = FALSE;
+  if (user_access('navigate_search search content') || user_access('navigate_search search menu')) {
+    $help['access'] = TRUE;
+  }
+  $help['content'] = t('<p>The Search widget allows a user to search content and / or menu items. To use, type a word or two in the search box, and then presses enter or click the search icon to conduct the search. You can use partial words in your search as well. Here\'s a quick rundown of the settings:</p>
+<ul>
+  <li><strong>Quick</strong>: Search content by title. It\'s quick and doesn\'t require that you have the search module installed or set up.</li>
+  <li><strong>Full</strong>: Uses the search module to conduct a site search. A more powerful search mechanism, but might not be up to date if you haven\'t run cron recently.</li>
+  <li><strong>Menu</strong>: Searches the menu for the keywords chosen.</li>
+  <li><strong>Advanced settings</strong>: You can select which content types to search in the advanced settings pane.</li>
+</ul>');
+  $help['title'] = 'Search';
+  return $help;
+}
