Skip to content

Commit

Permalink
fixup! MDL-81924 core_sms: Add SMS gateway management UI
Browse files Browse the repository at this point in the history
  • Loading branch information
mickhawkins committed Sep 20, 2024
1 parent 8e0b75e commit 2d1f081
Showing 1 changed file with 0 additions and 105 deletions.
105 changes: 0 additions & 105 deletions sms/gateway/aws/classes/gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,109 +68,4 @@ public function send(
public function get_send_priority(message $message): int {
return 50;
}

/**
* Set form definition.
*
* @param MoodleQuickForm $mform Moodle form element.
* @return void
*/
public static function set_form_definition(
MoodleQuickForm $mform,
): void {
$codeslink = 'https://en.wikipedia.org/wiki/List_of_country_calling_codes';
$link = \html_writer::link($codeslink, $codeslink);
$mform->addElement(
'text',
'countrycode',
get_string('countrycode', 'smsgateway_aws'),
'maxlength="255" size="20"',
);
$mform->addHelpButton(
elementname: 'countrycode',
identifier: 'countrycode',
component: 'smsgateway_aws',
a: $link,
);
$mform->setDefault(
elementName: 'countrycode',
defaultValue: 0,
);

$gateways = [
'aws_sns' => get_string('aws_sns', 'smsgateway_aws'),
];
$mform->addElement(
'select',
'gateway',
get_string('gateway', 'smsgateway_aws'),
$gateways,
);
$mform->addHelpButton(
elementname: 'gateway',
identifier: 'gateway',
component: 'smsgateway_aws',
);
$mform->setDefault(
elementName: 'gateway',
defaultValue: 'aws_sns',
);

$mform->addElement(
'checkbox',
'usecredchain',
get_string('usecredchain', 'smsgateway_aws'),
);
$mform->setDefault(
elementName: 'usecredchain',
defaultValue: 0,
);

$mform->addElement(
'text',
'api_key',
get_string('api_key', 'smsgateway_aws'),
'maxlength="255" size="20"',
);
$mform->addHelpButton(
elementname: 'api_key',
identifier: 'api_key',
component: 'smsgateway_aws',
);
$mform->setDefault(
elementName: 'api_key',
defaultValue: '',
);

$mform->addElement(
'text',
'api_secret',
get_string('api_secret', 'smsgateway_aws'),
'maxlength="255" size="20"',
);
$mform->addHelpButton(
elementname: 'api_secret',
identifier: 'api_secret',
component: 'smsgateway_aws',
);
$mform->setDefault(
elementName: 'api_secret',
defaultValue: '',
);
$mform->addElement(
'text',
'api_region',
get_string('api_region', 'smsgateway_aws'),
'maxlength="255" size="20"',
);
$mform->addHelpButton(
elementname: 'api_region',
identifier: 'api_region',
component: 'smsgateway_aws',
);
$mform->setDefault(
elementName: 'api_region',
defaultValue: 'ap-southeast-2',
);
}
}

0 comments on commit 2d1f081

Please sign in to comment.