diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-03-14 20:14:52 +0000 |
commit | 1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc (patch) | |
tree | 54655ff3e692a71a17f1d37cd97374b263557ca1 /lib/class/radio.class.php | |
parent | ef48bf3fbdca2a4d25f5d025f4c6ad23905e5369 (diff) | |
download | ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.gz ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.tar.bz2 ampache-1cb0983ed04c65e06d502ae2ac9ed6d5e31d70dc.zip |
Cosmetics: remove trailing whitespace
Diffstat (limited to 'lib/class/radio.class.php')
-rw-r--r-- | lib/class/radio.class.php | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/lib/class/radio.class.php b/lib/class/radio.class.php index 65cdf1d0..7112ea5c 100644 --- a/lib/class/radio.class.php +++ b/lib/class/radio.class.php @@ -17,7 +17,7 @@ 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. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -29,26 +29,26 @@ class Radio extends database_object implements media { /* DB based variables */ - public $id; - public $name; - public $site_url; - public $url; + public $id; + public $name; + public $site_url; + public $url; public $frequency; public $call_sign; - public $catalog; + public $catalog; /** * Constructor * This takes a flagged.id and then pulls in the information for said flag entry */ - public function __construct($id) { + public function __construct($id) { $info = $this->get_info($id,'live_stream'); // Set the vars - foreach ($info as $key=>$value) { - $this->$key = $value; - } + foreach ($info as $key=>$value) { + $this->$key = $value; + } } // constructor @@ -57,111 +57,111 @@ class Radio extends database_object implements media { * This takes the normal data from the database and makes it pretty * for the users, the new variables are put in f_??? and f_???_link */ - public function format() { + public function format() { // Default link used on the rightbar - $this->f_link = "<a href=\"$this->url\">$this->name</a>"; + $this->f_link = "<a href=\"$this->url\">$this->name</a>"; - $this->f_name_link = "<a target=\"_blank\" href=\"$this->site_url\">$this->name</a>"; - $this->f_callsign = scrub_out($this->call_sign); - $this->f_frequency = scrub_out($this->frequency); + $this->f_name_link = "<a target=\"_blank\" href=\"$this->site_url\">$this->name</a>"; + $this->f_callsign = scrub_out($this->call_sign); + $this->f_frequency = scrub_out($this->frequency); - return true; + return true; } // format /** * update * This is a static function that takes a key'd array for input - * it depends on a ID element to determine which radio element it + * it depends on a ID element to determine which radio element it * should be updating */ - public static function update($data) { + public static function update($data) { // Verify the incoming data - if (!$data['id']) { + if (!$data['id']) { // FIXME: Untranslated - Error::add('general','Missing ID'); - } + Error::add('general','Missing ID'); + } - if (!$data['name']) { + if (!$data['name']) { // FIXME: Untranslated - Error::add('general','Name Required'); - } + Error::add('general','Name Required'); + } - $allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp'); + $allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp'); - $elements = explode(":",$data['url']); - - if (!in_array($elements['0'],$allowed_array)) { + $elements = explode(":",$data['url']); + + if (!in_array($elements['0'],$allowed_array)) { // FIXME: Untranslated - Error::add('general','Invalid URL must be mms:// , https:// or http://'); - } + Error::add('general','Invalid URL must be mms:// , https:// or http://'); + } - if (Error::occurred()) { - return false; - } + if (Error::occurred()) { + return false; + } // Setup the data - $name = Dba::escape($data['name']); - $site_url = Dba::escape($data['site_url']); - $url = Dba::escape($data['url']); - $frequency = Dba::escape($data['frequency']); - $call_sign = Dba::escape($data['call_sign']); - $id = Dba::escape($data['id']); + $name = Dba::escape($data['name']); + $site_url = Dba::escape($data['site_url']); + $url = Dba::escape($data['url']); + $frequency = Dba::escape($data['frequency']); + $call_sign = Dba::escape($data['call_sign']); + $id = Dba::escape($data['id']); - $sql = "UPDATE `live_stream` SET `name`='$name',`site_url`='$site_url',`url`='$url'" . - ",`frequency`='$frequency',`call_sign`='$call_sign' WHERE `id`='$id'"; - $db_results = Dba::write($sql); + $sql = "UPDATE `live_stream` SET `name`='$name',`site_url`='$site_url',`url`='$url'" . + ",`frequency`='$frequency',`call_sign`='$call_sign' WHERE `id`='$id'"; + $db_results = Dba::write($sql); - return $db_results; + return $db_results; } // update /** * create * This is a static function that takes a key'd array for input - * and if everything is good creates the object. + * and if everything is good creates the object. */ - public static function create($data) { + public static function create($data) { // Make sure we've got a name - if (!strlen($data['name'])) { + if (!strlen($data['name'])) { // FIXME: Untranslated - Error::add('name','Name Required'); - } + Error::add('name','Name Required'); + } + + $allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp'); - $allowed_array = array('https','http','mms','mmsh','mmsu','mmst','rtsp'); + $elements = explode(":",$data['url']); - $elements = explode(":",$data['url']); - - if (!in_array($elements['0'],$allowed_array)) { - Error::add('url','Invalid URL must be http:// or https://'); - } + if (!in_array($elements['0'],$allowed_array)) { + Error::add('url','Invalid URL must be http:// or https://'); + } // Make sure it's a real catalog - $catalog = new Catalog($data['catalog']); - if (!$catalog->name) { + $catalog = new Catalog($data['catalog']); + if (!$catalog->name) { // FIXME: Untranslated - Error::add('catalog','Invalid Catalog'); - } + Error::add('catalog','Invalid Catalog'); + } - if (Error::occurred()) { return false; } + if (Error::occurred()) { return false; } // Clean up the input - $name = Dba::escape($data['name']); - $site_url = Dba::escape($data['site_url']); - $url = Dba::escape($data['url']); - $catalog = $catalog->id; - $frequency = Dba::escape($data['frequency']); - $call_sign = Dba::escape($data['call_sign']); + $name = Dba::escape($data['name']); + $site_url = Dba::escape($data['site_url']); + $url = Dba::escape($data['url']); + $catalog = $catalog->id; + $frequency = Dba::escape($data['frequency']); + $call_sign = Dba::escape($data['call_sign']); // If we've made it this far everything must be ok... I hope - $sql = "INSERT INTO `live_stream` (`name`,`site_url`,`url`,`catalog`,`frequency`,`call_sign`) " . - "VALUES ('$name','$site_url','$url','$catalog','$frequency','$call_sign')"; - $db_results = Dba::write($sql); + $sql = "INSERT INTO `live_stream` (`name`,`site_url`,`url`,`catalog`,`frequency`,`call_sign`) " . + "VALUES ('$name','$site_url','$url','$catalog','$frequency','$call_sign')"; + $db_results = Dba::write($sql); - return $db_results; + return $db_results; } // create @@ -169,14 +169,14 @@ class Radio extends database_object implements media { * delete * This deletes the current object from the database */ - public function delete() { + public function delete() { - $id = Dba::escape($this->id); + $id = Dba::escape($this->id); - $sql = "DELETE FROM `live_stream` WHERE `id`='$id'"; - $db_results = Dba::write($sql); + $sql = "DELETE FROM `live_stream` WHERE `id`='$id'"; + $db_results = Dba::write($sql); - return true; + return true; } // delete @@ -184,29 +184,29 @@ class Radio extends database_object implements media { * native_stream * This is needed by the media interface */ - public function native_stream() { + public function native_stream() { - } // native_stream + } // native_stream /** * play_url * This is needed by the media interface */ - public static function play_url($oid,$sid='',$force_http='') { + public static function play_url($oid,$sid='',$force_http='') { + + $radio = new Radio($oid); - $radio = new Radio($oid); - - return $radio->url; + return $radio->url; - } // play_url + } // play_url /** * has_flag * This is needed by the media interface */ - public function has_flag() { + public function has_flag() { @@ -216,7 +216,7 @@ class Radio extends database_object implements media { * stream_cmd * Needed by the media interface */ - public function stream_cmd() { + public function stream_cmd() { } // stream_cmd |