<?php

/**
 * [BEGIN_COT_EXT]
 * Hooks=certificatestags.main
 * [END_COT_EXT]
 */

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

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

$mavatar = new mavatar('certificates', '', $item_data['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';
    $mavtgs['MAVATAR'][] = $mavtg;
    $mavtgs['MAVATARCOUNT']++;
  }
}

$temp_array['MAVATARS'] = $mavtgs;