<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=marketorders.order.track.loop
 * [END_COT_EXT]
 */

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

require_once cot_incfile('mavatars', 'plug');

if(in_array($mkt['t_code'], array('market_msg', 'seller_check_order', 'seller_to_arbitrage', 'payer_to_arbitrage')))
{
  $mavatar = new mavatar('marketorders', 'msg', $mkt['t_id'], '', $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']++;

    $market_files['MAVATAR'][] = $mavtg;
    $market_files['MAVATARCOUNT']++;
  }

  $t->assign('MKT_MAVATARS', $mavtgs);
}
