function index() { global $viewhelper; require CACHE_COMMON_PATH . "cache_type.php"; $title = L("industry_info", "tpl"); //cal require CLASS_PATH . "calendar.class.php"; $cal = new Calendar(); $cal->setMonthNames(explode(",", L("month_unit", "tpl"))); $cal->setDayNames(explode(",", L("week_unit", "tpl"))); $d = getdate(time()); $day = $_GET['day']; if ($day == "") { $day = $d['mday']; } $month = $_GET['month']; if ($month == "") { $month = $d["mon"]; } $year = $_GET['year']; if ($year == "") { $year = $d["year"]; } if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) { $title .= L("journal", "tpl", $year . $month . $day); setvar("date_line", $year . "-" . $month . "-" . $day); } $viewhelper->setTitle($title); setvar("Calendar", $cal->getMonthView($month, $year)); $cache_id = $year . $month . $day; //end cal render("news/index"); }
/** * возвращает календарь. хтмл. */ public function calendar() { $this->__loadLib("calendar.php"); $this->__implement("calendar"); $year = getRequest('year') ? (int) getRequest('year') : date('Y'); $month = getRequest('month') ? (int) getRequest('month') : date('m'); $calendar = new Calendar(); $lang_id = cmsController::getInstance()->getCurrentLang()->getId(); $lang = langsCollection::getInstance()->getLang($lang_id); if ($lang->getPrefix() == "ru") { $calendar->setMonthNames(array("Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь")); $calendar->setDayNames(array("Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб")); $calendar->setStartDay(1); } $result = $calendar->getMonthView($month, $year); return $result; }
* The contents of this file are subject to the License; you may not use this file except in compliance with the License. * * @version $Revision: 2048 $ */ define('CURSCRIPT', 'index'); require "../libraries/common.inc.php"; require "../share.inc.php"; require CACHE_PATH . "cache_type.php"; uses("news", "newstype"); $news = new Newses(); $newstype = new Newstypes(); $title = L("industry_info", "tpl"); //cal require "../libraries/calendar.class.php"; $cal = new Calendar(); $cal->setMonthNames(explode(",", L("month_unit", "tpl"))); $cal->setDayNames(explode(",", L("week_unit", "tpl"))); $d = getdate(time()); $day = $_GET['day']; if ($day == "") { $day = $d['mday']; } $month = $_GET['month']; if ($month == "") { $month = $d["mon"]; } $year = $_GET['year']; if ($year == "") { $year = $d["year"]; } if (isset($_GET['year']) && isset($_GET['month']) && isset($_GET['day'])) {