Exemplo n.º 1
0
 /**
  * Creates the Day View
  *
  * @since 0.9
  */
 function display($tpl = null)
 {
     $mainframe =& JFactory::getApplication();
     //initialize variables
     $document =& JFactory::getDocument();
     $elsettings =& redEVENTHelper::config();
     $menu =& JSite::getMenu();
     $item = $menu->getActive();
     $params =& $mainframe->getParams();
     $uri =& JFactory::getURI();
     //add css file
     if (!$params->get('custom_css')) {
         $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css');
     } else {
         $document->addStyleSheet($params->get('custom_css'));
     }
     $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->');
     // add js
     JHTML::_('behavior.mootools');
     // for filter hint
     $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js');
     // get variables
     $limitstart = JRequest::getVar('limitstart', 0, '', 'int');
     $limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int');
     $pop = JRequest::getBool('pop');
     $pathway =& $mainframe->getPathWay();
     //get data from model
     $rows =& $this->get('Data');
     $customs =& $this->get('ListCustomFields');
     $total =& $this->get('Total');
     $day =& $this->get('Day');
     $daydate = strftime($elsettings->get('formatdate', '%d.%m.%Y'), strtotime($day));
     //are events available?
     if (!$rows) {
         $noevents = 1;
     } else {
         $noevents = 0;
     }
     //params
     if ($item) {
         $params->def('page_title', $item->title);
     }
     if ($pop) {
         //If printpopup set true
         $params->set('popup', 1);
     }
     $print_link = JRoute::_('index.php?view=day&tmpl=component&pop=1');
     //pathway
     $pathway->addItem($daydate, '');
     //Set Page title
     if ($item && !$item->title) {
         $document->setTitle($params->get('page_title'));
         $document->setMetadata('keywords', $params->get('page_title'));
     }
     //Check if the user has access to the form
     $maintainer = ELUser::ismaintainer();
     $genaccess = ELUser::validate_user($elsettings->get('evdelrec'), $elsettings->get('delivereventsyes'));
     if ($maintainer || $genaccess) {
         $dellink = 1;
     }
     //add alternate feed link
     $link = 'index.php?option=com_redevent&view=simplelist&format=feed';
     $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
     $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
     $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
     $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
     // Create the pagination object
     $page = $total - $limit;
     jimport('joomla.html.pagination');
     $pageNav = new JPagination($total, $limitstart, $limit);
     //create select lists
     $lists = $this->_buildSortLists();
     $this->assign('lists', $lists);
     $this->assignRef('rows', $rows);
     $this->assignRef('customs', $customs);
     $this->assignRef('noevents', $noevents);
     $this->assignRef('print_link', $print_link);
     $this->assignRef('params', $params);
     $this->assignRef('dellink', $dellink);
     $this->assignRef('pageNav', $pageNav);
     $this->assignRef('page', $page);
     $this->assignRef('elsettings', $elsettings);
     $this->assignRef('lists', $lists);
     $this->assignRef('daydate', $daydate);
     $this->assign('action', JRoute::_(RedeventHelperRoute::getDayRoute(JRequest::getInt('id'))));
     $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category'));
     $cols = redEVENTHelper::validateColumns($cols);
     $this->assign('columns', $cols);
     parent::display($tpl);
 }
Exemplo n.º 2
0
 function mkDay($var)
 {
     $eventContent = $this->mkEventContent($var);
     $linkstr = $this->mkUrl($this->actyear, $this->actmonth, $var);
     if ($eventContent) {
         if ($this->javaScriptDay) {
             $linkstr = "<a href=\"javascript:" . $this->javaScriptDay . "(" . $this->actyear . "," . $this->actmonth . "," . $var . ")\">" . $var . "</a>";
         } else {
             $dayurl = JRoute::_(RedeventHelperRoute::getDayRoute(sprintf('%04d%02d%02d', $this->actyear, $this->actmonth, $var)));
             $linkstr = "<a href=\"" . $dayurl . "\">" . $var . "</a>";
         }
     } else {
         $linkstr = $var;
     }
     if ($this->isEvent($var)) {
         if ($this->eventUrl) {
             $out = "<td class=\"" . $this->eventID . "\"><div class=\"daynum\"><a href=\"" . $this->eventUrl . "\">" . $var . "</div></a>" . $eventContent . "</td>";
             $this->eventUrl = false;
         } else {
             if (!$this->dayLinks) {
                 $out = "<td class=\"" . $this->eventID . "\"><div class=\"daynum\">" . $var . '</div>' . $eventContent . "</td>";
             } else {
                 $out = "<td class=\"" . $this->eventID . "\"><div class=\"daynum\">" . $linkstr . '</div>' . $eventContent . "</td>";
             }
         }
     } else {
         if ($var == $this->selectedday && $this->actmonth == $this->selectedmonth && $this->actyear == $this->selectedyear) {
             if (!$this->dayLinks) {
                 $out = "<td class=\"" . $this->cssSelecDay . "\"><div class=\"daynum\">" . $var . '</div>' . $eventContent . "</td>";
             } else {
                 $out = "<td class=\"" . $this->cssSelecDay . "\"><div class=\"daynum\">" . $linkstr . '</div>' . $eventContent . "</td>";
             }
         } else {
             if ($var == $this->daytoday && $this->actmonth == $this->monthtoday && $this->actyear == $this->yeartoday) {
                 if (!$this->dayLinks) {
                     $out = "<td class=\"" . $this->cssToday . "\"><div class=\"daynum\">" . $var . '</div>' . $eventContent . "</td>";
                 } else {
                     $out = "<td class=\"" . $this->cssToday . "\"><div class=\"daynum\">" . $linkstr . '</div>' . $eventContent . "</td>";
                 }
             } else {
                 if ($this->getWeekday($var) == 0 && $this->crSunClass) {
                     if (!$this->dayLinks) {
                         $out = "<td class=\"" . $this->cssSunday . "\"><div class=\"daynum\">" . $var . '</div>' . $eventContent . "</td>";
                     } else {
                         $out = "<td class=\"" . $this->cssSunday . "\"><div class=\"daynum\">" . $linkstr . '</div>' . $eventContent . "</td>";
                     }
                 } else {
                     if ($this->getWeekday($var) == 6 && $this->crSatClass) {
                         if (!$this->dayLinks) {
                             $out = "<td class=\"" . $this->cssSaturday . "\"><div class=\"daynum\">" . $var . '</div>' . $eventContent . "</td>";
                         } else {
                             $out = "<td class=\"" . $this->cssSaturday . "\"><div class=\"daynum\">" . $linkstr . '</div>' . $eventContent . "</td>";
                         }
                     } else {
                         if (!$this->dayLinks) {
                             $out = "<td class=\"" . $this->cssMonthDay . "\"><div class=\"daynum\">" . $var . '</div>' . $eventContent . "</td>";
                         } else {
                             $out = "<td class=\"" . $this->cssMonthDay . "\"><div class=\"daynum\">" . $linkstr . '</div>' . $eventContent . "</td>";
                         }
                     }
                 }
             }
         }
     }
     return $out;
 }