<?php

#
# XiVO Web-Interface
# Copyright (C) 2006-2018  Avencall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

$form	 = &$this->get_module('form');
$dhtml 	 = &$this->get_module('dhtml');
$element = $this->get_var('element');

?>

<div class="b-infos b-form">

<breadcrumb
        page="<?=$this->bbf('title_content_name');?>">
</breadcrumb>

<div class="sb-content">
<form class="form-horizontal" action="#" method="post" accept-charset="utf-8">

<div id="sb-part-first">
<?php
	echo	$form->hidden(array('name'	=> DWHO_SESS_NAME,
				    'value'	=> DWHO_SESS_ID)),

		$form->hidden(array('name'	=> 'fm_send',
				    'value'	=> 1)),

		$form->text(array('desc'	=> $this->bbf('fm_mydomain'),
				  'name'	=> 'mydomain',
				  'labelid'	=> 'mydomain',
				  'size'	=> 30,
				  'default'	=> $element['mail']['mydomain']['default'],
				  'value'	=> $this->get_var('info','mydomain'),
				  'help'    => $this->bbf('help-mydomain'),
				  'error'	=> $this->bbf_args('error',
						   $this->get_var('error', 'xivo-smtp-mydomain')) )),

		$form->text(array('desc'	=> $this->bbf('fm_origin'),
				  'name'	=> 'origin',
				  'labelid'	=> 'origin',
				  'size'	=> 30,
				  'default'	=> $element['mail']['origin']['default'],
				  'value'	=> $this->get_var('info','origin'),
				  'error'	=> $this->bbf_args('error',
						   $this->get_var('error', 'xivo-smtp-origin')) )),

		$form->text(array('desc'	=> $this->bbf('fm_relayhost'),
				  'name'	=> 'relayhost',
				  'labelid'	=> 'relayhost',
				  'size'	=> 30,
				  'default'	=> $element['mail']['relayhost']['default'],
				  'value'	=> $this->get_var('info','relayhost'),
				  'error'	=> $this->bbf_args('error',
						   $this->get_var('error', 'xivo-smtp-relayhost')) )),

		$form->text(array('desc'	=> $this->bbf('fm_fallback_relayhost'),
				  'name'	=> 'fallback_relayhost',
				  'labelid'	=> 'fallback_relayhost',
				  'size'	=> 30,
				  'default'	=> $element['mail']['fallback_relayhost']['default'],
				  'value'	=> $this->get_var('info','fallback_relayhost'),
				  'error'	=> $this->bbf_args('error',
						   $this->get_var('error', 'xivo-smtp-fallback_relayhost')) ));
?>
	<div class="col-sm-offset-2 fm-paragraph fm-description">
		<p>
			<label id="lb-description" for="it-description"><?=$this->bbf('fm_canonical');?></label>
		</p>
		<?=$form->textarea(array('paragraph'	=> false,
					 'label'	=> false,
					 'name'		=> 'canonical',
					 'id'		=> 'it-canonical',
					 'cols'		=> 60,
					 'rows'		=> 5,
					 'default'	=> $element['mail']['canonical']['default']),
				   $this->get_var('info','canonical'));?>
	</div>
</div>
<?php

echo	$form->submit(array('name'	=> 'submit',
			    'id'	=> 'it-submit',
			    'value'	=> $this->bbf('fm_bt-save')));

?>
</form>
	</div>
	<div class="sb-foot xspan"></div>
