programs_view
This commit is contained in:
@@ -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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user