Index: modules/dialog_node/dialog_node.module
===================================================================
--- modules/dialog_node/dialog_node.module	(revision 0)
+++ modules/dialog_node/dialog_node.module	(revision 3850)
@@ -0,0 +1,120 @@
+<?php
+// $Id: dialog_user.module,v 1.2.2.2 2010/01/13 02:59:08 rz Exp $
+
+/**
+ * Implementation of hook_menu().
+ */
+function dialog_node_menu() {
+  $items['dialog/node-add/%ctools_js/%'] = array(
+    'title' => 'Node add',
+    'page callback' => 'dialog_node_add',
+    'page arguments' => array(2, 3),
+    'access callback' => 'node_access',
+    'access arguments' => array('create', 3),
+    'type' => MENU_CALLBACK,
+  );
+  $items['dialog/node-edit/%ctools_js/%node'] = array(
+    'title' => 'Node edit',
+    'page callback' => 'dialog_node_edit',
+    'page arguments' => array(2, 3),
+    'access callback' => 'node_access',
+    'access arguments' => array('update', 3),
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+/**
+ * Access callback;
+ *
+ * @param $type
+ *   The machine readable name of the node type.
+ */
+function dialog_node_add_access($type) {
+  return user_access("create $type node");
+}
+
+/**
+ * Add node using Dialog.
+ *
+ * Enter description here ...
+ * @param unknown_type $js
+ * @param unknown_type $type
+ */
+function dialog_node_add($js, $type) {
+  if ($js) {
+    global $user;
+    ctools_include('ajax');
+    $commands = array();
+
+    $types = node_get_types();
+    $type = isset($type) ? str_replace('-', '_', $type) : NULL;
+
+    // If a node type has been specified, validate its existence.
+    if (isset($types[$type]) && node_access('create', $type)) {
+      module_load_include('inc', 'node', 'node.pages');
+      $node = array('uid' => $user->uid, 'name' => (isset($user->name) ? $user->name : ''), 'type' => $type, 'language' => '');
+
+      $form_state = array(
+        'ajax' => TRUE,
+        'title' => t('Create @name', array('@name' => $types[$type]->name)),
+        'args' => array('node' => $node),
+        'form_load_files' => array(drupal_get_path('module', 'node') . '/node.pages.inc'),
+      );
+
+      $commands = dialog_form_wrapper($type . '_node_form', $form_state);
+      if (empty($commands)) {
+        // Node is submitted. We can get the node ID and values from the
+        // $form_state.
+        //$commands[] = dialog_command_display(t('@name submitted', array('@name' => $types[$type]->name)), t('View <a href="@node-url">@title</a> @node-type.', array('@node-url' => url('node/' . $form_state['nid']), '@title' => $form_state['node']['title'], '@node-type' => $types[$type]->name)));
+          $commands[] = dialog_command_display(t('Comment submitted'), t('Reloading...'));
+          $commands[] = ctools_ajax_command_reload();
+      }
+    }
+    else {
+      $commands[] = dialog_command_display(t('Access denied'), t('Reloading...'));
+    }
+
+    ctools_ajax_render($commands);
+  }
+  else {
+    // No Javascript.
+    drupal_goto('node/add/' . $type);
+  }
+}
+
+function dialog_node_edit($js, $node){ 
+  if ($js) {    
+    global $user;
+    ctools_include('ajax');
+    $commands = array();
+    
+    module_load_include('inc', 'node', 'node.pages');
+
+    $form_id = $node->type.'_node_form'; 
+    $commands = dialog_get_form($form_id, $js, $node);   
+    ctools_ajax_render($commands);
+  }
+  else {
+    // No Javascript.
+    drupal_goto('node/'.$nid.'/edit');
+  }  
+}
+
+/**
+ * Implementation of hook_form_alter().
+ */
+function dialog_node_form_alter(&$form, $form_state, $form_id) {
+  // Specify the submit buttons to be used as the dialog buttons.
+  if (strpos($form_id, '_node_form') && !empty($form_state['ajax'])) {
+    if($form['buttons']['delete']){
+      $form['buttons']['delete']['#attributes']['class'] = 'ctools-dialog-button';
+    }
+    $form['buttons']['submit']['#attributes']['class'] = 'ctools-dialog-button';
+    // Preview buttons seems to submit the form, so unset it.
+    unset($form['buttons']['preview']);
+
+    unset($form['#action']);
+  }
+}
\ No newline at end of file
Index: modules/dialog_node/dialog_node.info
===================================================================
--- modules/dialog_node/dialog_node.info	(revision 0)
+++ modules/dialog_node/dialog_node.info	(revision 3850)
@@ -0,0 +1,5 @@
+; $Id$
+name = Dialog ndoe
+description = Provides Dialog integration for the core node module.
+core = 6.x
+dependencies[] = dialog
