primo commit

This commit is contained in:
2024-12-17 17:34:10 +01:00
commit e650f8df99
16435 changed files with 2451012 additions and 0 deletions

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,52 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
?>
<div id="jem" class="jem_venueslist<?php echo $this->pageclass_sfx; ?>">
<div class="buttons">
<?php
$btn_params = array('task' => $this->task, 'print_link' => $this->print_link);
echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
?>
</div>
<?php
if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="componentheading">
<?php
echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php
endif; ?>
<div class="clr"></div>
<?php
if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php
echo $this->params->get('introtext'); ?>
</div>
<?php
endif; ?>
<!--table-->
<?php echo $this->loadTemplate('venues'); ?>
<!--footer-->
<div class="pagination">
<?php
echo $this->pagination->getPagesLinks(); ?>
</div>
<div class="copyright">
<?php
echo JemOutput::footer(); ?>
</div>
</div>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEM_VENUESLIST_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_JEM_VENUESLIST_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic" addfieldpath="/administrator/components/com_jem/models/fields">
<field name="introtext" type="textarea"
filter="safehtml"
default=""
rows="8"
cols="30"
label="COM_JEM_INTROTEXT_FIELD"
description="COM_JEM_INTROTEXT_FIELD_DESC"
/>
<field name="showintrotext" type="radio"
default="0"
label="COM_JEM_DISPLAY_INTROTEXT"
description="COM_JEM_DISPLAY_INTROTEXT_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="showstate" type="radio"
default="0"
label="COM_JEM_SHOWSTATE"
description="COM_JEM_SHOWSTATE_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,128 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
?>
<style>
div#jem_filter select {
width: auto;
margin-right:10px;
border: 1px solid #808080;
background-color: #C6CCBE;
cursor: pointer;
}
</style>
<form action="<?php echo htmlspecialchars($this->action); ?>" method="post" id="adminForm" name="adminForm">
<?php
function jem_common_show_filter(&$obj) {
if ($obj->settings->get('global_show_filter',1) && !JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-hidefilter')) {
return true;
}
if (JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-showfilter')) {
return true;
}
return false;
}
?>
<?php if (jem_common_show_filter($this) && !JemHelper::jemStringContains($this->params->get('pageclass_sfx'), 'jem-filterbelow')): ?>
<div id="jem_filter" class="floattext">
<?php if ($this->settings->get('global_show_filter',1)) : ?>
<div class="jem_fleft">
<label for="filter"><?php echo Text::_('COM_JEM_FILTER'); ?></label>
<?php echo $this->lists['filter'].'&nbsp;'; ?>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->lists['search'];?>" class="inputbox" onchange="document.adminForm.submit();" />
<button class="btn btn-primary" type="submit"><?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button class="btn btn-secondary" type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php endif; ?>
<?php if ($this->settings->get('global_display',1)) : ?>
<div class="jem_fright">
<label for="limit"><?php echo Text::_('COM_JEM_DISPLAY_NUM'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="table table-responsive table-striped table-hover table-sm">
<table class="eventtable table table-striped" style="width:<?php echo $this->jemsettings->tablewidth; ?>;" summary="Venues">
<colgroup>
<col width="20%" class="jem_col_city" />
<?php if ($this->params->get('showstate')) : ?>
<col width="20%" class="jem_col_state" />
<?php endif; ?>
<?php if ($this->jemsettings->showlocate == 1) : ?>
<col width="<?php echo $this->jemsettings->locationwidth; ?>" class="jem_col_venue" />
<?php endif; ?>
</colgroup>
<thead>
<tr>
<th id="jem_city" class="sectiontableheader" align="left"><i class="fa fa-building" aria-hidden="true"></i>&nbsp;<?php echo HTMLHelper::_('grid.sort', 'COM_JEM_TABLE_CITY', 'a.city', $this->lists['order_Dir'], $this->lists['order']); ?></th>
<?php if ($this->params->get('showstate')) : ?>
<th id="jem_state" class="sectiontableheader" align="left"><i class="fa fa-map" aria-hidden="true"></i>&nbsp;<?php echo HTMLHelper::_('grid.sort', 'COM_JEM_TABLE_STATE', 'a.state', $this->lists['order_Dir'], $this->lists['order']); ?></th>
<?php endif; ?>
<th id="jem_location" class="sectiontableheader" align="left"><i class="fa fa-map-marker" aria-hidden="true"></i>&nbsp;<?php echo HTMLHelper::_('grid.sort', 'COM_JEM_TABLE_LOCATION', 'a.venue', $this->lists['order_Dir'], $this->lists['order']); ?></th>
</tr>
</thead>
<tbody>
<?php if (empty($this->rows)) : ?>
<tr class="no_events"><td colspan="20"><?php echo Text::_('COM_JEM_NO_VENUES'); ?></td></tr>
<?php else : ?>
<?php $odd = 0; ?>
<?php foreach ($this->rows as $row) : ?>
<tr class="venue_id<?php echo $this->escape($row->id); ?>">
<?php $odd = 1 - $odd; ?>
<td headers="jem_city" align="left" valign="top"><?php echo $row->city ? $this->escape($row->city) : '-'; ?></td>
<?php if ($this->params->get('showstate')) : ?>
<td headers="jem_state" align="left" valign="top">
<?php echo !empty($row->state) ? $this->escape($row->state) : '-'; ?>
</td>
<?php endif; ?>
<td headers="jem_location" align="left" valign="top">
<?php
if ($this->jemsettings->showlinkvenue == 1) :
echo $row->id != 0 ? "<a href='".Route::_(JemHelperRoute::getVenueRoute($row->venueslug))."'>".$this->escape($row->venue)."</a>" : '-';
else :
echo $row->id ? $this->escape($row->venue) : '-';
endif;
?>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="option" value="com_jem" />
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>

View File

@ -0,0 +1,133 @@
<?php
/**
* @version 2.3.1
* @package JEM
* @copyright (C) 2013-2021 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::_('behavior.tooltip');
?>
<?php /*?>
<style>
div#jem_filter select {
width: auto;
margin-right:10px;
border: 1px solid #808080;
background-color: #C6CCBE;
cursor: pointer;
}
</style>
<?php */?>
<form action="<?php echo htmlspecialchars($this->action); ?>" method="post" id="adminForm" name="adminForm">
<?php
function jem_common_show_filter(&$obj) {
if ($obj->settings->get('global_show_filter',1) && !JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-hidefilter')) {
return true;
}
if (JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-showfilter')) {
return true;
}
return false;
}
?>
<?php if (jem_common_show_filter($this) && !JemHelper::jemStringContains($this->params->get('pageclass_sfx'), 'jem-filterbelow')): ?>
<div id="jem_filter" class="floattext jem-form jem-row jem-justify-start">
<div>
<?php echo '<label for="filter">'.JText::_('COM_JEM_FILTER').'</label>'; ?>
</div>
<div class="jem-row jem-justify-start jem-nowrap">
<?php echo $this->lists['filter']; ?>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->lists['search'];?>" class="inputbox" onchange="document.adminForm.submit();" />
</div>
<div class="jem-row jem-justify-start jem-nowrap">
<button class="btn btn-primary" type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button class="btn btn-secondary" type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php if ($this->settings->get('global_display',1)) : ?>
<div class="jem_fright">
<label for="limit"><?php echo JText::_('COM_JEM_DISPLAY_NUM'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="table table-responsive table-striped table-hover table-sm">
<table class="eventtable" style="width:<?php echo $this->jemsettings->tablewidth; ?>;" summary="Venues">
<colgroup>
<col width="20%" class="jem_col_city" />
<?php if ($this->params->get('showstate')) : ?>
<col width="20%" class="jem_col_state" />
<?php endif; ?>
<?php if ($this->jemsettings->showlocate == 1) : ?>
<col width="<?php echo $this->jemsettings->locationwidth; ?>" class="jem_col_venue" />
<?php endif; ?>
</colgroup>
<thead>
<tr>
<th id="jem_city" class="sectiontableheader" align="left"><i class="fa fa-building-o" aria-hidden="true"></i>&nbsp;<?php echo JHtml::_('grid.sort', 'COM_JEM_TABLE_CITY', 'a.city', $this->lists['order_Dir'], $this->lists['order']); ?></th>
<?php if ($this->params->get('showstate')) : ?>
<th id="jem_state" class="sectiontableheader" align="left"><i class="fa fa-map-o" aria-hidden="true"></i>&nbsp;<?php echo JHtml::_('grid.sort', 'COM_JEM_TABLE_STATE', 'a.state', $this->lists['order_Dir'], $this->lists['order']); ?></th>
<?php endif; ?>
<th id="jem_location" class="sectiontableheader" align="left"><i class="fa fa-map-marker" aria-hidden="true"></i>&nbsp;<?php echo JHtml::_('grid.sort', 'COM_JEM_TABLE_LOCATION', 'a.venue', $this->lists['order_Dir'], $this->lists['order']); ?></th>
</tr>
</thead>
<tbody>
<?php if (empty($this->rows)) : ?>
<tr class="no_events"><td colspan="20"><?php echo JText::_('COM_JEM_NO_VENUES'); ?></td></tr>
<?php else : ?>
<?php $odd = 0; ?>
<?php foreach ($this->rows as $row) : ?>
<?php $odd = 1 - $odd; ?>
<td headers="jem_city" align="left" valign="top"><?php echo $row->city ? $this->escape($row->city) : '-'; ?></td>
<?php if ($this->params->get('showstate')) : ?>
<td headers="jem_state" align="left" valign="top">
<?php echo !empty($row->state) ? $this->escape($row->state) : '-'; ?>
</td>
<?php endif; ?>
<td headers="jem_location" align="left" valign="top">
<?php
if ($this->jemsettings->showlinkvenue == 1) :
echo $row->id != 0 ? "<a href='".JRoute::_(JemHelperRoute::getVenueRoute($row->venueslug))."'>".$this->escape($row->venue)."</a>" : '-';
else :
echo $row->id ? $this->escape($row->venue) : '-';
endif;
?>
</td>
</tr>
<?php// $i = 1 - $i; ?>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="option" value="com_jem" />
<?php echo JHtml::_('form.token'); ?>
</form>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,61 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
?>
<div id="jem" class="jem_venueslist<?php echo $this->pageclass_sfx;?>">
<div class="buttons">
<?php
//$btn_params = array('task' => $this->task, 'print_link' => $this->print_link);
$btn_params = array('task' => $this->task, 'print_link' => Route::_('index.php?option=com_jem&view=venueslist&layout=print&task=print&tmpl=component&print=1'));
echo JemOutput::createButtonBar($this->getName(), $this->permissions, $btn_params);
?>
</div>
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="componentheading">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<div class="clr"></div>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<?php endif; ?>
<!--table-->
<form action="<?php echo htmlspecialchars($this->action); ?>" method="post" name="adminForm" id="adminForm">
<?php echo $this->loadTemplate('venues');?>
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="option" value="com_jem" />
<?php echo HTMLHelper::_('form.token'); ?>
</form>
<?php if ($this->params->get('showfootertext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('footertext'); ?>
</div>
<?php endif; ?>
<!--footer-->
<div class="copyright">
<?php echo JEMOutput::footer( ); ?>
</div>
</div>

View File

@ -0,0 +1,193 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
$uri = Uri::getInstance();
?>
<script>
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>
<style>
.jem-sort #jem_city,
#jem .jem-event .jem-event-city {
flex: 1 <?php echo ($this->jemsettings->citywidth); ?>;
}
.jem-sort #jem_state,
#jem .jem-event .jem-event-state {
<?php if (($this->jemsettings->showstate == 1) && (!empty($this->jemsettings->statewidth))) : ?>
flex: 1 <?php echo ($this->jemsettings->statewidth); ?>;
<?php else : ?>
flex: 1;
<?php endif; ?>
}
.jem-sort #jem_location,
#jem .jem-event .jem-event-venue {
flex: 1 <?php echo ($this->jemsettings->locationwidth); ?>;
}
</style>
<?php
function jem_common_show_filter(&$obj) {
if ($obj->settings->get('global_show_filter',1) && !JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-hidefilter')) {
return true;
}
if (JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-showfilter')) {
return true;
}
return false;
}
?>
<?php if (jem_common_show_filter($this) && !JemHelper::jemStringContains($this->params->get('pageclass_sfx'), 'jem-filterbelow')): ?>
<div id="jem_filter" class="floattext jem-form jem-row jem-justify-start">
<div>
<?php echo '<label for="filter">'.Text::_('COM_JEM_FILTER').'</label>'; ?>
</div>
<div class="jem-row jem-justify-start jem-nowrap">
<?php echo $this->lists['filter']; ?>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->lists['search'];?>" class="inputbox form-control" onchange="document.adminForm.submit();" />
</div>
<div class="jem-row jem-justify-start jem-nowrap">
<button class="btn btn-primary" type="submit"><?php echo Text::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button class="btn btn-secondary" type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php if ($this->settings->get('global_display',1)) : ?>
<div class="jem-row jem-justify-start jem-nowrap">
<label for="limit"><?php echo Text::_('COM_JEM_DISPLAY_NUM'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="jem-sort jem-sort-small">
<div class="jem-list-row jem-small-list">
<div id="jem_city" class="sectiontableheader"><i class="fa fa-building" aria-hidden="true"></i>&nbsp;<?php echo HTMLHelper::_('grid.sort', 'COM_JEM_TABLE_CITY', 'a.city', $this->lists['order_Dir'], $this->lists['order']); ?></div>
<?php if ($this->params->get('showstate')) : ?>
<div id="jem_state" class="sectiontableheader"><i class="fa fa-map" aria-hidden="true"></i>&nbsp;<?php echo HTMLHelper::_('grid.sort', 'COM_JEM_TABLE_STATE', 'a.state', $this->lists['order_Dir'], $this->lists['order']); ?></div>
<?php endif; ?>
<div id="jem_location" class="sectiontableheader"><i class="fa fa-map-marker" aria-hidden="true"></i>&nbsp;<?php echo HTMLHelper::_('grid.sort', 'COM_JEM_TABLE_LOCATION', 'a.venue', $this->lists['order_Dir'], $this->lists['order']); ?></div>
</div>
</div>
<ul class="eventlist">
<?php if ($this->novenues == 1) : ?>
<li class="jem-event"><?php echo Text::_('COM_JEM_NO_VENUES'); ?></li>
<?php else : ?>
<?php
// Safari has problems with the "onclick" element in the <li>. It covers the links to location and category etc.
// This detects the browser and just writes the onclick attribute if the browser is not Safari.
$isSafari = false;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') && !strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) {
$isSafari = true;
}
?>
<?php $this->rows = $this->getRows(); ?>
<?php foreach ($this->rows as $row) : ?>
<?php if (!empty($row->featured)) : ?>
<li class="jem-event jem-list-row jem-small-list jem-featured event-id<?php echo $row->id.$this->params->get('pageclass_sfx') . ' venue_id' . $this->escape($row->id); ?>" itemscope="itemscope" itemtype="https://schema.org/Event" >
<?php else : ?>
<li class="jem-event jem-list-row jem-small-list jem-odd<?php echo ($row->odd +1) . $this->params->get('pageclass_sfx') . ' venue_id' . $this->escape($row->id); ?>" itemscope="itemscope" itemtype="https://schema.org/Event" >
<?php endif; ?>
<?php if (!empty($row->city)) : ?>
<div class="jem-event-info-small jem-event-city venue-big" title="<?php echo Text::_('COM_JEM_TABLE_CITY').': '.$this->escape($row->city); ?>">
<?php echo $this->escape($row->city); ?>
</div>
<?php else : ?>
<div class="jem-event-info-small jem-event-city">-</div>
<?php endif; ?>
<?php if ($this->params->get('showstate')) : ?>
<?php if (!empty($row->state)) : ?>
<div class="jem-event-info-small jem-event-state" title="<?php echo Text::_('COM_JEM_TABLE_STATE').': '.$this->escape($row->state); ?>">
<?php echo $this->escape($row->state); ?>
</div>
<?php else : ?>
<div class="jem-event-info-small jem-event-state">-</div>
<?php endif; ?>
<?php endif; ?>
<?php if (!empty($row->locid)) : ?>
<div class="jem-event-info-small jem-event-venue" title="<?php echo Text::_('COM_JEM_TABLE_LOCATION').': '.$this->escape($row->venue); ?>">
<i class="fa fa-map-marker" aria-hidden="true"></i>
<?php
if ($this->jemsettings->showlinkvenue == 1) :
echo $row->id != 0 ? "<a href='".Route::_(JemHelperRoute::getVenueRoute($row->venueslug))."'>".$this->escape($row->venue)."</a>" : '-';
else :
echo $row->id ? $this->escape($row->venue) : '-';
endif; ?>
</div>
<?php else : ?>
<div class="jem-event-info-small jem-event-venue">
<i class="fa fa-map-marker" aria-hidden="true"></i>
<?php
if ($this->jemsettings->showlinkvenue == 1) :
echo $row->id != 0 ? "<a href='".Route::_(JemHelperRoute::getVenueRoute($row->venueslug))."'>".$this->escape($row->venue)."</a>" : '-';
else :
echo $row->id ? $this->escape($row->venue) : '-';
endif; ?>
</div>
<?php endif; ?>
<meta itemprop="name" content="<?php echo $this->escape($row->venue); ?>" />
<meta itemprop="url" content="<?php echo rtrim($uri->base(), '/').Route::_(JemHelperRoute::getEventRoute($row->slug)); ?>" />
<meta itemprop="identifier" content="<?php echo rtrim($uri->base(), '/').Route::_(JemHelperRoute::getEventRoute($row->slug)); ?>" />
<div itemtype="https://schema.org/Place" itemscope itemprop="location" style="display: none;" >
<?php if (!empty($row->locid)) : ?>
<meta itemprop="name" content="<?php echo $this->escape($row->venue); ?>" />
<?php else : ?>
<meta itemprop="name" content="None" />
<?php endif; ?>
<?php
$microadress = '';
if (!empty($row->city)) {
$microadress .= $this->escape($row->city);
}
if (!empty($microadress)) {
$microadress .= ', ';
}
if (!empty($row->state)) {
$microadress .= $this->escape($row->state);
}
if (empty($microadress)) {
$microadress .= '-';
}
?>
<meta itemprop="address" content="<?php echo $microadress; ?>" />
</div>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>

View File

@ -0,0 +1,212 @@
<?php
/**
* @version 2.3.1
* @package JEM
* @copyright (C) 2013-2021 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::_('behavior.tooltip');
?>
<?php /*?>
<style>
div#jem_filter select {
width: auto;
margin-right:10px;
border: 1px solid #808080;
background-color: #C6CCBE;
cursor: pointer;
}
</style>
<?php */?>
<style>
<?php if (!empty($this->jemsettings->tablewidth)) : ?>
#jem #adminForm {
width: <?php echo ($this->jemsettings->tablewidth); ?>;
}
<?php endif; ?>
.jem-sort #jem_city,
#jem .jem-event .jem-event-city {
<?php if (($this->jemsettings->showcity == 1) && (!empty($this->jemsettings->citywidth))) : ?>
flex: 1 <?php echo ($this->jemsettings->citywidth); ?>;
<?php else : ?>
flex: 1;
<?php endif; ?>
}
.jem-sort #jem_state,
#jem .jem-event .jem-event-state {
<?php if (($this->jemsettings->showstate == 1) && (!empty($this->jemsettings->statewidth))) : ?>
flex: 1 <?php echo ($this->jemsettings->statewidth); ?>;
<?php else : ?>
flex: 1;
<?php endif; ?>
}
.jem-sort #jem_location,
#jem .jem-event .jem-event-venue {
<?php if (($this->jemsettings->showlocate == 1) && (!empty($this->jemsettings->locationwidth))) : ?>
flex: 1 <?php echo ($this->jemsettings->locationwidth); ?>;
<?php else : ?>
flex: 1;
<?php endif; ?>
}
</style>
<div>
<form action="<?php echo htmlspecialchars($this->action); ?>" method="post" id="adminForm" name="adminForm">
<?php
function jem_common_show_filter(&$obj) {
if ($obj->settings->get('global_show_filter',1) && !JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-hidefilter')) {
return true;
}
if (JemHelper::jemStringContains($obj->params->get('pageclass_sfx'), 'jem-showfilter')) {
return true;
}
return false;
}
?>
<?php if (jem_common_show_filter($this) && !JemHelper::jemStringContains($this->params->get('pageclass_sfx'), 'jem-filterbelow')): ?>
<div id="jem_filter" class="floattext jem-form jem-row jem-justify-start">
<div>
<?php echo '<label for="filter">'.JText::_('COM_JEM_FILTER').'</label>'; ?>
</div>
<div class="jem-row jem-justify-start jem-nowrap">
<?php echo $this->lists['filter']; ?>
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->lists['search'];?>" class="inputbox" onchange="document.adminForm.submit();" />
</div>
<div class="jem-row jem-justify-start jem-nowrap">
<button class="btn btn-primary" type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
<button class="btn btn-secondary" type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php if ($this->settings->get('global_display',1)) : ?>
<div class="jem_fright">
<label for="limit"><?php echo JText::_('COM_JEM_DISPLAY_NUM'); ?></label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="jem-sort jem-sort-small">
<div class="jem-list-row jem-small-list">
<?php if ($this->jemsettings->showcity == 1) : ?>
<div id="jem_city" class="sectiontableheader"><i class="fa fa-building-o" aria-hidden="true"></i>&nbsp;<?php echo JHtml::_('grid.sort', 'COM_JEM_TABLE_CITY', 'l.city', $this->lists['order_Dir'], $this->lists['order']); ?></div>
<?php endif; ?>
<?php if ($this->jemsettings->showstate == 1) : ?>
<div id="jem_state" class="sectiontableheader"><i class="fa fa-map-o" aria-hidden="true"></i>&nbsp;<?php echo JHtml::_('grid.sort', 'COM_JEM_TABLE_STATE', 'l.state', $this->lists['order_Dir'], $this->lists['order']); ?></div>
<?php endif; ?>
<?php if ($this->jemsettings->showlocate == 1) : ?>
<div id="jem_location" class="sectiontableheader"><i class="fa fa-map-marker" aria-hidden="true"></i>&nbsp;<?php echo JHtml::_('grid.sort', 'COM_JEM_TABLE_LOCATION', 'l.venue', $this->lists['order_Dir'], $this->lists['order']); ?></div>
<?php endif; ?>
</div>
</div>
<ul class="venueslist">
<?php if ($this->novenues == 1) : ?>
<li class="jem-venue"><?php echo JText::_('COM_JEM_NO_VENUES'); ?></li>
<?php else : ?>
<?php
// Safari has problems with the "onclick" element in the <li>. It covers the links to location and category etc.
// This detects the browser and just writes the onclick attribute if the broswer is not Safari.
$isSafari = false;
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') && !strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) {
$isSafari = true;
}
?>
<?php $this->rows = $this->getRows(); ?>
<?php foreach ($this->rows as $row) : ?>
<?php if (!empty($row->featured)) : ?>
<li class="jem-event jem-list-row jem-small-list jem-featured event-id<?php echo $row->id.$this->params->get('pageclass_sfx'); ?>" itemscope="itemscope" itemtype="https://schema.org/Event" <?php if ($this->jemsettings->showdetails == 1 && (!$isSafari)) : echo 'onclick=location.href="'.JRoute::_(JemHelperRoute::getEventRoute($row->slug)).'"'; endif; ?> >
<?php else : ?>
<li class="jem-event jem-list-row jem-small-list jem-odd<?php echo ($row->odd +1) . $this->params->get('pageclass_sfx'); ?>" itemscope="itemscope" itemtype="https://schema.org/Event" <?php if ($this->jemsettings->showdetails == 1 && (!$isSafari)) : echo 'onclick=location.href="'.JRoute::_(JemHelperRoute::getEventRoute($row->slug)).'"'; endif; ?> >
<?php endif; ?>
<?php if ($this->jemsettings->showcity == 1) : ?>
<?php if (!empty($row->city)) : ?>
<div class="jem-event-info-small jem-event-city" title="<?php echo JText::_('COM_JEM_TABLE_CITY').': '.$this->escape($row->city); ?>">
<i class="fa fa-building-o" aria-hidden="true"></i>
<?php echo $this->escape($row->city); ?>
</div>
<?php else : ?>
<div class="jem-event-info-small jem-event-city"><i class="fa fa-building-o" aria-hidden="true"></i> -</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->jemsettings->showstate == 1) : ?>
<?php if (!empty($row->state)) : ?>
<div class="jem-event-info-small jem-event-state" title="<?php echo JText::_('COM_JEM_TABLE_STATE').': '.$this->escape($row->state); ?>">
<i class="fa fa-map-o" aria-hidden="true"></i>
<?php echo $this->escape($row->state); ?>
</div>
<?php else : ?>
<div class="jem-event-info-small jem-event-state"><i class="fa fa-map-o" aria-hidden="true"></i> -</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->jemsettings->showlocate == 1) : ?>
<?php if (!empty($row->locid)) : ?>
<div class="jem-event-info-small jem-event-venue" title="<?php echo JText::_('COM_JEM_TABLE_LOCATION').': '.$this->escape($row->venue); ?>">
<i class="fa fa-map-marker" aria-hidden="true"></i>
<?php if ($this->jemsettings->showlinkvenue == 1) : ?>
<?php echo "<a href='".JRoute::_(JemHelperRoute::getVenueRoute($row->venueslug))."'>".$this->escape($row->venue)."</a>"; ?>
<?php else : ?>
<?php echo $this->escape($row->venue); ?>
<?php endif; ?>
</div>
<?php else : ?>
<div class="jem-event-info-small jem-event-venue">
<i class="fa fa-map-marker" aria-hidden="true"></i> -
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="option" value="com_jem" />
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>

