mirror of
https://github.com/scummvm/scummvm-web.git
synced 2026-05-21 05:40:47 +00:00
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
namespace ScummVM\Objects;
|
|
|
|
/**
|
|
* The DownloadsSection object represents a section on the downloads page.
|
|
*/
|
|
class DownloadsSection extends BasicSection
|
|
{
|
|
private $notes;
|
|
private $footer;
|
|
private $files;
|
|
private $links;
|
|
private $items;
|
|
private $baseUrl;
|
|
|
|
public function __construct($data)
|
|
{
|
|
parent::__construct($data);
|
|
$this->notes = $data['notes'];
|
|
$this->items = array();
|
|
|
|
if (isset($data['baseurl'])) {
|
|
$this->baseUrl = $data['baseurl'];
|
|
}
|
|
|
|
if (isset($data['entries'])) {
|
|
foreach ($data['entries'] as $type => $item) {
|
|
parent::toArray($item);
|
|
if ($type == 'file') {
|
|
foreach ($item as $file) {
|
|
$this->items[] = new File($file, $this->baseUrl);
|
|
}
|
|
} elseif ($type == 'link') {
|
|
foreach ($item as $link) {
|
|
$this->items[] = new WebLink($link);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* Get the optional notes. */
|
|
public function getNotes()
|
|
{
|
|
return $this->notes;
|
|
}
|
|
|
|
/* Get the list of items. */
|
|
public function getItems()
|
|
{
|
|
return $this->items;
|
|
}
|
|
}
|