Maybe we are killing ourselves over something a user can do quite easily on their own. Here is something REALLY ugly but still requires work:
Code: Select all
<li{if $currpage==$navlink.href} class="currentpage"{/if}><a href="{if $navlink.href=="DEFAULT_HOMELINK_URL"} {$serendipityBaseURL} {elseif $navlink.href=="DEFAULT_LOGIN_URL"} {$serendipityBaseURL}{$CONST.PATH_ADMIN} {else} {$navlink.href}{/if}" title="{if $navlink.title=="DEFAULT_HOMELINK_TEXT"} {$CONST.HOMEPAGE} {elseif $navlink.title=="DEFAULT_LOGIN_TEXT"} {$CONST.SUPERUSER_OPEN_LOGIN} {else} {$navlink.title}{/if}">{if $navlink.title=="DEFAULT_HOMELINK_TEXT"} {$CONST.HOMEPAGE} {elseif $navlink.title=="DEFAULT_LOGIN_TEXT"} {$CONST.SUPERUSER_OPEN_LOGIN} {else} {$navlink.title}{/if}</a></li>
One advantage is that ANY link can be "Home" or "Login". However, here are problems I see. First, the path to the blog MUST end in a "/", or it will not append the admin portion correctly. Second, there are 2 login variables - which of those 2 (SUPERUSER_OPEN_LOGIN and SUPERUSER_OPEN_ADMIN) is used is dependent upon whether the user is logged in or not, so that condition needs to be tested. Excellent examples of checking all this is in /include/plugins_internal.inc.php serendipity_superuser_plugin
Then it dawns on me that we are assigning this stuff in config.inc.php, so perhaps there is some logic that can be applied there, so that our current <li> code does not change, but the value actually assigned for these 2 instances is what we want, not what is in the input box. Plus, I would hate to have some fugly line like I have shown above in all the different navbar locations. Perhaps, if some complicated logic is required, we can take care of it once, then use the results of it (ie, define variables) everywhere else, which is why, once again, I wonder if we can resolve this in config.inc.php.
Anyway, like I first said... maybe this is too far removed from KISS to make it worthwhile. Then again, maybe not.
Meanwhile, I want to get back to admin styling. After a week or so of adding new IDs and classes all over the place (plus a few other neat tweaks), I need to revise my stylesheet to take advantage of a few of them.