View File

@ -0,0 +1,471 @@
<?php
/**
* @version 2.3.0
* @package JEM
* @copyright (C) 2013-2020 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
/**
* Event-View
*/
class JemViewEvent extends JemView
{
protected $item;
protected $params;
protected $print;
protected $state;
protected $user;
public function __construct($config = array())
{
parent::__construct($config);
// additional path for common templates + corresponding override path
$this->addCommonTemplatePath();
}
/**
* Creates the output for the Event view
*/
public function display($tpl = null)
{
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$app = JFactory::getApplication();
$user = JemFactory::getUser();
$userId = $user->get('id');
$dispatcher = JemFactory::getDispatcher();
$document = JFactory::getDocument();
$model = $this->getModel();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$pathway = $app->getPathway();
$edit_att = new \stdClass();
$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'));
$registration = $this->get('UserRegistration');
$this->regs['not_attending'] = $model->getRegisters($this->state->get('event.id'), -1);
$this->regs['invited'] = $model->getRegisters($this->state->get('event.id'), 0);
$this->regs['attending'] = $model->getRegisters($this->state->get('event.id'), 1);
$this->regs['waiting'] = $model->getRegisters($this->state->get('event.id'), 2);
$this->regs['all'] = $model->getRegisters($this->state->get('event.id'), 'all');
//JemHelper::addLogEntry("Attendees:\n" . print_r($this->registers, true), __METHOD__);
//JemHelper::addLogEntry("Attendees:\n" . print_r($this->regs, true), __METHOD__);
// check for data error
if (empty($this->item)) {
$app->enqueueMessage(JText::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return false;
}
// Check for errors.
$errors = $this->get('Errors');
if (is_array($errors) && count($errors)) {
\Joomla\CMS\Factory::getApplication()->enqueueMessage(implode("\n", $errors), 'warning');
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);
$pathwayKeys = array_keys($pathway->getPathway());
$lastPathwayEntryIndex = end($pathwayKeys);
$pathway->setItemName($lastPathwayEntryIndex, $menuitem->title);
//$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
\Joomla\CMS\Factory::getApplication()->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'warning');
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));
//use temporary class var to trigger content prepare plugin for venue description
$tempVenue = new stdClass();
$tempVenue->text = $item->locdescription;
$tempVenue->title = $item->venue;
$results = $dispatcher->trigger('onContentPrepare', array ('com_jem.event', &$tempVenue, &$this->params, $offset));
$item->locdescription = $tempVenue->text;
$item->venue = $tempVenue->title;
// 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);
// Check if user can edit attendees
$isAuthor = $userId && ($userId == $item->created_by);
//$permissions->canEditAttendees = $isAuthor;
//new logic: user can edit events, suggested by jojo12
$permissions->canEditAttendees = $user->can('edit', 'event', $item->id, $item->created_by);
//suggestion by M59S to allow groupmembers too see line 230/231 too
$edit_att->canEditAttendees = $user->can('edit', 'event', $item->id, $item->created_by);
$this->permissions = $permissions;
$this->showeventstate = $permissions->canEditEvent || $permissions->canPublishEvent;
$this->showvenuestate = $permissions->canEditVenue || $permissions->canPublishVenue;
/** show attendees and registration form if registration globally allowed or optional and on event allowed
* but if on event limited to invited users and limitation globally allowed user must be invited
* (or event owner to see attendees)
*/
$g_reg = $this->jemsettings->showfroregistra;
$g_inv = $this->jemsettings->regallowinvitation;
$e_reg = $this->item->registra;
$e_unreg = $item->unregistra;
$e_dates = $item->dates;
$e_times = $item->times;
$e_hours = (int)$item->unregistra_until;
//$this->showAttendees = (($g_reg == 1) || (($g_reg == 2) && ($e_reg & 1))) && ((!(($e_reg & 2) && ($g_inv > 0))) || (is_object($registration) || $isAuthor));
$this->showAttendees = (($g_reg == 1) || (($g_reg == 2) && ($e_reg & 1))) && ((!(($e_reg & 2) && ($g_inv > 0))) || (is_object($registration) || $isAuthor) || $edit_att);
$this->showRegForm = (($g_reg == 1) || (($g_reg == 2) && ($e_reg & 1))) && ((!(($e_reg & 2) && ($g_inv > 0))) || (is_object($registration)));
$this->allowAnnulation = ($e_unreg == 1) || (($e_unreg == 2) && (empty($e_dates) || (strtotime($e_dates.' '.$e_times.' -'.$e_hours.' hour') > strtotime('now'))));
// 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 (is_object($registration) && $registration->status != 0) { // is the user allready registered at the event
if ($now <= $enddate) { // allows registration changes on unfinished events
$formhandler = 4;
}
// else $formahandler = 0, see above
} 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; // allow registration (changes)
}
if ($formhandler >= 3) {
// user must click one of the radio buttons to enable Send button
$js = "function check(box, send) {
if(box.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) {
$endpos = \Joomla\String\StringHelper::strpos($desc, "]", 0);
if ($endpos > 0) {
$keyword = \Joomla\String\StringHelper::substr($desc, 0, $endpos);
$description_content .= $this->keyword_switcher($keyword, $this->item, $categories, $jemsettings->formattime, $jemsettings->formatdate);
$description_content .= \Joomla\String\StringHelper::substr($desc, $endpos + 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);
}
/* a bit backwaard compaibility... */
if (is_object($registration)) {
$this->isregistered = $registration->status;
} else {
$this->isregistered = false;
}
$this->registration = $registration;
$this->dispatcher = $dispatcher;
$this->pageclass_sfx = htmlspecialchars($item->params->get('pageclass_sfx'));
$this->itemid = $menuitem ? $menuitem->id : false;
$this->_prepareDocument();
parent::display($tpl);
}
/**
* structures the keywords
*/
protected function keyword_switcher($keyword, $row, $categories, $formattime, $formatdate)
{
$content = '';
switch ($keyword)
{
case 'categories':
$catnames = array();
foreach ($categories as $category) {
$catnames[] = $this->escape($category->catname);
}
$content = implode(', ', array_filter($catnames));
break;
case 'a_name':
$content = $row->venue;
break;
case 'times':
case 'endtimes':
if (isset($row->$keyword)) {
$content = JemOutput::formattime($row->$keyword);
}
break;
case 'dates':
case 'enddates':
if (isset($row->$keyword)) {
$content = JemOutput::formatdate($row->$keyword);
}
break;
case 'title':
default:
if (isset($row->$keyword)) {
$content = $row->$keyword;
}
break;
}
return $content;
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
// $menus = $app->getMenu();
// $pathway = $app->getPathway();
// add css file
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
if ($this->print) {
JemHelper::loadCss('print');
$this->document->setMetaData('robots', 'noindex, nofollow');
}
/*
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu) {
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
} else {
$this->params->def('page_heading', JText::_('JGLOBAL_JEM_EVENT'));
}
*/
$title = $this->params->get('page_title', '');
/*
$id = (int) @$menu->query['id'];
// if the menu item does not concern this event
if ($menu && ($menu->query['option'] != 'com_jem' || $menu->query['view'] != 'event' || $id != $this->item->id)) {
// If this is not a single event menu item, set the page title to the event title
if ($this->item->title) {
$title = $this->item->title;
}
$path = array(array('title' => $this->item->title, 'link' => ''));
$category = JCategories::getInstance('JEM2')->get($this->item->catid);
while ($category && ($menu->query['option'] != 'com_jem' || $menu->query['view'] == 'event'
|| $id != $category->id) && $category->id > 1) {
$path[] = array('title' => $category->catname, 'link' => JemHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach($path as $item) {
$pathway->addItem($item['title'], $item['link']);
}
}
*/
// Check for empty title and add site name if param is set
if (empty($title)) {
$title = $app->getCfg('sitename');
} elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
} elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
}
if (empty($title)) {
$title = $this->item->title;
}
$this->document->setTitle($title);
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
if ($app->getCfg('MetaAuthor') == '1') {
$this->document->setMetaData('author', $this->item->author);
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v) {
if ($v) {
$this->document->setMetadata($k, $v);
}
}
// If there is a pagebreak heading or title, add it to the page title
if (!empty($this->item->page_title)) {
$this->item->title = $this->item->title . ' - ' . $this->item->page_title;
$this->document->setTitle($this->item->page_title . ' - '
. JText::sprintf('PLG_CONTENT_PAGEBREAK_PAGE_NUM', $this->state->get('list.offset') + 1));
}
}
}
?>

