You are here

function party_log_default_message_type in Party 7

Implements hook_default_message_type().

File

modules/party_log/party_log.module, line 33
Provide a framework for logging things that happen to and with parties.

Code

function party_log_default_message_type() {
  $items = array();

  // Log a message for the attaching and detaching of different data_sets.
  foreach (party_get_data_set_info() as $info) {
    $items['party_data_set_attach_' . $info['set_name']] = entity_import('message_type', '{
      "name" : "party_data_set_attach_' . $info['set_name'] . '",
      "description" : "Party Attach ' . $info['label'] . '",
      "argument_keys" : [ "@entity_label" ],
      "argument" : [],
      "category" : "party_log",
      "data" : {
        "token options" : { "clear" : 0 },
        "purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
      },
      "language" : "",
      "arguments" : null,
      "message_text" : { "und" : [
          {
            "value" : "Attached @entity_label to the ' . $info['label'] . ' data set.",
            "format" : "plain_text",
            "safe_value" : "\\u003Cp\\u003EAttached @entity_label to the ' . $info['label'] . ' data set.\\u003C\\/p\\u003E\\n"
          }
        ]
      },
      "rdf_mapping" : []
    }');
    $items['party_data_set_detach_' . $info['set_name']] = entity_import('message_type', '{
      "name" : "party_data_set_detach_' . $info['set_name'] . '",
      "description" : "Party Detach ' . $info['label'] . '",
      "argument_keys" : [ "@entity_label" ],
      "argument" : [],
      "category" : "party_log",
      "data" : {
        "token options" : { "clear" : 0 },
        "purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
      },
      "language" : "",
      "arguments" : null,
      "message_text" : { "und" : [
          {
            "value" : "Detached @entity_label from the ' . $info['label'] . ' data set.",
            "format" : "plain_text",
            "safe_value" : "\\u003Cp\\u003EDetached @entity_label to the ' . $info['label'] . ' data set.\\u003C\\/p\\u003E\\n"
          }
        ]
      },
      "rdf_mapping" : []
    }');
  }
  $items['party_merged_into'] = entity_import('message_type', '{
    "name" : "party_merged_into",
    "description" : "Party is merged into another party.",
    "argument_keys" : [ "@other_party_label" ],
    "argument" : [],
    "category" : "party_log",
    "data" : {
      "token options" : { "clear" : 0 },
      "purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
    },
    "language" : "",
    "arguments" : null,
    "message_text" : { "und" : [
        {
          "value" : "This record was merged into @other_party_label.",
          "format" : "plain_text",
          "safe_value" : "\\u003Cp\\u003EThis record was merged into @other_party_label.\\u003C\\/p\\u003E\\n"
        }
      ]
    },
    "rdf_mapping" : []
  }');
  $items['party_had_other_merged_in'] = entity_import('message_type', '{
    "name" : "party_had_other_merged_in",
    "description" : "Party had another party merged into it.",
    "argument_keys" : [ "@other_party_label" ],
    "argument" : [],
    "category" : "party_log",
    "data" : {
      "token options" : { "clear" : 0 },
      "purge" : { "override" : 0, "enabled" : 0, "quota" : "", "days" : "" }
    },
    "language" : "",
    "arguments" : null,
    "message_text" : { "und" : [
        {
          "value" : "@other_party_label was merged into this party.",
          "format" : "plain_text",
          "safe_value" : "\\u003Cp\\u003E@other_party_label was merged into this party.\\u003C\\/p\\u003E\\n"
        }
      ]
    },
    "rdf_mapping" : []
  }');
  return $items;
}