1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-04 18:29:40 +02:00

First upload and license implementation

Fix #252
This commit is contained in:
Afterster 2014-06-13 03:36:19 +02:00
parent 137ba9092f
commit 40e9396f3e
51 changed files with 4962 additions and 104 deletions

View file

@ -99,6 +99,9 @@ Ampache includes some external modules that carry their own licensing.
* [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] (http://www.jstree.com/): MIT
Translations

62
admin/license.php Normal file
View file

@ -0,0 +1,62 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once '../lib/init.php';
if (!Access::check('interface','100')) {
UI::access_denied();
exit;
}
UI::show_header();
switch ($_REQUEST['action']) {
case 'edit':
if (isset($_POST['license_id'])) {
License::update($_POST);
$text = T_('License Updated');
} else {
License::create($_POST);
$text = T_('License Created');
}
show_confirmation($text,'',AmpConfig::get('web_path').'/admin/license.php');
break;
case 'show_edit':
$license = new License($_REQUEST['license_id']);
case 'show_create':
require_once AmpConfig::get('prefix') . '/templates/show_edit_license.inc.php';
break;
case 'delete':
License::delete($_REQUEST['license_id']);
show_confirmation(T_('License Deleted'),'',AmpConfig::get('web_path').'/admin/license.php');
break;
default:
$browse = new Browse();
$browse->set_type('license');
$browse->set_simple_browse(true);
$license_ids = $browse->get_objects();
$browse->show_objects($license_ids);
$browse->store();
break;
}
UI::show_footer();

View file

@ -319,6 +319,11 @@ sociable = "true"
; DEFAULT: true
notify = "true"
; License
; This turns on / off all licensing features on Ampache
; DEFAULT: false
;licensing = "false"
; This options will turn on/off Demo Mode
; If Demo mode is on you can not play songs or update your catalog
; in other words.. leave this commented out

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/fileupload-icons.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -35,6 +35,7 @@ class Artist extends database_object
public $mbid; // MusicBrainz ID
public $catalog_id;
public $time;
public $user;
public $tags;
public $f_tags;
@ -512,4 +513,10 @@ class Artist extends database_object
return Dba::write($sql, array($summary, $placeformed, $yearformed, time(), $this->id));
}
public function update_artist_user($user)
{
$sql = "UPDATE `artist` SET `user` = ? WHERE `id` = ?";
return Dba::write($sql, array($user, $this->id));
}
} // end of artist class

View file

@ -231,6 +231,10 @@ class Browse extends Query
$box_title = T_('Broadcasts');
$box_req = AmpConfig::get('prefix') . '/templates/show_broadcasts.inc.php';
break;
case 'license':
$box_title = T_('Media Licenses');
$box_req = AmpConfig::get('prefix') . '/templates/show_manage_license.inc.php';
break;
default:
// Rien a faire
break;

View file

@ -516,6 +516,32 @@ abstract class Catalog extends database_object
return $results;
}
public static function get_uploads_sql($type, $user_id=null)
{
if (is_null($user_id)) {
$user_id = $GLOBALS['user']->id;
}
$user_id = intval($user_id);
$sql = "";
switch ($type) {
case 'song':
$sql = "SELECT `song`.`id` as `id` FROM `song` WHERE `song`.`user_upload` = '" . $user_id . "'";
break;
case 'album':
$sql = "SELECT `album`.`id` as `id` FROM `album` JOIN `song` ON `song`.`album` = `album`.`id` WHERE `song`.`user_upload` = '" . $user_id . "' GROUP BY `album`.`id`";
break;
case 'artist':
default:
$sql = "SELECT `artist`.`id` as `id` FROM `artist` JOIN `song` ON `song`.`artist` = `artist`.`id` WHERE `song`.`user_upload` = '" . $user_id . "' GROUP BY `artist`.`id`";
break;
}
return $sql;
}
/**
* get_album_ids
*

138
lib/class/license.class.php Normal file
View file

@ -0,0 +1,138 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
class License
{
public $id;
public $name;
public $description;
public $external_link;
public $f_link;
/**
* Constructor
* This pulls the license information from the database and returns
* a constructed object
*/
public function __construct($id)
{
// Load the data from the database
$this->_get_info($id);
return true;
} // Constructor
/**
* _get_info
* does the db call, reads from the license table
*/
private function _get_info($id)
{
$sql = "SELECT * FROM `license` WHERE `id` = ?";
$db_results = Dba::read($sql, array($id));
$data = Dba::fetch_assoc($db_results);
foreach ($data as $key=>$value) {
$this->$key = $value;
}
return true;
} // _get_info
/**
* create
* This takes a key'd array of data as input and inserts a new license entry, it returns the auto_inc id
*/
public static function create($data)
{
$sql = "INSERT INTO `license` (`name`,`description`,`external_link`) " .
"VALUES (? , ?, ?)";
Dba::write($sql, array($data['name'], $data['description'], $data['external_link']));
$insert_id = Dba::insert_id();
return $insert_id;
} // create
/**
* update
* This takes a key'd array of data as input and updates a license entry
*/
public static function update($data)
{
$id = Dba::escape($data['shout_id']);
$text = Dba::escape(strip_tags($data['comment']));
$sticky = make_bool($data['sticky']);
$sql = "UPDATE `license` SET `name` = ?, `description` = ?, `external_link` = ? WHERE `id` = ?";
Dba::write($sql, array($data['name'], $data['description'], $data['external_link'], $data['license_id']));
return true;
} // create
/**
* format
* this function takes the object and reformats some values
*/
public function format()
{
$this->f_link = ($this->external_link) ? '<a href="' . $this->external_link . '">' . $this->name . '</a>' : $this->name;
return true;
} //format
/**
* delete
* this function deletes a specific license entry
*/
public static function delete($license_id)
{
$sql = "DELETE FROM `license` WHERE `id` = ?";
Dba::write($sql, array($license_id));
} // delete
/**
* get_licenses
* Returns a list of licenses accessible by the current user.
*/
public static function get_licenses()
{
$sql = 'SELECT `id` from `license` ORDER BY `name`';
$db_results = Dba::read($sql);
$results = array();
while ($row = Dba::fetch_assoc($db_results)) {
$results[] = $row['id'];
}
return $results;
} // get_licenses
} // License class

View file

@ -166,6 +166,12 @@ class Query
'alpha_match',
'regex_match',
'regex_not_match'
),
'license' => array(
'alpha_match',
'regex_match',
'regex_not_match',
'starts_with'
)
);
@ -265,6 +271,9 @@ class Query
'started',
'listeners'
),
'license' => array(
'name'
),
);
}
@ -594,6 +603,7 @@ class Query
case 'song_preview':
case 'channel':
case 'broadcast':
case 'license':
// Set it
$this->_state['type'] = $type;
$this->set_base_sql(true, $custom_base);
@ -889,6 +899,10 @@ class Query
$this->set_select("DISTINCT(`broadcast`.`id`)");
$sql = "SELECT %%SELECT%% FROM `broadcast` ";
break;
case 'license':
$this->set_select("`license`.`id`");
$sql = "SELECT %%SELECT%% FROM `license` ";
break;
case 'playlist_song':
case 'song':
default:
@ -1395,6 +1409,25 @@ class Query
break;
} // end filter
break;
case 'license':
switch ($filter) {
case 'alpha_match':
$filter_sql = " `license`.`name` LIKE '%" . Dba::escape($value) . "%' AND ";
break;
case 'regex_match':
if (!empty($value)) $filter_sql = " `':`.`name` REGEXP '" . Dba::escape($value) . "' AND ";
break;
case 'regex_not_match':
if (!empty($value)) $filter_sql = " `':`.`name` NOT REGEXP '" . Dba::escape($value) . "' AND ";
break;
case 'exact_match':
$filter_sql = " `':`.`name` = '" . Dba::escape($value) . "' AND ";
break;
default:
// Rien a faire
break;
} // end filter
break;
} // end switch on type
return $filter_sql;

View file

@ -376,6 +376,20 @@ class Search extends playlist_object
'type' => 'boolean_subsearch',
'widget' => array('select', $playlists)
);
$licenses = array();
foreach (License::get_licenses() as $license_id) {
$license = new License($license_id);
$licenses[$license_id] = $license->name;
}
if (AmpConfig::get('licensing')) {
$this->types[] = array(
'name' => 'license',
'label' => T_('Music License'),
'type' => 'boolean_numeric',
'widget' => array('select', $licenses)
);
}
break;
case 'album':
$this->types[] = array(
@ -1071,6 +1085,9 @@ class Search extends playlist_object
$join = array_merge($subsql['join'], $join);
$join['tag'] = $tagjoin;
break;
case 'license':
$where[] = "`song`.`license` $sql_match_operator '$input'";
break;
case 'added':
$input = strtotime($input);
$where[] = "`song`.`addition_time` $sql_match_operator $input";

View file

@ -46,6 +46,8 @@ class Song extends database_object implements media
public $mbid; // MusicBrainz ID
public $catalog;
public $waveform;
public $user_upload;
public $license;
public $tags;
public $language;
@ -128,19 +130,21 @@ class Song extends database_object implements media
$comment = $results['comment'];
$tags = $results['genre']; // multiple genre support makes this an array
$lyrics = $results['lyrics'];
$user_upload = isset($results['user_upload']) ? $results['user_upload'] : null;
$license = isset($results['license']) ? $results['license'] : null;
$artist_id = Artist::check($artist, $artist_mbid);
$album_id = Album::check($album, $year, $disk, $album_mbid);
$sql = 'INSERT INTO `song` (`file`, `catalog`, `album`, `artist`, ' .
'`title`, `bitrate`, `rate`, `mode`, `size`, `time`, `track`, ' .
'`addition_time`, `year`, `mbid`) ' .
'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
'`addition_time`, `year`, `mbid`, `user_upload`, `license`) ' .
'VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
$db_results = Dba::write($sql, array(
$file, $catalog, $album_id, $artist_id,
$title, $bitrate, $rate, $mode, $size, $time, $track,
time(), $year, $track_mbid));
time(), $year, $track_mbid, $user_upload, $license));
if (!$db_results) {
debug_event('song', 'Unable to insert ' . $file, 2);
@ -198,7 +202,7 @@ class Song extends database_object implements media
'`year`, `artist`, `title`, `bitrate`, `rate`, ' .
'`mode`, `size`, `time`, `track`, `played`, ' .
'`song`.`enabled`, `update_time`, `tag_map`.`tag_id`, '.
'`mbid`, `addition_time` ' .
'`mbid`, `addition_time`, `license` ' .
'FROM `song` LEFT JOIN `tag_map` ' .
'ON `tag_map`.`object_id`=`song`.`id` ' .
"AND `tag_map`.`object_type`='song' ";
@ -266,7 +270,7 @@ class Song extends database_object implements media
$sql = 'SELECT `song`.`id`, `song`.`file`, `song`.`catalog`, `song`.`album`, `song`.`year`, `song`.`artist`,' .
'`song`.`title`, `song`.`bitrate`, `song`.`rate`, `song`.`mode`, `song`.`size`, `song`.`time`, `song`.`track`, ' .
'`song`.`played`, `song`.`enabled`, `song`.`update_time`, `song`.`mbid`, `song`.`addition_time`, ' .
'`song`.`played`, `song`.`enabled`, `song`.`update_time`, `song`.`mbid`, `song`.`addition_time`, `song`.`license`, ' .
'`album`.`mbid` AS `album_mbid`, `artist`.`mbid` AS `artist_mbid` ' .
'FROM `song` LEFT JOIN `album` ON `album`.`id` = `song`.`album` LEFT JOIN `artist` ON `artist`.`id` = `song`.`artist` ' .
'WHERE `song`.`id` = ?';
@ -565,6 +569,7 @@ class Song extends database_object implements media
case 'artist':
case 'album':
case 'mbid':
case 'license':
// Check to see if it needs to be updated
if ($value != $this->$key) {
$function = 'update_' . $key;
@ -740,6 +745,12 @@ class Song extends database_object implements media
} // update_mbid
public static function update_license($new_license, $song_id)
{
self::_update_item('license', $new_license, $song_id, '50');
} // update_license
/**
* update_artist
* updates the artist field

View file

@ -410,6 +410,9 @@ class Update
$update_string = '- Add show/hide donate button preference.<br />';
$version[] = array('version' => '370003','description' => $update_string);
$update_string = '- Add license information and user\'s artist association.<br />';
$version[] = array('version' => '370004','description' => $update_string);
return $version;
}
@ -1843,7 +1846,7 @@ class Update
*/
public static function update_360024()
{
$sql = "DROP TABLE `flagged`";
$sql = "DROP TABLE IF EXISTS `flagged`";
Dba::write($sql);
return true;
@ -2519,4 +2522,97 @@ class Update
return true;
}
/**
* update_370004
*
* Add license information and user's artist association
*/
public static function update_370004()
{
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
"VALUES ('upload_catalog','-1','Uploads catalog destination',40,'integer','system')";
Dba::write($sql);
$id = Dba::insert_id();
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'-1')";
Dba::write($sql, array($id));
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
"VALUES ('allow_upload','0','Allow users to upload media',25,'boolean','system')";
Dba::write($sql);
$id = Dba::insert_id();
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'0')";
Dba::write($sql, array($id));
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
"VALUES ('upload_subdir','1','Upload: create a subdirectory per user (recommended)',25,'boolean','system')";
Dba::write($sql);
$id = Dba::insert_id();
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'1')";
Dba::write($sql, array($id));
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
"VALUES ('upload_user_artist','0','Upload: consider the user sender as the track\'s artist',25,'boolean','system')";
Dba::write($sql);
$id = Dba::insert_id();
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'0')";
Dba::write($sql, array($id));
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
"VALUES ('upload_script','','Upload: run the following script after upload (current directory = upload target directory)',25,'string','system')";
Dba::write($sql);
$id = Dba::insert_id();
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'')";
Dba::write($sql, array($id));
$sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
"VALUES ('upload_allow_edit','1','Upload: allow users to edit uploaded songs',25,'boolean','system')";
Dba::write($sql);
$id = Dba::insert_id();
$sql = "INSERT INTO `user_preference` VALUES (-1,?,'1')";
Dba::write($sql, array($id));
$sql = "ALTER TABLE `artist` ADD `user` int(11) NULL AFTER `last_update`";
Dba::write($sql);
$sql = "CREATE TABLE `license` (" .
"`id` int(11) unsigned NOT NULL AUTO_INCREMENT," .
"`name` varchar(80) NOT NULL," .
"`description` varchar(256) NULL," .
"`external_link` varchar(256) NOT NULL," .
"PRIMARY KEY (`id`)) ENGINE = MYISAM";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY', 'https://creativecommons.org/licenses/by/3.0/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY NC', 'https://creativecommons.org/licenses/by-nc/3.0/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY NC ND', 'https://creativecommons.org/licenses/by-nc-nd/3.0/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY NC SA', 'https://creativecommons.org/licenses/by-nc-sa/3.0/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY ND', 'https://creativecommons.org/licenses/by-nd/3.0/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('CC BY SA', 'https://creativecommons.org/licenses/by-sa/3.0/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('Licence Art Libre', 'http://artlibre.org/licence/lal/')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('Yellow OpenMusic', 'http://openmusic.linuxtag.org/yellow.html')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('Green OpenMusic', 'http://openmusic.linuxtag.org/green.html')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('Gnu GPL Art', 'http://gnuart.org/english/gnugpl.html')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('WTFPL', 'https://en.wikipedia.org/wiki/WTFPL')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('FMPL', 'http://www.fmpl.org/fmpl.html')";
Dba::write($sql);
$sql = "INSERT INTO `license`(`name`, `external_link`) VALUES ('C Reaction', 'http://morne.free.fr/Necktar7/creaction.htm')";
Dba::write($sql);
$sql = "ALTER TABLE `song` ADD `user_upload` int(11) NULL AFTER `addition_time`, ADD `license` int(11) NULL AFTER `user_upload`";
Dba::write($sql);
return true;
}
}

