Index: branches/5.1.x/core/units/email_messages/email_message_tp.php =================================================================== diff -u -N --- branches/5.1.x/core/units/email_messages/email_message_tp.php (revision 13086) +++ branches/5.1.x/core/units/email_messages/email_message_tp.php (revision 0) @@ -1,71 +0,0 @@ -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); - } - - /** - * Removes "Enabled" column, when not in debug mode - * - * @param Array $params - */ - function ModifyUnitConfig($params) - { - if (!$this->Application->isDebugMode()) { - $grids = $this->Application->getUnitOption($this->Prefix, 'Grids'); - - foreach ($grids as $grid_name => $grid_data) { - if (array_key_exists('Enabled', $grid_data['Fields'])) { - unset($grids[$grid_name]['Fields']['Enabled']); - } - } - - $this->Application->setUnitOption($this->Prefix, 'Grids', $grids); - } - } - } \ No newline at end of file