summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-01-26 02:19:06 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2013-01-26 02:19:06 -0500
commita12679b13d8d06c87308b1d26bc23c6b4fa5d92e (patch)
treed78d1a63975bfe5760bed1e6c94d38237201d807
parent80b618ba403d4560938cd1bfbed861994875d6c7 (diff)
downloadampache-a12679b13d8d06c87308b1d26bc23c6b4fa5d92e.tar.gz
ampache-a12679b13d8d06c87308b1d26bc23c6b4fa5d92e.tar.bz2
ampache-a12679b13d8d06c87308b1d26bc23c6b4fa5d92e.zip
Move get_user_icon from ui.lib.php to UI::get_icon
-rw-r--r--lib/class/ajax.class.php2
-rw-r--r--lib/class/ampache_rss.class.php2
-rw-r--r--lib/class/playlist_object.abstract.php2
-rw-r--r--lib/class/ui.class.php59
-rw-r--r--lib/javascript/search-data.php2
-rw-r--r--lib/ui.lib.php73
-rw-r--r--templates/rightbar.inc.php6
-rw-r--r--templates/show_access_list.inc.php12
-rw-r--r--templates/show_album.inc.php8
-rw-r--r--templates/show_album_row.inc.php4
-rw-r--r--templates/show_artist.inc.php8
-rw-r--r--templates/show_artist_row.inc.php2
-rw-r--r--templates/show_debug.inc.php4
-rw-r--r--templates/show_democratic.inc.php2
-rw-r--r--templates/show_ip_history.inc.php4
-rw-r--r--templates/show_live_stream.inc.php2
-rw-r--r--templates/show_localplay_instances.inc.php2
-rw-r--r--templates/show_manage_democratic.inc.php2
-rw-r--r--templates/show_playlist.inc.php6
-rw-r--r--templates/show_playlist_row.inc.php2
-rw-r--r--templates/show_playlist_song_row.inc.php2
-rw-r--r--templates/show_rules.inc.php2
-rw-r--r--templates/show_search_options.inc.php2
-rw-r--r--templates/show_shout_row.inc.php4
-rw-r--r--templates/show_smartplaylist.inc.php4
-rw-r--r--templates/show_smartplaylist_row.inc.php2
-rw-r--r--templates/show_song.inc.php4
-rw-r--r--templates/show_song_row.inc.php6
-rw-r--r--templates/show_user_row.inc.php10
-rw-r--r--templates/show_user_stats.inc.php6
-rw-r--r--templates/show_video_row.inc.php2
-rw-r--r--templates/sidebar.inc.php2
32 files changed, 119 insertions, 131 deletions
diff --git a/lib/class/ajax.class.php b/lib/class/ajax.class.php
index de217330..04098861 100644
--- a/lib/class/ajax.class.php
+++ b/lib/class/ajax.class.php
@@ -123,7 +123,7 @@ class Ajax {
$class = ' class="' . $class . '"';
}
- $string = get_user_icon($icon,$alt);
+ $string = UI::get_icon($icon,$alt);
// Generate an <a> so that it's more compliant with older
// browsers (ie :hover actions) and also to unify linkbuttons
diff --git a/lib/class/ampache_rss.class.php b/lib/class/ampache_rss.class.php
index 3b567937..3056e9cf 100644
--- a/lib/class/ampache_rss.class.php
+++ b/lib/class/ampache_rss.class.php
@@ -113,7 +113,7 @@ class Ampache_RSS {
// Default to now playing
$type = self::validate_type($type);
- $string = '<a href="' . Config::get('web_path') . '/rss.php?type=' . $type . '">' . get_user_icon('feed', T_('RSS Feed')) . '</a>';
+ $string = '<a href="' . Config::get('web_path') . '/rss.php?type=' . $type . '">' . UI::get_icon('feed', T_('RSS Feed')) . '</a>';
return $string;
diff --git a/lib/class/playlist_object.abstract.php b/lib/class/playlist_object.abstract.php
index 48eefb0d..d232d6d7 100644
--- a/lib/class/playlist_object.abstract.php
+++ b/lib/class/playlist_object.abstract.php
@@ -40,7 +40,7 @@ abstract class playlist_object extends database_object {
public function format() {
$this->f_name = UI::truncate($this->name,Config::get('ellipse_threshold_title'));
- $this->f_type = ($this->type == 'private') ? get_user_icon('lock', T_('Private')) : '';
+ $this->f_type = ($this->type == 'private') ? UI::get_icon('lock', T_('Private')) : '';
$client = new User($this->user);
diff --git a/lib/class/ui.class.php b/lib/class/ui.class.php
index c3d69198..f37c5a36 100644
--- a/lib/class/ui.class.php
+++ b/lib/class/ui.class.php
@@ -27,6 +27,7 @@ class UI {
private static $_classes;
private static $_ticker;
+ private static $_icon_cache;
public function __construct($data) {
return false;
@@ -104,6 +105,64 @@ class UI {
}
/**
+ * get_icon
+ *
+ * Returns an <img> tag for the specified icon
+ */
+ public static function get_icon($name, $title = null, $id = null) {
+ if (is_array($name)) {
+ $hover_name = $name[1];
+ $name = $name[0];
+ }
+
+ $title = $title ?: T_(ucfirst($name));
+
+ $icon_url = self::_find_icon($name);
+ if ($hover_name) {
+ $hover_url = self::_find_icon($hover_text);
+ }
+
+ $tag = '<img src="' . $icon_url . '" ';
+
+ if ($id) {
+ $tag .= 'id="' . $id . '" ';
+ }
+
+ $tag .= 'alt="' . $title . '" ';
+ $tag .= 'title="' . $title . '" ';
+
+ if ($hover_name) {
+ $tag .= 'onmouseover="this.src=\'' . $hover_url . '\'; return true;"';
+ $tag .= 'onmouseout="this.src=\'' . $icon_url . '\'; return true;" ';
+ }
+
+ $tag .= '/>';
+ return $tag;
+ }
+
+ /**
+ * _find_icon
+ *
+ * Does the finding icon thing
+ */
+ private static function _find_icon($name) {
+ if ($url = self::$_icon_cache[$name]) {
+ return $url;
+ }
+
+ $filename = 'icon_' . $name . '.png';
+ $path = Config::get('theme_path') . '/images/icons/';
+ if (!file_exists(Config::get('prefix') . $path . $filename)) {
+ $path = '/images/';
+ }
+ $url = Config::get('web_path') . $path . $filename;
+ self::$_icon_cache[$name] = $url;
+
+ return $url;
+ }
+
+
+ /**
* show_header
*
* For now this just shows the header template
diff --git a/lib/javascript/search-data.php b/lib/javascript/search-data.php
index 83c3be29..dd3e302e 100644
--- a/lib/javascript/search-data.php
+++ b/lib/javascript/search-data.php
@@ -48,5 +48,5 @@ echo 'var types = $H(\'';
echo arrayToJSON($search->types) . "'.evalJSON());\n";
echo 'var basetypes = $H(\'';
echo arrayToJSON($search->basetypes) . "'.evalJSON());\n";
-echo 'removeIcon = \'<a href="javascript: void(0)">' . get_user_icon('disable', T_('Remove')) . '</a>\';';
+echo 'removeIcon = \'<a href="javascript: void(0)">' . UI::get_icon('disable', T_('Remove')) . '</a>\';';
?>
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 7755a939..a72c4c70 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -342,78 +342,7 @@ function show_playlist_select($name,$selected='',$style='') {
} // show_playlist_select
-/**
- * get_user_icon
- * this function takes a name and a returns either a text representation
- * or an <img /> tag
- */
-function get_user_icon($name,$title='',$id='') {
-
- /* Because we do a lot of calls cache the URLs */
- static $url_cache = array();
-
- // If our name is an array
- if (is_array($name)) {
- $hover_name = $name['1'];
- $name = $name['0'];
- }
-
- if (!$title) { $title = T_(ucfirst($name)); }
-
- if ($id) {
- $id = ' id="' . $id . '" ';
- }
-
- if (isset($url_cache[$name])) {
- $img_url = $url_cache[$name];
- $cache_url = true;
- }
-
- if (empty($hover_name)) {
- $cache_hover = true;
- $hov_txt = '';
- }
- elseif (isset($url_cache[$hover_name])) {
- $hover_url = $url_cache[$hover_name];
- $cache_hover = true;
- }
-
- if (!isset($cache_url) OR !isset($cache_hover)) {
-
- $icon_name = 'icon_' . $name . '.png';
-
- /* Build the image url */
- if (file_exists(Config::get('prefix') . Config::get('theme_path') . '/images/icons/' . $icon_name)) {
- $img_url = Config::get('web_path') . Config::get('theme_path') . '/images/icons/' . $icon_name;
- }
- else {
- $img_url = Config::get('web_path') . '/images/' . $icon_name;
- }
-
- $url_cache[$name] = $img_url;
-
- /* If Hover, then build its url */
- if (!empty($hover_name)) {
- $hover_icon = 'icon_' . $hover_name . '.png';
- if (file_exists(Config::get('prefix') . Config::get('theme_path') . '/images/icons/' . $icon_name)) {
- $hov_url = Config::get('web_path') . Config::get('theme_path') . '/images/icons/' . $hover_icon;
- }
- else {
- $hov_url = Config::get('web_path') . '/images/' . $hover_icon;
- }
-
- $hov_txt = " onmouseover=\"this.src='$hov_url'; return true;\" onmouseout=\"this.src='$img_url'; return true;\" ";
- $url_cache[$hover_name] = $hov_txt;
- } // end hover
-
- } // end if not cached
-
- $string = '<img src="' . $img_url . '"' . $id . 'alt="' . $title . '" title="' . $title . '"' . $hov_txt . '/>';
-
- return $string;
-
-} // get_user_icon
-
+// FIXME: This should probably go in XML_Data
/**
* xml_from_array
* This takes a one dimensional array and creates a XML document from it. For
diff --git a/templates/rightbar.inc.php b/templates/rightbar.inc.php
index 6296a0cf..cb979e52 100644
--- a/templates/rightbar.inc.php
+++ b/templates/rightbar.inc.php
@@ -25,7 +25,7 @@
<?php echo Ajax::button('?page=stream&action=basket','all', T_('Play'),'rightbar_play'); ?>
</li>
<li id="pl_add">
- <?php echo get_user_icon('playlist_add', T_('Add to Playlist')); ?>
+ <?php echo UI::get_icon('playlist_add', T_('Add to Playlist')); ?>
<ul id="pl_action_additems" class="submenu">
<li>
<?php echo Ajax::text('?page=playlist&action=create', T_('Add to New Playlist'),'rb_create_playlist'); ?>
@@ -46,7 +46,7 @@
<?php if (Access::check_function('batch_download')) { ?>
<li>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=tmp_playlist&amp;id=<?php echo $GLOBALS['user']->playlist->id; ?>">
- <?php echo get_user_icon('batch_download', T_('Batch Download')); ?>
+ <?php echo UI::get_icon('batch_download', T_('Batch Download')); ?>
</a>
</li>
<?php } ?>
@@ -54,7 +54,7 @@
<?php echo Ajax::button('?action=basket&type=clear_all','delete', T_('Clear Playlist'),'rb_clear_playlist'); ?>
</li>
<li id="rb_add">
- <?php echo get_user_icon('add', T_('Add Dynamic Items')); ?>
+ <?php echo UI::get_icon('add', T_('Add Dynamic Items')); ?>
<ul id="rb_action_additems" class="submenu">
<li>
<?php echo Ajax::text('?action=basket&type=dynamic&random_type=default', T_('Pure Random'),'rb_add_pure_random'); ?>
diff --git a/templates/show_access_list.inc.php b/templates/show_access_list.inc.php
index 8d502694..2973e01c 100644
--- a/templates/show_access_list.inc.php
+++ b/templates/show_access_list.inc.php
@@ -24,18 +24,18 @@
<div id="information_actions" class="left-column">
<ul>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_current"><?php echo get_user_icon('add_user', T_('Add Current Host')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_current"><?php echo UI::get_icon('add_user', T_('Add Current Host')); ?></a>
<?php echo T_('Add Current Host'); ?>
</li>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_rpc"><?php echo get_user_icon('cog', T_('Add API / RPC Host')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_rpc"><?php echo UI::get_icon('cog', T_('Add API / RPC Host')); ?></a>
<?php echo T_('Add API / RPC Host'); ?>
</li>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_local"><?php echo get_user_icon('home', T_('Add Local Network Definition')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_local"><?php echo UI::get_icon('home', T_('Add Local Network Definition')); ?></a>
<?php echo T_('Add Local Network Definition'); ?>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_advanced"><?php echo get_user_icon('add_key', T_('Advanced Add')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_add_advanced"><?php echo UI::get_icon('add_key', T_('Advanced Add')); ?></a>
<?php echo T_('Advanced Add'); ?>
</li>
@@ -69,8 +69,8 @@
<td><?php echo $access->f_user; ?></td>
<td><?php echo $access->f_type; ?></td>
<td>
- <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_edit_record&amp;access_id=<?php echo scrub_out($access->id); ?>"><?php echo get_user_icon('edit', T_('Edit')); ?></a>
- <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_delete_record&amp;access_id=<?php echo scrub_out($access->id); ?>"><?php echo get_user_icon('delete', T_('Delete')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_edit_record&amp;access_id=<?php echo scrub_out($access->id); ?>"><?php echo UI::get_icon('edit', T_('Edit')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/access.php?action=show_delete_record&amp;access_id=<?php echo scrub_out($access->id); ?>"><?php echo UI::get_icon('delete', T_('Delete')); ?></a>
</td>
</tr>
<?php } // end foreach ?>
diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php
index ce83c232..449203ba 100644
--- a/templates/show_album.inc.php
+++ b/templates/show_album.inc.php
@@ -58,23 +58,23 @@ $title .= '&nbsp;-&nbsp;' . $album->f_artist_link;
</li>
<?php if (Access::check('interface','75')) { ?>
<li>
- <a href="<?php echo $web_path; ?>/albums.php?action=clear_art&amp;album_id=<?php echo $album->id; ?>"><?php echo get_user_icon('delete', T_('Reset Album Art')); ?></a>
+ <a href="<?php echo $web_path; ?>/albums.php?action=clear_art&amp;album_id=<?php echo $album->id; ?>"><?php echo UI::get_icon('delete', T_('Reset Album Art')); ?></a>
<a href="<?php echo $web_path; ?>/albums.php?action=clear_art&amp;album_id=<?php echo $album->id; ?>"><?php echo T_('Reset Album Art'); ?></a>
</li>
<?php } ?>
<li>
- <a href="<?php echo $web_path; ?>/albums.php?action=find_art&amp;album_id=<?php echo $album->id; ?>"><?php echo get_user_icon('view', T_('Find Album Art')); ?></a>
+ <a href="<?php echo $web_path; ?>/albums.php?action=find_art&amp;album_id=<?php echo $album->id; ?>"><?php echo UI::get_icon('view', T_('Find Album Art')); ?></a>
<a href="<?php echo $web_path; ?>/albums.php?action=find_art&amp;album_id=<?php echo $album->id; ?>"><?php echo T_('Find Album Art'); ?></a>
</li>
<?php if ((Access::check('interface','50'))) { ?>
<li>
- <a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&amp;album_id=<?php echo $album->id; ?>"><?php echo get_user_icon('cog', T_('Update from tags')); ?></a>
+ <a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&amp;album_id=<?php echo $album->id; ?>"><?php echo UI::get_icon('cog', T_('Update from tags')); ?></a>
<a href="<?php echo $web_path; ?>/albums.php?action=update_from_tags&amp;album_id=<?php echo $album->id; ?>"><?php echo T_('Update from tags'); ?></a>
</li>
<?php } ?>
<?php if (Access::check_function('batch_download')) { ?>
<li>
- <a href="<?php echo $web_path; ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>"><?php echo get_user_icon('batch_download', T_('Download')); ?></a>
+ <a href="<?php echo $web_path; ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>"><?php echo UI::get_icon('batch_download', T_('Download')); ?></a>
<a href="<?php echo $web_path; ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>"><?php echo T_('Download'); ?></a>
</li>
<?php } ?>
diff --git a/templates/show_album_row.inc.php b/templates/show_album_row.inc.php
index c53cbadd..db6ce30b 100644
--- a/templates/show_album_row.inc.php
+++ b/templates/show_album_row.inc.php
@@ -43,12 +43,12 @@ if (Art::is_enabled()) {
<td class="cel_action">
<?php if (Config::get('sociable')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/shout.php?action=show_add_shout&amp;type=album&amp;id=<?php echo $album->id; ?>">
- <?php echo get_user_icon('comment', T_('Post Shout')); ?>
+ <?php echo UI::get_icon('comment', T_('Post Shout')); ?>
</a>
<?php } ?>
<?php if (Access::check_function('batch_download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=album&amp;id=<?php echo $album->id; ?>">
- <?php echo get_user_icon('batch_download', T_('Batch Download')); ?>
+ <?php echo UI::get_icon('batch_download', T_('Batch Download')); ?>
</a>
<?php } ?>
<?php if (Access::check('interface','50')) { ?>
diff --git a/templates/show_artist.inc.php b/templates/show_artist.inc.php
index 59cb1566..aa26d52d 100644
--- a/templates/show_artist.inc.php
+++ b/templates/show_artist.inc.php
@@ -38,11 +38,11 @@ if (Config::get('ratings')) {
<li>
<?php if ($object_type == 'album') { ?>
<a href="<?php echo $web_path; ?>/artists.php?action=show_all_songs&amp;artist=<?php echo $artist->id; ?>">
- <?php echo get_user_icon('view', T_("Show All Songs By %s")); ?>
+ <?php echo UI::get_icon('view', T_("Show All Songs By %s")); ?>
<?php printf(T_("Show All Songs By %s"), $artist->f_name); ?></a>
<?php } else { ?>
<a href="<?php echo $web_path; ?>/artists.php?action=show&amp;artist=<?php echo $artist->id; ?>">
- <?php echo get_user_icon('view', T_("Show Albums By %s")); ?>
+ <?php echo UI::get_icon('view', T_("Show Albums By %s")); ?>
<?php printf(T_("Show Albums By %s"), $artist->f_name); ?></a>
<?php } ?>
</li>
@@ -58,13 +58,13 @@ if (Config::get('ratings')) {
</li>
<?php if (Access::check('interface','50')) { ?>
<li>
- <a href="<?php echo $web_path; ?>/artists.php?action=update_from_tags&amp;artist=<?php echo $artist->id; ?>"><?php echo get_user_icon('cog', T_('Update from tags')); ?></a>
+ <a href="<?php echo $web_path; ?>/artists.php?action=update_from_tags&amp;artist=<?php echo $artist->id; ?>"><?php echo UI::get_icon('cog', T_('Update from tags')); ?></a>
<a href="<?php echo $web_path; ?>/artists.php?action=update_from_tags&amp;artist=<?php echo $artist->id; ?>"><?php echo T_('Update from tags'); ?></a>
</li>
<?php } ?>
<?php if (Access::check_function('batch_download')) { ?>
<li>
- <a href="<?php echo $web_path; ?>/batch.php?action=artist&id=<?php echo $artist->id; ?>"><?php echo get_user_icon('batch_download', T_('Download')); ?></a>
+ <a href="<?php echo $web_path; ?>/batch.php?action=artist&id=<?php echo $artist->id; ?>"><?php echo UI::get_icon('batch_download', T_('Download')); ?></a>
<a href="<?php echo $web_path; ?>/batch.php?action=artist&id=<?php echo $artist->id; ?>"><?php echo T_('Download'); ?></a>
</li>
<?php } ?>
diff --git a/templates/show_artist_row.inc.php b/templates/show_artist_row.inc.php
index e97ce19f..f7612c1e 100644
--- a/templates/show_artist_row.inc.php
+++ b/templates/show_artist_row.inc.php
@@ -33,7 +33,7 @@
<td class="cel_action">
<?php if (Access::check_function('batch_download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=artist&amp;id=<?php echo $artist->id; ?>">
- <?php echo get_user_icon('batch_download','', T_('Batch Download')); ?>
+ <?php echo UI::get_icon('batch_download','', T_('Batch Download')); ?>
</a>
<?php } ?>
<?php if (Access::check('interface','50')) { ?>
diff --git a/templates/show_debug.inc.php b/templates/show_debug.inc.php
index adfcea5c..369774eb 100644
--- a/templates/show_debug.inc.php
+++ b/templates/show_debug.inc.php
@@ -24,11 +24,11 @@
<div id="information_actions">
<ul>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/admin/system.php?action=generate_config"><?php echo get_user_icon('cog', T_('Generate Configuration')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/system.php?action=generate_config"><?php echo UI::get_icon('cog', T_('Generate Configuration')); ?></a>
<?php echo T_('Generate Configuration'); ?>
</li>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/admin/system.php?action=reset_db_charset"><?php echo get_user_icon('server_lightning', T_('Set Database Charset')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/admin/system.php?action=reset_db_charset"><?php echo UI::get_icon('server_lightning', T_('Set Database Charset')); ?></a>
<?php echo T_('Set Database Charset'); ?>
</li>
</ul>
diff --git a/templates/show_democratic.inc.php b/templates/show_democratic.inc.php
index 5479f3b2..ed951c06 100644
--- a/templates/show_democratic.inc.php
+++ b/templates/show_democratic.inc.php
@@ -32,7 +32,7 @@ UI::show_box_top($string , 'info-box');
<?php } ?>
<?php if (Access::check('interface','75')) { ?>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/democratic.php?action=manage"><?php echo get_user_icon('server_lightning', T_('Configure Democratic Playlist')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/democratic.php?action=manage"><?php echo UI::get_icon('server_lightning', T_('Configure Democratic Playlist')); ?></a>
<?php echo T_('Configure Democratic Playlist'); ?>
</li>
<?php if ($democratic->is_enabled()) { ?>
diff --git a/templates/show_ip_history.inc.php b/templates/show_ip_history.inc.php
index 863d07c2..da4fb607 100644
--- a/templates/show_ip_history.inc.php
+++ b/templates/show_ip_history.inc.php
@@ -25,10 +25,10 @@
<ul>
<li>
<?php if (isset($_REQUEST['all'])){ ?>
- <a href="<?php echo Config::get('web_path')?>/admin/users.php?action=show_ip_history&user_id=<?php echo $working_user->id?>"><?php echo get_user_icon('disable'); ?></a>
+ <a href="<?php echo Config::get('web_path')?>/admin/users.php?action=show_ip_history&user_id=<?php echo $working_user->id?>"><?php echo UI::get_icon('disable'); ?></a>
<?php echo T_('Show Unique'); ?>
<?php }else{ ?>
- <a href="<?php echo Config::get('web_path')?>/admin/users.php?action=show_ip_history&user_id=<?php echo $working_user->id?>&all"><?php echo get_user_icon('add'); ?></a>
+ <a href="<?php echo Config::get('web_path')?>/admin/users.php?action=show_ip_history&user_id=<?php echo $working_user->id?>&all"><?php echo UI::get_icon('add'); ?></a>
<?php echo T_('Show All'); ?>
<?php }?>
</li>
diff --git a/templates/show_live_stream.inc.php b/templates/show_live_stream.inc.php
index ce2613f6..4cf52c27 100644
--- a/templates/show_live_stream.inc.php
+++ b/templates/show_live_stream.inc.php
@@ -24,7 +24,7 @@
<div id="information_actions">
<ul>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/radio.php?action=show_create"><?php echo get_user_icon('add', T_('Add')); ?></a> <?php echo T_('Add Radio Station'); ?>
+ <a href="<?php echo Config::get('web_path'); ?>/radio.php?action=show_create"><?php echo UI::get_icon('add', T_('Add')); ?></a> <?php echo T_('Add Radio Station'); ?>
</li>
</ul>
</div>
diff --git a/templates/show_localplay_instances.inc.php b/templates/show_localplay_instances.inc.php
index 094a581f..755744b7 100644
--- a/templates/show_localplay_instances.inc.php
+++ b/templates/show_localplay_instances.inc.php
@@ -36,7 +36,7 @@
<td><?php echo $instance[$key]; ?></td>
<?php } ?>
<td>
- <a href="<?php echo Config::get('web_path'); ?>/localplay.php?action=edit_instance&instance=<?php echo $uid; ?>"><?php echo get_user_icon('edit', T_('Edit Instance')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/localplay.php?action=edit_instance&instance=<?php echo $uid; ?>"><?php echo UI::get_icon('edit', T_('Edit Instance')); ?></a>
<?php echo Ajax::button('?page=localplay&action=delete_instance&instance=' . $uid,'delete', T_('Delete'),'delete_instance_' . $uid); ?>
</td>
</tr>
diff --git a/templates/show_manage_democratic.inc.php b/templates/show_manage_democratic.inc.php
index 8dc9b1d5..0134c9f3 100644
--- a/templates/show_manage_democratic.inc.php
+++ b/templates/show_manage_democratic.inc.php
@@ -56,7 +56,7 @@ UI::show_box_top(T_('Manage Democratic Playlists')); ?>
<td><?php echo $democratic->count_items(); ?></td>
<td>
<?php echo Ajax::button('?page=democratic&action=send_playlist&democratic_id=' . $democratic->id,'all', T_('Play'),'play_democratic'); ?>
- <a href="<?php echo Config::get('web_path'); ?>/democratic.php?action=delete&amp;democratic_id=<?php echo scrub_out($democratic->id); ?>"><?php echo get_user_icon('delete', T_('Delete')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/democratic.php?action=delete&amp;democratic_id=<?php echo scrub_out($democratic->id); ?>"><?php echo UI::get_icon('delete', T_('Delete')); ?></a>
</td>
</tr>
<?php } if (!count($playlists)) { ?>
diff --git a/templates/show_playlist.inc.php b/templates/show_playlist.inc.php
index 1b552d60..6e426d12 100644
--- a/templates/show_playlist.inc.php
+++ b/templates/show_playlist.inc.php
@@ -37,12 +37,12 @@ UI::show_box_top('<div id="playlist_row_' . $playlist->id . '">' . $title .
<div id="information_actions">
<ul>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/playlist.php?action=normalize_tracks&amp;playlist_id=<?php echo $playlist->id; ?>"><?php echo get_user_icon('statistics', T_('Normalize Tracks')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/playlist.php?action=normalize_tracks&amp;playlist_id=<?php echo $playlist->id; ?>"><?php echo UI::get_icon('statistics', T_('Normalize Tracks')); ?></a>
<?php echo T_('Normalize Tracks'); ?>
</li>
<?php if (Access::check_function('batch_download')) { ?>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=playlist&amp;id=<?php echo $playlist->id; ?>"><?php echo get_user_icon('batch_download', T_('Batch Download')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=playlist&amp;id=<?php echo $playlist->id; ?>"><?php echo UI::get_icon('batch_download', T_('Batch Download')); ?></a>
<?php echo T_('Batch Download'); ?>
</li>
<?php } ?>
@@ -61,7 +61,7 @@ UI::show_box_top('<div id="playlist_row_' . $playlist->id . '">' . $title .
</li>
<li>
<a href="<?php echo Config::get('web_path'); ?>/playlist.php?action=delete_playlist&playlist_id=<?php echo $playlist->id; ?>">
- <?php echo get_user_icon('delete'); ?>
+ <?php echo UI::get_icon('delete'); ?>
</a>
<?php echo T_('Delete'); ?>
</li>
diff --git a/templates/show_playlist_row.inc.php b/templates/show_playlist_row.inc.php
index 048ff3fa..5737c0c2 100644
--- a/templates/show_playlist_row.inc.php
+++ b/templates/show_playlist_row.inc.php
@@ -31,7 +31,7 @@
<td class="cel_action">
<?php if (Access::check_function('batch_download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=playlist&amp;id=<?php echo $playlist->id; ?>">
- <?php echo get_user_icon('batch_download', T_('Batch Download')); ?>
+ <?php echo UI::get_icon('batch_download', T_('Batch Download')); ?>
</a>
<?php } ?>
<?php if ($playlist->has_access()) { ?>
diff --git a/templates/show_playlist_song_row.inc.php b/templates/show_playlist_song_row.inc.php
index 5b6c1f4a..69f7f950 100644
--- a/templates/show_playlist_song_row.inc.php
+++ b/templates/show_playlist_song_row.inc.php
@@ -34,7 +34,7 @@
<td class="cel_action">
<?php if (Config::get('download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>">
- <?php echo get_user_icon('download', T_('Download')); ?>
+ <?php echo UI::get_icon('download', T_('Download')); ?>
</a>
<?php } ?>
<?php if ($playlist->has_access()) { ?>
diff --git a/templates/show_rules.inc.php b/templates/show_rules.inc.php
index 29554514..93754da4 100644
--- a/templates/show_rules.inc.php
+++ b/templates/show_rules.inc.php
@@ -46,7 +46,7 @@ $logic_operator = strtolower($logic_operator);
<tr id="rules_addrowbutton">
<td>
<a id="addrowbutton" href="javascript:void(0)">
- <?php echo get_user_icon('add'); ?>
+ <?php echo UI::get_icon('add'); ?>
<?php echo T_('Add Another Rule'); ?>
</a>
<script type="text/javascript">Event.observe('addrowbutton', 'click', SearchRow.add);</script>
diff --git a/templates/show_search_options.inc.php b/templates/show_search_options.inc.php
index f8ae35d1..aa6974db 100644
--- a/templates/show_search_options.inc.php
+++ b/templates/show_search_options.inc.php
@@ -29,7 +29,7 @@
</li>
<?php if (Access::check_function('batch_download')) { ?>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=browse&amp;type=<?php echo scrub_out($_REQUEST['type']); ?>&amp;browse_id=<?php echo $browse->id; ?>"><?php echo get_user_icon('batch_download', T_('Batch Download')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=browse&amp;type=<?php echo scrub_out($_REQUEST['type']); ?>&amp;browse_id=<?php echo $browse->id; ?>"><?php echo UI::get_icon('batch_download', T_('Batch Download')); ?></a>
<?php echo T_('Batch Download'); ?>
</li>
<?php } ?>
diff --git a/templates/show_shout_row.inc.php b/templates/show_shout_row.inc.php
index effa3636..355983e8 100644
--- a/templates/show_shout_row.inc.php
+++ b/templates/show_shout_row.inc.php
@@ -29,11 +29,11 @@
<td class="cel_action">
<a href="<?php echo $web_path; ?>/admin/shout.php?action=show_edit&amp;shout_id=<?php echo $shout->id; ?>">
- <?php echo get_user_icon('edit', T_('Edit')); ?>
+ <?php echo UI::get_icon('edit', T_('Edit')); ?>
</a>
<a href="<?php echo $web_path; ?>/admin/shout.php?action=delete&amp;shout_id=<?php echo $shout->id; ?>">
- <?php echo get_user_icon('delete', T_('Delete')); ?>
+ <?php echo UI::get_icon('delete', T_('Delete')); ?>
</a>
</td>
</tr>
diff --git a/templates/show_smartplaylist.inc.php b/templates/show_smartplaylist.inc.php
index c72734c9..b2c4062c 100644
--- a/templates/show_smartplaylist.inc.php
+++ b/templates/show_smartplaylist.inc.php
@@ -32,7 +32,7 @@ UI::show_box_top('<div id="playlist_row_' . $playlist->id . '">' . $title .
<ul>
<?php if (Access::check_function('batch_download')) { ?>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=search&amp;id=<?php echo $playlist->id; ?>"><?php echo get_user_icon('batch_download', T_('Batch Download')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=search&amp;id=<?php echo $playlist->id; ?>"><?php echo UI::get_icon('batch_download', T_('Batch Download')); ?></a>
<?php echo T_('Batch Download'); ?>
</li>
<?php } ?>
@@ -47,7 +47,7 @@ UI::show_box_top('<div id="playlist_row_' . $playlist->id . '">' . $title .
</li>
<li>
<a href="<?php echo Config::get('web_path'); ?>/smartplaylist.php?action=delete_playlist&playlist_id=<?php echo $playlist->id; ?>">
- <?php echo get_user_icon('delete'); ?>
+ <?php echo UI::get_icon('delete'); ?>
</a>
<?php echo T_('Delete'); ?>
</li>
diff --git a/templates/show_smartplaylist_row.inc.php b/templates/show_smartplaylist_row.inc.php
index bfefd2f2..77da914c 100644
--- a/templates/show_smartplaylist_row.inc.php
+++ b/templates/show_smartplaylist_row.inc.php
@@ -29,7 +29,7 @@
<td class="cel_action">
<?php if (Access::check_function('batch_download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/batch.php?action=smartplaylist&amp;id=<?php echo $playlist->id; ?>">
- <?php echo get_user_icon('batch_download', T_('Batch Download')); ?>
+ <?php echo UI::get_icon('batch_download', T_('Batch Download')); ?>
</a>
<?php } ?>
<?php if ($playlist->has_access()) { ?>
diff --git a/templates/show_song.inc.php b/templates/show_song.inc.php
index 527862c5..e3b2a279 100644
--- a/templates/show_song.inc.php
+++ b/templates/show_song.inc.php
@@ -33,8 +33,8 @@ $button_flip_state_id = 'button_flip_state_' . $song->id;
<dd class="<?php echo UI::flip_class(); ?>">
<?php echo Ajax::button('?action=basket&type=song&id=' . $song->id,'add', T_('Add'),'add_song_' . $song->id); ?>
<?php if (Access::check_function('download')) { ?>
- <a href="<?php echo Song::play_url($song->id); ?>"><?php echo get_user_icon('link', T_('Link')); ?></a>
- <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>"><?php echo get_user_icon('download', T_('Download')); ?></a>
+ <a href="<?php echo Song::play_url($song->id); ?>"><?php echo UI::get_icon('link', T_('Link')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>"><?php echo UI::get_icon('download', T_('Download')); ?></a>
<?php } ?>
<?php if (Access::check('interface','75')) { ?>
<span id="<?php echo($button_flip_state_id); ?>">
diff --git a/templates/show_song_row.inc.php b/templates/show_song_row.inc.php
index c87f56c7..9eea7f6c 100644
--- a/templates/show_song_row.inc.php
+++ b/templates/show_song_row.inc.php
@@ -33,15 +33,15 @@
<td class="cel_rating" id="rating_<?php echo $song->id; ?>_song"><?php Rating::show($song->id,'song'); ?></td>
<?php } ?>
<td class="cel_action">
- <a href="<?php echo $song->link; ?>"><?php echo get_user_icon('preferences', T_('Song Information')); ?></a>
+ <a href="<?php echo $song->link; ?>"><?php echo UI::get_icon('preferences', T_('Song Information')); ?></a>
<?php if (Config::get('shoutbox')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/shout.php?action=show_add_shout&amp;type=song&amp;id=<?php echo $song->id; ?>">
- <?php echo get_user_icon('comment', T_('Post Shout')); ?>
+ <?php echo UI::get_icon('comment', T_('Post Shout')); ?>
</a>
<?php } ?>
<?php if (Access::check_function('download')) { ?>
<a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&amp;song_id=<?php echo $song->id; ?>">
- <?php echo get_user_icon('download', T_('Download')); ?>
+ <?php echo UI::get_icon('download', T_('Download')); ?>
</a>
<?php } ?>
<?php if (Access::check('interface','75')) { ?>
diff --git a/templates/show_user_row.inc.php b/templates/show_user_row.inc.php
index 664717be..b24cf776 100644
--- a/templates/show_user_row.inc.php
+++ b/templates/show_user_row.inc.php
@@ -36,18 +36,18 @@
</td>
<?php } ?>
<td class="cel_action">
- <a href="<?php echo $web_path; ?>/admin/users.php?action=show_edit&amp;user_id=<?php echo $client->id; ?>"><?php echo get_user_icon('edit', T_('Edit')); ?></a>
- <a href="<?php echo $web_path; ?>/admin/users.php?action=show_preferences&amp;user_id=<?php echo $client->id; ?>"><?php echo get_user_icon('preferences', T_('Preferences')); ?></a>
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=show_edit&amp;user_id=<?php echo $client->id; ?>"><?php echo UI::get_icon('edit', T_('Edit')); ?></a>
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=show_preferences&amp;user_id=<?php echo $client->id; ?>"><?php echo UI::get_icon('preferences', T_('Preferences')); ?></a>
<?php
//FIXME: Fix this for the extra permission levels
if ($client->disabled == '1') {
- echo "<a href=\"".$web_path."/admin/users.php?action=enable&amp;user_id=$client->id\">" . get_user_icon('enable', T_('Enable')) . "</a>";
+ echo "<a href=\"".$web_path."/admin/users.php?action=enable&amp;user_id=$client->id\">" . UI::get_icon('enable', T_('Enable')) . "</a>";
}
else {
- echo "<a href=\"".$web_path."/admin/users.php?action=disable&amp;user_id=$client->id\">" . get_user_icon('disable', T_('Disable')) ."</a>";
+ echo "<a href=\"".$web_path."/admin/users.php?action=disable&amp;user_id=$client->id\">" . UI::get_icon('disable', T_('Disable')) ."</a>";
}
?>
- <a href="<?php echo $web_path; ?>/admin/users.php?action=delete&amp;user_id=<?php echo $client->id; ?>"><?php echo get_user_icon('delete', T_('Delete')); ?></a>
+ <a href="<?php echo $web_path; ?>/admin/users.php?action=delete&amp;user_id=<?php echo $client->id; ?>"><?php echo UI::get_icon('delete', T_('Delete')); ?></a>
</td>
<?php
if (($client->is_logged_in()) AND ($client->is_online())) {
diff --git a/templates/show_user_stats.inc.php b/templates/show_user_stats.inc.php
index 8909fcc2..5bfdadaf 100644
--- a/templates/show_user_stats.inc.php
+++ b/templates/show_user_stats.inc.php
@@ -28,7 +28,7 @@
if (count($favorite_artists)) {
$items = $working_user->format_favorites($favorite_artists);
$title = '<a href="' . Config::get('web_path') . '/stream.php?action=play_favorite&amp;type=artist">' .
- get_user_icon('all', T_('Favorite Artists')) . '</a>&nbsp;' . T_('Favorite Artists');
+ UI::get_icon('all', T_('Favorite Artists')) . '</a>&nbsp;' . T_('Favorite Artists');
show_info_box($title,'artist',$items);
}
else {
@@ -41,7 +41,7 @@
if (count($favorite_albums)) {
$items = $working_user->format_favorites($favorite_albums);
$title = '<a href="' . Config::get('web_path') . '/stream.php?action=play_favorite&amp;type=album">' .
- get_user_icon('all', T_('Favorite Albums')) . '</a>&nbsp;' . T_('Favorite Albums');
+ UI::get_icon('all', T_('Favorite Albums')) . '</a>&nbsp;' . T_('Favorite Albums');
show_info_box($title,'album',$items);
}
else {
@@ -54,7 +54,7 @@
if (count($favorite_songs)) {
$items = $working_user->format_favorites($favorite_songs);
$title = '<a href="' . Config::get('web_path') . '/stream.php?action=play_favorite&amp;type=song">' .
- get_user_icon('all', T_('Favorite Songs')) . '</a>&nbsp;' . T_('Favorite Songs');
+ UI::get_icon('all', T_('Favorite Songs')) . '</a>&nbsp;' . T_('Favorite Songs');
show_info_box($title,'your_song',$items);
}
else {
diff --git a/templates/show_video_row.inc.php b/templates/show_video_row.inc.php
index 344e12a4..0bb528b0 100644
--- a/templates/show_video_row.inc.php
+++ b/templates/show_video_row.inc.php
@@ -30,6 +30,6 @@
<td class="cel_tags"><?php $video->f_tags; ?></td>
<td class="cel_action">
<?php if (Access::check_function('download')) { ?>
- <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&type=video&oid=<?php echo $video->id; ?>"><?php echo get_user_icon('download', T_('Download')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/stream.php?action=download&type=video&oid=<?php echo $video->id; ?>"><?php echo UI::get_icon('download', T_('Download')); ?></a>
<?php } ?>
</td>
diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php
index 0df1240a..664ec3ed 100644
--- a/templates/sidebar.inc.php
+++ b/templates/sidebar.inc.php
@@ -58,7 +58,7 @@ $web_path = Config::get('web_path');
?>
<li id="sb_tab_logout" class="sb1">
<a href="<?php echo Config::get('web_path'); ?>/logout.php" id="sidebar_logout" >
- <?php echo get_user_icon('logout', T_('Logout')); ?>
+ <?php echo UI::get_icon('logout', T_('Logout')); ?>
</a>
</li>
</ul>