<?php
/* 2011-10-06 11:45:48 chayn1k [3DaVinci] */

class dv_imoney_templates {
	protected $templates;
	protected $MODULE_PATH;

	public function __construct($module_path = '') {
		/*
		if ($module_path !== '') $this->MODULE_PATH = $module_path;
		$MODULE_PATH = $this->MODULE_PATH;
		$nc_core = nc_Core::get_object();
		$settings = $nc_core->get_settings('','3dvimoney');
		*/

		// Шаблон кнопки оплаты
		$this->templates['pay_button'] =
			"<form method='post' name='dv_imoney_pay' class='dv_imoney_pay' action='https://merchant.intellectmoney.ru/ru/' >\n".
				"<input type='hidden' id='orderId' value='\$orderId' name='orderId'/>\n".
				"<input type='hidden' id='eshopId' value='\$eshopId' name='eshopId'/>\n".
				"<input type='hidden' id='serviceName' value='\$serviceName' name='serviceName'/>\n".
				"<input type='hidden' id='recipientAmount' value='\$recipientAmount' name='recipientAmount'/>\n".
				"<input type='hidden' value='\$recipientCurrency' name='recipientCurrency'/>\n".
				"<input type='hidden' value='\$successUrl' name='successUrl'/>\n".
				"<input type='hidden' value='\$failUrl' name='failUrl'/>\n".
				"<input type='hidden' value='\$preference' name='preference'/>\n".
				"<input type='hidden' id='userName' value='\$userName' name='userName'/>\n".
				"<input type='hidden' id='userEmail' value='\$userEmail' name='userEmail'/>\n".
				"<input type='hidden' id='hash' value='\$hash' name='hash'/>\n".
				"<input type='submit' class='submit' value='".DV_IMONEY_PAYMENT_BUTTON."' />\n".
			"</form>".
			"<script language='JavaScript'>
				var old_onload = window.onload;
				window.onload = function(){
					if(old_onload) old_onload();
					setTimeout('document.dv_imoney_pay.submit()',1000);
				};
			</script>";

		$this->templates['pay_form'] =
			"<form method='post' name='dv_imoney_pay' class='dv_imoney_pay' action='https://merchant.intellectmoney.ru/ru/' >\n".
				"<input type='hidden' readonly id='orderId' value='\$orderId' name='orderId'/>\n".
				"<input type='hidden' readonly id='eshopId' value='\$eshopId' name='eshopId'/>\n".
				"<p><label for='serviceName'>".DV_IMONEY_PAYMENT_SERVICE_NAME."</label><br>\n".
				"<input type='\$type' readonly id='serviceName' value='\$serviceName' name='serviceName'/></p>\n".
				"<p><label for='recipientAmount'>".DV_IMONEY_PAYMENT_RECIPIENT_AMOUNT."</label><br>\n".
				"<input type='\$type' readonly id='recipientAmount' value='\$recipientAmount' name='recipientAmount'/></p>\n".
				"<input type='hidden' readonly value='\$recipientCurrency' name='recipientCurrency'/>\n".
				"<input type='hidden' readonly value='\$successUrl' name='successUrl'/>\n".
				"<input type='hidden' readonly value='\$failUrl' name='failUrl'/>\n".
				"<input type='hidden' readonly value='\$preference' name='preference'/>\n".
				"<p><label for='userName'>".DV_IMONEY_PAYMENT_USER_NAME."</label><br>\n".
				"<input type='\$type' id='userName' value='\$userName' name='userName'/></p>\n".
				"<p><label for='userEmail'>".DV_IMONEY_PAYMENT_USER_EMAIL."</label><br>\n".
				"<input type='\$type' id='userEmail' value='\$userEmail' name='userEmail'/></p>\n".
				"<input type='hidden' readonly id='hash' value='\$hash' name='hash'/>\n".
				"<input type='submit' class='submit' value='".DV_IMONEY_PAYMENT_BUTTON."' />\n".
			"</form>";

	}




	public function __get($name) {
		if ($name == 'templates') {
			return $this->templates;
		}
	}
}
?>
