Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class QuickLinkColumn extends Page {
- static $db = array(
- 'QLSectionHeader1' => 'Text',
- 'QLSectionHeader2' => 'Text'
- );
- static $many_many = array(
- 'QLSection1' => 'QuickLink',
- 'QLSection2' => 'QuickLink'
- );
- function getCMSFields() {
- $fields = parent::getCMSFields();
- $QLSection1tablefield = new ManyManyComplexTableField(
- $this,
- 'QLSection1',
- 'QuickLink',
- array(
- 'QuickLinkName' => 'Link Name',
- 'QuickLinkTitle' => 'Link Title',
- 'QuickLinkLocation' => 'Link URL'
- ),
- 'getCMSFields_forPopup'
- );
- $QLSection1tablefield->setAddTitle( 'A Link' );
- $QLSection1tablefield->setPageSize(100);
- $QLSection2tablefield = new ManyManyComplexTableField(
- $this,
- 'QLSection2',
- 'QuickLink',
- array(
- 'QuickLinkName' => 'Link Name',
- 'QuickLinkTitle' => 'Link Title',
- 'QuickLinkLocation' => 'Link URL'
- ),
- 'getCMSFields_forPopup'
- );
- $QLSection2tablefield->setAddTitle( 'A Link' );
- $QLSection2tablefield->setPageSize(100);
- $fields->addFieldToTab( 'Root.Content.Section1', new TextField( 'QLSectionHeader1' ) );
- $fields->addFieldToTab( 'Root.Content.Section1', $QLSection1tablefield );
- $fields->addFieldToTab( 'Root.Content.Section2', new TextField( 'QLSectionHeader2' ) );
- $fields->addFieldToTab( 'Root.Content.Section2', $QLSection2tablefield );
- return $fields;
- }
- }
- class QuickLinkColumn_Controller extends Page_Controller {
- function index() {
- Director::redirect("home/");
- }
- }
- ?>
Add Comment
Please, Sign In to add comment