BxBaseCalendar.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @package Dolphin Core
  4. * @copyright Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
  5. * @license CC-BY - http://creativecommons.org/licenses/by/3.0/
  6. */
  7. defined('BX_DOL') or die('hack attempt');
  8. bx_import ('BxDolCalendar');
  9. /**
  10. * @see BxDolCalendar
  11. */
  12. class BxBaseCalendar extends BxDolCalendar {
  13. function BxBaseCalendar ($iYear, $iMonth) {
  14. parent::BxDolCalendar($iYear, $iMonth);
  15. }
  16. function display() {
  17. $oTemplate = BxDolTemplate::getInstance();
  18. $aVars = array (
  19. 'bx_repeat:week_names' => $this->_getWeekNames (),
  20. 'bx_repeat:calendar_row' => $this->_getCalendar (),
  21. 'month_prev_url' => $this->getBaseUri () . "{$this->iPrevYear}/{$this->iPrevMonth}",
  22. 'month_prev_name' => _t('_month_prev'),
  23. 'month_prev_icon' => getTemplateIcon('sys_back.png'),
  24. 'month_next_url' => $this->getBaseUri () . "{$this->iNextYear}/{$this->iNextMonth}",
  25. 'month_next_name' => _t('_month_next'),
  26. 'month_next_icon' => getTemplateIcon('sys_next.png'),
  27. 'month_current' => $this->getTitle(),
  28. );
  29. $sHtml = $oTemplate->parseHtmlByName('calendar.html', $aVars);
  30. $sHtml = preg_replace ('#<bx_repeat:events>.*?</bx_repeat:events>#s', '', $sHtml); // TODO: check this line and remove if unused
  31. $oTemplate->addCss('calendar.css');
  32. return $sHtml;
  33. }
  34. }