| 1 |
<?php |
<?php |
| 2 |
// $Id: page_title.module,v 1.18.2.14 2009/06/17 14:24:39 njt1982 Exp $ |
// $Id: page_title.module,v 1.18.2.15 2009/06/17 15:03:07 njt1982 Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 316 |
$title = check_plain(strip_tags($term_title)); |
$title = check_plain(strip_tags($term_title)); |
| 317 |
} |
} |
| 318 |
} |
} |
| 319 |
|
// If we're looking at a taxonomy term page, get the term title |
| 320 |
|
elseif (arg(0) == 'forum' && is_numeric(arg(1)) && module_exists('forum')) { |
| 321 |
|
$term = taxonomy_get_term(arg(1)); |
| 322 |
|
if (variable_get('page_title_vocab_'. $term->vid .'_showfield', 0) && ($term_title = page_title_load_title($term->tid, 'term'))) { |
| 323 |
|
$title = check_plain(strip_tags($term_title)); |
| 324 |
|
} |
| 325 |
|
} |
| 326 |
|
|
| 327 |
// If nothing above set a title, give the legacy function a chance to act |
// If nothing above set a title, give the legacy function a chance to act |
| 328 |
if (empty($title)) { |
if (empty($title)) { |
| 420 |
// Node (either node or comment reply) |
// Node (either node or comment reply) |
| 421 |
if ((arg(0) == 'node' && is_numeric(arg(1))) || (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2)) && module_exists('comment')) ) { |
if ((arg(0) == 'node' && is_numeric(arg(1))) || (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2)) && module_exists('comment')) ) { |
| 422 |
$types['node'] = menu_get_object(); |
$types['node'] = menu_get_object(); |
| 423 |
|
// If the node has any taxonomy, grab the first time and pass it over to be passed as a token. |
| 424 |
|
// TODO: Handle multiple terms? Only pass specific terms per content type? |
| 425 |
|
if (!empty($types['node']->taxonomy)) { |
| 426 |
|
$types['taxonomy'] = current($types['node']->taxonomy); |
| 427 |
|
} |
| 428 |
$page_title_pattern = variable_get('page_title_type_'. $types['node']->type, ''); |
$page_title_pattern = variable_get('page_title_type_'. $types['node']->type, ''); |
| 429 |
} |
} |
| 430 |
// Term |
// Term |
| 432 |
$types['taxonomy'] = taxonomy_get_term(arg(2)); |
$types['taxonomy'] = taxonomy_get_term(arg(2)); |
| 433 |
$page_title_pattern = variable_get('page_title_vocab_'. $types['taxonomy']->vid, ''); |
$page_title_pattern = variable_get('page_title_vocab_'. $types['taxonomy']->vid, ''); |
| 434 |
} |
} |
| 435 |
|
// Forum |
| 436 |
|
elseif (arg(0) == 'forum' && is_numeric(arg(1)) && module_exists('forum')) { |
| 437 |
|
$types['taxonomy'] = taxonomy_get_term(arg(1)); |
| 438 |
|
$page_title_pattern = variable_get('page_title_vocab_'. $types['taxonomy']->vid, ''); |
| 439 |
|
} |
| 440 |
// User |
// User |
| 441 |
elseif (arg(0) == 'user' && is_numeric(arg(1))) { |
elseif (arg(0) == 'user' && is_numeric(arg(1))) { |
| 442 |
$types['user'] = user_load(array('uid' => arg(1))); |
$types['user'] = user_load(array('uid' => arg(1))); |