Commit 2bc194e3 authored by jcnventura's avatar jcnventura

Fix the individual comment printing and links.

parent 0c1fab80
......@@ -36,8 +36,6 @@
* @ingroup print
*/
define('PRINT_PATH', 'print');
define('PRINT_LOGO_OPTIONS_DEFAULT', 1);
define('PRINT_LOGO_URL_DEFAULT', '');
define('PRINT_FOOTER_OPTIONS_DEFAULT', 1);
......@@ -48,7 +46,9 @@ define('PRINT_URLS_DEFAULT', 1);
define('PRINT_URLS_ANCHORS_DEFAULT', 0);
define('PRINT_COMMENTS_DEFAULT', 0);
define('PRINT_NEWWINDOW_DEFAULT', 1);
define('PRINT_TYPE_SYS_URLLIST_DEFAULT', 0);
define('PRINT_HTML_NEW_WINDOW_DEFAULT', 0);
define('PRINT_HTML_SENDTOPRINTER_DEFAULT', 0);
define('PRINT_HTML_WINDOWCLOSE_DEFAULT', 1);
......@@ -69,7 +69,7 @@ function print_print_link() {
'text' => t('Printer-friendly version'),
'description' => t('Display a printer-friendly version of this page.'),
'permission' => 'access print',
'path' => PRINT_PATH,
'path' => 'print',
'class' => 'print-page',
'icon' => 'print_icon.gif',
'module' => 'print',
......
......@@ -263,7 +263,7 @@ function _print_var_generator($node, $message = NULL, $cid = NULL) {
$url = $base_url . '/' . (((bool)variable_get('clean_url', '0')) ? '' : '?q=') . $path;
}
if (is_int($cid)) {
$url .= '#comment-$cid';
$url .= "#comment-$cid";
}
$retrieved_date = format_date(REQUEST_TIME, 'short');
$print_text_retrieved = filter_xss(variable_get('print_text_retrieved', t('retrieved on %date')));
......@@ -537,7 +537,12 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t
unset($comments['comment_form']);
foreach ($comments['comments'] as $key => &$comment) {
if (is_numeric($key)) {
unset($comment['links']);
if (($cid != NULL) && ($key != $cid)) {
unset($comments['comments'][$key]);
}
else {
unset($comment['links']);
}
}
}
......
......@@ -7,11 +7,6 @@
* @ingroup print
*/
define('PRINTMAIL_PATH', 'printmail');
// Defined in print.module
// define('PRINT_MAIL_FORMAT', 'mail');
define('PRINT_MAIL_HOURLY_THRESHOLD', 3);
define('PRINT_MAIL_TEASER_DEFAULT_DEFAULT', 1);
define('PRINT_MAIL_TEASER_CHOICE_DEFAULT', 0);
......@@ -27,7 +22,7 @@ function print_mail_print_link() {
'text' => t('Send by email'),
'description' => t('Send this page by email.'),
'permission' => 'access send by email',
'path' => PRINTMAIL_PATH,
'path' => 'printmail',
'class' => 'print-mail',
'icon' => 'mail_icon.gif',
'module' => 'print_mail',
......
......@@ -147,7 +147,7 @@ function print_pdf_tcpdf_settings() {
$form['settings']['print_pdf_font_family'] = array(
'#type' => 'textfield',
'#title' => t('Font family'),
'#default_value' => variable_get('print_pdf_font_family', PRINT_PDF_FONT_FAMILY_DEFAULT),
'#default_value' => variable_get('print_pdf_font_family', PRINT_PDF_TCPDF_FONT_FAMILY_DEFAULT),
'#size' => 60,
'#maxlength' => 250,
'#description' => t('Set the font family to be used. Examples: %examples.', array('%examples' => 'helvetica, times, courier, dejavusans, dejavuserif, freesans, freeserif, freemono')) . '<br />' .
......@@ -156,7 +156,7 @@ function print_pdf_tcpdf_settings() {
$form['settings']['print_pdf_font_size'] = array(
'#type' => 'textfield',
'#title' => t('Font size'),
'#default_value' => variable_get('print_pdf_font_size', PRINT_PDF_FONT_SIZE_DEFAULT),
'#default_value' => variable_get('print_pdf_font_size', PRINT_PDF_TCPDF_FONT_SIZE_DEFAULT),
'#size' => 2,
'#maxlength' => 3,
'#description' => t('Set the font size to be used for normal text. This is the base value for the scaling applied to other text styles.'),
......@@ -164,7 +164,7 @@ function print_pdf_tcpdf_settings() {
$form['settings']['print_pdf_font_subsetting'] = array(
'#type' => 'checkbox',
'#title' => t('Enable font subsetting'),
'#default_value' => variable_get('print_pdf_font_subsetting', PRINT_PDF_FONT_SUBSETTING_DEFAULT),
'#default_value' => variable_get('print_pdf_font_subsetting', PRINT_PDF_TCPDF_FONT_SUBSETTING_DEFAULT),
'#description' => t('Only embed those font characters that are actually used. This can generates smaller PDF files but may significantly slow down processing.'),
);
......
......@@ -7,11 +7,6 @@
* @ingroup print
*/
define('PRINTPDF_PATH', 'printpdf');
// Defined in print.module
// define('PRINT_PDF_FORMAT', 'pdf');
define('PRINT_PDF_LIB_PATH', 'sites/all/libraries');
define('PRINT_PDF_PDF_TOOL_DEFAULT', 0);
......@@ -20,9 +15,9 @@ define('PRINT_PDF_PAPER_SIZE_DEFAULT', 'A4');
define('PRINT_PDF_PAGE_ORIENTATION_DEFAULT', 'portrait');
define('PRINT_PDF_IMAGES_VIA_FILE_DEFAULT', 0);
define('PRINT_PDF_AUTOCONFIG_DEFAULT', 1);
define('PRINT_PDF_FONT_FAMILY_DEFAULT', 'dejavusans');
define('PRINT_PDF_FONT_SIZE_DEFAULT', 10);
define('PRINT_PDF_FONT_SUBSETTING_DEFAULT', 0);
define('PRINT_PDF_TCPDF_FONT_FAMILY_DEFAULT', 'dejavusans');
define('PRINT_PDF_TCPDF_FONT_SIZE_DEFAULT', 10);
define('PRINT_PDF_TCPDF_FONT_SUBSETTING_DEFAULT', FALSE);
define('PRINT_PDF_FILENAME_DEFAULT', '[site:name] - [node:title] - [node:changed:custom:Y-m-d]');
define('PRINT_PDF_DOMPDF_UNICODE_DEFAULT', 0);
define('PRINT_PDF_WKHTMLTOPDF_OPTIONS', "--footer-font-size 7 --footer-right '[page]'");
......@@ -36,7 +31,7 @@ function print_pdf_print_link() {
'text' => t('PDF version'),
'description' => t('Display a PDF version of this page.'),
'permission' => 'access PDF version',
'path' => PRINTPDF_PATH,
'path' => 'printpdf',
'class' => 'print-pdf',
'icon' => 'pdf_icon.gif',
'module' => 'print_pdf',
......
......@@ -294,9 +294,9 @@ function _print_pdf_tcpdf($print, $html, $filename = NULL) {
module_load_include('inc', 'print_pdf', 'print_pdf.class');
$font = Array(
check_plain(variable_get('print_pdf_font_family', PRINT_PDF_FONT_FAMILY_DEFAULT)),
check_plain(variable_get('print_pdf_font_family', PRINT_PDF_TCPDF_FONT_FAMILY_DEFAULT)),
'',
check_plain(variable_get('print_pdf_font_size', PRINT_PDF_FONT_SIZE_DEFAULT)),
check_plain(variable_get('print_pdf_font_size', PRINT_PDF_TCPDF_FONT_SIZE_DEFAULT)),
);
$orientation = drupal_strtoupper($print_pdf_page_orientation[0]);
......@@ -310,7 +310,7 @@ function _print_pdf_tcpdf($print, $html, $filename = NULL) {
$pdf->SetCreator(variable_get('site_name', 'Drupal'));
$pdf->SetTitle(html_entity_decode($print['title'], ENT_QUOTES, 'UTF-8'));
$pdf->setPDFVersion('1.6');
$pdf->setFontSubsetting(variable_get('print_pdf_font_subsetting', FALSE));
$pdf->setFontSubsetting(variable_get('print_pdf_font_subsetting', PRINT_PDF_TCPDF_FONT_SUBSETTING_DEFAULT));
if ($language->direction == LANGUAGE_RTL) {
$pdf->setRTL(TRUE);
......
This diff is collapsed.
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