Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions classes/email_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,15 @@ public function definition() {
$mform->addElement('static', 'selectors', '', \html_writer::table($table));
$mform->setType('selectors', PARAM_RAW);

$mform->addElement('filemanager', 'attachments', get_string('attachment', 'block_clampmail'), null,
array(
'areamaxbytes' => get_max_upload_file_size($CFG->maxbytes, $COURSE->maxbytes, get_config('block_clampmail', 'maxbytes'))
));
$mform->setType('attachments', PARAM_FILE);
$attachpossible = get_config('block_clampmail', 'attachfile');

if ($attachpossible) {
$mform->addElement('filemanager', 'attachments', get_string('attachment', 'block_clampmail'), null,
array(
'areamaxbytes' => get_max_upload_file_size($CFG->maxbytes, $COURSE->maxbytes, get_config('block_clampmail', 'maxbytes'))
));
$mform->setType('attachments', PARAM_FILE);
}

$mform->addElement('text', 'subject', get_string('subject', 'block_clampmail'));
$mform->setType('subject', PARAM_TEXT);
Expand Down
2 changes: 2 additions & 0 deletions lang/en/block_clampmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
$string['alternate_waiting'] = 'Waiting';
$string['alternate'] = 'Alternate emails';
$string['are_you_sure'] = 'Are you sure you want to delete {$a->title}? This action cannot be reversed.';
$string['attachfile_help'] = 'Allow attaching of files to email';
$string['attachfile'] = 'Allow attachements being sent';
$string['attachment'] = 'Attachment(s)';
$string['clampmail:addinstance'] = 'Add a new Quickmail block';
$string['clampmail:allowalternate'] = 'Allows users to add an alternate email for courses.';
Expand Down
7 changes: 7 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
)
);

$settings->add(
new admin_setting_configselect('block_clampmail/attachfile',
get_string('attachfile', 'block_clampmail'), get_string('attachfile_help', 'block_clampmail'),
1, $select
)
);

$choices = array();
$choices[NOGROUPS] = get_string('groupsnone', 'group');
$choices[SEPARATEGROUPS] = get_string('groupsseparate', 'group');
Expand Down