Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
306
Merge Requests
306
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
b8594062
Commit
b8594062
authored
Jun 25, 2006
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#69151
by flanker: make exported book pages themeable.
parent
7ced1e69
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
34 deletions
+20
-34
modules/book.module
modules/book.module
+10
-17
modules/book/book.module
modules/book/book.module
+10
-17
No files found.
modules/book.module
View file @
b8594062
...
...
@@ -687,30 +687,23 @@ function book_export($type = 'html', $nid = 0) {
* - an integer representing the node id (nid) of the node to export
* @param depth
* - an integer giving the depth in the book hierarchy of the node
which is to be exported
* which is to be exported
*
* @return
* - string containing HTML representing the node and its children in
the book hierarchy
*
the book hierarchy
*/
function
book_export_html
(
$nid
,
$depth
)
{
if
(
user_access
(
'see printer-friendly version'
))
{
global
$base_url
;
$node
=
node_load
(
$nid
)
;
for
(
$i
=
1
;
$i
<
$depth
;
$i
++
)
{
$
outpu
t
.
=
"<div class=
\"
section-
$i
\"
>
\n
"
;
$
conten
t
.
=
"<div class=
\"
section-
$i
\"
>
\n
"
;
}
$
outpu
t
.
=
book_recurse
(
$nid
,
$depth
,
'book_node_visitor_html_pre'
,
'book_node_visitor_html_post'
);
$
conten
t
.
=
book_recurse
(
$nid
,
$depth
,
'book_node_visitor_html_pre'
,
'book_node_visitor_html_post'
);
for
(
$i
=
1
;
$i
<
$depth
;
$i
++
)
{
$output
.
=
"</div>
\n
"
;
$content
.
=
"</div>
\n
"
;
}
$html
=
"<!DOCTYPE html PUBLIC
\"
-//W3C//DTD XHTML 1.0 Transitional//EN
\"
\"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
\"
>
\n
"
;
$html
.
=
'<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'
;
$html
.
=
"<head>
\n
<title>"
.
check_plain
(
$node
->
title
)
.
"</title>
\n
"
;
$html
.
=
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
;
$html
.
=
'<base href="'
.
$base_url
.
'/" />'
.
"
\n
"
;
$html
.
=
"<style type=
\"
text/css
\"
>
\n
@import url(misc/print.css);
\n
</style>
\n
"
;
$html
.
=
"</head>
\n
<body>
\n
"
.
$output
.
"
\n
</body>
\n
</html>
\n
"
;
return
$html
;
return
theme
(
'book_export_html'
,
check_plain
(
$node
->
title
),
$content
);
}
else
{
drupal_access_denied
();
...
...
modules/book/book.module
View file @
b8594062
...
...
@@ -687,30 +687,23 @@ function book_export($type = 'html', $nid = 0) {
* - an integer representing the node id (nid) of the node to export
* @param depth
* - an integer giving the depth in the book hierarchy of the node
which is to be exported
* which is to be exported
*
* @return
* - string containing HTML representing the node and its children in
the book hierarchy
*
the book hierarchy
*/
function
book_export_html
(
$nid
,
$depth
)
{
if
(
user_access
(
'see printer-friendly version'
))
{
global
$base_url
;
$node
=
node_load
(
$nid
)
;
for
(
$i
=
1
;
$i
<
$depth
;
$i
++
)
{
$
outpu
t
.
=
"<div class=
\"
section-
$i
\"
>
\n
"
;
$
conten
t
.
=
"<div class=
\"
section-
$i
\"
>
\n
"
;
}
$
outpu
t
.
=
book_recurse
(
$nid
,
$depth
,
'book_node_visitor_html_pre'
,
'book_node_visitor_html_post'
);
$
conten
t
.
=
book_recurse
(
$nid
,
$depth
,
'book_node_visitor_html_pre'
,
'book_node_visitor_html_post'
);
for
(
$i
=
1
;
$i
<
$depth
;
$i
++
)
{
$output
.
=
"</div>
\n
"
;
$content
.
=
"</div>
\n
"
;
}
$html
=
"<!DOCTYPE html PUBLIC
\"
-//W3C//DTD XHTML 1.0 Transitional//EN
\"
\"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
\"
>
\n
"
;
$html
.
=
'<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'
;
$html
.
=
"<head>
\n
<title>"
.
check_plain
(
$node
->
title
)
.
"</title>
\n
"
;
$html
.
=
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'
;
$html
.
=
'<base href="'
.
$base_url
.
'/" />'
.
"
\n
"
;
$html
.
=
"<style type=
\"
text/css
\"
>
\n
@import url(misc/print.css);
\n
</style>
\n
"
;
$html
.
=
"</head>
\n
<body>
\n
"
.
$output
.
"
\n
</body>
\n
</html>
\n
"
;
return
$html
;
return
theme
(
'book_export_html'
,
check_plain
(
$node
->
title
),
$content
);
}
else
{
drupal_access_denied
();
...
...
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