/[drupal]/contributions/modules/flag/flag.inc
ViewVC logotype

Diff of /contributions/modules/flag/flag.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.30.2.16, Wed Oct 28 02:38:10 2009 UTC revision 1.1.2.30.2.17, Tue Nov 3 03:09:05 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: flag.inc,v 1.1.2.30.2.15 2009/10/28 01:47:33 quicksketch Exp $  // $Id: flag.inc,v 1.1.2.30.2.16 2009/10/28 02:38:10 quicksketch Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 1184  class flag_node extends flag_flag { Line 1184  class flag_node extends flag_flag {
1184    }    }
1185    
1186    function replace_tokens($label, $contexts, $content_id) {    function replace_tokens($label, $contexts, $content_id) {
1187      if ($content_id && ($node = $this->fetch_content($content_id))) {      if (is_numeric($content_id) && ($node = $this->fetch_content($content_id))) {
1188        $contexts['node'] = $node;        $contexts['node'] = $node;
1189      }      }
1190        // Nodes accept the node-type as a $content_id in the case that a new node
1191        // is being created and a full node object does not yet exist.
1192        elseif (!empty($content_id) && ($type = node_get_types('type', $content_id))) {
1193          $content_id = NULL;
1194          $contexts['node'] = (object) array(
1195            'nid' => NULL,
1196            'type' => $type->type,
1197            'title' => '',
1198          );
1199        }
1200      return parent::replace_tokens($label, $contexts, $content_id);      return parent::replace_tokens($label, $contexts, $content_id);
1201    }    }
1202    

Legend:
Removed from v.1.1.2.30.2.16  
changed lines
  Added in v.1.1.2.30.2.17

  ViewVC Help
Powered by ViewVC 1.1.2