You are here

public function MailhandlerCommandsDefault::getMappingSources in Mailhandler 7.2

Same name and namespace in other branches
  1. 6.2 plugins/mailhandler/commands/MailhandlerCommandsDefault.class.php \MailhandlerCommandsDefault::getMappingSources()

Implements getMappingSources().

Overrides MailhandlerCommands::getMappingSources

File

plugins/mailhandler/commands/MailhandlerCommandsDefault.class.php, line 96
MailhandlerCommandsDefault class.

Class

MailhandlerCommandsDefault
Provides default commands.

Code

public function getMappingSources($config) {
  $sources = array();
  $sources['body_text'] = array(
    'name' => t('Body (Text)'),
    'description' => t('Plain-text message body. Will fall back to HTML body if necessary.'),
  );
  $sources['body_html'] = array(
    'name' => t('Body (HTML)'),
    'description' => t('HTML message body. Will fall back to text body if necessary.'),
  );
  $available_commands = explode("\n", $config['available_commands']);
  foreach ($available_commands as $command) {
    $command = trim($command);
    $sources[$command] = array(
      'name' => $command,
      'description' => $command . ' (commanded)',
    );
  }
  return $sources;
}