You are here

private function HeartbeatActivity::rebuild_arguments in Heartbeat 7

Same name and namespace in other branches
  1. 6.4 includes/heartbeatactivity.inc \HeartbeatActivity::rebuild_arguments()
  2. 6.3 includes/heartbeatactivity.inc \HeartbeatActivity::rebuild_arguments()

Rebuild the arguments for variables to share within this object

Parameters

array $raw_input of arguments:

1 call to HeartbeatActivity::rebuild_arguments()
HeartbeatActivity::_save in includes/heartbeatactivity.inc
Save activity log

File

includes/heartbeatactivity.inc, line 558
HeartbeatActivity object Defines one heartbeat activity object.

Class

HeartbeatActivity
Class defines an activity message object

Code

private function rebuild_arguments($raw_input) {
  $args = array();

  // Rebuild arguments with language tokens
  foreach ($this->variables as $key => $value) {
    $value = filter_xss($value);

    // Leave $key[0] == "!"  asis
    if ($key[0] != "@" || $key[0] != "!") {
      continue;

      // bad argument
    }
    $oldkey = $key;

    // if argument is prefilled, override
    if (isset($raw_input[$oldkey])) {
      $args[$key] = $raw_input[$oldkey];
      continue;
    }

    // Argument gets the value as in variables
    $args[$key] = $value;
  }
  return $args;
}