<?php
class Email extends CFormModel
{
	public $type;
	public $text;
	public $sendTo;
	public $template;
	
	public $ar_type = array('1'=>'945_own_template', '2'=>'946_ready_template');
	public $ar_sendTo = array('1'=>'947_all_clients', '2'=>'948_live_clients', '3'=>'949_demo_clients', '4'=>'950_yourself');
	public $ar_template = array('educational_video'=>'951_educational_video', 'bonus_reminder'=>'952_bonus_reminder');
	
	
	public function rules(){
   
		return array(
			array('template', 'required', 'on'=>'sendMail2User', 'message'=> Yii::t("main","36_cannot_be_blank")),
		);
	}
	
	public function attributeLabels(){
		return array(
			'type' => Yii::t("main",'942_letter_type'),
			'text' => Yii::t("main",'943_letter_text'),
			'sendTo' => Yii::t("main",'944_send_to'),
		);
	}
	
	public function getStaticArray($attribute){			
		$name = 'ar_'.$attribute;
		$data = array();
		foreach($this->$name as $key => $st_pr){
				$data[$key] = Yii::t("main", $st_pr);
		}
		return $data;
	}
}