136
lib/class/upload.class.php Normal file
View file

@ -0,0 +1,136 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
class Upload
{
/**
* Constructor
* This pulls the license information from the database and returns
* a constructed object
*/
protected function __construct()
{
return false;
} // Constructor
public static function process()
{
$catalog_id = AmpConfig::get('upload_catalog');
if ($catalog_id > 0) {
$catalog = Catalog::create_from_id($catalog_id);
if ($catalog->catalog_type == "local") {
$allowed = explode('|', AmpConfig::get('catalog_file_pattern'));
if (isset($_FILES['upl']) && $_FILES['upl']['error'] == 0) {
$extension = pathinfo($_FILES['upl']['name'], PATHINFO_EXTENSION);
if (!in_array(strtolower($extension), $allowed)) {
debug_event('upload', 'File extension `' . $extension . '` not allowed.', '2');
echo '{"status":"error"}';
return false;
}
$rootdir = self::get_root($catalog);
$targetdir = $rootdir;
$folder = $_POST['folder'];
if ($folder == '..') {
$folder = '';
}
if (!empty($folder)) {
$targetdir .= DIRECTORY_SEPARATOR . $folder;
}
$targetdir = realpath($targetdir);
if (strpos($targetdir, $rootdir) === FALSE) {
debug_event('upload', 'Something wrong with final upload path.', '1');
echo '{"status":"error"}';
return false;
}
$targetfile = $targetdir . DIRECTORY_SEPARATOR . $_FILES['upl']['name'];
if (Core::is_readable($targetfile)) {
debug_event('upload', 'File `' . $_FILES['upl']['name'] . '` already exists in target directory.', '1');
echo '{"status":"error"}';
return false;
}
if (move_uploaded_file($_FILES['upl']['tmp_name'], $targetfile)) {
debug_event('upload', 'File `' . $_FILES['upl']['name'] . '` uploaded.', '5');
if (AmpConfig::get('upload_script')) {
chdir($targetdir);
exec(AmpConfig::get('upload_script'));
}
$options = array();
$options['user_upload'] = $GLOBALS['user']->id;
if (isset($_POST['license'])) {
$options['license'] = $_POST['license'];
}
$catalog->add_files($targetdir, $options);
echo '{"status":"success"}';
return true;
} else {
debug_event('upload', 'Cannot copy the file to target directory. Please check write access.', '1');
}
}
} else {
debug_event('upload', 'The catalog must be local to upload files on it.', '1');
}
} else {
debug_event('upload', 'No catalog target upload configured.', '1');
}
echo '{"status":"error"}';
return false;
}
public static function get_root($catalog = null, $username = null)
{
if ($catalog == null) {
$catalog_id = AmpConfig::get('upload_catalog');
if ($catalog_id > 0) {
$catalog = Catalog::create_from_id($catalog_id);
}
}
if (is_null($username)) {
$username = $GLOBALS['user']->username;
}
$rootdir = realpath($catalog->path);
if (!empty($rootdir)) {
if (AmpConfig::get('upload_subdir')) {
$rootdir .= DIRECTORY_SEPARATOR . $username;
if (!Core::is_readable($rootdir)) {
debug_event('upload', 'Target user directory `' . $rootdir . '` doesn\'t exists. Creating it...', '5');
mkdir($rootdir);
}
}
}
return $rootdir;
}
} // Upload class

View file

