예제 #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);
 }
예제 #2
0
 * as published by the Free Software Foundation.
 * EventList is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with EventList; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
?>

<?php 
require_once JPATH_COMPONENT_SITE . DS . 'classes' . DS . 'calendar.class.php';
$cal = new ELCalendar($this->year, $this->month, $this->day);
$cal->enableMonthNav('index.php?view=categoryevents&layout=calendar&id=' . $this->category->slug);
$cal->setFirstWeekDay(1);
foreach ($this->rows as $row) {
    $year = JHTML::date($row->dates, "%Y");
    $month = JHTML::date($row->dates, "%m");
    $day = JHTML::date($row->dates, "%d");
    if ($this->elsettings->showtime == 1) {
        $time = $row->times;
    }
    //Link to details
    $detaillink = JRoute::_('index.php?view=details&cid=' . $this->category->slug . '&id=' . $row->slug);
    //title
    if ($this->elsettings->showtitle == 1 && $this->elsettings->showdetails == 1) {
        $title = $this->escape($row->title);
    }