function display($tpl = null) { global $mainframe; $document =& JFactory::getDocument(); $elsettings = ELHelper::config(); $rows =& $this->get('Data'); $total =& $this->get('Total'); //cleanup events ELHelper::cleanevents($elsettings->lastupdate); //add css file $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); //get menu information $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams('com_eventlist'); // Request variables $limitstart = JRequest::getInt('limitstart'); $limit = JRequest::getInt('limit', $params->get('cat_num')); $task = JRequest::getWord('task', '', '', 'string'); $params->def('page_title', $item->name); //pathway $pathway =& $mainframe->getPathWay(); $pathway->setItemName(1, $item->name); if ($task == 'archive') { $pathway->addItem(JText::_('ARCHIVE'), JRoute::_('index.php?view=categories&task=archive')); $navlink = JRoute::_('index.php?view=categories&task=archive'); $pagetitle = $params->get('page_title') . ' - ' . JText::_('ARCHIVE'); $urlfragment = 'index.php?view=categoryevents&task=catarchive&id='; } else { $navlink = JRoute::_('index.php?view=categories'); $pagetitle = $params->get('page_title'); $urlfragment = 'index.php?view=categoryevents&id='; } //Set Page title $mainframe->setPageTitle($params->get('page_title')); $mainframe->addMetaTag('title', $params->get('page_title')); //get icon settings $params->def('icons', $mainframe->getCfg('icons')); //add alternate feed link $link = 'index.php?option=com_eventlist&view=eventlist&format=feed'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->evdelrec, $elsettings->delivereventsyes); if ($maintainer || $genaccess) { $dellink = 1; } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $this->assignRef('rows', $rows); $this->assignRef('task', $task); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('pageNav', $pageNav); $this->assignRef('navlink', $navlink); $this->assignRef('item', $item); $this->assignRef('elsettings', $elsettings); $this->assignRef('pagetitle', $pagetitle); $this->assignRef('urlfragment', $urlfragment); parent::display($tpl); }
/** * Creates the Simple List View * * @since 0.9 */ function display($tpl = null) { global $mainframe; //initialize variables $document =& JFactory::getDocument(); $elsettings = ELHelper::config(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams(); //print_r($params); //$mainframe->close(); //cleanup events ELHelper::cleanevents($elsettings->lastupdate); //add css file $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // get variables $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int'); $pop = JRequest::getBool('pop'); $pathway =& $mainframe->getPathWay(); //get data from model $rows =& $this->get('Data'); $total =& $this->get('Total'); //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } //params $params->def('page_title', $item->name); if ($pop) { //If printpopup set true $params->set('popup', 1); } $print_link = JRoute::_('index.php?view=eventlist&tmpl=component&pop=1'); //pathway $pathway->setItemName(1, $item->name); //Set Page title if (!$item->name) { $document->setTitle($params->get('page_title')); $document->setMetadata('keywords', $params->get('page_title')); } //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->evdelrec, $elsettings->delivereventsyes); if ($maintainer || $genaccess) { $dellink = 1; } //add alternate feed link $link = 'index.php?option=com_eventlist&view=eventlist&format=feed'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //create select lists $lists = $this->_buildSortLists($elsettings); $this->assign('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('noevents', $noevents); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('lists', $lists); parent::display($tpl); }
/** * Creates the Venuesview * * @since 0.9 */ function display($tpl = null) { global $mainframe; $document =& JFactory::getDocument(); $elsettings = ELHelper::config(); //get menu information $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams(); //cleanup events ELHelper::cleanevents($elsettings->lastupdate); //add css file $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // Request variables $limitstart = JRequest::getInt('limitstart'); $limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int'); $pop = JRequest::getBool('pop', 0, '', 'int'); $rows =& $this->get('Data'); $total =& $this->get('Total'); //Add needed scripts if the lightbox effect is enabled if ($elsettings->lightbox == 1) { JHTML::_('behavior.modal'); } //add alternate feed link $link = 'index.php?option=com_eventlist&view=venues&format=feed'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); $params->def('page_title', $item->name); //set Page title $document->setTitle($params->get('page_title')); $document->setMetadata('keywords', $params->get('page_title')); //pathway $pathway =& $mainframe->getPathWay(); $pathway->setItemName(1, $item->name); //Printfunction $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($params->def('page_title', 1)) { $params->def('header', $item->name); } if ($pop) { $params->set('popup', 1); } $print_link = JRoute::_('index.php?view=venues&pop=1&tmpl=component'); //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->evdelrec, $elsettings->delivereventsyes); if ($maintainer || $genaccess) { $dellink = 1; } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); $link = 'index.php?option=com_eventlist&view=venues'; $this->assignRef('rows', $rows); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('link', $link); $this->assignRef('pageNav', $pageNav); $this->assignRef('limit', $limit); $this->assignRef('total', $total); $this->assignRef('item', $item); $this->assignRef('elsettings', $elsettings); parent::display($tpl); }
/** * Creates the Categoryevents View * * @since 0.9 */ function display($tpl = null) { global $mainframe, $option; //initialize variables $document =& JFactory::getDocument(); $menu =& JSite::getMenu(); $elsettings = ELHelper::config(); $item = $menu->getActive(); $params =& $mainframe->getParams(); //cleanup events ELHelper::cleanevents($elsettings->lastupdate); //add css file $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // Request variables $limitstart = JRequest::getInt('limitstart'); $limit = $mainframe->getUserStateFromRequest('com_eventlist.categoryevents.limit', 'limit', $params->def('display_num', 0), 'int'); $task = JRequest::getWord('task'); $pop = JRequest::getBool('pop'); //get data from model $rows =& $this->get('Data'); $category =& $this->get('Category'); $total =& $this->get('Total'); //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } //does the category exist if ($category->id == 0) { return JError::raiseError(404, JText::sprintf('Category #%d not found', $category->id)); } //Set Meta data $document->setTitle($item->name . ' - ' . $category->catname); $document->setMetadata('keywords', $category->meta_keywords); $document->setDescription(strip_tags($category->meta_description)); //Print function $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($pop) { $params->set('popup', 1); } $print_link = JRoute::_('index.php?option=com_eventlist&view=categoryevents&id=' . $category->id . '&pop=1&tmpl=component'); //add alternate feed link $link = 'index.php?option=com_eventlist&view=categoryevents&format=feed&id=' . $category->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); //create the pathway if ($task == 'catarchive') { $pathway =& $mainframe->getPathWay(); $pathway->setItemName(1, $item->name); $pathway->addItem(JText::_('ARCHIVE') . ' - ' . $category->catname, JRoute::_('index.php?option=' . $option . '&view=categoryevents&task=catarchive&id=' . $category->id)); $link = JRoute::_('index.php?option=com_eventlist&view=categoryevents&task=catarchive&id=' . $category->id); } else { $pathway =& $mainframe->getPathWay(); $pathway->setItemName(1, $item->name); $pathway->addItem($category->catname, JRoute::_('index.php?option=' . $option . '&view=categoryevents&id=' . $category->id)); $link = JRoute::_('index.php?option=com_eventlist&view=categoryevents&id=' . $category->id); } //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->evdelrec, $elsettings->delivereventsyes); if ($maintainer || $genaccess) { $dellink = 1; } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //Generate Categorydescription if (empty($category->catdescription)) { $catdescription = JText::_('NO DESCRIPTION'); } else { //execute plugins $category->text = $category->catdescription; $category->title = $category->catname; JPluginHelper::importPlugin('content'); $results = $mainframe->triggerEvent('onPrepareContent', array(&$category, &$params, 0)); $catdescription = $category->text; } if ($category->image != '') { $attribs['width'] = $elsettings->imagewidth; $attribs['height'] = $elsettings->imagehight; $attribs['border'] = 0; $category->image = JHTML::image('images/stories/' . $category->image, $category->catname, $attribs); } else { $category->image = JHTML::image('components/com_eventlist/assets/images/noimage.png', $category->catname); } //create select lists $lists = $this->_buildSortLists($elsettings); $this->assign('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('noevents', $noevents); $this->assignRef('category', $category); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('task', $task); $this->assignRef('catdescription', $catdescription); $this->assignRef('link', $link); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); parent::display($tpl); }
/** * Creates the Venueevents View * * @since 0.9 */ function display($tpl = null) { global $mainframe, $option; //initialize variables $document =& JFactory::getDocument(); $menu =& JSite::getMenu(); $elsettings = ELHelper::config(); $item = $menu->getActive(); $params =& $mainframe->getParams('com_eventlist'); //cleanup events ELHelper::cleanevents($elsettings->lastupdate); //add css file $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // Request variables $limitstart = JRequest::getInt('limitstart'); $limit = $mainframe->getUserStateFromRequest('com_eventlist.venueevents.limit', 'limit', $params->def('display_num', 0), 'int'); $pop = JRequest::getBool('pop'); //get data from model $rows =& $this->get('Data'); $venue =& $this->get('Venue'); $total =& $this->get('Total'); //does the venue exist? if ($venue->id == 0) { return JError::raiseError(404, JText::sprintf('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 if ($elsettings->lightbox == 1) { JHTML::_('behavior.modal'); } //Get image $limage = ELImage::flyercreator($venue->locimage, $elsettings); //add alternate feed link $link = 'index.php?option=com_eventlist&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); //set Page title $document->setTitle($item->name . ' - ' . $venue->venue); $document->setMetadata('keywords', $venue->meta_keywords); $document->setDescription(strip_tags($venue->meta_description)); //pathway $pathway =& $mainframe->getPathWay(); $pathway->setItemName(1, $item->name); $pathway->addItem($venue->venue, JRoute::_('index.php?option=' . $option . '&view=venueevents&id=' . $venue->id)); //Printfunction $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($pop) { $params->set('popup', 1); } $print_link = JRoute::_('index.php?option=com_eventlist&view=venueevents&id=' . $venue->id . '&pop=1&tmpl=component'); //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->evdelrec, $elsettings->delivereventsyes); if ($maintainer || $genaccess) { $dellink = 1; } //Generate Venuedescription if (empty($venue->locdescription)) { $venuedescription = JText::_('NO DESCRIPTION'); } else { //execute plugins $venue->text = $venue->locdescription; $venue->title = $venue->venue; JPluginHelper::importPlugin('content'); $results = $mainframe->triggerEvent('onPrepareContent', array(&$venue, &$params, 0)); $venuedescription = $venue->text; } //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 = ELOutput::getFlag($venue->country); } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //create select lists $lists = $this->_buildSortLists(); $this->assign('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('noevents', $noevents); $this->assignRef('venue', $venue); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('limage', $limage); $this->assignRef('venuedescription', $venuedescription); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); parent::display($tpl); }
/** * Creates the output for the details view * * @since 0.9 */ function display($tpl = null) { global $mainframe; $document =& JFactory::getDocument(); $user =& JFactory::getUser(); $elsettings = ELHelper::config(); $row =& $this->get('Details'); $registers =& $this->get('Registers'); $regcheck =& $this->get('Usercheck'); //cleanup events ELHelper::cleanevents($elsettings->lastupdate); //get menu information $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams('com_eventlist'); //Check if the id exists if ($row->did == 0) { return JError::raiseError(404, JText::sprintf('Event #%d not found', $row->did)); } //Check if user has access to the details if ($elsettings->showdetails == 0) { return JError::raiseError(403, JText::_('NO ACCESS')); } //add css file $document->addStyleSheet($this->baseurl . '/components/com_eventlist/assets/css/eventlist.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); //Print $pop = JRequest::getBool('pop'); $params->def('page_title', JText::_('DETAILS')); if ($pop) { $params->set('popup', 1); } $print_link = JRoute::_('index.php?view=details&id=' . $row->slug . '&pop=1&tmpl=component'); //pathway $pathway =& $mainframe->getPathWay(); $pathway->addItem(JText::_('DETAILS') . ' - ' . $row->title, JRoute::_('index.php?view=details&id=' . $row->slug)); //Get images $dimage = ELImage::flyercreator($row->datimage, $elsettings, 'event'); $limage = ELImage::flyercreator($row->locimage, $elsettings); //Check user if he can edit $allowedtoeditevent = ELUser::editaccess($elsettings->eventowner, $row->created_by, $elsettings->eventeditrec, $elsettings->eventedit); $allowedtoeditvenue = ELUser::editaccess($elsettings->venueowner, $row->venueowner, $elsettings->venueeditrec, $elsettings->venueedit); //Generate Date $date = strftime($elsettings->formatdate, strtotime($row->dates)); if ($row->times) { $time = strftime($elsettings->formattime, strtotime($row->times)); } if (!$row->enddates) { $displaydate = $date . '<br />'; } else { $enddate = strftime($elsettings->formatdate, strtotime($row->enddates)); $displaydate = $date . ' - ' . $enddate . '<br />'; } //Generate Time if ($elsettings->showtimedetails == 1 && $row->times) { $starttime = $time . ' ' . $elsettings->timename; if ($row->endtimes) { $endtime = strftime($elsettings->formattime, strtotime($row->endtimes)); $endtime = ' - ' . $endtime . ' ' . $elsettings->timename; $displaytime = $starttime . $endtime; } else { $displaytime = $starttime; } } //Timecheck for registration $jetzt = date("Y-m-d"); $now = strtotime($jetzt); $date = strtotime($row->dates); $timecheck = $now - $date; //let's build the registration handling $formhandler = 0; //is the user allready registered at the event if ($regcheck) { $formhandler = 3; } else { //no, he isn't $formhandler = 4; } //check if it is too late to register and overwrite $formhandler if ($timecheck > 0) { $formhandler = 1; } //is the user registered at joomla and overwrite $formhandler if not if (!$user->get('id')) { $formhandler = 2; } //Generate Eventdescription if ($row->datdescription == '' || $row->datdescription == '<br />') { $eventdescription = JText::_('NO DESCRIPTION'); } else { //Execute Plugins $row->text = $row->datdescription; //$row->title = $row->title; JPluginHelper::importPlugin('content'); $results = $mainframe->triggerEvent('onPrepareContent', array(&$row, &$params, 0)); $eventdescription = $row->text; } //Generate Venuedescription if (empty($row->locdescription)) { $venuedescription = JText::_('NO DESCRIPTION'); } else { //execute plugins $row->text = $row->locdescription; //$row->title = $row->venue; JPluginHelper::importPlugin('content'); $results = $mainframe->triggerEvent('onPrepareContent', array(&$row, &$params, 0)); $venuedescription = $row->text; } // generate Metatags $meta_keywords_content = ""; if (!empty($row->meta_keywords)) { $keywords = explode(",", $row->meta_keywords); foreach ($keywords as $keyword) { if ($meta_keywords_content != "") { $meta_keywords_content .= ", "; } if (ereg("[/[/]", $keyword)) { $keyword = trim(str_replace("[", "", str_replace("]", "", $keyword))); $meta_keywords_content .= $this->keyword_switcher($keyword, $row, $elsettings->formattime, $elsettings->formatdate); } else { $meta_keywords_content .= $keyword; } } } if (!empty($row->meta_description)) { $description = explode("[", $row->meta_description); $description_content = ""; foreach ($description as $desc) { $keyword = substr($desc, 0, strpos($desc, "]", 0)); if ($keyword != "") { $description_content .= $this->keyword_switcher($keyword, $row, $elsettings->formattime, $elsettings->formatdate); $description_content .= substr($desc, strpos($desc, "]", 0) + 1); } else { $description_content .= $desc; } } } else { $description_content = ""; } //set page title and meta stuff $document->setTitle($item->name . ' - ' . $row->title); $document->setMetadata('keywords', $meta_keywords_content); $document->setDescription(strip_tags($description_content)); //build the url if (!empty($row->url) && strtolower(substr($row->url, 0, 7)) != "http://") { $row->url = 'http://' . $row->url; } //create flag if ($row->country) { $row->countryimg = ELOutput::getFlag($row->country); } //assign vars to jview $this->assignRef('row', $row); $this->assignRef('params', $params); $this->assignRef('allowedtoeditevent', $allowedtoeditevent); $this->assignRef('allowedtoeditvenue', $allowedtoeditvenue); $this->assignRef('dimage', $dimage); $this->assignRef('limage', $limage); $this->assignRef('displaytime', $displaytime); $this->assignRef('displaydate', $displaydate); $this->assignRef('print_link', $print_link); $this->assignRef('eventdescription', $eventdescription); $this->assignRef('venuedescription', $venuedescription); $this->assignRef('registers', $registers); $this->assignRef('formhandler', $formhandler); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); parent::display($tpl); }