@ -1214,6 +1214,23 @@ class User extends database_object
} // activate_user
/**
* get_artists
* Get artists associated with the user
*/
public function get_artists()
{
$sql = "SELECT `id` FROM `artist` WHERE `user` = ?";
$db_results = Dba::read($sql, array($this->id));
$results = array();
while ($row = Dba::fetch_assoc($db_results)) {
$results[] = $row['id'];
}
return $results;
}
/**
* is_xmlrpc
* checks to see if this is a valid xmlrpc user

View file

@ -69,7 +69,7 @@ function install_check_status($configfile)
if (!file_exists($configfile)) {
return true;
} else {
Error::add('general', T_('Config file already exists, install is probably completed'));
//Error::add('general', T_('Config file already exists, install is probably completed'));
}
/*

View file

@ -178,6 +178,10 @@ function create_preference_input($name,$value)
case 'topmenu':
case 'demo_clear_sessions':
case 'show_donate':
case 'allow_upload':
case 'upload_subdir':
case 'upload_user_artist':
case 'upload_allow_edit':
$is_true = '';
$is_false = '';
if ($value == '1') {
@ -189,6 +193,9 @@ function create_preference_input($name,$value)
echo "\t<option value=\"0\" $is_false>" . T_("Disable") . "</option>\n";
echo "</select>\n";
break;
case 'upload_catalog':
show_catalog_select('upload_catalog', $value, '', true);
break;
case 'play_type':
$is_localplay = '';
$is_democratic = '';

View file

@ -270,13 +270,17 @@ function show_artist_select($name='artist', $artist_id=0, $allow_add=0, $song_id
* Yet another one of these buggers. this shows a drop down of all of your
* catalogs.
*/
function show_catalog_select($name='catalog',$catalog_id=0,$style='')
function show_catalog_select($name='catalog',$catalog_id=0,$style='', $allow_none=false)
{
echo "<select name=\"$name\" style=\"$style\">\n";
$sql = "SELECT `id`, `name` FROM `catalog` ORDER BY `name`";
$db_results = Dba::read($sql);
if ($allow_none) {
echo "\t<option value=\"-1\">" . T_('None') . "</option>\n";
}
while ($r = Dba::fetch_assoc($db_results)) {
$selected = '';
if ($r['id'] == $catalog_id) {
@ -291,6 +295,44 @@ function show_catalog_select($name='catalog',$catalog_id=0,$style='')
} // show_catalog_select
/**
* show_album_select
* This displays a select of every album that we've got in Ampache (which can be
* hella long). It's used by the Edit page and takes a $name and a $album_id
*/
function show_license_select($name='license',$license_id=0,$song_id=0)
{
static $license_id_cnt = 0;
// Generate key to use for HTML element ID
if ($song_id) {
$key = "license_select_" . $song_id;
} else {
$key = "license_select_c" . ++$album_id_cnt;
}
// 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`";
$db_results = Dba::read($sql);
echo "\t<option value=\"-1\"></option>\n";
while ($r = Dba::fetch_assoc($db_results)) {
$selected = '';
if ($r['id'] == $license_id) {
$selected = "selected=\"selected\"";
}
echo "\t<option value=\"" . $r['id'] . "\" $selected>" . $r['name'] . "</option>\n";
} // end while
echo "</select>\n";
} // show_license_select
/**
* show_user_select
* This one is for users! shows a select/option statement so you can pick a user

View file

@ -359,7 +359,7 @@ class Catalog_local extends Catalog
else {
if ($is_audio_file) {
$this->_insert_local_song($full_file,$file_size);
$this->_insert_local_song($full_file, $file_size, $options);
} else { $this->insert_local_video($full_file,$file_size); }
$this->count++;
@ -640,7 +640,7 @@ class Catalog_local extends Catalog
*
* Insert a song that isn't already in the database.
*/
private function _insert_local_song($file, $file_info)
private function _insert_local_song($file, $file_info, $options)
{
$vainfo = new vainfo($file, '', '', '', $this->sort_pattern, $this->rename_pattern);
$vainfo->get_info();
@ -648,8 +648,35 @@ class Catalog_local extends Catalog
$key = vainfo::get_tag_type($vainfo->tags);
$results = vainfo::clean_tag_info($vainfo->tags, $key, $file);
$results['catalog'] = $this->id;
if (isset($options['user_upload'])) {
$results['user_upload'] = $options['user_upload'];
// Override artist information with artist's user
if (AmpConfig::get('upload_user_artist')) {
$user = new User($options['user_upload']);
if ($user->id) {
$artists = $user->get_artists();
$artist = null;
// No associated artist yet, we create a default one for the user sender
if (count($artists) == 0) {
$artists[] = Artist::check($user->fullname);
$artist = new Artist($artists[0]);
$artist->update_artist_user($user->id);
} else {
$artist = new Artist($artists[0]);
}
$results['artist'] = $artist->name;
$results['mb_artistid'] = $artist->mbid;
}
}
}
if (isset($options['license'])) {
$results['license'] = $options['license'];
}
return Song::insert($results);
}

View file

@ -109,7 +109,7 @@ class getID3
protected $startup_error = '';
protected $startup_warning = '';
const VERSION = '1.10.0-20140319';
const VERSION = '1.9.8-20140511';
const FREAD_BUFFER_SIZE = 32768;
const ATTACHMENTS_NONE = false;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,185 @@
/*
* jQuery Iframe Transport Plugin 1.6.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint unparam: true, nomen: true */
/*global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts three additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
$.ajaxTransport('iframe', function (options) {
if (options.async) {
var form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6.
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
iframe = $(
'<iframe src="javascript:false;" name="iframe-transport-' +
(counter += 1) + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="javascript:false;"></iframe>')
.appendTo(form);
form.remove();
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if (options.formData) {
$.each(options.formData, function (index, field) {
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
return fileInputClones[index];
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
});
}
// Appending the file input fields to the hidden form
// removes them from their original location:
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
// enctype must be set as encoding for IE:
.prop('encoding', 'multipart/form-data');
}
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
if (fileInputClones && fileInputClones.length) {
options.fileInput.each(function (index, input) {
var clone = $(fileInputClones[index]);
$(input).prop('name', clone.prop('name'));
clone.replaceWith(input);
});
}
});
form.append(iframe).appendTo(document.body);
},
abort: function () {
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', 'javascript'.concat(':false;'));
}
if (form) {
form.remove();
}
}
};
}
});
// The iframe transport returns the iframe content document as response.
// The following adds converters from iframe to text, json, html, and script:
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
return iframe && $(iframe[0].body).html();
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));

View file

@ -0,0 +1,661 @@
/*!jQuery Knob*/
/**
* Downward compatible, touchable dial
*
* Version: 1.2.0 (15/07/2012)
* Requires: jQuery v1.7+
*
* Copyright (c) 2012 Anthony Terrien
* Under MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Thanks to vor, eskimoblood, spiffistan, FabrizioC
*/
(function($) {
/**
* Kontrol library
*/
"use strict";
/**
* Definition of globals and core
*/
var k = {}, // kontrol
max = Math.max,
min = Math.min;
k.c = {};
k.c.d = $(document);
k.c.t = function (e) {
return e.originalEvent.touches.length - 1;
};
/**
* Kontrol Object
*
* Definition of an abstract UI control
*
* Each concrete component must call this one.
* <code>
* k.o.call(this);
* </code>
*/
k.o = function () {
var s = this;
this.o = null; // array of options
this.$ = null; // jQuery wrapped element
this.i = null; // mixed HTMLInputElement or array of HTMLInputElement
this.g = null; // 2D graphics context for 'pre-rendering'
this.v = null; // value ; mixed array or integer
this.cv = null; // change value ; not commited value
this.x = 0; // canvas x position
this.y = 0; // canvas y position
this.$c = null; // jQuery canvas element
this.c = null; // rendered canvas context
this.t = 0; // touches index
this.isInit = false;
this.fgColor = null; // main color
this.pColor = null; // previous color
this.dH = null; // draw hook
this.cH = null; // change hook
this.eH = null; // cancel hook
this.rH = null; // release hook
this.run = function () {
var cf = function (e, conf) {
var k;
for (k in conf) {
s.o[k] = conf[k];
}
s.init();
s._configure()
._draw();
};
if(this.$.data('kontroled')) return;
this.$.data('kontroled', true);
this.extend();
this.o = $.extend(
{
// Config
min : this.$.data('min') || 0,
max : this.$.data('max') || 100,
stopper : true,
readOnly : this.$.data('readonly'),
// UI
cursor : (this.$.data('cursor') === true && 30)
|| this.$.data('cursor')
|| 0,
thickness : this.$.data('thickness') || 0.35,
lineCap : this.$.data('linecap') || 'butt',
width : this.$.data('width') || 200,
height : this.$.data('height') || 200,
displayInput : this.$.data('displayinput') == null || this.$.data('displayinput'),
displayPrevious : this.$.data('displayprevious'),
fgColor : this.$.data('fgcolor') || '#87CEEB',
inputColor: this.$.data('inputcolor') || this.$.data('fgcolor') || '#87CEEB',
inline : false,
step : this.$.data('step') || 1,
// Hooks
draw : null, // function () {}
change : null, // function (value) {}
cancel : null, // function () {}
release : null // function (value) {}
}, this.o
);
// routing value
if(this.$.is('fieldset')) {
// fieldset = array of integer
this.v = {};
this.i = this.$.find('input')
this.i.each(function(k) {
var $this = $(this);
s.i[k] = $this;
s.v[k] = $this.val();
$this.bind(
'change'
, function () {
var val = {};
val[k] = $this.val();
s.val(val);
}
);
});
this.$.find('legend').remove();
} else {
// input = integer
this.i = this.$;
this.v = this.$.val();
(this.v == '') && (this.v = this.o.min);
this.$.bind(
'change'
, function () {
s.val(s._validate(s.$.val()));
}
);
}
(!this.o.displayInput) && this.$.hide();
this.$c = $('<canvas width="' +
this.o.width + 'px" height="' +
this.o.height + 'px"></canvas>');
this.c = this.$c[0].getContext("2d");
this.$
.wrap($('<div style="' + (this.o.inline ? 'display:inline;' : '') +
'width:' + this.o.width + 'px;height:' +
this.o.height + 'px;"></div>'))
.before(this.$c);
if (this.v instanceof Object) {
this.cv = {};
this.copy(this.v, this.cv);
} else {
this.cv = this.v;
}
this.$
.bind("configure", cf)
.parent()
.bind("configure", cf);
this._listen()
._configure()
._xy()
.init();
this.isInit = true;
this._draw();
return this;
};
this._draw = function () {
// canvas pre-rendering
var d = true,
c = document.createElement('canvas');
c.width = s.o.width;
c.height = s.o.height;
s.g = c.getContext('2d');
s.clear();
s.dH
&& (d = s.dH());
(d !== false) && s.draw();
s.c.drawImage(c, 0, 0);
c = null;
};
this._touch = function (e) {
var touchMove = function (e) {
var v = s.xy2val(
e.originalEvent.touches[s.t].pageX,
e.originalEvent.touches[s.t].pageY
);
if (v == s.cv) return;
if (
s.cH
&& (s.cH(v) === false)
) return;
s.change(s._validate(v));
s._draw();
};
// get touches index
this.t = k.c.t(e);
// First touch
touchMove(e);
// Touch events listeners
k.c.d
.bind("touchmove.k", touchMove)
.bind(
"touchend.k"
, function () {
k.c.d.unbind('touchmove.k touchend.k');
if (
s.rH
&& (s.rH(s.cv) === false)
) return;
s.val(s.cv);
}
);
return this;
};
this._mouse = function (e) {
var mouseMove = function (e) {
var v = s.xy2val(e.pageX, e.pageY);
if (v == s.cv) return;
if (
s.cH
&& (s.cH(v) === false)
) return;
s.change(s._validate(v));
s._draw();
};
// First click
mouseMove(e);
// Mouse events listeners
k.c.d
.bind("mousemove.k", mouseMove)
.bind(
// Escape key cancel current change
"keyup.k"
, function (e) {
if (e.keyCode === 27) {
k.c.d.unbind("mouseup.k mousemove.k keyup.k");
if (
s.eH
&& (s.eH() === false)
) return;
s.cancel();
}
}
)
.bind(
"mouseup.k"
, function (e) {
k.c.d.unbind('mousemove.k mouseup.k keyup.k');
if (
s.rH
&& (s.rH(s.cv) === false)
) return;
s.val(s.cv);
}
);
return this;
};
this._xy = function () {
var o = this.$c.offset();
this.x = o.left;
this.y = o.top;
return this;
};
this._listen = function () {
if (!this.o.readOnly) {
this.$c
.bind(
"mousedown"
, function (e) {
e.preventDefault();
s._xy()._mouse(e);
}
)
.bind(
"touchstart"
, function (e) {
e.preventDefault();
s._xy()._touch(e);
}
);
this.listen();
} else {
this.$.attr('readonly', 'readonly');
}
return this;
};
this._configure = function () {
// Hooks
if (this.o.draw) this.dH = this.o.draw;
if (this.o.change) this.cH = this.o.change;
if (this.o.cancel) this.eH = this.o.cancel;
if (this.o.release) this.rH = this.o.release;
if (this.o.displayPrevious) {
this.pColor = this.h2rgba(this.o.fgColor, "0.4");
this.fgColor = this.h2rgba(this.o.fgColor, "0.6");
} else {
this.fgColor = this.o.fgColor;
}
return this;
};
this._clear = function () {
this.$c[0].width = this.$c[0].width;
};
this._validate = function(v) {
return (~~ (((v < 0) ? -0.5 : 0.5) + (v/this.o.step))) * this.o.step;
};
// Abstract methods
this.listen = function () {}; // on start, one time
this.extend = function () {}; // each time configure triggered
this.init = function () {}; // each time configure triggered
this.change = function (v) {}; // on change
this.val = function (v) {}; // on release
this.xy2val = function (x, y) {}; //
this.draw = function () {}; // on change / on release
this.clear = function () { this._clear(); };
// Utils
this.h2rgba = function (h, a) {
var rgb;
h = h.substring(1,7)
rgb = [parseInt(h.substring(0,2),16)
,parseInt(h.substring(2,4),16)
,parseInt(h.substring(4,6),16)];
return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + a + ")";
};
this.copy = function (f, t) {
for (var i in f) { t[i] = f[i]; }
};
};
/**
* k.Dial
*/
k.Dial = function () {
k.o.call(this);
this.startAngle = null;
this.xy = null;
this.radius = null;
this.lineWidth = null;
this.cursorExt = null;
this.w2 = null;
this.PI2 = 2*Math.PI;
this.extend = function () {
this.o = $.extend(
{
bgColor : this.$.data('bgcolor') || '#EEEEEE',
angleOffset : this.$.data('angleoffset') || 0,
angleArc : this.$.data('anglearc') || 360,
inline : true
}, this.o
);
};
this.val = function (v) {
if (null != v) {
this.cv = this.o.stopper ? max(min(v, this.o.max), this.o.min) : v;
this.v = this.cv;
this.$.val(this.v);
this._draw();
} else {
return this.v;
}
};
this.xy2val = function (x, y) {
var a, ret;
a = Math.atan2(
x - (this.x + this.w2)
, - (y - this.y - this.w2)
) - this.angleOffset;
if(this.angleArc != this.PI2 && (a < 0) && (a > -0.5)) {
// if isset angleArc option, set to min if .5 under min
a = 0;
} else if (a < 0) {
a += this.PI2;
}
ret = ~~ (0.5 + (a * (this.o.max - this.o.min) / this.angleArc))
+ this.o.min;
this.o.stopper
&& (ret = max(min(ret, this.o.max), this.o.min));
return ret;
};
this.listen = function () {
// bind MouseWheel
var s = this,
mw = function (e) {
e.preventDefault();
var ori = e.originalEvent
,deltaX = ori.detail || ori.wheelDeltaX
,deltaY = ori.detail || ori.wheelDeltaY
,v = parseInt(s.$.val()) + (deltaX>0 || deltaY>0 ? s.o.step : deltaX<0 || deltaY<0 ? -s.o.step : 0);
if (
s.cH
&& (s.cH(v) === false)
) return;
s.val(v);
}
, kval, to, m = 1, kv = {37:-s.o.step, 38:s.o.step, 39:s.o.step, 40:-s.o.step};
this.$
.bind(
"keydown"
,function (e) {
var kc = e.keyCode;
// numpad support
if(kc >= 96 && kc <= 105) {
kc = e.keyCode = kc - 48;
}
kval = parseInt(String.fromCharCode(kc));
if (isNaN(kval)) {
(kc !== 13) // enter
&& (kc !== 8) // bs
&& (kc !== 9) // tab
&& (kc !== 189) // -
&& e.preventDefault();
// arrows
if ($.inArray(kc,[37,38,39,40]) > -1) {
e.preventDefault();
var v = parseInt(s.$.val()) + kv[kc] * m;
s.o.stopper
&& (v = max(min(v, s.o.max), s.o.min));
s.change(v);
s._draw();
// long time keydown speed-up
to = window.setTimeout(
function () { m*=2; }
,30
);
}
}
}
)
.bind(
"keyup"
,function (e) {
if (isNaN(kval)) {
if (to) {
window.clearTimeout(to);
to = null;
m = 1;
s.val(s.$.val());
}
} else {
// kval postcond
(s.$.val() > s.o.max && s.$.val(s.o.max))
|| (s.$.val() < s.o.min && s.$.val(s.o.min));
}
}
);
this.$c.bind("mousewheel DOMMouseScroll", mw);
this.$.bind("mousewheel DOMMouseScroll", mw)
};
this.init = function () {
if (
this.v < this.o.min
|| this.v > this.o.max
) this.v = this.o.min;
this.$.val(this.v);
this.w2 = this.o.width / 2;
this.cursorExt = this.o.cursor / 100;
this.xy = this.w2;
this.lineWidth = this.xy * this.o.thickness;
this.lineCap = this.o.lineCap;
this.radius = this.xy - this.lineWidth / 2;
this.o.angleOffset
&& (this.o.angleOffset = isNaN(this.o.angleOffset) ? 0 : this.o.angleOffset);
this.o.angleArc
&& (this.o.angleArc = isNaN(this.o.angleArc) ? this.PI2 : this.o.angleArc);
// deg to rad
this.angleOffset = this.o.angleOffset * Math.PI / 180;
this.angleArc = this.o.angleArc * Math.PI / 180;
// compute start and end angles
this.startAngle = 1.5 * Math.PI + this.angleOffset;
this.endAngle = 1.5 * Math.PI + this.angleOffset + this.angleArc;
var s = max(
String(Math.abs(this.o.max)).length
, String(Math.abs(this.o.min)).length
, 2
) + 2;
this.o.displayInput
&& this.i.css({
'width' : ((this.o.width / 2 + 4) >> 0) + 'px'
,'height' : ((this.o.width / 3) >> 0) + 'px'
,'position' : 'absolute'
,'vertical-align' : 'middle'
,'margin-top' : ((this.o.width / 3) >> 0) + 'px'
,'margin-left' : '-' + ((this.o.width * 3 / 4 + 2) >> 0) + 'px'
,'border' : 0
,'background' : 'none'
,'font' : 'bold ' + ((this.o.width / s) >> 0) + 'px Arial'
,'text-align' : 'center'
,'color' : this.o.inputColor || this.o.fgColor
,'padding' : '0px'
,'-webkit-appearance': 'none'
})
|| this.i.css({
'width' : '0px'
,'visibility' : 'hidden'
});
};
this.change = function (v) {
this.cv = v;
this.$.val(v);
};
this.angle = function (v) {
return (v - this.o.min) * this.angleArc / (this.o.max - this.o.min);
};
this.draw = function () {
var c = this.g, // context
a = this.angle(this.cv) // Angle
, sat = this.startAngle // Start angle
, eat = sat + a // End angle
, sa, ea // Previous angles
, r = 1;
c.lineWidth = this.lineWidth;
c.lineCap = this.lineCap;
this.o.cursor
&& (sat = eat - this.cursorExt)
&& (eat = eat + this.cursorExt);
c.beginPath();
c.strokeStyle = this.o.bgColor;
c.arc(this.xy, this.xy, this.radius, this.endAngle, this.startAngle, true);
c.stroke();
if (this.o.displayPrevious) {
ea = this.startAngle + this.angle(this.v);
sa = this.startAngle;
this.o.cursor
&& (sa = ea - this.cursorExt)
&& (ea = ea + this.cursorExt);
c.beginPath();
c.strokeStyle = this.pColor;
c.arc(this.xy, this.xy, this.radius, sa, ea, false);
c.stroke();
r = (this.cv == this.v);
}
c.beginPath();
c.strokeStyle = r ? this.o.fgColor : this.fgColor ;
c.arc(this.xy, this.xy, this.radius, sat, eat, false);
c.stroke();
};
this.cancel = function () {
this.val(this.v);
};
};
$.fn.dial = $.fn.knob = function (o) {
return this.each(
function () {
var d = new k.Dial();
d.o = o;
d.$ = $(this);
d.run();
}
).parent();
};
})(jQuery);

5
modules/jstree/jstree.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,952 @@
/* jsTree default theme */
.jstree-node,
.jstree-children,
.jstree-container-ul {
display: block;
margin: 0;
padding: 0;
list-style-type: none;
list-style-image: none;
}
.jstree-node {
white-space: nowrap;
}
.jstree-anchor {
display: inline-block;
color: black;
white-space: nowrap;
padding: 0 4px 0 1px;
margin: 0;
vertical-align: top;
}
.jstree-anchor:focus {
outline: 0;
}
.jstree-anchor,
.jstree-anchor:link,
.jstree-anchor:visited,
.jstree-anchor:hover,
.jstree-anchor:active {
text-decoration: none;
color: inherit;
}
.jstree-icon {
display: inline-block;
text-decoration: none;
margin: 0;
padding: 0;
vertical-align: top;
text-align: center;
}
.jstree-icon:empty {
display: inline-block;
text-decoration: none;
margin: 0;
padding: 0;
vertical-align: top;
text-align: center;
}
.jstree-ocl {
cursor: pointer;
}
.jstree-leaf > .jstree-ocl {
cursor: default;
}
.jstree .jstree-open > .jstree-children {
display: block;
}
.jstree .jstree-closed > .jstree-children,
.jstree .jstree-leaf > .jstree-children {
display: none;
}
.jstree-anchor > .jstree-themeicon {
margin-right: 2px;
}
.jstree-no-icons .jstree-themeicon,
.jstree-anchor > .jstree-themeicon-hidden {
display: none;
}
.jstree-rtl .jstree-anchor {
padding: 0 1px 0 4px;
}
.jstree-rtl .jstree-anchor > .jstree-themeicon {
margin-left: 2px;
margin-right: 0;
}
.jstree-rtl .jstree-node {
margin-left: 0;
}
.jstree-rtl .jstree-container-ul > .jstree-node {
margin-right: 0;
}
.jstree-wholerow-ul {
position: relative;
display: inline-block;
min-width: 100%;
}
.jstree-wholerow-ul .jstree-leaf > .jstree-ocl {
cursor: pointer;
}
.jstree-wholerow-ul .jstree-anchor,
.jstree-wholerow-ul .jstree-icon {
position: relative;
}
.jstree-wholerow-ul .jstree-wholerow {
width: 100%;
cursor: pointer;
position: absolute;
left: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.vakata-context {
display: none;
}
.vakata-context,
.vakata-context ul {
margin: 0;
padding: 2px;
position: absolute;
background: #f5f5f5;
border: 1px solid #979797;
-moz-box-shadow: 5px 5px 4px -4px #666666;
-webkit-box-shadow: 2px 2px 2px #999999;
box-shadow: 2px 2px 2px #999999;
}
.vakata-context ul {
list-style: none;
left: 100%;
margin-top: -2.7em;
margin-left: -4px;
}
.vakata-context .vakata-context-right ul {
left: auto;
right: 100%;
margin-left: auto;
margin-right: -4px;
}
.vakata-context li {
list-style: none;
display: inline;
}
.vakata-context li > a {
display: block;
padding: 0 2em 0 2em;
text-decoration: none;
width: auto;
color: black;
white-space: nowrap;
line-height: 2.4em;
-moz-text-shadow: 1px 1px 0 white;
-webkit-text-shadow: 1px 1px 0 white;
text-shadow: 1px 1px 0 white;
-moz-border-radius: 1px;
-webkit-border-radius: 1px;
border-radius: 1px;
}
.vakata-context li > a:hover {
position: relative;
background-color: #e8eff7;
-moz-box-shadow: 0 0 2px #0a6aa1;
-webkit-box-shadow: 0 0 2px #0a6aa1;
box-shadow: 0 0 2px #0a6aa1;
}
.vakata-context li > a.vakata-context-parent {
background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAIORI4JlrqN1oMSnmmZDQUAOw==");
background-position: right center;
background-repeat: no-repeat;
}
.vakata-context li > a:focus {
outline: 0;
}
.vakata-context .vakata-context-hover > a {
position: relative;
background-color: #e8eff7;
-moz-box-shadow: 0 0 2px #0a6aa1;
-webkit-box-shadow: 0 0 2px #0a6aa1;
box-shadow: 0 0 2px #0a6aa1;
}
.vakata-context .vakata-context-separator a,
.vakata-context .vakata-context-separator a:hover {
background: white;
border: 0;
border-top: 1px solid #e2e3e3;
height: 1px;
min-height: 1px;
max-height: 1px;
padding: 0;
margin: 0 0 0 2.4em;
border-left: 1px solid #e0e0e0;
-moz-text-shadow: 0 0 0 transparent;
-webkit-text-shadow: 0 0 0 transparent;
text-shadow: 0 0 0 transparent;
-moz-box-shadow: 0 0 0 transparent;
-webkit-box-shadow: 0 0 0 transparent;
box-shadow: 0 0 0 transparent;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
}
.vakata-context .vakata-contextmenu-disabled a,
.vakata-context .vakata-contextmenu-disabled a:hover {
color: silver;
background-color: transparent;
border: 0;
box-shadow: 0 0 0;
}
.vakata-context li > a > i {
text-decoration: none;
display: inline-block;
width: 2.4em;
height: 2.4em;
background: transparent;
margin: 0 0 0 -2em;
vertical-align: top;
text-align: center;
line-height: 2.4em
}
.vakata-context li > a > i:empty {
width: 2.4em;
line-height: 2.4em;
}
.vakata-context li > a .vakata-contextmenu-sep {
display: inline-block;
width: 1px;
height: 2.4em;
background: white;
margin: 0 0.5em 0 0;
border-left: 1px solid #e2e3e3;
}
.vakata-context .vakata-contextmenu-shortcut {
font-size: 0.8em;
color: silver;
opacity: 0.5;
display: none;
}
.vakata-context-rtl ul {
left: auto;
right: 100%;
margin-left: auto;
margin-right: -4px;
}
.vakata-context-rtl li > a.vakata-context-parent {
background-image: url("data:image/gif;base64,R0lGODlhCwAHAIAAACgoKP///yH5BAEAAAEALAAAAAALAAcAAAINjI+AC7rWHIsPtmoxLAA7");
background-position: left center;
background-repeat: no-repeat;
}
.vakata-context-rtl .vakata-context-separator > a {
margin: 0 2.4em 0 0;
border-left: 0;
border-right: 1px solid #e2e3e3;
}
.vakata-context-rtl .vakata-context-left ul {
right: auto;
left: 100%;
margin-left: -4px;
margin-right: auto;
}
.vakata-context-rtl li > a > i {
margin: 0 -2em 0 0;
}
.vakata-context-rtl li > a .vakata-contextmenu-sep {
margin: 0 0 0 0.5em;
border-left-color: white;
background: #e2e3e3;
}
#jstree-marker {
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 0;
border-right: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 5px solid;
width: 0;
height: 0;
font-size: 0;
line-height: 0;
}
#jstree-dnd {
line-height: 16px;
margin: 0;
padding: 4px;
}
#jstree-dnd .jstree-icon,
#jstree-dnd .jstree-copy {
display: inline-block;
text-decoration: none;
margin: 0 2px 0 0;
padding: 0;
width: 16px;
height: 16px;
}
#jstree-dnd .jstree-ok {
background: green;
}
#jstree-dnd .jstree-er {
background: red;
}
#jstree-dnd .jstree-copy {
margin: 0 2px 0 2px;
}
.jstree-default .jstree-node,
.jstree-default .jstree-icon {
background-repeat: no-repeat;
background-color: transparent;
}
.jstree-default .jstree-anchor,
.jstree-default .jstree-wholerow {
transition: background-color 0.15s, box-shadow 0.15s;
}
.jstree-default .jstree-hovered {
background: #e7f4f9;
border-radius: 2px;
box-shadow: inset 0 0 1px #ccc;
}
.jstree-default .jstree-clicked {
background: #beebff;
border-radius: 2px;
box-shadow: inset 0 0 1px #999;
}
.jstree-default .jstree-no-icons .jstree-anchor > .jstree-themeicon {
display: none;
}
.jstree-default .jstree-disabled {
background: transparent;
color: #666;
}
.jstree-default .jstree-disabled.jstree-hovered {
background: transparent;
box-shadow: none;
}
.jstree-default .jstree-disabled.jstree-clicked {
background: #efefef;
}
.jstree-default .jstree-disabled > .jstree-icon {
opacity: 0.8;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'jstree-grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#jstree-grayscale");
/* Firefox 10+ */
filter: gray;
/* IE6-9 */
-webkit-filter: grayscale(100%);
/* Chrome 19+ & Safari 6+ */
}
.jstree-default .jstree-search {
font-style: italic;
color: #8b0000;
font-weight: bold;
}
.jstree-default .jstree-no-checkboxes .jstree-checkbox {
display: none !important;
}
.jstree-default.jstree-checkbox-no-clicked .jstree-clicked {
background: transparent;
box-shadow: none;
}
.jstree-default.jstree-checkbox-no-clicked .jstree-clicked.jstree-hovered {
background: #e7f4f9;
}
.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked {
background: transparent;
}
.jstree-default.jstree-checkbox-no-clicked > .jstree-wholerow-ul .jstree-wholerow-clicked.jstree-wholerow-hovered {
background: #e7f4f9;
}
#jstree-dnd.jstree-default .jstree-ok,
#jstree-dnd.jstree-default .jstree-er {
background-image: url("32px.png");
background-repeat: no-repeat;
background-color: transparent;
}
#jstree-dnd.jstree-default i {
background: transparent;
width: 16px;
height: 16px;
}
#jstree-dnd.jstree-default .jstree-ok {
background-position: -9px -71px;
}
#jstree-dnd.jstree-default .jstree-er {
background-position: -39px -71px;
}
.jstree-default > .jstree-striped {
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB/qqA+AAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMNAMM9s3UAAAAXSURBVHjajcEBAQAAAIKg/H/aCQZ70AUBjAATb6YPDgAAAABJRU5ErkJggg==") left top repeat;
}
.jstree-default > .jstree-wholerow-ul .jstree-hovered,
.jstree-default > .jstree-wholerow-ul .jstree-clicked {
background: transparent;
box-shadow: none;
border-radius: 0;
}
.jstree-default .jstree-wholerow {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
.jstree-default .jstree-wholerow-hovered {
background: #e7f4f9;
}
.jstree-default .jstree-wholerow-clicked {
background: #beebff;
background: -moz-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #beebff), color-stop(100%, #a8e4ff));
background: -webkit-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
background: -o-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
background: -ms-linear-gradient(top, #beebff 0%, #a8e4ff 100%);
background: linear-gradient(to bottom, #beebff 0%, #a8e4ff 100%);
/*filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='@color1', endColorstr='@color2',GradientType=0 );*/
}
.jstree-default .jstree-node {
min-height: 24px;
line-height: 24px;
margin-left: 24px;
min-width: 24px;
}
.jstree-default .jstree-anchor {
line-height: 24px;
height: 24px;
}
.jstree-default .jstree-icon {
width: 24px;
height: 24px;
line-height: 24px;
}
.jstree-default .jstree-icon:empty {
width: 24px;
height: 24px;
line-height: 24px;
}
.jstree-default.jstree-rtl .jstree-node {
margin-right: 24px;
}
.jstree-default .jstree-wholerow {
height: 24px;
}
.jstree-default .jstree-node,
.jstree-default .jstree-icon {
background-image: url("32px.png");
}
.jstree-default .jstree-node {
background-position: -292px -4px;
background-repeat: repeat-y;
}
.jstree-default .jstree-last {
background: transparent;
}
.jstree-default .jstree-open > .jstree-ocl {
background-position: -132px -4px;
}
.jstree-default .jstree-closed > .jstree-ocl {
background-position: -100px -4px;
}
.jstree-default .jstree-leaf > .jstree-ocl {
background-position: -68px -4px;
}
.jstree-default .jstree-themeicon {
background-position: -260px -4px;
}
.jstree-default > .jstree-no-dots .jstree-node,
.jstree-default > .jstree-no-dots .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default > .jstree-no-dots .jstree-open > .jstree-ocl {
background-position: -36px -4px;
}
.jstree-default > .jstree-no-dots .jstree-closed > .jstree-ocl {
background-position: -4px -4px;
}
.jstree-default .jstree-disabled {
background: transparent;
}
.jstree-default .jstree-disabled.jstree-hovered {
background: transparent;
}
.jstree-default .jstree-disabled.jstree-clicked {
background: #efefef;
}
.jstree-default .jstree-checkbox {
background-position: -164px -4px;
}
.jstree-default .jstree-checkbox:hover {
background-position: -164px -36px;
}
.jstree-default .jstree-clicked > .jstree-checkbox {
background-position: -228px -4px;
}
.jstree-default .jstree-clicked > .jstree-checkbox:hover {
background-position: -228px -36px;
}
.jstree-default .jstree-anchor > .jstree-undetermined {
background-position: -196px -4px;
}
.jstree-default .jstree-anchor > .jstree-undetermined:hover {
background-position: -196px -36px;
}
.jstree-default > .jstree-striped {
background-size: auto 48px;
}
.jstree-default.jstree-rtl .jstree-node {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
background-position: 100% 1px;
background-repeat: repeat-y;
}
.jstree-default.jstree-rtl .jstree-last {
background: transparent;
}
.jstree-default.jstree-rtl .jstree-open > .jstree-ocl {
background-position: -132px -36px;
}
.jstree-default.jstree-rtl .jstree-closed > .jstree-ocl {
background-position: -100px -36px;
}
.jstree-default.jstree-rtl .jstree-leaf > .jstree-ocl {
background-position: -68px -36px;
}
.jstree-default.jstree-rtl > .jstree-no-dots .jstree-node,
.jstree-default.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl {
background-position: -36px -36px;
}
.jstree-default.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl {
background-position: -4px -36px;
}
.jstree-default .jstree-themeicon-custom {
background-color: transparent;
background-image: none;
background-position: 0 0;
}
.jstree-default > .jstree-container-ul .jstree-loading > .jstree-ocl {
background: url("throbber.gif") center center no-repeat;
}
.jstree-default .jstree-file {
background: url("32px.png") -100px -68px no-repeat;
}
.jstree-default .jstree-folder {
background: url("32px.png") -260px -4px no-repeat;
}
.jstree-default.jstree-rtl .jstree-node {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
}
.jstree-default.jstree-rtl .jstree-last {
background: transparent;
}
.jstree-default-small .jstree-node {
min-height: 18px;
line-height: 18px;
margin-left: 18px;
min-width: 18px;
}
.jstree-default-small .jstree-anchor {
line-height: 18px;
height: 18px;
}
.jstree-default-small .jstree-icon {
width: 18px;
height: 18px;
line-height: 18px;
}
.jstree-default-small .jstree-icon:empty {
width: 18px;
height: 18px;
line-height: 18px;
}
.jstree-default-small.jstree-rtl .jstree-node {
margin-right: 18px;
}
.jstree-default-small .jstree-wholerow {
height: 18px;
}
.jstree-default-small .jstree-node,
.jstree-default-small .jstree-icon {
background-image: url("32px.png");
}
.jstree-default-small .jstree-node {
background-position: -295px -7px;
background-repeat: repeat-y;
}
.jstree-default-small .jstree-last {
background: transparent;
}
.jstree-default-small .jstree-open > .jstree-ocl {
background-position: -135px -7px;
}
.jstree-default-small .jstree-closed > .jstree-ocl {
background-position: -103px -7px;
}
.jstree-default-small .jstree-leaf > .jstree-ocl {
background-position: -71px -7px;
}
.jstree-default-small .jstree-themeicon {
background-position: -263px -7px;
}
.jstree-default-small > .jstree-no-dots .jstree-node,
.jstree-default-small > .jstree-no-dots .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default-small > .jstree-no-dots .jstree-open > .jstree-ocl {
background-position: -39px -7px;
}
.jstree-default-small > .jstree-no-dots .jstree-closed > .jstree-ocl {
background-position: -7px -7px;
}
.jstree-default-small .jstree-disabled {
background: transparent;
}
.jstree-default-small .jstree-disabled.jstree-hovered {
background: transparent;
}
.jstree-default-small .jstree-disabled.jstree-clicked {
background: #efefef;
}
.jstree-default-small .jstree-checkbox {
background-position: -167px -7px;
}
.jstree-default-small .jstree-checkbox:hover {
background-position: -167px -39px;
}
.jstree-default-small .jstree-clicked > .jstree-checkbox {
background-position: -231px -7px;
}
.jstree-default-small .jstree-clicked > .jstree-checkbox:hover {
background-position: -231px -39px;
}
.jstree-default-small .jstree-anchor > .jstree-undetermined {
background-position: -199px -7px;
}
.jstree-default-small .jstree-anchor > .jstree-undetermined:hover {
background-position: -199px -39px;
}
.jstree-default-small > .jstree-striped {
background-size: auto 36px;
}
.jstree-default-small.jstree-rtl .jstree-node {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
background-position: 100% 1px;
background-repeat: repeat-y;
}
.jstree-default-small.jstree-rtl .jstree-last {
background: transparent;
}
.jstree-default-small.jstree-rtl .jstree-open > .jstree-ocl {
background-position: -135px -39px;
}
.jstree-default-small.jstree-rtl .jstree-closed > .jstree-ocl {
background-position: -103px -39px;
}
.jstree-default-small.jstree-rtl .jstree-leaf > .jstree-ocl {
background-position: -71px -39px;
}
.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-node,
.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl {
background-position: -39px -39px;
}
.jstree-default-small.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl {
background-position: -7px -39px;
}
.jstree-default-small .jstree-themeicon-custom {
background-color: transparent;
background-image: none;
background-position: 0 0;
}
.jstree-default-small > .jstree-container-ul .jstree-loading > .jstree-ocl {
background: url("throbber.gif") center center no-repeat;
}
.jstree-default-small .jstree-file {
background: url("32px.png") -103px -71px no-repeat;
}
.jstree-default-small .jstree-folder {
background: url("32px.png") -263px -7px no-repeat;
}
.jstree-default-small.jstree-rtl .jstree-node {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAACAQMAAABv1h6PAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMHBgAAiABBI4gz9AAAAABJRU5ErkJggg==");
}
.jstree-default-small.jstree-rtl .jstree-last {
background: transparent;
}
.jstree-default-large .jstree-node {
min-height: 32px;
line-height: 32px;
margin-left: 32px;
min-width: 32px;
}
.jstree-default-large .jstree-anchor {
line-height: 32px;
height: 32px;
}
.jstree-default-large .jstree-icon {
width: 32px;
height: 32px;
line-height: 32px;
}
.jstree-default-large .jstree-icon:empty {
width: 32px;
height: 32px;
line-height: 32px;
}
.jstree-default-large.jstree-rtl .jstree-node {
margin-right: 32px;
}
.jstree-default-large .jstree-wholerow {
height: 32px;
}
.jstree-default-large .jstree-node,
.jstree-default-large .jstree-icon {
background-image: url("32px.png");
}
.jstree-default-large .jstree-node {
background-position: -288px 0px;
background-repeat: repeat-y;
}
.jstree-default-large .jstree-last {
background: transparent;
}
.jstree-default-large .jstree-open > .jstree-ocl {
background-position: -128px 0px;
}
.jstree-default-large .jstree-closed > .jstree-ocl {
background-position: -96px 0px;
}
.jstree-default-large .jstree-leaf > .jstree-ocl {
background-position: -64px 0px;
}
.jstree-default-large .jstree-themeicon {
background-position: -256px 0px;
}
.jstree-default-large > .jstree-no-dots .jstree-node,
.jstree-default-large > .jstree-no-dots .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default-large > .jstree-no-dots .jstree-open > .jstree-ocl {
background-position: -32px 0px;
}
.jstree-default-large > .jstree-no-dots .jstree-closed > .jstree-ocl {
background-position: 0px 0px;
}
.jstree-default-large .jstree-disabled {
background: transparent;
}
.jstree-default-large .jstree-disabled.jstree-hovered {
background: transparent;
}
.jstree-default-large .jstree-disabled.jstree-clicked {
background: #efefef;
}
.jstree-default-large .jstree-checkbox {
background-position: -160px 0px;
}
.jstree-default-large .jstree-checkbox:hover {
background-position: -160px -32px;
}
.jstree-default-large .jstree-clicked > .jstree-checkbox {
background-position: -224px 0px;
}
.jstree-default-large .jstree-clicked > .jstree-checkbox:hover {
background-position: -224px -32px;
}
.jstree-default-large .jstree-anchor > .jstree-undetermined {
background-position: -192px 0px;
}
.jstree-default-large .jstree-anchor > .jstree-undetermined:hover {
background-position: -192px -32px;
}
.jstree-default-large > .jstree-striped {
background-size: auto 64px;
}
.jstree-default-large.jstree-rtl .jstree-node {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAACAQMAAAB49I5GAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjAAMOBgAAGAAJMwQHdQAAAABJRU5ErkJggg==");
background-position: 100% 1px;
background-repeat: repeat-y;
}
.jstree-default-large.jstree-rtl .jstree-last {
background: transparent;
}
.jstree-default-large.jstree-rtl .jstree-open > .jstree-ocl {
background-position: -128px -32px;
}
.jstree-default-large.jstree-rtl .jstree-closed > .jstree-ocl {
background-position: -96px -32px;
}
.jstree-default-large.jstree-rtl .jstree-leaf > .jstree-ocl {
background-position: -64px -32px;
}
.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-node,
.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-open > .jstree-ocl {
background-position: -32px -32px;
}
.jstree-default-large.jstree-rtl > .jstree-no-dots .jstree-closed > .jstree-ocl {
background-position: 0px -32px;
}
.jstree-default-large .jstree-themeicon-custom {
background-color: transparent;
background-image: none;
background-position: 0 0;
}
.jstree-default-large > .jstree-container-ul .jstree-loading > .jstree-ocl {
background: url("throbber.gif") center center no-repeat;
}
.jstree-default-large .jstree-file {
background: url("32px.png") -96px -64px no-repeat;
}
.jstree-default-large .jstree-folder {
background: url("32px.png") -256px 0px no-repeat;
}
.jstree-default-large.jstree-rtl .jstree-node {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAACAQMAAAAD0EyKAAAABlBMVEUAAAAdHRvEkCwcAAAAAXRSTlMAQObYZgAAAAxJREFUCNdjgIIGBgABCgCBvVLXcAAAAABJRU5ErkJggg==");
}
.jstree-default-large.jstree-rtl .jstree-last {
background: transparent;
}
@media (max-width: 768px) {
.jstree-default-responsive {
/*
.jstree-open > .jstree-ocl,
.jstree-closed > .jstree-ocl { border-radius:20px; background-color:white; }
*/
}
.jstree-default-responsive .jstree-icon {
background-image: url("40px.png");
}
.jstree-default-responsive .jstree-node,
.jstree-default-responsive .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default-responsive .jstree-node {
min-height: 40px;
line-height: 40px;
margin-left: 40px;
min-width: 40px;
white-space: nowrap;
}
.jstree-default-responsive .jstree-anchor {
line-height: 40px;
height: 40px;
}
.jstree-default-responsive .jstree-icon,
.jstree-default-responsive .jstree-icon:empty {
width: 40px;
height: 40px;
line-height: 40px;
}
.jstree-default-responsive > .jstree-container-ul > .jstree-node {
margin-left: 0;
}
.jstree-default-responsive.jstree-rtl .jstree-node {
margin-left: 0;
margin-right: 40px;
}
.jstree-default-responsive.jstree-rtl .jstree-container-ul > .jstree-node {
margin-right: 0;
}
.jstree-default-responsive .jstree-ocl,
.jstree-default-responsive .jstree-themeicon,
.jstree-default-responsive .jstree-checkbox {
background-size: 120px 200px;
}
.jstree-default-responsive .jstree-leaf > .jstree-ocl {
background: transparent;
}
.jstree-default-responsive .jstree-open > .jstree-ocl {
background-position: 0 0px !important;
}
.jstree-default-responsive .jstree-closed > .jstree-ocl {
background-position: 0 -40px !important;
}
.jstree-default-responsive.jstree-rtl .jstree-closed > .jstree-ocl {
background-position: -40px 0px !important;
}
.jstree-default-responsive .jstree-themeicon {
background-position: -40px -40px;
}
.jstree-default-responsive .jstree-checkbox,
.jstree-default-responsive .jstree-checkbox:hover {
background-position: -40px -80px;
}
.jstree-default-responsive .jstree-clicked > .jstree-checkbox,
.jstree-default-responsive .jstree-clicked > .jstree-checkbox:hover {
background-position: 0 -80px;
}
.jstree-default-responsive .jstree-anchor > .jstree-undetermined,
.jstree-default-responsive .jstree-anchor > .jstree-undetermined:hover {
background-position: 0 -120px;
}
.jstree-default-responsive .jstree-anchor {
font-weight: bold;
font-size: 1.1em;
text-shadow: 1px 1px white;
}
.jstree-default-responsive > .jstree-striped {
background: transparent;
}
.jstree-default-responsive .jstree-wholerow {
border-top: 1px solid rgba(255, 255, 255, 0.7);
border-bottom: 1px solid rgba(64, 64, 64, 0.2);
background: #ebebeb;
height: 40px;
}
.jstree-default-responsive .jstree-wholerow-hovered {
background: #e7f4f9;
}
.jstree-default-responsive .jstree-wholerow-clicked {
background: #beebff;
}
.jstree-default-responsive .jstree-children .jstree-last > .jstree-wholerow {
box-shadow: inset 0 -6px 3px -5px #666666;
}
.jstree-default-responsive .jstree-children .jstree-open > .jstree-wholerow {
box-shadow: inset 0 6px 3px -5px #666666;
border-top: 0;
}
.jstree-default-responsive .jstree-children .jstree-open + .jstree-open {
box-shadow: none;
}
.jstree-default-responsive .jstree-node,
.jstree-default-responsive .jstree-icon,
.jstree-default-responsive .jstree-node > .jstree-ocl,
.jstree-default-responsive .jstree-themeicon,
.jstree-default-responsive .jstree-checkbox {
background-image: url("40px.png");
background-size: 120px 200px;
}
.jstree-default-responsive .jstree-node {
background-position: -80px 0;
background-repeat: repeat-y;
}
.jstree-default-responsive .jstree-last {
background: transparent;
}
.jstree-default-responsive .jstree-leaf > .jstree-ocl {
background-position: -40px -120px;
}
.jstree-default-responsive .jstree-last > .jstree-ocl {
background-position: -40px -160px;
}
.jstree-default-responsive .jstree-themeicon-custom {
background-color: transparent;
background-image: none;
background-position: 0 0;
}
.jstree-default-responsive .jstree-file {
background: url("40px.png") 0 -160px no-repeat;
background-size: 120px 200px;
}
.jstree-default-responsive .jstree-folder {
background: url("40px.png") -40px -40px no-repeat;
background-size: 120px 200px;
}
}
.jstree-default > .jstree-container-ul > .jstree-node {
margin-left: 0;
margin-right: 0;
}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -94,6 +94,7 @@ switch ($_REQUEST['action']) {
}
$level = '50';
$levelok = false;
if ($_POST['type'] == 'playlist_row' || $_POST['type'] == 'playlist_title') {
$playlist = new Playlist($_POST['id']);
@ -109,8 +110,17 @@ switch ($_REQUEST['action']) {
}
}
if ($_POST['type'] == 'song_row') {
$song = new Song($_POST['id']);
if ($song->user_upload == $GLOBALS['user']->id && AmpConfig::get('upload_allow_edit') && !Access::check('interface','75')) {
if (isset($_POST['artist'])) unset($_POST['artist']);
if (isset($_POST['album'])) unset($_POST['album']);
$levelok = true;
}
}
// Make sure we've got them rights
if (!Access::check('interface', $level) || AmpConfig::get('demo_mode')) {
if (!$levelok && (!Access::check('interface', $level) || AmpConfig::get('demo_mode'))) {
$results['rfc3514'] = '0x1';
break;
}
@ -139,9 +149,10 @@ switch ($_REQUEST['action']) {
break;
case 'song_row':
$key = 'song_' . $_POST['id'];
$song = new Song($_POST['id']);
$song->update($_POST);
$song->format();
if (isset($song)) {
$song->update($_POST);
$song->format();
}
break;
case 'playlist_row':
case 'playlist_title':

262
server/fs.ajax.php Normal file
View file

@ -0,0 +1,262 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
// jsTree file system browser
define('AJAX_INCLUDE','1');
require_once '../lib/init.php';
$rootdir = Upload::get_root(). DIRECTORY_SEPARATOR;
ini_set('open_basedir', $rootdir);
class fs
{
protected $base = null;
protected function real($path)
{
$temp = realpath($path);
if (!$temp) { throw new Exception('Path does not exist: ' . $path); }
if ($this->base && strlen($this->base)) {
if (strpos($temp, $this->base) !== 0) { throw new Exception('Path is not inside base ('.$this->base.'): ' . $temp); }
}
return $temp;
}
protected function path($id)
{
$id = str_replace('/', DIRECTORY_SEPARATOR, $id);
$id = trim($id, DIRECTORY_SEPARATOR);
$id = $this->real($this->base . DIRECTORY_SEPARATOR . $id);
return $id;
}
protected function id($path)
{
$path = $this->real($path);
$path = substr($path, strlen($this->base));
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
$path = trim($path, '/');
return strlen($path) ? $path : '/';
}
public function __construct($base)
{
$this->base = $this->real($base);
if (!$this->base) { throw new Exception('Base directory does not exist'); }
}
public function lst($id, $with_root = false)
{
$dir = $this->path($id);
$lst = @scandir($dir);
if (!$lst) { throw new Exception('Could not list path: ' . $dir); }
$res = array();
foreach ($lst as $item) {
if ($item == '.' || $item == '..' || $item === null) { continue; }
$tmp = preg_match('([^ a-zа-я-_0-9.]+)ui', $item);
if ($tmp === false || $tmp === 1) { continue; }
if (is_dir($dir . DIRECTORY_SEPARATOR . $item)) {
$res[] = array('text' => $item, 'children' => true, 'id' => $this->id($dir . DIRECTORY_SEPARATOR . $item), 'icon' => 'folder');
} else {
//$res[] = array('text' => $item, 'children' => false, 'id' => $this->id($dir . DIRECTORY_SEPARATOR . $item), 'type' => 'file', 'icon' => 'file file-'.substr($item, strrpos($item,'.') + 1));
}
}
if ($with_root && $this->id($dir) === '/') {
$res = array(array('text' => basename($this->base), 'children' => $res, 'id' => '/', 'icon'=>'folder', 'state' => array('opened' => true, 'disabled' => true)));
}
return $res;
}
public function data($id)
{
if (strpos($id, ":")) {
$id = array_map(array($this, 'id'), explode(':', $id));
return array('type'=>'multiple', 'content'=> 'Multiple selected: ' . implode(' ', $id));
}
$dir = $this->path($id);
if (is_dir($dir)) {
return array('type'=>'folder', 'content'=> $id);
}
if (is_file($dir)) {
$ext = strpos($dir, '.') !== FALSE ? substr($dir, strrpos($dir, '.') + 1) : '';
$dat = array('type' => $ext, 'content' => '');
switch ($ext) {
/*case 'txt':
case 'text':
case 'md':
case 'js':
case 'json':
case 'css':
case 'html':
case 'htm':
case 'xml':
case 'c':
case 'cpp':
case 'h':
case 'sql':
case 'log':
case 'py':
case 'rb':
case 'htaccess':
case 'php':
$dat['content'] = file_get_contents($dir);
break;
case 'jpg':
case 'jpeg':
case 'gif':
case 'png':
case 'bmp':
$dat['content'] = 'data:'.finfo_file(finfo_open(FILEINFO_MIME_TYPE), $dir).';base64,'.base64_encode(file_get_contents($dir));
break;*/
default:
$dat['content'] = 'File not recognized: '.$this->id($dir);
break;
}
return $dat;
}
throw new Exception('Not a valid selection: ' . $dir);
}
public function create($id, $name, $mkdir = false)
{
$dir = $this->path($id);
if (preg_match('([^ a-zа-я-_0-9.]+)ui', $name) || !strlen($name)) {
throw new Exception('Invalid name: ' . $name);
}
if ($mkdir) {
mkdir($dir . DIRECTORY_SEPARATOR . $name);
} else {
file_put_contents($dir . DIRECTORY_SEPARATOR . $name, '');
}
return array('id' => $this->id($dir . DIRECTORY_SEPARATOR . $name));
}
public function rename($id, $name)
{
$dir = $this->path($id);
if ($dir === $this->base) {
throw new Exception('Cannot rename root');
}
if (preg_match('([^ a-zа-я-_0-9.]+)ui', $name) || !strlen($name)) {
throw new Exception('Invalid name: ' . $name);
}
$new = explode(DIRECTORY_SEPARATOR, $dir);
array_pop($new);
array_push($new, $name);
$new = implode(DIRECTORY_SEPARATOR, $new);
if (is_file($new) || is_dir($new)) { throw new Exception('Path already exists: ' . $new); }
rename($dir, $new);
return array('id' => $this->id($new));
}
public function remove($id)
{
$dir = $this->path($id);
if ($dir === $this->base) {
throw new Exception('Cannot remove root');
}
if (is_dir($dir)) {
foreach (array_diff(scandir($dir), array(".", "..")) as $f) {
$this->remove($this->id($dir . DIRECTORY_SEPARATOR . $f));
}
rmdir($dir);
}
if (is_file($dir)) {
unlink($dir);
}
return array('status' => 'OK');
}
public function move($id, $par)
{
$dir = $this->path($id);
$par = $this->path($par);
$new = explode(DIRECTORY_SEPARATOR, $dir);
$new = array_pop($new);
$new = $par . DIRECTORY_SEPARATOR . $new;
rename($dir, $new);
return array('id' => $this->id($new));
}
public function copy($id, $par)
{
$dir = $this->path($id);
$par = $this->path($par);
$new = explode(DIRECTORY_SEPARATOR, $dir);
$new = array_pop($new);
$new = $par . DIRECTORY_SEPARATOR . $new;
if (is_file($new) || is_dir($new)) { throw new Exception('Path already exists: ' . $new); }
if (is_dir($dir)) {
mkdir($new);
foreach (array_diff(scandir($dir), array(".", "..")) as $f) {
$this->copy($this->id($dir . DIRECTORY_SEPARATOR . $f), $this->id($new));
}
}
if (is_file($dir)) {
copy($dir, $new);
}
return array('id' => $this->id($new));
}
}
if (isset($_GET['operation'])) {
$fs = new fs($rootdir);
try {
$rslt = null;
switch ($_GET['operation']) {
case 'get_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$rslt = $fs->lst($node, (isset($_GET['id']) && $_GET['id'] === '#'));
break;
case "get_content":
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$rslt = $fs->data($node);
break;
case 'create_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$rslt = $fs->create($node, isset($_GET['text']) ? $_GET['text'] : '', (!isset($_GET['type']) || $_GET['type'] !== 'file'));
break;
case 'rename_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$rslt = $fs->rename($node, isset($_GET['text']) ? $_GET['text'] : '');
break;
case 'delete_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$rslt = $fs->remove($node);
break;
case 'move_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
$rslt = $fs->move($node, $parn);
break;
case 'copy_node':
$node = isset($_GET['id']) && $_GET['id'] !== '#' ? $_GET['id'] : '/';
$parn = isset($_GET['parent']) && $_GET['parent'] !== '#' ? $_GET['parent'] : '/';
$rslt = $fs->copy($node, $parn);
break;
default:
throw new Exception('Unsupported operation: ' . $_GET['operation']);
break;
}
header('Content-Type: application/json; charset=utf8');
echo json_encode($rslt);
} catch (Exception $e) {
header($_SERVER["SERVER_PROTOCOL"] . ' 500 Server Error');
header('Status: 500 Server Error');
echo $e->getMessage();
}
die();
}

View file

@ -36,6 +36,7 @@ debug_event('show_edit.server.php', 'Called for action: {'.$_REQUEST['action'].'
switch ($_REQUEST['action']) {
case 'show_edit_object':
$level = '50';
$levelok = false;
switch ($_GET['type']) {
case 'album_row':
$album = new Album($_GET['id']);
@ -48,6 +49,10 @@ switch ($_REQUEST['action']) {
case 'song_row':
$song = new Song($_GET['id']);
$song->format();
if ($song->user_upload == $GLOBALS['user']->id && AmpConfig::get('upload_allow_edit')) {
$levelok = true;
}
break;
case 'live_stream_row':
$radio = new Radio($_GET['id']);
@ -86,7 +91,7 @@ switch ($_REQUEST['action']) {
} // end switch on type
// Make sure they got them rights
if (!Access::check('interface', $level)) {
if (!$levelok && !Access::check('interface', $level)) {
break;
}

View file

@ -54,6 +54,9 @@ switch ($_REQUEST['action']) {
case 'share':
require_once AmpConfig::get('prefix') . '/templates/show_shares.inc.php';
break;
case 'upload':
require_once AmpConfig::get('prefix') . '/templates/show_uploads.inc.php';
break;
case 'show':
default:
require_once AmpConfig::get('prefix') . '/templates/show_stats.inc.php';

View file

@ -41,6 +41,8 @@ $location = get_location();
<?php require_once AmpConfig::get('prefix') . '/templates/stylesheets.inc.php'; ?>
<link rel="stylesheet" href="<?php echo $web_path; ?>/templates/jquery-editdialog.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/modules/jquery-ui/jquery-ui.min.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/templates/jquery-file-upload.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/modules/jstree/themes/default/style.min.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/modules/tag-it/jquery.tagit.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/modules/rhinoslider/css/rhinoslider-1.05.css" type="text/css" media="screen" />
<link rel="stylesheet" href="<?php echo $web_path; ?>/modules/jquery-mediaTable/jquery.mediaTable.css" type="text/css" media="screen" />
@ -55,6 +57,9 @@ $location = get_location();
<script src="<?php echo $web_path; ?>/modules/rhinoslider/js/rhinoslider-1.05.min.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/responsive-elements/responsive-elements.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/jquery-mediaTable/jquery.mediaTable.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/jquery/jquery.knob.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/jquery-file-upload/jquery.iframe-transport.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/modules/jquery-file-upload/jquery.fileupload.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/lib/javascript/base.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/lib/javascript/ajax.js" language="javascript" type="text/javascript"></script>
<script src="<?php echo $web_path; ?>/lib/javascript/tools.js" language="javascript" type="text/javascript"></script>

View file

@ -0,0 +1,120 @@
/*----------------------------
The file upload form
http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/
-----------------------------*/
#dropfile{
background-color: #2E3134;
padding: 40px 50px;
margin-bottom: 30px;
border: 20px solid rgba(0, 0, 0, 0);
border-radius: 3px;
border-image: url('../images/fileupload-border.png') 25 repeat;
text-align: center;
text-transform: uppercase;
font-size:16px;
font-weight:bold;
color:#7f858a;
}
#dropfile a{
background-color:#007a96;
padding:12px 26px;
color:#fff;
font-size:14px;
border-radius:2px;
cursor:pointer;
display:inline-block;
margin-top:12px;
line-height:1;
}
#dropfile a:hover{
background-color:#0986a3;
}
#dropfile input{
display:none;
}
#uploadfile ul{
list-style:none;
margin:0 -30px;
border-top:1px solid #2b2e31;
border-bottom:1px solid #3d4043;
}
#uploadfile ul li{
background-color:#333639;
background-image:-webkit-linear-gradient(top, #333639, #303335);
background-image:-moz-linear-gradient(top, #333639, #303335);
background-image:linear-gradient(top, #333639, #303335);
border-top:1px solid #3d4043;
border-bottom:1px solid #2b2e31;
padding:15px;
height: 52px;
position: relative;
}
#uploadfile ul li input{
display: none;
}
#uploadfile ul li p{
width: 144px;
overflow: hidden;
white-space: nowrap;
color: #EEE;
font-size: 16px;
font-weight: bold;
position: absolute;
top: 20px;
left: 100px;
}
#uploadfile ul li i{
font-weight: normal;
font-style:normal;
color:#7f7f7f;
display:block;
}
#uploadfile ul li canvas{
top: 15px;
left: 32px;
position: absolute;
}
#uploadfile ul li span{
width: 15px;
height: 12px;
background: url('../images/fileupload-icons.png') no-repeat;
position: absolute;
top: 34px;
right: 33px;
cursor:pointer;
}
#uploadfile ul li.working span{
height: 16px;
background-position: 0 -12px;
}
#uploadfile ul li.error p{
color:red;
}
/*----------------------------
The file tree
-----------------------------*/
#container { min-width:620px; margin:0px auto 0 auto; border-radius:0px; padding:0px; overflow:hidden; }
#tree { float:right; min-width:600px; border-right:1px solid silver; overflow:auto; padding:0px 0; }
#data { float:left; }
#data textarea { margin:0; padding:0; height:100%; width:100%; border:0; display:block; line-height:18px; resize:none; }

View file

@ -0,0 +1,289 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
// Upload form from http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/
?>
<?php
UI::show_box_top(T_('Upload'));
$ajaxfs = AmpConfig::get('ajax_server') . '/fs.ajax.php';
?>
<div id="container" role="main">
<div id="tree"></div>
<div id="data">
<div class="treecontent code" style="display:none;"><textarea id="code" readonly="readonly"></textarea></div>
<div class="treecontent folder" style="display:none;"></div>
<div class="treecontent image" style="display:none; position:relative;"><img src="" alt="" style="display:block; position:absolute; left:50%; top:50%; padding:0; max-height:90%; max-width:90%;" /></div>
<div class="treecontent default" style="text-align:center;"><?php echo T_('Target folder'); ?></div>
</div>
</div>
<script src="<?php echo AmpConfig::get('web_path'); ?>/modules/jstree/jstree.min.js"></script>
<script>
$(window).resize(function () {
var h = Math.max($(window).height() - 0, 420);
$('#container, #data, #tree, #data .treecontent').height(100).filter('.default').css('lineHeight', '100px');
}).resize();
$(function () {
$('#tree')
.jstree({
'core' : {
'data' : {
'url' : '<?php echo $ajaxfs; ?>?operation=get_node',
'data' : function (node) {
return { 'id' : node.id };
}
},
'check_callback' : function(o, n, p, i, m) {
if (m && m.dnd && m.pos !== 'i') { return false; }
if (o === "move_node" || o === "copy_node") {
if (this.get_node(n).parent === this.get_node(p).id) { return false; }
}
return true;
},
'themes' : {
'responsive' : false,
'variant' : 'small',
'stripes' : true
}
},
'sort' : function(a, b) {
return this.get_type(a) === this.get_type(b) ? (this.get_text(a) > this.get_text(b) ? 1 : -1) : (this.get_type(a) >= this.get_type(b) ? 1 : -1);
},
'contextmenu' : {
'items' : function(node) {
var tmp = $.jstree.defaults.contextmenu.items();
delete tmp.create.action;
tmp.create.label = "New";
tmp.create.submenu = {
"create_folder" : {
"separator_after" : true,
"label" : "Folder",
"action" : function (data) {
var inst = $.jstree.reference(data.reference),
obj = inst.get_node(data.reference);
inst.create_node(obj, { type : "default", text : "New folder" }, "last", function (new_node) {
setTimeout(function () { inst.edit(new_node); },0);
});
}
}
};
if (this.get_type(node) === "file") {
delete tmp.create;
}
return tmp;
}
},
'types' : {
'default' : { 'icon' : 'folder' },
'file' : { 'valid_children' : [], 'icon' : 'file' }
},
'plugins' : ['state','dnd','sort','types','contextmenu','unique']
})
.on('delete_node.jstree', function (e, data) {
$.get('<?php echo $ajaxfs; ?>?operation=delete_node', { 'id' : data.node.id })
.fail(function () {
data.instance.refresh();
});
})
.on('create_node.jstree', function (e, data) {
$.get('<?php echo $ajaxfs; ?>?operation=create_node', { 'type' : data.node.type, 'id' : data.node.parent, 'text' : data.node.text })
.done(function (d) {
data.instance.set_id(data.node, d.id);
})
.fail(function () {
data.instance.refresh();
});
})
.on('rename_node.jstree', function (e, data) {
$.get('<?php echo $ajaxfs; ?>?operation=rename_node', { 'id' : data.node.id, 'text' : data.text })
.done(function (d) {
data.instance.set_id(data.node, d.id);
})
.fail(function () {
data.instance.refresh();
});
})
.on('move_node.jstree', function (e, data) {
$.get('<?php echo $ajaxfs; ?>?operation=move_node', { 'id' : data.node.id, 'parent' : data.parent })
.done(function (d) {
//data.instance.load_node(data.parent);
data.instance.refresh();
})
.fail(function () {
data.instance.refresh();
});
})
.on('copy_node.jstree', function (e, data) {
$.get('<?php echo $ajaxfs; ?>?operation=copy_node', { 'id' : data.original.id, 'parent' : data.parent })
.done(function (d) {
//data.instance.load_node(data.parent);
data.instance.refresh();
})
.fail(function () {
data.instance.refresh();
});
})
.on('changed.jstree', function (e, data) {
if (data && data.selected && data.selected.length) {
$.get('<?php echo $ajaxfs; ?>?operation=get_content&id=' + data.selected.join(':'), function (d) {
if (d && typeof d.type !== 'undefined') {
$('#folder').val(d.content);
}
});
} else {
$('#data .treecontent').hide();
$('#data .default').html('Target Folder').show();
}
});
});
</script>
<form id="uploadfile" method="post" enctype="multipart/form-data" action="<?php echo AmpConfig::get('web_path'); ?>/upload.php">
<input type="hidden" name="actionp" value="upload" />
<input type="hidden" id="folder" name="folder" value="" />
<table class="tabledata" cellpadding="0" cellspacing="0">
<?php if (AmpConfig::get('licensing')) { ?>
<tr>
<td class="edit_dialog_content_header"><?php echo T_('Music License') ?></td>
<td>
<?php show_license_select('license', '', '0'); ?>
<div id="album_select_license_<?php echo $song->license ?>">
<?php echo Ajax::observe('license_select', 'change', 'check_inline_song_edit("license", "0")'); ?>
</div>
</td>
</tr>
<?php } ?>
<tr>
<td><?php echo T_('Files'); ?></td>
<td>
<div id="dropfile">
<?php echo T_('Drop File Here'); ?>
<a><?php echo T_('Browse'); ?></a>
<input type="file" name="upl" multiple />
<ul>
<!-- The file uploads will be shown here -->
</ul>
</div>
</td>
</tr>
</table>
</form>
<script>
$(function(){
var ul = $('#uploadfile ul');
$('#dropfile a').click(function(){
// Simulate a click on the file input button
// to show the file browser dialog
$(this).parent().find('input').click();
});
// Initialize the jQuery File Upload plugin
$('#uploadfile').fileupload({
// This element will accept file drag/drop uploading
dropZone: $('#dropfile'),
// This function is called when a file is added to the queue;
// either via the browse button, or via drag/drop:
add: function (e, data) {
var tpl = $('<li class="working"><input type="text" value="0" data-width="48" data-height="48"'+
' data-fgColor="#0788a5" data-readOnly="1" data-bgColor="#3e4043" /><p></p><span></span></li>');
// Append the file name and file size
tpl.find('p').text(data.files[0].name)
.append('<i>' + formatFileSize(data.files[0].size) + '</i>');
// Add the HTML to the UL element
data.context = tpl.appendTo(ul);
// Initialize the knob plugin
tpl.find('input').knob();
// Listen for clicks on the cancel icon
tpl.find('span').click(function(){
if (tpl.hasClass('working')) {
jqXHR.abort();
}
tpl.fadeOut(function(){
tpl.remove();
});
});
// Automatically upload the file once it is added to the queue
var jqXHR = data.submit();
},
progress: function(e, data){
// Calculate the completion percentage of the upload
var progress = parseInt(data.loaded / data.total * 100, 10);
// Update the hidden input field and trigger a change
// so that the jQuery knob plugin knows to update the dial
data.context.find('input').val(progress).change();
if (progress == 100) {
data.context.removeClass('working');
}
},
fail:function(e, data){
// Something has gone wrong!
data.context.addClass('error');
}
});
// Prevent the default action when a file is dropped on the window
$(document).on('drop dragover', function (e) {
e.preventDefault();
});
// Helper function that formats the file sizes
public function formatFileSize(bytes)
{
if (typeof bytes !== 'number') {
return '';
}
if (bytes >= 1000000000) {
return (bytes / 1000000000).toFixed(2) + ' GB';
}
if (bytes >= 1000000) {
return (bytes / 1000000).toFixed(2) + ' MB';
}
return (bytes / 1000).toFixed(2) + ' KB';
}
});
</script>
<?php UI::show_box_bottom(); ?>

View file

@ -39,7 +39,7 @@
$broadcast = new Broadcast($broadcast_id);
$broadcast->format();
?>
<tr class="<?php echo UI::flip_class(); ?>" id="channel_row_<?php echo $channel->id; ?>">
<tr class="<?php echo UI::flip_class(); ?>" id="broadcast_row_<?php echo $broadcast->id; ?>">
<?php require AmpConfig::get('prefix') . '/templates/show_broadcast_row.inc.php'; ?>
</tr>
<?php } ?>

