Skip to content

Commit

Permalink
Fixed indent and add translation words
Browse files Browse the repository at this point in the history
  • Loading branch information
momo-i2 committed Feb 3, 2011
1 parent 7ef24e8 commit 9ce6366
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 34 deletions.
11 changes: 5 additions & 6 deletions artists.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@
}
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;
Expand Down Expand Up @@ -93,8 +92,8 @@
}
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 {
Expand Down Expand Up @@ -173,8 +172,8 @@
// 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
);
}
Expand Down
18 changes: 9 additions & 9 deletions image.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@
$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;
Expand All @@ -124,10 +124,10 @@
$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;
Expand Down
25 changes: 23 additions & 2 deletions lib/class/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

/**
Expand All @@ -74,6 +82,9 @@ public function __construct() {
* 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) {

Expand All @@ -85,6 +96,8 @@ public static function get($name) {
/**
* get_all
* This returns all of the current config variables as an array
*
* @return array
*/
public static function get_all() {

Expand All @@ -96,6 +109,11 @@ public static function get_all() {
* 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) {

Expand All @@ -112,6 +130,9 @@ public static function set($name, $value, $clobber = 0) {
/**
* 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) {

Expand Down
31 changes: 30 additions & 1 deletion lib/class/media.interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

?>
13 changes: 13 additions & 0 deletions lib/gettext.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
/**
* load_gettext
* Sets up our local gettext settings.
*
* @return void
*/
function load_gettext() {
/* If we have gettext */
Expand Down Expand Up @@ -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) {

Expand All @@ -74,6 +81,12 @@ function __($string,$subject,$replace) {

} // __

/**
* gettext_noop
*
* @param string $string
* @return string
*/
function gettext_noop($string) {
return $string;
}
Expand Down
2 changes: 1 addition & 1 deletion playlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@

$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.
Expand Down
16 changes: 8 additions & 8 deletions preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
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']));
Expand Down Expand Up @@ -103,10 +103,10 @@
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']);
Expand Down
2 changes: 1 addition & 1 deletion rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

/* Check Perms */
if (!Config::get('use_rss') || Config::get('demo_mode')) {
access_denied();
access_denied();
exit;
}

Expand Down
2 changes: 1 addition & 1 deletion search.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
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';
Expand Down
10 changes: 5 additions & 5 deletions stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
/* 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
Expand Down

0 comments on commit 9ce6366

Please sign in to comment.