Guest User

Untitled

a guest
Apr 16th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <?php
  2.  
  3. class QuickLinkColumn extends Page {
  4.  
  5. static $db = array(
  6. 'QLSectionHeader1' => 'Text',
  7. 'QLSectionHeader2' => 'Text'
  8. );
  9.  
  10. static $many_many = array(
  11. 'QLSection1' => 'QuickLink',
  12. 'QLSection2' => 'QuickLink'
  13. );
  14.  
  15. function getCMSFields() {
  16. $fields = parent::getCMSFields();
  17.  
  18. $QLSection1tablefield = new ManyManyComplexTableField(
  19. $this,
  20. 'QLSection1',
  21. 'QuickLink',
  22. array(
  23. 'QuickLinkName' => 'Link Name',
  24. 'QuickLinkTitle' => 'Link Title',
  25. 'QuickLinkLocation' => 'Link URL'
  26. ),
  27. 'getCMSFields_forPopup'
  28. );
  29. $QLSection1tablefield->setAddTitle( 'A Link' );
  30. $QLSection1tablefield->setPageSize(100);
  31.  
  32. $QLSection2tablefield = new ManyManyComplexTableField(
  33. $this,
  34. 'QLSection2',
  35. 'QuickLink',
  36. array(
  37. 'QuickLinkName' => 'Link Name',
  38. 'QuickLinkTitle' => 'Link Title',
  39. 'QuickLinkLocation' => 'Link URL'
  40. ),
  41. 'getCMSFields_forPopup'
  42. );
  43. $QLSection2tablefield->setAddTitle( 'A Link' );
  44. $QLSection2tablefield->setPageSize(100);
  45.  
  46. $fields->addFieldToTab( 'Root.Content.Section1', new TextField( 'QLSectionHeader1' ) );
  47. $fields->addFieldToTab( 'Root.Content.Section1', $QLSection1tablefield );
  48. $fields->addFieldToTab( 'Root.Content.Section2', new TextField( 'QLSectionHeader2' ) );
  49. $fields->addFieldToTab( 'Root.Content.Section2', $QLSection2tablefield );
  50.  
  51. return $fields;
  52. }
  53.  
  54. }
  55.  
  56. class QuickLinkColumn_Controller extends Page_Controller {
  57. function index() {
  58. Director::redirect("home/");
  59. }
  60.  
  61. }
  62.  
  63. ?>
Add Comment
Please, Sign In to add comment