Use project or organization logo image for printing
This commit is contained in:
parent
39339da278
commit
a6559e5149
3 changed files with 31 additions and 0 deletions
|
@ -68,6 +68,9 @@ $conf = array(
|
||||||
# 'social_linkedin' => 'http://linkedin.com/in/username',
|
# 'social_linkedin' => 'http://linkedin.com/in/username',
|
||||||
# 'social_contact' => 'http://www.example.com/contact',
|
# 'social_contact' => 'http://www.example.com/contact',
|
||||||
|
|
||||||
|
// Use project or organization logo image for printing:
|
||||||
|
# 'print_logo_aux' => 1,
|
||||||
|
|
||||||
// Reverse proxy:
|
// Reverse proxy:
|
||||||
# 'reverse_proxy' => TRUE,
|
# 'reverse_proxy' => TRUE,
|
||||||
# 'reverse_proxy_addresses' => array('a.b.c.d', ...),
|
# 'reverse_proxy_addresses' => array('a.b.c.d', ...),
|
||||||
|
|
|
@ -9,6 +9,9 @@
|
||||||
/*
|
/*
|
||||||
* Global styles.
|
* Global styles.
|
||||||
*/
|
*/
|
||||||
|
img.print-logo {
|
||||||
|
max-height: 120px;
|
||||||
|
}
|
||||||
body.print-body .form-control {
|
body.print-body .form-control {
|
||||||
border: 0;
|
border: 0;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
|
|
@ -28,6 +28,31 @@
|
||||||
print '<div class="print-message">'. $print['message'] .'</div>';
|
print '<div class="print-message">'. $print['message'] .'</div>';
|
||||||
} ?>
|
} ?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
if (!empty($conf['print_logo_aux']) && $conf['print_logo_aux']) {
|
||||||
|
if ($print['node']->type == 'stormorganization' || $print['node']->type == 'stormproject') {
|
||||||
|
$nid = $print['node']->nid;
|
||||||
|
} elseif (!empty($print['node']->project_nid)) {
|
||||||
|
$nid = $print['node']->project_nid;
|
||||||
|
} elseif (!empty($print['node']->organization_nid)) {
|
||||||
|
$nid = $print['node']->organization_nid;
|
||||||
|
}
|
||||||
|
if (!empty($nid)) {
|
||||||
|
$node = node_load($nid);
|
||||||
|
if ($node->type == 'stormorganization' && !empty($node->field_stormorganization_image[0]['filename'])) {
|
||||||
|
$img = 'organizations/' . $node->field_stormorganization_image[0]['filename'];
|
||||||
|
}
|
||||||
|
elseif (!empty($node->field_stormproject_image[0]['filename'])) {
|
||||||
|
$img = 'projects/' . $node->field_stormproject_image[0]['filename'];
|
||||||
|
}
|
||||||
|
if (!empty($img)) {
|
||||||
|
$lang = $print['language'] != 'es' ? '/' . $print['language'] : '';
|
||||||
|
$print['logo'] = '<img src="' . "$lang/system/files/$img" . '" alt="' . $node->title . '" class="print-logo" id="logo" />';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} ?>
|
||||||
<div class="print-logo"><?php print $print['logo']; ?></div>
|
<div class="print-logo"><?php print $print['logo']; ?></div>
|
||||||
|
|
||||||
<hr class="print-hr" />
|
<hr class="print-hr" />
|
||||||
|
|
Reference in a new issue