View file

@ -0,0 +1,48 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
?>
<?php UI::show_box_top(T_('Configure License')); ?>
<form method="post" enctype="multipart/form-data" action="<?php echo AmpConfig::get('web_path'); ?>/admin/license.php?action=edit">
<?php if (isset($license)) { ?>
<input type="hidden" name="license_id" value="<?php echo $license->id; ?>" />
<?php } ?>
<table class="tabledata" cellpadding="0" cellspacing="0">
<tr>
<td class="edit_dialog_content_header"><?php echo T_('Name') ?></td>
<td><input type="text" name="name" value="<?php if (isset($license)) echo $license->name; ?>" /></td>
</tr>
<tr>
<td><?php echo T_('Description:'); ?></td>
<td><textarea rows="5" cols="70" maxlength="140" name="description"><?php if (isset($license)) echo $license->description; ?></textarea></td>
</tr>
<tr>
<td class="edit_dialog_content_header"><?php echo T_('External Link') ?></td>
<td><input type="text" name="external_link" value="<?php if (isset($license)) echo $license->external_link; ?>" /></td>
</tr>
<tr>
<td>
<input type="submit" value="<?php echo T_('Confirm'); ?>" />
</td>
</tr>
</table>
</form>
<?php UI::show_box_bottom(); ?>

