diff --git a/artists.php b/artists.php index f4e611f089..ee02589a88 100644 --- a/artists.php +++ b/artists.php @@ -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; @@ -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 { @@ -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 ); } diff --git a/image.php b/image.php index 864ad04eb6..14dc4e8771 100644 --- a/image.php +++ b/image.php @@ -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; @@ -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; diff --git a/lib/class/config.class.php b/lib/class/config.class.php index d05d9125d3..9111416df4 100644 --- a/lib/class/config.class.php +++ b/lib/class/config.class.php @@ -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 @@ 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) { @@ -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() { @@ -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) { @@ -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) { diff --git a/lib/class/media.interface.php b/lib/class/media.interface.php index 7cc927605f..242f2772c8 100644 --- a/lib/class/media.interface.php +++ b/lib/class/media.interface.php @@ -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 - ?> diff --git a/lib/gettext.php b/lib/gettext.php index d4eb02243c..fa96dfc3c2 100644 --- a/lib/gettext.php +++ b/lib/gettext.php @@ -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; } diff --git a/playlist.php b/playlist.php index 016b2a5527..cab29d765d 100644 --- a/playlist.php +++ b/playlist.php @@ -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. diff --git a/preferences.php b/preferences.php index e5be9746f0..f1b3fcbfd2 100644 --- a/preferences.php +++ b/preferences.php @@ -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'])); @@ -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']); diff --git a/rss.php b/rss.php index 2ce15c1769..9d3cd1fa47 100644 --- a/rss.php +++ b/rss.php @@ -36,7 +36,7 @@ /* Check Perms */ if (!Config::get('use_rss') || Config::get('demo_mode')) { - access_denied(); + access_denied(); exit; } diff --git a/search.php b/search.php index 56e6ad94bf..4ef60940ee 100644 --- a/search.php +++ b/search.php @@ -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'; diff --git a/stats.php b/stats.php index 55579f1b95..308117cb4e 100644 --- a/stats.php +++ b/stats.php @@ -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