<? _title($this, $this->Language('Edit message'), array(array('href' => '?page=messages', 'name' => 'All messages'))); ?>

<? $row = $this->templates->assoc(); ?>
<form method="post">
<table class="header" style="float:left;">

<tr>
	<th><?=$this->Language('name', true);?></th>
	<td><input type="hidden"    name="id" value="<?=$row['id']?>"><?=$row['name']?></td>
</tr>


<tr>
	<th><?=$this->Language('language', true);?></th>
	<td><select name="language">
	<?
	while($row2 = $this->language_menus->Assoc()){

		$selected = '';
		if($row2['key'] == $row['language']) $selected = 'selected="selected"';

		echo '<option value="'.$row2['key'].'" '.$selected.'>'.$row2['language'].'</option>';
	}
	?></select></td>
</tr>


<tr>
	<th><?=$this->Language('type', true);?></th>
	<td><select name="type">
	<?
	foreach($this->message_types as $row2){

		$selected = '';
		if($row2['name'] == $row['type']) $selected = 'selected="selected"';

		echo '<option value="'.$row2['name'].'" '.$selected.'>'.$row2['name'].'</option>';
	}
	?></select></td>
</tr>


<tr>
	<th><?=$this->Language('subject', true);?></th>
	<td><input type="text"    name="subject" value="<?=$row['subject']?>"></td>
</tr>


<tr>
	<th><?=$this->Language('from_name', true);?></th>
	<td><input type="text"    name="from_name" value="<?=$row['from_name']?>"></td>
</tr>


<tr>
	<th><?=$this->Language('from_email', true);?></th>
	<td><input type="text"    name="from_email" value="<?=$row['from_email']?>"></td>
</tr>




<tr>
	<th><?=$this->Language('from phone', true);?></th>
	<td><input type="text"    name="from_phone" value="<?=$row['from_phone']?>"></td>
</tr>


<tr>
	<th><?=$this->Language('is_active', true);?></th>
	<td><input type="checkbox"    name="is_active" value="1" <?=($row['is_active'] ==1 ? 'checked' : '');?>></td>
</tr>

<tr>
	<td></td>
	<td><input type="submit"    name="update" value="<?=$this->Language('Update');?>"></td>
</tr>
</table>

<table style="float:left;">
<tr>
	<td><?=$this->Editor->ckeditor(550, 425, 'content', $row['content']);?></td>
</tr>
</table>

<div style="clear:both;"></div>
</form>