/** * @see JDeveloperCreate */ protected function getTemplate() { $template = parent::getTemplate(); if ($template === false) { // If any errors exist throw Exception $errors = $this->getErrors(); if (!empty($errors)) { throw new JDeveloperException($errors); } // Look for template with same name in admin folder $this->templateFile = preg_replace('/^site/', 'admin', $this->templateFile); $template = parent::getTemplate(); $this->templateFile = preg_replace('/^admin/', 'site', $this->templateFile); if ($template === false) { $this->setError($this->_name . ": No template found"); throw new JDeveloperException($this->getErrors()); } $this->template = $template; return $this->template; } $this->template = $template; return $this->template; }