You are here

function workbench_email_features_export_options in Workbench Email 7.3

Same name and namespace in other branches
  1. 7 workbench_email.features.inc \workbench_email_features_export_options()

Implements COMPONENT_features_export_options().

Inform features about the available email transitions in the database.

File

./workbench_email.features.inc, line 12
Features file for Workbench Email Module

Code

function workbench_email_features_export_options() {
  $options = array();
  $workbench_emails = workbench_email_get();
  foreach ($workbench_emails as $transition_label => $email_transition_set) {
    foreach ($email_transition_set as $rid => $email_transition) {
      if ($rid == WORKBENCH_EMAIL_AUTHOR) {
        $role = workbench_email_get_author_role();
      }
      else {
        $role = user_role_load($rid);
      }
      $options[$email_transition->from_name . ':' . $email_transition->to_name . '::' . str_replace('_', ' ', strtolower($role->name))] = $role->name . ': ' . $email_transition->from_name . ' to ' . $email_transition->to_name;
    }
  }
  return $options;
}