echo $row->state ? $this->escape($row->state) : '-'; ?> </td> <?php break; ?> <?php case 'category': ?> <td class="re_category"> <?php $cats = array(); foreach ($row->categories as $cat) { if ($this->params->get('catlinklist', 1) == 1) { $cats[] = JHTML::link(RedeventHelperRoute::getCategoryEventsRoute($cat->slug), $cat->catname); } else { $cats[] = $this->escape($cat->catname); } } echo implode("<br/>", $cats); ?> </td> <?php break; ?> <?php case 'picture': ?> <td class="re_places" itemprop="image"><?php
</dd> <?php } $n = count($this->row->categories); ?> <dt class="category"><?php echo $n < 2 ? JText::_('COM_REDEVENT_CATEGORY') : JText::_('COM_REDEVENT_CATEGORIES'); ?> :</dt> <dd class="category"> <?php $i = 0; foreach ($this->row->categories as $category) { echo JHTML::link(RedeventHelperRoute::getCategoryEventsRoute($category->slug), $this->escape($category->catname)); $i++; if ($i != $n) { echo ','; } } ?> </dd> </dl> <?php $stripped = $this->row->datdescription; $stripped = JFilterOutput::cleanText($stripped); $stripped = trim($stripped); if ($stripped) { ?>
/** * Creates the Categoryevents View * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialize variables $document =& JFactory::getDocument(); $menu =& JSite::getMenu(); $elsettings =& redEVENTHelper::config(); $item = $menu->getActive(); $params =& $mainframe->getParams(); $uri =& JFactory::getURI(); $pathway =& $mainframe->getPathWay(); if (!$this->getLayout()) { $this->setLayout($params->get('default_list_layout')); } /* Check if the item is an object */ if (!is_object($item)) { $item = new StdClass(); $item->title = ''; } //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'); // Request variables $limitstart = JRequest::getInt('limitstart'); $limit = $mainframe->getUserStateFromRequest('com_redevent.categoryevents.limit', 'limit', $params->def('display_num', 0), 'int'); $task = JRequest::getWord('task'); $pop = JRequest::getBool('pop'); //get data from model $rows =& $this->get('Data'); $customs =& $this->get('ListCustomFields'); $customsfilters =& $this->get('CustomFilters'); $category =& $this->get('Category'); $total =& $this->get('Total'); //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } //does the category exist if ($category->id == 0) { return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Category_d_not_found', $category->id)); } //Set Meta data if (!$item->title) { $document->setTitle($category->catname); } else { $document->setTitle($item->title . ' - ' . $category->catname); } $document->setMetadata('keywords', $category->meta_keywords); $document->setDescription(strip_tags($category->meta_description)); //Print function $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($pop) { $params->set('popup', 1); } //add alternate feed link $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug) . '&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); if ($task == 'archive') { $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, 'archive'); $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $category->catname, JRoute::_($link)); $print_link = JRoute::_($link . '&pop=1&tmpl=component'); } else { $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug); $pathway->addItem($category->catname, JRoute::_($link)); $print_link = JRoute::_($link . '&pop=1&tmpl=component'); } $thumb_link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, null, 'thumb'); $list_link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, null, 'default'); //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; } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //Generate Categorydescription if (empty($category->catdescription)) { $catdescription = JText::_('COM_REDEVENT_NO_DESCRIPTION'); } else { //execute plugins $catdescription = JHTML::_('content.prepare', $category->catdescription); } //create select lists $lists = $this->_buildSortLists($elsettings); $state =& $this->get('state'); $filter_customs = $state->get('filter_customs'); $this->assign('lists', $lists); $this->assign('action', JRoute::_('index.php?option=com_redevent&view=categoryevents&id=' . $category->id)); $this->assignRef('rows', $rows); $this->assignRef('customs', $customs); $this->assignRef('noevents', $noevents); $this->assignRef('category', $category); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('task', $task); $this->assignRef('catdescription', $catdescription); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); $this->assignRef('config', $elsettings); $this->assignRef('thumb_link', $thumb_link); $this->assignRef('list_link', $list_link); $this->assignRef('customsfilters', $customsfilters); $this->assign('filter_customs', $filter_customs); $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category')); $cols = redEVENTHelper::validateColumns($cols); $this->assign('columns', $cols); parent::display($tpl); }
function _getTag_category() { // categories $cats = array(); foreach ($this->getEvent()->getData()->categories as $c) { $cats[] = JHTML::link($this->absoluteUrls(RedeventHelperRoute::getCategoryEventsRoute($c->slug)), $c->catname); } return '<span class="details-categories">' . implode(', ', $cats) . '</span>'; }
<div class="events-exports"> <?php if ($this->params->get('events_rsscal', 0)) { ?> <span class="events-rsscal"> <?php echo JHTML::link(JRoute::_(RedeventHelperRoute::getCategoryEventsRoute($this->category->id, null, 'rsscal') . '&format=feed'), JHTML::image('components/com_redevent/assets/images/rsscal2.0.png', JText::_('COM_REDEVENT_EXPORT_RSSCAL'))); ?> </span> <?php } ?> <?php if ($this->params->get('events_ical', 1)) { ?> <span class="events-ical"> <?php echo JHTML::link(JRoute::_(RedeventHelperRoute::getCategoryEventsRoute($this->category->id, null) . '&format=raw&layout=ics'), JHTML::image('components/com_redevent/assets/images/iCal2.0.png', JText::_('COM_REDEVENT_EXPORT_ICS'))); ?> </span> <?php } ?> </div> <!-- end: exports --> <?php } ?> </div>
/** * Method to get the Categories * * @access public * @return array */ function &getData() { $mainframe =& JFactory::getApplication(); $params =& $mainframe->getParams(); $elsettings =& redEVENTHelper::config(); // Lets load the content if it doesn't already exist if (empty($this->_categories)) { $query = $this->_buildQuery(); $this->_categories = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); $count = count($this->_categories); for ($i = 0; $i < $count; $i++) { $category =& $this->_categories[$i]; $category->events = $this->_getEvents($category); $category->assignedevents = $this->_getEventsTotal($category); //Generate description if (empty($category->catdescription)) { $category->catdescription = JText::_('COM_REDEVENT_NO_DESCRIPTION'); } else { //execute plugins $category->catdescription = JHTML::_('content.prepare', $category->catdescription); } //create target link $task = JRequest::getWord('task'); $category->linktext = JText::_('COM_REDEVENT_SHOW_EVENTS'); $category->linktarget = JRoute::_(RedeventHelperRoute::getCategoryEventsRoute($category->slug)); } } return $this->_categories; }
/** * Method to get the Categories * * @access public * @return array */ function &getData() { $elsettings =& redEVENTHelper::config(); // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit')); $k = 0; $count = count($this->_data); for ($i = 0; $i < $count; $i++) { $category =& $this->_data[$i]; //create target link $task = JRequest::getWord('task'); $category->linktext = JText::_('COM_REDEVENT_SHOW_EVENTS'); $category->linktarget = RedeventHelperRoute::getCategoryEventsRoute($category->slug); $k = 1 - $k; } } return $this->_data; }