diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-16 05:25:00 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-16 05:25:00 +0000 |
commit | 16f655ba45459c5a0d1be76d1f43094f49dfd0a7 (patch) | |
tree | 2e365e5f6625e8ef307211e58b92a3233b016044 /templates | |
parent | e2bf8254895b30b679865585b37e72aa1e867320 (diff) | |
download | ampache-16f655ba45459c5a0d1be76d1f43094f49dfd0a7.tar.gz ampache-16f655ba45459c5a0d1be76d1f43094f49dfd0a7.tar.bz2 ampache-16f655ba45459c5a0d1be76d1f43094f49dfd0a7.zip |
new tabbed preferences and account page is back
Diffstat (limited to 'templates')
-rw-r--r-- | templates/header.inc | 13 | ||||
-rw-r--r-- | templates/menustyle.inc | 35 | ||||
-rw-r--r-- | templates/show_preference_box.inc.php | 1 | ||||
-rw-r--r-- | templates/show_preferences.inc | 111 | ||||
-rw-r--r-- | templates/show_user.inc.php | 117 |
5 files changed, 154 insertions, 123 deletions
diff --git a/templates/header.inc b/templates/header.inc index 514c2310..0e8185f0 100644 --- a/templates/header.inc +++ b/templates/header.inc @@ -46,25 +46,16 @@ if (conf('use_rss')) { ?> <img class="pageheader" src="<?php echo $web_path; ?><?php echo conf('theme_path'); ?>/images/ampache.gif" border="0" title="Ampache: For the love of music" alt="Ampache: For the love of music" /> </a> </div><!--End topbarleft --> + <div id="topbarright"> <?php if (($user->prefs['play_type']=='mpd') && ($location['page'] != 'mpd.php')) { $myMpd = init_mpd(); show_template ('show_mpdminicontrol'); } else { ?> - <div id="topbarright"> <a href="http://www.ampache.org/index.php">Ampache v.<?php echo conf('version'); ?></a><br /> <b><?php echo _("You are currently logged in as") . " " . $GLOBALS['user']->fullname; ?></b> <br /> - <?php echo _("Browse"); ?>: - <form method="post" action="<?php echo $web_path; ?>/browse.php" enctype="multipart/form-data" style="Display:inline;"> - <select name="action"> - <option value="album">Album</option> - <option value="artist">Artist</option> - <option value="genre">Genre</option> - </select> - <input type="submit" value="<?php echo _("Go!"); ?>" class="button" /> - </form> - </div> <!-- End topbarright --> <?php } ?> + </div> <!-- End topbarright --> </div><!-- End topbar --> <div id="sidebar"><!-- This is the sidebar --> <?php require_once(conf('prefix') . '/templates/sidebar.inc.php'); ?> diff --git a/templates/menustyle.inc b/templates/menustyle.inc index 1b785924..09846d1b 100644 --- a/templates/menustyle.inc +++ b/templates/menustyle.inc @@ -210,5 +210,40 @@ text-indent: -9000px; z-index: 1; } + #tablist { + padding: 3px 0; + margin-left: 0; + border-bottom: 1px solid #778; + font: bold 12px Verdana, sans-serif; + } + + #tablist li { + list-style: none; + margin: 0; + display: inline; + } + + #tablist li a { + padding: 3px 0.5em; + margin-left: 3px; + border: 1px solid #778; + border-bottom: none; + background: #DDE; + text-decoration: none; + } + + #tablist li a:link { color: #448; } + #tablist li a:visited { color: #667; } + + #tablist li a:hover { + color: #000; + background: #AAE; + border-color: #227; + } + + #tablist li a#current { + background: white; + border-bottom: 1px solid white; + } --> </style> diff --git a/templates/show_preference_box.inc.php b/templates/show_preference_box.inc.php index 45e86d6c..4d2ffa67 100644 --- a/templates/show_preference_box.inc.php +++ b/templates/show_preference_box.inc.php @@ -32,7 +32,6 @@ if ($GLOBALS['user']->has_access(100) AND conf('use_auth')) { $show_apply_to_all = true; } - ?> diff --git a/templates/show_preferences.inc b/templates/show_preferences.inc index 9cbf9a15..f87d0378 100644 --- a/templates/show_preferences.inc +++ b/templates/show_preferences.inc @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2005 Ampache.org + Copyright (c) 2001 - 2006 Ampache.org All rights reserved This program is free software; you can redistribute it and/or @@ -26,6 +26,20 @@ */ +/** + * This page has a few tabs, as such we need to figure out which tab we are on + * and display the information accordingly + */ +$current_tab = scrub_in($_REQUEST['tab']); +if (!$current_tab) { $current_tab = 'theme'; } +$link = conf('web_path') . $target; + +/* CSS construction bs */ +$link_active = "a_" . $current_tab; +${$link_active} = "id=\"current\""; +$tab_active = "tab_" .$current_tab; +${$tab_active} = "id=\"tabactive\""; + /* I'm cheating a little here, check to see if we want to show the * Apply to All button on this page */ @@ -33,43 +47,58 @@ if (($GLOBALS['user']->has_access(100)) AND ($user_id == '-1' AND conf('use_auth $show_apply_to_all = true; } ?> -<table class="text-box"> -<tr> - <td> - <span class="header1"> - <?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _("preferences"); ?> - <?php if ($GLOBALS['user']->has_access(100)) { ?> - [<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>] - <?php } ?> - </span> - <form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data"> - <table cellspacing="10"> - <tr> - <td valign="top"><?php show_preference_box($preferences['theme']); ?></td> - <?php if (isset($preferences['system'])) { ?> - <td valign="top"><?php show_preference_box($preferences['system']); ?></td> - <?php } else { ?> - <td valign="top"> </td> - <?php } ?> - </tr> - <tr> - <td valign="top"><?php show_preference_box($preferences['streaming']); ?></td> - <td> </td> - </tr> - <tr> - <td valign="top"><?php show_preference_box($preferences['interface']); ?></td> - <td> </td> - </tr> - <tr> - <td valign="top"><?php show_preference_box($preferences['options']); ?></td> - <td> </td> - </tr> - </table> - <input class="button" type="submit" value="<?php echo _("Update Preferences"); ?>" /> - <input type="hidden" name="action" value="update_preferences" /> - <input type="hidden" name="user_id" value="<?php echo $user_id; ?>" /> - <input class="button" type="submit" name="action" value="<?php echo _("Cancel"); ?>" /> - </form> - </td> -</tr> -</table> +<span class="header1"> +<?php echo _("Editing"); ?> <?php echo $fullname; ?> <?php echo _("preferences"); ?> +<?php if ($GLOBALS['user']->has_access(100)) { ?> +[<a href="<?php echo conf('web_path'); ?>/admin/preferences.php?action=fix_preferences&user_id=<?php echo $user_id; ?>"><?php echo _("Rebuild Preferences"); ?></a>] +<?php } ?> +</span> + + +<ul> +<div id="tabcontainer"> +<ul id="tablist"> +<li <?php echo $tab_theme; ?>> + <a href="<?php echo $link; ?>?tab=theme&user_id=<?php echo $user_id; ?>" <?php echo $a_theme; ?>>Theme</a> +</li> +<li <?php echo $tab_streaming; ?>> + <a href="<?php echo $link; ?>?tab=streaming&user_id=<?php echo $user_id; ?>" <?php echo $a_streaming; ?>>Streaming</a> +</li> +<li <?php echo $tab_interface; ?>> + <a href="<?php echo $link; ?>?tab=interface&user_id=<?php echo $user_id; ?>" <?php echo $a_interface; ?>>Interface</a> +</li> +<li <?php echo $tab_options; ?>> + <a href="<?php echo $link; ?>?tab=options&user_id=<?php echo $user_id; ?>" <?php echo $a_options; ?>>Options</a> +</li> +<?php if ($user_id != '-1') { ?> +<li <?php echo $tab_account; ?>> + <a href="<?php echo $link; ?>?tab=account&user_id=<?php echo $user_id; ?>" <?php echo $a_account; ?>>Account</a> +</li> +<?php } else { ?> +<li <?php echo $tab_system; ?>> + <a href="<?php echo $link; ?>?tab=system&user_id=<?php echo $user_id; ?>" <?php echo $a_system; ?>>System</a> +</li> +<?php } ?> +</ul> +</div> +<div class="text-box"> +<form method="post" name="preferences" action="<?php echo conf('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data"> +<?php +if ($current_tab != 'account') { + show_preference_box($preferences[$current_tab]); +?> + <input class="button" type="submit" value="<?php echo _("Update Preferences"); ?>" /> + <input type="hidden" name="action" value="update_preferences" /> + <input type="hidden" name="user_id" value="<?php echo $user_id; ?>" /> + <input type="hidden" name="tab" value="<?php echo scrub_out($current_tab); ?>" /> + <input class="button" type="submit" name="action" value="<?php echo _("Cancel"); ?>" /> +<?php + } + + else { + $this_user = new User($user_id); + require (conf('prefix') . '/templates/show_user.inc.php'); + } +?> +</form> +</div> diff --git a/templates/show_user.inc.php b/templates/show_user.inc.php index 9d59d5ea..eeb32f9b 100644 --- a/templates/show_user.inc.php +++ b/templates/show_user.inc.php @@ -20,73 +20,50 @@ */ ?> -<br /><br /> -<div class="text-box"> -<form name="update_user" method="post" action="<?php echo conf('web_path'); ?>/user.php?action=update_user" enctype="multipart/form-data" > - <p class="header2"><?php echo _("Changing User Information for") . " " . $this_user->fullname; ?></p> - <table> - <tr> - <td> - <?php echo _("Name"); ?>: - </td> - <td> - <input type="text" name="fullname" size="30" value="<?php echo $this_user->fullname; ?>" /> - </td> - </tr> - - <tr> - <td> - <?php echo _("E-mail"); ?>: - </td> - <td> - <input type="text" name="email" size="30" value="<?php echo $this_user->email; ?>" /> - </td> - </tr> - <tr> - <td> - <?php echo _("Results Per Page"); ?>: - </td> - <td> - <input type="text" name="offset_limit" size="5" value="<?php echo $this_user->offset_limit; ?>" /> - </td> - </tr> - </table> - <input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" /> - <input type="submit" name="action" value="<?php echo _("Update Profile"); ?>" /> -</form> -</div> -<br /> -<div class="text-box"> -<form name="change_password" method="post" action="<?php echo conf('web_path'); ?>/user.php?action=change_password" enctype="multipart/form-data" > - <span class="header2">Changing User Password</span> - <?php $GLOBALS['error']->print_error('password'); ?> - <table border="0" cellpadding="5" cellspacing="0"> - <tr> - <td> - <?php echo _("Enter password"); ?>: - </td> - <td> - <input type="password" name="password" size="30" /> - </td> - </tr> - <tr> - <td> - <?php echo _("Confirm Password"); ?>: - </td> - <td> - <input type="password" name="confirm_password" size="30" /> - </td> - </tr> - </table> - <input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" /> - <input type="submit" name="action" value="<?php echo _("Change Password"); ?>" /> -</form> -</div> -<br /> -<div class="text-box"> -<form name="clear_statistics" method="post" action="<?php echo conf('web_path'); ?>/user.php?action=clear_stats" enctype="multipart/form-data"> - <span class="header2"><?php echo _("Delete Your Personal Statistics"); ?></span><br /> - <input type="hidden" name="user_id" value="<?php echo $this_user->username; ?>" /> - <input type="submit" value="<?php echo _("Clear Stats"); ?>" /> -</form> -</div> +<table> +<tr> + <td><?php echo _('Name'); ?>:</td> + <td> + <input type="text" name="fullname" size="27" value="<?php echo scrub_out($this_user->fullname); ?>" /> + </td> +</tr> +<tr> + <td><?php echo _('E-mail'); ?>:</td> + <td> + <input type="text" name="email" size="27" value="<?php echo scrub_out($this_user->email); ?>" /> + </td> +</tr> +<tr> + <td><?php echo _('Results Per Page'); ?>:</td> + <td> + <input type="text" name="offset_limit" size="3" value="<?php echo scrub_out($this_user->offset_limit); ?>" /> + </td> +</tr> +<tr> + <td><?php echo _('New Password'); ?>:</td> + <td> + <?php $GLOBALS['error']->print_error('password'); ?> + <input type="password" name="password1" size="27" /> + </td> +</tr> +<tr> + <td><?php echo _('Confirm Password'); ?>:</td> + <td> + <input type="password" name="password2" size="27" /> + </td> +</tr> +<tr> + <td><?php echo _('Clear Stats'); ?>:</td> + <td> + <input type="checkbox" name="clear_stats" value="1" /> + </td> +</tr> +<tr> + <td colspan="2"> + <input type="hidden" name="user_id" value="<?php echo scrub_out($this_user->id); ?>" /> + <input type="hidden" name="action" value="update_user" /> + <input type="hidden" name="tab" value="<?php echo scrub_out($current_tab); ?>" /> + <input type="submit" value="<?php echo _('Update Account'); ?>" /> + </td> +</tr> +</table> |