<?php

/* ====================
  [BEGIN_COT_EXT]
  Hooks=admin.config.edit.loop
  [END_COT_EXT]
  ==================== */

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

require_once cot_langfile('notifyMarket', 'plug', 'ru');
$adminhelp = $L['eventseshop_help'];

if ($p == 'notifyMarket' && $row['config_name'] == 'groups' && $cfg['jquery']) {
    $sskin = cot_tplfile('notifyMarket.admin.config', 'plug', true);
    $tt = new XTemplate($sskin);

    $tpaset = explode(",", $row['config_value']);

    $jj = 0;
    foreach ($tpaset as $k) {
        $tt->assign(array(
            'ADDNUM' => $jj,
            'ADDGROUP' => cot_selectbox_groups($k, 'group' . $jj, array(1, 2, 3))
        ));
        $tt->parse('MAIN.ADDITIONAL');
        $jj++;
    }

    $jj++;
    $tt->assign(array(
        'CATNUM' => $jj
    ));
    $tt->parse('MAIN');
    $version = (int) str_replace(".", '', $cfg["version"]);
    
    if ($version <= 920) {
        $t->assign(array(
            'ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row) . $tt->text('MAIN'),
        ));
    } else {
        $t->assign(array(
            'ADMIN_CONFIG_ROW_CONFIG' => cot_config_input($row['config_name'], $row['config_type'], $row['config_value'], $row['config_variants']) . $tt->text('MAIN'),
        ));
    }
}