Index: domain_menu.info
===================================================================
--- domain_menu.info	(revision 3051)
+++ domain_menu.info	(working copy)
@@ -1,7 +1,7 @@
 ; $Id: domain_menu.info,v 1.1 2007/11/26 22:54:48 canen Exp $
+core = 6.x
 name = Domain Menu
 description = Domain specific menu settings.
 package = Domain Access
-dependencies = domain menu 
-
-
+dependencies[] = domain
+dependencies[] = menu 
\ No newline at end of file
Index: domain_menu.install
===================================================================
--- domain_menu.install	(revision 3051)
+++ domain_menu.install	(working copy)
@@ -1,25 +1,30 @@
 <?php
 // $Id: domain_menu.install,v 1.1 2007/11/26 22:54:48 canen Exp $
 function domain_menu_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysqli':
-    case 'mysql':
-      db_query("CREATE TABLE IF NOT EXISTS {domain_menu} (
-       domain_id int(11) NOT NULL default '0',
-       menu_settings blob,
-       PRIMARY KEY (domain_id)
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");     
-      break;
-    case 'pgsql':
-      db_query("CREATE TABLE {domain_menu} (
-       domain_id integer NOT NULL default 0,
-       menu_settings bytea,
-       PRIMARY KEY (domain_id)
-      )");     
-      break;
-  }
+  drupal_install_schema('domain_menu');
 }
 
+function domain_menu_schema() {
+  $schema['domain_menu'] = array(
+    'description' => t('The table defining domains'),
+    'fields' => array(
+      'domain_id' => array(
+	    'description' => t('the domain id'),
+	    'type' => 'int',
+	    'not null' => TRUE,
+      ),
+      'menu_settings' => array(
+	   'description' => t('the setting for a specific subdomain'),
+	    'type' => 'blob',
+	    'size' => 'big',
+      ),
+    ),
+    'primary key' => array('domain_id'),
+  );
+  
+  return $schema;   
+}
+
 /**
  * Implements hook_uninstall()
  */
Index: domain_menu.module
===================================================================
--- domain_menu.module	(revision 3051)
+++ domain_menu.module	(working copy)
@@ -7,39 +7,21 @@
  */
 
 /**
- * Implementation of hook_init().
- *
- * Overrides global menu settings for primary, secondary, authoring.
- */
-function domain_menu_init() {
-  global $_domain, $conf;
-
-  $domain_menu = domain_menu_lookup($_domain['domain_id']);
-
-  if ($domain_menu != -1) {
-    $conf['menu_primary_menu'] = $domain_menu['primary'];
-    $conf['menu_secondary_menu'] = $domain_menu['secondary'];
-    $conf['menu_parent_items'] = $domain_menu['parent_items'];
-  }
-}
-
-/**
  * Implements hook_menu()
  *
  * @ingroup drupal
  */
-function domain_menu_menu($may_cache) {
+function domain_menu_menu() {
   $items = array();
-  if (!$may_cache) {
-    $items[] = array(
-      'title' => t('Domain menu settings'),
-      'path' => 'admin/build/domain/menu',
-      'access' => user_access('administer domains'),
-      'type' => MENU_CALLBACK,
-      'callback' => 'domain_menu_page',
-      'callback arguments' => array(arg(4))      
-    );    
-  }
+  
+  $items['admin/build/domain/menu'] = array(
+   'title' => t('Domain menu settings'),
+   'access arguments' => array('administer domains'),
+   'type' => MENU_CALLBACK,
+   'page callback' => 'domain_menu_page',
+   'page arguments' => array(4),      
+  );    
+  
   return $items;
 }
 
Index: domain_menu_form.inc
===================================================================
--- domain_menu_form.inc	(revision 3051)
+++ domain_menu_form.inc	(working copy)
@@ -12,7 +12,9 @@
   $domain_menus = domain_menu_lookup($_domain['domain_id']);
 
   // Find All memu items excluding the "Navigation" menu
-  $root_menus = menu_parent_options(1); 
+  $menu_names = menu_get_menus();
+  unset($menu_names['navigation']);
+  $root_menus = menu_parent_options($menu_names,0); 
   $primary_options = $root_menus;
   $primary_options[0] = t('No primary links');
 
@@ -48,24 +50,12 @@
     '#value' => t('The menu module allows on-the-fly creation of menu links in the content authoring forms. The following option limits the menus in which a new link may be added. E.g., this can be used to force new menu items to be created in the primary links menu or to hide admin menu items.'),
   );
 
-  $authoring_options = $root_menus;
-  $authoring_options[0] = t('Show all menus');
-
-  $form['domain_settings_authoring']['menu_parent_items'] = array('#type' => 'select',
-    '#title' => t('Restrict parent items to'),
-    '#default_value' => $domain_menus['parent_items'] ? $domain_menus['parent_items'] : 0,
-    '#options' => $authoring_options,
-    '#description' => t('Choose the menu to be made available in the content authoring form. Only this menu item and its children will be shown.'),
-   );
-
   // Which domain are we editing?
   $form['domain_id'] = array(
     '#type' => 'value',
     '#value' => $_domain['domain_id'],
   );
 
-  // Our submit handlers.
-  $form['#submit']['domain_menu_submit'] = array();
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save configuration'),
@@ -73,14 +63,13 @@
   return $form; 
 }
 
-function domain_menu_submit($form_id, $form_values) {
-  $id = $form_values['domain_id'];
+function domain_menu_form_submit($form, &$form_state) {
+  $id = $form_state['values']['domain_id'];
   $check = domain_menu_lookup($id);
 
   $menus = array();
-  $menus['primary'] = $form_values['menu_primary_menu'];
-  $menus['secondary'] = $form_values['menu_secondary_menu'];
-  $menus['parent_items'] = $form_values['menu_parent_items']; // temp
+  $menus['primary'] = $form_state['values']['menu_primary_menu'];
+  $menus['secondary'] = $form_state['values']['menu_secondary_menu'];
 
   $menus = serialize($menus);
 
