Commit d3399ce3 authored by jcnventura's avatar jcnventura

Use the node.tpl.php template for now

parent 265b5f48
......@@ -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')),
......
......@@ -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');
......
......@@ -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}";
}
/**
......
......@@ -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);
......
......@@ -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" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment