Guest User

Untitled

a guest
Apr 25th, 2018
80
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 ApplicantsHolder extends Page {
  4.  
  5. static $allowed_children = array ( 'Applicant' );
  6.  
  7. static $db = array(
  8. );
  9.  
  10. static $has_many = array(
  11. 'Applicants' => 'Applicant'
  12. );
  13.  
  14. function getCMSFields() {
  15. $fields = parent::getCMSFields();
  16.  
  17. $tablefield = new HasManyComplexTableField(
  18. $this,
  19. 'Applicants',
  20. 'Applicant',
  21. array(
  22. 'FirstName' => 'First Name',
  23. 'LastName' => 'Last Name',
  24. 'DateOfBirth' => 'Date of Birth'
  25. ),
  26. 'getCMSFields_forPopup'
  27. );
  28. $tablefield->setAddTitle( 'An Applicant' );
  29.  
  30. $fields->addFieldToTab( 'Root.Content.Applicants', $tablefield );
  31.  
  32. return $fields;
  33. }
  34.  
  35. }
  36.  
  37. class ApplicantsHolder_Controller extends Page_Controller {
  38.  
  39. }
Add Comment
Please, Sign In to add comment