? red5_d6.patch
Index: services/services/flvnode_service/flvnode_service.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/red5flashserver/services/services/flvnode_service/flvnode_service.info,v
retrieving revision 1.1.2.1
diff -u -b -r1.1.2.1 flvnode_service.info
--- services/services/flvnode_service/flvnode_service.info	3 Nov 2008 15:58:59 -0000	1.1.2.1
+++ services/services/flvnode_service/flvnode_service.info	25 Feb 2009 10:11:34 -0000
@@ -2,4 +2,7 @@
 name = FLV node service
 description = Provides a flv node service.
 package = Services - services
-dependencies = services node
+dependencies[] = services
+dependencies[] = node
+
+core = 6.x
\ No newline at end of file
Index: services/services/flvnode_service/flvnode_service.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/red5flashserver/services/services/flvnode_service/flvnode_service.install,v
retrieving revision 1.1.2.1
diff -u -b -r1.1.2.1 flvnode_service.install
--- services/services/flvnode_service/flvnode_service.install	3 Nov 2008 15:58:59 -0000	1.1.2.1
+++ services/services/flvnode_service/flvnode_service.install	25 Feb 2009 10:11:34 -0000
@@ -5,4 +5,7 @@
  * Implementation of hook_uninstall().
  */
 function flvnode_service_uninstall() {
+  // Remove tables.
+  drupal_uninstall_schema('flvnode_service');
+
 }
Index: services/services/flvnode_service/flvnode_service.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/red5flashserver/services/services/flvnode_service/flvnode_service.module,v
retrieving revision 1.1.2.1
diff -u -b -r1.1.2.1 flvnode_service.module
--- services/services/flvnode_service/flvnode_service.module	3 Nov 2008 15:58:59 -0000	1.1.2.1
+++ services/services/flvnode_service/flvnode_service.module	25 Feb 2009 10:11:34 -0000
@@ -1,6 +1,72 @@
 <?php
 // $Id: flvnode_service.module,v 1.1.2.1 2008/11/03 15:58:59 chriscar Exp $
 
+
+/* TODO FormAPI image buttons are now supported.
+   FormAPI now offers the 'image_button' element type, allowing developers to
+   use icons or other custom images in place of traditional HTML submit buttons.
+
+$form['my_image_button'] = array(
+  '#type'         => 'image_button',
+  '#title'        => t('My button'),
+  '#return_value' => 'my_data',
+  '#src'          => 'my/image/path.jpg',
+); */
+
+/* TODO Node previews and adding form fields to the node form.
+   There is a subtle but important difference in the way node previews (and other
+   such operations) are carried out when adding or editing a node. With the new
+   Forms API, the node form is handled as a multi-step form. When the node form
+   is previewed, all the form values are submitted, and the form is rebuilt with
+   those form values put into $form['#node']. Thus, form elements that are added
+   to the node form will lose any user input unless they set their '#default_value'
+   elements using this embedded node object. */
+
+/* TODO {files} table changed
+   The files table has been changed to make it easier to preview uploaded files.
+   Two fields, status and timestamp, have been added so that temporary files
+   can be stored and cleaned automatically removed during a cron job. Use
+   file_set_status() to change a files status and make it a permanent file. */
+
+/* TODO New user_mail_tokens() method may be useful.
+   user.module now provides a user_mail_tokens() function to return an array
+   of the tokens available for the email notification messages it sends when
+   accounts are created, activated, blocked, etc. Contributed modules that
+   wish to make use of the same tokens for their own needs are encouraged
+   to use this function. */
+
+/* TODO
+   There is a new hook_watchdog in core. This means that contributed modules
+   can implement hook_watchdog to log Drupal events to custom destinations.
+   Two core modules are included, dblog.module (formerly known as watchdog.module),
+   and syslog.module. Other modules in contrib include an emaillog.module,
+   included in the logging_alerts module. See syslog or emaillog for an
+   example on how to implement hook_watchdog.
+function example_watchdog($log = array()) {
+  if ($log['severity'] == WATCHDOG_ALERT) {
+    mysms_send($log['user']->uid,
+      $log['type'],
+      $log['message'],
+      $log['variables'],
+      $log['severity'],
+      $log['referer'],
+      $log['ip'],
+      format_date($log['timestamp']));
+  }
+} */
+
+/* TODO Implement the hook_theme registry. Combine all theme registry entries
+   into one hook_theme function in each corresponding module file.
+function flvnode_service_theme() {
+  return array(
+  );
+}; */
+
+
+/* TODO
+   An argument for replacements has been added to format_plural(),
+   escaping and/or theming the values just as done with t().*/
+
 /**
  * @file
  * The module which exposes services related to flv nodes
@@ -8,8 +74,8 @@
 /**
  * Implementation of hook_help().
  */
