e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
320 stars 214 forks source link

update code of login, signup and fpw pages to use the same logic and rules for easier templating #5078

Open Jimmi08 opened 1 year ago

Jimmi08 commented 1 year ago

Motivation

Easier life of theme developer.

Examples:

Check of legacy theme: in signup.php if($template = e107::getCoreTemplate('signup')) in login.php in fpw.php if(deftrue('BOOTSTRAP'))

Why is not THEME_LEGACY used?

Loading legacy templates fpw.php require_once (e107::coreTemplatePath('fpw')); //correct way to load a core template. signup.php

    $tmplPath = e107::coreTemplatePath('signup');
    require_once($tmplPath); //correct way to load a core template.

login.php

            if (file_exists(THEME.'templates/login_template.php')) //v2.x path
            {
                require_once(THEME.'templates/login_template.php');
            }
            elseif (file_exists(THEME.'login_template.php'))
            {
                require_once(THEME.'login_template.php');
            }
            else
            {
                $LOGIN_TEMPLATE = e107::getCoreTemplate('login');
            }

usersettings: include instead of require. What is correct?

            $coreTemplatePath                   = e107::coreTemplatePath('usersettings');
            include_once($coreTemplatePath); //correct way to load a core template.

Can be this changed for login file too?

Thanks