root / drupal7 / sites / all / modules / print / print.tpl.php @ 76bdcd04
1 |
<?php
|
---|---|
2 |
|
3 |
/**
|
4 |
* @file
|
5 |
* Default theme implementation to display a printer-friendly version page.
|
6 |
*
|
7 |
* This file is akin to Drupal's page.tpl.php template. The contents being
|
8 |
* displayed are all included in the $content variable, while the rest of the
|
9 |
* template focuses on positioning and theming the other page elements.
|
10 |
*
|
11 |
* All the variables available in the page.tpl.php template should also be
|
12 |
* available in this template. In addition to those, the following variables
|
13 |
* defined by the print module(s) are available:
|
14 |
*
|
15 |
* Arguments to the theme call:
|
16 |
* - $node: The node object. For node content, this is a normal node object.
|
17 |
* For system-generated pages, this contains usually only the title, path
|
18 |
* and content elements.
|
19 |
* - $format: The output format being used ('html' for the Web version, 'mail'
|
20 |
* for the send by email, 'pdf' for the PDF version, etc.).
|
21 |
* - $expand_css: TRUE if the CSS used in the file should be provided as text
|
22 |
* instead of a list of @include directives.
|
23 |
* - $message: The message included in the send by email version with the
|
24 |
* text provided by the sender of the email.
|
25 |
*
|
26 |
* Variables created in the preprocess stage:
|
27 |
* - $print_logo: the image tag with the configured logo image.
|
28 |
* - $content: the rendered HTML of the node content.
|
29 |
* - $scripts: the HTML used to include the JavaScript files in the page head.
|
30 |
* - $footer_scripts: the HTML to include the JavaScript files in the page
|
31 |
* footer.
|
32 |
* - $sourceurl_enabled: TRUE if the source URL infromation should be
|
33 |
* displayed.
|
34 |
* - $url: absolute URL of the original source page.
|
35 |
* - $source_url: absolute URL of the original source page, either as an alias
|
36 |
* or as a system path, as configured by the user.
|
37 |
* - $cid: comment ID of the node being displayed.
|
38 |
* - $print_title: the title of the page.
|
39 |
* - $head: HTML contents of the head tag, provided by drupal_get_html_head().
|
40 |
* - $robots_meta: meta tag with the configured robots directives.
|
41 |
* - $css: the syle tags contaning the list of include directives or the full
|
42 |
* text of the files for inline CSS use.
|
43 |
* - $sendtoprinter: depending on configuration, this is the script tag
|
44 |
* including the JavaScript to send the page to the printer and to close the
|
45 |
* window afterwards.
|
46 |
*
|
47 |
* print[--format][--node--content-type[--nodeid]].tpl.php
|
48 |
*
|
49 |
* The following suggestions can be used:
|
50 |
* 1. print--format--node--content-type--nodeid.tpl.php
|
51 |
* 2. print--format--node--content-type.tpl.php
|
52 |
* 3. print--format.tpl.php
|
53 |
* 4. print--node--content-type--nodeid.tpl.php
|
54 |
* 5. print--node--content-type.tpl.php
|
55 |
* 6. print.tpl.php
|
56 |
*
|
57 |
* Where format is the ouput format being used, content-type is the node's
|
58 |
* content type and nodeid is the node's identifier (nid).
|
59 |
*
|
60 |
* @see print_preprocess_print()
|
61 |
* @see theme_print_published
|
62 |
* @see theme_print_breadcrumb
|
63 |
* @see theme_print_footer
|
64 |
* @see theme_print_sourceurl
|
65 |
* @see theme_print_url_list
|
66 |
* @see page.tpl.php
|
67 |
* @ingroup print
|
68 |
*/
|
69 |
?>
|
70 |
|
71 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
|
72 |
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
|
73 |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" version="XHTML+RDFa 1.0" dir="<?php print $language->dir; ?>"> |
74 |
<head>
|
75 |
<?php print $head; ?> |
76 |
<base href='<?php print $url ?>' /> |
77 |
<title><?php print $print_title; ?></title> |
78 |
<?php print $scripts; ?> |
79 |
<?php if (isset($sendtoprinter)) print $sendtoprinter; ?> |
80 |
<?php print $robots_meta; ?> |
81 |
<?php if (theme_get_setting('toggle_favicon')): ?> |
82 |
<link rel='shortcut icon' href='<?php print theme_get_setting('favicon') ?>' type='image/x-icon' /> |
83 |
<?php endif; ?> |
84 |
<?php print $css; ?> |
85 |
</head>
|
86 |
<body>
|
87 |
<?php if (!empty($message)): ?> |
88 |
<div class="print-message"><?php print $message; ?></div><p /> |
89 |
<?php endif; ?> |
90 |
<?php if ($print_logo): ?> |
91 |
<div class="print-logo"><?php print $print_logo; ?></div> |
92 |
<?php endif; ?> |
93 |
<div class="print-site_name"><?php print theme('print_published'); ?></div> |
94 |
<p /> |
95 |
<div class="print-breadcrumb"><?php print theme('print_breadcrumb', array('node' => $node)); ?></div> |
96 |
<hr class="print-hr" /> |
97 |
<?php if (!isset($node->type)): ?> |
98 |
<h2 class="print-title"><?php print $print_title; ?></h2> |
99 |
<?php endif; ?> |
100 |
<div class="print-content"><?php print $content; ?></div> |
101 |
<div class="print-footer"><?php print theme('print_footer'); ?></div> |
102 |
<hr class="print-hr" /> |
103 |
<?php if ($sourceurl_enabled): ?> |
104 |
<div class="print-source_url"> |
105 |
<?php print theme('print_sourceurl', array('url' => $source_url, 'node' => $node, 'cid' => $cid)); ?> |
106 |
</div>
|
107 |
<?php endif; ?> |
108 |
<div class="print-links"><?php print theme('print_url_list'); ?></div> |
109 |
<?php print $footer_scripts; ?> |
110 |
</body>
|
111 |
</html>
|