This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
infoskjerm/app/models/slide.php
T
olivaq@gmail.com cf044fb1c3 fix
2011-02-01 16:40:24 +01:00

32 lines
713 B
PHP

<?php
class Slide extends AppModel {
var $name = 'Slide';
var $hasMany = 'DisplayTime';
function getActiveSlides()
{
$enabledSlides = $this->find('list',
array('conditions'=>
array('Slide.enabled'=>1,
'(Slide.start IS NULL OR Slide.start <= now()',
'Slide.top IS NULL OR Slide.stop >= now()')));
$enabledSlides = array_keys($enabledSlides);
return $this->DisplayTime->filterByDisplayTime($enabledSlides);
}
function getEnabledSlides()
{
return $this->find('all', array('conditions'=>array('Slide.enabled'=>1)));
}
function getDisabledSlides()
{
return $this->find('all', array('conditions'=>array('Slide.enabled'=>0),'order'=>array('id'=>'DESC')));
}
}
?>