/** * Creates the Event Feed of the Category */ function display() { $app = JFactory::getApplication(); $doc = JFactory::getDocument(); // Get some data from the model $app->input->set('limit', $app->getCfg('feed_limit')); $rows = $this->get('Items'); if (!empty($rows)) { foreach ($rows as $row) { // strip html from feed item title $title = $this->escape($row->title); $title = html_entity_decode($title); // strip html from feed item category if (!empty($row->categories)) { $category = array(); foreach ($row->categories AS $category2) { $category[] = $category2->catname; } // adding the , to the list when there are multiple category's $category = $this->escape(implode(', ', $category)); $category = html_entity_decode($category); } else { $category = ''; } //Format date and time $displaydate = JemOutput::formatLongDateTime($row->dates, $row->times,$row->enddates, $row->endtimes); // url link to event $link = JRoute::_(JemHelperRoute::getEventRoute($row->id)); // feed item description text $description = JText::_('COM_JEM_TITLE').': '.$title.'<br />'; $description .= JText::_('COM_JEM_VENUE').': '.$row->venue.' / '.$row->city.'<br />'; $description .= JText::_('COM_JEM_CATEGORY').': '.$category.'<br />'; $description .= JText::_('COM_JEM_DATE').': '.$displaydate.'<br />'; $description .= JText::_('COM_JEM_DESCRIPTION').': '.$row->fulltext; $created = ($row->created ? date('r', strtotime($row->created)) : ''); // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->date = $created; $item->category = $category; // loads item info into rss array $doc->addItem($item); } } }
public function getObjectLink($id) { $db = JFactory::getDBO(); $query = 'SELECT a.id, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(\':\', a.id, a.alias) ELSE a.id END as slug' . ' FROM #__jem_events AS a' . ' WHERE id = ' . $id; $db->setQuery($query); $slug = $db->loadResult(); $JEMRouter = JPATH_SITE . '/components/com_jem/helpers/route.php'; if (is_file($JEMRouter)) { require_once $JEMRouter; $link = JRoute::_(JemHelperRoute::getEventRoute($slug)); } else { $link = JRoute::_('index.php?option=com_jem&view=event&id=' . $slug); } return $link; }
} ?> <td headers="jem_date" align="left"> <?php echo JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes); echo JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes); ?> </td> <?php if ($this->jemsettings->showtitle == 1 && $this->jemsettings->showdetails == 1) { ?> <td headers="jem_title" align="left" valign="top"> <a href="<?php echo JRoute::_(JemHelperRoute::getEventRoute($row->slug)); ?> " itemprop="url"> <span itemprop="name"><?php echo $this->escape($row->title) . JemOutput::recurrenceicon($row); ?> </span> </a> </td> <?php } ?> <?php if ($this->jemsettings->showtitle == 1 && $this->jemsettings->showdetails == 0) { ?>
static function icalAddEvent(&$calendartool, $event, $rows) { require_once JPATH_SITE . '/components/com_jem/classes/iCalcreator.class.php'; $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $config = JFactory::getConfig(); $sitename = $config->get('sitename'); # retrieve TimezoneName # if we have a timezone for the venue then that info will be used for the output if ($event->timezone) { # venue - timeZone $timezone_name = $event->timezone; } else { # global - TimeZone $timezone_name = JemHelper::getTimeZoneName(); } // get categories names $categories = array(); foreach ($event->categories as $c) { $categories[] = $c->catname; } // no start date... $validdate = JemHelper::isValidDate($event->dates); if (!$event->dates || !$validdate) { return false; } // make end date same as start date if not set if (!$event->enddates) { $event->enddates = $event->dates; } // start if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/', $event->dates, $start_date)) { JError::raiseError(0, JText::_('COM_JEM_ICAL_EXPORT_WRONG_STARTDATE_FORMAT')); } $date = array('year' => (int) $start_date[1], 'month' => (int) $start_date[2], 'day' => (int) $start_date[3]); // all day event if start time is not set if (!$event->times) { $dateparam = array('VALUE' => 'DATE'); // for ical all day events, dtend must be send to the next day $event->enddates = strftime('%Y-%m-%d', strtotime($event->enddates . ' +1 day')); if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/', $event->enddates, $end_date)) { JError::raiseError(0, JText::_('COM_JEM_ICAL_EXPORT_WRONG_ENDDATE_FORMAT')); } $date_end = array('year' => $end_date[1], 'month' => $end_date[2], 'day' => $end_date[3]); $dateendparam = array('VALUE' => 'DATE'); } else { if (!preg_match('/([0-9]{2}):([0-9]{2}):([0-9]{2})/', $event->times, $start_time)) { JError::raiseError(0, JText::_('COM_JEM_ICAL_EXPORT_WRONG_STARTTIME_FORMAT')); } $date['hour'] = $start_time[1]; $date['min'] = $start_time[2]; $date['sec'] = $start_time[3]; $dateparam = array('VALUE' => 'DATE-TIME'); if ($settings->get('ical_tz', 0) == 1) { $dateparam['TZID'] = $timezone_name; } if (!$event->endtimes || $event->endtimes == '00:00:00') { $event->endtimes = $event->times; } // if same day but end time < start time, change end date to +1 day if ($event->enddates == $event->dates && strtotime($event->dates . ' ' . $event->endtimes) < strtotime($event->dates . ' ' . $event->times)) { $event->enddates = strftime('%Y-%m-%d', strtotime($event->enddates . ' +1 day')); } if (!preg_match('/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/', $event->enddates, $end_date)) { JError::raiseError(0, JText::_('COM_JEM_ICAL_EXPORT_WRONG_ENDDATE_FORMAT')); } $date_end = array('year' => $end_date[1], 'month' => $end_date[2], 'day' => $end_date[3]); if (!preg_match('/([0-9]{2}):([0-9]{2}):([0-9]{2})/', $event->endtimes, $end_time)) { JError::raiseError(0, JText::_('COM_JEM_ICAL_EXPORT_WRONG_STARTTIME_FORMAT')); } $date_end['hour'] = $end_time[1]; $date_end['min'] = $end_time[2]; $date_end['sec'] = $end_time[3]; $dateendparam = array('VALUE' => 'DATE-TIME'); if ($settings->get('ical_tz') == 1) { $dateendparam['TZID'] = $timezone_name; } } // item description text $description = $event->title . '\\n'; $description .= JText::_('COM_JEM_CATEGORY') . ': ' . implode(', ', $categories) . '\\n'; $link = JURI::root() . JemHelperRoute::getEventRoute($event->slug); $link = JRoute::_($link); $description .= JText::_('COM_JEM_ICS_LINK') . ': ' . $link . '\\n'; // location $location = array($event->venue); if (isset($event->street) && !empty($event->street)) { $location[] = $event->street; } if (isset($event->postalCode) && !empty($event->postalCode) && isset($event->city) && !empty($event->city)) { $location[] = $event->postalCode . ' ' . $event->city; } else { if (isset($event->postalCode) && !empty($event->postalCode)) { $location[] = $event->postalCode; } if (isset($event->city) && !empty($event->city)) { $location[] = $event->city; } } if (isset($event->countryname) && !empty($event->countryname)) { $exp = explode(",", $event->countryname); $location[] = $exp[0]; } $location = implode(",", $location); $e = new vevent(); $e->setProperty('summary', $event->title); $e->setProperty('categories', implode(', ', $categories)); $e->setProperty('dtstart', $date, $dateparam); if (count($date_end)) { $e->setProperty('dtend', $date_end, $dateendparam); } $e->setProperty('description', $description); if ($location != '') { $e->setProperty('location', $location); } $e->setProperty('url', $link); $e->setProperty('uid', 'event' . $event->id . '@' . $sitename); $calendartool->addComponent($e); // add component to calendar return true; }
<a href="<?php echo JRoute::_(JemHelperRoute::getEventRoute($row->slug)); ?>" itemprop="url"> <span itemprop="name"><?php echo $this->escape($row->title) . JemOutput::recurrenceicon($row); ?></span> </a><?php echo JemOutput::publishstateicon($row); ?> </td> <?php endif; ?> <?php if (($this->jemsettings->showtitle == 1) && ($this->jemsettings->showdetails == 0)) : ?> <td headers="jem_title" align="left" valign="top" itemprop="name"> <?php echo $this->escape($row->title) . JemOutput::recurrenceicon($row) . JemOutput::publishstateicon($row); ?> </td> <?php endif; ?> <?php if ($this->jemsettings->showlocate == 1) : ?> <td headers="jem_location" align="left" valign="top"> <?php if ($this->jemsettings->showlinkvenue == 1) : ?> <?php echo !empty($row->locid) ? "<a href='".JRoute::_(JemHelperRoute::getVenueRoute($row->venueslug))."'>".$this->escape($row->venue)."</a>" : '-'; ?> <?php else : ?> <?php echo !empty($row->locid) ? $this->escape($row->venue) : '-'; ?> <?php endif; ?> </td> <?php endif; ?> <?php if ($this->jemsettings->showcity == 1) : ?> <td headers="jem_city" align="left" valign="top"> <?php echo !empty($row->city) ? $this->escape($row->city) : '-'; ?> </td> <?php endif; ?> <?php if ($this->jemsettings->showstate == 1) : ?> <td headers="jem_state" align="left" valign="top"> <?php echo !empty($row->state) ? $this->escape($row->state) : '-'; ?>
foreach ($this->venues as $i => $row) { ?> <tr class="row<?php echo $i % 2; ?> "> <?php if ($this->jemsettings->showlocate == 1) { ?> <td class="jem_location"> <?php if ($this->jemsettings->showlinkvenue == 1) { ?> <?php echo $row->id != 0 ? "<a href='" . JRoute::_(JemHelperRoute::getVenueRoute($row->venueslug)) . "'>" . $this->escape($row->venue) . "</a>" : '-'; ?> <?php } else { ?> <?php echo $row->id ? $this->escape($row->venue) : '-'; ?> <?php } ?> </td> <?php } ?>
/** * Creates the Venue View */ function display($tpl = null) { if ($this->getLayout() == 'calendar') { ### Venue Calendar view ### $app = JFactory::getApplication(); // Load tooltips behavior JHtml::_('behavior.tooltip'); // initialize variables $document = JFactory::getDocument(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $jemsettings = JEMHelper::config(); $params = $app->getParams(); $uri = JFactory::getURI(); $pathway = $app->getPathWay(); $jinput = $app->input; $print = $jinput->getBool('print', false); $user = JemFactory::getUser(); // Load css JemHelper::loadCss('jem'); JemHelper::loadCss('calendar'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } $evlinkcolor = $params->get('eventlinkcolor'); $evbackgroundcolor = $params->get('eventbackgroundcolor'); $currentdaycolor = $params->get('currentdaycolor'); $eventandmorecolor = $params->get('eventandmorecolor'); $style = ' div#jem .eventcontentinner a, div#jem .eventandmore a {color:' . $evlinkcolor . ';} .eventcontentinner {background-color:'.$evbackgroundcolor .';} .eventandmore {background-color:' . $eventandmorecolor . ';} .today .daynum {background-color:' . $currentdaycolor . ';}'; $document->addStyleDeclaration ($style); // add javascript (using full path - see issue #590) JHtml::_('script', 'media/com_jem/js/calendar.js'); // Retrieve year/month variables $year = $jinput->get('yearID', strftime("%Y"),'int'); $month = $jinput->get('monthID', strftime("%m"),'int'); // get data from model and set the month $model = $this->getModel('VenueCal'); $model->setDate(mktime(0, 0, 1, $month, 1, $year)); $rows = $this->get('Items','VenueCal'); // Set Page title $pagetitle = $params->def('page_title', $menuitem->title); $params->def('page_heading', $params->get('page_title')); $pageclass_sfx = $params->get('pageclass_sfx'); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } $document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); // Check if the user has permission to add things $permissions = new stdClass(); $permissions->canAddEvent = $user->can('add', 'event'); $permissions->canAddVenue = $user->can('add', 'venue'); $itemid = $jinput->getInt('Itemid', 0); $venueID = $jinput->getInt('id', $params->get('id')); $partItemid = ($itemid > 0) ? '&Itemid=' . $itemid : ''; $partVenid = ($venueID > 0) ? '&id=' . $venueID : ''; $partLocid = ($venueID > 0) ? '&locid=' . $venueID : ''; $partDate = ($year ? ('&yearID=' . $year) : '') . ($month ? ('&monthID=' . $month) : ''); $url_base = 'index.php?option=com_jem&view=venue&layout=calendar' . $partVenid . $partItemid; $print_link = JRoute::_($url_base . $partDate . '&print=1&tmpl=component'); // init calendar $cal = new JEMCalendar($year, $month, 0); $cal->enableMonthNav($url_base . ($print ? '&print=1&tmpl=component' : '')); $cal->setFirstWeekDay($params->get('firstweekday',1)); $cal->enableDayLinks('index.php?option=com_jem&view=day'.$partLocid); // map variables $this->rows = $rows; $this->locid = $venueID; $this->params = $params; $this->jemsettings = $jemsettings; $this->permissions = $permissions; $this->cal = $cal; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); $this->print_link = $print_link; } else { ### Venue List view ### // initialize variables $app = JFactory::getApplication(); $document = JFactory::getDocument(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $params = $app->getParams('com_jem'); $pathway = $app->getPathWay (); $uri = JFactory::getURI(); $jinput = $app->input; $task = $jinput->getCmd('task', ''); $print = $jinput->getBool('print', false); $user = JemFactory::getUser(); $itemid = $app->input->getInt('id', 0) . ':' . $app->input->getInt('Itemid', 0); // Load css JemHelper::loadCss('jem'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } // get data from model $rows = $this->get('Items'); $venue = $this->get('Venue'); // check for data error if (empty($venue)) { $app->enqueueMessage(JText::_('COM_JEM_VENUE_ERROR_VENUE_NOT_FOUND'), 'error'); return false; } // are events available? $noevents = (!$rows) ? 1 : 0; // Decide which parameters should take priority $useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'venue' && (!isset($menuitem->query['layout']) || $menuitem->query['layout'] == 'default') && $menuitem->query['id'] == $venue->id); // get search & user-state variables $filter_order = $app->getUserStateFromRequest('com_jem.venue.'.$itemid.'.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_DirDefault = 'ASC'; // Reverse default order for dates in archive mode if($task == 'archive' && $filter_order == 'a.dates') { $filter_order_DirDefault = 'DESC'; } $filter_order_Dir = $app->getUserStateFromRequest('com_jem.venue.'.$itemid.'.filter_order_Dir', 'filter_order_Dir', $filter_order_DirDefault, 'word'); $filter_type = $app->getUserStateFromRequest('com_jem.venue.'.$itemid.'.filter_type', 'filter_type', '', 'int'); $search = $app->getUserStateFromRequest('com_jem.venue.'.$itemid.'.filter_search', 'filter_search', '', 'string'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // Get image $limage = JemImage::flyercreator($venue->locimage,'venue'); // Add feed links $link = '&format=feed&id='.$venue->id.'&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); // pathway, page title, page heading if ($useMenuItemParams) { $pagetitle = $params->get('page_title', $menuitem->title ? $menuitem->title : $venue->venue); $pageheading = $params->get('page_heading', $pagetitle); $pathway->setItemName(1, $menuitem->title); } else { $pagetitle = $venue->venue; $pageheading = $pagetitle; $params->set('show_page_heading', 1); // ensure page heading is shown $pathway->addItem($pagetitle, JRoute::_(JemHelperRoute::getVenueRoute($venue->slug))); } $pageclass_sfx = $params->get('pageclass_sfx'); // create the pathway if ($task == 'archive') { $pathway->addItem (JText::_('COM_JEM_ARCHIVE'), JRoute::_(JemHelperRoute::getVenueRoute($venue->slug).'&task=archive')); $print_link = JRoute::_(JEMHelperRoute::getVenueRoute($venue->slug).'&task=archive&print=1&tmpl=component'); $pagetitle .= ' - ' . JText::_('COM_JEM_ARCHIVE'); $pageheading .= ' - ' . JText::_('COM_JEM_ARCHIVE'); } else { //$pathway->addItem($venue->venue, JRoute::_(JEMHelperRoute::getVenueRoute($venue->slug))); $print_link = JRoute::_(JemHelperRoute::getVenueRoute($venue->slug).'&print=1&tmpl=component'); } $params->set('page_heading', $pageheading); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } // set Page title & Meta data $document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); $document->setMetadata('keywords', $venue->meta_keywords); $document->setDescription(strip_tags($venue->meta_description)); // Check if the user has permission to add things $permissions = new stdClass(); $permissions->canAddEvent = $user->can('add', 'event'); $permissions->canAddVenue = $user->can('add', 'venue'); // Check if the user has permission to edit-this venue $permissions->canEditVenue = $user->can('edit', 'venue', $venue->id, $venue->created_by); $permissions->canEditPublishVenue = $user->can(array('edit', 'publish'), 'venue', $venue->id, $venue->created_by); // Generate Venuedescription if (!$venue->locdescription == '' || !$venue->locdescription == '<br />') { // execute plugins $venue->text = $venue->locdescription; $venue->title = $venue->venue; JPluginHelper::importPlugin ('content'); $app->triggerEvent ('onContentPrepare', array ( 'com_jem.venue', &$venue, &$params, 0 )); $venuedescription = $venue->text; } // build the url if (!empty($venue->url) && !preg_match('%^http(s)?://%', $venue->url)) { $venue->url = 'http://' . $venue->url; } // prepare the url for output if (strlen($venue->url) > 35) { $venue->urlclean = $this->escape(substr($venue->url, 0, 35 )) . '...'; } else { $venue->urlclean = $this->escape($venue->url); } // create flag if ($venue->country) { $venue->countryimg = JemHelperCountries::getCountryFlag($venue->country); } // Create the pagination object $pagination = $this->get('Pagination'); // filters $filters = array (); // ALL events have the same venue - so hide this from filter and list $jemsettings->showlocate = 0; if ($jemsettings->showtitle == 1) { $filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_TITLE')); } if ($jemsettings->showlocate == 1) { $filters[] = JHtml::_('select.option', '2', JText::_('COM_JEM_VENUE')); } if ($jemsettings->showcity == 1) { $filters[] = JHtml::_('select.option', '3', JText::_('COM_JEM_CITY')); } if ($jemsettings->showcat == 1) { $filters[] = JHtml::_('select.option', '4', JText::_('COM_JEM_CATEGORY')); } if ($jemsettings->showstate == 1) { $filters[] = JHtml::_('select.option', '5', JText::_('COM_JEM_STATE')); } $lists['filter'] = JHtml::_('select.genericlist', $filters, 'filter_type', array('size'=>'1','class'=>'inputbox'), 'value', 'text', $filter_type); $lists['search'] = $search; // mapping variables $this->lists = $lists; $this->action = $uri->toString(); $this->rows = $rows; $this->noevents = $noevents; $this->venue = $venue; $this->print_link = $print_link; $this->params = $params; $this->limage = $limage; $this->venuedescription = $venuedescription; $this->pagination = $pagination; $this->jemsettings = $jemsettings; $this->settings = $settings; $this->permissions = $permissions; $this->show_status = $permissions->canEditPublishVenue; $this->item = $menuitem; $this->pagetitle = $pagetitle; $this->task = $task; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); } parent::display($tpl); }
/** * Get a category names list * @param unknown $categories Category List * @param boolean $doLink Link the categories to the respective Category View * @return string|multitype: */ static function getCategoryList($categories, $doLink, $backend = false, $FixItemID = false) { $output = array_map(function ($category) use($doLink, $backend, $FixItemID) { if ($doLink) { if ($backend) { $path = $category->path; $path = str_replace('/', ' » ', $path); $value = '<span class="hasTooltip" title="' . JHtml::tooltipText(JText::_('COM_JEM_EDIT_CATEGORY'), $path, 0) . '">'; $value .= '<a href="index.php?option=com_jem&task=category.edit&id=' . $category->id . '">' . $category->catname . '</a>'; $value .= '</span>'; } else { if ($FixItemID) { $value = '<a href="' . JRoute::_('index.php?option=com_jem&view=category&id=' . $category->catslug . '&Itemid=' . $FixItemID) . '">' . $category->catname . '</a>'; } else { $value = '<a href="' . JRoute::_(JemHelperRoute::getCategoryRoute($category->catslug)) . '">' . $category->catname . '</a>'; } } } else { $value = $category->catname; } return $value; }, $categories); return $output; }
/** * Creates the output for the Event view */ function display($tpl = null) { $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $app = JFactory::getApplication(); $user = JemFactory::getUser(); $userId = $user->get('id'); $dispatcher = JDispatcher::getInstance(); $document = JFactory::getDocument(); $model = $this->getModel(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $pathway = $app->getPathway(); $this->params = $app->getParams('com_jem'); $this->item = $this->get('Item'); $this->print = $app->input->getBool('print', false); $this->state = $this->get('State'); $this->user = $user; $this->jemsettings = $jemsettings; $this->settings = $settings; $categories = isset($this->item->categories) ? $this->item->categories : $this->get('Categories'); $this->categories = $categories; $this->registers = $model->getRegisters($this->state->get('event.id')); $isregistered = $this->get('UserIsRegistered'); // check for data error if (empty($this->item)) { $app->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error'); return false; } // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Create a shortcut for $item and params. $item = $this->item; $params = $this->params; // Decide which parameters should take priority $useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'event' && $menuitem->query['id'] == $item->id); // Add router helpers. $item->slug = $item->alias ? ($item->id.':'.$item->alias) : $item->id; $item->venueslug = $item->localias ? ($item->locid.':'.$item->localias) : $item->locid; // Check to see which parameters should take priority if ($useMenuItemParams) { // Merge so that the menu item params take priority $pagetitle = $params->def('page_title', $menuitem->title ? $menuitem->title : $item->title); $params->def('page_heading', $pagetitle); $pathway->setItemName(1, $menuitem->title); // Load layout from active query (in case it is an alternative menu item) if (isset($menuitem->query['layout'])) { $this->setLayout($menuitem->query['layout']); } else // Single-event menu item layout takes priority over alt layout for an event if ($layout = $item->params->get('event_layout')) { $this->setLayout($layout); } $item->params->merge($params); } else { // Merge the menu item params with the event params so that the event params take priority $pagetitle = $item->title; $params->set('page_title', $pagetitle); $params->set('page_heading', $pagetitle); $params->set('show_page_heading', 1); // ensure page heading is shown $pathway->addItem($pagetitle, JRoute::_(JemHelperRoute::getEventRoute($item->slug))); // Check for alternative layouts (since we are not in a single-event menu item) // Single-event menu item layout takes priority over alt layout for an event if ($layout = $item->params->get('event_layout')) { $this->setLayout($layout); } $temp = clone($params); $temp->merge($item->params); $item->params = $temp; } $offset = $this->state->get('list.offset'); // Check the view access to the event (the model has already computed the values). if (!$item->params->get('access-view')) { // && !$item->params->get('show_noauth') && $user->get('guest')) { - not supported yet JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); return; } if ($item->params->get('show_intro', '1') == '1') { $item->text = $item->introtext.' '.$item->fulltext; } elseif ($item->fulltext) { $item->text = $item->fulltext; } else { $item->text = $item->introtext; } // Process the content plugins // JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onContentPrepare', array ('com_jem.event', &$item, &$this->params, $offset)); $item->event = new stdClass(); $results = $dispatcher->trigger('onContentAfterTitle', array('com_jem.event', &$item, &$this->params, $offset)); $item->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_jem.event', &$item, &$this->params, $offset)); $item->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onContentAfterDisplay', array('com_jem.event', &$item, &$this->params, $offset)); $item->event->afterDisplayContent = trim(implode("\n", $results)); // Increment the hit counter of the event. if (!$this->params->get('intro_only') && $offset == 0) { $model->hit(); } // Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->item->params->get('pageclass_sfx')); $this->print_link = JRoute::_(JemHelperRoute::getRoute($item->slug).'&print=1&tmpl=component'); // Get images $this->dimage = JemImage::flyercreator($item->datimage, 'event'); $this->limage = JemImage::flyercreator($item->locimage, 'venue'); // Check if the user has permission to add things $permissions = new stdClass(); $permissions->canAddEvent = $user->can('add', 'event'); $permissions->canAddVenue = $user->can('add', 'venue'); // Check if user can edit the event $permissions->canEditEvent = $user->can('edit', 'event', $item->id, $item->created_by); $permissions->canPublishEvent = $user->can('publish', 'event', $item->id, $item->created_by); // Check if user can edit the venue $permissions->canEditVenue = $user->can('edit', 'venue', $item->locid, $item->venueowner); $permissions->canPublishVenue = $user->can('publish', 'venue', $item->locid, $item->venueowner); $this->permissions = $permissions; $this->showeventstate = $permissions->canEditEvent || $permissions->canPublishEvent; $this->showvenuestate = $permissions->canEditVenue || $permissions->canPublishVenue; // Timecheck for registration $now = strtotime(date("Y-m-d")); $date = empty($item->dates) ? $now : strtotime($item->dates); $enddate = empty($item->enddates) ? $date : strtotime($item->enddates); $timecheck = $now - $date; // on open date $timecheck is 0 // let's build the registration handling $formhandler = 0; // too late to unregister if ($isregistered) { // is the user allready registered at the event if ($now <= $enddate) { // allows unregister on open date $formhandler = 3; } } elseif ($timecheck > 0) { // check if it is too late to register and overwrite $formhandler $formhandler = 1; } elseif (!$userId) { // user doesn't have an ID (mostly guest) $formhandler = 2; } else { $formhandler = 4; } if ($formhandler >= 3) { $js = "function check(checkbox, send) { if(checkbox.checked==true){ send.disabled = false; } else { send.disabled = true; }}"; $document->addScriptDeclaration($js); } $this->formhandler = $formhandler; // generate Metatags $meta_keywords = array(); if (!empty($this->item->meta_keywords)) { $keywords = explode(",", $this->item->meta_keywords); foreach ($keywords as $keyword) { if (preg_match("/[\/[\/]/", $keyword)) { $keyword = trim(str_replace("[", "", str_replace("]", "", $keyword))); $buffer = $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate); if (!empty($buffer)) { $meta_keywords[] = $buffer; } } else { $meta_keywords[] = $keyword; } } $document->setMetadata('keywords', implode(', ', $meta_keywords)); } if (!empty($this->item->meta_description)) { $description = explode("[", $this->item->meta_description); $description_content = ""; foreach ($description as $desc) { $keyword = substr($desc, 0, strpos($desc, "]", 0)); if ($keyword != "") { $description_content .= $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate); $description_content .= substr($desc, strpos($desc, "]", 0) + 1); } else { $description_content .= $desc; } } } else { $description_content = ""; } $document->setDescription(strip_tags($description_content)); // load dispatcher for JEM plugins (comments) $item->pluginevent = new stdClass(); if ($this->print) { $item->pluginevent->onEventEnd = false; } else { JPluginHelper::importPlugin('jem', 'comments'); $results = $dispatcher->trigger('onEventEnd', array($item->did, $this->escape($item->title))); $item->pluginevent->onEventEnd = trim(implode("\n", $results)); } // create flag if ($item->country) { $item->countryimg = JemHelperCountries::getCountryFlag($item->country); } $this->isregistered = $isregistered; $this->dispatcher = $dispatcher; $this->pageclass_sfx = htmlspecialchars($item->params->get('pageclass_sfx')); $this->_prepareDocument(); parent::display($tpl); }
/** * Creates the Event Feed */ function display($cachable = false, $urlparams = false) { $app = JFactory::getApplication(); $jinput = $app->input; $doc = JFactory::getDocument(); // Get some data from the model $jinput->set('limit', $app->getCfg('feed_limit')); $rows = $this->get('Items'); foreach ($rows as $row) { // strip html from feed item title $title = $this->escape($row->title); $title = html_entity_decode($title); // categories (object of stdclass to array), when there is something to show if (!empty($row->categories)) { $category = array(); foreach ($row->categories as $category2) { $category[] = $category2->catname; } // ading the , to the list when there are multiple category's $category = $this->escape(implode(', ', $category)); $category = html_entity_decode($category); } else { $category = ''; } //Format date and time $displaydate = JemOutput::formatLongDateTime($row->dates, $row->times, $row->enddates, $row->endtimes); // url link to event $link = JRoute::_(JemHelperRoute::getEventRoute($row->slug)); // Venue $venue = ""; if ($row->venue && $row->city) { $venue .= $row->venue . ' / ' . $row->city; } if ($row->venue && !$row->city) { $venue .= $row->venue; } if (!$row->venue && $row->city) { $venue .= $row->city; } if (!$row->venue && !$row->city) { $venue .= ""; } // combine description variable $description = JText::_('COM_JEM_TITLE') . ': ' . $title . '<br />'; if ($venue) { $description .= JText::_('COM_JEM_VENUE') . ': ' . $venue . '<br />'; } $description .= JText::_('COM_JEM_CATEGORY') . ': ' . $category . '<br />'; $description .= JText::_('COM_JEM_DATE') . ': ' . $displaydate . '<br />'; $description .= JText::_('COM_JEM_DESCRIPTION') . ': ' . $row->introtext . $row->fulltext; # define pubdate $date = false; // load individual item creator class $item = new JFeedItem(); $item->title = $title; $item->link = $link; $item->description = $description; $item->category = $category; if ($date) { $item->date = $date; } // loads item info into rss array $doc->addItem($item); } }
"> <td> <a href="javascript:void(0)" onclick="if (window.parent) window.parent.<?php echo $this->escape($function); ?> ('<?php echo $item->id; ?> ', '<?php echo $this->escape(addslashes($item->title)); ?> ', '<?php echo $this->escape(JemHelperRoute::getEventRoute($item->slug)); ?> ', '<?php echo $this->escape(JemHelperRoute::getEventRoute($item->slug)); ?> ', '<?php echo $this->escape($lang); ?> ',null);"> <?php echo $this->escape($item->title); ?> </a> </td> <td class="center"> <?php echo $this->escape($item->access_level); ?> </td>
<div itemprop="location" itemscope="itemscope" itemtype="http://schema.org/Place"> <h2 class="location"> <?php echo JText::_('COM_JEM_VENUE') ; $itemid = $this->item ? $this->item->id : 0 ; echo JemOutput::editbutton($this->item, $params, $attribs, $this->permissions->canEditVenue, 'editvenue'); ?> </h2> <?php echo JemOutput::flyer($this->item, $this->limage, 'venue'); ?> <dl class="location"> <dt class="venue"><?php echo JText::_('COM_JEM_LOCATION'); ?>:</dt> <dd class="venue"> <?php echo '<a href="' . JRoute::_(JemHelperRoute::getVenueRoute($this->item->venueslug)) . '">' . $this->escape($this->item->venue) . '</a>'; if (!empty($this->item->url)) : echo ' - <a target="_blank" href="' . $this->item->url . '">' . JText::_('COM_JEM_WEBSITE') . '</a>'; endif; ?> </dd> </dl> <?php if ($params->get('event_show_detailsadress', '1')) : ?> <dl class="location floattext" itemprop="address" itemscope itemtype="http://schema.org/PostalAddress"> <?php if ($this->item->street) : ?> <dt class="venue_street"><?php echo JText::_('COM_JEM_STREET'); ?>:</dt> <dd class="venue_street" itemprop="streetAddress"> <?php echo $this->escape($this->item->street); ?> </dd> <?php endif; ?>
/** * Creates the Venue View */ function display($tpl = null) { // initialize variables $app = JFactory::getApplication(); $jinput = $app->input; $document = JFactory::getDocument(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $vsettings = JemHelper::viewSettings('vvenue'); $db = JFactory::getDBO(); $state = $this->get('State'); $params = $state->params; $pathway = $app->getPathWay(); $uri = JFactory::getURI(); $task = $jinput->getCmd('task'); $user = JFactory::getUser(); $itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0); $print = $jinput->getBool('print'); $this->state = $this->get('State'); // Load css JemHelper::loadCss('jem'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } // get data from model $rows = $this->get('Items'); $venue = $this->get('Venue'); // are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } // Decide which parameters should take priority $useMenuItemParams = $menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'venue' && (!isset($menuitem->query['layout']) || $menuitem->query['layout'] == 'default') && $menuitem->query['id'] == $venue->id; // get search & user-state variables $filter_order = $app->getUserStateFromRequest('com_jem.venue.' . $itemid . '.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_DirDefault = 'ASC'; // Reverse default order for dates in archive mode if ($task == 'archive' && $filter_order == 'a.dates') { $filter_order_DirDefault = 'DESC'; } $filter_order_Dir = $app->getUserStateFromRequest('com_jem.venue.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', $filter_order_DirDefault, 'word'); $filter_type = $app->getUserStateFromRequest('com_jem.venue.' . $itemid . '.filter_type', 'filter_type', '', 'int'); $search = $app->getUserStateFromRequest('com_jem.venue.' . $itemid . '.filter_search', 'filter_search', '', 'string'); $search = $db->escape(trim(JString::strtolower($search))); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // Get image $limage = JemImage::flyercreator($venue->locimage, 'venue'); // Add feed links $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); // pathway, page title, page heading if ($useMenuItemParams) { $pagetitle = $params->get('page_title', $menuitem->title ? $menuitem->title : $venue->venue); $pageheading = $params->get('page_heading', $pagetitle); $pathway->setItemName(1, $menuitem->title); } else { $pagetitle = $venue->venue; $pageheading = $pagetitle; $params->set('show_page_heading', 1); // ensure page heading is shown $pathway->addItem($pagetitle, JRoute::_(JemHelperRoute::getVenueRoute($venue->slug))); } $pageclass_sfx = $params->get('pageclass_sfx'); // create the pathway if ($task == 'archive') { $pathway->addItem(JText::_('COM_JEM_ARCHIVE'), JRoute::_(JemHelperRoute::getVenueRoute($venue->slug) . '&task=archive')); $print_link = JRoute::_(JEMHelperRoute::getVenueRoute($venue->slug) . '&task=archive&print=1&tmpl=component'); $pagetitle .= ' - ' . JText::_('COM_JEM_ARCHIVE'); $pageheading .= ' - ' . JText::_('COM_JEM_ARCHIVE'); } else { //$pathway->addItem($venue->venue, JRoute::_(JEMHelperRoute::getVenueRoute($venue->slug))); $print_link = JRoute::_(JemHelperRoute::getVenueRoute($venue->slug) . '&print=1&tmpl=component'); } $params->set('page_heading', $pageheading); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } // set Page title & Meta data $document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); $document->setMetadata('keywords', $venue->meta_keywords); $document->setDescription(strip_tags($venue->meta_description)); // Check if the user has access to the add-eventform $maintainer = JemUser::ismaintainer('add'); $genaccess = JemUser::validate_user($jemsettings->evdelrec, $jemsettings->delivereventsyes); if ($maintainer || $genaccess || $user->authorise('core.create', 'com_jem')) { $addeventlink = 1; } else { $addeventlink = 0; } // Check if the user has access to the add-venueform $maintainer2 = JemUser::venuegroups('add'); $genaccess2 = JemUser::validate_user($jemsettings->locdelrec, $jemsettings->deliverlocsyes); if ($maintainer2 || $genaccess2) { $addvenuelink = 1; } else { $addvenuelink = 0; } // Check if the user has access to the edit-venueform $maintainer3 = JemUser::venuegroups('edit'); $genaccess3 = JemUser::editaccess($jemsettings->venueowner, $venue->created, $jemsettings->venueeditrec, $jemsettings->venueedit); if ($maintainer3 || $genaccess3) { $allowedtoeditvenue = 1; } else { $allowedtoeditvenue = 0; } // Generate Venuedescription if (!$venue->locdescription == '' || !$venue->locdescription == '<br />') { // execute plugins $venue->text = $venue->locdescription; $venue->title = $venue->venue; JPluginHelper::importPlugin('content'); $app->triggerEvent('onContentPrepare', array('com_jem.venue', &$venue, &$params, 0)); $venuedescription = $venue->text; } // prepare the url for output if (strlen($venue->url) > 35) { $venue->urlclean = $this->escape(substr($venue->url, 0, 35)) . '...'; } else { $venue->urlclean = $this->escape($venue->url); } // create flag if ($venue->country) { $venue->countryimg = JemHelperCountries::getCountryFlag($venue->country); } # retrieve mapType setting $settings = JemHelper::globalattribs(); $mapType = $settings->get('mapType', '0'); switch ($mapType) { case '0': $type = 'ROADMAP'; break; case '1': $type = 'SATELLITE'; break; case '2': $type = 'HYBRID'; break; case '3': $type = 'TERRAIN'; break; } $this->mapType = $type; // Create the pagination object $pagination = $this->get('Pagination'); // filters $filters = array(); $filters[] = JHtml::_('select.option', '0', '— ' . JText::_('COM_JEM_GLOBAL_SELECT_FILTER') . ' —'); if ($jemsettings->showtitle == 1) { $filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_TITLE')); } if ($jemsettings->showcat == 1) { $filters[] = JHtml::_('select.option', '4', JText::_('COM_JEM_CATEGORY')); } $lists['filter'] = JHtml::_('select.genericlist', $filters, 'filter_type', array('size' => '1', 'class' => 'inputbox input-medium'), 'value', 'text', $filter_type); $lists['search'] = $search; // mapping variables $this->lists = $lists; $this->action = $uri->toString(); $this->rows = $rows; $this->noevents = $noevents; $this->venue = $venue; $this->print_link = $print_link; $this->params = $params; $this->addvenuelink = $addvenuelink; $this->addeventlink = $addeventlink; $this->limage = $limage; $this->venuedescription = $venuedescription; $this->pagination = $pagination; $this->jemsettings = $jemsettings; $this->settings = $settings; $this->vsettings = $vsettings; $this->item = $menuitem; $this->pagetitle = $pagetitle; $this->task = $task; $this->allowedtoeditvenue = $allowedtoeditvenue; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); $this->print = $print; parent::display($tpl); }
<?php if ($this->item->locid != 0) { ?> <div class="inner-events syo-module"> <div class="eventsHeader"> <h3 class="panel-title"><?php echo JText::_('TPL_SYO_JEM_VENUE_DESC'); ?> </h3> </div> <?php echo $this->item->locdescription; ?> <a href="<?php echo JRoute::_(JemHelperRoute::getVenueRoute($this->item->venueslug)); ?> ">More details about <?php echo $this->escape($this->item->venue); ?> ...</a> </div> <?php $this->attachments = $this->item->vattachments; ?> <?php echo $this->loadTemplate('attachments'); ?> </div>
/** * Creates the Myattendances View */ function display($tpl = null) { $app = JFactory::getApplication(); // initialize variables $document = JFactory::getDocument(); $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $params = $app->getParams(); $uri = JFactory::getURI(); $user = JemFactory::getUser(); $pathway = $app->getPathWay(); $print = $app->input->getBool('print', false); $task = $app->input->getCmd('task', ''); // redirect if not logged in if (!$user->get('id')) { $app->enqueueMessage(JText::_('COM_JEM_NEED_LOGGED_IN'), 'error'); return false; } // Decide which parameters should take priority $useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'myattendances'); // Load css JemHelper::loadCss('jem'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } $attending = $this->get('Attending'); $attending_pagination = $this->get('AttendingPagination'); // are attendences available? $noattending = (!$attending) ? 1 : 0; // get variables $filter_order = $app->getUserStateFromRequest('com_jem.myattendances.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_jem.myattendances.filter_order_Dir', 'filter_order_Dir', '', 'word'); // $filter_state = $app->getUserStateFromRequest('com_jem.myattendances.filter_state', 'filter_state', '*', 'word'); $filter = $app->getUserStateFromRequest('com_jem.myattendances.filter', 'filter', '', 'int'); $search = $app->getUserStateFromRequest('com_jem.myattendances.filter_search', 'filter_search', '', 'string'); // search filter $filters = array(); if ($jemsettings->showtitle == 1) { $filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_TITLE')); } if ($jemsettings->showlocate == 1) { $filters[] = JHtml::_('select.option', '2', JText::_('COM_JEM_VENUE')); } if ($jemsettings->showcity == 1) { $filters[] = JHtml::_('select.option', '3', JText::_('COM_JEM_CITY')); } if ($jemsettings->showcat == 1) { $filters[] = JHtml::_('select.option', '4', JText::_('COM_JEM_CATEGORY')); } if ($jemsettings->showstate == 1) { $filters[] = JHtml::_('select.option', '5', JText::_('COM_JEM_STATE')); } $lists['filter'] = JHtml::_('select.genericlist', $filters, 'filter', array('size'=>'1','class'=>'inputbox'), 'value', 'text', $filter); // search filter $lists['search']= $search; // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // pathway if ($menuitem) { $pathway->setItemName(1, $menuitem->title); } // Set Page title $pagetitle = JText::_('COM_JEM_MY_ATTENDANCES'); $pageheading = $pagetitle; // Check to see which parameters should take priority if ($useMenuItemParams) { // Menu item params take priority $params->def('page_title', $menuitem->title); $pagetitle = $params->get('page_title', JText::_('COM_JEM_MY_ATTENDANCES')); $pageheading = $params->get('page_heading', $pagetitle); $pageclass_sfx = $params->get('pageclass_sfx'); } if ($task == 'archive') { $pathway->addItem(JText::_('COM_JEM_ARCHIVE'), JRoute::_(JemHelperRoute::getMyAttendancesRoute().'&task=archive')); $print_link = JRoute::_(JemHelperRoute::getMyAttendancesRoute().'&task=archive&print=1&tmpl=component'); $pagetitle .= ' - '.JText::_('COM_JEM_ARCHIVE'); $pageheading .= ' - '.JText::_('COM_JEM_ARCHIVE'); $params->set('page_heading', $pageheading); } else { $print_link = JRoute::_(JemHelperRoute::getMyAttendancesRoute().'&print=1&tmpl=component'); } $params->set('page_heading', $pageheading); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } $document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); // Don't add things from this view, no good starting point $permissions = new stdClass(); $this->action = $uri->toString(); $this->attending = $attending; $this->task = $task; $this->params = $params; $this->attending_pagination = $attending_pagination; $this->jemsettings = $jemsettings; $this->settings = $settings; $this->permissions = $permissions; $this->pagetitle = $pagetitle; $this->print_link = $print_link; $this->lists = $lists; $this->noattending = $noattending; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); parent::display($tpl); }
/** * Creates the Category View */ function display($tpl=null) { if ($this->getLayout() == 'calendar') { ### Category Calendar view ### $app = JFactory::getApplication(); // Load tooltips behavior JHtml::_('behavior.tooltip'); //initialize variables $document = JFactory::getDocument(); $jemsettings = JemHelper::config(); $user = JemFactory::getUser(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $params = $app->getParams(); $uri = JFactory::getURI(); $pathway = $app->getPathWay(); $print = $app->input->getBool('print', false); // Load css JemHelper::loadCss('jem'); JemHelper::loadCss('calendar'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } $evlinkcolor = $params->get('eventlinkcolor'); $evbackgroundcolor = $params->get('eventbackgroundcolor'); $currentdaycolor = $params->get('currentdaycolor'); $eventandmorecolor = $params->get('eventandmorecolor'); $style = ' div#jem .eventcontentinner a, div#jem .eventandmore a {color:' . $evlinkcolor . ';} .eventcontentinner {background-color:'.$evbackgroundcolor .';} .eventandmore {background-color:'.$eventandmorecolor .';} .today .daynum {background-color:'.$currentdaycolor.';}'; $document->addStyleDeclaration($style); // add javascript (using full path - see issue #590) JHtml::_('script', 'media/com_jem/js/calendar.js'); // Retrieve date variables $year = (int)$app->input->getInt('yearID', strftime("%Y")); $month = (int)$app->input->getInt('monthID', strftime("%m")); $catid = $app->input->getInt('id', 0); if (empty($catid)) { $catid = $params->get('id'); } // get data from model and set the month $model = $this->getModel('CategoryCal'); $model->setDate(mktime(0, 0, 1, $month, 1, $year)); $category = $this->get('Category', 'CategoryCal'); $rows = $this->get('Items', 'CategoryCal'); // Set Page title $pagetitle = $params->def('page_title', $menuitem->title); $params->def('page_heading', $params->get('page_title')); $pageclass_sfx = $params->get('pageclass_sfx'); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } $document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); // Check if the user has permission to add things $permissions = new stdClass(); $permissions->canAddEvent = $user->can('add', 'event', false, false, $catid); $permissions->canAddVenue = $user->can('add', 'venue', false, false, $catid); $itemid = $app->input->getInt('Itemid', 0); $partItemid = ($itemid > 0) ? '&Itemid='.$itemid : ''; $partCatid = ($catid > 0) ? '&id=' . $catid : ''; $url_base = 'index.php?option=com_jem&view=category&layout=calendar' . $partCatid . $partItemid; $partDate = ($year ? ('&yearID=' . $year) : '') . ($month ? ('&monthID=' . $month) : ''); $print_link = JRoute::_($url_base . $partDate . '&print=1&tmpl=component'); // init calendar $cal = new JEMCalendar($year, $month, 0); $cal->enableMonthNav($url_base . ($print ? '&print=1&tmpl=component' : '')); $cal->setFirstWeekDay($params->get('firstweekday', 1)); $cal->enableDayLinks('index.php?option=com_jem&view=day&catid='.$catid); $this->rows = $rows; $this->catid = $catid; $this->params = $params; $this->jemsettings = $jemsettings; $this->permissions = $permissions; $this->cal = $cal; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); $this->print_link = $print_link; } else { ### Category List view ### //initialize variables $app = JFactory::getApplication(); $document = JFactory::getDocument(); $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $user = JemFactory::getUser(); $print = $app->input->getBool('print', false); JHtml::_('behavior.tooltip'); // get menu information $params = $app->getParams(); $uri = JFactory::getURI(); $pathway = $app->getPathWay(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); // Load css JemHelper::loadCss('jem'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } // get data from model $state = $this->get('State'); $params = $state->params; $items = $this->get('Items'); $category = $this->get('Category'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $this->get('Pagination'); if ($category == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } // are events available? if (!$items) { $noevents = 1; } else { $noevents = 0; } // Decide which parameters should take priority $useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'category' && (!isset($menuitem->query['layout']) || $menuitem->query['layout'] == 'default') && $menuitem->query['id'] == $category->id); // get variables $itemid = $app->input->getInt('id', 0) . ':' . $app->input->getInt('Itemid', 0); $this->showsubcats = (bool)$params->get('usecat', 1); $this->showemptysubcats = (bool)$params->get('showemptychilds', 1); $filter_order = $app->getUserStateFromRequest('com_jem.category.'.$itemid.'.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_jem.category.'.$itemid.'.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_type = $app->getUserStateFromRequest('com_jem.category.'.$itemid.'.filter_filtertype', 'filter_type', '', 'int'); $search = $app->getUserStateFromRequest('com_jem.category.'.$itemid.'.filter_search', 'filter_search', '', 'string'); $task = $app->input->get('task', ''); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // search filter $filters = array(); if ($jemsettings->showtitle == 1) { $filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_TITLE')); } if ($jemsettings->showlocate == 1) { $filters[] = JHtml::_('select.option', '2', JText::_('COM_JEM_VENUE')); } if ($jemsettings->showcity == 1) { $filters[] = JHtml::_('select.option', '3', JText::_('COM_JEM_CITY')); } if ($jemsettings->showcat == 1) { $filters[] = JHtml::_('select.option', '4', JText::_('COM_JEM_CATEGORY')); } if ($jemsettings->showstate == 1) { $filters[] = JHtml::_('select.option', '5', JText::_('COM_JEM_STATE')); } $lists['filter'] = JHtml::_('select.genericlist', $filters, 'filter_type', array('size'=>'1','class'=>'inputbox'), 'value', 'text', $filter_type); // search filter $lists['search']= $search; // Add feed links $link = '&format=feed&id='.$category->id.'&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); // create the pathway $cats = new JEMCategories($category->id); $parents = $cats->getParentlist(); foreach($parents as $parent) { $pathway->addItem($this->escape($parent->catname), JRoute::_(JemHelperRoute::getCategoryRoute($parent->slug)) ); } // Show page heading specified on menu item or category title as heading - idea taken from com_content. // // Check to see which parameters should take priority // If the current view is the active menuitem and an category view for this category, then the menu item params take priority if ($useMenuItemParams) { $pagetitle = $params->get('page_title', $menuitem->title ? $menuitem->title : $category->catname); $pageheading = $params->get('page_heading', $pagetitle); $pathway->setItemName(1, $menuitem->title); } else { $pagetitle = $category->catname; $pageheading = $pagetitle; $params->set('show_page_heading', 1); // ensure page heading is shown $pathway->addItem($category->catname, JRoute::_(JemHelperRoute::getCategoryRoute($category->slug)) ); } $pageclass_sfx = $params->get('pageclass_sfx'); if ($task == 'archive') { $pathway->addItem(JText::_('COM_JEM_ARCHIVE'), JRoute::_(JemHelperRoute::getCategoryRoute($category->slug).'&task=archive')); $print_link = JRoute::_(JemHelperRoute::getCategoryRoute($category->id) .'&task=archive&print=1&tmpl=component'); $pagetitle .= ' - '.JText::_('COM_JEM_ARCHIVE'); $pageheading .= ' - '.JText::_('COM_JEM_ARCHIVE'); } else { $print_link = JRoute::_(JemHelperRoute::getCategoryRoute($category->id) .'&print=1&tmpl=component'); } $params->set('page_heading', $pageheading); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } // Set Page title & Meta data $this->document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); $document->setMetadata('keywords', $category->meta_keywords); $document->setDescription(strip_tags($category->meta_description)); // Check if the user has permission to add things $permissions = new stdClass(); $permissions->canAddEvent = $user->can('add', 'event', false, false, $category->id); $permissions->canAddVenue = $user->can('add', 'venue', false, false, $category->id); // Create the pagination object $pagination = $this->get('Pagination'); // Generate Categorydescription if (empty ($category->description)) { $description = JText::_('COM_JEM_NO_DESCRIPTION'); } else { // execute plugins $category->text = $category->description; $category->title = $category->catname; JPluginHelper::importPlugin('content'); $app->triggerEvent('onContentPrepare', array('com_jem.category', &$category, &$params, 0)); $description = $category->text; } $cimage = JemImage::flyercreator($category->image,'category'); $children = array($category->id => $children); $this->lists = $lists; $this->action = $uri->toString(); $this->cimage = $cimage; $this->rows = $items; $this->noevents = $noevents; $this->print_link = $print_link; $this->params = $params; $this->dellink = $permissions->canAddEvent; // deprecated $this->permissions = $permissions; $this->task = $task; $this->description = $description; $this->pagination = $pagination; $this->jemsettings = $jemsettings; $this->settings = $settings; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); $this->maxLevel = $params->get('maxLevel', -1); $this->category = $category; $this->children = $children; $this->parent = $parent; $this->user = $user; } parent::display($tpl); }
/** * Creates the Myvenues View */ function display($tpl = null) { // initialize variables $app = JFactory::getApplication(); $document = JFactory::getDocument(); $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $params = $app->getParams(); $uri = JFactory::getURI(); $user = JemFactory::getUser(); $userId = $user->get('id'); $pathway = $app->getPathWay(); $jinput = $app->input; $print = $jinput->getBool('print', false); $task = $jinput->getCmd('task', ''); // redirect if not logged in if (!$userId) { $app->enqueueMessage(JText::_('COM_JEM_NEED_LOGGED_IN'), 'error'); return false; } // Decide which parameters should take priority $useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'myvenues'); // Load css JemHelper::loadCss('jem'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } $venues = $this->get('Venues'); $venues_pagination = $this->get('VenuesPagination'); // are no venues available? $novenues = (!$venues) ? 1 : 0; // get variables $filter_order = $app->getUserStateFromRequest('com_jem.myvenues.filter_order', 'filter_order', 'l.venue', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_jem.myvenues.filter_order_Dir', 'filter_order_Dir', '', 'word'); // $filter_state = $app->getUserStateFromRequest('com_jem.myvenues.filter_state', 'filter_state', '*', 'word'); $filter = $app->getUserStateFromRequest('com_jem.myvenues.filter', 'filter', '', 'int'); $search = $app->getUserStateFromRequest('com_jem.myvenues.filter_search', 'filter_search', '', 'string'); // search filter $filters = array(); // Workaround issue #557: Show venue name always. $jemsettings->showlocate = 1; //if ($jemsettings->showtitle == 1) { // $filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_TITLE')); //} if ($jemsettings->showlocate == 1) { $filters[] = JHtml::_('select.option', '2', JText::_('COM_JEM_VENUE')); } if ($jemsettings->showcity == 1) { $filters[] = JHtml::_('select.option', '3', JText::_('COM_JEM_CITY')); } //if ($jemsettings->showcat == 1) { // $filters[] = JHtml::_('select.option', '4', JText::_('COM_JEM_CATEGORY')); //} if ($jemsettings->showstate == 1) { $filters[] = JHtml::_('select.option', '5', JText::_('COM_JEM_STATE')); } $lists['filter'] = JHtml::_('select.genericlist', $filters, 'filter', array('size'=>'1','class'=>'inputbox'), 'value', 'text', $filter); // search filter $lists['search'] = $search; // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; // pathway if ($menuitem) { $pathway->setItemName(1, $menuitem->title); } // Set Page title $pagetitle = JText::_('COM_JEM_MY_VENUES'); $pageheading = $pagetitle; $pageclass_sfx = ''; // Check to see which parameters should take priority if ($useMenuItemParams) { // Menu item params take priority $params->def('page_title', $menuitem->title); $pagetitle = $params->get('page_title', JText::_('COM_JEM_MY_VENUES')); $pageheading = $params->get('page_heading', $pagetitle); $pageclass_sfx = $params->get('pageclass_sfx'); } // ($task == 'archive') useless $print_link = JRoute::_(JemHelperRoute::getMyVenuesRoute() .'&print=1&tmpl=component'); $params->set('page_heading', $pageheading); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } $document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); // Should we show publish buttons? $canPublishVenue = false; foreach ($venues as $venue) { $canPublishVenue |= $venue->params->get('access-change'); if ($canPublishVenue) break; } // Set the user permissions $permissions = new stdClass(); $permissions->canAddEvent = $user->can('add', 'event'); $permissions->canAddVenue = $user->can('add', 'venue'); $permissions->canPublishVenue = $canPublishVenue; $this->action = $uri->toString(); $this->venues = $venues; $this->task = $task; $this->print = $print; $this->params = $params; $this->venues_pagination = $venues_pagination; $this->jemsettings = $jemsettings; $this->settings = $settings; $this->permissions = $permissions; $this->pagetitle = $pagetitle; $this->lists = $lists; $this->novenues = $novenues; $this->print_link = $print_link; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); parent::display($tpl); }
<?php /** * @package JEM * @copyright (C) 2013-2015 joomlaeventmanager.net * @copyright (C) 2005-2009 Christoph Lukes * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL */ defined('_JEXEC') or die; JHtml::_('bootstrap.tooltip'); $colspan = $this->event->waitinglist ? 10 : 9; $detaillink = JRoute::_(JemHelperRoute::getEventRoute($this->event->id . ':' . $this->event->alias)); ?> <script type="text/javascript"> function tableOrdering(order, dir, view) { var form = document.getElementById("adminForm"); form.filter_order.value = order; form.filter_order_Dir.value = dir; form.submit(view); } </script> <div id="jem" class="jem_attendees<?php echo $this->pageclass_sfx; ?> "> <div class="topbox"> <?php
/** * Creates the output for the Event view */ function display($tpl = null) { $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $app = JFactory::getApplication(); $user = JFactory::getUser(); $userId = $user->get('id'); $dispatcher = JEventDispatcher::getInstance(); $document = JFactory::getDocument(); $model = $this->getModel(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); $pathway = $app->getPathway(); $jinput = $app->input; $this->KunenaConfig = $this->get('KunenaConfig'); $this->params = $app->getParams('com_jem'); $this->item = $this->get('Item'); $this->print = $jinput->getBool('print'); $this->state = $this->get('State'); $this->user = $user; $this->jemsettings = $jemsettings; $this->settings = $settings; $categories = $this->get('Categories'); $this->categories = $categories; $isregistered = $this->get('UserIsRegistered'); // Check for errors. if (count($errors = $this->get('Errors'))) { JError::raiseWarning(500, implode("\n", $errors)); return false; } // Create a shortcut for $item and params. $item = $this->item; $params = $this->params; $this->registers = $model->getRegisters($this->state->get('event.id')); // Decide which parameters should take priority $useMenuItemParams = $menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'event' && $menuitem->query['id'] == $item->id; // Add router helpers. $item->slug = $item->alias ? $item->id . ':' . $item->alias : $item->id; $item->venueslug = $item->localias ? $item->locid . ':' . $item->localias : $item->locid; // Check to see which parameters should take priority if ($useMenuItemParams) { // Merge so that the menu item params take priority $pagetitle = $params->def('page_title', $menuitem->title ? $menuitem->title : $item->title); $params->def('page_heading', $pagetitle); $pathway->setItemName(1, $menuitem->title); // Load layout from active query (in case it is an alternative menu item) if (isset($menuitem->query['layout'])) { $this->setLayout($menuitem->query['layout']); } else { // Single-event menu item layout takes priority over alt layout for an event if ($layout = $item->params->get('event_layout')) { $this->setLayout($layout); } } $item->params->merge($params); } else { // Merge the menu item params with the event params so that the event params take priority $pagetitle = $item->title; $params->set('page_title', $pagetitle); $params->set('page_heading', $pagetitle); $params->set('show_page_heading', 1); // ensure page heading is shown $pathway->addItem($pagetitle, JRoute::_(JemHelperRoute::getEventRoute($item->slug))); // Check for alternative layouts (since we are not in a single-event menu item) // Single-event menu item layout takes priority over alt layout for an event if ($layout = $item->params->get('event_layout')) { $this->setLayout($layout); } $temp = clone $params; $temp->merge($item->params); $item->params = $temp; } $offset = $this->state->get('list.offset'); // Check the view access to the event (the model has already computed the values). if ($item->params->get('access-view') == false) { JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR')); return; } if ($item->params->get('show_intro', '1') == '1') { $item->text = $item->introtext . ' ' . $item->fulltext; } elseif ($item->fulltext) { $item->text = $item->fulltext; } else { $item->text = $item->introtext; } // Process the content plugins // JPluginHelper::importPlugin('content'); $results = $dispatcher->trigger('onContentPrepare', array('com_jem.event', &$item, &$this->params, $offset)); $item->event = new stdClass(); $results = $dispatcher->trigger('onContentAfterTitle', array('com_jem.event', &$item, &$this->params, $offset)); $item->event->afterDisplayTitle = trim(implode("\n", $results)); $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_jem.event', &$item, &$this->params, $offset)); $item->event->beforeDisplayContent = trim(implode("\n", $results)); $results = $dispatcher->trigger('onContentAfterDisplay', array('com_jem.event', &$item, &$this->params, $offset)); $item->event->afterDisplayContent = trim(implode("\n", $results)); // Increment the hit counter of the event. if (!$this->params->get('intro_only') && $offset == 0) { $model->hit(); } //Escape strings for HTML output $this->pageclass_sfx = htmlspecialchars($this->item->params->get('pageclass_sfx')); $this->print_link = JRoute::_(JemHelperRoute::getRoute($item->slug) . '&print=1&tmpl=component'); //Get images if ($item->datimage) { $this->dimage = JemImage::flyercreator($item->datimage, 'event'); } else { $this->dimage = false; } if ($item->locimage) { $this->limage = JemImage::flyercreator($item->locimage, 'venue'); } else { $this->limage = false; } $this->img_position = $settings->get('img_position', 1); // Check if the user has access to the add-eventform $maintainer = JemUser::ismaintainer('add'); $genaccess = JemUser::validate_user($jemsettings->evdelrec, $jemsettings->delivereventsyes); if ($maintainer || $genaccess || $user->authorise('core.create', 'com_jem')) { $this->addeventlink = 1; } else { $this->addeventlink = 0; } // Check if the user has access to the add-venueform $maintainer2 = JemUser::venuegroups('add'); $genaccess2 = JemUser::validate_user($jemsettings->locdelrec, $jemsettings->deliverlocsyes); if ($maintainer2 || $genaccess2) { $this->addvenuelink = 1; } else { $this->addvenuelink = 0; } // Check if user can edit $maintainer5 = JemUser::ismaintainer('edit', $item->did); $genaccess5 = JemUser::editaccess($jemsettings->eventowner, $item->created_by, $jemsettings->eventeditrec, $jemsettings->eventedit); if ($maintainer5 || $genaccess5 || $user->authorise('core.edit', 'com_jem')) { $this->allowedtoeditevent = 1; } else { $this->allowedtoeditevent = 0; } //Check if the user has access to the edit-venueform $maintainer3 = JemUser::venuegroups('edit'); $genaccess3 = JemUser::editaccess($jemsettings->venueowner, $item->venueowner, $jemsettings->venueeditrec, $jemsettings->venueedit); if ($maintainer3 || $genaccess3) { $this->allowedtoeditvenue = 1; } else { $this->allowedtoeditvenue = 0; } //Timecheck for registration $now = strtotime(date("Y-m-d")); $date = strtotime($item->dates); $timecheck = $now - $date; //let's build the registration handling $formhandler = 0; //is the user allready registered at the event if ($isregistered) { $formhandler = 3; } elseif ($timecheck > 0 && !is_null($item->dates)) { //check if it is too late to register and overwrite $formhandler $formhandler = 1; } elseif (!$user->get('id')) { //is the user registered at joomla and overwrite $formhandler if not $formhandler = 2; } else { $formhandler = 4; } if ($formhandler >= 3) { $js = "function check(checkbox, send) {\n\t\t\t\tif(checkbox.checked==true){\n\t\t\t\t\tsend.disabled = false;\n\t\t\t\t} else {\n\t\t\t\t\tsend.disabled = true;\n\t\t\t\t}}"; $document->addScriptDeclaration($js); } $this->formhandler = $formhandler; // generate Metatags $meta_keywords_content = ""; if (!empty($this->item->meta_keywords)) { $keywords = explode(",", $this->item->meta_keywords); foreach ($keywords as $keyword) { if ($meta_keywords_content != "") { $meta_keywords_content .= ", "; } if (preg_match("/[\\/[\\/]/", $keyword)) { $keyword = trim(str_replace("[", "", str_replace("]", "", $keyword))); $buffer = $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate); if ($buffer != "") { $meta_keywords_content .= $buffer; } else { $meta_keywords_content = substr($meta_keywords_content, 0, strlen($meta_keywords_content) - 2); // remove the comma and the white space } } else { $meta_keywords_content .= $keyword; } } $document->setMetadata('keywords', $meta_keywords_content); } if (!empty($this->item->meta_description)) { $description = explode("[", $this->item->meta_description); $description_content = ""; foreach ($description as $desc) { $keyword = substr($desc, 0, strpos($desc, "]", 0)); if ($keyword != "") { $description_content .= $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate); $description_content .= substr($desc, strpos($desc, "]", 0) + 1); } else { $description_content .= $desc; } } } else { $description_content = ""; } $document->setDescription(strip_tags($description_content)); # retrieve mapType setting $settings = JemHelper::globalattribs(); $mapType = $settings->get('mapType', '0'); switch ($mapType) { case '0': $type = 'ROADMAP'; break; case '1': $type = 'SATELLITE'; break; case '2': $type = 'HYBRID'; break; case '3': $type = 'TERRAIN'; break; } $this->mapType = $type; // load dispatcher for JEM plugins (comments) $item->pluginevent = new stdClass(); if ($this->print) { $item->pluginevent->onEventEnd = false; } else { JPluginHelper::importPlugin('jem', 'comments'); $results = $dispatcher->trigger('onEventEnd', array($item->did, $this->escape($item->title))); $item->pluginevent->onEventEnd = trim(implode("\n", $results)); } //create flag if ($item->country) { $item->countryimg = JemHelperCountries::getCountryFlag($item->country); } $this->isregistered = $isregistered; $this->dispatcher = $dispatcher; $this->pageclass_sfx = htmlspecialchars($item->params->get('pageclass_sfx')); $this->_prepareDocument(); parent::display($tpl); }
/** * Get the return URL. * * If a "return" variable has been passed in the request * * @return string The return URL. */ protected function getReturnPage() { $return = JFactory::getApplication()->input->get('return', null, 'base64'); if (empty($return) || !JUri::isInternal(urldecode(base64_decode($return)))) { if (!empty($this->_id)) { return JRoute::_(JemHelperRoute::getEventRoute($this->_id)); } return JUri::base(); } else { return urldecode(base64_decode($return)); } }
<?php if ($i = count($row->subcats)) { ?> <div class="subcategories"> <?php echo JText::_('COM_JEM_SUBCATEGORIES'); ?> </div> <div class="subcategorieslist"> <?php foreach ($row->subcats as $sub) { ?> <strong> <a href="<?php echo JRoute::_(JemHelperRoute::getCategoryRoute($sub->slug)); ?> "> <?php echo $this->escape($sub->catname); ?> </a> </strong> <?php echo '(' . ($sub->assignedevents != null ? $sub->assignedevents : 0) . (--$i ? '),' : ')'); ?> <?php } ?> </div> <?php }
/** * Get a category names list * @param unknown $categories Category List * @param boolean $doLink Link the categories to the respective Category View * @param boolean $backend Used for backend (true) or frontend (false, default) * @return string|multitype: */ static function getCategoryList($categories, $doLink, $backend = false) { $output = array_map( function ($category) use ($doLink, $backend) { if ($doLink) { if ($backend) { $path = $category->path; $path = str_replace('/', ' » ', $path); $value = '<span '.JEMOutput::tooltip(JText::_('COM_JEM_EDIT_CATEGORY'), $path, 'editlinktip').'>'; $value .= '<a href="index.php?option=com_jem&task=category.edit&id='. $category->id.'">'. $category->catname.'</a>'; $value .= '</span>'; } else { $value = '<a href="'.JRoute::_(JemHelperRoute::getCategoryRoute($category->catslug)).'">'. $category->catname.'</a>'; } } else { $value = $category->catname; } return $value; }, $categories); return $output; }
/** * Creates the Category View */ function display($tpl = null) { //initialize variables $app = JFactory::getApplication(); $jinput = JFactory::getApplication()->input; $document = JFactory::getDocument(); $vsettings = JemHelper::viewSettings('vcategory'); $jemsettings = JemHelper::config(); $settings = JemHelper::globalattribs(); $db = JFactory::getDBO(); $user = JFactory::getUser(); $print = $jinput->getBool('print'); $state = $this->get('State'); $params = $state->params; $uri = JFactory::getURI(); $pathway = $app->getPathWay(); $menu = $app->getMenu(); $menuitem = $menu->getActive(); # load css JemHelper::loadCss('jem'); JemHelper::loadCustomCss(); JemHelper::loadCustomTag(); //get data from model $state = $this->get('State'); $params = $state->params; $items = $this->get('Items'); $category = $this->get('Category'); $children = $this->get('Children'); $parent = $this->get('Parent'); $pagination = $this->get('Pagination'); if ($category == false) { return JError::raiseError(404, JText::_('JGLOBAL_CATEGORY_NOT_FOUND')); } //are events available? if (!$items) { $noevents = 1; } else { $noevents = 0; } // Decide which parameters should take priority $useMenuItemParams = $menuitem && $menuitem->query['option'] == 'com_jem' && $menuitem->query['view'] == 'category' && (!isset($menuitem->query['layout']) || $menuitem->query['layout'] == 'default') && $menuitem->query['id'] == $category->id; // get variables $itemid = $jinput->getInt('id', 0) . ':' . $jinput->getInt('Itemid', 0); $filter_order = $app->getUserStateFromRequest('com_jem.category.' . $itemid . '.filter_order', 'filter_order', 'a.dates', 'cmd'); $filter_order_Dir = $app->getUserStateFromRequest('com_jem.category.' . $itemid . '.filter_order_Dir', 'filter_order_Dir', '', 'word'); $filter_type = $app->getUserStateFromRequest('com_jem.category.' . $itemid . '.filter_filtertype', 'filter_type', '', 'int'); $search = $app->getUserStateFromRequest('com_jem.category.' . $itemid . '.filter_search', 'filter_search', '', 'string'); $search = $db->escape(trim(JString::strtolower($search))); $task = $jinput->getCmd('task'); // table ordering $lists['order_Dir'] = $filter_order_Dir; $lists['order'] = $filter_order; //search filter $filters = array(); $filters[] = JHtml::_('select.option', '0', '— ' . JText::_('COM_JEM_GLOBAL_SELECT_FILTER') . ' —'); if ($jemsettings->showtitle == 1) { $filters[] = JHtml::_('select.option', '1', JText::_('COM_JEM_TITLE')); } if ($jemsettings->showlocate == 1) { $filters[] = JHtml::_('select.option', '2', JText::_('COM_JEM_VENUE')); } if ($jemsettings->showcity == 1) { $filters[] = JHtml::_('select.option', '3', JText::_('COM_JEM_CITY')); } $lists['filter'] = JHtml::_('select.genericlist', $filters, 'filter_type', array('size' => '1', 'class' => 'inputbox input-medium'), 'value', 'text', $filter_type); // search filter $lists['search'] = $search; // Add feed links $link = '&format=feed&limitstart='; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $this->document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $this->document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); //create the pathway $cats = new JEMCategories($category->id); $parents = $cats->getParentlist(); foreach ($parents as $parent) { $pathway->addItem($this->escape($parent->catname), JRoute::_(JemHelperRoute::getCategoryRoute($parent->slug))); } // Show page heading specified on menu item or category title as heading - idea taken from com_content. // // Check to see which parameters should take priority // If the current view is the active menuitem and an category view for this category, then the menu item params take priority if ($useMenuItemParams) { $pagetitle = $params->get('page_title', $menuitem->title ? $menuitem->title : $category->catname); $pageheading = $params->get('page_heading', $pagetitle); $pathway->setItemName(1, $menuitem->title); } else { $pagetitle = $category->catname; $pageheading = $pagetitle; $params->set('show_page_heading', 1); // ensure page heading is shown $pathway->addItem($category->catname, JRoute::_(JemHelperRoute::getCategoryRoute($category->slug))); } $pageclass_sfx = $params->get('pageclass_sfx'); if ($task == 'archive') { $pathway->addItem(JText::_('COM_JEM_ARCHIVE'), JRoute::_(JemHelperRoute::getCategoryRoute($category->slug) . '&task=archive')); $print_link = JRoute::_(JemHelperRoute::getCategoryRoute($category->id) . '&task=archive&print=1&tmpl=component'); $pagetitle .= ' - ' . JText::_('COM_JEM_ARCHIVE'); $pageheading .= ' - ' . JText::_('COM_JEM_ARCHIVE'); } else { $print_link = JRoute::_(JemHelperRoute::getCategoryRoute($category->id) . '&print=1&tmpl=component'); } if ($print) { JemHelper::loadCss('print'); $document->setMetaData('robots', 'noindex, nofollow'); } $params->set('page_heading', $pageheading); // Add site name to title if param is set if ($app->getCfg('sitename_pagetitles', 0) == 1) { $pagetitle = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $pagetitle); } elseif ($app->getCfg('sitename_pagetitles', 0) == 2) { $pagetitle = JText::sprintf('JPAGETITLE', $pagetitle, $app->getCfg('sitename')); } //Set Page title & Meta data $this->document->setTitle($pagetitle); $document->setMetaData('title', $pagetitle); $document->setMetadata('keywords', $category->meta_keywords); $document->setDescription(strip_tags($category->meta_description)); //Check if the user has access to the form $maintainer = JemUser::ismaintainer('add'); $genaccess = JemUser::validate_user($jemsettings->evdelrec, $jemsettings->delivereventsyes); if ($maintainer || $genaccess || $user->authorise('core.create', 'com_jem')) { $dellink = 1; } else { $dellink = 0; } # Check if the user has access to the add-venueform $maintainer2 = JemUser::venuegroups('add'); $genaccess2 = JemUser::validate_user($jemsettings->locdelrec, $jemsettings->deliverlocsyes); if ($maintainer2 || $genaccess2) { $this->addvenuelink = 1; } else { $this->addvenuelink = 0; } // Create the pagination object $pagination = $this->get('Pagination'); //Generate Categorydescription if (empty($category->description)) { $description = JText::_('COM_JEM_NO_DESCRIPTION'); } else { //execute plugins $category->text = $category->description; $category->title = $category->catname; JPluginHelper::importPlugin('content'); $app->triggerEvent('onContentPrepare', array('com_jem.category', &$category, &$params, 0)); $description = $category->text; } $cimage = JemImage::flyercreator($category->image, 'category'); $children = array($category->id => $children); $this->lists = $lists; $this->action = $uri->toString(); $this->cimage = $cimage; $this->rows = $items; $this->noevents = $noevents; $this->print_link = $print_link; $this->params = $params; $this->dellink = $dellink; $this->task = $task; $this->description = $description; $this->pagination = $pagination; $this->jemsettings = $jemsettings; $this->vsettings = $vsettings; $this->settings = $settings; $this->pageclass_sfx = htmlspecialchars($pageclass_sfx); $this->maxLevel = $params->get('maxLevel', -1); $this->category = $category; $this->children = $children; $this->parent = $parent; $this->user = $user; $this->print = $print; parent::display($tpl); }
<?php echo $row->description; ?> <p> <?php echo JHtml::_('link', JRoute::_($row->linktarget), $row->linktext); ?> (<?php echo $row->assignedevents ? $row->assignedevents : '0'; ?>) </p> </div> </div> <?php if ($i = count($row->subcats)) : ?> <div class="subcategories"> <?php echo JText::_('COM_JEM_SUBCATEGORIES'); ?> </div> <div class="subcategorieslist"> <?php foreach ($row->subcats as $sub) : ?> <strong> <a href="<?php echo JRoute::_(JemHelperRoute::getCategoryRoute($sub->slug, $this->task)); ?>"> <?php echo $this->escape($sub->catname); ?></a> </strong> <?php echo '(' . ($sub->assignedevents != null ? $sub->assignedevents : 0) . (--$i ? '),' : ')'); ?> <?php endforeach; ?> </div> <?php endif; ?> <!--table--> <?php if ($this->params->get('detcat_nr', 0) > 0) { $this->catrow = $row; echo $this->loadTemplate('table'); } ?> <?php endforeach; ?>
if ($this->img_position == 1) { ?> <div class="container-fluid"> <div class="row"> <div class="col-md-7"> <?php } ?> <dl class="location_dl" itemprop="location" itemscope itemtype="http://schema.org/PostalAddress"> <dt class="venue"><?php echo JText::_('COM_JEM_LOCATION') . ':'; ?> </dt> <dd class="venue"> <?php echo "<a href='" . JRoute::_(JemHelperRoute::getVenueRoute($this->item->venueslug)) . "'>" . $this->escape($this->item->venue) . "</a>"; ?> <?php if (!empty($this->item->url)) { ?> - <a target="_blank" href="<?php echo $this->item->url; ?> "> <?php echo JText::_('COM_JEM_WEBSITE'); ?> </a> <?php }
} } $eventname = '<div class="eventName">' . JText::_('COM_JEM_TITLE_SHORT') . ': ' . $this->escape($row->title) . '</div>'; $detaillink = JRoute::_(JemHelperRoute::getEventRoute($row->slug)); //initialize variables $multicatname = ''; $colorpic = ''; $nr = count($row->categories); $ix = 0; $content = ''; $contentend = ''; $catz = array(); //walk through categories assigned to an event foreach ($row->categories as $category) { //Currently only one id possible...so simply just pick one up... $detaillink = JRoute::_(JemHelperRoute::getEventRoute($row->slug)); //wrap a div for each category around the event for show hide toggler $catz[] = 'cat' . $category->id; //attach category color if any in front of the catname if ($category->color) { $multicatname .= '<span class="colorpic" style="width:6px; background-color: ' . $category->color . ';"></span> ' . $category->catname; } else { $multicatname .= $category->catname; } $ix++; if ($ix != $nr) { $multicatname .= ', '; } //attach category color if any in front of the event title in the calendar overview if (isset($category->color) && $category->color) { $colorpic .= '<span class="colorpic" style="width:6px; background-color: ' . $category->color . ';"></span>';
/** * Method to get the events * * @access public * @return array */ public static function getList(&$params) { mb_internal_encoding('UTF-8'); $db = JFactory::getDBO(); $user = JFactory::getUser(); $levels = $user->getAuthorisedViewLevels(); $settings = JemHelper::config(); // Use (short) format saved in module settings or in component settings or format in language file otherwise $dateFormat = $params->get('formatdate', ''); if (empty($dateFormat)) { // on empty format long format will be used but we need short format if (isset($settings->formatShortDate) && $settings->formatShortDate) { $dateFormat = $settings->formatShortDate; } else { $dateFormat = JText::_('COM_JEM_FORMAT_SHORT_DATE'); } } $timeFormat = $params->get('formattime', ''); $addSuffix = false; if (empty($timeFormat)) { // on empty format component's format will be used, so also use component's time suffix $addSuffix = true; } # Retrieve Eventslist model for the data $model = JModelLegacy::getInstance('Eventslist', 'JemModel', array('ignore_request' => true)); # Set params for the model # has to go before the getItems function $model->setState('params', $params); # filter published # 0: unpublished # 1: published # 2: archived # -2: trashed $type = $params->get('type'); # All events $cal_from = ""; // TODO: Add parameter to specify start and end dates for showing events // (used for schools league) // All events, default order if ($type == 3) { $cal_from = ""; } elseif ($type == 2) { $model->setState('filter.published', 2); $model->setState('filter.orderby', array('a.dates DESC', 'a.times DESC')); $cal_from = ""; } else { $model->setState('filter.published', 1); $model->setState('filter.orderby', array('a.dates ASC', 'a.times ASC')); $offset_minutes = 60 * $params->get('offset_hours', 0); $cal_from = "((TIMESTAMPDIFF(MINUTE, NOW(), CONCAT(a.dates,' ',IFNULL(a.times,'00:00:00'))) > {$offset_minutes}) "; $cal_from .= $type == 1 ? " OR (TIMESTAMPDIFF(MINUTE, NOW(), CONCAT(IFNULL(a.enddates,a.dates),' ',IFNULL(a.endtimes,'23:59:59'))) > {$offset_minutes})) " : ") "; } $model->setState('filter.calendar_from', $cal_from); $model->setState('filter.groupby', 'a.id'); # filter category's $catids = JemHelper::getValidIds($params->get('catid')); if ($catids) { $model->setState('filter.category_id', $catids); $model->setState('filter.category_id.include', true); } # filter venue's $venids = JemHelper::getValidIds($params->get('venid')); if ($venids) { $model->setState('filter.venue_id', $venids); $model->setState('filter.venue_id.include', true); } # count $count = $params->get('count', '2'); $model->setState('list.limit', $count); # Retrieve the available Events $events = $model->getItems(); # Loop through the result rows and prepare data $i = 0; $lists = array(); foreach ($events as $row) { //cut titel $length = mb_strlen($row->title); if ($length > $params->get('cuttitle', '18')) { $row->title = mb_substr($row->title, 0, $params->get('cuttitle', '18')); $row->title = $row->title . '...'; } $lists[$i] = new stdClass(); $lists[$i]->link = JRoute::_(JemHelperRoute::getEventRoute($row->slug)); # time/date list($lists[$i]->date, $lists[$i]->time) = self::_format_date_time($row, $params->get('datemethod', 1), $dateFormat, $timeFormat, $addSuffix); $lists[$i]->dateinfo = JEMOutput::formatDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $dateFormat, $timeFormat, $addSuffix); $lists[$i]->dateinfo = JemOutput::formatDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $dateFormat, $timeFormat, $addSuffix); $lists[$i]->text = $params->get('showtitloc', 0) ? $row->title : htmlspecialchars($row->venue, ENT_COMPAT, 'UTF-8'); $lists[$i]->city = htmlspecialchars($row->city, ENT_COMPAT, 'UTF-8'); $lists[$i]->venueurl = !empty($row->venueslug) ? JRoute::_(JEMHelperRoute::getVenueRoute($row->venueslug)) : null; $i++; } return $lists; }