array ( 1 => "Janeiro", 2 => "Fevereiro", 3 => "Março", 4 => "Abril", 5 => "Maio", 6 => "Junho", 7 => "Julho", 8 => "Agosto", 9 => "Setembro", 10 => "Outubro", 11 => "Novembro", 12 => "Dezembro" ), "en" => array ( 1 => "January", 2 => "February", 3 => "March", 4 => "April", 5 => "May", 6 => "June", 7 => "July", 8 => "August", 9 => "September", 10 => "October", 11 => "November", 12 => "December" ) ); function monthNumberToMonthName($number) { global $monthNameConversion; return $monthNameConversion[getLocale()][intval($number)]; } function getDay($time) { return date("d", $time); } function getMonth($time) { return date("m", $time); } function getYear($time) { return date("Y", $time); } function getHours($time) { return date("H", $time); } function getMinutes($time) { return date("i", $time); } function digestText($text) { global $digestSize; $words = split(" ", $text); $digest = ""; for ($i = 0; $i < count($words) && $i <= $digestSize; $i++) { $digest = $digest . ' ' . $words[$i]; } if ($i < $digestSize) { $digest = $digest . '...'; } return $digest; } function getHumanReadableTime($string) { $components = split(' ', $string); $date = $components[0]; $hour = $components[1]; $dateComponents = split('/', $date); $day = $dateComponents[0]; $month = $dateComponents[1]; $year = $dateComponents[2]; $hourComponents = split(':', $hour); $hour = $hourComponents[0]; if ($hour == 24) $hour = 0; $minutes = $hourComponents[1]; $readable = $day . '/' . $month . '/' . $year; if ($minutes != 0 || $hour != 0) { $readable = $readable . ' ' . $hour . ':' . $minutes; } return $readable; } function getDateWithExtensiveMonth($date) { return getDay($date) . " " . monthNumberToMonthName(getMonth($date)) . " " . getYear($date); } function buildArchiveUrlFor($boardId, $year, $month) { global $informationPage; return $informationPage . "?archive=true&language=" . getLocale() . "&boardId=" . $boardId . "&year=" . $year . "&month=" . $month; } function buildColumnUrlFor($boardId, $announcementId) { global $informationPage; return $informationPage . "?boardId=" . $boardId . "&language=" . getLocale() . "&archive=true#achor" . $announcementId; } function printNewsDate($announcement) { $publicationDate = $announcement->getPublicationBegin(); if (!isset ($publicationDate)) { $publicationDate = $announcement->getCreationDate(); } echo getDateWithExtensiveMonth($publicationDate); } function printEventDate($announcement) { $beginDate = $announcement->getReferedSubjectBegin(); $endDate = $announcement->getReferedSubjectEnd(); if (isset ($beginDate)) { if (!isset ($endDate)) { return getDateWithExtensiveMonth($beginDate); } else { return getResourceMessage("label.from") . " " . getDateWithExtensiveMonth($beginDate) . " " . getResourceMessage("label.to") . " " . getDateWithExtensiveMonth($endDate); } } else { $beginDate = $announcement->getPublicationBegin(); if (isset ($beginDate)) { return getDateWithExtensiveMonth($announcement->getPublicationBegin()); } else { return getDateWithExtensiveMonth($announcement->getCreationDate()); } } } function printAnnouncementDate($announcement) { if (isset ($announcement->referedSubjectBegin) && isset ($announcement->referedSubjectEnd) && $announcement->referedSubjectBegin != $announcement->referedSubjectEnd) { return getResourceMessage("label.from") . " " . getDateWithExtensiveMonth($announcement->getReferedSubjectBegin()) . " " . getResourceMessage("label.to") . " " . getDateWithExtensiveMonth($announcement->getReferedSubjectEnd()); } else if (isset ($announcement->referedSubjectBegin)) { return getDateWithExtensiveMonth($announcement->getReferedSubjectBegin()); } else { $beginDate = $announcement->getPublicationBegin(); if (!isset ($beginDate)) { $beginDate = $announcement->getCreationDate(); } return getDateWithExtensiveMonth($beginDate); } } function printColumnAnnouncementBody($announcement) { if (isset ($announcement->excerpt)) { return $announcement->excerpt; } else { return digestText($announcement->body); } } function printAnnouncementBody($announcement) { if (isset ($announcement->body)) { return $announcement->body; } return ""; } function printAnnouncementAuthor($announcement) { $result = ""; if (isset ($announcement->authorEmail)) { $result .= "authorEmail . ">"; } $result .= $announcement->author; if (isset ($announcement->authorEmail)) { $result .= ""; } return $result; } ?>