findPks($platforms); $retVal = ''; foreach ($data as $platform) { $retVal .= "- {$platform->getName()} \n"; } return $retVal; } public function getNotes() { $notes = "### Support Level\n\n"; $notes .= "%{$this->getSupport()}%\n\n"; if ($stable = $this->getStablePlatforms()) { $notes .= "### Supported Platforms \n"; $notes .= "{$this->processPlatforms($stable)}\n"; } if ($unstable = $this->getUnstablePlatforms()) { $notes .= "### Unsupported Platforms\n"; $notes .= "{$this->processPlatforms($unstable)}\n"; } if ($this->notes) { $notes .= "### Additional Notes\n"; $notes .= str_replace("- ", "\n- ", parent::getNotes()) . "\n"; } $links = []; if ($this->getGame()->getMobyId() > 0) { $links[] = "- [MobyGames](https://www.mobygames.com/game/{$this->getGame()->getMobyId()})"; } if ($this->getGame()->getDataFiles()) { $links[] = "- [ScummVM Wiki]({$this->getGame()->getDataFiles()})"; } $wikipediaPage = $this->getGame()->getWikipediaPage(); if ($wikipediaPage) { // If we have a full URL, such as for a non-English Wikipedia page, use that // Otherwise, assume it's a page for English Wikipedia if (str_starts_with($wikipediaPage, "https://")) { $links[] = "- [Wikipedia]({$this->getGame()->getWikipediaPage()})"; } else { $links[] = "- [Wikipedia](https://en.wikipedia.org/wiki/{$this->getGame()->getWikipediaPage()})"; } } if ($links) { $notes .= "\n\n### Links\n"; $notes .= join("\n", $links); } $config = \HTMLPurifier_Config::createDefault(); $purifier = new \HTMLPurifier($config); $parsedown = new \Parsedown(); $notes = $parsedown->text($notes); $notes = $purifier->purify($notes); return $notes; } }