diff --git a/print.admin.inc b/print.admin.inc index 46ffb0eb3c579b116488761e474cc6fb766fe4a0..9d09306acf504f4a6ddd3c0e2acf01d6b9c6e2f5 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 db7a3f99b219718243aa6a36f209ad8045ca9101..5f1f1569088a1c19d09b0a9bcbde0ca9b54dbc49 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 6767223ae3983e7102117eed94f56eeb5dcb3328..1ff56e05fada1eedb434b51fdcacd69e58db19c8 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 fa6c674ede866c80e07e19646c2576c3fd7bde24..94072a3f159e5ed9a85f957404c363a37cf5f769 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 b7789e6d6b64a01afc73aab56eed61591516e29a..5a830c4189fa2c0c0449284fd90682e5fa095f9c 100644 --- a/print.tpl.php +++ b/print.tpl.php @@ -29,9 +29,6 @@

-

- -