[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