/* global registerBackward, TraverseUtility, DataProviderFacade */

registerBackward('4.13.0', 'Theme', function (control) {
    'use strict';

    if (DataProviderFacade.getCmsInfo().cmsName === 'Magento') {

        TraverseUtility.traverseControls(control, function (tpl) {
            switch (tpl.constructorName) {
                case 'HomeTemplate':
                case 'PageTemplate':
                case 'DefaultTemplate':
                case 'ProductsTemplate':
                case 'ProductOverviewTemplate':
                case 'ShoppingCartTemplate':
                case 'Template404':
                    tpl.BaseTemplate.caption = tpl.constructorName;
                    break;
            }
        });

    }

    return control;
});