View file

@ -27,6 +27,7 @@
<td class="edit_dialog_content_header"><?php echo T_('Title') ?></td>
<td><input type="text" name="title" value="<?php echo scrub_out($song->title); ?>" /></td>
</tr>
<?php if (Access::check('interface','75')) { ?>
<tr>
<td class="edit_dialog_content_header"><?php echo T_('Artist') ?></td>
<td>
@ -45,6 +46,7 @@
</div>
</td>
</tr>
<?php } ?>
<tr>
<td class="edit_dialog_content_header"><?php echo T_('Track') ?></td>
<td><input type="text" name="track" value="<?php echo scrub_out($song->track); ?>" /></td>
@ -59,6 +61,17 @@
<input type="text" name="edit_tags" id="edit_tags" value="<?php echo Tag::get_display($song->tags); ?>" />
</td>
</tr>
<?php if (AmpConfig::get('licensing')) { ?>
<tr>
<td class="edit_dialog_content_header"><?php echo T_('Music License') ?></td>
<td>
<?php show_license_select('license', $song->license, $song->id); ?>
<div id="album_select_license_<?php echo $song->license ?>">
<?php echo Ajax::observe('license_select_'.$song->license, 'change', 'check_inline_song_edit("license", '.$song->id.')'); ?>
</div>
</td>
</tr>
<?php } ?>
</table>
<input type="hidden" name="id" value="<?php echo $song->id; ?>" />
<input type="hidden" name="type" value="song_row" />

