Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Fix to #147
Browse files Browse the repository at this point in the history
I added the functionality for an admin to be able to disable the
additional email field.
  • Loading branch information
Kathrin84 committed Jun 3, 2015
1 parent 8f0dee4 commit 2891bba
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions email_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ public function definition() {

$mform->addElement('static', 'selectors', '', html_writer::table($table));

if (!empty($CFG->block_quickmail_addionalemail)) {
$mform->addElement('text', 'additional_emails', quickmail::_s('additional_emails'), array('style'=>'width: 50%;'));
$mform->setType('additional_emails', PARAM_TEXT);
$mform->addRule('additional_emails', 'One or more email addresses is invalid', 'callback', 'block_quickmail_mycallback', 'client');
$mform->addHelpButton('additional_emails', 'additional_emails', 'block_quickmail');
}
$mform->addElement(
'filemanager', 'attachments', quickmail::_s('attachment'),
null, array('subdirs' => 1, 'accepted_types' => '*')
Expand Down
6 changes: 4 additions & 2 deletions lang/en/block_quickmail.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
$string['allusers'] = ' All Users';
$string['pluginname'] = 'Quickmail';
$string['sendadmin'] = 'Admin Email';
$string['sendadmin'] = 'Admin Email';
$string['quickmail:cansend'] = "Allows users to send email through Quickmail";
$string['quickmail:canconfig'] = "Allows users to configure Quickmail instance.";
$string['quickmail:canimpersonate'] = "Allows users to log in as other users and view history.";
Expand Down Expand Up @@ -93,6 +93,8 @@
$string['noferpa'] = 'No Group Respect';
$string['courselayout'] = 'Course Layout';
$string['courselayout_desc'] = 'Use _Course_ page layout when rendering the Quickmail block pages. Enable this setting, if you are getting Moodle form fixed width issues.';
$string['addionalemail'] = 'Allow emails to external email addresses';
$string['addionalemail_desc'] = 'If this option is enabled quickmail emails are also sent so external email adresses the user entered within the form.';

$string['are_you_sure'] = 'Are you sure you want to delete {$a->title}? This action
cannot be reversed.';
Expand Down Expand Up @@ -164,6 +166,6 @@
$string['time_elapsed'] = 'Time Elapsed: ';
$string['additional_emails'] = 'Additional Emails';
$string['additional_emails_help'] = 'Other email addresses you would like the message sent to, in a comma or semicolon separated list. Example:
email1@example.com, email2@example.com
';
7 changes: 7 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,11 @@
)
);

$settings->add(
new admin_setting_configcheckbox('block_quickmail_addionalemail',
quickmail::_s('addionalemail'), quickmail::_s('addionalemail_desc'),
0
)
);

}

0 comments on commit 2891bba

Please sign in to comment.