Как реализовать в Мапсе
версия cms 2.7.2
А сейчас в развёрнутом виде выводится?
В инстант мапсе она всегда в развернутом виде… на странице объекта
В мапс особо не вникал, но вроде карта должна быть виджетом.Или нет?
нет… карта выводится на странице объекта
$options = $ctype['places-options'];
$this->addCSS($this->getStylesFileName('places'));
$this->addJS('templates/default/js/maps/systems/'.$options['system'].'.js');
$this->addJS('templates/default/js/maps/list.js');
$city = $options['is_city_filter']? cmsUser::sessionGet('maps-city'): false;
$city_name = $city? $city['name']: LANG_PLACES_CITY_SELECT;
$city_full = $city? implode(', ', array($city['country'], $city['region'], $city['name'])): false;
$center = empty($city['lat'])? explode(':', $options['center']): array($city['lat'], $city['lng']);
$map_filter = $filters;
if (!empty($category_id)) { $map_filter['category_id'] = $category_id; }
if (!empty($dataset)) { $map_filter['dataset'] = $dataset; }
if ($city) { $map_filter['city_id'] = $city['id']; }
if (!empty($filters['user_id'])){
$options['is_city_filter'] = false;
$options['zoom'] = $options['min_zoom'];
unset($map_filter['city_id']);
}
$core = cmsCore::getInstance();
if ($core->uri_controller == 'tags' && $core->uri_action == 'search'){
$map_filter['tag'] = $core->request->get('q');
}
$map_filter = http_build_query($map_filter);
if( $ctype['options']['list_show_filter'] ) {
$this->renderAsset('ui/filter-panel', array(
'css_prefix' => $ctype['name'],
'page_url' => $page_url,
'fields' => $fields,
'props_fields' => $props_fields,
'props' => $props,
'filters' => $filters,
'is_expanded' => $ctype['options']['list_expand_filter']
));
}
if ($user->is_admin){
$this->addToolButton(array(
'class' => 'settings',
'title' => LANG_PLACES_SETTINGS,
'href' => href_to('admin', 'controllers', array('edit', 'places'))
));
}
?>
<div id="maps-map-block">
<?php if ($options['is_city_filter']) { ?>
<div id="maps-city-selector">
<a class="ajaxlink ajax-modal" href="<?php echo href_to('places', 'city_select'); ?>" title="<?php echo LANG_PLACES_CITY_SELECT; ?>"><?php echo $city_name; ?></a>
</div>
<?php } ?>
<div id="map-canvas" style="height: <?php echo $options['height']; ?>px"></div>
</div>
<script>
icms.mapsList.init('map-canvas', {
zoom: <?php echo $options['zoom'] + 1; ?>,
min_zoom: <?php echo $options['min_zoom'] + 1; ?>,
max_zoom: <?php echo $options['max_zoom'] + 1; ?>,
center: [<?php echo nf($center[0], 4); ?>, <?php echo nf($center[1], 4); ?>],
city_addr: <?php echo $city_full && empty($city['lat'])? "'{$city_full}'": 'false'; ?>,
city_id: <?php echo $city? $city['id']: 'false'; ?>,
map_type: '<?php echo $options['map_type']; ?>',
map_type_select: <?php echo $options['map_type_select']? 'true': 'false'; ?>,
scroll_zoom: <?php echo $options['scroll_zoom']? 'true': 'false'; ?>,
bounds: <?php echo $options['mk_bounds']? 'true': 'false'; ?>,
filter: '<?php echo $map_filter; ?>',
load_url: '<?php echo href_to('places', 'markers'); ?>',
icons_url: '<?php echo cmsConfig::get('upload_host'). '/markers'; ?>',
balloon_url: '<?php echo href_to('places', 'balloon'); ?>',
city_save_url: '<?php echo href_to('places', 'city_save'); ?>',
delay: '<?php echo $options['mk_delay']; ?>'
});
</script>
<?php if ($items){ ?>
<div class="tcompact_maps <?php echo $ctype['name']; ?>_tlist">
<?php foreach($items as $item){ ?>
<div class="t_c_group">
<?php
$label = false;$c = 1;
if(isset($item['is_vip']) && $item['is_vip']){$label = '✫✫✫';}
if(isset($item['label']) && $item['label']){
$label = $item['label'];
$c = rand(1, 5);
}
?>
<?php if($label){ ?>
<div class="t_c_block_polosa">
<div class="t_c_polosa color_<?php html($c); ?>"><?php html($label); ?></div>
</div>
<?php } ?>
<div class="t_c_group-img">
<?php if (isset($fields['photo']) && $item['photo']){ ?>
<?php echo html_image($item['photo'], 'normal', $item['title']); ?>
<?php } else { ?>
<span class="t_c_nophoto"><i class="fa fa-camera"></i><br><br>Нет изображения</span>
<?php } ?>
<div class="t_c_group-title">
<a href="<?php echo href_to($ctype['name'], $item['slug'].'.html'); ?>">
<?php html($item['title']); ?>
</a>
<?php if ($item['addrs']){ ?>
<?php $address = cmsModel::yamlToArray($item['addrs']); ?>
<div class="t_c_group_ico">
<i class="fa fa-map-marker"></i>
<span class="t_c_text">
<?php html($address[key($address)]); ?>
</span>
</div>
<?php } ?>
</div>
</div>
<div class="t_c_group-desc"><?php html(mb_strimwidth($item['teaser'], 0, 100, "...")); ?></div>
<div class="t_c_group-bott">
<?php if ($options['reviews_on']){ ?>
<i class="fa fa-comments-o"></i> <?php echo html_spellcount($item['reviews_count'], LANG_PLACES_REVIEW_SPELLCOUNT); ?>
<?php } else { ?>
<i class="fa fa-calendar"></i> <?php html(string_date_age_max($item['date_pub'], true)); ?>
<?php } ?>
<span class="pull-right c_maps_rating">
<?php if ($options['reviews_on'] && $options['reviews_rating']){ ?>
<?php
$value = $item['rating_avg'];
$rating = $value;
$value *= 10; $step = 0.5 * 10;
$value = (round($value)%$step === 0)? round($value): round(($value+$step/2)/$step)*$step;
$value = $value / 10;
?>
<?php for($s=1; $s<=5; $s++) { ?>
<?php
if ($value >= 1) { $class = 'star'; $value -= 1; } else
if ($value >= 0.5) { $class = 'star-half-o'; $value -= 0.5; } else
{ $class = 'star-o'; $value -= 0.5; }
?>
<i class="fa fa-<?php echo $class; ?>"></i>
<?php } ?>
<?php } ?>
</span>
</div>
</div>
<?php } ?>
</div>
<?php if ($perpage < $total) { ?>
<?php echo html_pagebar($page, $perpage, $total, $page_url, $filters); ?>
<?php } ?>
<?php } else { echo LANG_LIST_EMPTY; } ?>
Дайте ссылку на страницу. И уберите код под спойлер.
lifeofcrimea.info/places/2-dostavka-pro100roll.html
Дайте ссылку на страницу. И уберите код под спойлер.