}
/**
* Renders a complete page and table
*/
public function render_all () {
$this->header();
$this->body();
$this->footer();
}
/**
* Renders a comptele page/table header: div#thin, h2, scripts, notes,
* form, table, etc.
*/
public function header () {
if ($this->HasTorrents) {
?>
=display_str($this->Heading)?>
Sorting
Click on the headings to organize columns automatically.
Sort multiple columns simultaneously by holding down the shift key and clicking other column headers.
Click and drag any row to change its order.
Double-click on a row to check it.
}
}
/**
* Formats data for use in row
*
*/
public function body () {
if ($this->HasTorrents)
foreach ($this->TorrentList as $GroupID => $Group) {
$Artists = array();
extract($Group);
extract($this->CollageDataList[$GroupID]);
$this->NumGroups++;
$DisplayName = self::display_name($ExtendedArtists, $Artists, $VanityHouse);
$TorrentLink = ''.$Name.'';
$Year = $Year > 0 ? $Year : '';
$DateAdded = date($Time);
$this->row($Sort, $GroupID, $Year, $DisplayName, $TorrentLink, $DateAdded);
}
}
/**
* Outputs a single row
*
* @param string|int $Sort
* @param string|int $GroupID
* @param string|int $GroupYear
* @param string $DisplayName
* @param string $TorrentLink
*/
public function row ($Sort, $GroupID, $GroupYear, $DisplayName, $TorrentLink, $DateAdded) {
$CSS = $this->NumGroups % 2 === 0 ? 'rowa' : 'rowb';
?>
=$this->NumGroups?>
=$GroupYear ? trim($GroupYear) : ' '?>
=$DisplayName ? trim($DisplayName) : ' '?>
=$TorrentLink ? trim($TorrentLink) : ' '?>
=$DateAdded ? time_diff($DateAdded) : ' '?>
}
/**
* Parses a simple display name
*
* @param array $ExtendedArtists
* @param array $Artists
* @param string $VanityHouse
* @return string $DisplayName
*/
public static function display_name (array &$ExtendedArtists, array &$Artists, $VanityHouse) {
$DisplayName = '';
if (!empty($ExtendedArtists[1]) || !empty($ExtendedArtists[4])
|| !empty($ExtendedArtists[5]) || !empty($ExtendedArtists[6])) {
unset($ExtendedArtists[2], $ExtendedArtists[3]);
$DisplayName = Artists::display_artists($ExtendedArtists, true, false);
} elseif (count($Artists) > 0) {
$DisplayName = Artists::display_artists(array('1'=>$Artists), true, false);
}
if ($VanityHouse) {
$DisplayName .= ' [VH]';
}
return $DisplayName;
}
/**
* Renders buttons used at the top and bottom of the table
*/
public function buttons () {
?>
}
/**
* @param string $EditType
*/
public function set_edit_type ($EditType) {
$this->EditType = $EditType;
}
/**
* Set's the current page's heading
* @param string $Heading
*/
public function set_heading ($Heading) {
$this->Heading = $Heading;
}
}