diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-01-27 03:57:38 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2009-01-27 03:57:38 +0000 |
commit | 03d0c2d5c3d455bbfba524b59d6269ae446351af (patch) | |
tree | 9890e0784e61b4f7f75a015e3ff8687dcdb0f234 | |
parent | bc25aa8141c287e6db6a2dc47b04fc30d3cf50ad (diff) | |
download | ampache-03d0c2d5c3d455bbfba524b59d6269ae446351af.tar.gz ampache-03d0c2d5c3d455bbfba524b59d6269ae446351af.tar.bz2 ampache-03d0c2d5c3d455bbfba524b59d6269ae446351af.zip |
fix editing preferences, and colorize the debug page a tad for fun
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/class/preference.class.php | 28 | ||||
-rw-r--r-- | templates/base.css | 12 | ||||
-rw-r--r-- | templates/show_debug.inc.php | 3 | ||||
-rw-r--r-- | templates/show_user_preferences.inc.php | 3 |
5 files changed, 45 insertions, 3 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 0b51f325..3e3820c4 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3-5-Alpha2 + - Fixed bug where you admins couldn't edit preferences of + users due to missing 'key' on form - Added Mime type to Song XML -------------------------------------------------------------------------- diff --git a/lib/class/preference.class.php b/lib/class/preference.class.php index 57368251..3bd87b0b 100644 --- a/lib/class/preference.class.php +++ b/lib/class/preference.class.php @@ -355,6 +355,34 @@ class Preference { } // clear_from_session /** + * is_boolean + * This returns true / false if the preference in question is a boolean preference + * This is currently only used by the debug view, could be used other places.. wouldn't be a half + * bad idea + */ + public static function is_boolean($key) { + + $boolean_array = array('session_cookiesecure','require_session', + 'access_control','require_localnet_session', + 'downsample_remote','track_user_ip', + 'xml_rpc','allow_zip_download', + 'file_zip_download','ratings', + 'shoutbox','resize_images', + 'show_album_art','allow_public_registration', + 'captcha_public_reg','admin_notify_reg', + 'use_rss','download','force_http_play', + 'allow_stream_playback','allow_democratic_playback', + 'use_auth','allow_localplay_playback','debug','lock_songs'); + + if (in_array($key,$boolean_array)) { + return true; + } + + return false; + + } // is_boolean + + /** * init * This grabs the preferences and then loads them into conf it should be run on page load * to initialize the needed variables diff --git a/templates/base.css b/templates/base.css index 17a43d97..db4d7408 100644 --- a/templates/base.css +++ b/templates/base.css @@ -24,6 +24,7 @@ /***************** * Tag Definitions *****************/ + .tag_size1 { font-size:.6em; } @@ -42,5 +43,12 @@ a.tag_size1, a.tag_size2, a.tag_size3, a.tag_size4 { text-decoration: none; } .hover-add:hover { font-weight:900; } .hover-remove:hover { text-decoration:line-through;} - - +/***************** + * Generic / Misc + *****************/ +.item_on { + color: #347C17; +} +.item_off { + color: #FF0000; +} diff --git a/templates/show_debug.inc.php b/templates/show_debug.inc.php index a3b0490a..f8a9a71d 100644 --- a/templates/show_debug.inc.php +++ b/templates/show_debug.inc.php @@ -94,6 +94,9 @@ } $value = $string; } + if (Preference::is_boolean($key)) { + $value = print_boolean($value); + } ?> <tr class="<?php echo flip_class(); ?>"> <td valign="top"><strong><?php echo $key; ?></strong></td> diff --git a/templates/show_user_preferences.inc.php b/templates/show_user_preferences.inc.php index 8ef67376..a948a078 100644 --- a/templates/show_user_preferences.inc.php +++ b/templates/show_user_preferences.inc.php @@ -1,7 +1,7 @@ <?php /* - Copyright (c) 2001 - 2007 Ampache.org + Copyright (c) Ampache.org All rights reserved This program is free software; you can redistribute it and/or @@ -48,6 +48,7 @@ <td> <div class="formValidation"> <input class="button" type="submit" value="<?php echo _('Update Preferences'); ?>" /> + <?php echo Core::form_register('update_preference'); ?> <input type="hidden" name="user_id" value="<?php echo scrub_out($_REQUEST['user_id']); ?>" /> </div> </td> |