Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f46a82da
Commit
f46a82da
authored
Oct 29, 2004
by
Steven Wittens
Browse files
#7607
: Sort node types in node/add by translated names.
parent
3e406e8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/node.module
View file @
f46a82da
...
...
@@ -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
;
...
...
modules/node/node.module
View file @
f46a82da
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment