function BuildStandardCalendar() { $tpl = $this->tpl; $firstDayOfWeek = $this->days[1]; $row = ""; $allRows = ""; for ($i = 1; $i < $firstDayOfWeek; $i++) { $tpl->setVars("CALENDARCOL", "DAY", ""); $row .= $tpl->ParseBlock("CALENDARCOL"); } $dayTD = ""; foreach ($this->days as $dayOfMonth => $dayOfWeek) { if (isset($this->preURL)) { $tpl->setVars("LINK", "LINK", $this->preURL); $tpl->setVars("LINK", "TEXT", $dayOfMonth); if (isset($this->extraURL)) { $tpl->setVars("LINK", "EXTRA", $this->extraURL); $tpl->setVars("LINK", "DATE", $dayOfMonth . "/" . $this->month . "/" . $this->year); //Anywhere in the link, DATE var is replaced $tpl->setVars("LINK", "FUID", $this->FUID); //Anywhere in the link, DATE var is replaced } $dayTD = $tpl->parseBlock("LINK"); } else { $dayTD = $dayOfMonth; } if (DateTools::isToday($this->month . "/" . $dayOfMonth . "/" . $this->year)) { $tpl->setVars("TODAY", "DAY", $dayTD); $tpl->setVars("TODAY", "EVENTS", $this->BuildEventsForDay($this->month . "/" . $dayOfMonth . "/" . $this->year)); $row .= $tpl->ParseBlock("TODAY"); } else { $tpl->setVars("CALENDARCOL", "DAY", $dayTD); $tpl->setVars("CALENDARCOL", "EVENTS", $this->BuildEventsForDay($this->month . "/" . $dayOfMonth . "/" . $this->year)); $row .= $tpl->ParseBlock("CALENDARCOL"); } if ($dayOfWeek == 7 || $dayOfMonth == count($this->days)) { $tpl->setVars("CALENDARROW", "ROW", $row); $allRows .= $tpl->ParseBlock("CALENDARROW"); $row = ""; } } $this->addBrowseButtons($tpl); $tpl->setVars("CALENDAR", "ALLROWS", $allRows); return $tpl->ParseBlock("CALENDAR"); }