/** * replace the tags in text messages * * a tag contains the column name for the value to use: [column_name] * * also processes the [record_link] tag * * @param string $text the unprocessed text with tags * * @return string the text with the replacements made * */ protected function _proc_tags($text) { return Participants_Db::replace_tags($text, $this->participant_values, $this->fields); /* if (empty($values)) { foreach ($this->fields as $column) { $tags[] = '[' . $column->name . ']'; $column->value = $this->participant_values[$column->name]; $values[] = PDb_FormElement::get_field_value_display($column, false); } } // add some extra tags foreach (array('id', 'private_id') as $v) { $tags[] = '[' . $v . ']'; $values[] = $this->participant_values[$v]; } $tags[] = '[record_link]'; $values[] = $this->registration_page; $tags[] = '[admin_record_link]'; $values[] = Participants_Db::get_admin_record_link($this->participant_values['id']); $placeholders = array(); for ($i = 1; $i <= count($tags); $i++) { $placeholders[] = '%' . $i . '$s'; } // replace the tags with variables $pattern = str_replace($tags, $placeholders, $text); // replace the variables with strings return vsprintf($pattern, $values); */ }