From: Alexander Ebert Date: Thu, 5 Jul 2012 17:48:04 +0000 (+0200) Subject: Work-around for template guessing if accessing *Edit page X-Git-Tag: 2.0.0_Beta_1~1032^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=06701166ca7dab9e73175eae509e63612e61aabe;p=GitHub%2FWoltLab%2FWCF.git Work-around for template guessing if accessing *Edit page --- diff --git a/wcfsetup/install/files/lib/page/AbstractPage.class.php b/wcfsetup/install/files/lib/page/AbstractPage.class.php index 31ca7ca9e0..53c9231255 100644 --- a/wcfsetup/install/files/lib/page/AbstractPage.class.php +++ b/wcfsetup/install/files/lib/page/AbstractPage.class.php @@ -151,6 +151,12 @@ abstract class AbstractPage implements IPage { if (empty($this->templateName)) { $classParts = explode('\\', get_class($this)); $className = preg_replace('~(Form|Page)$~', '', array_pop($classParts)); + + // check if this an *Edit page and use the add-template instead + if (substr($className, -4) == 'Edit') { + $className = substr($className, 0, -4) . 'Add'; + } + $this->templateName = lcfirst($className); }