| 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 |
| 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 |
|
|