Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
InsertNode
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
InsertNode
Commits
365aa6ab
Commit
365aa6ab
authored
15 years ago
by
AlexisWilke
Browse files
Options
Downloads
Patches
Plain Diff
* Added support for the webform module.
parent
9bc4c9d4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
InsertNode.module
+6
-0
6 additions, 0 deletions
InsertNode.module
InsertNode.pages.inc
+44
-18
44 additions, 18 deletions
InsertNode.pages.inc
with
50 additions
and
18 deletions
InsertNode.module
+
6
−
0
View file @
365aa6ab
...
...
@@ -206,6 +206,12 @@ function InsertNode_theme() {
),
'file'
=>
'InsertNode.pages.inc'
,
),
'InsertNode_webform'
=>
array
(
'arguments'
=>
array
(
'node'
=>
NULL
,
),
'file'
=>
'InsertNode.pages.inc'
,
),
);
}
...
...
This diff is collapsed.
Click to expand it.
InsertNode.pages.inc
+
44
−
18
View file @
365aa6ab
...
...
@@ -180,7 +180,8 @@ function _InsertNode_replacer($matches) {
case
'cckteaser'
:
$show_teaser
=
TRUE
;
case
'cck'
:
if
(
$p
==
'body'
)
{
switch
(
$p
)
{
case
'body'
:
// the user wants to see the body as is (without decorations)
$body
=
str_replace
(
'<!--break-->'
,
''
,
$node
->
body
);
$output
.
=
check_markup
(
$body
,
$node
->
format
,
FALSE
);
...
...
@@ -188,20 +189,23 @@ function _InsertNode_replacer($matches) {
// we want to make sure that the default doesn't get inserted
$output
=
' '
;
}
}
elseif
(
$p
==
'teaser'
)
{
break
;
case
'teaser'
:
// the user wants to see the teaser as is (without decorations)
$output
.
=
check_markup
(
$node
->
teaser
,
$node
->
format
,
FALSE
);
if
(
!
$output
)
{
// we want to make sure that the default doesn't get inserted
$output
=
' '
;
}
}
elseif
(
$p
==
'title'
)
{
break
;
case
'title'
:
// the user wants to see the title as is (without H3)
$output
.
=
check_plain
(
$node
->
title
);
}
elseif
(
$p
==
'book_children'
)
{
break
;
case
'book_children'
:
if
(
$node
->
book
)
{
$output
.
=
theme
(
'InsertNode_book_children'
,
$node
->
book
);
}
...
...
@@ -209,8 +213,9 @@ function _InsertNode_replacer($matches) {
// we want to make sure that the default doesn't get inserted
$output
=
' '
;
}
}
elseif
(
$p
==
'book_navigation'
)
{
break
;
case
'book_navigation'
:
if
(
$node
->
book
)
{
$output
.
=
theme
(
'book_navigation'
,
$node
->
book
);
}
...
...
@@ -218,16 +223,27 @@ function _InsertNode_replacer($matches) {
// we want to make sure that the default doesn't get inserted
$output
=
' '
;
}
}
elseif
(
module_exists
(
'content'
))
{
// the content module is optional
// add the CCK content (Note: CCK permissions == Node permissions)
$field
=
content_fields
(
$p
);
if
(
is_array
(
$field
))
{
$output
.
=
content_view_field
(
$field
,
$node
,
$show_teaser
,
FALSE
);
break
;
case
'webform'
:
if
(
$node
->
webform
)
{
theme
(
'webform'
,
$node
);
}
}
else
{
$comments
.
=
"<em>"
.
t
(
"Cannot find the 'content' (or CCK) module! <a href=
\"
/admin/build/modules
\"
>Was it selected</a>?"
)
.
"</em>"
;
break
;
default
:
if
(
module_exists
(
'content'
))
{
// the content module is optional
// add the CCK content (Note: CCK permissions == Node permissions)
$field
=
content_fields
(
$p
);
if
(
is_array
(
$field
))
{
$output
.
=
content_view_field
(
$field
,
$node
,
$show_teaser
,
FALSE
);
}
}
else
{
$comments
.
=
"<em>"
.
t
(
"Cannot find the 'content' (or CCK) module! <a href=
\"
/admin/build/modules
\"
>Was it selected</a>?"
)
.
"</em>"
;
}
break
;
}
$show_teaser
=
FALSE
;
break
;
...
...
@@ -555,6 +571,16 @@ function theme_InsertNode_node($node, $output, $insert_node_count) {
return
'<span'
.
$classes
.
'>'
.
$output
.
'</span>'
;
}
/**
* Use this theme by default when no other option was specified (and thus
* the output is still empty after we're done with the user options.)
*
* By default, this is similar to the theme_InsertNode_content() function.
*/
function
theme_InsertNode_webform
(
$node
)
{
return
'<div class="insert-webform-content">'
.
webform_view
(
$node
,
FALSE
,
TRUE
)
.
'</div>'
;
}
/**
* Process variables for InsertNode-book-children.tpl.php.
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment