loginlink() and lilink()

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:

loginlink() and lilink()

Post by cmb » Sat Feb 28, 2015 3:11 pm

Hello Community,

does anybody know why function loginlink() is defined as:

Code: Select all

function loginlink()
{
    if (function_exists('lilink')) {
        return lilink();
    }
}
Apparently function lilink() has been introduced with CMSimple 2.8 (placed in cmsimple/login.php), but I don't see the reason why. Has it been to allow lilink() to be removed, so there's no loginlink in the template? Wouldn't that have been more easily accomplished by modifiying the template?

I have not been able to find further information, neither in this forum nor on http://forum.cmsimple-xh.dk/.

Unless there is a good reason to have this split, I suggest to merge lilink() into loginlink() back again.
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: loginlink() and lilink()

Post by cmb » Wed Apr 29, 2015 1:37 pm

The respective patch (a feature branch appears to be overkill):

Code: Select all

Index: cmsimple/functions.php
===================================================================
--- cmsimple/functions.php	(revision 1580)
+++ cmsimple/functions.php	(working copy)
@@ -1562,23 +1562,6 @@
 }
 
 /**
- * Returns the login link.
- *
- * @global int    The index of the requested page.
- * @global array  The localization of the core.
- *
- * @return string HTML
- */
-function lilink()
-{
-    global $s, $tx;
-
-    if (!XH_ADM) {
-        return a($s > -1 ? $s : 0, '&login') . $tx['menu']['login'] . '</a>';
-    }
-}
-
-/**
  * Returns the login form.
  *
  * @global array  The configuration of the core.
Index: cmsimple/tplfuncs.php
===================================================================
--- cmsimple/tplfuncs.php	(revision 1580)
+++ cmsimple/tplfuncs.php	(working copy)
@@ -355,12 +355,17 @@
 /**
  * Returns the link to the login form.
  *
+ * @global int    The index of the requested page.
+ * @global array  The localization of the core.
+ *
  * @return string HTML
  */
 function loginlink()
 {
-    if (function_exists('lilink')) {
-        return lilink();
+    global $s, $tx;
+
+    if (!XH_ADM) {
+        return a($s > -1 ? $s : 0, '&login') . $tx['menu']['login'] . '</a>';
     }
 }
Christoph M. Becker – Plugins for CMSimple_XH

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

Re: loginlink() and lilink()

Post by cmb » Mon Jun 01, 2015 12:21 am

Done (r1615).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply