1 <?php
2
3 class HouseCatalogProductDecorator extends DataObjectDecorator {
4 function () {
5 return array(
6 'db' => array(
7 'Latitude' => 'Float',
8 'Longitude' => 'Float',
9 )
10 );
11 }
12
13 function updateCMSFields(& $fields) {
14 $tab = $fields->findOrMakeTab('Root.Content.Params');
15 $tab->push(new TextField('Latitude', $this->owner->FieldLabel('Latitude')));
16 $tab->push(new TextField('Longitude', $this->owner->FieldLabel('Longitude')));
17
18 $tab->push(new LiteralField('YandexMap', '<a href="#" class="popuplink" id="map_object_ymap_link">Указать объект на Яндекс.Карте</a>'));
19 $tab->push(new LiteralField('MapPageType', '<div state="not_loaded" id="map_object_ymap"></div>'));
20
21 Requirements::javascript('http://api-maps.yandex.ru/2.0/?load=package.full&lang=ru-RU');
22 Requirements::css('house_catalog/css/admin_object.css');
23 Requirements::javascript('house_catalog/js/admin_object.js');
24 }
25 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-