summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-28 06:49:29 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-09-28 06:49:29 +0000
commitcad6aca40feafa7adbe6066772afbe225dbfe30c (patch)
treeb1f95ec59dffefa0c6a07fec3581832bd14cebf3
parentebdb7573bf4176b81264d2c66dd567fa3c3ee0bd (diff)
downloadampache-cad6aca40feafa7adbe6066772afbe225dbfe30c.tar.gz
ampache-cad6aca40feafa7adbe6066772afbe225dbfe30c.tar.bz2
ampache-cad6aca40feafa7adbe6066772afbe225dbfe30c.zip
removed images that were not being used, added icons and started the iconification!
-rw-r--r--admin/users.php49
-rw-r--r--images/icon_delete.gifbin0 -> 868 bytes
-rw-r--r--images/icon_disable.gifbin0 -> 552 bytes
-rw-r--r--images/icon_download.gifbin0 -> 306 bytes
-rw-r--r--images/icon_edit.gifbin0 -> 537 bytes
-rw-r--r--images/icon_enable.gifbin0 -> 289 bytes
-rw-r--r--images/icon_flag.gifbin0 -> 519 bytes
-rw-r--r--images/icon_link.gifbin0 -> 301 bytes
-rw-r--r--images/icon_preferences.gifbin0 -> 879 bytes
-rw-r--r--images/icon_statistics.gifbin0 -> 873 bytes
-rw-r--r--lib/ui.lib.php23
-rw-r--r--modules/admin.php11
-rw-r--r--templates/show_edit_user.inc.php (renamed from templates/userform.inc)35
-rw-r--r--templates/show_users.inc26
-rwxr-xr-xthemes/burgundy/images/headphone.gifbin861 -> 0 bytes
-rwxr-xr-xthemes/burgundy/images/table.gifbin5680 -> 0 bytes
-rw-r--r--themes/classic/images/blankalbum.jpgbin20730 -> 0 bytes
-rwxr-xr-xthemes/classic/images/headphone.gifbin861 -> 0 bytes
-rwxr-xr-xthemes/classic/images/table.gifbin5680 -> 0 bytes
-rw-r--r--themes/greyblock/images/blankalbum.jpgbin22197 -> 0 bytes
-rw-r--r--themes/greyblock/images/headphone.gifbin861 -> 0 bytes
-rw-r--r--themes/greyblock/images/table.gifbin5680 -> 0 bytes
22 files changed, 78 insertions, 66 deletions
diff --git a/admin/users.php b/admin/users.php
index 3a8c132c..e9cc8753 100644
--- a/admin/users.php
+++ b/admin/users.php
@@ -1,8 +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
@@ -29,7 +28,7 @@
require_once ('../lib/init.php');
-if (!$user->has_access(100)) {
+if (!$GLOBALS['user']->has_access(100)) {
access_denied();
}
@@ -43,17 +42,16 @@ $user_id = scrub_in($_REQUEST['user']);
$temp_user = new User($user_id);
switch ($action) {
- case 'edit':
- if (conf('demo_mode')) { break; }
- show_user_form($temp_user->username,
- $temp_user->fullname,
- $temp_user->email,
- $temp_user->access,
- 'edit_user',
- '');
+ case 'edit':
+ if (conf('demo_mode')) { break; }
+ $username = $temp_user->username;
+ $fullname = $temp_user->fullname;
+ $email = $temp_user->email;
+ $access = $temp_user->access;
+ $id = $temp_user->id;
+ require_once(conf('prefix') . '/templates/show_edit_user.inc.php');
break;
-
- case 'update_user':
+ case 'update_user':
if (conf('demo_mode')) { break; }
/* Clean up the variables */
@@ -162,20 +160,19 @@ switch ($action) {
show_user_form('','','','','new_user','');
break;
- case 'update':
- case 'disabled':
- if (conf('demo_mode')) { break; }
- $level = scrub_in($_REQUEST['level']);
- $thisuser = new User($_REQUEST['user']);
- if ($GLOBALS['user']->has_access(100)) {
- $thisuser->update_access($level);
- }
- show_manage_users();
+ case 'update':
+ case 'disabled':
+ if (conf('demo_mode')) { break; }
+ $level = scrub_in($_REQUEST['level']);
+ $thisuser = new User($_REQUEST['user']);
+ if ($GLOBALS['user']->has_access(100)) {
+ $thisuser->update_access($level);
+ }
+ show_manage_users();
+ break;
+ default:
+ show_manage_users();
break;
-
- default:
- show_manage_users();
-
}
/* Show the footer */
diff --git a/images/icon_delete.gif b/images/icon_delete.gif
new file mode 100644
index 00000000..94e71892
--- /dev/null
+++ b/images/icon_delete.gif
Binary files differ
diff --git a/images/icon_disable.gif b/images/icon_disable.gif
new file mode 100644
index 00000000..a769d5b9
--- /dev/null
+++ b/images/icon_disable.gif
Binary files differ
diff --git a/images/icon_download.gif b/images/icon_download.gif
new file mode 100644
index 00000000..c6ff1f2d
--- /dev/null
+++ b/images/icon_download.gif
Binary files differ
diff --git a/images/icon_edit.gif b/images/icon_edit.gif
new file mode 100644
index 00000000..fe1be8a7
--- /dev/null
+++ b/images/icon_edit.gif
Binary files differ
diff --git a/images/icon_enable.gif b/images/icon_enable.gif
new file mode 100644
index 00000000..0664a5f5
--- /dev/null
+++ b/images/icon_enable.gif
Binary files differ
diff --git a/images/icon_flag.gif b/images/icon_flag.gif
new file mode 100644
index 00000000..67a678e9
--- /dev/null
+++ b/images/icon_flag.gif
Binary files differ
diff --git a/images/icon_link.gif b/images/icon_link.gif
new file mode 100644
index 00000000..0971bb99
--- /dev/null
+++ b/images/icon_link.gif
Binary files differ
diff --git a/images/icon_preferences.gif b/images/icon_preferences.gif
new file mode 100644
index 00000000..6d8a5f24
--- /dev/null
+++ b/images/icon_preferences.gif
Binary files differ
diff --git a/images/icon_statistics.gif b/images/icon_statistics.gif
new file mode 100644
index 00000000..7deec08e
--- /dev/null
+++ b/images/icon_statistics.gif
Binary files differ
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 7eec5525..c3be646c 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -1312,4 +1312,27 @@ function show_box_bottom() {
} // show_box_bottom
+/**
+ * get_user_icon
+ * this function takes a name and a returns either a text representation
+ * or an <img /> tag
+ */
+function get_user_icon($name) {
+
+ $icon_name = 'icon_' . $name . '.gif';
+
+ if (file_exists(conf('prefix') . '/themes/' . $GLOBALS['theme']['path'] . '/images/' . $icon_name)) {
+ $img_url = conf('web_path') . conf('theme_path') . '/images/' . $icon_name;
+ }
+ else {
+ $img_url = conf('web_path') . '/images/' . $icon_name;
+ }
+
+ $string = "<img src=\"$img_url\" border=\"0\" alt=\"$name\" title=\"$name\" />";
+
+ return $string;
+
+} // show_icon
+
+
?>
diff --git a/modules/admin.php b/modules/admin.php
index 33cf37d8..0be633e5 100644
--- a/modules/admin.php
+++ b/modules/admin.php
@@ -51,17 +51,6 @@ function show_manage_users () {
} // show_manage_users()
-/*!
- @function show_user_form
- @discussion shows the user form
-*/
-function show_user_form ($username, $fullname, $email, $access, $type, $error) {
-
- require(conf('prefix').'/templates/userform.inc');
-
-} // show_user_form()
-
-
/*
* show_change_password
*
diff --git a/templates/userform.inc b/templates/show_edit_user.inc.php
index fbde9f5a..675c6224 100644
--- a/templates/userform.inc
+++ b/templates/show_edit_user.inc.php
@@ -21,23 +21,23 @@
*/
if ($type === 'new_user') {
- $userfield = "<input type=\"text\" name=\"new_username\" size=\"30\" value=\"$username\" />";
- $title = _("Adding a New User");
+ $userfield = "<input type=\"text\" name=\"new_username\" size=\"30\" value=\"" . scrub_out($username) . "\" />";
+ $title = _('Adding a New User');
}
else {
- $userfield = $username;
- $title = _("Editing existing User");
+ $userfield = scrub_out($username);
+ $title = _('Editing existing User');
}
?>
<br />
-<div class="header2"><?php echo $title; ?></div>
+<?php show_box_top($title); ?>
<?php $GLOBALS['error']->print_error('general'); ?>
<form name="update_user" method="post" action="<?php echo conf('web_path') . "/admin/users.php"; ?>">
-<table class="text-box" cellspacing="0" cellpadding="0" border="0">
+<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td>
- <?php echo _("Username"); ; ?>:
+ <?php echo _('Username'); ?>:
</td>
<td>
<?php echo $userfield; ?>
@@ -45,22 +45,22 @@ else {
</td>
</tr>
<tr>
- <td><?php echo _("Full Name"); ; ?>:</td>
+ <td><?php echo _('Full Name'); ?>:</td>
<td>
- <input type="text" name="new_fullname" size="30" value="<?php echo $fullname; ?>" />
+ <input type="text" name="new_fullname" size="30" value="<?php echo scrub_out($fullname); ?>" />
</td>
</tr>
<tr>
<td>
- <?php echo _("E-mail"); ?>:
+ <?php echo _('E-mail'); ?>:
</td>
<td>
- <input type="text" name="new_email" size="30" value="<?php echo $email; ?>" />
+ <input type="text" name="new_email" size="30" value="<?php echo scrub_out($email); ?>" />
</td>
</tr>
<tr>
<td>
- <?php echo _("Password"); ?> :
+ <?php echo _('Password'); ?> :
</td>
<td>
<input type="password" name="new_password_1" size="30" value="" />
@@ -69,7 +69,7 @@ else {
</tr>
<tr>
<td>
- <?php echo _("Confirm Password"); ?>:
+ <?php echo _('Confirm Password'); ?>:
</td>
<td>
<input type="password" name="new_password_2" size="30" value="" />
@@ -77,7 +77,7 @@ else {
</tr>
<tr>
<td>
- <?php echo _("User Access Level"); ; ?>:
+ <?php echo _('User Access Level'); ?>:
</td>
<td>
<select name="user_access">
@@ -91,12 +91,13 @@ else {
<?php
if ($type == 'new_user') {
echo "<input type=\"hidden\" name=\"action\" value=\"add_user\" />";
- echo "<input type=\"submit\" value=\"" . _("Add User") . "\" />";
+ echo "<input type=\"submit\" value=\"" . _('Add User') . "\" />";
}
else {
echo "<input type=\"hidden\" name=\"action\" value=\"update_user\" />\n";
- echo "<input type=\"submit\" value=\"" . _("Update User") . "\" />\n";
- echo "<input type=\"hidden\" name=\"new_username\" value=\"$username\" />";
+ echo "<input type=\"submit\" value=\"" . _('Update User') . "\" />\n";
+ echo "<input type=\"hidden\" name=\"new_username\" value=\"$id\" />";
}
?>
</form>
+<?php show_box_bottom(); ?>
diff --git a/templates/show_users.inc b/templates/show_users.inc
index a6e6442b..dd0d7b0a 100644
--- a/templates/show_users.inc
+++ b/templates/show_users.inc
@@ -54,7 +54,8 @@ $admin_menu = "admin/";
<b><?php echo _("Registration Date"); ?></b>
</a>
</td>
-
+ <td colspan="5">&nbsp;</td>
+ <!--
<td align="center">
<b><?php echo _("Edit"); ?></b>
</td>
@@ -70,6 +71,7 @@ $admin_menu = "admin/";
<td align="center">
<b><?php echo _("Delete"); ?></b>
</td>
+ -->
<td align="center">
<b><?php echo _("On-line"); ?></b>
</td>
@@ -83,46 +85,46 @@ while ($results = mysql_fetch_object($db_result)) {
if (!$user->create_date) { $create_date = "Unknown"; }
?>
-<tr class="<?php echo flip_class(); ?>">
- <td>
- <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&amp;user=<?php echo $user->username; ?>">
+<tr class="<?php echo flip_class(); ?>" align="center">
+ <td align="left">
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=edit&amp;user=<?php echo $user->id; ?>">
<?php echo $user->fullname; ?> (<?php echo $user->username; ?>)
</a>
</td>
- <td align="center">
+ <td>
<?php echo $last_seen; ?>
</td>
- <td align="center">
+ <td>
<?php echo $create_date; ?>
</td>
<td>
<a href="<?php echo $web_path; ?>/admin/users.php?action=edit&amp;user=<?php echo $user->username; ?>">
- <?php echo _("Edit"); ?>
+ <?php echo get_user_icon('edit'); ?>
</a>
</td>
<td>
<a href="<?php echo $web_path; ?>/admin/preferences.php?action=user&amp;user_id=<?php echo $user->username; ?>">
- <?php echo _("Prefs"); ?>
+ <?php echo get_user_icon('preferences'); ?>
</a>
</td>
<td>
<a href="<?php echo $web_path; ?>/stats.php?user_id=<?php echo $user->username; ?>">
- <?php echo _("Stats"); ?>
+ <?php echo get_user_icon('statistics'); ?>
</a>
</td>
<?php
//FIXME: Fix this for the extra permission levels
if ($user->disabled == '1') {
- echo "<td><a href=\"".$web_path."/admin/users.php?action=update&amp;user=$user->username&amp;level=enabled\">" . _("Enable") . "</a></td>";
+ echo "<td><a href=\"".$web_path."/admin/users.php?action=update&amp;user=$user->username&amp;level=enabled\">" . get_user_icon('enable') . "</a></td>";
}
else {
- echo "<td><a href=\"".$web_path."/admin/users.php?action=update&amp;user=$user->username&amp;level=disabled\">" . _("Disable") ."</a></td>";
+ echo "<td><a href=\"".$web_path."/admin/users.php?action=update&amp;user=$user->username&amp;level=disabled\">" . get_user_icon('disable') ."</a></td>";
}
?>
<td>
<a href="<?php echo $web_path; ?>/admin/users.php?action=delete&amp;user=<?php echo $user->username; ?>">
- <?php echo _("delete"); ?>
+ <?php echo get_user_icon('delete'); ?>
</a>
</td>
<?php
diff --git a/themes/burgundy/images/headphone.gif b/themes/burgundy/images/headphone.gif
deleted file mode 100755
index 74a66e11..00000000
--- a/themes/burgundy/images/headphone.gif
+++ /dev/null
Binary files differ
diff --git a/themes/burgundy/images/table.gif b/themes/burgundy/images/table.gif
deleted file mode 100755
index 89761b38..00000000
--- a/themes/burgundy/images/table.gif
+++ /dev/null
Binary files differ
diff --git a/themes/classic/images/blankalbum.jpg b/themes/classic/images/blankalbum.jpg
deleted file mode 100644
index 468301bd..00000000
--- a/themes/classic/images/blankalbum.jpg
+++ /dev/null
Binary files differ
diff --git a/themes/classic/images/headphone.gif b/themes/classic/images/headphone.gif
deleted file mode 100755
index 74a66e11..00000000
--- a/themes/classic/images/headphone.gif
+++ /dev/null
Binary files differ
diff --git a/themes/classic/images/table.gif b/themes/classic/images/table.gif
deleted file mode 100755
index 89761b38..00000000
--- a/themes/classic/images/table.gif
+++ /dev/null
Binary files differ
diff --git a/themes/greyblock/images/blankalbum.jpg b/themes/greyblock/images/blankalbum.jpg
deleted file mode 100644
index f3a49a2d..00000000
--- a/themes/greyblock/images/blankalbum.jpg
+++ /dev/null
Binary files differ
diff --git a/themes/greyblock/images/headphone.gif b/themes/greyblock/images/headphone.gif
deleted file mode 100644
index 74a66e11..00000000
--- a/themes/greyblock/images/headphone.gif
+++ /dev/null
Binary files differ
diff --git a/themes/greyblock/images/table.gif b/themes/greyblock/images/table.gif
deleted file mode 100644
index 89761b38..00000000
--- a/themes/greyblock/images/table.gif
+++ /dev/null
Binary files differ