#206670 by keith.smith and myself: node type names have their underscores converted to hyphens in node/add links

6.x
Gábor Hojtsy 2008-01-07 13:18:40 +00:00
parent 444c5e16be
commit 19619d9354
2 changed files with 2 additions and 2 deletions

View File

@ -675,7 +675,7 @@ function template_preprocess_forums(&$variables) {
if (node_access('create', $type)) {
// Fetch the "General" name of the content type;
// Push the link with title and url to the array.
$forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => "node/add/$type/$variables[tid]");
$forum_types[$type] = array('title' => t('Post new @node_type', array('@node_type' => node_get_types('name', $type))), 'href' => 'node/add/'. str_replace('_', '-', $type) .'/'. $variables[tid]);
}
}

View File

@ -47,7 +47,7 @@ function translation_node_overview($node) {
// No such translation in the set yet: help user to create it.
$title = t('n/a');
if (node_access('create', $node)) {
$options[] = l(t('add translation'), 'node/add/'. $node->type, array('query' => "translation=$node->nid&language=$language->language"));
$options[] = l(t('add translation'), 'node/add/'. str_replace('_', '-', $node->type), array('query' => "translation=$node->nid&language=$language->language"));
}
$status = t('Not translated');
}