예제 #1
0
 /**
  * Creates the Calendar View
  *
  * @since 1.1
  */
 function display($tpl = null)
 {
     $app =& JFactory::getApplication();
     // Load tooltips behavior
     JHTML::_('behavior.tooltip');
     //initialize variables
     $document =& JFactory::getDocument();
     $menu =& JSite::getMenu();
     $elsettings =& ELHelper::config();
     $item = $menu->getActive();
     $params =& $app->getParams();
     $uri =& JFactory::getURI();
     $pathway =& $app->getPathWay();
     //add css file
     $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css');
     $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->');
     $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlistcalendar.css');
     // add javascript
     $document->addScript($this->baseurl . '/components/com_eventlist/assets/js/calendar.js');
     $year = (int) JRequest::getVar('yearID', strftime("%Y"));
     $month = (int) JRequest::getVar('monthID', strftime("%m"));
     //get data from model and set the month
     $model =& $this->getModel();
     $model->setDate(mktime(0, 0, 1, $month, 1, $year));
     $rows =& $this->get('Data');
     //Set Meta data
     $document->setTitle($item->name);
     //Set Page title
     $pagetitle = $params->def('page_title', $item->name);
     $app->setPageTitle($pagetitle);
     $app->addMetaTag('title', $pagetitle);
     //init calendar
     $cal = new ELCalendar($year, $month, 0, $app->getCfg('offset'));
     $cal->enableMonthNav('index.php?view=calendar');
     $cal->setFirstWeekDay($params->get('firstweekday', 1));
     $cal->enableDayLinks(false);
     $this->assignRef('rows', $rows);
     $this->assignRef('params', $params);
     $this->assignRef('elsettings', $elsettings);
     $this->assignRef('cal', $cal);
     parent::display($tpl);
 }