Commit fd2c0b3e authored by jcnventura's avatar jcnventura

Issue #1351412: Use 'Send by email' instead of 'Send to friend' and use...

Issue #1351412: Use 'Send by email' instead of 'Send to friend' and use recommended 'email' spelling instead of 'e-mail'.
parent 7171466f
......@@ -42,7 +42,7 @@ CONFIGURATION
comments via the "Show printer-friendly version link in individual
comments" checkbox. (default: disabled)
Administration > Configuration > User interface > Printer, e-mail and PDF versions (admin/config/user-interface/print)
Administration > Configuration > User interface > Printer, email and PDF versions (admin/config/user-interface/print)
This is where all the module-specific configuration options can be set.
- To modify the template of printer friendly pages, simply edit the
......
name = "Printer-friendly pages"
description = "Adds a printer-friendly version link to content and administrative pages."
core=7.x
package = "Printer, e-mail and PDF versions"
package = "Printer, email and PDF versions"
files[] = print.module
files[] = print.admin.inc
files[] = print.pages.inc
......
......@@ -13,7 +13,7 @@
function print_install() {
$t = get_t();
drupal_set_message($t('Printer-friendly Page settings are available under !link',
array( '!link' => l($t('Administration > Configuration > User interface > Printer, e-mail and PDF versions'), 'admin/config/user-interface/print' ) )
array( '!link' => l($t('Administration > Configuration > User interface > Printer, email and PDF versions'), 'admin/config/user-interface/print' ) )
));
}
......@@ -167,3 +167,17 @@ function print_update_7000(&$sandbox) {
update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
}
/**
* Update permissions to new spellings
*/
function print_update_7100(&$sandbox) {
db_update('role_permission')
->fields(array('permission' => 'access send by email'))
->condition('permission', 'access send to friend')
->execute();
db_update('role_permission')
->fields(array('permission' => 'send unlimited emails'))
->condition('permission', 'send unlimited e-mails')
->execute();
}
<?php
/**
* @defgroup print Printer, e-mail and PDF versions
* @defgroup print Printer, email and PDF versions
*
* Welcome to the print module developer's documentation. The interesting
* functions for themers are those that start with 'theme_'.
......@@ -12,7 +12,7 @@
* - @link print.pages.inc HTML generation @endlink
* - @link print.install (Un)Install routines @endlink
* - @link print.tpl.php Page generation template @endlink
* - Send by e-mail
* - Send by email
* - @link print_mail.module Module main file @endlink
* - @link print_mail.admin.inc Settings form @endlink
* - @link print_mail.inc Mail form and send mail routine @endlink
......@@ -192,7 +192,7 @@ function print_menu() {
'access callback' => FALSE,
);
$items['admin/config/user-interface/print'] = array(
'title' => 'Printer, e-mail and PDF versions',
'title' => 'Printer, email and PDF versions',
'description' => 'Adds a printer-friendly version link to content and administrative pages.',
'page callback' => 'drupal_get_form',
'page arguments' => array('print_html_settings'),
......@@ -249,7 +249,7 @@ function print_menu() {
* Implements hook_block_info().
*/
function print_block_info() {
$block['print-links']['info'] = t('Printer, e-mail and PDF versions');
$block['print-links']['info'] = t('Printer, email and PDF versions');
$block['print-links']['cache'] = DRUPAL_CACHE_PER_PAGE;
$block['print-top']['info'] = t('Most printed');
$block['print-top']['cache'] = DRUPAL_CACHE_GLOBAL;
......@@ -484,7 +484,7 @@ function print_form_alter(&$form, &$form_state, $form_id) {
(($form_id == 'node_type_form') || !empty($form['#node_edit_form']))) {
$form['print'] = array(
'#type' => 'fieldset',
'#title' => t('Printer, e-mail and PDF versions'),
'#title' => t('Printer, email and PDF versions'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#weight' => PRINT_TYPE_FIELDS_WEIGHT,
......
......@@ -57,7 +57,7 @@ function print_controller_html() {
* @param $teaser
* if set to TRUE, outputs only the node's teaser
* @param $message
* optional sender's message (used by the send e-mail module)
* optional sender's message (used by the send email module)
* @return
* array with the fields to be used in the template
* @see _print_generate_node()
......@@ -142,7 +142,7 @@ function _print_robots_meta_generator() {
* @param $node
* generated node with a printer-friendly node body
* @param $message
* optional sender's message (used by the send e-mail module)
* optional sender's message (used by the send email module)
* @param $cid
* id of current comment being generated (NULL when not generating
* an individual comment)
......@@ -197,7 +197,7 @@ function _print_var_generator($node, $message = NULL, $cid = NULL) {
}
}
// If we are sending a message via e-mail, the CSS must be embedded
// If we are sending a message via email, the CSS must be embedded
if (!empty($message)) {
$style = '';
$css_files = array_keys($drupal_css);
......@@ -475,7 +475,7 @@ function _print_url_list_enabled($node, $format = PRINT_HTML_FORMAT) {
* @param $teaser
* if set to TRUE, outputs only the node's teaser
* @param $message
* optional sender's message (used by the send e-mail module)
* optional sender's message (used by the send email module)
* @return
* filled array ready to be used in the template
*/
......@@ -581,7 +581,7 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t
* @param $teaser
* if set to TRUE, outputs only the node's teaser
* @param $message
* optional sender's message (used by the send e-mail module)
* optional sender's message (used by the send email module)
* @return
* filled array ready to be used in the template
*/
......@@ -648,7 +648,7 @@ function _print_generate_path($path, $format = PRINT_HTML_FORMAT, $teaser = FALS
* @param $teaser
* if set to TRUE, outputs only the node's teaser
* @param $message
* optional sender's message (used by the send e-mail module)
* optional sender's message (used by the send email module)
* @return
* filled array ready to be used in the template
*/
......
......@@ -2,9 +2,9 @@
/**
* @file
* Contains the administrative functions of the send by e-mail module.
* Contains the administrative functions of the send by email module.
*
* This file is included by the send by e-mail module, and includes the
* This file is included by the send by email module, and includes the
* settings form.
*
* @ingroup print
......@@ -14,27 +14,27 @@
@include_once('Mail/mime.php');
/**
* Menu callback for the send by e-mail module settings form.
* Menu callback for the send by email module settings form.
*
* @ingroup forms
*/
function print_mail_settings() {
$form['settings'] = array(
'#type' => 'fieldset',
'#title' => t('Send by e-mail options'),
'#title' => t('Send by email options'),
);
$form['settings']['print_mail_link_pos'] = array(
'#type' => 'checkboxes',
'#title' => t('Send by e-mail link'),
'#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')),
'#description' => t('Choose the location of the link(s) to the send by e-mail 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 e-mail by going to !path/nid where nid is the numeric id of the node.', array('!path' => PRINTMAIL_PATH)),
'#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)),
);
$form['settings']['print_mail_link_teaser'] = array(
'#type' => 'checkbox',
'#title' => t('Display send by e-mail link in teaser'),
'#title' => t('Display send by email link in teaser'),
'#default_value' => variable_get('print_mail_link_teaser', PRINT_MAIL_LINK_TEASER_DEFAULT),
'#description' => t('Enabling this will display the link in teaser mode.'),
);
......@@ -109,7 +109,7 @@ function print_mail_settings() {
'#type' => 'textarea',
'#default_value' => variable_get('print_mail_sys_link_pages', PRINT_MAIL_SYS_LINK_PAGES_DEFAULT),
'#rows' => 3,
'#description' => t('Setting this option will add a send by e-mail link on pages created by Drupal or the enabled modules.') . '<br />' .
'#description' => t('Setting this option will add a send by email link on pages created by Drupal or the enabled modules.') . '<br />' .
t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>')),
);
......@@ -136,7 +136,7 @@ function print_mail_settings() {
'#title' => t('Hourly threshold'),
'#default_value' => variable_get('print_mail_hourly_threshold', PRINT_MAIL_HOURLY_THRESHOLD),
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50)),
'#description' => t('The maximum number of e-mails a user can send per hour.'),
'#description' => t('The maximum number of emails a user can send per hour.'),
);
$form['settings']['print_mail_teaser_default'] = array(
......@@ -155,7 +155,7 @@ function print_mail_settings() {
$form['settings']['print_mail_send_option_default'] = array(
'#type' => 'select',
'#title' => t('Default e-mail sending format'),
'#title' => t('Default email sending format'),
'#default_value' => variable_get('print_mail_send_option_default', PRINT_MAIL_SEND_OPTION_DEFAULT),
'#options' => array(
'sendlink' => t('Link'),
......@@ -170,9 +170,9 @@ function print_mail_settings() {
if (module_exists('job_queue')) {
$form['settings']['print_mail_job_queue'] = array(
'#type' => 'checkbox',
'#title' => t('Send e-mails using Job Queue'),
'#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, e-mail delivery will be performed by the Job Queue module during each cron run. Leaving this unselected, the e-mail will be sent immediately, but the site will take slightly longer to reply to the user."),
'#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."),
);
}
......@@ -187,7 +187,7 @@ function print_mail_settings() {
}
/**
* Menu callback for the send by e-mail module text strings settings form.
* Menu callback for the send by email module text strings settings form.
*
* @ingroup forms
*/
......@@ -202,27 +202,27 @@ function print_mail_strings_settings() {
$form['print_mail_text']['print_mail_link_text'] = array(
'#type' => 'textfield',
'#title' => t('Link text'),
'#default_value' => variable_get('print_mail_link_text', t('Send to friend')),
'#default_value' => variable_get('print_mail_link_text', t('Send by email')),
'#description' => t('Text used in the link to the send by-email form.'),
);
$form['print_mail_text']['print_mail_text_title'] = array(
'#type' => 'textfield',
'#title' => t('Form page title'),
'#default_value' => variable_get('print_mail_text_title', t('Send page by e-mail')),
'#default_value' => variable_get('print_mail_text_title', t('Send page by email')),
'#description' => t("Text used as the page title of the mail submission form. Requires a menu rebuild to apply."),
);
$form['print_mail_text']['print_mail_text_subject'] = array(
'#type' => 'textfield',
'#title' => t('Message Subject'),
'#default_value' => variable_get('print_mail_text_subject', t('!user has sent you a message from !site')),
'#description' => t("e-mail subject line. The sender's name will appear in place of !user in the subject. The web site name will be inserted in place of !site. The page title replaces !title."),
'#description' => t("email subject line. The sender's name will appear in place of !user in the subject. The web site name will be inserted in place of !site. The page title replaces !title."),
);
$form['print_mail_text']['print_mail_text_message'] = array(
'#type' => 'textarea',
'#title' => t('Message Preamble'),
'#default_value' => variable_get('print_mail_text_message', t('Message from sender')),
'#description' => t('e-mail message preamble. The sender will be able to add their own message after this.'),
'#description' => t('email message preamble. The sender will be able to add their own message after this.'),
);
$form['print_mail_text']['print_mail_text_content'] = array(
'#type' => 'textarea',
......
......@@ -16,7 +16,7 @@ require_once(DRUPAL_ROOT . '/' . drupal_get_path('module', 'print') . '/print.pa
@include_once('Mail/mime.php');
/**
* Menu callback for the send by e-mail form.
* Menu callback for the send by email form.
*
* @ingroup forms
*/
......@@ -54,7 +54,7 @@ function print_mail_form($form, &$form_state) {
$print_mail_hourly_threshold = variable_get('print_mail_hourly_threshold', PRINT_MAIL_HOURLY_THRESHOLD);
if ((!user_access('send unlimited e-mails')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold))) {
if ((!user_access('send unlimited emails')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold))) {
$form['flood'] = array(
'#type' => 'markup',
'#markup' => '<p>' . format_plural($print_mail_hourly_threshold, 'You cannot send more than 1 message per hour. Please try again later.', 'You cannot send more than @count messages per hour. Please try again later.') . '</p>',
......@@ -87,7 +87,7 @@ function print_mail_form($form, &$form_state) {
$form['fld_from_addr'] = array(
'#type' => 'textfield',
'#title' => t('Your e-mail'),
'#title' => t('Your email'),
'#size' => 62,
'#required' => TRUE,
);
......@@ -142,7 +142,7 @@ function print_mail_form($form, &$form_state) {
$form['btn_submit'] = array(
'#name' => 'submit',
'#type' => 'submit',
'#value' => t('Send e-mail'),
'#value' => t('Send email'),
);
$form['btn_clear'] = array(
'#type' => 'markup',
......@@ -242,7 +242,7 @@ function print_mail_form_validate($form, &$form_state) {
$print_mail_hourly_threshold = variable_get('print_mail_hourly_threshold', PRINT_MAIL_HOURLY_THRESHOLD);
if ((!user_access('send unlimited e-mails')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold - count($to_array) + 1))) {
if ((!user_access('send unlimited emails')) && (!flood_is_allowed('print_mail', $print_mail_hourly_threshold - count($to_array) + 1))) {
form_set_error('txt_to_addrs', t('You cannot send more than %number messages per hour. Please reduce the number of recipients.', array('%number' => $print_mail_hourly_threshold)));
}
......
name = "Send by e-mail"
description = "Provides the capability to send the web page by e-mail"
name = "Send by email"
description = "Provides the capability to send the web page by email"
core=7.x
package = "Printer, e-mail and PDF versions"
package = "Printer, email and PDF versions"
dependencies[] = print
files[] = print_mail.module
files[] = print_mail.inc
......
......@@ -21,6 +21,10 @@ function print_mail_enable() {
->condition('type', 'module')
->condition('name', 'print_mail')
->execute();
if (module_exists('mailsystem')) {
mailsystem_set(array('print_mail' => 'DefaultMailSystem'));
}
}
/**
......@@ -60,7 +64,7 @@ function print_mail_uninstall() {
*/
function print_mail_schema() {
$schema['print_mail_node_conf'] = array(
'description' => 'Send by e-mail node-specific configuration settings',
'description' => 'Send by email node-specific configuration settings',
'fields' => array(
'nid' => array(
'type' => 'int',
......@@ -97,7 +101,7 @@ function print_mail_schema() {
);
$schema['print_mail_page_counter'] = array(
'description' => 'Send by e-mail version access counter',
'description' => 'Send by email version access counter',
'fields' => array(
'path' => array(
'type' => 'varchar',
......@@ -133,7 +137,7 @@ function print_mail_schema() {
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Last e-mail sent',
'description' => 'Last email sent',
),
),
'primary key' => array('path'),
......@@ -154,3 +158,12 @@ function print_mail_update_7000(&$sandbox) {
update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
}
/**
* Disable MimeMailSystem for now
*/
function print_mail_update_7100(&$sandbox) {
if (module_exists('mailsystem')) {
mailsystem_set(array('print_mail' => 'DefaultMailSystem'));
}
}
......@@ -33,13 +33,13 @@ define('PRINT_MAIL_JOB_QUEUE_DEFAULT', 0);
*/
function print_mail_permission() {
return array(
'access send to friend' => array(
'title' => t('Access the Send To Friend functionality'),
'description' => t('Provides the ability to send pages to a friend and the links to them in the original pages.'),
'access send by email' => array(
'title' => t('Access the Send by email functionality'),
'description' => t('Provides the ability to send pages by email and the links to them in the original pages.'),
),
'send unlimited e-mails' => array(
'send unlimited emails' => array(
'title' => t('Send unlimited emails'),
'description' => t("Overrides the built-in hourly threshold limits when sending e-mails. This permission should only be granted to trusted users, due to it's potential in enabling the use of your site as a source of e-mail spam."),
'description' => t("Overrides the built-in hourly threshold limits when sending emails. This permission should only be granted to trusted users, due to it's potential in enabling the use of your site as a source of email spam."),
),
);
}
......@@ -66,11 +66,11 @@ function print_mail_menu() {
$items = array();
$items[PRINTMAIL_PATH] = array(
'title' => variable_get('print_mail_text_title', 'Send page by e-mail'),
'title' => variable_get('print_mail_text_title', 'Send page by email'),
'page callback' => 'drupal_get_form',
'page arguments' => array('print_mail_form'),
'access callback' => '_print_mail_access',
'access arguments' => array('access send to friend'),
'access arguments' => array('access send by email'),
'type' => MENU_CALLBACK,
'file' => 'print_mail.inc',
);
......@@ -78,7 +78,7 @@ function print_mail_menu() {
'access callback' => FALSE,
);
$items['admin/config/user-interface/print/email'] = array(
'title' => 'e-mail',
'title' => 'email',
'page callback' => 'drupal_get_form',
'page arguments' => array('print_mail_settings'),
'access arguments' => array('administer print'),
......@@ -275,7 +275,7 @@ function print_mail_form_alter(&$form, &$form_state, $form_id) {
(($form_id == 'node_type_form') || !empty($form['#node_edit_form']))) {
$form['print']['mail_label'] = array(
'#type' => 'markup',
'#markup' => '<p><strong>' . t('Send by e-mail') . '</strong></p>',
'#markup' => '<p><strong>' . t('Send by email') . '</strong></p>',
);
$form['print']['print_mail_display'] = array(
......@@ -310,7 +310,7 @@ function print_mail_form_alter(&$form, &$form_state, $form_id) {
*/
function print_mail_job_queue_functions() {
$functions['print_mail'] = array(
'title' => t('Send to friend'),
'title' => t('Send by email'),
);
return $functions;
}
......@@ -378,7 +378,7 @@ function _print_mail_node_conf_modify($nid, $link, $comments, $url_list) {
}
/**
* Format the send by e-mail link
* Format the send by email link
*
* @return
* array of formatted attributes
......@@ -387,10 +387,10 @@ function _print_mail_node_conf_modify($nid, $link, $comments, $url_list) {
function theme_print_mail_format_link() {
$print_mail_link_class = variable_get('print_mail_link_class', PRINT_MAIL_LINK_CLASS_DEFAULT);
$print_mail_show_link = variable_get('print_mail_show_link', PRINT_MAIL_SHOW_LINK_DEFAULT);
$print_mail_link_text = filter_xss(variable_get('print_mail_link_text', t('Send to friend')));
$print_mail_link_text = filter_xss(variable_get('print_mail_link_text', t('Send by email')));
$img = drupal_get_path('module', 'print') . '/icons/mail_icon.gif';
$title = t('Send this page by e-mail.');
$title = t('Send this page by email.');
$class = strip_tags($print_mail_link_class);
$new_window = FALSE;
$format = _print_format_link_aux($print_mail_show_link, $print_mail_link_text, $img);
......@@ -402,7 +402,7 @@ function theme_print_mail_format_link() {
}
/**
* Auxiliary function to display a formatted send by e-mail link
* Auxiliary function to display a formatted send by email link
*
* Function made available so that developers may call this function from
* their defined pages/blocks.
......@@ -465,7 +465,7 @@ function print_mail_insert_link($path = NULL, $node = NULL) {
}
/**
* Determine a the link to send by e-mail is allowed depending on all possible settings
* Determine a the link to send by email is allowed depending on all possible settings
*
* @param $args
* array containing the possible parameters:
......@@ -478,7 +478,7 @@ function print_mail_insert_link($path = NULL, $node = NULL) {
function print_mail_link_allowed($args) {
$view_mode = isset($args['view_mode']) ? $args['view_mode'] : '';
if ((($view_mode == 'teaser') && !variable_get('print_mail_link_teaser', PRINT_MAIL_LINK_TEASER_DEFAULT))
|| !in_array($view_mode, array('full', 'teaser', '')) || !user_access('access send to friend')) {
|| !in_array($view_mode, array('full', 'teaser', '')) || !user_access('access send by email')) {
// If the teaser link is disabled or the user is not allowed
return FALSE;
}
......@@ -569,7 +569,7 @@ function print_mail_mollom_form_info($form_id) {
case 'print_mail_form':
$form_info = array(
'elements' => array(
'fld_from_addr' => t('Sender e-mail'),
'fld_from_addr' => t('Sender email'),
'fld_from_name' => t('Sender name'),
'txt_to_addrs' => t('Recipients'),
'fld_subject' => t('Subject'),
......
name = "PDF version"
description = "Adds the capability to export pages as PDF."
core=7.x
package = "Printer, e-mail and PDF versions"
package = "Printer, email and PDF versions"
dependencies[] = print
files[] = print_pdf.module
files[] = print_pdf.admin.inc
......
......@@ -18,9 +18,9 @@ class PrintBasicTest extends DrupalWebTestCase {
*/
function getInfo() {
return array(
'name' => t('Printer, e-mail and PDF versions tests'),
'name' => t('Printer, email and PDF versions tests'),
'description' => t('Unit tests for the print, print_mail and print_pdf modules.'),
'group' => t('Printer, e-mail and PDF versions'),
'group' => t('Printer, email and PDF versions'),
);
}
......
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