/* global registerBackward, DataProviderFacade */

registerBackward('1.0.11', 'Theme', function (control) {
    'use strict';
    if (DataProviderFacade.getCmsInfo().cmsName === 'Joomla') {
        if (control.prototypes.CategoryProductsComponent) {
            control.controls.productListContainer = {
                items: control.prototypes.CategoryProductsComponent.productsGrid.item.layouts[1].items,
                constructorName: "LayoutContainer"
            };
            control.prototypes.CategoryProductsComponent.productsGrid.item.layouts[1].items = {
                0: '/controls/productListContainer',
                length: 1,
                constructorName: "LayoutItems"
            };
            control.prototypes.categoryProducts = control.prototypes.CategoryProductsComponent;
            delete control.prototypes.CategoryProductsComponent;
        }
    }
    return control;
});