1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
class HomePage extends Page {

  public static $db = array(
    'Copyright' => 'Text'
  );

  public static $has_one = array(
  );

  public static $has_many = array(
    'Slides' => 'SliderObject',
    'Logos' => 'LogoboxObject',
    'Opinions' => 'OpinionObject',
    'Clients' => 'ClientObject'
  );
  
  function getCMSFields() {
    $fields = parent::getCMSFields();
    $fields->addFieldToTab('Root.Content.Copyright', new TextField('Copyright', 'Copyright der Seite'));
    $fields->addFieldToTab('Root.Content.Slider', new DataObjectManager($this, 'Slides', 'SliderObject', array('Name' => 'Name des Bildes/Projekts', 'Link' => 'verlinkung des Bilds', 'Description' => 'Beschreibung'), 'getCMSFields_forPopup'));
    $fields->addFieldToTab('Root.Content.Logobox', new DataObjectManager($this, 'Logos', 'LogoboxObject', array('Name' => 'Name des Logos/der Seite', 'Link' => 'Link zur Seite'), 'getCMSFields_forPopup'));
    $fields->addFieldToTab('Root.Content.Kundenmeinungen', new DataObjectManager($this, 'Opinions', 'OpinionObject', array('Project' => 'Name des Projekts', 'Opinion' => 'Kundenmeinung', 'PLink' => 'Link zum Projekt'), 'getCMSFields_forPopup'));
    return $fields;
  }

}
class HomePage_Controller extends Page_Controller {

}