### Eclipse Workspace Patch 1.0
#P Auto_Nodetitle6_CVS
Index: auto_nodetitle.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/auto_nodetitle/Attic/auto_nodetitle.module,v
retrieving revision 1.20.2.3
diff -u -r1.20.2.3 auto_nodetitle.module
--- auto_nodetitle.module	30 Dec 2008 20:28:26 -0000	1.20.2.3
+++ auto_nodetitle.module	17 Jan 2009 22:15:29 -0000
@@ -86,6 +86,34 @@
 }
 
 /**
+* Implementation of hook_node_operations().
+*/
+function auto_nodetitle_node_operations() {
+  $operations = array(
+    'nodetitle_update' => array(
+      'label' => t('Update automatic Nodetitles'),
+      'callback' => 'auto_nodetitle_operations_update',
+    ),
+  );
+  return $operations;
+}
+
+/**
+* Callback function for updating node titles.
+*/
+function auto_nodetitle_operations_update($nodes) {
+  foreach ($nodes as $nid) {
+    $node = node_load($nid);
+    $nodetitle_save = $node->title;
+    auto_nodetitle_set_title($node);
+    if ($node->title != $nodetitle_save) {
+      //only save if the title has actually changed
+      node_save($node);
+    }
+  }
+}
+
+/**
   * Helper function to generate the title according to the PHP code.
   * Right now its only a wrapper, but if this is to be expanded, here is the place to be.
   * @return a title string
