1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 10:49:37 +02:00

Add link to license on upload form

Add option to remove grid view from catalog favorites at homepage
This commit is contained in:
Afterster 2016-02-28 10:07:52 +01:00
parent ce1191e97e
commit 2de4417058
8 changed files with 80 additions and 96 deletions

View file

@ -29,6 +29,11 @@ You get the latest version with recent changes and fixes but maybe in an unstabl
[![Codacy Badge](https://api.codacy.com/project/badge/b28cdb9e9ee2431c7cb9c23d5438cb80)](https://www.codacy.com/app/afterster_2222/ampache)
[![Code Climate](https://codeclimate.com/github/ampache/ampache/badges/gpa.svg)](https://codeclimate.com/github/ampache/ampache)
Installation
------------
Please see [the wiki](https://github.com/ampache/ampache/wiki/Installation)
Requirements
------------
@ -47,16 +52,11 @@ receives the most testing:
* hash
* session
* json
* simplexml (This is not strictly necessary, but may result in a better experience.)
* curl (This is not strictly necessary, but may result in a better experience.)
* simplexml (optional)
* curl (optional)
* MySQL 5.x
Installation
------------
Please see [the wiki](https://github.com/ampache/ampache/wiki/Installation)
Upgrading
---------
@ -72,45 +72,7 @@ Ampache is free software; you can redistribute it and/or
modify it under the terms of the GNU Affero General Public License v3 (AGPLv3)
as published by the Free Software Foundation.
Ampache includes some external modules that carry their own licensing.
* [getID3](http://getid3.sourceforge.net): GPL v2
* [Horde_Browser](http://www.horde.org): LGPL v2.1
* [Gettext](https://github.com/oscarotero/Gettext): MIT
* [MusicBrainz](https://github.com/mikealmond/MusicBrainz): MIT
* PHP MPD interface: GPL v2
* [PHPMailer](https://github.com/PHPMailer/PHPMailer): LGPL v2.1
* [jQuery](https://jquery.org/): MIT
* [Requests](http://requests.ryanmccue.info): ISC Licensed
* [xbmc-php-rpc](https://github.com/krixon/xbmc-php-rpc): GPL v3
* [Dropbox SDK](https://github.com/dropbox/dropbox-sdk-php): MIT
* [jPlayer](http://jplayer.org): MIT
* [prettyPhoto](http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone): GPL v2
* [Tag-it!] (http://aehlke.github.io/tag-it): MIT
* [PHP Echo Nest API] (https://github.com/bshaffer/php-echonest-api): MIT
* [Noty] (http://ned.im/noty/): MIT
* [jScroll] (https://github.com/pklauzinski/jscroll): MIT
* [jquery.qrcode] (http://jeromeetienne.github.io/jquery-qrcode): MIT
* [PHP OpenID] (https://github.com/openid/php-openid): Apache License
* [Ratchet] (http://socketo.me): MIT
* [ReactPHP] (https://github.com/reactphp/react): MIT
* [Guzzle] (https://github.com/guzzle/guzzle): MIT
* [Symfony Components] (https://github.com/symfony): MIT
* [Evenement] (https://github.com/igorw/evenement): MIT
* [RhinoSlider] (http://www.rhinoslider.com/): MIT
* [MediaTable] (https://github.com/edenspiekermann/MediaTable): MIT
* [Responsive Elements] (https://github.com/kumailht/responsive-elements): MIT
* [Bootstrap] (http://getbootstrap.com): MIT
* [jQuery Knob] (https://github.com/aterrien/jQuery-Knob): MIT
* [jQuery File Upload] (https://github.com/blueimp/jQuery-File-Upload): MIT
* [jsTree] (https://www.jstree.com/): MIT
* [php-tmdb-api] (https://github.com/php-tmdb/api) : MIT
* [TvDb] (https://github.com/Moinax/TvDb) : MIT
* [jQuery DateTimePicker] (https://github.com/xdan/datetimepicker) : MIT
* [pChart] (http://www.pchart.net) : GPL v3
* [ZipStream-PHP] (https://github.com/maennchen/ZipStream-PHP) : [ZipStream-PHP license] (modules/zipstream/COPYING)
* [SabreDAV] (https://github.com/fruux/sabre-dav) : New BSD
Ampache includes some [external modules](https://github.com/ampache/ampache/blob/develop/composer.lock) that carry their own licensing.
Translations
------------

View file

@ -2782,7 +2782,7 @@ class Update
"PRIMARY KEY (`id`)) ENGINE = MYISAM";
$retval &= Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('_default', '')";
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('0 - default', '')";
$retval &= Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY', 'https://creativecommons.org/licenses/by/3.0/')";
$retval &= Dba::write($sql);

View file

@ -442,3 +442,11 @@ function geolocate_user_callback(position) {
var url = jsAjaxUrl + '?page=stats&action=geolocation&latitude=' + position.coords.latitude + '&longitude=' + position.coords.longitude;
$.get(url);
}
function show_selected_license_link(license_select) {
var license = $('#' + license_select + ' option:selected');
var link = license.attr('data-link');
if (link !== undefined) {
window.open(link);
}
}

View file

@ -201,6 +201,7 @@ function create_preference_input($name,$value)
case 'notify_email':
case 'libitem_contextmenu':
case 'upload_catalog_pattern':
case 'catalogfav_gridview':
$is_true = '';
$is_false = '';
if ($value == '1') {

View file

@ -446,7 +446,7 @@ function show_license_select($name='license',$license_id=0,$song_id=0)
// Added ID field so we can easily observe this element
echo "<select name=\"$name\" id=\"$key\">\n";
$sql = "SELECT `id`, `name` FROM `license` ORDER BY `name`";
$sql = "SELECT `id`, `name`, `description`, `external_link` FROM `license` ORDER BY `name`";
$db_results = Dba::read($sql);
while ($r = Dba::fetch_assoc($db_results)) {
@ -455,10 +455,18 @@ function show_license_select($name='license',$license_id=0,$song_id=0)
$selected = "selected=\"selected\"";
}
echo "\t<option value=\"" . $r['id'] . "\" $selected>" . $r['name'] . "</option>\n";
echo "\t<option value=\"" . $r['id'] . "\" $selected";
if (!empty($r['description'])) {
echo " title=\"" . addslashes($r['description']) . "\"";
}
if (!empty($r['external_link'])) {
echo " data-link=\"" . $r['external_link'] . "\"";
}
echo ">" . $r['name'] . "</option>\n";
} // end while
echo "</select>\n";
echo "<a href=\"javascript:show_selected_license_link('" . $key . "');\">" . T_('View License') . "</a>";
} // show_license_select
/**

View file

@ -33,6 +33,7 @@ class AmpacheCatalogFavorites
// These are internal settings used by this class, run this->load to
// fill them out
private $maxitems;
private $gridview;
/**
* Constructor
@ -56,7 +57,7 @@ class AmpacheCatalogFavorites
}
Preference::insert('catalogfav_max_items','Catalog favorites max items','5','25','integer','plugins',$this->name);
Preference::insert('catalogfav_columns','Catalog favorites columns','1','25','integer','plugins',$this->name);
Preference::insert('catalogfav_gridview','Catalog favorites grid view display','1','25','boolean','plugins',$this->name);
return true;
}
@ -69,6 +70,7 @@ class AmpacheCatalogFavorites
public function uninstall()
{
Preference::delete('catalogfav_max_items');
Preference::delete('catalogfav_gridview');
return true;
}
@ -81,7 +83,7 @@ class AmpacheCatalogFavorites
{
$from_version = Plugin::get_plugin_version($this->name);
if ($from_version < 2) {
Preference::insert('catalogfav_columns','Catalog favorites columns','1','25','integer','plugins');
Preference::insert('catalogfav_gridview','Catalog favorites grid view display','1','25','boolean','plugins');
}
return true;
}
@ -95,7 +97,11 @@ class AmpacheCatalogFavorites
if (AmpConfig::get('userflags')) {
$userflags = Userflag::get_latest(null, -1, $this->maxitems);
$i = 0;
echo '<div class="home_plugin"><table class="tabledata">';
echo '<div class="home_plugin"><table class="tabledata';
if (!$this->gridview) {
echo " disablegv";
}
echo '">';
foreach ($userflags as $userflag) {
$item = new $userflag['type']($userflag['id']);
$item->format();
@ -103,9 +109,9 @@ class AmpacheCatalogFavorites
$user->format();
if ($item->id) {
echo '<tr class="' . ((($i % 2) == 0) ? 'even' : 'odd') . '"><td>';
echo '<div>';
echo '<div style="float: left;">';
echo '<tr class="' . ((($i % 2) == 0) ? 'even' : 'odd') . '">';
echo '<td style="height: auto;">';
if ($this->gridview) {
echo '<span style="font-weight: bold;">' . $item->f_link . '</span> ';
echo '<span style="margin-right: 10px;">';
if (AmpConfig::get('directplay')) {
@ -116,20 +122,25 @@ class AmpacheCatalogFavorites
}
echo Ajax::button('?action=basket&type=' . $userflag['type'] . '&id=' . $userflag['id'],'add', T_('Add to temporary playlist'),'play_full_' . $userflag['id']);
echo '</span>';
echo '</div>';
echo '<div style="float: right; opacity: 0.5;">' . T_('recommended by') . ' ' . $user->f_link . '</div>';
}
echo '</div><br />';
echo '<div style="margin-left: 30px;">';
echo '<div style="float: left; margin-right: 20px;">';
$thumb = UI::is_grid_view('album') ? 2 : 11;
$thumb = $this->gridview ? 2 : 11;
$item->display_art($thumb);
echo '</div>';
echo '</td>';
if (!$this->gridview) {
echo '<td>' . $item->f_link . '</td>';
}
echo '<td class="optional">';
echo '<div style="white-space: normal;">' . $item->get_description() . '</div>';
echo '</div>';
if ($this->gridview) {
echo '<div style="float: right; opacity: 0.5;">' . T_('recommended by') . ' ' . $user->f_link . '</div>';
echo '</div><br />';
}
echo '</td></tr>';
$i++;
@ -153,6 +164,7 @@ class AmpacheCatalogFavorites
if ($this->maxitems < 1) {
$this->maxitems = 5;
}
$this->gridview = ($data['catalogfav_gridview'] == '1');
return true;
}

View file

@ -344,7 +344,7 @@ CREATE TABLE IF NOT EXISTS `license` (
--
INSERT INTO `license` (`id`, `name`, `description`, `external_link`) VALUES
(1, '_default', NULL, ''),
(1, '0 - default', NULL, ''),
(2, 'CC BY', NULL, 'https://creativecommons.org/licenses/by/3.0/'),
(3, 'CC BY NC', NULL, 'https://creativecommons.org/licenses/by-nc/3.0/'),
(4, 'CC BY NC ND', NULL, 'https://creativecommons.org/licenses/by-nc-nd/3.0/'),

View file

@ -427,41 +427,34 @@ $_SESSION['login'] = false;
<div id="topmenu_container" class="topmenu_container-<?php echo AmpConfig::get('ui_fixed') ? 'fixed' : 'float';
?>">
<div id="topmenu_item">
<a href="<?php echo $web_path;
?>/index.php">
<img src="<?php echo $web_path;
?>/images/topmenu-home.png" />
<span><?php echo T_('Home');
?></span>
<a href="<?php echo $web_path ?>/index.php">
<img src="<?php echo $web_path ?>/images/topmenu-home.png" />
<span><?php echo T_('Home') ?></span>
</a>
</div>
<div id="topmenu_item">
<a href="<?php echo $web_path;
?>/browse.php?action=artist">
<img src="<?php echo $web_path;
?>/images/topmenu-music.png" />
<span><?php echo T_('Artists');
?></span>
<a href="<?php echo $web_path ?>/browse.php?action=artist">
<img src="<?php echo $web_path ?>/images/topmenu-music.png" />
<span><?php echo T_('Artists') ?></span>
</a>
</div>
<div id="topmenu_item">
<a href="<?php echo $web_path;
?>/browse.php?action=playlist">
<img src="<?php echo $web_path;
?>/images/topmenu-playlist.png" />
<span><?php echo T_('Playlists');
?></span>
<a href="<?php echo $web_path ?>/browse.php?action=playlist">
<img src="<?php echo $web_path ?>/images/topmenu-playlist.png" />
<span><?php echo T_('Playlists') ?></span>
</a>
</div>
<?php if (Access::check('interface', '25')) {
?>
<div id="topmenu_item">
<a href="<?php echo $web_path;
?>/stats.php?action=userflag">
<img src="<?php echo $web_path;
?>/images/topmenu-favorite.png" />
<span><?php echo T_('Favorites');
?></span>
<a href="<?php echo $web_path ?>/stats.php?action=userflag">
<img src="<?php echo $web_path ?>/images/topmenu-favorite.png" />
<span><?php echo T_('Favorites') ?></span>
</a>
</div>
<?php
}
?>
</div>
<?php
} ?>