-function flvnode_service_help($section) {
-  switch ($section) {
+function flvnode_service_help($path, $arg) {
+  switch ($path) {
     case 'admin/help#services_node':
       return t('<p>Provides node methods to services applications. Requires services.module.</p>');
     case 'admin/modules#description':
@@ -17,9 +83,11 @@
   }
 }
 
-/*function node_service_perm() {
+/**
+  function node_service_perm() {
   return array('load raw node data');
-}*/
+  }
+ */
 
 /**
  * Implementation of hook_service().
@@ -67,7 +135,8 @@
     if ($node->nid) {
       $ret = drupal_execute($node->type .'_node_form', $edit, $edit);
     }
-  } else {
+  }
+  else {
     $ret = drupal_execute($edit['type'] .'_node_form', $edit, $edit);
   }
   if ($errors = form_get_errors()) {
@@ -78,11 +147,11 @@
   $nid = substr($ret, strpos($ret, '/')+1); 
 
 
-  $flvfile->fid = db_next_id('{files}_fid');
+  $flvfile->fid = db_last_insert_id('{files}_fid');
   $flvfile->filename = $edit['filename'];
-  $flvfile->filepath = file_directory_path() . '/' . $edit['filepath'];
+  $flvfile->filepath = file_directory_path() .'/'. $edit['filepath'];
   $flvfile->filemime = file_get_mimetype($edit['filename']);
-  $flvfile->filesize = filesize(file_directory_path() . '/' . $edit['filepath']);
+  $flvfile->filesize = filesize(file_directory_path() .'/'. $edit['filepath']);
   $flvfile->list = 0;
   $flvfile->description = $edit['filename'];
 
@@ -90,12 +159,12 @@
 
     // insert flv file reference
     $result = db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $flvfile->fid, $nid, $flvfile->filename, $flvfile->filepath, $flvfile->filemime, $flvfile->filesize);
-    $result = db_query("INSERT INTO {file_revisions} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $flvfile->fid, $nid, $flvfile->list, $flvfile->description);
+    $result = db_query("INSERT INTO {upload} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $flvfile->fid, $nid, $flvfile->list, $flvfile->description);
 
 
-    $jpgfile->fid = db_next_id('{files}_fid');
-    $jpgfile->filename = substr($edit['filename'], 0, strpos($edit['filename'], '.flv')) . '.jpg'; 
-    $jpgfile->filepath = file_directory_path() . '/' . substr($edit['filepath'], 0, strpos($edit['filepath'], '.flv')) . '.jpg';
+    $jpgfile->fid = db_last_insert_id('{files}_fid');
+    $jpgfile->filename = substr($edit['filename'], 0, strpos($edit['filename'], '.flv')) .'.jpg'; 
+    $jpgfile->filepath = file_directory_path() .'/'. substr($edit['filepath'], 0, strpos($edit['filepath'], '.flv')) .'.jpg';
     $jpgfile->filemime = file_get_mimetype($jpgfile->filename);
     $jpgfile->filesize = filesize($jpgfile->filepath);
     $jpgfile->list = 0;
@@ -103,7 +172,7 @@
 
     // insert jpg file reference (video thumbnail)
     $result = db_query("INSERT INTO {files} (fid, nid, filename, filepath, filemime, filesize) VALUES (%d, %d, '%s', '%s', '%s', %d)", $jpgfile->fid, $nid, $jpgfile->filename, $jpgfile->filepath, $jpgfile->filemime, $jpgfile->filesize);
-    $result = db_query("INSERT INTO {file_revisions} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $jpgfile->fid, $nid, $jpgfile->list, $jpgfile->description);
+    $result = db_query("INSERT INTO {upload} (fid, vid, list, description) VALUES (%d, %d, %d, '%s')", $jpgfile->fid, $nid, $jpgfile->list, $jpgfile->description);
   }
   
   if (!$result) {
@@ -113,14 +182,15 @@
   return $ret;
 }
 
-function flvnode_service_save_access($node) {
+function flvnode_service_save_access($op, $node, $account) {
   if (isset($node['nid'])) {
-    return node_access('update', $node);
+    return node_access($op , $node, $account);
   }
-  return node_access('create', $node['type']);
+  return node_access($op, $node['type'], $account);
 }
 
-/*function node_service_delete_access($nid) {
+/*
+ function node_service_delete_access($nid, $account) {
   $node = node_load($nid);
-  return node_access('delete', $node);
+  return node_access('delete', $node, $account);
 }*/
Index: videonoderecorder/videonoderecorder.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/red5flashserver/videonoderecorder/videonoderecorder.info,v
retrieving revision 1.1.2.1
diff -u -b -r1.1.2.1 videonoderecorder.info
--- videonoderecorder/videonoderecorder.info	3 Nov 2008 15:58:59 -0000	1.1.2.1
+++ videonoderecorder/videonoderecorder.info	25 Feb 2009 10:11:34 -0000
@@ -1,5 +1,11 @@
 ; $Id: videonoderecorder.info,v 1.1.2.1 2008/11/03 15:58:59 chriscar Exp $
 name = Video node recorder 
 description = Module for recording Flash video nodes using a standard webcam and the Red5 Open Source Flash Server.
-dependencies = upload services flvnode_service amfphp swftools
+dependencies[] = upload
+dependencies[] = services
+dependencies[] = flvnode_service
+dependencies[] = amfphp
+dependencies[] = swftools
 package = Red5 Flash Server
+
+core = 6.x
\ No newline at end of file
Index: videonoderecorder/videonoderecorder.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/red5flashserver/videonoderecorder/videonoderecorder.install,v
retrieving revision 1.1.2.1
diff -u -b -r1.1.2.1 videonoderecorder.install
--- videonoderecorder/videonoderecorder.install	3 Nov 2008 15:58:59 -0000	1.1.2.1
+++ videonoderecorder/videonoderecorder.install	25 Feb 2009 10:11:34 -0000
@@ -2,8 +2,16 @@
 // $Id: videonoderecorder.install,v 1.1.2.1 2008/11/03 15:58:59 chriscar Exp $
 
 /**
+ * @file
+ * Install file for video node recorder red5 int
+ */
+
+/**
  * Implementation of hook_uninstall().
  */
 function videonoderecorder_uninstall() {
+  // Remove tables.
+  drupal_uninstall_schema('videonoderecorder');
+
   db_query("DELETE from {variable} WHERE name LIKE 'videonoderecorder%'");
 }
Index: videonoderecorder/videonoderecorder.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/red5flashserver/videonoderecorder/videonoderecorder.module,v
retrieving revision 1.1.2.1
diff -u -b -r1.1.2.1 videonoderecorder.module
--- videonoderecorder/videonoderecorder.module	3 Nov 2008 15:58:59 -0000	1.1.2.1
+++ videonoderecorder/videonoderecorder.module	25 Feb 2009 10:11:34 -0000
@@ -1,12 +1,73 @@
 <?php
 // $Id: videonoderecorder.module,v 1.1.2.1 2008/11/03 15:58:59 chriscar Exp $ 
 
+/* TODO Automatically add Drupal.settings.basePath
+   In Drupal 5, you would have to add the base path to Drupal.settings yourself
+   if you needed it (it's needed for just about every AHAH/AJAX enabled module
+   if you did it right). Now in Drupal 6, it's added automatically. You can always
+   find it at Drupal.settings.basePath (actually, as soon as drupal_add_js() is
+   called at least once, so this is similar to the way we automatically add
+   drupal.js and jquery.js. */
+
+/* TODO FormAPI image buttons are now supported.
+   FormAPI now offers the 'image_button' element type, allowing developers to
+   use icons or other custom images in place of traditional HTML submit buttons.
+
+$form['my_image_button'] = array(
+  '#type'         => 'image_button',
+  '#title'        => t('My button'),
+  '#return_value' => 'my_data',
+  '#src'          => 'my/image/path.jpg',
+); */
+
+/* TODO Node previews and adding form fields to the node form.
+   There is a subtle but important difference in the way node previews (and other
+   such operations) are carried out when adding or editing a node. With the new
+   Forms API, the node form is handled as a multi-step form. When the node form
+   is previewed, all the form values are submitted, and the form is rebuilt with
+   those form values put into $form['#node']. Thus, form elements that are added
+   to the node form will lose any user input unless they set their '#default_value'
+   elements using this embedded node object. */
+
+/* TODO New user_mail_tokens() method may be useful.
+   user.module now provides a user_mail_tokens() function to return an array
+   of the tokens available for the email notification messages it sends when
+   accounts are created, activated, blocked, etc. Contributed modules that
+   wish to make use of the same tokens for their own needs are encouraged
+   to use this function. */
+
+/* TODO
+   There is a new hook_watchdog in core. This means that contributed modules
+   can implement hook_watchdog to log Drupal events to custom destinations.
+   Two core modules are included, dblog.module (formerly known as watchdog.module),
+   and syslog.module. Other modules in contrib include an emaillog.module,
+   included in the logging_alerts module. See syslog or emaillog for an
+   example on how to implement hook_watchdog.
+function example_watchdog($log = array()) {
+  if ($log['severity'] == WATCHDOG_ALERT) {
+    mysms_send($log['user']->uid,
+      $log['type'],
+      $log['message'],
+      $log['variables'],
+      $log['severity'],
+      $log['referer'],
+      $log['ip'],
+      format_date($log['timestamp']));
+  }
+} */
+
+
+
+/* TODO
+   An argument for replacements has been added to format_plural(),
+   escaping and/or theming the values just as done with t().*/
+
 /**
  * Implementation of hook_help
  */
-function videonoderecorder_help($section) { 
+function videonoderecorder_help($path, $arg) { 
 
-  switch ($section) {
+  switch ($path) {
     case 'admin/settings/webcamvideo':
       return t('Configure your Red5 Flash Server endpoint as well as the Drupal content type to record webcam videos.');
     break;
@@ -31,15 +92,15 @@
 /**
  * Implementation of hook_access.
  */
-function videonoderecorder_access($op, $node) {
-  global $user;
+function videonoderecorder_access($op, $node, $account) {
+
 
-  if ($op == 'create' && user_access('record webcam video')) {
+  if ($op == 'create' && user_access('record webcam video', $account)) {
     return TRUE;
   } 
   
   if ($op == 'update' || $op == 'delete') {
-    if (user_access('edit own webcam video') && ($user->uid == $node->uid)) {
+    if (user_access('edit own webcam video', $account) && ($account->uid == $node->uid)) {
       return TRUE;
     }
   }
@@ -48,35 +109,54 @@
 /**
  * Implementation of hook_menu().
  */
-function videonoderecorder_menu($may_cache) {
+function videonoderecorder_menu() {
 
   $items = array();
 
   // Page initializations
-  if (!$may_cache) {
-
-    $items[] = array(
-      'path' => 'node/add/webcamvideo',
-      'title' => t('Webcam Video'),
-      'callback' => 'videonoderecorder_recorder',
-      'description' => t('Record a Flash video using a standard webcam.'),
-      'access' => user_access('record webcam video'),
-    );
-
-    $items[] = array(
-      'path' => 'admin/settings/webcamvideo',
-      'title' => t('Webcam video'),
-      'callback' => 'drupal_get_form',
-      'callback arguments' => array('videonoderecorder_admin_settings'),
-      'access' => user_access('administer webcam video'),
+/* TODO
+   Non menu code that was placed in hook_menu under the '!$may_cache' block
+   so that it could be run during initialization, should now be moved to hook_init.
+   Previously we called hook_init twice, once early in the bootstrap process, second
+   just after the bootstrap has finished. The first instance is now called boot
+   instead of init.
+   
+   In Drupal 6, there are now two hooks that can be used by modules to execute code
+   at the beginning of a page request. hook_boot() replaces hook_boot() in Drupal 5
+   and runs on each page request, even for cached pages. hook_boot() now only runs
+   for non-cached pages and thus can be used for code that was previously placed in
+   hook_menu() with $may_cache = FALSE:
+   
+   Dynamic menu items under a '!$may_cache' block can often be simplified
+   to remove references to arg(n) and use of '%<function-name>' to check
+   conditions. See http://drupal.org/node/103114.
+   
+   The title and description arguments should not have strings wrapped in t(),
+   because translation of these happen in a later stage in the menu system.
+*/
+    $items['admin/settings/webcamvideo'] = array(
+      'title' => 'Webcam video',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('videonoderecorder_admin_settings'),
+      'access arguments' => array('administer webcam video'),
       'type' => MENU_NORMAL_ITEM,
-      'description' => t('Configure the webcam Flash video recorder.'),
+      'description' => 'Configure the webcam Flash video recorder.',
     );
-  }
 
   return $items;
 }
 
+function videonoderecorder_node_info() {
+  return array(
+    'videonoderecorder' => array(
+      'name' => t('Video Node'),
+      'module' => 'videonoderecorder',
+      'description' => t("A video recording node!"),
+    )
+  );
+}
+
+
 /**
  * Return recoder form name.
  */
@@ -87,13 +167,13 @@
 /**
  * Video recorder form. 
  */
-function videonoderecorder_form() {
+function videonoderecorder_form(&$node) {
 
   global $user;
   global $base_url;
 
   // js file needed for inject title into flash
-  drupal_add_js(drupal_get_path('module', 'videonoderecorder') . '/js/videonoderecorder.js');   
+  drupal_add_js(drupal_get_path('module', 'videonoderecorder') .'/js/videonoderecorder.js');   
 
   $form['help'] = array(
       '#value' => variable_get('videonoderecorder_record_helptext', t('Record a video using your webcam. To start, the Adobe Flash Player needs to have access to your webcam and microphone. Please press the Allow button.<br />Speak loud and make sure the audio level is ok. If you have more than one webcam connected, please select the one you wish to use from the Camera menu. The same applies for the microphone. You can select your Connection speed if you wish (DSL connection is recommended).')),
@@ -119,14 +199,40 @@
     //'servicesApiKey' => '5b8315a055e691e22efab0d5cb9741ef',
   );
 
-  $form['title']['#suffix'] = swf($base_url . '/' . drupal_get_path('module', 'videonoderecorder') . '/recorder/VideoNodeRecorder.swf',  array('id' => 'webcamVideoRec', 'width'=>'352', 'height'=>'344', 'bgcolor'=>'FFFFFF'), $flashvars, SWFDEFAULT, SWFDEFAULT);
+  $params = array(
+    'params' => array(
+      'id' => 'webcamVideoRec',
+      'width' => '352', 
+      'height' => '344', 
+      'bgcolor' => 'FFFFFF
+    '),
+    'flashvars' => $flashvars,
+  );
+
+  //$form['title']['#suffix'] = swf($base_url .'/'. drupal_get_path('module', 'videonoderecorder') .'/recorder/VideoNodeRecorder.swf',  array('id' => 'webcamVideoRec', 'width' => '352', 'height' => '344', 'bgcolor' => 'FFFFFF'), $flashvars, SWFDEFAULT, SWFDEFAULT);
+  $form['title']['#suffix'] = swf($base_url .'/'. drupal_get_path('module', 'videonoderecorder') .'/recorder/VideoNodeRecorder.swf', $flashvars);
 
   return $form;
 }
 
+/* TODO Implement the hook_theme registry. Combine all theme registry entries
+  into one hook_theme function in each corresponding module file. */
+/*
+function videonoderecorder_theme() {
+  return array(
+    'videonoderecorder_form' => array(
+      'file' => 'videonoderecorder.module',
+      'arguments' => array(
+        'form' => NULL,
+      ),
+    ),
+  );
+}; 
+*/
 /**
  * Theme videonoderecorder_form
  */
+/*
 function theme_videonoderecorder_form($form) {
 
   $output .= drupal_render($form['help']);
@@ -134,6 +240,7 @@
 
   return $output;
 }
+*/
 
 /**
  * Admin settings page.
