summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Arthur <paul.arthur@flowerysong.com>2013-01-26 01:28:34 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2013-01-26 01:28:34 -0500
commitd572c2776f5ab7f66a632f54006dabe2f159c02b (patch)
tree2da705d0c0feabdea69fd7b8df0c5453c2e7571a /lib
parent04aa79b53c38095d4727f4d850e191c64d99352f (diff)
downloadampache-d572c2776f5ab7f66a632f54006dabe2f159c02b.tar.gz
ampache-d572c2776f5ab7f66a632f54006dabe2f159c02b.tar.bz2
ampache-d572c2776f5ab7f66a632f54006dabe2f159c02b.zip
Move show_box_{top,bottom}() from ui.lib.php to UI
Diffstat (limited to 'lib')
-rw-r--r--lib/class/browse.class.php60
-rw-r--r--lib/class/catalog.class.php20
-rw-r--r--lib/class/ui.class.php18
-rw-r--r--lib/ui.lib.php22
4 files changed, 58 insertions, 62 deletions
diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php
index 074efacd..ce22728e 100644
--- a/lib/class/browse.class.php
+++ b/lib/class/browse.class.php
@@ -127,86 +127,86 @@ class Browse extends Query {
// Switch on the type of browsing we're doing
switch ($type) {
case 'song':
- show_box_top(T_('Songs') . $match, $class);
+ UI::show_box_top(T_('Songs') . $match, $class);
Song::build_cache($object_ids);
require_once Config::get('prefix') . '/templates/show_songs.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'album':
- show_box_top(T_('Albums') . $match, $class);
+ UI::show_box_top(T_('Albums') . $match, $class);
Album::build_cache($object_ids,'extra');
require_once Config::get('prefix') . '/templates/show_albums.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'user':
- show_box_top(T_('Manage Users') . $match, $class);
+ UI::show_box_top(T_('Manage Users') . $match, $class);
require_once Config::get('prefix') . '/templates/show_users.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'artist':
- show_box_top(T_('Artists') . $match, $class);
+ UI::show_box_top(T_('Artists') . $match, $class);
Artist::build_cache($object_ids,'extra');
require_once Config::get('prefix') . '/templates/show_artists.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'live_stream':
require_once Config::get('prefix') . '/templates/show_live_stream.inc.php';
- show_box_top(T_('Radio Stations') . $match, $class);
+ UI::show_box_top(T_('Radio Stations') . $match, $class);
require_once Config::get('prefix') . '/templates/show_live_streams.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'playlist':
Playlist::build_cache($object_ids);
- show_box_top(T_('Playlists') . $match, $class);
+ UI::show_box_top(T_('Playlists') . $match, $class);
require_once Config::get('prefix') . '/templates/show_playlists.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'playlist_song':
- show_box_top(T_('Playlist Songs') . $match,$class);
+ UI::show_box_top(T_('Playlist Songs') . $match,$class);
require_once Config::get('prefix') . '/templates/show_playlist_songs.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'playlist_localplay':
- show_box_top(T_('Current Playlist'));
+ UI::show_box_top(T_('Current Playlist'));
require_once Config::get('prefix') . '/templates/show_localplay_playlist.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'smartplaylist':
- show_box_top(T_('Smart Playlists') . $match, $class);
+ UI::show_box_top(T_('Smart Playlists') . $match, $class);
require_once Config::get('prefix') . '/templates/show_smartplaylists.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'catalog':
- show_box_top(T_('Catalogs'), $class);
+ UI::show_box_top(T_('Catalogs'), $class);
require_once Config::get('prefix') . '/templates/show_catalogs.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'shoutbox':
- show_box_top(T_('Shoutbox Records'),$class);
+ UI::show_box_top(T_('Shoutbox Records'),$class);
require_once Config::get('prefix') . '/templates/show_manage_shoutbox.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'flagged':
- show_box_top(T_('Flagged Records'),$class);
+ UI::show_box_top(T_('Flagged Records'),$class);
require_once Config::get('prefix') . '/templates/show_flagged.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'tag':
Tag::build_cache($tags);
- show_box_top(T_('Tag Cloud'),$class);
+ UI::show_box_top(T_('Tag Cloud'),$class);
require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'video':
Video::build_cache($object_ids);
- show_box_top(T_('Videos'),$class);
+ UI::show_box_top(T_('Videos'),$class);
require_once Config::get('prefix') . '/templates/show_videos.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
break;
case 'democratic':
- show_box_top(T_('Democratic Playlist'),$class);
+ UI::show_box_top(T_('Democratic Playlist'),$class);
require_once Config::get('prefix') . '/templates/show_democratic_playlist.inc.php';
- show_box_bottom();
+ UI::show_box_bottom();
default:
// Rien a faire
break;
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 029c2d67..f0c773b2 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -277,9 +277,9 @@ class Catalog extends database_object {
public function run_add($options) {
if ($this->catalog_type == 'remote') {
- show_box_top(T_('Running Remote Sync') . '. . .');
+ UI::show_box_top(T_('Running Remote Sync') . '. . .');
$this->get_remote_catalog($type=0);
- show_box_bottom();
+ UI::show_box_bottom();
return true;
}
@@ -1079,9 +1079,9 @@ class Catalog extends database_object {
public function add_to_catalog() {
if ($this->catalog_type == 'remote') {
- show_box_top(T_('Running Remote Update') . '. . .');
+ UI::show_box_top(T_('Running Remote Update') . '. . .');
$this->get_remote_catalog($type=0);
- show_box_bottom();
+ UI::show_box_bottom();
return true;
}
@@ -1127,12 +1127,12 @@ class Catalog extends database_object {
$time_diff = ($current_time - $start_time) ?: 0;
$rate = intval($this->count / $time_diff) ?: T_('N/A');
- show_box_top();
+ UI::show_box_top();
echo "\n<br />" .
printf(T_('Catalog Update Finished. Total Time: [%s] Total Songs: [%s] Songs Per Second: [%s]'),
date('i:s', $time_diff), $this->count, $rate);
echo '<br /><br />';
- show_box_bottom();
+ UI::show_box_bottom();
} // add_to_catalog
@@ -1277,11 +1277,11 @@ class Catalog extends database_object {
// Remove any orphaned artists/albums/etc.
self::gc();
- show_box_top();
+ UI::show_box_top();
echo "<strong>";
printf (T_ngettext('Catalog Clean Done. %d file removed.', 'Catalog Clean Done. %d files removed.', $dead_total), $dead_total);
echo "</strong><br />\n";
- show_box_bottom();
+ UI::show_box_bottom();
ob_flush();
flush();
@@ -1381,11 +1381,11 @@ class Catalog extends database_object {
self::gc();
$this->update_last_update();
- show_box_top();
+ UI::show_box_top();
echo '<strong>';
printf(T_('Catalog Verify Done. %d of %d files updated.'), $total_updated, $number);
echo "</strong><br />\n";
- show_box_bottom();
+ UI::show_box_bottom();
ob_flush();
flush();
diff --git a/lib/class/ui.class.php b/lib/class/ui.class.php
index c4fd3d47..021ad67d 100644
--- a/lib/class/ui.class.php
+++ b/lib/class/ui.class.php
@@ -110,6 +110,24 @@ class UI {
}
/**
+ * show_box_top
+ *
+ * This shows the top of the box.
+ */
+ public static function show_box_top($title = '', $class = '') {
+ require Config::get('prefix') . '/templates/show_box_top.inc.php';
+ }
+
+ /**
+ * show_box_bottom
+ *
+ * This shows the bottom of the box
+ */
+ public static function show_box_bottom() {
+ require Config::get('prefix') . '/templates/show_box_bottom.inc.php';
+ }
+
+ /**
* truncate
*
* Limit text to a certain length; adds an ellipsis if truncation was
diff --git a/lib/ui.lib.php b/lib/ui.lib.php
index 00f7eb27..577e9ce1 100644
--- a/lib/ui.lib.php
+++ b/lib/ui.lib.php
@@ -343,28 +343,6 @@ function show_playlist_select($name,$selected='',$style='') {
} // show_playlist_select
/**
- * show_box_top
- * This function requires the top part of the box
- * it takes title as an optional argument
- */
-function show_box_top($title='',$class='') {
-
- require Config::get('prefix') . '/templates/show_box_top.inc.php';
-
-} // show_box_top
-
-/**
- * show_box_bottom
- * This function requires the bottom part of the box
- * it does not take any arguments
- */
-function show_box_bottom() {
-
- require Config::get('prefix') . '/templates/show_box_bottom.inc.php';
-
-} // show_box_bottom
-
-/**
* get_user_icon
* this function takes a name and a returns either a text representation
* or an <img /> tag