<?php
/**
* @version	$Id: coupons_tag_processor.php 12739 2009-10-20 19:38:22Z alex $
* @package	In-Commerce
* @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license	Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/

	defined('FULL_PATH') or die('restricted access!');

	class CouponsTagProcessor extends kDBTagProcessor {

		function LastCloneCount($params){

			$clone_count = $this->Application->RecallVar('CoupLastCloneCount');
			if (!$clone_count){
				$clone_count = 1;
			}
			return $clone_count;
		}

		function DefaultExpDate($params){
			$object = &$this->Application->recallObject($this->getPrefixSpecial());
			$formatter =& $this->Application->makeClass('kDateFormatter');
			return $formatter->Format( adodb_mktime() + $this->Application->ConfigValue('Comm_DefaultCouponDuration') * 3600 * 24, 'Expiration_date', $object);
		}

		function DefaultExpTime($params){
			$object = &$this->Application->recallObject($this->getPrefixSpecial());
			$formatter =& $this->Application->makeClass('kDateFormatter');
			return $formatter->Format( adodb_mktime() + $this->Application->ConfigValue('Comm_DefaultCouponDuration') * 3600 * 24, 'Expiration_time', $object);
		}
	}