Revision 76bdcd04
Added by Assos Assos almost 6 years ago
drupal7/sites/all/modules/print/print.tpl.php | ||
---|---|---|
2 | 2 |
|
3 | 3 |
/** |
4 | 4 |
* @file |
5 |
* Default print module template
|
|
5 |
* Default theme implementation to display a printer-friendly version page.
|
|
6 | 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 |
|
7 | 67 |
* @ingroup print |
8 | 68 |
*/ |
9 | 69 |
?> |
10 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
11 |
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $print['language']; ?>" xml:lang="<?php print $print['language']; ?>"> |
|
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; ?>"> |
|
12 | 74 |
<head> |
13 |
<?php print $print['head']; ?> |
|
14 |
<?php print $print['base_href']; ?> |
|
15 |
<title><?php print $print['title']; ?></title> |
|
16 |
<?php print $print['scripts']; ?> |
|
17 |
<?php print $print['sendtoprinter']; ?> |
|
18 |
<?php print $print['robots_meta']; ?> |
|
19 |
<?php print $print['favicon']; ?> |
|
20 |
<?php print $print['css']; ?> |
|
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; ?> |
|
21 | 85 |
</head> |
22 | 86 |
<body> |
23 |
<?php if (!empty($print['message'])) { |
|
24 |
print '<div class="print-message">'. $print['message'] .'</div><p />'; |
|
25 |
} ?> |
|
26 |
<div class="print-logo"><?php print $print['logo']; ?></div> |
|
27 |
<div class="print-site_name"><?php print $print['site_name']; ?></div> |
|
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> |
|
28 | 94 |
<p /> |
29 |
<div class="print-breadcrumb"><?php print $print['breadcrumb']; ?></div>
|
|
95 |
<div class="print-breadcrumb"><?php print theme('print_breadcrumb', array('node' => $node)); ?></div>
|
|
30 | 96 |
<hr class="print-hr" /> |
31 |
<div class="print-content"><?php print $print['content']; ?></div> |
|
32 |
<div class="print-footer"><?php print $print['footer_message']; ?></div> |
|
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> |
|
33 | 102 |
<hr class="print-hr" /> |
34 |
<div class="print-source_url"><?php print $print['source_url']; ?></div> |
|
35 |
<div class="print-links"><?php print $print['pfp_links']; ?></div> |
|
36 |
<?php print $print['footer_scripts']; ?> |
|
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; ?> |
|
37 | 110 |
</body> |
38 | 111 |
</html> |
Also available in: Unified diff
Weekly update of contrib modules