<?php

#
# XiVO Web-Interface
# Copyright (C) 2006-2017  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');
$url = &$this->get_module('url');
$context_list = $this->get_var('context_list');
$import_file = $this->get_var('import_file');

if($context_list === false):
  $dhtml = &$this->get_module('dhtml');
  echo	'<div id="fd-protocol-context" class="txt-center">',
	  $url->href_htmln($this->bbf('create_context'),
			  'service/ipbx/system_management/context',
			  'act=add'),
	  $dhtml->message_error($this->bbf('error_before_create_context'));
	  '</div>';
  return;
endif;

?>
<div id="sr-users" class="b-infos b-form">
	<h3 class="sb-top xspan">
		<span class="span-left">&nbsp;</span>
		<span class="span-center"><?=$this->bbf('title_content_name');?></span>
		<span class="span-right">&nbsp;</span>
	</h3>
	<?php
	$this->file_include('bloc/service/ipbx/asterisk/pbx_settings/users/submenu');
	?>

	<div class="sb-content">
		<form class="form-horizontal" action="#" method="post" accept-charset="utf-8" enctype="multipart/form-data"
			 onsubmit="dwho.form.select('it-group');
					dwho.form.select('it-queue');
					dwho.form.select('it-codec');">
<?php
		echo	$form->hidden(array('name'	=> 'max_file_size',
					    'value'	=> $import_file['size'])),
		
			$form->hidden(array('name'	=> DWHO_SESS_NAME,
					    'value'	=> DWHO_SESS_ID)),

			$form->hidden(array('name'	=> 'act',
					    'value'	=> 'add')),

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

		$this->file_include('bloc/service/ipbx/asterisk/pbx_settings/users/form');

		echo	$form->submit(array('name'	=> 'submit',
					    'id'	=> 'it-submit',
					    'value'	=> $this->bbf('fm_bt-save')));
?>
		</form>
	</div>
	<div class="sb-foot xspan">
		<span class="span-left">&nbsp;</span>
		<span class="span-center">&nbsp;</span>
		<span class="span-right">&nbsp;</span>
	</div>
</div>
