/** * Creates the Categoryevents View * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); $option = JRequest::getCmd('option'); //initialize variables $document =& JFactory::getDocument(); $menu =& JSite::getMenu(); $elsettings =& redEVENTHelper::config(); $item = $menu->getActive(); $params =& $mainframe->getParams(); $uri =& JFactory::getURI(); $pathway =& $mainframe->getPathWay(); if (!$this->getLayout()) { $this->setLayout($params->get('default_list_layout')); } /* Check if the item is an object */ if (!is_object($item)) { $item = new StdClass(); $item->title = ''; } //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); } else { $document->addStyleSheet($params->get('custom_css')); } $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // add js JHTML::_('behavior.mootools'); // for filter hint $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js'); // Request variables $limitstart = JRequest::getInt('limitstart'); $limit = $mainframe->getUserStateFromRequest('com_redevent.categoryevents.limit', 'limit', $params->def('display_num', 0), 'int'); $task = JRequest::getWord('task'); $pop = JRequest::getBool('pop'); //get data from model $rows =& $this->get('Data'); $customs =& $this->get('ListCustomFields'); $customsfilters =& $this->get('CustomFilters'); $category =& $this->get('Category'); $total =& $this->get('Total'); //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } //does the category exist if ($category->id == 0) { return JError::raiseError(404, JText::sprintf('COM_REDEVENT_Category_d_not_found', $category->id)); } //Set Meta data if (!$item->title) { $document->setTitle($category->catname); } else { $document->setTitle($item->title . ' - ' . $category->catname); } $document->setMetadata('keywords', $category->meta_keywords); $document->setDescription(strip_tags($category->meta_description)); //Print function $params->def('print', !$mainframe->getCfg('hidePrint')); $params->def('icons', $mainframe->getCfg('icons')); if ($pop) { $params->set('popup', 1); } //add alternate feed link $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug) . '&format=feed'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); if ($task == 'archive') { $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, 'archive'); $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE') . ' - ' . $category->catname, JRoute::_($link)); $print_link = JRoute::_($link . '&pop=1&tmpl=component'); } else { $link = RedeventHelperRoute::getCategoryEventsRoute($category->slug); $pathway->addItem($category->catname, JRoute::_($link)); $print_link = JRoute::_($link . '&pop=1&tmpl=component'); } $thumb_link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, null, 'thumb'); $list_link = RedeventHelperRoute::getCategoryEventsRoute($category->slug, null, 'default'); //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->get('evdelrec'), $elsettings->get('delivereventsyes')); if ($maintainer || $genaccess) { $dellink = 1; } // Create the pagination object jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //Generate Categorydescription if (empty($category->catdescription)) { $catdescription = JText::_('COM_REDEVENT_NO_DESCRIPTION'); } else { //execute plugins $catdescription = JHTML::_('content.prepare', $category->catdescription); } //create select lists $lists = $this->_buildSortLists($elsettings); $state =& $this->get('state'); $filter_customs = $state->get('filter_customs'); $this->assign('lists', $lists); $this->assign('action', JRoute::_('index.php?option=com_redevent&view=categoryevents&id=' . $category->id)); $this->assignRef('rows', $rows); $this->assignRef('customs', $customs); $this->assignRef('noevents', $noevents); $this->assignRef('category', $category); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('task', $task); $this->assignRef('catdescription', $catdescription); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('item', $item); $this->assignRef('config', $elsettings); $this->assignRef('thumb_link', $thumb_link); $this->assignRef('list_link', $list_link); $this->assignRef('customsfilters', $customsfilters); $this->assign('filter_customs', $filter_customs); $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category')); $cols = redEVENTHelper::validateColumns($cols); $this->assign('columns', $cols); parent::display($tpl); }
/** * Creates the Day View * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); //initialize variables $document =& JFactory::getDocument(); $elsettings =& redEVENTHelper::config(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams(); $uri =& JFactory::getURI(); //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); } else { $document->addStyleSheet($params->get('custom_css')); } $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // add js JHTML::_('behavior.mootools'); // for filter hint $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js'); // get variables $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $limit = JRequest::getVar('limit', $params->get('display_num'), '', 'int'); $pop = JRequest::getBool('pop'); $pathway =& $mainframe->getPathWay(); //get data from model $rows =& $this->get('Data'); $customs =& $this->get('ListCustomFields'); $total =& $this->get('Total'); $day =& $this->get('Day'); $daydate = strftime($elsettings->get('formatdate', '%d.%m.%Y'), strtotime($day)); //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } //params if ($item) { $params->def('page_title', $item->title); } if ($pop) { //If printpopup set true $params->set('popup', 1); } $print_link = JRoute::_('index.php?view=day&tmpl=component&pop=1'); //pathway $pathway->addItem($daydate, ''); //Set Page title if ($item && !$item->title) { $document->setTitle($params->get('page_title')); $document->setMetadata('keywords', $params->get('page_title')); } //Check if the user has access to the form $maintainer = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->get('evdelrec'), $elsettings->get('delivereventsyes')); if ($maintainer || $genaccess) { $dellink = 1; } //add alternate feed link $link = 'index.php?option=com_redevent&view=simplelist&format=feed'; $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); $document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs); $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); $document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs); // Create the pagination object $page = $total - $limit; jimport('joomla.html.pagination'); $pageNav = new JPagination($total, $limitstart, $limit); //create select lists $lists = $this->_buildSortLists(); $this->assign('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('customs', $customs); $this->assignRef('noevents', $noevents); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('pageNav', $pageNav); $this->assignRef('page', $page); $this->assignRef('elsettings', $elsettings); $this->assignRef('lists', $lists); $this->assignRef('daydate', $daydate); $this->assign('action', JRoute::_(RedeventHelperRoute::getDayRoute(JRequest::getInt('id')))); $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category')); $cols = redEVENTHelper::validateColumns($cols); $this->assign('columns', $cols); parent::display($tpl); }
/** * 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); }
/** * Creates the MyItems View * * @since 1.0 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); $user =& JFactory::getUser(); if (!$user->get('id')) { $mainframe->redirect('index.php', JText::_('COM_REDEVENT_Only_logged_users_can_access_this_page'), 'error'); } //initialize variables $document =& JFactory::getDocument(); $elsettings =& redEVENTHelper::config(); $pathway =& $mainframe->getPathWay(); $params =& $mainframe->getParams(); $uri =& JFactory::getURI(); $acl =& UserACl::getInstance(); $menu =& JSite::getMenu(); $item = $menu->getActive(); //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]-->'); JHTML::_('behavior.mootools'); $js = " window.addEvent('domready', function(){\n\t\t\t \$\$('.deletelink').addEvent('click', function(event){\n\t\t\t if (confirm('" . JText::_('COM_REDEVENT_CONFIRM_DELETE_DATE') . "')) {\n\t \treturn true;\n\t\t }\n\t\t else {\n\t\t \tif (event.preventDefault) {\n\t\t \t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tevent.returnValue = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t \t}\n\t\t\t });\t\t \n\t\t }); "; $document->addScriptDeclaration($js); // get variables $limitstart = JRequest::getVar('limitstart', 0, '', 'int'); $limit = $mainframe->getUserStateFromRequest('com_redevent.myevents.limit', 'limit', $params->def('display_num', 5), 'int'); $filter_event = $mainframe->getUserStateFromRequest('com_redevent.myevents.filter_event', 'filter_event', 0, 'int'); $task = JRequest::getWord('task'); $pop = JRequest::getBool('pop'); //get data from model $events =& $this->get('Events'); $venues =& $this->get('Venues'); $attending =& $this->get('Attending'); $groups =& $this->get('Groups'); //paginations $events_pageNav =& $this->get('EventsPagination'); $venues_pageNav =& $this->get('VenuesPagination'); $attending_pageNav =& $this->get('AttendingPagination'); //params $params->def('page_title', $item ? $item->title : 'COM_REDEVENT_VIEW_MYEVENTS_TITLE'); if ($pop) { //If printpopup set true $params->set('popup', 1); } //Set Page title $pagetitle = $params->get('page_title', JText::_('COM_REDEVENT_MY_EVENTS')); $this->document->setTitle($pagetitle); //create select lists $lists = $this->_buildSortLists(); if ($lists['filter']) { $uri->setVar('filter', $lists['filter']); $uri->setVar('filter_type', JRequest::getString('filter_type')); } else { $uri->delVar('filter'); $uri->delVar('filter_type'); } // events filter $hasManagedEvents = false; $options = array(JHTML::_('select.option', 0, JText::_('COM_REDEVENT_select_event'))); if ($ev = $this->get('EventsOptions')) { $hasManagedEvents = count($ev); $options = array_merge($options, $ev); } $lists['filter_event'] = JHTML::_('select.genericlist', $options, 'filter_event', 'onchange="document.getElementById(\'adminForm\').submit();"', 'value', 'text', $filter_event); $this->assign('action', JRoute::_(RedeventHelperRoute::getMyeventsRoute())); $this->assignRef('events', $events); $this->assignRef('venues', $venues); $this->assignRef('attending', $attending); $this->assignRef('groups', $groups); $this->assignRef('task', $task); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('events_pageNav', $events_pageNav); $this->assignRef('venues_pageNav', $venues_pageNav); $this->assignRef('attending_pageNav', $attending_pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('pagetitle', $pagetitle); $this->assignRef('lists', $lists); $this->assignRef('acl', $acl); $this->assignRef('hasManagedEvents', $hasManagedEvents); $this->assignRef('canAddXref', $acl->canAddXref()); $this->assignRef('canAddEvent', $acl->canAddEvent()); $this->assignRef('canAddVenue', $acl->canAddVenue()); $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category')); $cols = redEVENTHelper::validateColumns($cols); $this->assign('columns', $cols); parent::display($tpl); }
/** * Creates the Simple List View * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); //initialize variables $document =& JFactory::getDocument(); $elsettings =& redEVENTHelper::config(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams(); $uri =& JFactory::getURI(); $pathway =& $mainframe->getPathWay(); $state =& $this->get('state'); //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/featured.css'); } else { $document->addStyleSheet($params->get('custom_css')); } $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // add js JHTML::_('behavior.mootools'); // for filter hint $document->addScript($this->baseurl . '/components/com_redevent/assets/js/eventslist.js'); // get variables $task = JRequest::getWord('task'); $pop = JRequest::getBool('pop'); //get data from model $rows =& $this->get('Data'); $customs =& $this->get('ListCustomFields'); $customsfilters =& $this->get('CustomFilters'); $pagination =& $this->get('Pagination'); //are events available? if (!$rows) { $noevents = 1; } else { $noevents = 0; } //params $params->def('page_title', isset($item->title) ? $item->title : JText::_('COM_REDEVENT_Events')); if ($pop) { //If printpopup set true $params->set('popup', 1); $This->setLayout('print'); } $print_link = JRoute::_('index.php?option=com_redevent&view=featured&tmpl=component&pop=1'); $pagetitle = $params->get('page_title'); $list_link = RedeventHelperRoute::getFeaturedRoute(); //Set Page title $this->document->setTitle($pagetitle); //add alternate feed link $link = 'index.php?option=com_redevent&view=featured&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 select lists $lists = $this->_buildSortLists(); $filter_customs = $state->get('filter_customs'); $this->assign('lists', $lists); $this->assignRef('rows', $rows); $this->assignRef('customs', $customs); $this->assignRef('customsfilters', $customsfilters); $this->assignRef('task', $task); $this->assignRef('noevents', $noevents); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('pageNav', $pagination); $this->assignRef('elsettings', $elsettings); $this->assignRef('pagetitle', $pagetitle); $this->assignRef('config', $elsettings); $this->assignRef('thumb_link', $thumb_link); $this->assignRef('list_link', $list_link); $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); }
/** * Creates the week View * * @since 2.0 */ function display($tpl = null) { $application = JFactory::getApplication(); //initialize variables $document = JFactory::getDocument(); $settings = redEVENTHelper::config(); $menu = JSite::getMenu(); $item = $menu->getActive(); $params = $application->getParams(); $uri = JFactory::getURI(); //add css file if (!$params->get('custom_css')) { $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/week.css'); } else { $document->addStyleSheet($params->get('custom_css')); } // add js JHTML::_('behavior.mootools'); $pop = JRequest::getBool('pop'); $pathway = $application->getPathWay(); //get data from model $rows =& $this->get('Data'); $week =& $this->get('Day'); //params if ($item) { $title = $item->title; } else { $title = JText::sprintf('COM_REDEVENT_WEEK_HEADER', $this->get('weeknumber'), $this->get('year')); } $params->def('page_title', $title); //pathway $pathway->addItem(JText::sprintf('COM_REDEVENT_WEEK_HEADER', $this->get('weeknumber'), $this->get('year'))); //Set Page title if ($item && !$item->title) { $document->setTitle($params->get('page_title')); $document->setMetadata('keywords', $params->get('page_title')); } $this->assignRef('data', $rows); $this->assignRef('title', $title); $this->assignRef('params', $params); $this->assign('week', $this->get('week')); $this->assign('weeknumber', $this->get('weeknumber')); $this->assign('year', $this->get('year')); $this->assign('weekdays', $this->get('weekdays')); $this->assign('next', $this->get('nextweek')); $this->assign('previous', $this->get('previousweek')); $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category')); array_unshift($cols, 'time'); array_unique($cols); $exclude = array('date'); $cols = array_diff($cols, $exclude); $cols = redEVENTHelper::validateColumns($cols); $this->assign('columns', $cols); $start = JComponentHelper::getParams('com_redevent')->get('week_start') == 'MO' ? 1 : 0; $this->assign('start', $start); parent::display($tpl); }
/** * Creates the Categoriesdetailed View * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); //initialise variables $document =& JFactory::getDocument(); $elsettings =& redEVENTHelper::config(); $model = $this->getModel(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams(); //get vars $pathway =& $mainframe->getPathWay(); $pop = JRequest::getBool('pop'); $task = JRequest::getWord('task'); //Get data from the model $categories =& $this->get('Data'); $customs =& $this->get('ListCustomFields'); $pageNav =& $this->get('pagination'); //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]-->'); $params->def('page_title', $item->title); if ($task == 'archive') { $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE'), JRoute::_(RedeventHelperRoute::getCategoriesDetailedRoute(null, 'archive'))); $print_link = JRoute::_(RedeventHelperRoute::getCategoriesDetailedRoute(null, 'archive') . '&pop=1&tmpl=component'); $pagetitle = $params->get('page_title') . ' - ' . JText::_('COM_REDEVENT_ARCHIVE'); } else { $print_link = JRoute::_(RedeventHelperRoute::getCategoriesDetailedRoute() . '&pop=1&tmpl=component'); $pagetitle = $params->get('page_title'); } //set Page title $this->document->setTitle($pagetitle); $document->setMetadata('keywords', $pagetitle); //Print $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 = ELUser::ismaintainer(); $genaccess = ELUser::validate_user($elsettings->get('evdelrec'), $elsettings->get('delivereventsyes')); if ($maintainer || $genaccess) { $dellink = 1; } //add alternate feed link // $link = 'index.php?option=com_redevent&view=simplelist&format=feed'; // $attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0'); // $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs); // $attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0'); // $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs); // Create the pagination object jimport('joomla.html.pagination'); $this->assignRef('categories', $categories); $this->assignRef('customs', $customs); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('item', $item); $this->assignRef('model', $model); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('task', $task); $this->assignRef('pagetitle', $pagetitle); $cols = explode(',', $params->get('lists_columns', 'date, title, venue, city, category')); $cols = redEVENTHelper::validateColumns($cols); $this->assign('columns', $cols); parent::display($tpl); }
/** * Creates the search View * * @since 0.9 */ function display($tpl = null) { $mainframe =& JFactory::getApplication(); //initialize variables $document =& JFactory::getDocument(); $elsettings =& redEVENTHelper::config(); $menu =& JSite::getMenu(); $item = $menu->getActive(); $params =& $mainframe->getParams(); $uri =& JFactory::getURI(); $pathway =& $mainframe->getPathWay(); //add css file $document->addStyleSheet($this->baseurl . '/components/com_redevent/assets/css/redevent.css'); $document->addCustomTag('<!--[if IE]><style type="text/css">.floattext{zoom:1;}, * html #eventlist dd { height: 1%; }</style><![endif]-->'); // add javascript JHTML::_('behavior.mootools'); $document->addScript($this->baseurl . '/components/com_redevent/assets/js/search.js'); // get variables $task = JRequest::getWord('task'); $pop = JRequest::getBool('pop'); //get data from model $rows =& $this->get('Data'); $customs =& $this->get('ListCustomFields'); $customsfilters =& $this->get('CustomFilters'); $total =& $this->get('Total'); // Create the pagination object $pageNav = $this->get('Pagination'); $limitstart = $pageNav->limitstart; $limit = $pageNav->limit; $state =& $this->get('state'); // set in the model $filter_country = $state->get('filter_country'); $filter_city = $state->get('filter_city'); $filter_state = $state->get('filter_state'); $filter_venue = $state->get('filter_venue'); $filter_date_from = $state->get('filter_date_from'); $filter_date_to = $state->get('filter_date_to'); $filter_venuecategory = $state->get('filter_venuecategory'); $filter_category = $mainframe->getUserStateFromRequest('com_redevent.search.filter_category', 'filter_category', $params->get('category', 0), 'int'); $filter_event = $state->get('filter_event'); $filter_customs = $state->get('filter_customs'); //are events available? if (!$rows) { $noevents = 1; $filter = $this->get('Filter'); if (!$filter) { $nofilter = 1; } } else { $noevents = 0; $nofilter = 0; } //params $params->def('page_title', $item->title); if ($pop) { //If printpopup set true $params->set('popup', 1); $this->setLayout('print'); } if ($task == 'archive') { $pathway->addItem(JText::_('COM_REDEVENT_ARCHIVE'), JRoute::_('index.php?option=com_redevent&view=search&task=archive')); $print_link = JRoute::_('index.php?option=com_redevent&view=search&task=archive&tmpl=component&pop=1'); $pagetitle = $params->get('page_title') . ' - ' . JText::_('COM_REDEVENT_ARCHIVE'); } else { $print_link = JRoute::_('index.php?option=com_redevent&view=search&tmpl=component&pop=1'); $pagetitle = $params->get('page_title'); } //Set Page title $this->document->setTitle($pagetitle); //create select lists $lists = $this->_buildSortLists(); if ($params->get('category', 0) == 0) { $catoptions = array(); $catoptions[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Select_category')); $catoptions = array_merge($catoptions, $this->get('CategoriesOptions')); $selectedcats = $filter_category ? array($filter_category) : array(); //build select $lists['categories'] = JHTML::_('select.genericlist', $catoptions, 'filter_category', 'size="1" class="inputbox dynfilter"', 'value', 'text', $selectedcats); unset($catoptions); } $vcatoptions = array(); $vcatoptions[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Select_venue_category')); $vcatoptions = array_merge($vcatoptions, redEVENTHelper::getVenuesCatOptions()); $selectedcats = $filter_venuecategory ? array($filter_venuecategory) : array(); //build select $lists['vcategories'] = JHTML::_('select.genericlist', $vcatoptions, 'filter_venuecategory', 'size="1" class="inputbox dynfilter"', 'value', 'text', $selectedcats); unset($catoptions); // country filter $countries = array(); $countries[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Select_country')); $countries = array_merge($countries, $this->get('CountryOptions')); $lists['countries'] = JHTML::_('select.genericlist', $countries, 'filter_country', 'class="inputbox"', 'value', 'text', $filter_country); unset($countries); // state filter $states = array(); $states[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Select_state')); $states = array_merge($states, $this->get('StateOptions')); $lists['states'] = JHTML::_('select.genericlist', $states, 'filter_state', 'class="inputbox"', 'value', 'text', $filter_state); unset($states); // city filter $cities = array(); $cities[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Select_city')); $cities = array_merge($cities, $this->get('CityOptions')); $lists['cities'] = JHTML::_('select.genericlist', $cities, 'filter_city', 'class="inputbox"', 'value', 'text', $filter_city); unset($cities); // venues filter $venues = array(); $venues[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Select_venue')); $venues = array_merge($venues, $this->get('VenuesOptions')); $lists['venues'] = JHTML::_('select.genericlist', $venues, 'filter_venue', 'class="inputbox dynfilter"', 'value', 'text', $filter_venue); unset($venues); // events filter $options = array(); $options[] = JHTML::_('select.option', '0', JText::_('COM_REDEVENT_Search_select_event')); $options = array_merge($options, $this->get('EventsOptions')); $lists['events'] = JHTML::_('select.genericlist', $options, 'filter_event', 'class="inputbox dynfilter"', 'value', 'text', $filter_event); unset($venues); // remove previously set filter in get $uri->delVar('filter'); $uri->delVar('filter_type'); $uri->delVar('filter_category'); $uri->delVar('filter_venuecategory'); $uri->delVar('filter_venue'); $uri->delVar('filter_event'); $uri->delVar('filter_continent'); $uri->delVar('filter_country'); $uri->delVar('filter_state'); $uri->delVar('filter_city'); $uri->delVar('filter_date_from'); $uri->delVar('filter_date_to'); $uri->delVar('filtercustom'); $this->assign('lists', $lists); $this->assign('total', $total); $this->assign('action', JRoute::_(RedeventHelperRoute::getSearchRoute())); $this->assignRef('rows', $rows); $this->assignRef('customs', $customs); $this->assignRef('customsfilters', $customsfilters); $this->assignRef('task', $task); $this->assignRef('noevents', $noevents); $this->assignRef('nofilter', $nofilter); $this->assignRef('print_link', $print_link); $this->assignRef('params', $params); $this->assignRef('dellink', $dellink); $this->assignRef('pageNav', $pageNav); $this->assignRef('elsettings', $elsettings); $this->assignRef('pagetitle', $pagetitle); $this->assign('filter_country', $filter_country); $this->assign('filter_state', $filter_state); $this->assign('filter_date_from', $filter_date_from); $this->assign('filter_date_to', $filter_date_to); $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); }