summaryrefslogtreecommitdiffstats
path: root/print_mail
diff options
context:
space:
mode:
authorJoao Ventura2012-04-02 03:12:04 +0200
committerJoao Ventura2012-04-02 03:12:04 +0200
commitfd2c0b3e5fedc0003a0df31739df3608cc6e01b1 (patch)
tree5964c90095f3963d3e53469bdac998582ed08c83 /print_mail
parent7171466f9d1369876e17a894bd91d8b94267f0ab (diff)
Issue #1351412: Use 'Send by email' instead of 'Send to friend' and use recommended 'email' spelling instead of 'e-mail'.
Diffstat (limited to 'print_mail')
-rw-r--r--print_mail/print_mail.admin.inc34
-rw-r--r--print_mail/print_mail.inc10
-rw-r--r--print_mail/print_mail.info6
-rw-r--r--print_mail/print_mail.install19
-rw-r--r--print_mail/print_mail.module34
5 files changed, 58 insertions, 45 deletions
diff --git a/print_mail/print_mail.admin.inc b/print_mail/print_mail.admin.inc
index 515e92b..1ccc266 100644
--- a/print_mail/print_mail.admin.inc
+++ b/print_mail/print_mail.admin.inc
@@ -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',
diff --git a/print_mail/print_mail.inc b/print_mail/print_mail.inc
index 2e3d142..c31a7f2 100644
--- a/print_mail/print_mail.inc
+++ b/print_mail/print_mail.inc
@@ -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)));
}
diff --git a/print_mail/print_mail.info b/print_mail/print_mail.info
index 464ecfc..70ce71c 100644
--- a/print_mail/print_mail.info
+++ b/print_mail/print_mail.info
@@ -1,7 +1,7 @@
-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
diff --git a/print_mail/print_mail.install b/print_mail/print_mail.install
index 1c8f0fb..6a2d5ea 100644
--- a/print_mail/print_mail.install
+++ b/print_mail/print_mail.install
@@ -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'));
+ }
+}
diff --git a/print_mail/print_mail.module b/print_mail/print_mail.module
index 7e4a607..3ef7135 100644
--- a/print_mail/print_mail.module
+++ b/print_mail/print_mail.module
@@ -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'),