<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=projects.list.loop
 * [END_COT_EXT]
 */

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

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

$mavatar = new mavatar('projects', '', $item['item_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']++;
}

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