diff options
author | momo-i <webmaster@momo-i.org> | 2011-02-03 14:03:16 +0900 |
---|---|---|
committer | momo-i <webmaster@momo-i.org> | 2011-02-03 14:03:16 +0900 |
commit | 9ce63661d1ce941dee468cec6fe197534a636f40 (patch) | |
tree | 2c89d117befdad5dfab8948979897a39d667db48 | |
parent | 7ef24e84c6986a07be5144df4b67186f78f99d61 (diff) | |
download | ampache-9ce63661d1ce941dee468cec6fe197534a636f40.tar.gz ampache-9ce63661d1ce941dee468cec6fe197534a636f40.tar.bz2 ampache-9ce63661d1ce941dee468cec6fe197534a636f40.zip |
Fixed indent and add translation words
-rw-r--r-- | artists.php | 11 | ||||
-rw-r--r-- | image.php | 18 | ||||
-rw-r--r-- | lib/class/config.class.php | 25 | ||||
-rw-r--r-- | lib/class/media.interface.php | 31 | ||||
-rw-r--r-- | lib/gettext.php | 13 | ||||
-rw-r--r-- | playlist.php | 2 | ||||
-rw-r--r-- | preferences.php | 16 | ||||
-rw-r--r-- | rss.php | 2 | ||||
-rw-r--r-- | search.php | 2 | ||||
-rw-r--r-- | stats.php | 10 |
10 files changed, 96 insertions, 34 deletions
diff --git a/artists.php b/artists.php index f4e611f0..ee02589a 100644 --- a/artists.php +++ b/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 ); } @@ -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; diff --git a/lib/class/config.class.php b/lib/class/config.class.php index d05d9125..9111416d 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 @@ 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) { diff --git a/lib/class/media.interface.php b/lib/class/media.interface.php index 7cc92760..242f2772 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 d4eb0224..fa96dfc3 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 016b2a55..cab29d76 100644 --- a/playlist.php +++ b/playlist.php @@ -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. diff --git a/preferences.php b/preferences.php index e5be9746..f1b3fcbf 100644 --- a/preferences.php +++ b/preferences.php @@ -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']); @@ -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'; @@ -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 |