View File

@ -0,0 +1,167 @@
<?php
/**
* @package JEM
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2005-2009 Christoph Lukes
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
/**
* View: Venueslist
*/
class JemViewVenueslist extends JemView
{
public function __construct($config = array())
{
parent::__construct($config);
// additional path for common templates + corresponding override path
$this->addCommonTemplatePath();
}
/**
* Creates the Venueslist View
*/
public function display($tpl = null)
{
// Get data from model
$rows = $this->get('Items');
$pagination = $this->get('Pagination');
// initialize variables
$app = Factory::getApplication();
$document = $app->getDocument();
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$params = $app->getParams();
$uri = Uri::getInstance();
$user = JemFactory::getUser();
$userId = $user->get('id');
$pathway = $app->getPathWay();
$jinput = $app->input;
$print = $jinput->getBool('print', false);
$task = $jinput->getCmd('task', '');
// Decide which parameters should take priority
$useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem'
&& $menuitem->query['view'] == 'venueslist');
// 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');
// are no venues available?
$novenues = (!$rows) ? 1 : 0;
// get variables
$filter_order = $app->getUserStateFromRequest('com_jem.venueslist.filter_order', 'filter_order', 'a.city', 'cmd');
$filter_order_Dir = $app->getUserStateFromRequest('com_jem.venueslist.filter_order_Dir', 'filter_order_Dir', '', 'word');
// $filter_state = $app->getUserStateFromRequest('com_jem.venueslist.filter_state', 'filter_state', '*', 'word');
$filter = $app->getUserStateFromRequest('com_jem.venueslist.filter_type', 'filter_type', '', 'int');
$search = $app->getUserStateFromRequest('com_jem.venueslist.filter_search', 'filter_search', '', 'string');
// search filter
$filters = array();
// Workaround issue #557: Show venue name always.
$jemsettings->showlocate = 1;
//$filters[] = HTMLHelper::_('select.option', '0', Text::_('COM_JEM_CHOOSE'));
if ($jemsettings->showlocate == 1) {
$filters[] = HTMLHelper::_('select.option', '3', Text::_('COM_JEM_CITY'));
}
$filters[] = HTMLHelper::_('select.option', '2', Text::_('COM_JEM_VENUE'));
$filters[] = HTMLHelper::_('select.option', '5', Text::_('COM_JEM_STATE'));
$lists['filter'] = HTMLHelper::_('select.genericlist', $filters, 'filter_type', array('size'=>'1','class'=>'form-select'), '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 = Text::_('COM_JEM_VENUESLIST_PAGETITLE');
$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', Text::_('COM_JEM_VENUESLIST_PAGETITLE'));
$pageheading = $params->get('page_heading', $pagetitle);
$pageclass_sfx = $params->get('pageclass_sfx');
$print_link = Route::_('index.php?option=com_jem&view=venueslist&print=1&tmpl=component');
}
$params->set('page_heading', $pageheading);
// Add site name to title if param is set
if ($app->get('sitename_pagetitles', 0) == 1) {
$pagetitle = Text::sprintf('JPAGETITLE', $app->get('sitename'), $pagetitle);
}
elseif ($app->get('sitename_pagetitles', 0) == 2) {
$pagetitle = Text::sprintf('JPAGETITLE', $pagetitle, $app->get('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');
$permissions->canEditPublishVenue = $user->can(array('edit', 'publish'), 'venue');
// Create the pagination object
// $pagination = $this->get('Pagination');
$this->action = $uri->toString();
$this->rows = $rows;
$this->task = $task;
$this->print = $print;
$this->params = $params;
$this->pagination = $pagination;
$this->jemsettings = $jemsettings;
$this->settings = $settings;
$this->pagetitle = $pagetitle;
$this->lists = $lists;
$this->novenues = $novenues;
$this->permissions = $permissions;
$this->show_status = $permissions->canEditPublishVenue;
$this->print_link = $print_link;
$this->pageclass_sfx = $pageclass_sfx ? htmlspecialchars($pageclass_sfx) : $pageclass_sfx;
parent::display($tpl);
}
}