Why is $f changed in loginforms()?

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Why is $f changed in loginforms()?

Post by cmb » Mon Apr 07, 2014 3:12 pm

Hello Community,

in another thread I stumbled over the issue, that $f == 'Login' (i.e. capitalized) in printlink(). I found out that $f is set in loginforms() to $tx['menu']['login'] if $f == 'login'. It seems this line is there since about CMSimple 2.8. Does anybody know why that is done? It really doesn't seem reasonable to change the value of $f to something language depended, as that could easily lead to bugs in the following (see for instance line 1245 in cms.php, which would fail for most languages, if it was not commented out).

If there is no good reason for $f being modified there, I suggest we remove the line in the next release.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Why is $f changed in loginforms()?

Post by cmb » Tue Jul 01, 2014 1:47 pm

I had a closer look at the issue. At least one reason that $f is set to $tx['menu']['login'] is the locator and the <title> (you can verify that by changing $tx['menu']['login']).
cmb wrote:If there is no good reason for $f being modified there, I suggest we remove the line in the next release.
Actually, I consider having an appropriately localized locator and <title> to be a good reason. So I suggest to stick with the current solution, and rework this later (most likely XH 1.7 or 2.0, as any comprehensive change might affect plugins).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply