Guest User

Untitled

a guest
May 27th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. <?php
  2.  
  3. class LocationDetails extends Page {
  4. static $db = array(
  5. 'CBLocTitle' => 'Text',
  6. 'CBLocAdd1' => 'Text',
  7. 'CBLocAdd2' => 'Text',
  8. 'CBLocCity' => 'Text',
  9. 'CBLocPostal' => 'Text',
  10. 'CBLocPhone' => 'Text',
  11. 'CBLocFax' => 'Text',
  12. 'CBLocEmail' => 'Text',
  13. 'CBLocContactName' => 'Text',
  14. 'CBLocContactEmail' => 'Text',
  15. 'CBLocMapLink' => 'Text'
  16. );
  17. static $has_one = array(
  18. 'CBLocContactPortrait' => 'Image',
  19. 'CBLocMap' => 'Image'
  20.  
  21. );
  22.  
  23. function getCMSFields() {
  24. $fields = parent::getCMSFields();
  25.  
  26. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocTitle','Location Title:'));
  27. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocAdd1', 'Address Line 1:'));
  28. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocAdd2', 'Address Line 2:'));
  29. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocCity', 'City:'));
  30. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocPostal', 'Postal Code:'));
  31. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocPhone', 'Phone:'));
  32. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocFax', 'Fax:'));
  33. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocEmail', 'Center Email:'));
  34. $fields->addFieldToTab("Root.Content.Location", new ImageField('CBLocMap', 'Map'));
  35. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocContactName', 'Main Center Contact:'));
  36. $fields->addFieldToTab("Root.Content.Location", new TextField('CBLocContactEmail', 'Main Center Contact Email:'));
  37. $fields->addFieldToTab("Root.Content.Location", new ImageField('CBLocContactPortrait', 'Portrait'));
  38.  
  39. return $fields;
  40. }
  41.  
  42.  
  43. }
  44.  
  45. class LocationDetails_Controller extends Page_Controller {
  46. function init() {
  47. parent::init();
  48.  
  49.  
  50.  
  51. }
  52. }
  53.  
  54. ?>
Add Comment
Please, Sign In to add comment