public function generateCMSFields(FieldList $fields)
    {
        /** @var News $owner */
        $owner = $this->owner;
        /** @var SiteConfig $siteConfig */
        $siteConfig = SiteConfig::current_site_config();
        $this->type_array = array(
            'news' => _t('News.NEWSITEMTYPE', 'Newsitem'),
        );
        /** Setup all fields according. Their visibility is based on the origin, which can be read from the functionname and comments. */
        $this->defaultFields();
        $this->multipleNewsHolderPages();
        $this->siteConfigFields($owner, $siteConfig);
        $this->existingItem($owner, $siteConfig);
        $this->displayLogic();
        $this->createHelptab();
        if (count($this->type_array) > 1) {
            $this->field_list['Root.Main'][3] = OptionsetField::create('Type', $owner->fieldLabel('Type'), $this->type_array, $owner->Type);
        }
        $this->setupFields($owner, $fields);
    }
public function generateCMSFields(FieldList $fields)
    {
        /** @var News $owner */
        $owner = $this->owner;
        /** @var SiteConfig $siteConfig */
        $siteConfig = SiteConfig::current_site_config();
        $this->type_array = array(
            'news' => _t('News.NEWSITEMTYPE', 'Newsitem'),
        );
        /** Setup all fields according. Their visibility is based on the origin, which can be read from the functionname and comments. */
        $this->defaultFields();
        $this->multipleNewsHolderPages();
        $this->siteConfigFields($owner, $siteConfig);
        $this->existingItem($owner, $siteConfig);
        $this->displayLogic();
        $this->createHelptab();
        if (count($this->type_array) > 1) {
            $this->field_list['Root.Main'][3] = OptionsetField::create('Type', $owner->fieldLabel('Type'), $this->type_array, $owner->Type);
        }
        $this->setupFields($owner, $fields);
    }
public function generateCMSFields ( FieldList $ fields ) { /** @var News $owner */ $ owner = $ this -> owner ; /** @var SiteConfig $siteConfig */ $ siteConfig = SiteConfig :: current_site_config ( ) ; $ this -> type_array = array ( 'news' => _t ( 'News.NEWSITEMTYPE' , 'Newsitem' ) , ) ; /** Setup all fields according. Their visibility is based on the origin, which can be read from the functionname and comments. */ $ this -> defaultFields ( ) ; $ this -> multipleNewsHolderPages ( ) ; $ this -> siteConfigFields ( $ owner , $ siteConfig ) ; $ this -> existingItem ( $ owner , $ siteConfig ) ; $ this -> displayLogic ( ) ; $ this -> createHelptab ( ) ; if ( count ( $ this -> type_array ) > 1 ) { $ this -> field_list [ 'Root.Main' ] [ 3 ] = OptionsetField :: create ( 'Type' , $ owner -> fieldLabel ( 'Type' ) , $ this -> type_array , $ owner -> Type ) ; } $ this -> setupFields ( $ owner , $ fields ) ; }
Create the fieldlist in the admin

@param FieldList $fields
Create the fieldlist in the admin