From 0630676eb6b35a717c820e1b40d6a6b51ecb9eef Mon Sep 17 00:00:00 2001 From: Afterster Date: Mon, 29 Feb 2016 22:51:42 +0100 Subject: [PATCH] Add browse filter and light sidebar options Add overload to force library item art display --- images/topmenu-tagcloud.png | Bin 0 -> 1242 bytes images/topmenu-upload.png | Bin 0 -> 1002 bytes lib/class/album.class.php | 4 +- lib/class/artist.class.php | 4 +- lib/class/broadcast.class.php | 4 +- lib/class/channel.class.php | 4 +- lib/class/label.class.php | 4 +- lib/class/library_item.interface.php | 2 +- lib/class/live_stream.class.php | 4 +- lib/class/playlist_object.abstract.php | 2 +- lib/class/podcast.class.php | 4 +- lib/class/podcast_episode.class.php | 4 +- lib/class/song.class.php | 4 +- lib/class/tag.class.php | 4 +- lib/class/tvshow.class.php | 4 +- lib/class/tvshow_episode.class.php | 4 +- lib/class/tvshow_season.class.php | 4 +- lib/class/update.class.php | 33 +++- lib/class/video.class.php | 4 +- lib/class/xml_data.class.php | 6 +- lib/preferences.php | 2 + .../CatalogFavorites.plugin.php | 2 +- templates/header.inc.php | 21 ++- templates/sidebar.light.inc.php | 18 ++- templates/sidebar_home.inc.php | 143 +++++++----------- themes/reborn/templates/default.css | 14 +- 26 files changed, 163 insertions(+), 136 deletions(-) create mode 100644 images/topmenu-tagcloud.png create mode 100644 images/topmenu-upload.png diff --git a/images/topmenu-tagcloud.png b/images/topmenu-tagcloud.png new file mode 100644 index 0000000000000000000000000000000000000000..0eac348ebec4d3a4780ce087acb84d94ad16282b GIT binary patch literal 1242 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq8sKd6mGxU^Rn*LA+qju0R{0zMTO+ zA+A6L|Le8>*J=H4(E4Aa1!9jPdWHZn*h#nU>C>mtGkjElkvFj<$S)X3GcfQd#7|r@ zt4LpnF?#ovYGGMb0nUBD?imzbeEjUeW<9YR4p+;zy}6aP%lrK07vDs=*07%bh^cL zsTJaPVnRU0^1Ani=Q4h4t2|wIMBdYi?{4UsznAXZzJ4-DSxNr0NKIMVca^D-H{`3Z>DC86 zxjxzwk~=1fzJBq_G4dCi!=Vctm)Vk2zN+!?EK5^p+u5obae(VGQ+5ik8PB#do^O18 ze&>D($2u^ro8hS1{z!?U1^XU2^cg^lG*<0ZdIL6WAm} zHujtmxxc0(pe@H)M`}*PtHnlvEk#8K6{jDckl*L(%ouQLoq+3#j>b+&34xlLqc>!t zn7FP5rA*vZ6!C1ufn^JYRHnzYsyteB>cANW&TJip9a2jcE)$FNX<}T_+mdKI;Vst0CW{MjsO4v literal 0 HcmV?d00001 diff --git a/images/topmenu-upload.png b/images/topmenu-upload.png new file mode 100644 index 0000000000000000000000000000000000000000..9455ae651e24edf83396e1a3896ac04cf80f37ae GIT binary patch literal 1002 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq8sKd6mGxU^Rn*LA+qju0R{0zN7%3 z5Lcjr|Mgn`>oh?m{Sl_UKoLwq${j`vGl_83)2C0LMa!N9hH^^~FGjzZ&q_|oD`V3y$WJ@U$D4gZFY?Dd0WTI= zv-eUw8y)2jXmM-~v0+=`y_7r4&r+jp*}J!ITsCa0tK4MHx%YcqrUdu#**}AVZ_P`H z-Cq5BQjboBUY$MAUdAMEcbC!?Su=hE*}0xBjv*e$lM^KT8YZTAriq2gH1x`@)|645 zW5FP9&d0lhfnUGW^ux!=D;ygfC#di`9pX`1v?N1-nQfPa_(v%fhlwhhu3OkLB@6Z# z39oK!m!88VA(_&7MM0g}*Xk3OOJ+bwle%$UYLdwbrAbS>WCW!`97TkgRZLfZ6u7ov z-NJ<{S<|v#zj*ahSe&0NVH@8^!E}x^>4T!uvuDhjxai=WrpALo6Ipl{DTQ6*xn*`F zd&Abvget_description(); } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { $id = null; $type = null; @@ -817,7 +817,7 @@ class Album extends database_object implements library_item $id = $this->id; $type = 'album'; } else { - if (Art::has_db($this->artist_id, 'artist')) { + if (Art::has_db($this->artist_id, 'artist') || $force) { $id = $this->artist_id; $type = 'artist'; } diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index f55fcc16..d3cc1d6a 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -619,12 +619,12 @@ class Artist extends database_object implements library_item return $this->summary; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { $id = null; $type = null; - if (Art::has_db($this->id, 'artist')) { + if (Art::has_db($this->id, 'artist') || $force) { $id = $this->id; $type = 'artist'; } diff --git a/lib/class/broadcast.class.php b/lib/class/broadcast.class.php index ba05fc26..c6ffbc40 100644 --- a/lib/class/broadcast.class.php +++ b/lib/class/broadcast.class.php @@ -286,9 +286,9 @@ class Broadcast extends database_object implements library_item return null; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'broadcast')) { + if (Art::has_db($this->id, 'broadcast') || $force) { Art::display('broadcast', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/channel.class.php b/lib/class/channel.class.php index 98a2a41e..bebeec7c 100644 --- a/lib/class/channel.class.php +++ b/lib/class/channel.class.php @@ -249,9 +249,9 @@ class Channel extends database_object implements media, library_item return $this->description; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'channel')) { + if (Art::has_db($this->id, 'channel') || $force) { Art::display('channel', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/label.class.php b/lib/class/label.class.php index 941f2fd7..23898a7b 100644 --- a/lib/class/label.class.php +++ b/lib/class/label.class.php @@ -97,9 +97,9 @@ class Label extends database_object implements library_item return true; } - public function display_art($thumb) + public function display_art($thumb, $force = false) { - if (Art::has_db($this->id, 'label')) { + if (Art::has_db($this->id, 'label') || $force) { Art::display('label', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/library_item.interface.php b/lib/class/library_item.interface.php index 67d82038..55e96d55 100644 --- a/lib/class/library_item.interface.php +++ b/lib/class/library_item.interface.php @@ -37,7 +37,7 @@ interface library_item extends playable_item public function get_description(); - public function display_art($thumb); + public function display_art($thumb, $force = false); public function update(array $data); diff --git a/lib/class/live_stream.class.php b/lib/class/live_stream.class.php index d0ac6993..2d56c4c8 100644 --- a/lib/class/live_stream.class.php +++ b/lib/class/live_stream.class.php @@ -165,9 +165,9 @@ class Live_Stream extends database_object implements media, library_item return null; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'live_stream')) { + if (Art::has_db($this->id, 'live_stream') || $force) { Art::display('live_stream', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/playlist_object.abstract.php b/lib/class/playlist_object.abstract.php index 168e9541..bec8b0c1 100644 --- a/lib/class/playlist_object.abstract.php +++ b/lib/class/playlist_object.abstract.php @@ -157,7 +157,7 @@ abstract class playlist_object extends database_object implements library_item return null; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { // no art } diff --git a/lib/class/podcast.class.php b/lib/class/podcast.class.php index 26547bb3..5f84e4e0 100644 --- a/lib/class/podcast.class.php +++ b/lib/class/podcast.class.php @@ -226,9 +226,9 @@ class Podcast extends database_object implements library_item return $this->f_description; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'podcast')) { + if (Art::has_db($this->id, 'podcast') || $force) { Art::display('podcast', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/podcast_episode.class.php b/lib/class/podcast_episode.class.php index 3a0dee8b..44af5bde 100644 --- a/lib/class/podcast_episode.class.php +++ b/lib/class/podcast_episode.class.php @@ -206,7 +206,7 @@ class Podcast_Episode extends database_object implements media, library_item return $this->f_description; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { $id = null; $type = null; @@ -215,7 +215,7 @@ class Podcast_Episode extends database_object implements media, library_item $id = $this->id; $type = 'podcast_episode'; } else { - if (Art::has_db($this->podcast, 'podcast')) { + if (Art::has_db($this->podcast, 'podcast') || $force) { $id = $this->podcast; $type = 'podcast'; } diff --git a/lib/class/song.class.php b/lib/class/song.class.php index 98461984..a977fb19 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -1592,7 +1592,7 @@ class Song extends database_object implements media, library_item return $album->get_description(); } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { $id = null; $type = null; @@ -1605,7 +1605,7 @@ class Song extends database_object implements media, library_item $id = $this->album; $type = 'album'; } else { - if (Art::has_db($this->artist, 'artist')) { + if (Art::has_db($this->artist, 'artist') || $force) { $id = $this->artist; $type = 'artist'; } diff --git a/lib/class/tag.class.php b/lib/class/tag.class.php index a9102976..48cbed49 100644 --- a/lib/class/tag.class.php +++ b/lib/class/tag.class.php @@ -780,9 +780,9 @@ class Tag extends database_object implements library_item return null; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'tag')) { + if (Art::has_db($this->id, 'tag') || $force) { Art::display('tag', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/tvshow.class.php b/lib/class/tvshow.class.php index 9ab5e064..5222a07e 100644 --- a/lib/class/tvshow.class.php +++ b/lib/class/tvshow.class.php @@ -262,9 +262,9 @@ class TVShow extends database_object implements library_item return $this->summary; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'tvshow')) { + if (Art::has_db($this->id, 'tvshow') || $force) { Art::display('tvshow', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/tvshow_episode.class.php b/lib/class/tvshow_episode.class.php index 21fd341a..ce8b5a0c 100644 --- a/lib/class/tvshow_episode.class.php +++ b/lib/class/tvshow_episode.class.php @@ -213,7 +213,7 @@ class TVShow_Episode extends Video return $season->get_description(); } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { $id = null; $type = null; @@ -227,7 +227,7 @@ class TVShow_Episode extends Video $type = 'tvshow_season'; } else { $season = new TVShow_Season($this->season); - if (Art::has_db($season->tvshow, 'tvshow')) { + if (Art::has_db($season->tvshow, 'tvshow') || $force) { $id = $season->tvshow; $type = 'tvshow'; } diff --git a/lib/class/tvshow_season.class.php b/lib/class/tvshow_season.class.php index 22ce4ed1..e410dc8a 100644 --- a/lib/class/tvshow_season.class.php +++ b/lib/class/tvshow_season.class.php @@ -227,7 +227,7 @@ class TVShow_Season extends database_object implements library_item return $tvshow->get_description(); } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { $id = null; $type = null; @@ -236,7 +236,7 @@ class TVShow_Season extends database_object implements library_item $id = $this->id; $type = 'tvshow_season'; } else { - if (Art::has_db($this->tvshow, 'tvshow')) { + if (Art::has_db($this->tvshow, 'tvshow') || $force) { $id = $this->tvshow; $type = 'tvshow'; } diff --git a/lib/class/update.class.php b/lib/class/update.class.php index 4853b32b..1196f3eb 100644 --- a/lib/class/update.class.php +++ b/lib/class/update.class.php @@ -544,6 +544,9 @@ class Update $update_string = "- Add upload rename pattern and ignore duplicate options.
"; $version[] = array('version' => '380007', 'description' => $update_string); + $update_string = "- Add browse filter and light sidebar options.
"; + $version[] = array('version' => '380008', 'description' => $update_string); + return $version; } @@ -3837,14 +3840,40 @@ class Update $retval = true; $sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`, `subcatagory`) " . - "VALUES ('upload_catalog_pattern','0','Rename uploaded file according to catalog pattern',0,'boolean','system','upload')"; + "VALUES ('upload_catalog_pattern','0','Rename uploaded file according to catalog pattern',100,'boolean','system','upload')"; $retval &= Dba::write($sql); $id = Dba::insert_id(); $sql = "INSERT INTO `user_preference` VALUES (-1,?,'0')"; $retval &= Dba::write($sql, array($id)); $sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`, `subcatagory`) " . - "VALUES ('catalog_check_duplicate','0','Check library item at import time and don\'t import duplicates',0,'boolean','system','catalog')"; + "VALUES ('catalog_check_duplicate','0','Check library item at import time and don\'t import duplicates',100,'boolean','system','catalog')"; + $retval &= Dba::write($sql); + $id = Dba::insert_id(); + $sql = "INSERT INTO `user_preference` VALUES (-1,?,'0')"; + $retval &= Dba::write($sql, array($id)); + + return $retval; + } + + /** + * update_380008 + * + * Add browse filter and light sidebar options + */ + public static function update_380008() + { + $retval = true; + + $sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`, `subcatagory`) " . + "VALUES ('browse_filter','1','Show filter box on browse',25,'boolean','interface','library')"; + $retval &= Dba::write($sql); + $id = Dba::insert_id(); + $sql = "INSERT INTO `user_preference` VALUES (-1,?,'1')"; + $retval &= Dba::write($sql, array($id)); + + $sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`, `subcatagory`) " . + "VALUES ('sidebar_light','0','Light sidebar by default',25,'boolean','interface','theme')"; $retval &= Dba::write($sql); $id = Dba::insert_id(); $sql = "INSERT INTO `user_preference` VALUES (-1,?,'0')"; diff --git a/lib/class/video.class.php b/lib/class/video.class.php index 38cee764..bb8ee401 100644 --- a/lib/class/video.class.php +++ b/lib/class/video.class.php @@ -393,9 +393,9 @@ class Video extends database_object implements media, library_item return ''; } - public function display_art($thumb = 2) + public function display_art($thumb = 2, $force = false) { - if (Art::has_db($this->id, 'video')) { + if (Art::has_db($this->id, 'video') || $force) { Art::display('video', $this->id, $this->get_fullname(), $thumb, $this->link); } } diff --git a/lib/class/xml_data.class.php b/lib/class/xml_data.class.php index f0d2d0b3..3477f7ec 100644 --- a/lib/class/xml_data.class.php +++ b/lib/class/xml_data.class.php @@ -195,9 +195,9 @@ class XML_Data * This returns the formatted 'playlistTrack' string for an xml document * */ - private static function playlist_song_tracks_string($song,$playlist_data) + private static function playlist_song_tracks_string($song, $playlist_data) { - if ($playlist_data == "") { + if (empty($playlist_data)) { return ""; } $playlist_track = ""; @@ -424,7 +424,7 @@ class XML_Data * This returns an xml document from an array of song ids. * (Spiffy isn't it!) */ - public static function songs($songs,$playlist_data='') + public static function songs($songs, $playlist_data='') { if (count($songs) > self::$limit or self::$offset > 0) { $songs = array_slice($songs, self::$offset, self::$limit); diff --git a/lib/preferences.php b/lib/preferences.php index 31c70896..f230cd05 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -202,6 +202,8 @@ function create_preference_input($name,$value) case 'libitem_contextmenu': case 'upload_catalog_pattern': case 'catalogfav_gridview': + case 'browse_filter': + case 'sidebar_light': $is_true = ''; $is_false = ''; if ($value == '1') { diff --git a/modules/plugins/CatalogFavorites/CatalogFavorites.plugin.php b/modules/plugins/CatalogFavorites/CatalogFavorites.plugin.php index b7c02820..ac448ba1 100644 --- a/modules/plugins/CatalogFavorites/CatalogFavorites.plugin.php +++ b/modules/plugins/CatalogFavorites/CatalogFavorites.plugin.php @@ -126,7 +126,7 @@ class AmpacheCatalogFavorites echo '
'; $thumb = ($this->gridview && UI::is_grid_view('album')) ? 2 : 11; - $item->display_art($thumb); + $item->display_art($thumb, true); echo '
'; echo ''; diff --git a/templates/header.inc.php b/templates/header.inc.php index fb27508f..87dbeb95 100644 --- a/templates/header.inc.php +++ b/templates/header.inc.php @@ -444,7 +444,13 @@ $_SESSION['login'] = false; - + + + + + + + + + - +