getObject($params); $other_recipients = $object->GetDBField('OtherRecipients'); $other_recipients = $other_recipients ? unserialize($other_recipients) : Array (); $ret = ''; $block_params = $this->prepareTagParams($params); $block_params['name'] = $params['render_as']; foreach ($other_recipients as $recipient_type => $recipients) { if ( $recipient_type == EmailTemplate::RECIPIENT_TYPE_TO ) { array_shift($recipients); } if ( $recipients ) { $block_params['recipient_type'] = $recipient_type; $block_params['recipients'] = $recipients; $ret .= $this->Application->ParseBlock($block_params); } } return $ret; } /** * Returns recipient type * * @param Array $params * @return string * @access protected */ protected function RecipientType($params) { $heading_mapping = Array ( EmailTemplate::RECIPIENT_TYPE_TO => 'To', EmailTemplate::RECIPIENT_TYPE_CC => 'Cc', EmailTemplate::RECIPIENT_TYPE_BCC => 'Bcc', ); $recipient_type = $this->Application->Parser->GetParam('recipient_type'); return $heading_mapping[$recipient_type]; } /** * Prints recipients * * @param Array $params * @return string * @access protected */ protected function RecipientsByType($params) { /** @var Array $recipients */ $recipients = $this->Application->Parser->GetParam('recipients'); $ret = ''; $block_params = $this->prepareTagParams($params); $block_params['name'] = $params['render_as']; $recipient_count = count($recipients); foreach ($recipients as $index => $recipient) { $block_params['recipient_name'] = $recipient['name'] ? $recipient['name'] : $recipient['email']; $block_params['recipient_email'] = $recipient['email']; $block_params['is_last'] = $index == $recipient_count - 1; $ret .= $this->Application->ParseBlock($block_params); } return $ret; } /** * Creates link to an item including only it's id * * @param Array $params * @return string * @access protected */ protected function ItemLink($params) { $access_key = $this->Application->Parser->GetParam('email_access_key'); if ( !$access_key ) { return parent::ItemLink($params); } $params['authkey'] = $access_key; if ( $this->Application->isAdmin ) { // $params['index_file'] = 'index.php'; $params['prefix'] = '_FRONT_END_'; if ( $this->Application->ConfigValue('UseModRewrite') ) { $params['__MOD_REWRITE__'] = 1; } } return $this->Application->ProcessParsedTag('m', 't', $params); } }