2017-11-08 17:39:50 +01:00
|
|
|
<?php if(count(get_included_files()) ==1) exit("Direct access not permitted.");
|
|
|
|
|
|
|
|
class Programs
|
|
|
|
{
|
|
|
|
public static function readSingle($f)
|
|
|
|
{
|
|
|
|
$a = require $f;
|
2018-01-03 21:02:40 +01:00
|
|
|
|
|
|
|
$a['thumbnail_url'] = '/data/images/program_thumbnails/' . $a['thumbnail_name'];
|
|
|
|
$a['url'] = '/programs/view/' . $a['name'];
|
|
|
|
|
2017-11-08 17:39:50 +01:00
|
|
|
return $a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function listAll()
|
|
|
|
{
|
|
|
|
$files = glob(__DIR__ . '/../statics/programs/*.php');
|
|
|
|
|
2018-01-03 21:02:40 +01:00
|
|
|
return array_map('self::readSingle', $files);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function listAllNewestFirst()
|
|
|
|
{
|
|
|
|
$data = self::listAll();
|
|
|
|
usort($data, function($a, $b) { return strcasecmp($b['add_date'], $a['add_date']); });
|
|
|
|
return $data;
|
2017-11-08 17:39:50 +01:00
|
|
|
}
|
2017-11-20 17:15:12 +01:00
|
|
|
|
|
|
|
public static function listUpdateData()
|
|
|
|
{
|
|
|
|
$a = require (__DIR__ . '/../statics/updates/programupdates.php');
|
|
|
|
return $a;
|
|
|
|
}
|
2017-11-08 17:39:50 +01:00
|
|
|
}
|