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

Add licensing to song list column if enabled

Remove MOTD plugin and add it first by default if enabled
This commit is contained in:
Afterster 2016-03-03 22:34:40 +01:00
parent 5b75e70979
commit c01d5b55b9
9 changed files with 43 additions and 107 deletions

View file

@ -100,8 +100,8 @@ class Live_Stream extends database_object implements media, library_item
public function format($details = true)
{
// Default link used on the rightbar
$this->f_name = scrub_out($this->name);
$this->link = AmpConfig::get('web_path') . '/radio.php?action=show&radio=' . scrub_out($this->id);
$this->f_name = scrub_out($this->name);
$this->link = AmpConfig::get('web_path') . '/radio.php?action=show&radio=' . scrub_out($this->id);
$this->f_link = "<a href=\"" . $this->link . "\">" . $this->f_name . "</a>";
$this->f_name_link = "<a target=\"_blank\" href=\"" . $this->site_url . "\">" . $this->f_name . "</a>";
$this->f_url_link = "<a target=\"_blank\" href=\"" . $this->url . "\">" . $this->url . "</a>";

View file

@ -280,6 +280,10 @@ class Song extends database_object implements media, library_item
* @var string $f_composer
*/
public $f_composer;
/**
* @var string $f_license
*/
public $f_license;
/* Setting Variables */
/**
@ -1472,6 +1476,12 @@ class Song extends database_object implements media, library_item
$this->f_publisher = $this->label;
$this->f_composer = $this->composer;
if (AmpConfig::get('licensing') && $this->license) {
$license = new License($this->license);
$license->format();
$this->f_license = $license->f_link;
}
} // format
/**

View file

@ -195,7 +195,7 @@ class Stream_Playlist
if (!empty($object->site_url)) {
$url['title'] .= ' (' . $object->site_url . ')';
}
$url['codec'] = $object->codec;
$url['codec'] = $object->codec;
$url['image_url'] = Art::url($object->id, 'live_stream', $api_session, (AmpConfig::get('ajax_load') ? 3 : 4));
break;
case 'song_preview':

View file

@ -1,95 +0,0 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU Affero General Public License, version 3 (AGPLv3)
* Copyright 2001 - 2015 Ampache.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
class AmpacheMOTDHome
{
public $name = 'Message of the Day';
public $categories = 'home';
public $description = 'Message of the Day on homepage';
public $url = '';
public $version = '000001';
public $min_ampache = '370040';
public $max_ampache = '999999';
/**
* Constructor
* This function does nothing...
*/
public function __construct()
{
return true;
}
/**
* install
* This is a required plugin function. It inserts our preferences
* into Ampache
*/
public function install()
{
return true;
}
/**
* uninstall
* This is a required plugin function. It removes our preferences from
* the database returning it to its original form
*/
public function uninstall()
{
return true;
}
/**
* upgrade
* This is a recommended plugin function
*/
public function upgrade()
{
return true;
}
/**
* display_home
* This display the module in home page
*/
public function display_home()
{
if (@is_readable(AmpConfig::get('prefix') . '/config/motd.php')) {
echo '<div id="motd">';
UI::show_box_top(T_('Message of the Day'));
require_once AmpConfig::get('prefix') . '/config/motd.php';
UI::show_box_bottom();
echo '</div>';
}
}
/**
* load
* This loads up the data we need into this object, this stuff comes
* from the preferences.
*/
public function load($user)
{
return true;
}
}

View file

@ -20,6 +20,13 @@
*
*/
if (@is_readable(AmpConfig::get('prefix') . '/config/motd.php')) {
echo '<div id="motd">';
require_once AmpConfig::get('prefix') . '/config/motd.php';
echo '</div><br />';
}
foreach (Plugin::get_plugins('display_home') as $plugin_name) {
$plugin = new Plugin($plugin_name);
if ($plugin->load($GLOBALS['user'])) {

View file

@ -49,9 +49,9 @@
<?php echo Ajax::button('?action=basket&type=live_stream&id=' . $radio->id,'add', T_('Add to temporary playlist'),'add_live_stream_' . $radio->id); ?>
</dd>
<?php
$itemprops[gettext_noop('Name')] = $radio->f_name;
$itemprops[gettext_noop('Website')] = $radio->f_link;
$itemprops[gettext_noop('Stream')] = $radio->f_url_link;
$itemprops[gettext_noop('Name')] = $radio->f_name;
$itemprops[gettext_noop('Website')] = scrub_out($radio->site_url);
$itemprops[gettext_noop('Stream')] = $radio->f_url_link;
$itemprops[gettext_noop('Codec')] = scrub_out($video->codec);
foreach ($itemprops as $key => $value) {

View file

@ -244,12 +244,8 @@ $button_flip_state_id = 'button_flip_state_' . $song->id;
$songprops[gettext_noop('Lyrics')] = $song->f_lyrics;
}
if (AmpConfig::get('licensing')) {
if ($song->license) {
$license = new License($song->license);
$license->format();
$songprops[gettext_noop('Licensing')] = $license->f_link;
}
if (AmpConfig::get('licensing') && $song->license) {
$songprops[gettext_noop('Licensing')] = $song->f_license;
}
$owner_id = $song->get_user_owner();

View file

@ -68,6 +68,12 @@ if ($libitem->enabled || Access::check('interface','50')) {
<td class="cel_album"><?php echo $libitem->f_album_link ?></td>
<td class="cel_tags"><?php echo $libitem->f_tags ?></td>
<td class="cel_time"><?php echo $libitem->f_time ?></td>
<?php if (AmpConfig::get('licensing')) {
?>
<td class="cel_license"><?php echo $libitem->f_license ?></td>
<?php
}
?>
<?php if (AmpConfig::get('show_played_times')) {
?>

View file

@ -36,6 +36,12 @@ $thcount = 8;
<th class="cel_album essential"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=album' . $argument_param, T_('Album'), 'sort_song_album' . $browse->id); ?></th>
<th class="cel_tags optional"><?php echo T_('Tags'); ?></th>
<th class="cel_time optional"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=time' . $argument_param, T_('Time'), 'sort_song_time' . $browse->id); ?></th>
<?php if (AmpConfig::get('licensing')) {
?>
<th class="cel_license optional"><?php echo T_('License');
?></th>
<?php
} ?>
<?php if (AmpConfig::get('show_played_times')) {
?>
<th class="cel_counter optional"><?php echo T_('# Played');
@ -109,6 +115,12 @@ $thcount = 8;
<th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=album' . $argument_param, T_('Album'), 'sort_song_album' . $browse->id); ?></th>
<th class="cel_tags"><?php echo T_('Tags'); ?></th>
<th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=time' . $argument_param, T_('Time'), 'sort_song_time' . $browse->id); ?></th>
<?php if (AmpConfig::get('licensing')) {
?>
<th class="cel_license"><?php echo T_('License');
?></th>
<?php
} ?>
<?php if (AmpConfig::get('show_played_times')) {
?>
<th class="cel_counter optional"><?php echo T_('# Played');