Index: menutrails.admin.inc
===================================================================
RCS file: menutrails.admin.inc
diff -N menutrails.admin.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ menutrails.admin.inc	19 Feb 2009 22:14:41 -0000
@@ -0,0 +1,162 @@
+<?php
+// $Id: menutrails.module,v 1.4.2.11 2009/02/02 15:50:15 sun Exp $
+
+/**
+ * @file
+ * Menutrails administrator forms.
+ */
+
+
+/**
+ * Form builder function for settings.
+ *
+ * This is where menutrails rules are set. The interface here could definitely
+ * stand for some improvement. It's especially unhelpful for tagging
+ * vocabularies with lots and lots of terms.
+ */
+function menutrails_settings_form() {
+  $options = array('' => '<none>');
+  $limit   = MENU_MAX_DEPTH - 1;
+
+  // Load up menutrail menu.
+  $menu = variable_get('menutrails_menu', 'primary-links');
+  $tree = menu_tree_all_data($menu, NULL);
+  _menutrails_parents_recurse($tree, $menu, '--', $options, 0, $limit);
+
+  $form['description'] = array(
+    '#type' => 'markup',
+    '#weight' => '-10',
+    '#value' => t('Use these settings to configure the "menu trails" for your nodes. This determines what menu items are activated when viewing an individual node. For instance, if you have a menu item for "Blog," you may want to have all blog posts fall under that menu.'),
+    '#prefix' => '<p>',
+    '#suffix' => '</p>',
+  );
+  $form['menutrails_menu'] = array(
+    '#type' => 'select',
+    '#weight' => '-6',
+    '#options' => menu_get_menus(),
+    '#default_value' => variable_get('menutrails_menu', 'primary-links'),
+    '#title' => t('Menutrails Menu'),
+    '#description' => t('What menu are you most interested in assigning trails to? This menu will be used if there is ambiguity about what menu a node falls under.'),
+  );
+  $form['menutrails_breadcrumbs'] = array(
+    '#type' => 'checkbox',
+    '#weight' => '-5',
+    '#default_value' => variable_get('menutrails_breadcrumbs', 1),
+    '#title' => t('Set breadcrumbs?'),
+    '#description' => t('If checked, menutrails will also synchronize the default drupal breadcrumbs with the menu trails, again giving priority to the menu selected above.'),
+  );
+  $form['order'] = array(
+    '#type' => 'markup',
+    '#weight' => '-1',
+    '#value' => t('Menu trails are evaluated in the order they are shown below.'),
+    '#prefix' => '<p>',
+    '#suffix' => '</p>',
+  );
+  $form = array_merge($form, module_invoke_all('menutrails_settings', $options));
+
+  return system_settings_form($form);
+}
+
+/**
+ * Implementation of hook_menutrails_settings().
+ *
+ * Allows other modules to define their own menutrail behavior.
+ *
+ * Please define your input as a fieldset and do not assign a weight. This will
+ * keep the groups of menutrails settings in order.
+ *
+ * @param $options
+ *   Options array to be used by other modules to define their own menutrails.
+ *
+ * @return
+ *   A form element (or array) for the menutrails system settings form.
+ */
+function menutrails_menutrails_settings($options) {
+  $form = array();
+  $node_types = node_get_types('names');
+  $node_trails = variable_get('menutrails_node_types', array());
+  $vocabs = module_exists('taxonomy') ? taxonomy_get_vocabularies() : array();
+  $term_trails = variable_get('menutrails_terms', array());
+  $form['menutrails_node_types'] = array(
+    '#tree' => TRUE,
+    '#type' => 'fieldset',
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+    '#title' => t('Node types'),
+  );
+  foreach ($node_types as $key => $value) {
+    $form['menutrails_node_types'][$key] = array('#type' => 'select',
+      '#title' => t('Parent item for') ." $value",
+      '#default_value' => isset($node_trails[$key]) ? $node_trails[$key] : NULL,
+      '#options' => $options,
+    );
+  }
+  foreach ($vocabs as $vocab) {
+    if ($vocab->tags != 1) {
+      // Tagging gets out of hand too fast, so we disallow.
+      $form[$vocab->vid]['menutrails_terms'] = array(
+        '#tree' => TRUE,
+        '#type' => 'fieldset',
+        '#collapsible' => TRUE,
+        '#collapsed' => TRUE,
+        '#title' => t('Categories:') ." $vocab->name",
+      );
+      $terms = taxonomy_get_tree($vocab->vid);
+      foreach ($terms as $term) {
+        $form[$vocab->vid]['menutrails_terms'][$term->tid] = array('#type' => 'select',
+          '#title' => t('Parent item for') ." $term->name",
+          '#default_value' => isset($term_trails[$term->tid]) ? $term_trails[$term->tid] : NULL,
+          '#options' => $options,
+        );
+      }
+    }
+  }
+  // Organic groups support.
+  if (module_exists('og')) {
+    $form['menutrails_og'] = array(
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#title' => t('Organic groups'),
+      '#description' => t('Settings for nodes withing Organic Groups: these override node and taxonomy settings'),
+    );
+    $form['menutrails_og']['menutrails_og_sub_pages'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use Group Node Menu Trail For Og Pages'),
+      '#default_value' => variable_get('menutrails_og_sub_pages', TRUE),
+      '#description' => t('Use menutrails present for an organic group node for OG sub pages (e.g. "manage subscription" or "members")'),
+    );
+    $form['menutrails_og']['menutrails_og_post_default'] = array(
+      '#type' => 'select',
+      '#title' => t('Default menu trail for all nodes with group audience'),
+      '#default_value' => variable_get('menutrails_og_post_default', 0),
+      '#description' => t('Default menu trail for any posts in a group.'),
+      '#options' => $options,
+    );
+    $form['menutrails_og']['menutrails_og_node'] = array(
+      '#type' => 'fieldset',
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#tree' => TRUE,
+      '#title' => t('Individual organic group trails'),
+      '#description' => t('Specific trails for posts within specific groups'),
+    );
+    $result = db_query('SELECT n.nid, n.title FROM {node} n INNER JOIN og ON n.nid = og.nid ORDER BY n.title');
+    $og_trails = variable_get('menutrails_og_node', array());
+    while ($node = db_fetch_object($result)) {
+      $form['menutrails_og']['menutrails_og_node'][$node->nid] = array(
+        '#type' => 'select',
+        '#title' => 'Group '. $node->title,
+        '#default_value' => isset($og_trails[$node->nid]) ? $og_trails[$node->nid] : NULL,
+        '#options' => $options,
+      );
+    }
+    $form['menutrails_og']['menutrails_og_group_menu'] = array(
+      '#type' => 'checkbox',
+      '#title' => t("Use Group's Menu Item For Posts"),
+      '#default_value' => variable_get('menutrails_og_group_menu', FALSE),
+      '#description' => t('If a specific group node has an assigned menu item, use this as the trail for nodes which have that group as an audience. If present, this will override all other group settings.'),
+    );
+  }
+  return $form;
+}
\ No newline at end of file
Index: menutrails.install
===================================================================
RCS file: menutrails.install
diff -N menutrails.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ menutrails.install	19 Feb 2009 22:14:41 -0000
@@ -0,0 +1,10 @@
+<?php
+
+/**
+ * Implementation of hook_enable().
+ *
+ * Default menutrails to run after core/og modules for fuller control.
+ */
+function menutrails_enable() {
+  db_query("UPDATE {system} SET weight = 1 WHERE name = 'menutrails' AND type = 'module'");
+}
\ No newline at end of file
Index: menutrails.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/menutrails/menutrails.module,v
retrieving revision 1.4.2.11
diff -u -p -r1.4.2.11 menutrails.module
--- menutrails.module	2 Feb 2009 15:50:15 -0000	1.4.2.11
+++ menutrails.module	19 Feb 2009 22:14:41 -0000
@@ -17,6 +17,7 @@ function menutrails_menu() {
     'title' => 'Trails',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('menutrails_settings_form'),
+    'file' => 'menutrails.admin.inc',
     'access arguments' => array('administer menu'),
     'type' => MENU_LOCAL_TASK,
     'weight' => 6,
@@ -52,15 +53,6 @@ function menutrails_init() {
 }
 
 /**
- * Implementation of hook_enable().
- *
- * Default menutrails to run after core/og modules for fuller control.
- */
-function menutrails_enable() {
-  db_query("UPDATE {system} SET weight = 1 WHERE name = 'menutrails' AND type = 'module'");
-}
-
-/**
  * Implementation of hook_nodeapi().
  *
  * This will evaluate individual nodes when being viewed and take the necessary
@@ -177,160 +169,6 @@ function menutrails_comment($comment, $o
   }
 }
 
-/**
- * Form builder function for settings.
- *
- * This is where menutrails rules are set. The interface here could definitely
- * stand for some improvement. It's especially unhelpful for tagging
- * vocabularies with lots and lots of terms.
- */
-function menutrails_settings_form() {
-  $options = array('' => '<none>');
-  $limit   = MENU_MAX_DEPTH - 1;
-
-  // Load up menutrail menu.
-  $menu = variable_get('menutrails_menu', 'primary-links');
-  $tree = menu_tree_all_data($menu, NULL);
-  _menutrails_parents_recurse($tree, $menu, '--', $options, 0, $limit);
-
-  $form['description'] = array(
-    '#type' => 'markup',
-    '#weight' => '-10',
-    '#value' => t('Use these settings to configure the "menu trails" for your nodes. This determines what menu items are activated when viewing an individual node. For instance, if you have a menu item for "Blog," you may want to have all blog posts fall under that menu.'),
-    '#prefix' => '<p>',
-    '#suffix' => '</p>',
-  );
-  $form['menutrails_menu'] = array(
-    '#type' => 'select',
-    '#weight' => '-6',
-    '#options' => menu_get_menus(),
-    '#default_value' => variable_get('menutrails_menu', 'primary-links'),
-    '#title' => t('Menutrails Menu'),
-    '#description' => t('What menu are you most interested in assigning trails to? This menu will be used if there is ambiguity about what menu a node falls under.'),
-  );
-  $form['menutrails_breadcrumbs'] = array(
-    '#type' => 'checkbox',
-    '#weight' => '-5',
-    '#default_value' => variable_get('menutrails_breadcrumbs', 1),
-    '#title' => t('Set breadcrumbs?'),
-    '#description' => t('If checked, menutrails will also synchronize the default drupal breadcrumbs with the menu trails, again giving priority to the menu selected above.'),
-  );
-  $form['order'] = array(
-    '#type' => 'markup',
-    '#weight' => '-1',
-    '#value' => t('Menu trails are evaluated in the order they are shown below.'),
-    '#prefix' => '<p>',
-    '#suffix' => '</p>',
-  );
-  $form = array_merge($form, module_invoke_all('menutrails_settings', $options));
-
-  return system_settings_form($form);
-}
-
-/**
- * Implementation of hook_menutrails_settings().
- *
- * Allows other modules to define their own menutrail behavior.
- *
- * Please define your input as a fieldset and do not assign a weight. This will
- * keep the groups of menutrails settings in order.
- *
- * @param $options
- *   Options array to be used by other modules to define their own menutrails.
- *
- * @return
- *   A form element (or array) for the menutrails system settings form.
- */
-function menutrails_menutrails_settings($options) {
-  $form = array();
-  $node_types = node_get_types('names');
-  $node_trails = variable_get('menutrails_node_types', array());
-  $vocabs = module_exists('taxonomy') ? taxonomy_get_vocabularies() : array();
-  $term_trails = variable_get('menutrails_terms', array());
-  $form['menutrails_node_types'] = array(
-    '#tree' => TRUE,
-    '#type' => 'fieldset',
-    '#collapsible' => TRUE,
-    '#collapsed' => TRUE,
-    '#title' => t('Node types'),
-  );
-  foreach ($node_types as $key => $value) {
-    $form['menutrails_node_types'][$key] = array('#type' => 'select',
-      '#title' => t('Parent item for') ." $value",
-      '#default_value' => isset($node_trails[$key]) ? $node_trails[$key] : NULL,
-      '#options' => $options,
-    );
-  }
-  foreach ($vocabs as $vocab) {
-    if ($vocab->tags != 1) {
-      // Tagging gets out of hand too fast, so we disallow.
-      $form[$vocab->vid]['menutrails_terms'] = array(
-        '#tree' => TRUE,
-        '#type' => 'fieldset',
-        '#collapsible' => TRUE,
-        '#collapsed' => TRUE,
-        '#title' => t('Categories:') ." $vocab->name",
-      );
-      $terms = taxonomy_get_tree($vocab->vid);
-      foreach ($terms as $term) {
-        $form[$vocab->vid]['menutrails_terms'][$term->tid] = array('#type' => 'select',
-          '#title' => t('Parent item for') ." $term->name",
-          '#default_value' => isset($term_trails[$term->tid]) ? $term_trails[$term->tid] : NULL,
-          '#options' => $options,
-        );
-      }
-    }
-  }
-  // Organic groups support.
-  if (module_exists('og')) {
-    $form['menutrails_og'] = array(
-      '#type' => 'fieldset',
-      '#collapsible' => TRUE,
-      '#collapsed' => TRUE,
-      '#title' => t('Organic groups'),
-      '#description' => t('Settings for nodes withing Organic Groups: these override node and taxonomy settings'),
-    );
-    $form['menutrails_og']['menutrails_og_sub_pages'] = array(
-      '#type' => 'checkbox',
-      '#title' => t('Use Group Node Menu Trail For Og Pages'),
-      '#default_value' => variable_get('menutrails_og_sub_pages', TRUE),
-      '#description' => t('Use menutrails present for an organic group node for OG sub pages (e.g. "manage subscription" or "members")'),
-    );
-    $form['menutrails_og']['menutrails_og_post_default'] = array(
-      '#type' => 'select',
-      '#title' => t('Default menu trail for all nodes with group audience'),
-      '#default_value' => variable_get('menutrails_og_post_default', 0),
-      '#description' => t('Default menu trail for any posts in a group.'),
-      '#options' => $options,
-    );
-    $form['menutrails_og']['menutrails_og_node'] = array(
-      '#type' => 'fieldset',
-      '#collapsible' => TRUE,
-      '#collapsed' => TRUE,
-      '#tree' => TRUE,
-      '#title' => t('Individual organic group trails'),
-      '#description' => t('Specific trails for posts within specific groups'),
-    );
-    $result = db_query('SELECT n.nid, n.title FROM {node} n INNER JOIN og ON n.nid = og.nid ORDER BY n.title');
-    $og_trails = variable_get('menutrails_og_node', array());
-    while ($node = db_fetch_object($result)) {
-      $form['menutrails_og']['menutrails_og_node'][$node->nid] = array(
-        '#type' => 'select',
-        '#title' => 'Group '. $node->title,
-        '#default_value' => isset($og_trails[$node->nid]) ? $og_trails[$node->nid] : NULL,
-        '#options' => $options,
-      );
-    }
-    $form['menutrails_og']['menutrails_og_group_menu'] = array(
-      '#type' => 'checkbox',
-      '#title' => t("Use Group's Menu Item For Posts"),
-      '#default_value' => variable_get('menutrails_og_group_menu', FALSE),
-      '#description' => t('If a specific group node has an assigned menu item, use this as the trail for nodes which have that group as an audience. If present, this will override all other group settings.'),
-    );
-  }
-  return $form;
-}
-
 function menutrails_token_values($type, $object = NULL, $options = array()) {
   if ($type == 'node') {
     $node = $object;
