<?php

/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Contact\Site\Helper\RouteHelper;

$tparams = $this->item->params;
$canDo   = ContentHelper::getActions('com_contact', 'category', $this->item->catid);
$canEdit = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by === Factory::getUser()->id);
$htag    = $tparams->get('show_page_heading') ? 'h2' : 'h1';

$additionalFields = array();
foreach($this->item->jcfields as $field) {
	$additionalFields[$field->name] = $field->value;
}
?>

<div class="com-contact contact one-blog custom-width-container" itemscope itemtype="https://schema.org/Person">
	<div class="container">
		<?php 
			jimport( 'joomla.application.module.helper' ); 
			$module = JModuleHelper::getModules('breadcrumbs');
			$attribs['style'] = 'none';
			foreach($module as $moduleitem){
				echo JModuleHelper::renderModule($moduleitem, $attribs);
			}
		?>
		<div class="page-header minus-h1">
			<h1 class="minus-h1"><?php echo $this->escape($tparams->get('page_heading')); ?></h1>
		</div>
		<div class="minus30">
			<div class="com-contact__info">
				<div class="row">
					<div class="col-12 col-sm-6">
						<div class="item">
							<div class="title">Офис</div>
							<?php echo $this->loadTemplate('address'); ?>
						</div>
					</div>
					<div class="col-12 col-sm-6">
						<div class="item item-contact-form-box">
							<div class="title">Связаться с нами</div>
							<?php 
								jimport( 'joomla.application.module.helper' ); 
								$module = JModuleHelper::getModules('fos');
								$attribs['style'] = 'none';
								foreach($module as $moduleitem){
									echo JModuleHelper::renderModule($moduleitem, $attribs);
								}
							?>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<? if (isset($additionalFields['ymap']) and !empty($additionalFields['ymap'])) :?>
	<script src="//api-maps.yandex.ru/2.0/?load=package.standard,package.geoObjects&lang=ru-RU" type="text/javascript"></script>
	<div id="map" class="ymap"></div>
	<?php echo $additionalFields['ymap']; ?>
<?php endif; ?>