summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/ui.class.php17
-rw-r--r--lib/init-tiny.php2
-rw-r--r--lib/ui.lib.php23
-rw-r--r--templates/rightbar.inc.php4
-rw-r--r--templates/show_access_list.inc.php2
-rw-r--r--templates/show_admin_tools.inc.php4
-rw-r--r--templates/show_albums.inc.php4
-rw-r--r--templates/show_artists.inc.php4
-rw-r--r--templates/show_catalogs.inc.php4
-rw-r--r--templates/show_debug.inc.php20
-rw-r--r--templates/show_democratic_playlist.inc.php2
-rw-r--r--templates/show_disabled_songs.inc.php4
-rw-r--r--templates/show_duplicates.inc.php2
-rw-r--r--templates/show_edit_album.inc.php6
-rw-r--r--templates/show_edit_artist.inc.php4
-rw-r--r--templates/show_edit_song.inc.php16
-rw-r--r--templates/show_flag_row.inc.php2
-rw-r--r--templates/show_flagged.inc.php2
-rw-r--r--templates/show_ip_history.inc.php2
-rw-r--r--templates/show_live_streams.inc.php2
-rw-r--r--templates/show_localplay_controllers.inc.php4
-rw-r--r--templates/show_localplay_instances.inc.php2
-rw-r--r--templates/show_localplay_playlist.inc.php4
-rw-r--r--templates/show_manage_democratic.inc.php2
-rw-r--r--templates/show_manage_shoutbox.inc.php2
-rw-r--r--templates/show_objects.inc.php2
-rw-r--r--templates/show_playlist_songs.inc.php2
-rw-r--r--templates/show_playlists.inc.php4
-rw-r--r--templates/show_plugins.inc.php4
-rw-r--r--templates/show_preference_admin.inc.php2
-rw-r--r--templates/show_preference_box.inc.php2
-rw-r--r--templates/show_recently_played.inc.php2
-rw-r--r--templates/show_recommended_artists.inc.php4
-rw-r--r--templates/show_shout_row.inc.php2
-rw-r--r--templates/show_shoutbox.inc.php2
-rw-r--r--templates/show_smartplaylists.inc.php4
-rw-r--r--templates/show_song.inc.php6
-rw-r--r--templates/show_songs.inc.php4
-rw-r--r--templates/show_user_preferences.inc.php2
-rw-r--r--templates/show_users.inc.php2
-rw-r--r--templates/show_videos.inc.php4
41 files changed, 91 insertions, 97 deletions
diff --git a/lib/class/ui.class.php b/lib/class/ui.class.php
index 6c2041f5..b1a54f33 100644
--- a/lib/class/ui.class.php
+++ b/lib/class/ui.class.php
@@ -25,6 +25,7 @@
class UI {
+ private static $_classes;
private static $_ticker;
public function __construct($data) {
@@ -45,4 +46,20 @@ class UI {
return false;
}
+
+ /**
+ * flip_class
+ *
+ * First initialised with an array of two class names. Subsequent calls
+ * reverse the array then return the first element.
+ */
+ public static function flip_class($classes = null) {
+ if (is_array($classes)) {
+ self::$_classes = $array;
+ }
+ else {
+ self::$_classes = array_reverse(self::$_classes);
+ }
+ return self::$_classes[0];
+ }
}
diff --git a/lib/init-tiny.php b/lib/init-tiny.php
index 01746a98..a54281ed 100644
--- a/lib/init-tiny.php
+++ b/lib/init-tiny.php
@@ -81,7 +81,7 @@ require_once $prefix . '/lib/class/media.interface.php';
require_once $prefix . '/modules/horde/Browser.php';
/* Set up the flip class */
-flip_class(array('odd','even'));
+UI::flip_class(array('odd', 'even'));
// Merge GET then POST into REQUEST effectively stripping COOKIE without
// depending on a PHP setting change for the effect
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 0b56b221..45c87016 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -49,29 +49,6 @@ function show_confirmation($title,$text,$next_url,$cancel=0,$form_name='confirma
} // show_confirmation
/**
- * flip_class
- *
- * First called with an array of 2 class names. Subsequent calls reverse the
- * array then return the first element.
- *
- * @param array $array
- * @return mixed void or classname
- */
-function flip_class($array=0) {
-
- static $classes = array();
-
- if ($array) {
- $classes = $array;
- }
- else {
- $classes = array_reverse($classes);
- return $classes[0];
- }
-
-} // flip_class
-
-/**
* access_denied
* Throws an error if they try to do something that they aren't allowed to.
*/
diff --git a/templates/rightbar.inc.php b/templates/rightbar.inc.php
index 46ff84a7..6296a0cf 100644
--- a/templates/rightbar.inc.php
+++ b/templates/rightbar.inc.php
@@ -100,7 +100,7 @@
$object->f_link = Random::get_type_name($type);
}
?>
-<li class="<?php echo flip_class(); ?>" >
+<li class="<?php echo UI::flip_class(); ?>" >
<?php echo $object->f_link; ?>
<?php echo Ajax::button('?action=current_playlist&type=delete&id=' . $uid,'delete', T_('Delete'),'rightbar_delete_' . $uid,'','delitem'); ?>
</li>
@@ -108,7 +108,7 @@
<li class="error"><?php echo T_('Not Enough Data'); ?></li>
<?php } ?>
<?php if (isset($truncated)) { ?>
- <li class="<?php echo flip_class(); ?>">
+ <li class="<?php echo UI::flip_class(); ?>">
<?php echo $truncated . ' ' . T_('More'); ?>...
</li>
<?php } ?>
diff --git a/templates/show_access_list.inc.php b/templates/show_access_list.inc.php
index a671e5bc..7ccbb4a1 100644
--- a/templates/show_access_list.inc.php
+++ b/templates/show_access_list.inc.php
@@ -61,7 +61,7 @@
$access = new Access($access_id);
$access->format();
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo scrub_out($access->name); ?></td>
<td><?php echo $access->f_start; ?></td>
<td><?php echo $access->f_end; ?></td>
diff --git a/templates/show_admin_tools.inc.php b/templates/show_admin_tools.inc.php
index 03601be1..bfe92113 100644
--- a/templates/show_admin_tools.inc.php
+++ b/templates/show_admin_tools.inc.php
@@ -35,7 +35,7 @@ $catalogs = Catalog::get_catalogs();
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
<?php foreach ($catalogs as $catalog) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_name">
<a href="<?php echo $web_path; ?>/admin/catalog.php?action=show_customize_catalog&amp;catalog_id=<?php echo $catalog->id; ?>">
<?php echo scrub_out($catalog->name); ?></a>
@@ -55,7 +55,7 @@ $catalogs = Catalog::get_catalogs();
</td>
</tr>
<!--
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="2">
<?php echo T_('Fast'); ?><input type="checkbox" name="fast" value="1" />
<?php echo T_('Gather Art'); ?><input type="checkbox" name="gather_art" value="1" />
diff --git a/templates/show_albums.inc.php b/templates/show_albums.inc.php
index 7cb5708c..a9727634 100644
--- a/templates/show_albums.inc.php
+++ b/templates/show_albums.inc.php
@@ -59,12 +59,12 @@ $web_path = Config::get('web_path');
$album = new Album($album_id);
$album->format();
?>
-<tr id="album_<?php echo $album->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="album_<?php echo $album->id; ?>" class="<?php echo UI::flip_class(); ?>">
<?php require Config::get('prefix') . '/templates/show_album_row.inc.php'; ?>
</tr>
<?php } //end foreach ($albums as $album) ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="7"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_artists.inc.php b/templates/show_artists.inc.php
index 99ddf78d..36d9b01e 100644
--- a/templates/show_artists.inc.php
+++ b/templates/show_artists.inc.php
@@ -55,12 +55,12 @@ foreach ($object_ids as $artist_id) {
$artist = new Artist($artist_id, $_SESSION['catalog']);
$artist->format();
?>
-<tr id="artist_<?php echo $artist->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="artist_<?php echo $artist->id; ?>" class="<?php echo UI::flip_class(); ?>">
<?php require Config::get('prefix') . '/templates/show_artist_row.inc.php'; ?>
</tr>
<?php } //end foreach ($artists as $artist) ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="5"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_catalogs.inc.php b/templates/show_catalogs.inc.php
index e837c8ca..c9f8cedd 100644
--- a/templates/show_catalogs.inc.php
+++ b/templates/show_catalogs.inc.php
@@ -43,11 +43,11 @@
$catalog = new Catalog($catalog_id);
$catalog->format();
?>
-<tr class="<?php echo flip_class(); ?>" id="catalog_<?php echo $catalog->id; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="catalog_<?php echo $catalog->id; ?>">
<?php require Config::get('prefix') . '/templates/show_catalog_row.inc.php'; ?>
</tr>
<?php } ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="6">
<?php if (!count($object_ids)) { ?>
<span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span>
diff --git a/templates/show_debug.inc.php b/templates/show_debug.inc.php
index 67412833..d5fb8cd0 100644
--- a/templates/show_debug.inc.php
+++ b/templates/show_debug.inc.php
@@ -44,39 +44,39 @@
<th class="cel_php_setting"><?php echo T_('Setting'); ?></th>
<th class="cel_php_value"><?php echo T_('Value'); ?></th>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Memory Limit'); ?></td>
<td><?php echo ini_get('memory_limit'); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Maximum Execution Time'); ?></td>
<td><?php echo ini_get('max_execution_time'); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Override Execution Time'); ?></td>
<td><?php set_time_limit(0); echo ini_get('max_execution_time') ? T_('Failed') : T_('Succeeded'); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Safe Mode'); ?></td>
<td><?php echo print_bool(ini_get('safe_mode')); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td>Open Basedir</td>
<td><?php echo ini_get('open_basedir'); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Zlib Support'); ?></td>
<td><?php echo print_bool(function_exists('gzcompress')); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('GD Support'); ?></td>
<td><?php echo print_bool(function_exists('ImageCreateFromString')); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Iconv Support'); ?></td>
<td><?php echo print_bool(function_exists('iconv')); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Gettext Support'); ?></td>
<td><?php echo print_bool(function_exists('bindtextdomain')); ?></td>
</tr>
@@ -106,7 +106,7 @@
$value = print_bool($value);
}
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td valign="top"><strong><?php echo $key; ?></strong></td>
<td><?php echo $value; ?></td>
</tr>
diff --git a/templates/show_democratic_playlist.inc.php b/templates/show_democratic_playlist.inc.php
index ca0af81f..49dd889e 100644
--- a/templates/show_democratic_playlist.inc.php
+++ b/templates/show_democratic_playlist.inc.php
@@ -70,7 +70,7 @@ foreach($object_ids as $item) {
$media = new $item['object_type']($item['object_id']);
$media->format();
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_action">
<?php if ($democratic->has_vote($item['object_id'], $item['object_type'])) { ?>
<?php echo Ajax::button('?page=democratic&action=delete_vote&row_id=' . $item['id'],'delete', T_('Remove Vote'),'remove_vote_' . $item['id']); ?>
diff --git a/templates/show_disabled_songs.inc.php b/templates/show_disabled_songs.inc.php
index a69ec924..c651b19e 100644
--- a/templates/show_disabled_songs.inc.php
+++ b/templates/show_disabled_songs.inc.php
@@ -40,7 +40,7 @@
<th class="cel_additiontime"><?php echo T_('Addition Time'); ?></th>
</tr>
<?php foreach ($songs as $song) { ?>
- <tr class="<?php echo flip_class(); ?>">
+ <tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_select"><input type="checkbox" name="song[]" value="<?php echo $song->id; ?>" /></td>
<td class="cel_song"><?php echo $song->title; ?></td>
<td class="cel_album"><?php echo $song->get_album_name($song->album); ?></td>
@@ -50,7 +50,7 @@
</tr>
<?php } if (!count($songs)) { ?>
- <tr class="<?php echo flip_class(); ?>">
+ <tr class="<?php echo UI::flip_class(); ?>">
<td colspan="7"><span class="error"><?php echo T_('No Records Found'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_duplicates.inc.php b/templates/show_duplicates.inc.php
index 612a1ff6..bc46fced 100644
--- a/templates/show_duplicates.inc.php
+++ b/templates/show_duplicates.inc.php
@@ -53,7 +53,7 @@
$song->format();
$row_key = 'duplicate_' . $song_id;
$button_flip_state_id = 'button_flip_state_' . $song_id;
- $current_class = ($key == '0') ? 'row-highlight' : flip_class();
+ $current_class = ($key == '0') ? 'row-highlight' : UI::flip_class();
$button = $song->enabled ? 'disable' : 'enable';
?>
<tr id="<?php echo $row_key; ?>" class="<?php echo $current_class; ?>">
diff --git a/templates/show_edit_album.inc.php b/templates/show_edit_album.inc.php
index 10856a2c..47906b7d 100644
--- a/templates/show_edit_album.inc.php
+++ b/templates/show_edit_album.inc.php
@@ -24,19 +24,19 @@
<?php show_box_top(T_('Edit Album')); ?>
<form name="edit_album" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/admin/flag.php?action=edit_album">
<table class="tabledata">
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Name'); ?></td>
<td>
<input type="text" name="name" value="<?php echo scrub_out($album->full_name); ?>">
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Year'); ?></td>
<td>
<input type="text" name="year" value="<?php echo scrub_out($album->year); ?>">
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td>&nbsp;</td>
<td>
<input type="checkbox" name="flag" value="1" checked="checked" /> <?php echo T_('Flag for Retagging'); ?>
diff --git a/templates/show_edit_artist.inc.php b/templates/show_edit_artist.inc.php
index 73acf847..9c84c465 100644
--- a/templates/show_edit_artist.inc.php
+++ b/templates/show_edit_artist.inc.php
@@ -24,13 +24,13 @@
<?php show_box_top(T_('Edit Artist')); ?>
<form name="edit_artist" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/admin/flag.php?action=edit_artist">
<table class="tabledata">
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Name'); ?></td>
<td>
<input type="text" name="name" value="<?php echo scrub_out($artist->name); ?>">
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td>&nbsp;</td>
<td>
<input type="checkbox" name="flag" value="1" checked="checked" /> <?php echo T_('Flag for Retagging'); ?>
diff --git a/templates/show_edit_song.inc.php b/templates/show_edit_song.inc.php
index 94781219..11129915 100644
--- a/templates/show_edit_song.inc.php
+++ b/templates/show_edit_song.inc.php
@@ -24,17 +24,17 @@
<?php show_box_top(T_('Edit Song')); ?>
<form name="edit_song" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/admin/flag.php">
<table>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('File'); ?>:</td>
<td><?php echo scrub_out($song->file); ?></td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Title'); ?></td>
<td>
<input type="text" name="title" value="<?php echo scrub_out($song->title); ?>" size="45" />
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Album'); ?></td>
<td>
<?php show_album_select('album',$song->album); ?>
@@ -42,7 +42,7 @@
<input type="text" name="album_string" value="<?php echo scrub_out($song->get_album_name()); ?>" />
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Artist'); ?></td>
<td>
<?php show_artist_select('artist',$song->artist); ?>
@@ -50,25 +50,25 @@
<input type="text" name="artist_string" value="<?php echo scrub_out($song->get_artist_name()); ?>" />
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Track'); ?></td>
<td>
<input type="text" name="track" value="<?php echo scrub_out($song->track); ?>" size="3" />
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Year'); ?></td>
<td>
<input type="text" name="year" value="<?php echo scrub_out($song->year); ?>" size="5" />
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo T_('Comment'); ?></td>
<td>
<input type="text" name="comment" value="<?php echo scrub_out($song->comment); ?>" size="45" />
</td>
</tr>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td>&nbsp;</td>
<td>
<input type="checkbox" name="flag" value="1" checked="checked" /> <?php echo T_('Flag for Retagging'); ?>
diff --git a/templates/show_flag_row.inc.php b/templates/show_flag_row.inc.php
index c4e4e63f..cbeef4f8 100644
--- a/templates/show_flag_row.inc.php
+++ b/templates/show_flag_row.inc.php
@@ -20,7 +20,7 @@
*
*/
?>
-<tr id="flagged_<?php echo $flag->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="flagged_<?php echo $flag->id; ?>" class="<?php echo UI::flip_class(); ?>">
<td class="cel_object"><?php echo $flag->f_name; ?></td>
<td class="cel_username"><?php echo $flag->f_user; ?></td>
<td class="cel_flag"><?php $flag->print_flag(); ?></td>
diff --git a/templates/show_flagged.inc.php b/templates/show_flagged.inc.php
index 9ddca29d..ed51f277 100644
--- a/templates/show_flagged.inc.php
+++ b/templates/show_flagged.inc.php
@@ -46,7 +46,7 @@ foreach ($object_ids as $flag_id) {
require Config::get('prefix') . '/templates/show_flag_row.inc.php';
?>
<?php } if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="7" class="error"><?php echo T_('No Records Found'); ?></td>
</tr>
<?php } ?>
diff --git a/templates/show_ip_history.inc.php b/templates/show_ip_history.inc.php
index 6a4506e2..651f56d6 100644
--- a/templates/show_ip_history.inc.php
+++ b/templates/show_ip_history.inc.php
@@ -46,7 +46,7 @@
<th class="cel_ipaddress"><?php echo T_('IP Address'); ?></th>
</tr>
<?php foreach ($history as $data) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_date">
<?php echo date("d/m/Y H\hi",$data['date']); ?>
</td>
diff --git a/templates/show_live_streams.inc.php b/templates/show_live_streams.inc.php
index 71b7230a..e03b4d13 100644
--- a/templates/show_live_streams.inc.php
+++ b/templates/show_live_streams.inc.php
@@ -46,7 +46,7 @@ foreach ($object_ids as $radio_id) {
$radio = new Radio($radio_id);
$radio->format();
?>
-<tr id="live_stream_<?php echo $radio->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="live_stream_<?php echo $radio->id; ?>" class="<?php echo UI::flip_class(); ?>">
<?php require Config::get('prefix') . '/templates/show_live_stream_row.inc.php'; ?>
</tr>
<?php } //end foreach ($artists as $artist) ?>
diff --git a/templates/show_localplay_controllers.inc.php b/templates/show_localplay_controllers.inc.php
index d7da20a6..809b42e7 100644
--- a/templates/show_localplay_controllers.inc.php
+++ b/templates/show_localplay_controllers.inc.php
@@ -50,14 +50,14 @@ foreach ($controllers as $controller) {
$action_txt = T_('Activate');
}
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_name"><?php echo scrub_out($localplay->f_name); ?></td>
<td class="cel_description"><?php echo scrub_out($localplay->f_description); ?></td>
<td class="cel_version"><?php echo scrub_out($localplay->f_version); ?></td>
<td class="cel_action"><a href="<?php echo $web_path; ?>/admin/modules.php?action=<?php echo $action; ?>&amp;type=<?php echo urlencode($controller); ?>"><?php echo $action_txt; ?></a></td>
</tr>
<?php } if (!count($controllers)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="4"><span class="error"><?php echo T_('No Records Found'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_localplay_instances.inc.php b/templates/show_localplay_instances.inc.php
index 70e89be6..59db9d5c 100644
--- a/templates/show_localplay_instances.inc.php
+++ b/templates/show_localplay_instances.inc.php
@@ -31,7 +31,7 @@
<?php foreach ($instances as $uid=>$name) {
$instance = $localplay->get_instance($uid);
?>
-<tr class="<?php echo flip_class(); ?>" id="localplay_instance_<?php echo $uid; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="localplay_instance_<?php echo $uid; ?>">
<?php foreach ($fields as $key=>$field) { ?>
<td><?php echo $instance[$key]; ?></td>
<?php } ?>
diff --git a/templates/show_localplay_playlist.inc.php b/templates/show_localplay_playlist.inc.php
index b7ef5292..0f5b2633 100644
--- a/templates/show_localplay_playlist.inc.php
+++ b/templates/show_localplay_playlist.inc.php
@@ -41,7 +41,7 @@ foreach ($object_ids as $object) {
$class = ' class="cel_name"';
if ($status['track'] == $object['track']) { $class=' class="cel_name lp_current"'; }
?>
-<tr class="<?php echo flip_class(); ?>" id="localplay_playlist_<?php echo $object['id']; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="localplay_playlist_<?php echo $object['id']; ?>">
<td class="cel_track">
<?php echo scrub_out($object['track']); ?>
</td>
@@ -53,7 +53,7 @@ foreach ($object_ids as $object) {
</td>
</tr>
<?php } if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="3"><span class="error"><?php echo T_('No Records Found'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_manage_democratic.inc.php b/templates/show_manage_democratic.inc.php
index 7c70aeab..57cd75f2 100644
--- a/templates/show_manage_democratic.inc.php
+++ b/templates/show_manage_democratic.inc.php
@@ -47,7 +47,7 @@ show_box_top(T_('Manage Democratic Playlists')); ?>
$playlist = new Playlist($democratic->base_playlist);
$playlist->format();
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td><?php echo scrub_out($democratic->name); ?></td>
<td><?php echo $playlist->f_link; ?></td>
<td><?php echo $democratic->f_cooldown; ?></td>
diff --git a/templates/show_manage_shoutbox.inc.php b/templates/show_manage_shoutbox.inc.php
index d0c96bce..3e19bd4d 100644
--- a/templates/show_manage_shoutbox.inc.php
+++ b/templates/show_manage_shoutbox.inc.php
@@ -51,7 +51,7 @@ foreach ($object_ids as $shout_id) {
require Config::get('prefix') . '/templates/show_shout_row.inc.php';
?>
<?php } if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="7" class="error"><?php echo T_('No Records Found'); ?></td>
</tr>
<?php } ?>
diff --git a/templates/show_objects.inc.php b/templates/show_objects.inc.php
index 711969e1..f3d2c04c 100644
--- a/templates/show_objects.inc.php
+++ b/templates/show_objects.inc.php
@@ -35,7 +35,7 @@
foreach ($objects as $object) {
$object->format();
?>
-<tr id="object_row_<?php echo $object->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="object_row_<?php echo $object->id; ?>" class="<?php echo UI::flip_class(); ?>">
<?php require Config::get('prefix') . '/templates/show_object_row.inc.php'; ?>
</tr>
<?php } ?>
diff --git a/templates/show_playlist_songs.inc.php b/templates/show_playlist_songs.inc.php
index f6bec07e..01257804 100644
--- a/templates/show_playlist_songs.inc.php
+++ b/templates/show_playlist_songs.inc.php
@@ -58,7 +58,7 @@ $web_path = Config::get('web_path');
$song->format();
$playlist_track = $object['track'];
?>
-<tr class="<?php echo flip_class(); ?>" id="track_<?php echo $object['track_id']; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="track_<?php echo $object['track_id']; ?>">
<?php require Config::get('prefix') . '/templates/show_playlist_song_row.inc.php'; ?>
</tr>
<?php } ?>
diff --git a/templates/show_playlists.inc.php b/templates/show_playlists.inc.php
index d8c41024..98cd9e16 100644
--- a/templates/show_playlists.inc.php
+++ b/templates/show_playlists.inc.php
@@ -44,12 +44,12 @@ foreach ($object_ids as $playlist_id) {
$playlist->format();
$count = $playlist->get_song_count();
?>
-<tr class="<?php echo flip_class(); ?>" id="playlist_row_<?php echo $playlist->id; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="playlist_row_<?php echo $playlist->id; ?>">
<?php require Config::get('prefix') . '/templates/show_playlist_row.inc.php'; ?>
</tr>
<?php } // end foreach ($playlists as $playlist) ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="6"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_plugins.inc.php b/templates/show_plugins.inc.php
index d5770695..96d3f3ad 100644
--- a/templates/show_plugins.inc.php
+++ b/templates/show_plugins.inc.php
@@ -55,7 +55,7 @@ foreach ($plugins as $plugin_name) {
}
}
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_name"><?php echo scrub_out($plugin->_plugin->name); ?></td>
<td class="cel_description"><?php echo scrub_out($plugin->_plugin->description); ?></td>
<td class="cel_version"><?php echo scrub_out($plugin->_plugin->version); ?></td>
@@ -63,7 +63,7 @@ foreach ($plugins as $plugin_name) {
<td class="cel_action"><?php echo $action; ?></td>
</tr>
<?php } if (!count($plugins)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="4"><span class="error"><?php echo T_('No Records Found'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_preference_admin.inc.php b/templates/show_preference_admin.inc.php
index e4388a12..3d984e6c 100644
--- a/templates/show_preference_admin.inc.php
+++ b/templates/show_preference_admin.inc.php
@@ -35,7 +35,7 @@ show_box_top(T_('Preference Administration'));
<?php foreach ($preferences as $preference) {
unset($is_25,$is_5,$is_100);
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_preference"><?php echo scrub_out(T_($preference['description'])); ?></td>
<td class="cel_level">
<?php $level_name = "is_" . $preference['level']; ${$level_name} = 'selected="selected"'; ?>
diff --git a/templates/show_preference_box.inc.php b/templates/show_preference_box.inc.php
index 23055df8..bc604910 100644
--- a/templates/show_preference_box.inc.php
+++ b/templates/show_preference_box.inc.php
@@ -46,7 +46,7 @@ if ((Access::check('interface','100') OR !Config::get('use_auth')) AND $_REQUEST
<?php } ?>
</tr>
<?php foreach ($preferences['prefs'] as $pref) { ?>
- <tr class="<?php echo flip_class(); ?>">
+ <tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_preference"><?php echo T_($pref['description']); ?></td>
<td class="cel_value">
<?php create_preference_input($pref['name'], $pref['value']); ?>
diff --git a/templates/show_recently_played.inc.php b/templates/show_recently_played.inc.php
index 01a3754e..2aecf9e7 100644
--- a/templates/show_recently_played.inc.php
+++ b/templates/show_recently_played.inc.php
@@ -82,7 +82,7 @@ show_box_top(T_('Recently Played') . $link, 'box box_recently_played');
$song->format();
?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_add">
<?php echo Ajax::button('?action=basket&type=song&id=' . $song->id,'add', T_('Add'),'add_' . $song->id); ?>
</td>
diff --git a/templates/show_recommended_artists.inc.php b/templates/show_recommended_artists.inc.php
index a0ded0b8..f4b6fa50 100644
--- a/templates/show_recommended_artists.inc.php
+++ b/templates/show_recommended_artists.inc.php
@@ -50,12 +50,12 @@ foreach ($object_ids as $artist_id) {
$artist = new Artist($artist_id);
$artist->format();
?>
-<tr id="artist_<?php echo $artist->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="artist_<?php echo $artist->id; ?>" class="<?php echo UI::flip_class(); ?>">
<?php require Config::get('prefix') . '/templates/show_artist_row.inc.php'; ?>
</tr>
<?php } //end foreach ($artists as $artist) ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="5"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_shout_row.inc.php b/templates/show_shout_row.inc.php
index 1ec26ee8..effa3636 100644
--- a/templates/show_shout_row.inc.php
+++ b/templates/show_shout_row.inc.php
@@ -20,7 +20,7 @@
*
*/
?>
-<tr id="flagged_<?php echo $shout->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="flagged_<?php echo $shout->id; ?>" class="<?php echo UI::flip_class(); ?>">
<td class="cel_object"><?php echo $object->f_link; ?></td>
<td class="cel_username"><?php echo $client->f_link; ?></td>
<td class="cel_sticky"><?php echo $shout->sticky; ?></td>
diff --git a/templates/show_shoutbox.inc.php b/templates/show_shoutbox.inc.php
index d46f07c1..38925390 100644
--- a/templates/show_shoutbox.inc.php
+++ b/templates/show_shoutbox.inc.php
@@ -30,7 +30,7 @@
$client = new User($shout->user);
$client->format();
?>
-<div class="shout <?php echo flip_class(); ?>">
+<div class="shout <?php echo UI::flip_class(); ?>">
<?php echo $shout->get_image(); ?>
<?php echo Ajax::button('?action=basket&type=' . $shout->object_type .'&id=' . $shout->object_id,'add', T_('Add'),'add_' . $shout->object_type . '_' . $shout->object_id); ?>
<?php echo $object->f_link; ?>
diff --git a/templates/show_smartplaylists.inc.php b/templates/show_smartplaylists.inc.php
index 0dfd9d2b..80493aac 100644
--- a/templates/show_smartplaylists.inc.php
+++ b/templates/show_smartplaylists.inc.php
@@ -42,12 +42,12 @@ foreach ($object_ids as $playlist_id) {
$playlist = new Search('song', $playlist_id);
$playlist->format();
?>
-<tr class="<?php echo flip_class(); ?>" id="playlist_row_<?php echo $playlist->id; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="playlist_row_<?php echo $playlist->id; ?>">
<?php require Config::get('prefix') . '/templates/show_smartplaylist_row.inc.php'; ?>
</tr>
<?php } // end foreach ($playlists as $playlist) ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="6"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_song.inc.php b/templates/show_song.inc.php
index 07a0dd06..7fd41c75 100644
--- a/templates/show_song.inc.php
+++ b/templates/show_song.inc.php
@@ -26,11 +26,11 @@ $button_flip_state_id = 'button_flip_state_' . $song->id;
<?php show_box_top($song->title . ' ' . T_('Details'), 'box box_song_details'); ?>
<dl class="song_details">
<?php if (Config::get('ratings')) { ?>
-<dt class="<?php echo flip_class(); ?>"><?php echo T_('Rating'); ?></dt>
+<dt class="<?php echo UI::flip_class(); ?>"><?php echo T_('Rating'); ?></dt>
<dd><div id="rating_<?php echo $song->id; ?>_song"><?php Rating::show($song->id,'song'); ?></div></dd>
<?php } ?>
<dt class="<?php echo $rowparity; ?>"><?php echo T_('Action'); ?></dt>
- <dd class="<?php echo flip_class(); ?>">
+ <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>
@@ -65,7 +65,7 @@ $button_flip_state_id = 'button_flip_state_' . $song->id;
{
if(trim($value))
{
- $rowparity = flip_class();
+ $rowparity = UI::flip_class();
echo "<dt class=\"".$rowparity."\">" . T_($key) . "</dt><dd class=\"".$rowparity."\">" . $value . "</dd>";
}
}
diff --git a/templates/show_songs.inc.php b/templates/show_songs.inc.php
index b031ebf3..09b009e4 100644
--- a/templates/show_songs.inc.php
+++ b/templates/show_songs.inc.php
@@ -54,12 +54,12 @@ $web_path = Config::get('web_path');
$song = new Song($song_id);
$song->format();
?>
-<tr class="<?php echo flip_class(); ?>" id="song_<?php echo $song->id; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" id="song_<?php echo $song->id; ?>">
<?php require Config::get('prefix') . '/templates/show_song_row.inc.php'; ?>
</tr>
<?php } ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="9"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>
diff --git a/templates/show_user_preferences.inc.php b/templates/show_user_preferences.inc.php
index 19772fd7..b87b3f01 100644
--- a/templates/show_user_preferences.inc.php
+++ b/templates/show_user_preferences.inc.php
@@ -38,7 +38,7 @@
<th class="col_value"><?php echo T_('Value'); ?></th>
</tr>
<?php foreach ($preferences as $pref) { ?>
- <tr class="<?php echo flip_class(); ?>">
+ <tr class="<?php echo UI::flip_class(); ?>">
<td class="cel_preference"><?php echo T_($pref['description']); ?></td>
<td class="cel_value">
<?php create_preference_input($pref['name'], $pref['value']); ?>
diff --git a/templates/show_users.inc.php b/templates/show_users.inc.php
index b56133e8..ba3d7b84 100644
--- a/templates/show_users.inc.php
+++ b/templates/show_users.inc.php
@@ -54,7 +54,7 @@ foreach ($object_ids as $user_id) {
$last_seen = $client->last_seen ? date("m\/d\/Y - H:i",$client->last_seen) : T_('Never');
$create_date = $client->create_date ? date("m\/d\/Y - H:i",$client->create_date) : T_('Unknown');
?>
-<tr class="<?php echo flip_class(); ?>" align="center" id="admin_user_<?php echo $client->id; ?>">
+<tr class="<?php echo UI::flip_class(); ?>" align="center" id="admin_user_<?php echo $client->id; ?>">
<?php require Config::get('prefix') . '/templates/show_user_row.inc.php'; ?>
</tr>
<?php } //end foreach users ?>
diff --git a/templates/show_videos.inc.php b/templates/show_videos.inc.php
index cb52357d..256fe682 100644
--- a/templates/show_videos.inc.php
+++ b/templates/show_videos.inc.php
@@ -48,12 +48,12 @@ foreach ($object_ids as $video_id) {
$video = new Video($video_id);
$video->format();
?>
-<tr id="video_<?php echo $video->id; ?>" class="<?php echo flip_class(); ?>">
+<tr id="video_<?php echo $video->id; ?>" class="<?php echo UI::flip_class(); ?>">
<?php require Config::get('prefix') . '/templates/show_video_row.inc.php'; ?>
</tr>
<?php } //end foreach ?>
<?php if (!count($object_ids)) { ?>
-<tr class="<?php echo flip_class(); ?>">
+<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="7"><span class="fatalerror"><?php echo T_('Not Enough Data'); ?></span></td>
</tr>
<?php } ?>