summaryrefslogtreecommitdiff
path: root/common.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-14 14:47:02 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-14 14:47:02 -0400
commit104674fb0eb388b21ca16e014e8fda3ae5a89581 (patch)
tree6e565e109e5f175a8cb119b6894029c476e09893 /common.php
parent67a347bafb875be60e7554f308d80d7f0a1d2747 (diff)
head and foot menus
darcs-hash:20080514184702-84dde-b9291e08f3fd0ad31141e392cab26220b310a6d4.gz
Diffstat (limited to 'common.php')
-rw-r--r--common.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/common.php b/common.php
index de0529a2e..3a5278e49 100644
--- a/common.php
+++ b/common.php
@@ -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) {