[geeklog-hg] geeklog: Added in a new menu element that displays a Login or Lo...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Thu Oct 10 18:15:16 EDT 2013
changeset 9320:3b32aaf8b28a
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/3b32aaf8b28a
user: Tom <websitemaster at cogeco.net>
date: Thu Oct 10 18:14:54 2013 -0400
description:
Added in a new menu element that displays a Login or Logout link depending if the user is logged in or not. (feature request #0001711)
diffstat:
language/english.php | 2 +-
language/english_utf-8.php | 2 +-
public_html/docs/english/config.html | 2 +-
public_html/docs/japanese/config.html | 2 +-
public_html/lib-common.php | 20 +++++++++++++++++---
5 files changed, 21 insertions(+), 7 deletions(-)
diffs (79 lines):
diff -r 6b3108687b67 -r 3b32aaf8b28a language/english.php
--- a/language/english.php Thu Oct 10 18:00:39 2013 -0400
+++ b/language/english.php Thu Oct 10 18:14:54 2013 -0400
@@ -2300,7 +2300,7 @@
21 => array('HTML 4.01 Transitional' => 'html401transitional', 'HTML 4.01 Strict' => 'html401strict', 'XHTML 1.0 Transitional' => 'xhtml10transitional', 'XHTML 1.0 Strict' => 'xhtml10strict', 'HTML5' => 'html5', 'HTML5 with XHTML syntax' => 'xhtml5'),
22 => array('Strict' => 'DENY', 'Same Origin' => 'SAMEORIGIN', '(disabled)' => ''),
23 => array('Disabled' => 0, 'Enabled' => 1, 'Enabled (Default for Homepage only)' => 2),
- 24 => array('Contribute' => 'contribute', 'Home' => 'home', 'Advanced Search' => 'search', 'Directory' => 'directory', 'My Account' => 'prefs', 'Plugin Entries' => 'plugins', 'Custom Entries' => 'custom', 'Site Statistics' => 'stats'),
+ 24 => array('Contribute' => 'contribute', 'Home' => 'home', 'Advanced Search' => 'search', 'Directory' => 'directory', 'Login' => 'login', 'My Account' => 'prefs', 'Plugin Entries' => 'plugins', 'Custom Entries' => 'custom', 'Site Statistics' => 'stats'),
25 => array('New Stories' => 'story', 'New Comments' => 'comment', 'New Trackbacks' => 'trackback', 'New Pingbacks' => 'pingback', 'New Users' => 'user'),
26 => array('G (General Audiences)' => 'G', 'PG (Parental Guidance)' => 'PG', 'R (Restricted)' => 'R', 'X (Explicit)' => 'X'),
27 => array('Hits (asc)' => 'hits|asc', 'Hits (desc)' => 'hits|desc', 'Date (asc)' => 'date|asc', 'Date (desc)' => 'date|desc', 'Title (asc)' => 'title|asc', 'Title (desc)' => 'title|desc', 'Author (asc)' => 'uid|asc', 'Author (desc)' => 'uid|desc'),
diff -r 6b3108687b67 -r 3b32aaf8b28a language/english_utf-8.php
--- a/language/english_utf-8.php Thu Oct 10 18:00:39 2013 -0400
+++ b/language/english_utf-8.php Thu Oct 10 18:14:54 2013 -0400
@@ -2300,7 +2300,7 @@
21 => array('HTML 4.01 Transitional' => 'html401transitional', 'HTML 4.01 Strict' => 'html401strict', 'XHTML 1.0 Transitional' => 'xhtml10transitional', 'XHTML 1.0 Strict' => 'xhtml10strict', 'HTML5' => 'html5', 'HTML5 with XHTML syntax' => 'xhtml5'),
22 => array('Strict' => 'DENY', 'Same Origin' => 'SAMEORIGIN', '(disabled)' => ''),
23 => array('Disabled' => 0, 'Enabled' => 1, 'Enabled (Default for Homepage only)' => 2),
- 24 => array('Contribute' => 'contribute', 'Home' => 'home', 'Advanced Search' => 'search', 'Directory' => 'directory', 'My Account' => 'prefs', 'Plugin Entries' => 'plugins', 'Custom Entries' => 'custom', 'Site Statistics' => 'stats'),
+ 24 => array('Contribute' => 'contribute', 'Home' => 'home', 'Advanced Search' => 'search', 'Directory' => 'directory', 'Login' => 'login', 'My Account' => 'prefs', 'Plugin Entries' => 'plugins', 'Custom Entries' => 'custom', 'Site Statistics' => 'stats'),
25 => array('New Stories' => 'story', 'New Comments' => 'comment', 'New Trackbacks' => 'trackback', 'New Pingbacks' => 'pingback', 'New Users' => 'user'),
26 => array('G (General Audiences)' => 'G', 'PG (Parental Guidance)' => 'PG', 'R (Restricted)' => 'R', 'X (Explicit)' => 'X'),
27 => array('Hits (asc)' => 'hits|asc', 'Hits (desc)' => 'hits|desc', 'Date (asc)' => 'date|asc', 'Date (desc)' => 'date|desc', 'Title (asc)' => 'title|asc', 'Title (desc)' => 'title|desc', 'Author (asc)' => 'uid|asc', 'Author (desc)' => 'uid|desc'),
diff -r 6b3108687b67 -r 3b32aaf8b28a public_html/docs/english/config.html
--- a/public_html/docs/english/config.html Thu Oct 10 18:00:39 2013 -0400
+++ b/public_html/docs/english/config.html Thu Oct 10 18:14:54 2013 -0400
@@ -583,7 +583,7 @@
(if your theme uses the <code>{menu_elements}</code> variable to display
the menu bar). Can be any combination of <tt>'home'</tt>,
<tt>'contribute'</tt>, <tt>'search'</tt>, <tt>'stats'</tt>,
- <tt>'directory'</tt>, <tt>'prefs'</tt>, <tt>'plugins'</tt>, and
+ <tt>'directory'</tt>, <tt>'login'</tt>, <tt>'prefs'</tt>, <tt>'plugins'</tt>, and
<tt>'custom'</tt> where <tt>'plugins'</tt> is the same as the
<code>{plg_menu_elements}</code> variable, i.e. a list of the menu entries
provided by plugins, and <tt>'custom'</tt> displays the entries returned by
diff -r 6b3108687b67 -r 3b32aaf8b28a public_html/docs/japanese/config.html
--- a/public_html/docs/japanese/config.html Thu Oct 10 18:00:39 2013 -0400
+++ b/public_html/docs/japanese/config.html Thu Oct 10 18:14:54 2013 -0400
@@ -519,7 +519,7 @@
'plugins')</code></td>
<td valign="top">ã©ã®ã¡ãã¥ã¼é
ç®ããµã¤ãã®ã¡ãã¥ã¼ãã¼ï¼ã°ãã¼ãã«ã¡ãã¥ã¼ï¼ã«è¡¨ç¤ºããããæå®ãã¾ãï¼ä½¿ç¨ãããã¼ãã«ã¡ãã¥ã¼ãã¼ã表示ããããã®<code>{menu_elements}</code>ãã³ãã¬ã¼ãå¤æ°ã使ç¨ããã¦ããå ´åï¼ã<tt>'home'</tt>ï¼ããããã¼ã¸ï¼,
<tt>'contribute'</tt>ï¼è¨äºæ稿ï¼, <tt>'search'</tt>ï¼æ¤ç´¢ï¼, <tt>'stats'</tt>,
- <tt>'directory'</tt>ï¼è¨äºä¸è¦§ï¼, <tt>'prefs'</tt>ï¼ãã¤ã¢ã«ã¦ã³ãï¼, <tt>'plugins'</tt>ï¼ãã©ã°ã¤ã³ï¼,
+ <tt>'directory'</tt>ï¼è¨äºä¸è¦§) , <tt>'login'</tt>, <tt>'prefs'</tt>ï¼ãã¤ã¢ã«ã¦ã³ãï¼, <tt>'plugins'</tt>ï¼ãã©ã°ã¤ã³ï¼,
<tt>'custom'</tt>ï¼ã«ã¹ã¿ã ï¼ã好ããªæ°ã ã好ããªé åºã§çµã¿åããããã¨ãã§ãã¾ãã<tt>'plugins'</tt>ï¼ãã©ã°ã¤ã³ï¼ã¯<code>{plg_menu_elements}</code>ãã³ãã¬ã¼ãå¤æ°ã¨åãã§ãåãã©ã°ã¤ã³ãæä¾ããã¡ãã¥ã¼é
ç®ã§ãã<tt>'custom'</tt>ï¼ã«ã¹ã¿ã ï¼ã¯<code>CUSTOM_menuEntries</code>ã«ã¹ã¿ã é¢æ°ãè¿ãã¡ãã¥ã¼é
ç®ã§ãï¼è©³ç´°ã¯<tt>lib-custom.php</tt>ãåç
§ãã¦ãã ãããï¼ã</td></tr>
<tr>
<td valign="top"><a name="desc_cache_templates">cache_templates</a></td>
diff -r 6b3108687b67 -r 3b32aaf8b28a public_html/lib-common.php
--- a/public_html/lib-common.php Thu Oct 10 18:00:39 2013 -0400
+++ b/public_html/lib-common.php Thu Oct 10 18:14:54 2013 -0400
@@ -835,10 +835,24 @@
$url = '';
$label = '';
break;
-
+ case 'login':
+ if ($anon) {
+ $url = $_CONF['site_url'] . '/users.php';
+ $label = $LANG01[58];
+ } else {
+ $url = $_CONF['site_url'] . '/users.php?mode=logout';
+ $label = $LANG01[35];
+ }
+ break;
+
case 'prefs':
- $url = $_CONF['site_url'] . '/usersettings.php';
- $label = $LANG01[48];
+ if ($anon) {
+ $url = '';
+ $label = '';
+ } else {
+ $url = $_CONF['site_url'] . '/usersettings.php';
+ $label = $LANG01[48];
+ }
break;
case 'search':
More information about the geeklog-cvs
mailing list