diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-26 04:32:08 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-26 04:32:08 +0000 |
commit | 97c78343ae899e59226ecbeb88dc4805b5ddc751 (patch) | |
tree | 500c4e90ddfe0c245cb7b30050d59fa1de6488e8 /lib | |
parent | 00417ad9658bd68f347f45e1ef8c5327fed95648 (diff) | |
download | ampache-97c78343ae899e59226ecbeb88dc4805b5ddc751.tar.gz ampache-97c78343ae899e59226ecbeb88dc4805b5ddc751.tar.bz2 ampache-97c78343ae899e59226ecbeb88dc4805b5ddc751.zip |
two file pattern fixes and some more work on the flagged stuff as well as some minor cleanup on the album art links
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/flag.class.php | 56 | ||||
-rw-r--r-- | lib/class/vainfo.class.php | 2 |
2 files changed, 21 insertions, 37 deletions
diff --git a/lib/class/flag.class.php b/lib/class/flag.class.php index f27d7fc6..d3f5ba56 100644 --- a/lib/class/flag.class.php +++ b/lib/class/flag.class.php @@ -43,12 +43,10 @@ class Flag { * Constructor * This takes a flagged.id and then pulls in the information for said flag entry */ - public function __construct($flag_id=0) { - - if (!$flag_id) { return false; } + public function __construct($flag_id) { $info = $this->_get_info($flag_id); - + foreach ($info as $key=>$value) { $this->$key = $value; } @@ -61,7 +59,7 @@ class Flag { * _get_info * Private function for getting the information for this object from the database */ - private function _get_info() { + private function _get_info($flag_id) { $id = Dba::escape($flag_id); @@ -209,49 +207,35 @@ class Flag { return true; - } // approve - + } // approve + /** - * format_name - * This function formats and sets the $this->name variable and $this->title + * format + * This function figures out what kind of object we've got and sets up all the + * vars all nice and fuzzy like */ - function format_name() { + public function format() { switch ($this->object_type) { - case 'song': + case 'song': $song = new Song($this->object_id); - $song->format(); - $name = $song->f_title . " - " . $song->f_artist; - $title = $song->title . " - " . $song->get_artist_name(); + $song->format(); + $this->f_name = $song->f_link; break; - default: - - break; - } // end switch on object type - - $this->title = $title; - $this->name = $name; - } // format_name() - - /** - * print_name - * This function formats and prints out a userfriendly name of the flagged - * object - */ - function print_name() { - - $this->format_name(); - echo "<span title=\"" . $this->title . "\">" . $this->name . "</span>"; - - } // print_name + } // end switch on type + $client = new User($this->user); + $client->format(); + $this->f_user = $client->f_link; + } // format + /** * print_status * This prints out a userfriendly version of the current status for this flagged * object */ - function print_status() { + public function print_status() { if ($this->approved) { echo _('Approved'); } else { echo _('Pending'); } @@ -262,7 +246,7 @@ class Flag { * print_flag * This prints out a userfriendly version of the current flag type */ - function print_flag() { + public function print_flag() { switch ($this->flag) { case 'delete': diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php index 5a595f2b..e83310e8 100644 --- a/lib/class/vainfo.class.php +++ b/lib/class/vainfo.class.php @@ -181,7 +181,7 @@ class vainfo { * any tags to look at */ if (!is_array($this->_raw['tags'])) { - return false; + return $results; } /* The tags can come in many different shapes and colors |