]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
head and foot menus
authorEvan Prodromou <evan@prodromou.name>
Wed, 14 May 2008 18:47:02 +0000 (14:47 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 14 May 2008 18:47:02 +0000 (14:47 -0400)
darcs-hash:20080514184702-84dde-b9291e08f3fd0ad31141e392cab26220b310a6d4.gz

TODO
URLS.txt
common.php

diff --git a/TODO b/TODO
index 08ac0a5eb2a13db2c5c1de2011654500f18e0d85..7cc39f845926f3042c8389b55109a67eb8dadf2c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -11,9 +11,8 @@
 + subscribe
 + unsubscribe
 + subscribe links on profile
-- licenses
-- header menu
-- footer menu
++ header menu
++ footer menu
 - disallow direct to PHP files
 - common_local_url()
 - configuration system ($config)
@@ -25,6 +24,7 @@
 - delete a notice
 - make sure canonical usernames are unique
 - upload avatar
+- licenses
 - design from Open Source Web Designs
 - release 0.1
 - gettext
index bcbad40da22cb416302be55a6c7b95054797162a..e275796fa12f196b3e3b2bff0960e0088c0f7922 100644 (file)
--- a/URLS.txt
+++ b/URLS.txt
 /<username>/all                        self and friends
 
 /main/login                    login to site
+/main/logout                   logout of site
 /main/register                 register to site
 /main/settings                 change account settings
 /main/recover                  recover password
 /doc/                          documentation
      about                     about this site
      help                      help
+     privacy                   privacy
      
 /style/                                style
 /js/                           javascript
index de0529a2e8bf0deffc918a7f62bc0a5ae50d7e57..3a5278e494cf22fd76c1b03c96a12eca7952b1cd 100644 (file)
@@ -68,13 +68,60 @@ function common_show_header($pagetitle) {
                                   $pagetitle . " - " . $config['site']['name']);
        common_element_end('head');
        common_element_start('body');
+       common_head_menu();
 }
 
 function common_show_footer() {
+       common_foot_menu();
        common_element_end('body');
        common_element_end('html');
 }
 
+function common_head_menu() {
+       $user = common_current_user();
+       common_element_start('ul', 'headmenu');
+       common_menu_item(common_local_url('doc', array('title' => 'help')),
+                                        _t('Help'));
+       if ($user) {
+               common_menu_item(common_local_url('all', array('nickname' => 
+                                                                                                          $user->nickname)),
+                                                _t('Home'));
+               common_menu_item(common_local_url('showstream', array('nickname' =>
+                                                                                                                         $user->nickname)),
+                                                _t('Profile'),  $user->fullname || $user->nickname);
+               common_menu_item(common_local_url('settings'),
+                                                _t('Settings'));
+               common_menu_item(common_local_url('logout'),
+                                                _t('Logout'));
+       } else {
+               common_menu_item(common_local_url('login'),
+                                                _t('Login'));
+               common_menu_item(common_local_url('register'),
+                                                _t('Register'));
+       }
+       common_element_end('ul');
+}
+
+function common_foot_menu() {
+       common_element_start('ul', 'footmenu');
+       common_menu_item(common_local_url('doc', array('title' => 'about')),
+                                        _t('About'));
+       common_menu_item(common_local_url('doc', array('title' => 'help')),
+                                        _t('Help'));
+       common_menu_item(common_local_url('doc', array('title' => 'privacy')),
+                                        _t('Privacy'));
+}
+
+function common_menu_item($url, $text, $title=NULL) {
+       $attrs['href'] = $url;
+       if ($title) {
+               $attrs['title'] = $title;
+       }
+       common_element_start('li', 'menuitem');
+       common_element('a', $attrs, $text);
+       common_element_end('li');
+}
+
 # salted, hashed passwords are stored in the DB
 
 function common_munge_password($id, $password) {