summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2010-10-11 13:09:23 (GMT)
committer Joao Ventura2010-10-11 13:09:23 (GMT)
commitd3399ce324c1d657beaabc283e239ccd34cc3288 (patch)
tree2aecd272b7c514c645c34ed5fd7ef095119b2071
parent265b5f480db6296275492712af65bdb2e7363b46 (diff)
Use the node.tpl.php template for now
-rw-r--r--print.admin.inc8
-rw-r--r--print.install2
-rw-r--r--print.module16
-rw-r--r--print.pages.inc33
-rw-r--r--print.tpl.php3
5 files changed, 16 insertions, 46 deletions
diff --git a/print.admin.inc b/print.admin.inc
index 46ffb0e..9d09306 100644
--- a/print.admin.inc
+++ b/print.admin.inc
@@ -364,14 +364,6 @@ function print_main_strings_settings() {
'#type' => 'textfield',
'#default_value' => variable_get('print_text_published', t('Published on %site_name')),
);
- $form['print_main_text']['print_text_by'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('print_text_by', t('By %author')),
- );
- $form['print_main_text']['print_text_created'] = array(
- '#type' => 'textfield',
- '#default_value' => variable_get('print_text_created', t('Created %date')),
- );
$form['print_main_text']['print_text_source_url'] = array(
'#type' => 'textfield',
'#default_value' => variable_get('print_text_source_url', t('Source URL')),
diff --git a/print.install b/print.install
index db7a3f9..5f1f156 100644
--- a/print.install
+++ b/print.install
@@ -71,8 +71,6 @@ function print_uninstall() {
variable_del('print_footer_user');
variable_del('print_html_link_text');
variable_del('print_html_link_use_alias');
- variable_del('print_text_by');
- variable_del('print_text_created');
variable_del('print_text_links');
variable_del('print_text_published');
variable_del('print_text_retrieved');
diff --git a/print.module b/print.module
index 6767223..1ff56e0 100644
--- a/print.module
+++ b/print.module
@@ -111,11 +111,12 @@ function print_theme() {
),
'print_node' => array(
'variables' => array('node' => NULL, 'teaser' => FALSE, 'page' => FALSE, 'type' => PRINT_HTML_FORMAT),
+ 'render element' => 'elements',
'template' => 'print_node',
- 'base hook' => 'node',
),
'print' => array(
'variables' => array('print' => array(), 'type' => PRINT_HTML_FORMAT, 'node' => NULL),
+ 'render element' => 'page',
'template' => 'print',
),
);
@@ -125,14 +126,15 @@ function print_theme() {
* Implements hook_preprocess_HOOK().
*/
function print_preprocess_print_node(&$variables) {
- $format = $variables['type'];
+ $variables['node'] = $variables['elements']['#node'];
$type = $variables['node']->type;
+// $format = $variables['type'];
template_preprocess_node($variables);
$variables['theme_hook_suggestions'][] = "node";
- $variables['theme_hook_suggestions'][] = "node__$type";
+ $variables['theme_hook_suggestions'][] = "node__{$type}";
$variables['theme_hook_suggestions'][] = "print_node";
- $variables['theme_hook_suggestions'][] = "print_node_$format";
- $variables['theme_hook_suggestions'][] = "print_node_$format.node__$type";
+// $variables['theme_hook_suggestions'][] = "print_node_{$format}";
+// $variables['theme_hook_suggestions'][] = "print_node_{$format}.node__{$type}";
}
/**
@@ -150,9 +152,9 @@ function print_preprocess_print(&$variables) {
$type = '';
}
$variables['theme_hook_suggestions'][] = "print";
- $variables['theme_hook_suggestions'][] = "print__node_{$type}";
+ $variables['theme_hook_suggestions'][] = "print__node__{$type}";
$variables['theme_hook_suggestions'][] = "print__{$format}";
- $variables['theme_hook_suggestions'][] = "print__{$format}_node_{$type}";
+ $variables['theme_hook_suggestions'][] = "print__{$format}__node__{$type}";
}
/**
diff --git a/print.pages.inc b/print.pages.inc
index fa6c674..94072a3 100644
--- a/print.pages.inc
+++ b/print.pages.inc
@@ -272,30 +272,7 @@ function _print_var_generator($node, $message = NULL, $cid = NULL) {
$print['source_url'] = '';
}
- if (isset($node->type)) {
- $node_type = $node->type;
-
- if (theme_get_setting("toggle_node_info_$node_type")) {
- $print_text_by = filter_xss(variable_get('print_text_by', t('By %author')));
- $by_author = ($node->name ? $node->name : variable_get('anonymous', t('Anonymous')));
- $print['submitted'] = t($print_text_by, array('%author' => $by_author));
-
- $print_text_created = filter_xss(variable_get('print_text_created', t('Created %date')));
- $created_datetime = format_date($node->created, 'short');
- $print['created'] = t($print_text_created, array('%date' => $created_datetime));
- }
- else {
- $print['submitted'] = '';
- $print['created'] = '';
- }
-
- $print['type'] = $node->type;
- }
- else {
- $print['submitted'] = '';
- $print['created'] = '';
- $print['type'] = '';
- }
+ $print['type'] = (isset($node->type)) ? $node->type : '';
menu_set_active_item($path);
$breadcrumb = drupal_get_breadcrumb();
@@ -488,7 +465,10 @@ function _print_url_list_enabled($node, $format = PRINT_HTML_FORMAT) {
*/
function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $teaser = FALSE, $message = NULL) {
global $_print_urls;
- global $language;
+
+ if (!isset($langcode)) {
+ $langcode = $GLOBALS['language_content']->language;
+ }
// We can take a node id
$node = node_load($nid);
@@ -560,9 +540,10 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t
}
$build += array(
- '#theme' => 'print_node',
+ '#theme' => 'node',
'#node' => $node,
'#view_mode' => $view_mode,
+ '#language' => $langcode,
);
drupal_alter('node_view', $build);
diff --git a/print.tpl.php b/print.tpl.php
index b7789e6..5a830c4 100644
--- a/print.tpl.php
+++ b/print.tpl.php
@@ -29,9 +29,6 @@
<p />
<div class="print-breadcrumb"><?php print $print['breadcrumb']; ?></div>
<hr class="print-hr" />
- <h1 class="print-title"><?php print $print['title']; ?></h1>
- <div class="print-submitted"><?php print $print['submitted']; ?></div>
- <div class="print-created"><?php print $print['created']; ?></div>
<div class="print-content"><?php print $print['content']; ?></div>
<div class="print-footer"><?php print $print['footer_message']; ?></div>
<hr class="print-hr" />