summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2004-10-29 00:51:49 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2004-10-29 00:51:49 +0000
commitf46a82da51947f0b3deec4eff44d307b9cf04324 (patch)
tree65633c76a21e224b4b932e4b7570e7ebf53d5f76 /modules
parent3e406e8f4094498233b56fdf77135f0c00a33189 (diff)
downloadbrdo-f46a82da51947f0b3deec4eff44d307b9cf04324.tar.gz
brdo-f46a82da51947f0b3deec4eff44d307b9cf04324.tar.bz2
#7607: Sort node types in node/add by translated names.
Diffstat (limited to 'modules')
-rw-r--r--modules/node.module17
-rw-r--r--modules/node/node.module17
2 files changed, 24 insertions, 10 deletions
diff --git a/modules/node.module b/modules/node.module
index f0d881f72..59ab672be 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -1256,14 +1256,21 @@ function node_add($type) {
// If no (valid) node type has been provided, display a node type overview.
foreach (node_list() as $type) {
if (node_access('create', $type)) {
- $output .= '<li>';
- $output .= ' '. l(node_invoke($type, 'node_name'), 'node/add/'. $type, array('title' => t('Add a new %s.', array('%s' => node_invoke($type, 'node_name')))));
- $output .= ' <div style="margin-left: 20px;">'. implode("\n", module_invoke_all('help', 'node/add#'. $type)) .'</div>';
- $output .= '</li>';
+ $out = '<li>';
+ $out .= ' '. l(node_invoke($type, 'node_name'), "node/add/$type", array('title' => t('Add a new %s.', array('%s' => node_invoke($type, 'node_name')))));
+ $out .= " <div style=\"margin-left: 20px;\">". implode("\n", module_invoke_all('help', 'node/add#'. $type)) .'</div>';
+ $out .= '</li>';
+ $item[node_invoke($type, 'node_name')] = $out;
}
}
- $output = t('Choose the appropriate item from the list:') .'<ul>'. $output .'</ul>';
+ if (isset($item)) {
+ ksort($item);
+ $output = t('Choose the appropriate item from the list:') .'<ul>'. implode('', $item) .'</ul>';
+ }
+ else {
+ $output = message_access();
+ }
}
return $output;
diff --git a/modules/node/node.module b/modules/node/node.module
index f0d881f72..59ab672be 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -1256,14 +1256,21 @@ function node_add($type) {
// If no (valid) node type has been provided, display a node type overview.
foreach (node_list() as $type) {
if (node_access('create', $type)) {
- $output .= '<li>';
- $output .= ' '. l(node_invoke($type, 'node_name'), 'node/add/'. $type, array('title' => t('Add a new %s.', array('%s' => node_invoke($type, 'node_name')))));
- $output .= ' <div style="margin-left: 20px;">'. implode("\n", module_invoke_all('help', 'node/add#'. $type)) .'</div>';
- $output .= '</li>';
+ $out = '<li>';
+ $out .= ' '. l(node_invoke($type, 'node_name'), "node/add/$type", array('title' => t('Add a new %s.', array('%s' => node_invoke($type, 'node_name')))));
+ $out .= " <div style=\"margin-left: 20px;\">". implode("\n", module_invoke_all('help', 'node/add#'. $type)) .'</div>';
+ $out .= '</li>';
+ $item[node_invoke($type, 'node_name')] = $out;
}
}
- $output = t('Choose the appropriate item from the list:') .'<ul>'. $output .'</ul>';
+ if (isset($item)) {
+ ksort($item);
+ $output = t('Choose the appropriate item from the list:') .'<ul>'. implode('', $item) .'</ul>';
+ }
+ else {
+ $output = message_access();
+ }
}
return $output;