Index: page_title.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/page_title/page_title.module,v
retrieving revision 1.12.2.11
diff -u -p -r1.12.2.11 page_title.module
--- page_title.module	18 Jan 2008 12:13:50 -0000	1.12.2.11
+++ page_title.module	17 Feb 2008 09:34:40 -0000
@@ -224,7 +224,15 @@ function page_title_nodeapi(&$node, $op,
 
     case 'load':
       return array('page_title' => page_title_node_get_title($node->nid));
-
+    
+    //Load the page title for the node-edit forms
+    case 'prepare' :
+      if ($node) {
+        page_title_set_node($node);
+      }
+      break;
+    
+    //Load the page title for a node view, but ONLY if node is full page and not a teaser.  
     case 'view':
       if ($page && !$teaser) {
         page_title_set_node($node);
@@ -267,16 +275,6 @@ function page_title_get_title() {
   }
 }
 
-/**
- * Simple wrapper function to get the page type
- *
- * @return unknown
- */
-function page_title_get_type() {
-  $node = page_title_set_node();
-  return isset($node->type) ? $node->type : '';
-}
-
 
 // Public API (every module's gotta have one =)
 
@@ -312,19 +310,24 @@ function page_title_page_get_title() {
     }
     //Otherwise this is a non-frontpage page title.
     else {
-      //Get the current type for the page being displayed
-      $type = page_title_get_type();
-      
-      //Get the pattern for this type
-      $page_title_pattern = variable_get('page_title_type_' . $type, '');
+      //Get the node for this page
+      $node = page_title_set_node();
+
+      //Get the pattern for the node type. If no node type available, assume blank
+      $page_title_pattern = variable_get('page_title_type_' . (isset($node->type) ? $node->type : ''), '');
       
       //If pattern is emtpy (either if the type is not overridable or simply not set) fallback to the default pattern
       if (empty($page_title_pattern)) {
         $page_title_pattern = variable_get('page_title_default', '[page-title] | [site-name]');
       }
       
-      // Return the title
-      $title = token_replace($page_title_pattern);
+      // Return the title using the node scope if node is set, otherwise default to global scope.
+      if (isset($node)) {
+        $title = token_replace($page_title_pattern, 'node', $node);
+      }
+      else {
+        $title = token_replace($page_title_pattern);
+      }
     }
   }
   
