<?php
class Announcements {
var $announcement_array, $count;
function Announcements() {
$this->announcement_array = Array();
$this->count = 0;
}
function addAnnouncement($str) {
if (strlen($str) > 0) {
$this->announcement_array[] = new Announcement($str, $count);
$this->count++;
}
}
function toStr() {
$str ="";
// as long as there are some actual announcements to show,
if ($this->count>0) {
// make a long string of ...
foreach($this->announcement_array as $this_announcement) {
// ... each announcement formatted for html!
$str .= $this_announcement->toStr();
$str .= Text::smallBreak(2);
}
// place that html in the page with proper surroundings!
$str = new TextBox("",$str
. "<script language=JavaScript>blink(". $this->count
. ",". BLINK_TIMES .");</script>");
}
return ($str);
}
function display() {
echo $this->toStr();
}
}
?>