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
8f1255a3
Commit
8f1255a3
authored
Aug 15, 2006
by
drumm
Browse files
#78549
by beginner, test for function existence instead of module existence.
parent
937f9099
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/node/content_types.inc
View file @
8f1255a3
...
...
@@ -17,7 +17,7 @@ function node_overview_types() {
foreach
(
$names
as
$key
=>
$name
)
{
$type
=
$types
[
$key
];
if
(
module
_exist
(
$type
->
module
))
{
if
(
function
_exist
s
(
$type
->
module
.
'_form'
))
{
$name
=
check_plain
(
$name
);
$type_url_str
=
str_replace
(
'_'
,
'-'
,
$type
->
type
);
// Populate the operations field.
...
...
modules/node/node.module
View file @
8f1255a3
...
...
@@ -1062,7 +1062,7 @@ function node_menu($may_cache) {
'type'
=>
MENU_CALLBACK
);
foreach
(
node_get_types
()
as
$type
)
{
if
(
module
_exist
(
$type
->
module
))
{
if
(
function
_exist
s
(
$type
->
module
.
'_form'
))
{
$name
=
check_plain
(
$type
->
name
);
$type_url_str
=
str_replace
(
'_'
,
'-'
,
$type
->
type
);
$items
[]
=
array
(
...
...
@@ -2010,7 +2010,7 @@ function node_add($type) {
else
{
// If no (valid) node type has been provided, display a node type overview.
foreach
(
$types
as
$type
)
{
if
(
module
_exist
(
$type
->
module
)
&&
node_access
(
'create'
,
$type
->
type
))
{
if
(
function
_exist
s
(
$type
->
module
.
'_form'
)
&&
node_access
(
'create'
,
$type
->
type
))
{
$type_url_str
=
str_replace
(
'_'
,
'-'
,
$type
->
type
);
$title
=
t
(
'Add a new %s.'
,
array
(
'%s'
=>
check_plain
(
$type
->
name
)));
$out
=
'<dt>'
.
l
(
$type
->
name
,
"node/add/
$type_url_str
"
,
array
(
'title'
=>
$title
))
.
'</dt>'
;
...
...
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