1
0

programs_view

This commit is contained in:
2018-01-20 03:05:15 +01:00
parent 40ca6e8d96
commit b241500129
58 changed files with 737 additions and 109 deletions

View File

@@ -5,7 +5,7 @@ class Programs
public static function readSingle($a)
{
$a['thumbnail_url'] = '/data/images/program_thumbnails/' . $a['internal_name'] . '.png';
$a['file_longdescription'] = (__DIR__ . '/../statics/programs/' . $a['internal_name'] . '_descrition.md');
$a['file_longdescription'] = (__DIR__ . '/../statics/programs/' . $a['internal_name'] . '_description.md');
$a['url'] = '/programs/view/' . $a['internal_name'];
return $a;
@@ -31,4 +31,18 @@ class Programs
$a = require (__DIR__ . '/../statics/updates/programupdates.php');
return $a;
}
public static function getProgramByInternalName($id)
{
foreach (self::listAll() as $prog) {
if (strcasecmp($prog['internal_name'], $id) === 0) return $prog;
if ($prog['internal_name_alt'] !== null && strcasecmp($prog['internal_name_alt'], $id) === 0) return $prog;
}
return null;
}
public static function getProgramDescription($prog)
{
return file_get_contents($prog['file_longdescription']);
}
}