protected function getBaseTemplate(Request $request = null)
    {
        $request = $this->resolveRequest($request);

        if ($request->get('_pjax')) {
            return 'GlavwebCmsCoreBundle::sonata_admin_pajax_layout.html.twig';
        }

        if ($this->isXmlHttpRequest($request)) {
            return $this->admin->getTemplate('ajax');
        }

        return $this->admin->getTemplate('layout');
    }