/* global registerBackward, DataProviderFacade, BackwardUtility */

registerBackward('1.2.18', 'Theme', function (control) {
    'use strict';
    if (DataProviderFacade.getCmsInfo().cmsName === 'Drupal') {
        if (!control.templates.hasOwnProperty('pageTemplate')) {
            var pageTemplate = BackwardUtility.getControlObject('PageTemplate');

            pageTemplate.BaseTemplate.templateName = 'pageTemplate';
            pageTemplate.BaseTemplate.body.items = {
                0: "/controls/toolbarContainer",
                1: "/controls/header1",
                2: "/controls/breadcrumb1",
                3: "/controls/sheetPageTemplate",
                4: "/controls/footer1",
                5: "/controls/pageFooter",
                6: "/controls/backToTop1",
                length: 7,
                constructorName: "LayoutItems"
            };

            control.templates.pageTemplate = pageTemplate;
        }
    }
   
    return control;
});