View file

@ -0,0 +1,34 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
?>
<tr id="license_<?php echo $license->id; ?>" class="<?php echo UI::flip_class(); ?>">
<td class="cel_name"><?php echo $license->f_link; ?></td>
<td class="cel_description"><?php echo $license->description; ?></td>
<td class="cel_action">
<a href="<?php echo $web_path; ?>/admin/license.php?action=show_edit&license_id=<?php echo $license->id; ?>">
<?php echo UI::get_icon('edit', T_('Edit')); ?>
</a>
<a href="<?php echo $web_path; ?>/admin/license.php?action=delete&license_id=<?php echo $license->id; ?>">
<?php echo UI::get_icon('delete', T_('Delete')); ?>
</a>
</td>
</tr>

View file

@ -0,0 +1,61 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
$web_path = AmpConfig::get('web_path');
?>
<div id="information_actions">
<ul>
<li>
<a href="<?php echo AmpConfig::get('web_path'); ?>/admin/license.php?action=show_create"><?php echo T_('Create new license'); ?></a>
</li>
</ul>
</div>
<table class="tabledata" cellpadding="0" cellspacing="0">
<thead>
<tr class="th-top">
<th class="cel_name"><?php echo T_('Name'); ?></th>
<th class="cel_description"><?php echo T_('Description'); ?></th>
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($object_ids as $license_id) {
$license = new License($license_id);
$license->format();
require AmpConfig::get('prefix') . '/templates/show_license_row.inc.php';
?>
<?php } if (!count($object_ids)) { ?>
<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="6" class="error"><?php echo T_('No Licenses Found'); ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr class="th-bottom">
<th class="cel_name"><?php echo T_('Name'); ?></th>
<th class="cel_description"><?php echo T_('Description'); ?></th>
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
</tfoot>
</table>

View file

@ -23,36 +23,42 @@
$web_path = AmpConfig::get('web_path');
?>
<table class="tabledata" cellpadding="0" cellspacing="0">
<tr class="th-top">
<th class="cel_object"><?php echo T_('Object'); ?></th>
<th class="cel_username"><?php echo T_('User'); ?></th>
<th class="cel_sticky"><?php echo T_('Sticky'); ?></th>
<th class="cel_comment"><?php echo T_('Comment'); ?></th>
<th class="cel_date"><?php echo T_('Date Added'); ?></th>
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
<?php
foreach ($object_ids as $shout_id) {
$shout = new Shoutbox($shout_id);
$shout->format();
$object = Shoutbox::get_object($shout->object_type,$shout->object_id);
$object->format();
$client = new User($shout->user);
$client->format();
<thead>
<tr class="th-top">
<th class="cel_object"><?php echo T_('Object'); ?></th>
<th class="cel_username"><?php echo T_('User'); ?></th>
<th class="cel_sticky"><?php echo T_('Sticky'); ?></th>
<th class="cel_comment"><?php echo T_('Comment'); ?></th>
<th class="cel_date"><?php echo T_('Date Added'); ?></th>
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($object_ids as $shout_id) {
$shout = new Shoutbox($shout_id);
$shout->format();
$object = Shoutbox::get_object($shout->object_type,$shout->object_id);
$object->format();
$client = new User($shout->user);
$client->format();
require AmpConfig::get('prefix') . '/templates/show_shout_row.inc.php';
?>
<?php } if (!count($object_ids)) { ?>
<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="6" class="error"><?php echo T_('No Records Found'); ?></td>
</tr>
<?php } ?>
<tr class="th-bottom">
<th class="cel_object"><?php echo T_('Object'); ?></th>
<th class="cel_username"><?php echo T_('User'); ?></th>
<th class="cel_sticky"><?php echo T_('Sticky'); ?></th>
<th class="cel_comment"><?php echo T_('Comment'); ?></th>
<th class="cel_date"><?php echo T_('Date Added'); ?></th>
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
require AmpConfig::get('prefix') . '/templates/show_shout_row.inc.php';
?>
<?php } if (!count($object_ids)) { ?>
<tr class="<?php echo UI::flip_class(); ?>">
<td colspan="6" class="error"><?php echo T_('No Records Found'); ?></td>
</tr>
<?php } ?>
</tbody>
<tfoot>
<tr class="th-bottom">
<th class="cel_object"><?php echo T_('Object'); ?></th>
<th class="cel_username"><?php echo T_('User'); ?></th>
<th class="cel_sticky"><?php echo T_('Sticky'); ?></th>
<th class="cel_comment"><?php echo T_('Comment'); ?></th>
<th class="cel_date"><?php echo T_('Date Added'); ?></th>
<th class="cel_action"><?php echo T_('Action'); ?></th>
</tr>
</tfoot>
</table>

View file

@ -107,6 +107,14 @@ $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;
}
}
foreach ($songprops as $key => $value) {
if (trim($value)) {
$rowparity = UI::flip_class();

View file

@ -66,7 +66,7 @@
<?php } ?>
<?php if (Access::check_function('download')) { ?>
<a href="<?php echo AmpConfig::get('web_path'); ?>/stream.php?action=download&song_id=<?php echo $song->id; ?>"><?php echo UI::get_icon('download', T_('Download')); ?></a><?php } ?>
<?php if (Access::check('interface','75')) { ?>
<?php if (Access::check('interface','75') || ($song->user_upload == $GLOBALS['user']->id && AmpConfig::get('upload_allow_edit'))) { ?>
<a id="<?php echo 'edit_song_'.$song->id ?>" onclick="showEditDialog('song_row', '<?php echo $song->id ?>', '<?php echo 'edit_song_'.$song->id ?>', '<?php echo T_('Song edit') ?>', 'song_', 'refresh_song')">
<?php echo UI::get_icon('edit', T_('Edit')); ?>
</a>

View file

@ -26,67 +26,74 @@ $catalogs = Catalog::get_catalogs();
<?php UI::show_box_top(T_('Statistics'), 'box box_stats'); ?>
<em><?php echo T_('Catalogs'); ?></em>
<table class="tabledata" cellpadding="3" cellspacing="1">
<tr class="th-top">
<th><?php echo T_('Connected Users'); ?></th>
<th><?php echo T_('Total Users'); ?></th>
<th><?php echo T_('Albums'); ?></th>
<th><?php echo T_('Artists'); ?></th>
<th><?php echo T_('Songs'); ?></th>
<th><?php echo T_('Videos'); ?></th>
<th><?php echo T_('Tags'); ?></th>
<th><?php echo T_('Catalog Size'); ?></th>
<th><?php echo T_('Catalog Time'); ?></th>
</tr>
<tr>
<td><?php echo $stats['connected']; ?></td>
<td><?php echo $stats['users'] ?></td>
<td><?php echo $stats['albums']; ?></td>
<td><?php echo $stats['artists']; ?></td>
<td><?php echo $stats['songs']; ?></td>
<td><?php echo $stats['videos']; ?></td>
<td><?php echo $stats['tags']; ?></td>
<td><?php echo $stats['formatted_size']; ?></td>
<td><?php echo $stats['time_text']; ?></td>
</tr>
<thead>
<tr class="th-top">
<th><?php echo T_('Connected Users'); ?></th>
<th><?php echo T_('Total Users'); ?></th>
<th><?php echo T_('Albums'); ?></th>
<th><?php echo T_('Artists'); ?></th>
<th><?php echo T_('Songs'); ?></th>
<th><?php echo T_('Videos'); ?></th>
<th><?php echo T_('Tags'); ?></th>
<th><?php echo T_('Catalog Size'); ?></th>
<th><?php echo T_('Catalog Time'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $stats['connected']; ?></td>
<td><?php echo $stats['users'] ?></td>
<td><?php echo $stats['albums']; ?></td>
<td><?php echo $stats['artists']; ?></td>
<td><?php echo $stats['songs']; ?></td>
<td><?php echo $stats['videos']; ?></td>
<td><?php echo $stats['tags']; ?></td>
<td><?php echo $stats['formatted_size']; ?></td>
<td><?php echo $stats['time_text']; ?></td>
</tr>
</tbody>
</table>
<hr />
<table class="tabledata" cellpadding="0" cellspacing="0">
<colgroup>
<col id="col_catalog" />
<col id="col_path" />
<col id="col_lastverify" />
<col id="col_lastadd" />
<col id="col_lastclean" />
<col id="col_songs" />
<col id="col_video" />
<col id="col_total" />
</colgroup>
<tr class="th-top">
<th class="cel_catalog"><?php echo T_('Name'); ?></th>
<th class="cel_path"><?php echo T_('Path'); ?></th>
<th class="cel_lastverify"><?php echo T_('Last Verify'); ?></th>
<th class="cel_lastadd"><?php echo T_('Last Add'); ?></th>
<th class="cel_lastclean"><?php echo T_('Last Clean'); ?></th>
<th class="cel_songs"><?php echo T_('Songs'); ?></th>
<th class="cel_video"><?php echo T_('Videos'); ?></th>
<th class="cel_total"><?php echo T_('Catalog Size'); ?></th>
</tr>
<colgroup>
<col id="col_catalog" />
<col id="col_path" />
<col id="col_lastverify" />
<col id="col_lastadd" />
<col id="col_lastclean" />
<col id="col_songs" />
<col id="col_video" />
<col id="col_total" />
</colgroup>
<thead>
<tr class="th-top">
<th class="cel_catalog"><?php echo T_('Name'); ?></th>
<th class="cel_path"><?php echo T_('Path'); ?></th>
<th class="cel_lastverify"><?php echo T_('Last Verify'); ?></th>
<th class="cel_lastadd"><?php echo T_('Last Add'); ?></th>
<th class="cel_lastclean"><?php echo T_('Last Clean'); ?></th>
<th class="cel_songs"><?php echo T_('Songs'); ?></th>
<th class="cel_video"><?php echo T_('Videos'); ?></th>
<th class="cel_total"><?php echo T_('Catalog Size'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($catalogs as $catalog_id) {
$catalog = Catalog::create_from_id($catalog_id);
$catalog->format();
$stats = Catalog::get_stats($catalog_id);
?>
<tr>
<td class="cel_catalog"><?php echo $catalog->name; ?></td>
<td class="cel_path"><?php echo scrub_out($catalog->f_path); ?></td>
<td class="cel_lastverify"><?php echo scrub_out($catalog->f_update); ?></td>
<td class="cel_lastadd"><?php echo scrub_out($catalog->f_add); ?></td>
<td class="cel_lastclean"><?php echo scrub_out($catalog->f_clean); ?></td>
<td class="cel_songs"><?php echo scrub_out($stats['songs']); ?></td>
<td class="cel_video"><?php echo scrub_out($stats['videos']); ?></td>
<td class="cel_total"><?php echo scrub_out($stats['formatted_size']); ?></td>
</tr>
<tr>
<td class="cel_catalog"><?php echo $catalog->name; ?></td>
<td class="cel_path"><?php echo scrub_out($catalog->f_path); ?></td>
<td class="cel_lastverify"><?php echo scrub_out($catalog->f_update); ?></td>
<td class="cel_lastadd"><?php echo scrub_out($catalog->f_add); ?></td>
<td class="cel_lastclean"><?php echo scrub_out($catalog->f_clean); ?></td>
<td class="cel_songs"><?php echo scrub_out($stats['songs']); ?></td>
<td class="cel_video"><?php echo scrub_out($stats['videos']); ?></td>
<td class="cel_total"><?php echo scrub_out($stats['formatted_size']); ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php UI::show_box_bottom(); ?>

View file

@ -0,0 +1,44 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
$sql = Catalog::get_uploads_sql('song', $GLOBALS['user']->id);
$browse = new Browse();
$browse->set_type('song', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Catalog::get_uploads_sql('album', $GLOBALS['user']->id);
$browse = new Browse();
$browse->set_type('album', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
if (!AmpConfig::get('upload_user_artist')) {
$sql = Catalog::get_uploads_sql('artist', $GLOBALS['user']->id);
$browse = new Browse();
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
}

View file

@ -0,0 +1,25 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
?>
<?php UI::show_box_top(T_('Uploads')); ?>
<?php require_once AmpConfig::get('prefix') . '/templates/show_stats_upload.inc.php'; ?>
<?php UI::show_box_bottom(); ?>

View file

@ -48,6 +48,9 @@
<?php if (AmpConfig::get('sociable')) { ?>
<li id="sb_admin_ot_ManageShoutbox"><a href="<?php echo $web_path; ?>/admin/shout.php"><?php echo T_('Manage Shoutbox'); ?></a></li>
<?php } ?>
<?php if (AmpConfig::get('licensing')) { ?>
<li id="sb_admin_ot_ManageLicense"><a href="<?php echo $web_path; ?>/admin/license.php"><?php echo T_('Manage Licenses'); ?></a></li>
<?php } ?>
</ul>
</li>
<?php if (Access::check('interface','100')) { ?>

View file

@ -41,6 +41,9 @@
<?php } ?>
<li id="sb_browse_bb_RadioStation"><a href="<?php echo $web_path; ?>/browse.php?action=live_stream"><?php echo T_('Radio Stations'); ?></a></li>
<li id="sb_browse_bb_Video"><a href="<?php echo $web_path; ?>/browse.php?action=video"><?php echo T_('Videos'); ?></a></li>
<?php if (AmpConfig::get('allow_upload')) { ?>
<li id="sb_browse_bb_Upload"><a href="<?php echo $web_path; ?>/upload.php"><?php echo T_('Upload'); ?></a></li>
<?php } ?>
</ul>
</li>
<?php Ajax::start_container('browse_filters'); ?>
@ -92,6 +95,9 @@
<?php if (AmpConfig::get('share')) { ?>
<li id="sb_home_info_Share"><a href="<?php echo $web_path; ?>/stats.php?action=share"><?php echo T_('Shared Objects'); ?></a></li>
<?php } ?>
<?php if (AmpConfig::get('allow_upload')) { ?>
<li id="sb_browse_bb_Upload"><a href="<?php echo $web_path; ?>/stats.php?action=upload"><?php echo T_('Uploads'); ?></a></li>
<?php } ?>
<li id="sb_home_info_Statistics"><a href="<?php echo $web_path; ?>/stats.php?action=show"><?php echo T_('Statistics'); ?></a></li>
</ul>
</li>

47
upload.php Normal file
View file

@ -0,0 +1,47 @@
<?php
/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
*
* LICENSE: GNU General Public License, version 2 (GPLv2)
* Copyright 2001 - 2014 Ampache.org
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License v2
* as published by the Free Software Foundation.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once 'lib/init.php';
if (!AmpConfig::get('allow_upload')) {
UI::access_denied();
exit;
}
/* Switch on the action passed in */
switch ($_REQUEST['actionp']) {
case 'upload':
if (AmpConfig::get('demo_mode')) {
UI::access_denied();
exit;
}
Upload::process();
exit;
default:
UI::show_header();
require AmpConfig::get('prefix') . '/templates/show_add_upload.inc.php';
break;
} // switch on the action
UI::show_footer();