1
0
www.mikescher.com/www/pages/programs_download.php

30 lines
1.1 KiB
PHP
Raw Normal View History

2018-01-27 18:13:38 +01:00
<?php
require_once (__DIR__ . '/../internals/website.php');
2018-01-27 18:13:38 +01:00
/** @var PageFrameOptions $FRAME_OPTIONS */ global $FRAME_OPTIONS;
/** @var URLRoute $ROUTE */ global $ROUTE;
/** @var Website $SITE */ global $SITE;
?>
2018-01-27 18:13:38 +01:00
<?php
$progid = $ROUTE->parameter['id'];
$prog = $SITE->modules->Programs()->getProgramByInternalName($progid);
if ($prog === null) { $FRAME_OPTIONS->setForced404("Program not found"); return; }
$FRAME_OPTIONS->title = null;
$FRAME_OPTIONS->canonical_url = null;
$FRAME_OPTIONS->activeHeader = null;
2018-01-27 18:13:38 +01:00
$FRAME_OPTIONS->frame = 'nocontent_frame.php';
2018-01-27 18:13:38 +01:00
foreach ($SITE->modules->Programs()->getURLs($prog) as $xurl)
2018-01-27 18:13:38 +01:00
{
if ($xurl['type'] === 'download') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'playstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'amazonappstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'windowsstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
if ($xurl['type'] === 'itunesstore') { $FRAME_OPTIONS->setForcedRedirect($xurl['href']); return; }
}
?>