/** * Method to get the Venues * * @access public * @return array */ function &getData() { $mainframe =& JFactory::getApplication(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $menu->getParams($item->id); $elsettings =& redEVENTHelper::config(); // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); // Get a reference to the global cache object. $cache =& JFactory::getCache('redevent'); $this->_data = $cache->call(array('RedeventModelCountriesmap', '_getResultList'), $query); $countrycoords = redEVENTHelperCountries::getCountrycoordArray(); $k = 0; for ($i = 0; $i < count($this->_data); $i++) { $country =& $this->_data[$i]; $country->flag = REOutput::getFlag($country->iso2); $country->flagurl = REOutput::getFlagUrl($country->iso2); $country->latitude = $countrycoords[$country->iso2][0]; $country->longitude = $countrycoords[$country->iso2][1]; //create target link $country->targetlink = JRoute::_(JURI::base() . 'index.php?option=com_redevent&view=countryevents&filter_country=' . $country->iso2); $k = 1 - $k; } } return $this->_data; }
/** * Creates the Venueevents View * * @since 0.9 */ function display() { $document =& JFactory::getDocument(); $document->link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents'); $upcomingevents = $this->get('UpcomingVenueEvents'); $elsettings = redEVENTHelper::config(); $imagepath = JURI::root() . 'administrator/components/com_redevent/assets/images/'; foreach ((array) $upcomingevents as $key => $event) { $event_url = RedeventHelperRoute::getDetailsRoute($event->slug, $event->xslug); $venue_url = RedeventHelperRoute::getVenueEventsRoute($event->venueslug); $description = '<table> <tbody> <tr> <td width="100">Course:</td><td>' . JHTML::_('link', $event_url, $event->full_title, 'target="_blank"') . '</td> </tr><tr> <td>Where:</td><td>' . $event->location . ' ' . REOutput::getFlag($event->country) . '</td> </tr><tr> <td>Date:</td><td>' . REOutput::formatdate($event->dates, $event->times) . '</td> </tr><tr> <td>Duration:</td><td>' . $event->duration; if ($event->duration == 1) { $description .= JText::_('COM_REDEVENT_DAY'); } else { if ($event->duration > 1) { $description .= JText::_('COM_REDEVENT_DAYS'); } } $description .= '</td> </tr><tr> <td>Venue:</td><td>' . JHTML::_('link', $venue_url, $event->venue, 'target="_blank"') . '</td> </tr><tr> <td>Price:</td><td class="re-price">' . REOutput::formatListPrices($event->prices) . '</td> </tr><tr> <td>Credits:</td><td>' . $event->course_credit . '</td> </tr><tr> <td>Signup:</td><td>'; /* Get the different submission types */ $submissiontypes = explode(',', $event->submission_types); $venues_html = ''; foreach ($submissiontypes as $key => $subtype) { switch ($subtype) { case 'email': $venues_html .= ' ' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&task=signup&subtype=email&xref=' . $event->xref . '&id=' . $event->id), JHTML::_('image', $imagepath . $elsettings->get('signup_email_img'), JText::_($elsettings->get('signup_email_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . ' '; break; case 'phone': $venues_html .= ' ' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&task=signup&subtype=phone&xref=' . $event->xref . '&id=' . $event->id), JHTML::_('image', $imagepath . $elsettings->get('signup_phone_img'), JText::_($elsettings->get('signup_phone_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . ' '; break; case 'external': $venues_html .= ' ' . JHTML::_('link', $event->submission_type_external, JHTML::_('image', $imagepath . $elsettings->get('signup_external_img'), $elsettings->get('signup_external_text'), 'width="24px" height="24px" border="0"'), 'target="_blank"') . ' '; break; case 'webform': if ($event->prices && count($event->prices)) { foreach ($event->prices as $p) { $img = empty($p->image) ? JHTML::_('image', $imagepath . $elsettings->get('signup_webform_img'), JText::_($elsettings->get('signup_webform_text'))) : JHTML::_('image', $imagepath . $p->image, JText::_($p->name)); $link = JRoute::_(RedeventHelperRoute::getSignupRoute('webform', $event->slug, $event->xslug, $p->slug)); $venues_html .= ' ' . JHTML::_('link', $link, $img) . ' '; } } else { $venues_html .= ' ' . JHTML::_('link', JRoute::_(RedeventHelperRoute::getSignupRoute('webform', $event->slug, $event->xslug)), JHTML::_('image', $imagepath . $elsettings->get('signup_webform_img'), JText::_($elsettings->get('signup_webform_text')))) . ' '; } break; case 'formaloffer': $venues_html .= ' ' . JHTML::_('link', JRoute::_('index.php?option=com_redevent&view=signup&subtype=formaloffer&task=signup&xref=' . $event->xslug . '&id=' . $event->slug), JHTML::_('image', $imagepath . $elsettings->get('signup_formal_offer_img'), JText::_($elsettings->get('signup_formal_offer_text')), 'width="24px" height="24px" border="0"'), 'target="_blank"') . ' '; break; } } $description .= $venues_html; $description .= '</td></tr></tbody></table>'; $item = new JFeedItem(); $item->title = $event->full_title; $item->link = $event_url; $item->description = $description; $item->date = ''; $item->category = $event->venue; // loads item info into rss array $document->addItem($item); } }
/** * Creates the Venueevents 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('com_redevent'); $uri =& JFactory::getURI(); $acl = UserAcl::getInstance(); //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.venueevents.limit', 'limit', $params->def('display_num', 0), 'int'); $pop = JRequest::getBool('pop'); $task = JRequest::getWord('task'); //get data from model $rows =& $this->get('Data'); $venue =& $this->get('Venue'); $total =& $this->get('Total'); $customs =& $this->get('ListCustomFields'); $customsfilters =& $this->get('CustomFilters'); //does the venue exist? if ($venue->id == 0) { return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Venue_d_not_found', $venue->id)); } //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } // Add needed scripts if the lightbox effect is enabled JHTML::_('behavior.modal'); //add alternate feed link $link = 'index.php?option=com_redevent&view=venueevents&format=feed&id=' . $venue->id; $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); //pathway $pathway =& $mainframe->getPathWay(); //create the pathway if ($task == 'archive') { $link = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug, 'archive')); $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $venue->venue, $link); $print_link = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $venue->slug . '&task=archive&pop=1&tmpl=component'); $pagetitle = $venue->venue . ' - ' . JText::_('COM_REDEVENT_ARCHIVE'); } else { $link = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug)); $pathway->addItem($venue->venue, $link); $print_link = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $venue->slug . '&pop=1&tmpl=component'); $pagetitle = $venue->venue; } $thumb_link = RedeventHelperRoute::getVenueEventsRoute($venue->slug, null, 'thumb'); $list_link = RedeventHelperRoute::getVenueEventsRoute($venue->slug, null, 'default'); //set Page title $this->document->setTitle($pagetitle); $document->setMetadata('keywords', $venue->meta_keywords); $document->setDescription(strip_tags($venue->meta_description)); //Printfunction $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($pop) { $params->set('popup', 1); } //Check if the user has access to the form $maintainer = $acl->canEditVenue($venue->id); //Generate Venuedescription if (!empty($venue->locdescription)) { //execute plugins $venuedescription = JHTML::_('content.prepare', $venue->locdescription); } //build the url if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") { $venue->url = 'http://' . $venue->url; } //prepare the url for output if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) { $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...'; } else { $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES); } //create flag if ($venue->country) { $venue->countryimg = REOutput::getFlag($venue->country); } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //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::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug))); $this->assignRef('rows', $rows); $this->assignRef('customs', $customs); $this->assignRef('noevents', $noevents); $this->assignRef('venue', $venue); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('editlink', $maintainer); $this->assignRef('venuedescription', $venuedescription); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); $this->assignRef('pagetitle', $pagetitle); $this->assignRef('task', $task); $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); }
$imagepath = JURI::root() . 'administrator/components/com_redevent/assets/images/'; foreach ($this->upcomingvenueevents as $key => $event) { $event_url = JRoute::_('index.php?option=com_redevent&view=details&xref=' . $event->xref . '&id=' . $event->slug); $venue_url = JRoute::_('index.php?option=com_redevent&view=venueevents&id=' . $event->venueslug); ?> <tr> <td><?php echo JHTML::_('link', $event_url, $event->full_title); ?> </td> <td><?php echo $event->location; ?> </td> <td><?php echo REOutput::getFlag($event->country); ?> </td> <td><?php echo REOutput::formatdate($event->dates, $event->times); ?> </td> <td><?php echo redEVENTHelper::getEventDuration($event); ?> </td> <td><?php echo JHTML::_('link', $venue_url, $event->venue); ?> </td> <td class="re-price"><?php
/** * Logic to get the venue * * @return array */ function &getData() { $mainframe =& JFactory::getApplication(); if (empty($this->_venue)) { if ($this->_id) { // Load the Event data $query = ' SELECT v.id, v.venue, v.url, v.street, v.plz, v.city, v.state, v.country, v.locdescription, v.locimage, v.latitude, v.longitude, v.company, ' . ' COUNT( a.id ) AS assignedevents,' . ' CASE WHEN CHAR_LENGTH(v.alias) THEN CONCAT_WS(\':\', v.id, v.alias) ELSE v.id END as slug' . ' FROM #__redevent_venues as v' . ' LEFT JOIN #__redevent_event_venue_xref AS a ON a.venueid = v.id AND a.published = 1' . ' WHERE v.id = ' . $this->_db->Quote($this->_id) . ' GROUP BY v.id '; $this->_db->setQuery($query); $venue = $this->_db->loadObject(); //Create image information $venue->limage = redEVENTImage::flyercreator($venue->locimage); //Generate Venuedescription if (!empty($venue->locdescription)) { //execute plugins $venue->locdescription = JHTML::_('content.prepare', $venue->locdescription); } //build the url if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") { $venue->url = 'http://' . $venue->url; } //prepare the url for output if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) { $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...'; } else { $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES); } //create flag if ($venue->country) { $venue->countryimg = REOutput::getFlag($venue->country); } //create target link $venue->targetlink = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug)); $venue->categories = $this->_getVenueCategories($this->_id); $this->_venue = $venue; } } return $this->_venue; }
/** * Method to get the Venues * * @access public * @return array */ function &getData() { $mainframe =& JFactory::getApplication(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $menu->getParams($item->id); $elsettings =& redEVENTHelper::config(); // Lets load the content if it doesn't already exist if (empty($this->_data)) { $query = $this->_buildQuery(); // Get a reference to the global cache object. $cache =& JFactory::getCache('redevent'); $this->_data = $cache->call(array('RedeventModelVenuesmap', '_getResultList'), $query); $k = 0; for ($i = 0; $i < count($this->_data); $i++) { $venue =& $this->_data[$i]; //Create image information $venue->limage = redEVENTImage::flyercreator($venue->locimage); //Generate Venuedescription if (!empty($venue->locdescription)) { //execute plugins $venue->locdescription = JHTML::_('content.prepare', $venue->locdescription); } //build the url if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") { $venue->url = 'http://' . $venue->url; } //prepare the url for output if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) { $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...'; } else { $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES); } //create flag if ($venue->country) { $venue->countryimg = REOutput::getFlag($venue->country); } //create target link $venue->targetlink = JRoute::_(RedeventHelperRoute::getVenueEventsRoute($venue->slug)); $k = 1 - $k; } } return $this->_data; }
/** * Creates the Venueevents 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('com_redevent'); $uri =& JFactory::getURI(); $pop = JRequest::getBool('pop'); $upcomingvenueevents = $this->get('UpcomingVenueEvents'); $model_venueevents = $this->getModel('Venueevents'); $rows =& $model_venueevents->getData(); $venue =& $model_venueevents->getVenue(); $total =& $model_venueevents->getTotal(); //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 rss link */ $link = '&format=feed'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); // Add needed scripts if the lightbox effect JHTML::_('behavior.modal'); //add alternate feed link $link = 'index.php?option=com_redevent&view=venueevents&format=feed&id=' . $venue->id; $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); //pathway $pathway =& $mainframe->getPathWay(); $task = JRequest::getVar('task'); //create the pathway if ($task == 'archive') { $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $venue->venue, JRoute::_('index.php?option=' . $option . '&view=upcomingvenueevents&task=archive&id=' . $venue->slug)); $link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents&id=' . $venue->slug . '&task=archive'); $print_link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents&id=' . $venue->slug . '&task=archive&pop=1&tmpl=component'); $pagetitle = $venue->venue . ' - ' . JText::_('COM_REDEVENT_ARCHIVE'); } else { $pathway->addItem($venue->venue, JRoute::_('index.php?option=' . $option . '&view=upcomingvenueevents&id=' . $venue->slug)); $link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents&id=' . $venue->slug); $print_link = JRoute::_('index.php?option=com_redevent&view=upcomingvenueevents&id=' . $venue->slug . '&pop=1&tmpl=component'); $pagetitle = $venue->venue . ' - ' . JText::_('COM_REDEVENT_UPCOMING_EVENTS_TITLE'); } //set Page title $document->setTitle($pagetitle); $document->setMetadata('keywords', $venue->meta_keywords); $document->setDescription(strip_tags($venue->meta_description)); //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; } //Printfunction $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($pop) { $params->set('popup', 1); } //Generate Venuedescription if (!empty($venue->locdescription)) { //execute plugins $venuedescription = JHTML::_('content.prepare', $venue->locdescription); } //build the url if (!empty($venue->url) && strtolower(substr($venue->url, 0, 7)) != "http://") { $venue->url = 'http://' . $venue->url; } //prepare the url for output if (strlen(htmlspecialchars($venue->url, ENT_QUOTES)) > 35) { $venue->urlclean = substr(htmlspecialchars($venue->url, ENT_QUOTES), 0, 35) . '...'; } else { $venue->urlclean = htmlspecialchars($venue->url, ENT_QUOTES); } //create flag if ($venue->country) { $venue->countryimg = REOutput::getFlag($venue->country); } // Create the pagination object $limitstart = JRequest::getInt('limitstart'); $limit = $mainframe->getUserStateFromRequest('com_redevent.venueevents.limit', 'limit', $params->def('display_num', 0), 'int'); jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $this->assignRef('upcomingvenueevents', $upcomingvenueevents); $this->assignRef('params', $params); $this->assignRef('rows', $rows); $this->assignRef('venue', $venue); $this->assignRef('pageNav', $pageNav); $this->assignRef('venuedescription', $venuedescription); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); $this->assignRef('pagetitle', $pagetitle); $this->assignRef('task', $task); $this->assignRef('print_link', $print_link); $this->assignRef('dellink', $dellink); $this->assign('action', JRoute::_(RedeventHelperRoute::getUpcomingVenueEventsRoute($venue->slug))); parent::display($tpl); }