public function updateCMSFields(FieldList $fields)
    {
        /** Only allow authors or higher! */
        $fields->addFieldToTab(
            'Root', // What tab
            TabSet::create(
                'Newssettings', _t('NewsSiteConfigExtension.NEWSCOMMENTS', 'News settings')
            )
        );
        if (($this->owner->AllowAuthors && $this->owner->canEdit(Member::currentUser())) || Member::currentUser()->inGroup('administrators')) {
            $userTabs = array();
            foreach (self::$config_tabs as $tab) {
                $userTabs[] = $this->$tab();
            }
            $fields->addFieldsToTab('Root.Newssettings', $userTabs);
        } else {
            $fields->addFieldToTab('Root.Newssettings', HeaderField::create('NoPermissions', _t('NewsSiteConfigExtension.PERMISSIONERROR', 'You do not have the permission to edit these settings')));
        }
        if (Member::currentUser()->inGroup('administrators')) {
            $adminTabs = array();
            foreach (self::$admin_tabs as $tab) {
                $adminTabs[] = $this->$tab();
            }
            $fields->addFieldsToTab('Root.Newssettings', $adminTabs, 'Help');
        }
    }
public function updateCMSFields(FieldList $fields)
    {
        /** Only allow authors or higher! */
        $fields->addFieldToTab(
            'Root', // What tab
            TabSet::create(
                'Newssettings', _t('NewsSiteConfigExtension.NEWSCOMMENTS', 'News settings')
            )
        );
        if (($this->owner->AllowAuthors && $this->owner->canEdit(Member::currentUser())) || Member::currentUser()->inGroup('administrators')) {
            $userTabs = array();
            foreach (self::$config_tabs as $tab) {
                $userTabs[] = $this->$tab();
            }
            $fields->addFieldsToTab('Root.Newssettings', $userTabs);
        } else {
            $fields->addFieldToTab('Root.Newssettings', HeaderField::create('NoPermissions', _t('NewsSiteConfigExtension.PERMISSIONERROR', 'You do not have the permission to edit these settings')));
        }
        if (Member::currentUser()->inGroup('administrators')) {
            $adminTabs = array();
            foreach (self::$admin_tabs as $tab) {
                $adminTabs[] = $this->$tab();
            }
            $fields->addFieldsToTab('Root.Newssettings', $adminTabs, 'Help');
        }
    }
public function updateCMSFields ( FieldList $ fields ) { /** Only allow authors or higher! */ $ fields -> addFieldToTab ( 'Root' , // What tab TabSet :: create ( 'Newssettings' , _t ( 'NewsSiteConfigExtension.NEWSCOMMENTS' , 'News settings' ) ) ) ; if ( ( $ this -> owner -> AllowAuthors && $ this -> owner -> canEdit ( Member :: currentUser ( ) ) ) || Member :: currentUser ( ) -> inGroup ( 'administrators' ) ) { $ userTabs = array ( ) ; foreach ( self :: $ config_tabs as $ tab ) { $ userTabs [ ] = $ this -> $ tab ( ) ; } $ fields -> addFieldsToTab ( 'Root.Newssettings' , $ userTabs ) ; } else { $ fields -> addFieldToTab ( 'Root.Newssettings' , HeaderField :: create ( 'NoPermissions' , _t ( 'NewsSiteConfigExtension.PERMISSIONERROR' , 'You do not have the permission to edit these settings' ) ) ) ; } if ( Member :: currentUser ( ) -> inGroup ( 'administrators' ) ) { $ adminTabs = array ( ) ; foreach ( self :: $ admin_tabs as $ tab ) { $ adminTabs [ ] = $ this -> $ tab ( ) ; } $ fields -> addFieldsToTab ( 'Root.Newssettings' , $ adminTabs , 'Help' ) ; } }
Update the SiteConfig with the news-settings.
The tabs are pushed into arrays, because it works better than adding them one by one.

@param FieldList $fields of current FieldList of SiteConfig
Update the SiteConfig with the news - settings . The tabs are pushed into arrays because it works better than adding them one by one .