mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 09:49:30 +02:00
Fixed indent and add translation words
This commit is contained in:
parent
7ef24e84c6
commit
9ce63661d1
10 changed files with 96 additions and 34 deletions
11
artists.php
11
artists.php
|
@ -55,14 +55,13 @@ switch($_REQUEST['action']) {
|
|||
}
|
||||
break;
|
||||
case 'show_all_songs':
|
||||
$artist = new Artist($_REQUEST['artist']);
|
||||
$artist = new Artist($_REQUEST['artist']);
|
||||
$artist->format();
|
||||
$object_type = 'song';
|
||||
$object_ids = $artist->get_songs();
|
||||
require_once Config::get('prefix') . '/templates/show_artist.inc.php';
|
||||
break;
|
||||
case 'update_from_tags':
|
||||
|
||||
$type = 'artist';
|
||||
$object_id = intval($_REQUEST['artist']);
|
||||
$target_url = Config::get('web_path') . "/artists.php?action=show&artist=" . $object_id;
|
||||
|
@ -93,8 +92,8 @@ switch($_REQUEST['action']) {
|
|||
}
|
||||
if ($count > 0) {
|
||||
show_confirmation (
|
||||
"Renamed artist(s)",
|
||||
"$count artists have been merged with " . $artist->name,
|
||||
_('Renamed artist(s)'),
|
||||
sprintf(_('%1$s artists have been merged with %2$s'), $count, $artist->name),
|
||||
conf('web_path') . "/artists.php?action=show&artist=" . $artist->id
|
||||
);
|
||||
} else {
|
||||
|
@ -173,8 +172,8 @@ switch($_REQUEST['action']) {
|
|||
// show something other than a blank screen after this
|
||||
if ($ret) {
|
||||
show_confirmation (
|
||||
"Renamed artist",
|
||||
$artist->name . " is now known as " . $newname,
|
||||
_('Renamed artist'),
|
||||
sprintf(_('%1$s is now known as %2$s'), $artist->name, $newname),
|
||||
conf('web_path') . "/artists.php?action=show&artist=" . $newid
|
||||
);
|
||||
}
|
||||
|
|
18
image.php
18
image.php
|
@ -95,11 +95,11 @@ switch ($_GET['type']) {
|
|||
$data = explode("/",$mime);
|
||||
$extension = $data['1'];
|
||||
|
||||
// Send the headers and output the image
|
||||
header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
// Send the headers and output the image
|
||||
header("Expires: Sun, 19 Nov 1978 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: $mime");
|
||||
header("Content-Disposition: filename=" . $key . "." . $extension);
|
||||
echo $image;
|
||||
|
@ -124,10 +124,10 @@ switch ($_GET['type']) {
|
|||
$extension = Art::extension($mime);
|
||||
|
||||
// Send the headers and output the image
|
||||
header("Expires: Tue, 27 Mar 1984 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: Tue, 27 Mar 1984 05:00:00 GMT");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: $mime");
|
||||
header("Content-Disposition: filename=" . scrub_out($media->name) . "." . $extension);
|
||||
echo $source;
|
||||
|
|
|
@ -54,10 +54,18 @@
|
|||
*/
|
||||
class Config {
|
||||
|
||||
// These are the settings for this specific class
|
||||
/**
|
||||
* These are the settings for this specific class
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private $_local = array();
|
||||
|
||||
// These are the global settings they go where it goes
|
||||
/**
|
||||
* These are the global settings they go where it goes
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
private static $_global = array();
|
||||
|
||||
/**
|
||||
|
@ -74,6 +82,9 @@ class Config {
|
|||
* get
|
||||
* This checks to see if this is an instance or procedure
|
||||
* call, procedure == global, instance == local
|
||||
*
|
||||
* @param string $name
|
||||
* @return mixed array or null
|
||||
*/
|
||||
public static function get($name) {
|
||||
|
||||
|
@ -85,6 +96,8 @@ class Config {
|
|||
/**
|
||||
* get_all
|
||||
* This returns all of the current config variables as an array
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_all() {
|
||||
|
||||
|
@ -96,6 +109,11 @@ class Config {
|
|||
* set
|
||||
* This checks to see if this is an instance or procedure calls
|
||||
* and then sets the correct variable based on that
|
||||
*
|
||||
* @param string $name Key name
|
||||
* @param string $value Value name
|
||||
* @param integer $clobber Clobber flag 0 or 1
|
||||
* @return void
|
||||
*/
|
||||
public static function set($name, $value, $clobber = 0) {
|
||||
|
||||
|
@ -112,6 +130,9 @@ class Config {
|
|||
/**
|
||||
* set_by_array
|
||||
* This is the same as the set function except it takes an array as input
|
||||
*
|
||||
* @param array $array Array
|
||||
* @param integer $clobber Clobber flag 0 or 1
|
||||
*/
|
||||
public static function set_by_array($array, $clobber = 0) {
|
||||
|
||||
|
|
|
@ -53,12 +53,41 @@
|
|||
*/
|
||||
interface media {
|
||||
|
||||
/**
|
||||
* format
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public function format();
|
||||
|
||||
/**
|
||||
* native_stream
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function native_stream();
|
||||
|
||||
/**
|
||||
* play_url
|
||||
*
|
||||
* @param int $oid ID
|
||||
* @return mixed
|
||||
*/
|
||||
public static function play_url($oid);
|
||||
|
||||
/**
|
||||
* stream_cmd
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function stream_cmd();
|
||||
|
||||
/**
|
||||
* has_flag
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function has_flag();
|
||||
|
||||
} // end interface
|
||||
|
||||
?>
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
/**
|
||||
* load_gettext
|
||||
* Sets up our local gettext settings.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function load_gettext() {
|
||||
/* If we have gettext */
|
||||
|
@ -65,6 +67,11 @@ function load_gettext() {
|
|||
* This function does the same as _ on the supplied
|
||||
* string, but also does a str_replace on the supplied
|
||||
* vars
|
||||
*
|
||||
* @param string $string
|
||||
* @param string $subject
|
||||
* @param string $replace
|
||||
* @return string
|
||||
*/
|
||||
function __($string,$subject,$replace) {
|
||||
|
||||
|
@ -74,6 +81,12 @@ function __($string,$subject,$replace) {
|
|||
|
||||
} // __
|
||||
|
||||
/**
|
||||
* gettext_noop
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
function gettext_noop($string) {
|
||||
return $string;
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ switch ($_REQUEST['action']) {
|
|||
|
||||
$playlist->create($playlist_name,$playlist_type);
|
||||
$_SESSION['data']['playlist_id'] = $playlist->id;
|
||||
show_confirmation(_('Playlist Created'),$playlist_name . ' (' . $playlist_type . ') ' . _(' has been created'),'playlist.php');
|
||||
show_confirmation(_('Playlist Created'), sprintf(_('%1$s (%2$s) has been created'), $playlist_name, $playlist_type),'playlist.php');
|
||||
break;
|
||||
case 'delete_playlist':
|
||||
// If we made it here, we didn't have sufficient rights.
|
||||
|
|
|
@ -70,10 +70,10 @@ switch($_REQUEST['action']) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if (!Core::form_verify('update_preference','post')) {
|
||||
access_denied();
|
||||
exit;
|
||||
}
|
||||
if (!Core::form_verify('update_preference','post')) {
|
||||
access_denied();
|
||||
exit;
|
||||
}
|
||||
|
||||
update_preferences($_POST['user_id']);
|
||||
header("Location: " . Config::get('web_path') . "/admin/users.php?action=show_preferences&user_id=" . scrub_out($_POST['user_id']));
|
||||
|
@ -103,10 +103,10 @@ switch($_REQUEST['action']) {
|
|||
exit;
|
||||
}
|
||||
|
||||
if (!Core::form_verify('update_user','post')) {
|
||||
access_denied();
|
||||
exit;
|
||||
}
|
||||
if (!Core::form_verify('update_user','post')) {
|
||||
access_denied();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Remove the value
|
||||
unset($_SESSION['forms']['account']);
|
||||
|
|
2
rss.php
2
rss.php
|
@ -36,7 +36,7 @@ require 'lib/init.php';
|
|||
|
||||
/* Check Perms */
|
||||
if (!Config::get('use_rss') || Config::get('demo_mode')) {
|
||||
access_denied();
|
||||
access_denied();
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ switch ($_REQUEST['action']) {
|
|||
case 'save_as_track':
|
||||
$playlist_id = save_search($_REQUEST);
|
||||
$playlist = new Playlist($playlist_id);
|
||||
show_confirmation("Search Saved","Your Search has been saved as a track in $playlist->name",conf('web_path') . "/search.php");
|
||||
show_confirmation(_('Search Saved'),sprintf(_('Your Search has been saved as a track in %s'), $playlist->name),conf('web_path') . "/search.php");
|
||||
break;
|
||||
default:
|
||||
require_once Config::get('prefix') . '/templates/show_search.inc.php';
|
||||
|
|
10
stats.php
10
stats.php
|
@ -48,12 +48,12 @@ switch ($_REQUEST['action']) {
|
|||
/* Get em! */
|
||||
$working_user = new User($_REQUEST['user_id']);
|
||||
|
||||
/* Pull favs */
|
||||
$favorite_artists = $working_user->get_favorites('artist');
|
||||
$favorite_albums = $working_user->get_favorites('album');
|
||||
$favorite_songs = $working_user->get_favorites('song');
|
||||
/* Pull favs */
|
||||
$favorite_artists = $working_user->get_favorites('artist');
|
||||
$favorite_albums = $working_user->get_favorites('album');
|
||||
$favorite_songs = $working_user->get_favorites('song');
|
||||
|
||||
require_once Config::get('prefix') . '/templates/show_user_stats.inc.php';
|
||||
require_once Config::get('prefix') . '/templates/show_user_stats.inc.php';
|
||||
|
||||
break;
|
||||
// Show stats
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue