/**
 * Rendering is the process of pushing the document buffers into the template
 * placeholders, retrieving data from the document and pushing it into
 * the application response buffer.
 *
 * @return  void
 *
 * @since   3.2
 */
protected function render()
{
    switch ($this->document->getType()) {
        case 'feed':
            // No special processing for feeds
            break;
        case 'html':
        default:
            $template = $this->getTemplate(true);
            $file = $this->input->get('tmpl', 'index');
            if ($file === 'offline' && !$this->get('offline')) {
                $this->set('themeFile', 'index.php');
            }
            if ($this->get('offline') && !Factory::getUser()->authorise('core.login.offline')) {
                $this->setUserState('users.login.form.data', array('return' => Uri::getInstance()->toString()));
                $this->set('themeFile', 'offline.php');
                $this->setHeader('Status', '503 Service Temporarily Unavailable', 'true');
            }
            if (!is_dir(JPATH_THEMES . '/' . $template->template) && !$this->get('offline')) {
                $this->set('themeFile', 'component.php');
            }
            // Ensure themeFile is set by now
            if ($this->get('themeFile') == '') {
                $this->set('themeFile', $file . '.php');
            }
            // Pass the parent template to the state
            $this->set('themeInherits', $template->parent);
            break;
    }
    parent::render();
}