1 <?php
2 3 4 5 6 7 8
9
10 class MapPage extends Page {
11 static $allowed_children = array('MapObjectGroup');
12
13 static $defaults = array(
14 'AutoChild' => 0,
15 );
16
17 function getCMSFields() {
18 $fields = parent::getCMSFields();
19 $sc = SiteConfig::current_site_config();
20 if (!$sc->isNeedMapApiKey()) {
21 $fields->addFieldToTab('Root.Content.Main', new LiteralField('NoMapApiKey', _t("SiteConfig.NoMapApiKeyMessage")));
22 }
23 return $fields;
24 }
25
26 public function canPublish($member = null) {
27 $can = parent::canPublish($member);
28 if (!SiteConfig::current_site_config()->isNeedMapApiKey()) {
29 $can = false;
30 }
31 return $can;
32 }
33
34 35 36 37 38
39
40
41 public function Groups() {
42 return DataObject::get('MapObjectGroup', "ParentID = {$this->ID}");
43 }
44 }
45
46 class MapPage_Controller extends Page_Controller {
47
48 }
49
50
[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.
-