1
0

Added new Images for programs/index (+ other things)

This commit is contained in:
2014-06-03 14:24:37 +02:00
parent 1b23097722
commit df2d966eb4
8 changed files with 208 additions and 122 deletions

View File

@@ -1,7 +1,14 @@
<?php
/**
* Class ProgramHelper
*/
class ProgramHelper {
/**
* @param bool $doDelimiter
* @return Program[]
*/
public static function GetHighlightedProgList($doDelimiter)
{
$dropDownModels = array();
@@ -26,7 +33,7 @@ class ProgramHelper {
foreach (Program::model()->findAll($criteria) as $row) {
$contains = false;
foreach($dropDownModels as $modelElem)
if ($modelElem != null && $modelElem->attributes['ID'] == $row->attributes['ID'])
if ($modelElem != null && $modelElem->ID == $row->ID)
$contains = true;
if (! $contains)
$dropDownModels[] = $row;
@@ -35,6 +42,9 @@ class ProgramHelper {
return $dropDownModels;
}
/**
* @return Program
*/
public static function GetRecentProg()
{
$criteria = new CDbCriteria;
@@ -45,6 +55,9 @@ class ProgramHelper {
return Program::model()->find($criteria);
}
/**
* @return Program
*/
public static function GetDailyProg()
{
$recent = self::GetRecentProg();
@@ -62,6 +75,9 @@ class ProgramHelper {
return $result;
}
/**
* @return array
*/
public static function GetProgDropDownList()
{
$progDropDown = array();
@@ -72,7 +88,7 @@ class ProgramHelper {
if (is_null($row))
$progDropDown[] = TbHtml::menuDivider();
else
$progDropDown[] = array('label' => $row->attributes['Name'], 'url' => '/programs/view/' . $row->attributes['Name']);
$progDropDown[] = array('label' => $row->Name, 'url' => $row->getLink());
}
return $progDropDown;
}