Guest User

Untitled

a guest
Jul 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. class ReferencePage extends Page {
  4.  
  5. public static $db = array(
  6. 'Address' => 'Text',
  7. 'Country' => 'Text',
  8. 'Mission' => 'Text',
  9. 'Website' => 'Text'
  10. );
  11.  
  12. public static $has_one = array();
  13.  
  14. function getCMSFields() {
  15.  
  16. $fields = parent::getCMSFields();
  17.  
  18. $fields->removeFieldFromTab(
  19. 'Root.Content.Main',
  20. 'Content'
  21. );
  22.  
  23. $fields->addFieldsToTab(
  24. 'Root.Content.Main',
  25. array(
  26. new TextField('Address'),
  27. new TextField('Country', 'Country in ISO 3166 Code (see parent page help)', null, 2),
  28. new TextField('Mission'),
  29. new TextField('Website')
  30. )
  31. );
  32.  
  33. return $fields;
  34.  
  35. }
  36.  
  37. }
  38.  
  39. class ReferencePage_Controller extends Page_Controller {
  40.  
  41. }
  42.  
  43. ?>
Add Comment
Please, Sign In to add comment