<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=ds.history.resend
 * [END_COT_EXT]
 */

defined('COT_CODE') or die('Wrong URL');

require_once cot_incfile('mavatars', 'plug');
global $db_mavatar;

$mavatar = new mavatar('ds', $resend_msg['did'], $resend_msg['mid'], '', $mav_rowset_list);
$mavatars_tags = $mavatar->tags();

$mavtgs = array();
$mavtgs['MAVATAR'] = array();
$mavtgs['MAVATARCOUNT'] = 0;

foreach($mavatars_tags as $mavtg) {
  $mavtg['FILEEXTICON'] = 'doc';
  if(cot_mavatar_is_photo($mavtg['FILEEXT'])) {
    $mavtg['FILEEXTICON'] = 'image';
  } elseif(cot_mavatar_is_audio($mavtg['FILEEXT'])) {
    $mavtg['FILEEXTICON'] = 'audio';
  } elseif($mavtg['FILEEXT'] == 'zip' || $mavtg['FILEEXT'] == 'rar') {
    $mavtg['FILEEXTICON'] = 'zip';
  }
  $mavtgs['MAVATAR'][] = $mavtg;
  $mavtgs['MAVATARCOUNT']++;
}

$t->assign('DS_RESEND_MAVATARS', $mavtgs);