summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-11 05:16:20 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-11 05:16:20 +0000
commit689517e332c874ac09bb41398602622a1fc36af8 (patch)
treec97a077bd164e594211ed213405eb0cfbbf77b1c /templates
parent7327a025db941554501bbbe79c057fa308fb205c (diff)
downloadampache-689517e332c874ac09bb41398602622a1fc36af8.tar.gz
ampache-689517e332c874ac09bb41398602622a1fc36af8.tar.bz2
ampache-689517e332c874ac09bb41398602622a1fc36af8.zip
fixed preferences mostly, also fixed some genre issues and other stuff I am forgetting now
Diffstat (limited to 'templates')
-rw-r--r--templates/show_genre.inc.php4
-rw-r--r--templates/show_genres.inc.php2
-rw-r--r--templates/show_preference_box.inc.php21
-rw-r--r--templates/show_preferences.inc.php52
-rw-r--r--templates/sidebar_preferences.inc.php9
5 files changed, 26 insertions, 62 deletions
diff --git a/templates/show_genre.inc.php b/templates/show_genre.inc.php
index 5e9466d9..1eb1cc14 100644
--- a/templates/show_genre.inc.php
+++ b/templates/show_genre.inc.php
@@ -1,7 +1,7 @@
<?php
/*
- Copyright (c) 2001 - 2006 Ampache.org
+ Copyright (c) 2001 - 2007 Ampache.org
All rights reserved.
This program is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
* This shows a single genre and lets you pick between
* albums/artists or songs
*/
-$web_path = conf('web_path');
+$web_path = Config::get('web_path');
?>
<?php show_box_top(_('Viewing') . " " . $genre->name . " " . _('Genre')); ?>
[<?php echo $genre->get_album_count(); ?>]
diff --git a/templates/show_genres.inc.php b/templates/show_genres.inc.php
index e3ae1223..bd7b0a3d 100644
--- a/templates/show_genres.inc.php
+++ b/templates/show_genres.inc.php
@@ -39,7 +39,7 @@
<?php
foreach ($object_ids as $genre_id) {
$genre = new Genre($genre_id);
- $genre->format_genre();
+ $genre->format();
?>
<tr class="<?php echo flip_class(); ?>">
<td>
diff --git a/templates/show_preference_box.inc.php b/templates/show_preference_box.inc.php
index eedaa2b7..7fa4ae72 100644
--- a/templates/show_preference_box.inc.php
+++ b/templates/show_preference_box.inc.php
@@ -22,32 +22,33 @@
/* I'm cheating a little here, check to see if we want to show the
* Apply to All button on this page
*/
-if ($GLOBALS['user']->has_access(100) AND Config::get('use_auth')) {
- $show_apply_to_all = true;
+if (($GLOBALS['user']->has_access(100) OR !Config::get('use_auth')) AND $_REQUEST['action'] == 'admin') {
+ $is_admin = true;
}
?>
-
-
<table class="tabledata" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr class="odd">
- <th colspan="3" class="header2" align="left"><?php echo $preferences['title']; ?></th>
+ <th colspan="5" class="header2" align="left"><?php echo $preferences['title']; ?></th>
</tr>
<tr class="table-header">
<th><?php echo _('Preference'); ?></th>
<th><?php echo _('Value'); ?></th>
- <?php if ($show_apply_to_all) { ?>
- <th><?php echo _('Apply to All'); ?></th>
+ <?php if ($is_admin) { ?>
+ <th><?php echo _('Apply to All'); ?></th>
+ <th><?php echo _('Access Level'); ?></th>
<?php } ?>
</tr>
-<?php
-foreach ($preferences['prefs'] as $pref) { ?>
+<?php foreach ($preferences['prefs'] as $pref) { ?>
<tr class="<?php echo flip_class(); ?>">
<td><?php echo _($pref['description']); ?></td>
<td>
<?php create_preference_input($pref['name'], $pref['value']); ?>
</td>
- <?php if ($show_apply_to_all) { ?>
+ <?php if ($is_admin) { ?>
<td align="center"><input type="checkbox" name="check_<?php echo $pref['name']; ?>" value="1" /></td>
+ <td align="center">
+
+ </td>
<?php } ?>
</tr>
<?php } // End foreach ($preferences['prefs'] as $pref) ?>
diff --git a/templates/show_preferences.inc.php b/templates/show_preferences.inc.php
index 22843bfb..31500393 100644
--- a/templates/show_preferences.inc.php
+++ b/templates/show_preferences.inc.php
@@ -23,63 +23,19 @@
* 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 = 'interface'; }
-// HORRIBLE HACK!
-if ($_REQUEST['action'] == 'user') { $action_txt = '&amp;action=user'; }
-$link = Config::get('web_path') . $target;
-/* CSS construction bs */
-$link_active = "a_" . $current_tab;
-${$link_active} = "id=\"current\"";
-$tab_active = "tab_" .$current_tab;
-${$tab_active} = "id=\"tabactive\"";
?>
-<?php show_box_top(); ?>
-<span class="header1">
-<?php echo _('Editing'); ?> <?php echo $fullname; ?> <?php echo _('preferences'); ?>
-<?php if ($GLOBALS['user']->has_access(100)) { ?>
-[<a href="<?php echo Config::get('web_path'); ?>/admin/preferences.php?action=fix_preferences&amp;user_id=<?php echo $user_id; ?>"><?php echo _('Rebuild Preferences'); ?></a>]
-<?php } ?>
-</span>
-
-<div id="tabcontainer">
-<ul id="tablist">
-<li <?php echo $tab_interface; ?>>
- <a href="<?php echo $link; ?>?tab=interface&amp;user_id=<?php echo $user_id . $action_txt; ?>" <?php echo $a_interface; ?>><?php echo _('Interface'); ?></a>
-</li>
-<li <?php echo $tab_streaming; ?>>
- <a href="<?php echo $link; ?>?tab=streaming&amp;user_id=<?php echo $user_id . $action_txt; ?>" <?php echo $a_streaming; ?>><?php echo _('Streaming'); ?></a>
-</li>
-<li <?php echo $tab_options; ?>>
- <a href="<?php echo $link; ?>?tab=options&amp;user_id=<?php echo $user_id . $action_txt; ?>" <?php echo $a_options; ?>><?php echo _('Options'); ?></a>
-</li>
-<?php if ($user_id != '-1' && $_SESSION['userdata']['type'] == 'mysql') { ?>
-<li <?php echo $tab_account; ?>>
- <a href="<?php echo $link; ?>?tab=account&amp;user_id=<?php echo $user_id . $action_txt; ?>" <?php echo $a_account; ?>><?php echo _('Account'); ?></a>
-</li>
-<?php } elseif ($_SESSION['userdata']['type'] == 'mysql' || $user_id == '-1') { ?>
-<li <?php echo $tab_system; ?>>
- <a href="<?php echo $link; ?>?tab=system&amp;user_id=<?php echo $user_id; ?>" <?php echo $a_system; ?>><?php echo _('System'); ?></a>
-</li>
-<li <?php echo $tab_modules; ?>>
- <a href="<?php echo $link; ?>?tab=modules&amp;user_id=<?php echo $user_id; ?>" <?php echo $a_modules; ?>><?php echo _('Modules'); ?></a>
-</li>
-
-<?php } ?>
-</ul>
-</div>
-<div class="text-box" style="width:45em;">
-<form method="post" name="preferences" action="<?php echo Config::get('web_path'); ?><?php echo $target; ?>" enctype="multipart/form-data">
+<?php show_box_top(_('Editing') . ' ' . $fullname . ' ' . _('preferences')); ?>
+<form method="post" name="preferences" action="<?php echo Config::get('web_path'); ?>/preferences.php?action=update_preferences" enctype="multipart/form-data">
<?php
if ($current_tab != 'account' && $current_tab != 'modules') {
- show_preference_box($preferences[$current_tab]);
+ show_preference_box($preferences[$_REQUEST['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; ?>" />&nbsp;&nbsp;
<input type="hidden" name="tab" value="<?php echo scrub_out($current_tab); ?>" />
+ <input type="hidden" name="method" value="<?php echo scrub_out($_REQUEST['action']); ?>" />
<input class="button" type="submit" name="action" value="<?php echo _("Cancel"); ?>" />
<?php
}
diff --git a/templates/sidebar_preferences.inc.php b/templates/sidebar_preferences.inc.php
index 14bb5c67..1b988086 100644
--- a/templates/sidebar_preferences.inc.php
+++ b/templates/sidebar_preferences.inc.php
@@ -1,7 +1,14 @@
<h4><?php echo _('Sections'); ?></h4>
-<hr />
<span><a href="<?php echo $web_path; ?>/preferences.php?tab=interface"><?php echo _('Interface'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/preferences.php?tab=streaming"><?php echo _('Streaming'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/preferences.php?tab=options"><?php echo _('Options'); ?></a></span>
<span><a href="<?php echo $web_path; ?>/preferences.php?tab=account"><?php echo _('Account'); ?></a></span>
<hr />
+<?php if ($GLOBALS['user']->has_access('100')) { ?>
+<h4><?php echo _('Server Config'); ?></h4>
+<span><a href="<?php echo $web_path; ?>/preferences.php?action=admin&amp;tab=interface"><?php echo _('Interface'); ?></a></span>
+<span><a href="<?php echo $web_path; ?>/preferences.php?action=admin&amp;tab=streaming"><?php echo _('Streaming'); ?></a></span>
+<span><a href="<?php echo $web_path; ?>/preferences.php?action=admin&amp;tab=options"><?php echo _('Options'); ?></a></span>
+<span><a href="<?php echo $web_path; ?>/preferences.php?action=admin&amp;tab=system"><?php echo _('System'); ?></a></span>
+<hr />
+<?php } ?>