Application->RecallVar('recipient_type'); $block_params = $this->prepareTagParams($params); $block_params['name'] = $params['render_as']; $recipients = $this->getRecipients($recipient_type); $recipient_count = count($recipients); $ret = ''; foreach ($recipients as $recipient_index => $recipient_name) { $block_params['recipient_name'] = $recipient_name; $block_params['not_last'] = $recipient_index < $recipient_count - 1; $ret .= $this->Application->ParseBlock($block_params); } return $ret; } function getRecipients($prefix) { $id_field = $this->Application->getUnitOption($prefix, 'IDField'); $table_name = $this->Application->getUnitOption($prefix, 'TableName'); $recipient_ids = $this->Application->RecallVar('recipient_ids'); $sql = 'SELECT '.($prefix == 'u' ? 'Email' : 'Name').' FROM '.$table_name.' WHERE '.$id_field.' IN ('.$recipient_ids.')'; return $this->Conn->GetCol($sql); } } ?>