...
 
Commits (74)
icons/mail_icon.gif

919 Bytes | W: | H:

icons/mail_icon.gif

321 Bytes | W: | H:

icons/mail_icon.gif
icons/mail_icon.gif
icons/mail_icon.gif
icons/mail_icon.gif
  • 2-up
  • Swipe
  • Onion skin
icons/pdf_icon.gif

985 Bytes | W: | H:

icons/pdf_icon.gif

583 Bytes | W: | H:

icons/pdf_icon.gif
icons/pdf_icon.gif
icons/pdf_icon.gif
icons/pdf_icon.gif
  • 2-up
  • Swipe
  • Onion skin
icons/print_icon.gif

917 Bytes | W: | H:

icons/print_icon.gif

215 Bytes | W: | H:

icons/print_icon.gif
icons/print_icon.gif
icons/print_icon.gif
icons/print_icon.gif
  • 2-up
  • Swipe
  • Onion skin
......@@ -201,8 +201,8 @@ function print_html_settings() {
$form['settings']['print_html_link_pos'] = array(
'#type' => 'checkboxes',
'#title' => t('Printer-friendly page link'),
'#default_value' => variable_get('print_html_link_pos', array(PRINT_HTML_LINK_POS_DEFAULT => PRINT_HTML_LINK_POS_DEFAULT)),
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner')),
'#default_value' => variable_get('print_html_link_pos', drupal_json_decode(PRINT_HTML_LINK_POS_DEFAULT)),
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner'), 'block' => t('Block'), 'help' => t('Help area')),
'#description' => t('Choose the location of the link(s) to the printer-friendly page. The Links area is usually below the node content, whereas the Content corner is placed in the upper-right corner of the node content. Unselect all options to disable the link. Even if the link is disabled, you can still view the print version of a node by going to !path/nid where nid is the numeric id of the node.', array('!path' => PRINT_PATH)),
);
......
name = "Printer-friendly pages"
description = "Adds a printer-friendly version link to content and administrative pages."
core=7.x
description = "Generates a printer-friendly version of Drupal pages."
core = 7.x
package = "Printer, email and PDF versions"
files[] = print.module
files[] = print.admin.inc
files[] = print.pages.inc
files[] = print.install
files[] = print_join_page_counter.inc
dependencies[] = node
configure = admin/config/user-interface/print
......@@ -126,7 +126,7 @@ function print_schema() {
'fields' => array(
'path' => array(
'type' => 'varchar',
'length' => 128,
'length' => 255,
'not null' => TRUE,
'description' => 'Page path',
),
......@@ -167,7 +167,21 @@ function print_update_7000(&$sandbox) {
}
/**
* Empty update
* Enable block and help area links
*/
function print_update_7100(&$sandbox) {
function print_update_7101(&$sandbox) {
$link_pos = variable_get('print_html_link_pos', drupal_json_decode('{ "link": "link", "block": "block", "help": "help" }'));
$link_pos['block'] = 'block';
$link_pos['help'] = 'help';
variable_set('print_html_link_pos', $link_pos);
}
/**
* Increase size of the path field in the print_page_counter table
*/
function print_update_7103(&$sandbox) {
db_drop_primary_key('print_page_counter');
db_change_field('print_page_counter', 'path', 'path',
array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'description' => 'Page path'),
array('primary key' => array('path')));
}
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @file
* Printer-friendly version Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
function print_views_data() {
// The 'group' index will be used as a prefix in the UI for any of this
// table's fields, sort criteria, etc. so it's easy to tell where they came
// from.
$data['print_node_conf']['table']['group'] = t('Printer-friendly version');
$data['print_page_counter']['table']['group'] = t('Printer-friendly version');
// This table references the {node} table. The declaration below creates an
// 'implicit' relationship to the node table, so that when 'node' is the base
// table, the fields are automatically available.
$data['print_node_conf']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'nid',
// 'type' => 'INNER',
);
$data['print_page_counter']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'path',
// 'type' => 'INNER',
'handler' => 'print_join_page_counter',
);
// print_node_conf fields
$data['print_node_conf']['link'] = array(
'title' => t('Web: Show link'),
'help' => t('Whether to show the printer-friendly version link.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_node_conf']['comments'] = array(
'title' => t('Web: Show link in individual comments'),
'help' => t('Whether to show the printer-friendly version link in individual comments.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_node_conf']['url_list'] = array(
'title' => t('Web: Show Printer-friendly URLs list'),
'help' => t('Whether to show the URL list.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
// print_page_counter fields
$data['print_page_counter']['totalcount'] = array(
'title' => t('Web: Number of page accesses'),
'help' => t('Counter of accesses to the printer-friendly version for this node.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
$data['print_page_counter']['timestamp'] = array(
'title' => t('Web: Last access'),
'help' => t("The date of the last access to the node's printer-friendly version."),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
return $data;
}
<?php
/**
* @file
* Custom Views integration join for the page counters
*
* @ingroup print
*/
class print_join_page_counter extends views_join {
// PHP 4 doesn't call constructors of the base class automatically from a
// constructor of a derived class. It is your responsibility to propagate
// the call to constructors upstream where appropriate.
function construct($table = NULL, $left_table = NULL, $left_field = NULL, $field = NULL, $extra = array(), $type = 'LEFT') {
parent::construct($table, $left_table, $left_field, $field, $extra, $type);
}
function build_join($select_query, $table, $view_query) {
if ($this->left_table) {
$this->left_field = "CONCAT('node/', $this->left_table.$this->left_field)";
$this->left_table = NULL;
}
parent::build_join($select_query, $table, $view_query);
}
}
......@@ -27,8 +27,8 @@ function print_mail_settings() {
$form['settings']['print_mail_link_pos'] = array(
'#type' => 'checkboxes',
'#title' => t('Send by email link'),
'#default_value' => variable_get('print_mail_link_pos', array(PRINT_MAIL_LINK_POS_DEFAULT => PRINT_MAIL_LINK_POS_DEFAULT)),
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner')),
'#default_value' => variable_get('print_mail_link_pos', drupal_json_decode(PRINT_MAIL_LINK_POS_DEFAULT)),
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner'), 'block' => t('Block'), 'help' => t('Help area')),
'#description' => t('Choose the location of the link(s) to the send by email page. The Links area is usually below the node content, whereas the Content corner is placed in the upper-right corner of the node content. Unselect all options to disable the link. Even if the link is disabled, you can still send a node by email by going to !path/nid where nid is the numeric id of the node.', array('!path' => PRINTMAIL_PATH)),
);
......@@ -139,6 +139,13 @@ function print_mail_settings() {
'#description' => t('The maximum number of emails a user can send per hour.'),
);
$form['settings']['print_mail_use_reply_to'] = array(
'#type' => 'checkbox',
'#title' => t('Use Reply-To header'),
'#default_value' => variable_get('print_mail_use_reply_to', PRINT_MAIL_USE_REPLY_TO),
'#description' => t("When enabled, any email sent will use the provided user and username in the 'Reply-To' header, with the site's email address used in the 'From' header (configured in !link). Enabling this helps in preventing email being flagged as spam.", array('!link' => l(t('Site information'), 'admin/config/system/site-information'))),
);
$form['settings']['print_mail_teaser_default'] = array(
'#type' => 'checkbox',
'#title' => t('Send only the teaser'),
......@@ -167,14 +174,12 @@ function print_mail_settings() {
$form['settings']['print_mail_send_option_default']['#options']['plain-attachment'] = t('Plain Text with Attachment');
}
if (module_exists('job_queue')) {
$form['settings']['print_mail_job_queue'] = array(
'#type' => 'checkbox',
'#title' => t('Send emails using Job Queue'),
'#default_value' => variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT),
'#description' => t("Selecting this option, email delivery will be performed by the Job Queue module during each cron run. Leaving this unselected, the email will be sent immediately, but the site will take slightly longer to reply to the user."),
);
}
$form['settings']['print_mail_job_queue'] = array(
'#type' => 'checkbox',
'#title' => t('Send emails using queue'),
'#default_value' => variable_get('print_mail_job_queue', PRINT_MAIL_JOB_QUEUE_DEFAULT),
'#description' => t("Selecting this option, email delivery will be performed by the system queue during each cron run. Leaving this unselected, the email will be sent immediately, but the site will take slightly longer to reply to the user."),
);
$form['settings']['print_mail_display_sys_urllist'] = array(
'#type' => 'checkbox',
......
This diff is collapsed.
name = "Send by email"
description = "Provides the capability to send the web page by email"
core=7.x
core = 7.x
package = "Printer, email and PDF versions"
dependencies[] = print
files[] = print_mail.module
files[] = print_mail.inc
files[] = print_mail.admin.inc
files[] = print_mail.install
configure = admin/config/user-interface/print/email
......@@ -27,6 +27,15 @@ function print_mail_enable() {
}
}
/**
* Implements hook_disable().
*/
function print_mail_disable() {
if (module_exists('mailsystem')) {
mailsystem_clear(array('print_mail' => ''));
}
}
/**
* Implements hook_uninstall().
*/
......@@ -42,6 +51,7 @@ function print_mail_uninstall() {
variable_del('print_mail_sys_link_pages');
variable_del('print_mail_book_link');
variable_del('print_mail_hourly_threshold');
variable_del('print_mail_use_reply_to');
variable_del('print_mail_teaser_default');
variable_del('print_mail_teaser_choice');
variable_del('print_mail_link_text');
......@@ -105,7 +115,7 @@ function print_mail_schema() {
'fields' => array(
'path' => array(
'type' => 'varchar',
'length' => 128,
'length' => 255,
'not null' => TRUE,
'description' => 'Page path',
),
......@@ -181,3 +191,23 @@ function print_mail_update_7101(&$sandbox) {
->condition('permission', 'send unlimited e-mails')
->execute();
}
/**
* Enable block and help area links
*/
function print_mail_update_7102(&$sandbox) {
$link_pos = variable_get('print_mail_link_pos', drupal_json_decode('{ "link": "link", "block": "block", "help": "help" }'));
$link_pos['block'] = 'block';
$link_pos['help'] = 'help';
variable_set('print_mail_link_pos', $link_pos);
}
/**
* Increase size of the path field in the print_mail_page_counter table
*/
function print_mail_update_7103(&$sandbox) {
db_drop_primary_key('print_mail_page_counter');
db_change_field('print_mail_page_counter', 'path', 'path',
array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'description' => 'Page path'),
array('primary key' => array('path')));
}
This diff is collapsed.
<?php
/**
* @file
* Send by email Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
function print_mail_views_data() {
// The 'group' index will be used as a prefix in the UI for any of this
// table's fields, sort criteria, etc. so it's easy to tell where they came
// from.
$data['print_mail_node_conf']['table']['group'] = t('Printer-friendly version');
$data['print_mail_page_counter']['table']['group'] = t('Printer-friendly version');
// This table references the {node} table. The declaration below creates an
// 'implicit' relationship to the node table, so that when 'node' is the base
// table, the fields are automatically available.
$data['print_mail_node_conf']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'nid',
// 'type' => 'INNER',
);
$data['print_mail_page_counter']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'path',
// 'type' => 'INNER',
'handler' => 'print_join_page_counter',
);
// print_mail_node_conf fields
$data['print_mail_node_conf']['link'] = array(
'title' => t('Email: Show link'),
'help' => t('Whether to show the send by email link.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_mail_node_conf']['comments'] = array(
'title' => t('Email: Show link in individual comments'),
'help' => t('Whether to show the send by email link in individual comments.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_mail_node_conf']['url_list'] = array(
'title' => t('Email: Show Printer-friendly URLs list'),
'help' => t('Whether to show the URL list.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
// print_mail_page_counter fields
$data['print_mail_page_counter']['totalcount'] = array(
'title' => t('Email: Number of page accesses'),
'help' => t('Counter of accesses to the send by email form for this node.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
$data['print_mail_page_counter']['timestamp'] = array(
'title' => t('Email: Last access'),
'help' => t("The date of the last access to the node's send by email form."),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
$data['print_mail_page_counter']['sentcount'] = array(
'title' => t('Email: Number of sent emails'),
'help' => t('Counter of emails sent for this node.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
$data['print_mail_page_counter']['sent_timestamp'] = array(
'title' => t('Email: Last email sent'),
'help' => t('The date when the node was last sent by email.'),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
return $data;
}
<?php
/**
* @file
* Views sort handler for the print_mail module
*
* Extend the default sort handler.
* Add a relationship with custom join to print's emailed counter
*/
class views_handler_sort_print_mail_sentcount extends views_handler_sort {
function query() {
$table = 'print_mail_page_counter';
$join = new views_join;
$join->construct($table, NULL, "CONCAT('node/', node.nid)", 'path', NULL, 'LEFT');
$alias = $this->query->add_relationship($table, $join, 'node');
$this->query->add_orderby($table, 'sentcount', $this->options['order']);
}
}
......@@ -18,6 +18,8 @@
*/
function print_pdf_settings() {
$pdf_tools = _print_pdf_tools();
$current_pdf_tool = variable_get('print_pdf_pdf_tool', PRINT_PDF_PDF_TOOL_DEFAULT);
$pdf_tool_default = (in_array($current_pdf_tool, $pdf_tools)) ? $current_pdf_tool : PRINT_PDF_PDF_TOOL_DEFAULT;
if ($pdf_tools != -1) {
$form['settings'] = array(
......@@ -29,15 +31,15 @@ function print_pdf_settings() {
'#type' => 'radios',
'#title' => t('PDF generation tool'),
'#options' => $pdf_tools,
'#default_value' => variable_get('print_pdf_pdf_tool', PRINT_PDF_PDF_TOOL_DEFAULT),
'#default_value' => $pdf_tool_default,
'#description' => t('This option selects the PDF generation tool being used by this module to create the PDF version.'),
);
$form['settings']['print_pdf_link_pos'] = array(
'#type' => 'checkboxes',
'#title' => t('PDF version link'),
'#default_value' => variable_get('print_pdf_link_pos', array(PRINT_PDF_LINK_POS_DEFAULT => PRINT_PDF_LINK_POS_DEFAULT)),
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner')),
'#default_value' => variable_get('print_pdf_link_pos', drupal_json_decode(PRINT_PDF_LINK_POS_DEFAULT)),
'#options' => array('link' => t('Links area'), 'corner' => t('Content corner'), 'block' => t('Block'), 'help' => t('Help area')),
'#description' => t('Choose the location of the link(s) to the PDF version. The Links area is usually below the node content, whereas the Content corner is placed in the upper-right corner of the node content. Unselect all options to disable the link. Even if the link is disabled, you can still view the PDF version of a node by going to !path/nid where nid is the numeric id of the node.', array('!path' => PRINTPDF_PATH)),
);
......@@ -258,7 +260,7 @@ function print_pdf_settings() {
else {
$form['settings'] = array(
'#type' => 'markup',
'#markup' => '<p>' . t("No PDF generation tool found! Please dowload a supported PHP PDF generation tool. Check this module's INSTALL.txt for more details.") . '</p>',
'#markup' => '<p>' . t("No PDF generation tool found! Please download a supported PHP PDF generation tool. Check this module's INSTALL.txt for more details.") . '</p>',
);
}
......
......@@ -12,8 +12,13 @@
class PrintTCPDF extends TCPDF {
public $footer;
// Display invisible link at the bottom of all pages.
public function setTcpdfLink($tcpdflink) {
$this->tcpdflink = $tcpdflink;
}
// Page footer data
public function SetFooterData($arg = '') {
public function setFooterContent($arg = '') {
$this->footer = $arg;
}
......
......@@ -13,12 +13,13 @@
define('TCPDF_DOWNLOAD_URI', 'http://sourceforge.net/projects/tcpdf/files/latest');
// URI to the the latest dompdf version.. Hardcoded version unfortunately
define('DOMPDF_DOWNLOAD_URI', 'http://dompdf.googlecode.com/files/dompdf_0-6-0_beta3.tar.gz');
define('DOMPDF_DOWNLOAD_URI', 'https://github.com/dompdf/dompdf/releases/download/v0.6.1/dompdf-0.6.1.zip');
// wkhtmltopdf is a binary, requiring a different download for each platform
define('WKHTMLTOPDF_AMD64_DOWNLOAD_URI', 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2');
define('WKHTMLTOPDF_I386_DOWNLOAD_URI', 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2');
define('WKHTMLTOPDF_WIN_DOWNLOAD_URI', 'http://wkhtmltopdf.googlecode.com/files/wkhtmltox-0.11.0_rc1-installer.exe');
define('WKHTMLTOPDF_AMD64_DOWNLOAD_URI', 'http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.0/wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz');
define('WKHTMLTOPDF_I386_DOWNLOAD_URI', 'http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.0/wkhtmltox-linux-i386_0.12.0-03c001d.tar.xz');
define('WKHTMLTOPDF_WIN64_DOWNLOAD_URI', 'http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.0/wkhtmltox-win64_0.12.0-03c001d.exe');
define('WKHTMLTOPDF_WIN_DOWNLOAD_URI', 'http://downloads.sourceforge.net/project/wkhtmltopdf/0.12.0/wkhtmltox-win32_0.12.0-03c001d.exe');
define('WKHTMLTOPDF_OSX_DOWNLOAD_URI', 'http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-OSX-0.10.0_rc2-static.tar.bz2');
/**
......@@ -159,6 +160,10 @@ function _drush_print_pdf_download_extract($filename) {
// Decompress the tar bz2 archive
$arch_ret = drush_shell_exec('tar xjf ' . $filename);
break;
case 'application/x-xz':
// Decompress the tar xz archive
$arch_ret = drush_shell_exec('tar xJf %s', $filename);
break;
}
}
else {
......
name = "PDF version"
description = "Adds the capability to export pages as PDF."
core=7.x
core = 7.x
package = "Printer, email and PDF versions"
dependencies[] = print
files[] = print_pdf.module
files[] = print_pdf.admin.inc
files[] = print_pdf.pages.inc
files[] = print_pdf.install
files[] = print_pdf.class.inc
configure = admin/config/user-interface/print/pdf
......@@ -103,7 +103,7 @@ function print_pdf_schema() {
'fields' => array(
'path' => array(
'type' => 'varchar',
'length' => 128,
'length' => 255,
'not null' => TRUE,
'description' => 'Page path',
),
......@@ -145,3 +145,23 @@ function print_pdf_update_7000(&$sandbox) {
variable_set('print_pdf_filename', '[site:name] - [node:title] - [node:changed:custom:Y-m-d]');
}
}
/**
* Enable block and help area links
*/
function print_pdf_update_7101(&$sandbox) {
$link_pos = variable_get('print_pdf_link_pos', drupal_json_decode('{ "link": "link", "block": "block", "help": "help" }'));
$link_pos['block'] = 'block';
$link_pos['help'] = 'help';
variable_set('print_pdf_link_pos', $link_pos);
}
/**
* Increase size of the path field in the print_pdf_page_counter table
*/
function print_pdf_update_7105(&$sandbox) {
db_drop_primary_key('print_pdf_page_counter');
db_change_field('print_pdf_page_counter', 'path', 'path',
array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'description' => 'Page path'),
array('primary key' => array('path')));
}
This diff is collapsed.
This diff is collapsed.
<?php
/**
* @file
* PDF Version Views integration
*
* @ingroup print
*/
/**
* Implements hook_views_data().
*/
function print_pdf_views_data() {
// The 'group' index will be used as a prefix in the UI for any of this
// table's fields, sort criteria, etc. so it's easy to tell where they came
// from.
$data['print_pdf_node_conf']['table']['group'] = t('Printer-friendly version');
$data['print_pdf_page_counter']['table']['group'] = t('Printer-friendly version');
// This table references the {node} table. The declaration below creates an
// 'implicit' relationship to the node table, so that when 'node' is the base
// table, the fields are automatically available.
$data['print_pdf_node_conf']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'nid',
// 'type' => 'INNER',
);
$data['print_pdf_page_counter']['table']['join']['node'] = array(
// 'left_field' is the primary key in the referenced table.
// 'field' is the foreign key in this table.
'left_field' => 'nid',
'field' => 'path',
// 'type' => 'INNER',
'handler' => 'print_join_page_counter',
);
// print_pdf_node_conf fields
$data['print_pdf_node_conf']['link'] = array(
'title' => t('PDF: Show link'),
'help' => t('Whether to show the PDF version link.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_pdf_node_conf']['comments'] = array(
'title' => t('PDF: Show link in individual comments'),
'help' => t('Whether to show the PDF version link in individual comments.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
$data['print_pdf_node_conf']['url_list'] = array(
'title' => t('PDF: Show Printer-friendly URLs list'),
'help' => t('Whether to show the URL list.'),
'field' => array(
'handler' => 'views_handler_field_boolean',
'click sortable' => TRUE,
),
'filter' => array(
'handler' => 'views_handler_filter_boolean_operator',
'label' => t('Active'),
'type' => 'yes-no',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
);
// print_pdf_page_counter fields
$data['print_pdf_page_counter']['totalcount'] = array(
'title' => t('PDF: Number of page accesses'),
'help' => t('Counter of accesses to the PDF version for this node.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort',
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
),
);
$data['print_pdf_page_counter']['timestamp'] = array(
'title' => t('PDF: Last access'),
'help' => t("The date of the last access to the node's PDF version."),
'field' => array(
'handler' => 'views_handler_field_date',
'click sortable' => TRUE,
),
'sort' => array(
'handler' => 'views_handler_sort_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
);
return $data;
}
......@@ -55,6 +55,8 @@ class PrintBasicTest extends DrupalWebTestCase {
// Must require it, since this function gets called via Drupal's dynamic loading
require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'print') . '/print.pages.inc');
variable_set('print_urls_anchors', 1);
$_print_urls = TRUE;
$pattern = '!<(a\s[^>]*?)>(.*?)(</a>)!is';
......@@ -95,6 +97,10 @@ class PrintBasicTest extends DrupalWebTestCase {
$rel_url[9] = $url[9];
$abs_url[9] = $url[9];
$url[10] = '';
$rel_url[10] = '';
$abs_url[10] = $base_url . '/' . $this->getq;
$size = count($url);
for ($i = 0; $i < $size; $i++) {
preg_match($pattern, $part1 . $url[$i] . $part2, $matches);
......