mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +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:
parent
5b75e70979
commit
c01d5b55b9
9 changed files with 43 additions and 107 deletions
|
@ -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
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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'])) {
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</dd>
|
||||
<?php
|
||||
$itemprops[gettext_noop('Name')] = $radio->f_name;
|
||||
$itemprops[gettext_noop('Website')] = $radio->f_link;
|
||||
$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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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')) {
|
||||
?>
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue