Guest User

Untitled

a guest
May 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <?php
  2.  
  3. class GoogleMapXML extends Page {
  4. static $icon = "themes/xtreme-diving/images/treeicons/xml";
  5.  
  6. static $has_many = array(
  7. 'GoogleMapXML' => 'GoogleMapObject'
  8. );
  9.  
  10. function getCMSFields() {
  11. $fields = parent::getCMSFields();
  12.  
  13. $fields->addFieldToTab( 'Root.Content.Main', new TextField( 'NameOfSite' ) );
  14. $fields->addFieldToTab( 'Root.Content.Main', new TextField( 'StartPoint' ) );
  15. $fields->addFieldToTab( 'Root.Content.Main', new TextField( 'EndPoint' ) );
  16. $fields->addFieldToTab( 'Root.Content.Main', new TextField( 'Zoom' ) );
  17. $fields->addFieldToTab( 'Root.Content.Main', new TextField( 'Text' ) );
  18.  
  19. $tablefield = new HasManyComplexTableField(
  20. $this,
  21. 'GoogleMapXML',
  22. 'GoogleMapObject',
  23. array(
  24. 'NameOfSite' => 'Divesite',
  25. 'StartPoint' => 'Start Latitude/Longitude',
  26. 'EndPoint' => 'End Latitude/Longitude',
  27. 'Zoom' => 'Zoom level',
  28. 'Text' => 'Text'
  29. ),
  30. 'getCMSFields_forPopup'
  31. );
  32. $tablefield->setAddTitle( 'Add divesite' );
  33. //$tablefield->setParentIdName('GoogleMapXMLID');
  34.  
  35. $fields->addFieldToTab( 'Root.Content.GoogleMapObject', $tablefield );
  36.  
  37.  
  38. return $fields;
  39. }
  40.  
  41. }
  42.  
  43. class GoogleMapXML_Controller extends Page_Controller {
  44. }
  45.  
  46. ?>
Add Comment
Please, Sign In to add comment