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 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,363 @@
<?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\Factory;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
$app = Factory::getApplication();
$document = $app->getDocument();
$wa = $document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
jimport('joomla.html.html.tabs');
// Create shortcut to parameters.
$params = $this->item->params;
//$settings = json_decode($this->item->attribs);
$options = array(
'onActive' => 'function(title, description){
description.setStyle("display", "block");
title.addClass("open").removeClass("closed");
}',
'onBackground' => 'function(title, description){
description.setStyle("display", "none");
title.addClass("closed").removeClass("open");
}',
'startOffset' => 0, // 0 starts on the first tab, 1 starts the second, etc...
'useCookie' => true, // this must not be a string. Don't use quotes.
);
# defining values for centering default-map
$location = JemHelper::defineCenterMap($this->form);
?>
<script>
Joomla.submitbutton = function(task)
{
if (task == 'venue.cancel' || document.formvalidator.isValid(document.getElementById('venue-form'))) {
Joomla.submitform(task, document.getElementById('venue-form'));
}
}
</script>
<script>
// window.addEvent('domready', function(){
window.onload = (event) => {
setAttribute();
test();
}
function setAttribute(){
document.getElementById("tmp_form_postalCode").setAttribute("geo-data", "postal_code");
document.getElementById("tmp_form_city").setAttribute("geo-data", "locality");
document.getElementById("tmp_form_state").setAttribute("geo-data", "administrative_area_level_1");
document.getElementById("tmp_form_street").setAttribute("geo-data", "street_address");
document.getElementById("tmp_form_route").setAttribute("geo-data", "route");
document.getElementById("tmp_form_streetnumber").setAttribute("geo-data", "street_number");
document.getElementById("tmp_form_country").setAttribute("geo-data", "country_short");
document.getElementById("tmp_form_latitude").setAttribute("geo-data", "lat");
document.getElementById("tmp_form_longitude").setAttribute("geo-data", "lng");
document.getElementById("tmp_form_venue").setAttribute("geo-data", "name");
}
function meta(){
var f = document.getElementById('venue-form');
if(f.jform_meta_keywords.value != "") f.jform_meta_keywords.value += ", ";
f.jform_meta_keywords.value += f.jform_venue.value+', ' + f.jform_city.value;
}
function test() {
var form = document.getElementById('venue-form');
var map = $('#jform_map');
var streetcheck = $(form.jform_street).hasClass('required');
// if (map && map.checked == true) {
if (map && map.is(":checked")) {
var lat = $('#jform_latitude');
var lon = $('#jform_longitude');
if (lat.val() == ('' || 0.000000) || lon.val() == ('' || 0.000000)) {
if (!streetcheck) {
addrequired();
}
} else {
if (lat.val() != ('' || 0.000000) && lon.val() != ('' || 0.000000)) {
removerequired();
}
}
$('#mapdiv').show();
}
// if (map && map.checked == false) {
if (map && !map.is(":checked")) {
removerequired();
$('#mapdiv').hide();
}
}
function addrequired(){
var form = document.getElementById('venue-form');
$(form.jform_street).addClass('required');
$(form.jform_postalCode).addClass('required');
$(form.jform_city).addClass('required');
$(form.jform_country).addClass('required');
}
function removerequired(){
var form = document.getElementById('venue-form');
$(form.jform_street).removeClass('required');
$(form.jform_postalCode).removeClass('required');
$(form.jform_city).removeClass('required');
$(form.jform_country).removeClass('required');
}
jQuery(function(){
jQuery("#geocomplete").geocomplete({
map: ".map_canvas",
<?php echo $location; ?>
details: "form ",
detailsAttribute: "geo-data",
types: ['establishment', 'geocode'],
mapOptions: {
zoom: 16,
mapTypeId: "hybrid"
},
markerOptions: {
draggable: true
}
});
jQuery("#geocomplete").bind('geocode:result', function(){
var street = jQuery("#tmp_form_street").val();
var route = jQuery("#tmp_form_route").val();
if (route) {
/* something to add */
} else {
jQuery("#tmp_form_street").val('');
}
});
jQuery("#geocomplete").bind("geocode:dragged", function(event, latLng){
jQuery("#tmp_form_latitude").val(latLng.lat());
jQuery("#tmp_form_longitude").val(latLng.lng());
});
/* option to attach a reset function to the reset-link
jQuery("#reset").click(function(){
jQuery("#geocomplete").geocomplete("resetMarker");
jQuery("#reset").hide();
return false;
});
*/
jQuery("#find-left").click(function() {
jQuery("#geocomplete").val(jQuery("#jform_street").val() + ", " + jQuery("#jform_postalCode").val() + " " + jQuery("#jform_city").val());
jQuery("#geocomplete").trigger("geocode");
});
jQuery("#cp-latlong").click(function() {
document.getElementById("jform_latitude").value = document.getElementById("tmp_form_latitude").value;
document.getElementById("jform_longitude").value = document.getElementById("tmp_form_longitude").value;
test();
});
jQuery("#cp-address").click(function() {
document.getElementById("jform_street").value = document.getElementById("tmp_form_street").value;
document.getElementById("jform_postalCode").value = document.getElementById("tmp_form_postalCode").value;
document.getElementById("jform_city").value = document.getElementById("tmp_form_city").value;
document.getElementById("jform_state").value = document.getElementById("tmp_form_state").value;
document.getElementById("jform_country").value = document.getElementById("tmp_form_country").value;
});
jQuery("#cp-venue").click(function() {
var venue = document.getElementById("tmp_form_venue").value;
if (venue) {
document.getElementById("jform_venue").value = venue;
}
});
jQuery("#cp-all").click(function() {
jQuery("#cp-address").click();
jQuery("#cp-latlong").click();
jQuery("#cp-venue").click();
});
jQuery('#jform_map').on('keyup keypress blur change', function() {
test();
});
jQuery('#jform_latitude').on('keyup keypress blur change', function() {
test();
});
jQuery('#jform_longitude').on('keyup keypress blur change', function() {
test();
});
});
</script>
<div id="jem" class="jem_editvenue<?php echo $this->pageclass_sfx; ?>">
<div class="edit item-page">
<?php if ($params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_jem&a_id=' . (int)$this->item->id); ?>" class="form-validate" method="post" name="adminForm" id="venue-form" enctype="multipart/form-data">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('venue.save')"><?php echo Text::_('JSAVE') ?></button>
<button type="button" class="btn btn-secondary" onclick="Joomla.submitbutton('venue.cancel')"><?php echo Text::_('JCANCEL') ?></button>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<?php endif; ?>
<p>&nbsp;</p>
<?php //echo HTMLHelper::_('tabs.start', 'venueTab', $options); ?>
<!-- VENUE-DETAILS TAB -->
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_INFO_TAB'), 'venue-details'); ?>
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'venue-details', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-details', Text::_('COM_JEM_EDITVENUE_INFO_TAB')); ?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_DETAILS_LEGEND'); ?></legend>
<ul class="adminformlist">
<li><?php echo $this->form->getLabel('venue'); ?><?php echo $this->form->getInput('venue'); ?></li>
<?php if (is_null($this->item->id)) : ?>
<li><?php echo $this->form->getLabel('alias'); ?><?php echo $this->form->getInput('alias'); ?></li>
<?php endif; ?>
<li><?php echo $this->form->getLabel('street'); ?><?php echo $this->form->getInput('street'); ?></li>
<li><?php echo $this->form->getLabel('postalCode'); ?><?php echo $this->form->getInput('postalCode'); ?></li>
<li><?php echo $this->form->getLabel('city'); ?><?php echo $this->form->getInput('city'); ?></li>
<li><?php echo $this->form->getLabel('state'); ?><?php echo $this->form->getInput('state'); ?></li>
<li><?php echo $this->form->getLabel('country'); ?><?php echo $this->form->getInput('country'); ?></li>
<li><?php echo $this->form->getLabel('latitude'); ?><?php echo $this->form->getInput('latitude'); ?></li>
<li><?php echo $this->form->getLabel('longitude'); ?><?php echo $this->form->getInput('longitude'); ?></li>
<li><?php echo $this->form->getLabel('url'); ?><?php echo $this->form->getInput('url'); ?></li>
<li><?php echo $this->form->getLabel('published'); ?><?php echo $this->form->getInput('published'); ?></li>
</ul>
</fieldset>
<!-- VENUE-GEODATA-->
<fieldset class="adminform" id="geodata">
<legend><?php echo Text::_('COM_JEM_GEODATA_LEGEND'); ?></legend>
<ul class="adminformlist">
<li><?php echo $this->form->getLabel('map'); ?><?php echo $this->form->getInput('map'); ?></li>
</ul>
<div class="clr"></div>
<div id="mapdiv">
<input id="geocomplete" type="text" size="55" placeholder="<?php echo Text::_( 'COM_JEM_VENUE_ADDRPLACEHOLDER' ); ?>" value="" />
<input id="find-left" class="geobutton" type="button" value="<?php echo Text::_('COM_JEM_VENUE_ADDR_FINDVENUEDATA'); ?>" />
<div class="clr"></div>
<div class="map_canvas"></div>
<ul class="adminformlist label-button-line">
<li><label><?php echo Text::_('COM_JEM_STREET'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_street" readonly="readonly" />
<input type="hidden" class="readonly" id="tmp_form_streetnumber" readonly="readonly" />
<input type="hidden" class="readonly" id="tmp_form_route" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_ZIP'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_postalCode" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_CITY'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_city" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_STATE'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_state" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_VENUE'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_venue" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_COUNTRY'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_country" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_LATITUDE'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_latitude" readonly="readonly" />
</li>
<li><label><?php echo Text::_('COM_JEM_LONGITUDE'); ?></label>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_longitude" readonly="readonly" />
</li>
</ul>
<div class="clr"></div>
<input id="cp-all" class="geobutton" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_DATA'); ?>" style="margin-right: 3em;" />
<input id="cp-address" class="geobutton" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_ADDRESS'); ?>" />
<input id="cp-venue" class="geobutton" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_VENUE'); ?>" />
<input id="cp-latlong" class="geobutton" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_COORDINATES'); ?>" />
</div>
</fieldset>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_DESCRIPTION_LEGEND'); ?></legend>
<div class="clr"></div>
<?php echo $this->form->getLabel('locdescription'); ?>
<div>
<div class="clr"><br /></div>
<?php echo $this->form->getInput('locdescription'); ?>
</div>
</fieldset>
<p>&nbsp;</p>
<!-- EXTENDED TAB -->
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'editvenue-extendedtab', Text::_('COM_JEM_EDITVENUE_EXTENDED_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_EXTENDED_TAB'), 'editvenue-extendedtab'); ?>
<?php echo $this->loadTemplate('extended'); ?>
<!-- PUBLISHING TAB -->
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-publishtab', Text::_('COM_JEM_EDITVENUE_PUBLISH_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_PUBLISH_TAB'), 'venue-publishtab'); ?>
<?php echo $this->loadTemplate('publish'); ?>
<!-- ATTACHMENTS TAB -->
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php if (!empty($this->item->attachments) || ($this->jemsettings->attachmentenabled != 0)) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-attachments', Text::_('COM_JEM_EDITVENUE_ATTACHMENTS_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_ATTACHMENTS_TAB'), 'venue-attachments'); ?>
<?php echo $this->loadTemplate('attachments'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<!-- OTHER TAB -->
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-other', Text::_('COM_JEM_EDITVENUE_OTHER_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_OTHER_TAB'), 'venue-other' ); ?>
<?php echo $this->loadTemplate('other'); ?>
<?php //echo HTMLHelper::_('tabs.end'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<div class="clearfix"></div>
<input type="hidden" name="country" id="country" geo-data="country_short" value="">
<input type="hidden" name="author_ip" value="<?php echo $this->item->author_ip; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
<?php echo HTMLHelper::_('form.token'); ?>
</form>
</div>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEM_EDITVENUE_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_JEM_EDITVENUE_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic">
<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">COM_JEM_SHOW</option>
<option value="0">COM_JEM_HIDE</option>
</field>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,92 @@
<?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\Session\Session;
?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_ATTACHMENTS_LEGEND'); ?></legend>
<table class="adminform" id="el-attachments">
<tbody>
<?php foreach ($this->item->attachments as $file): ?>
<tr>
<td>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_FILE'); ?></div>
<input class="form-control readonly valid form-control-success w-75" type="text" readonly="readonly" value="<?php echo $file->file; ?>"/>
<input type="hidden" name="attached-id[]" value="<?php echo $file->id; ?>"/>
</div>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_NAME'); ?></div>
<?php /* name is always editable, also if attachemnt upload is not allowed */ ?>
<input type="text" name="attached-name[]" style="width: 100%" value="<?php echo $file->name; ?>" />
</div>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_DESCRIPTION'); ?></div>
<?php /* description is always editable, also if attachemnt upload is not allowed */ ?>
<input type="text" name="attached-desc[]" style="width: 100%" value="<?php echo $file->description; ?>" />
</div>
</td>
<td>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_ACCESS'); ?></div>
<?php
$attribs = array('class'=>'inputbox', 'size'=>'7');
/* if attachment upload is not allowed changing access level should also not possible */
if ($this->jemsettings->attachmentenabled == 0) :
$attribs['disabled'] = 'disabled';
endif;
echo HTMLHelper::_('select.genericlist', $this->access, 'attached-access[]', $attribs, 'value', 'text', $file->access);
?>
</div>
</td>
<td class="center">
<?php if ($this->jemsettings->attachmentenabled != 0) : ?>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_REMOVE'); ?></div>
<?php echo JemOutput::removebutton(Text::_('COM_JEM_GLOBAL_REMOVE_ATTACHEMENT'), array('id' => 'attach-remove'.$file->id.':'.Session::getFormToken(),'class' => 'attach-remove','title'=>Text::_('COM_JEM_GLOBAL_REMOVE_ATTACHEMENT'))); ?>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
<?php if ($this->jemsettings->attachmentenabled != 0) : ?>
<tr>
<td width="100%">
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_FILE'); ?></div>
<input type="file" name="attach[]" class="attach-field" /> <input type="reset" value="<?php echo Text::_('JSEARCH_FILTER_CLEAR') ?>" class="btn btn-primary">
</div>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_NAME'); ?></div>
<input type="text" name="attach-name[]" class="attach-name" value="" />
</div>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_DESCRIPTION'); ?></div>
<input type="text" name="attach-desc[]" class="attach-desc" value="" />
</div>
</td>
<td>
<div>
<div class="title"><?php echo Text::_('COM_JEM_ATTACHMENT_ACCESS'); ?></div>
<?php echo HTMLHelper::_('select.genericlist', $this->access, 'attach-access[]', array('class'=>'inputbox', 'size'=>'7'), 'value', 'text', 1); ?>
</div>
</td>
<td>&nbsp;</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</fieldset>

View File

@ -0,0 +1,53 @@
<?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;
//$max_custom_fields = $this->settings->get('global_editvenue_maxnumcustomfields', -1); // default to All
?>
<!-- IMAGE -->
<?php if ($this->item->locimage || $this->jemsettings->imageenabled != 0) : ?>
<fieldset class="jem_fldst_image">
<legend><?php echo Text::_('COM_JEM_IMAGE'); ?></legend>
<?php
if ($this->item->locimage) :
echo JemOutput::flyer($this->item, $this->limage, 'venue', 'locimage');
?><input type="hidden" name="locimage" id="locimage" value="<?php echo $this->item->locimage; ?>" /><?php
endif;
?>
<?php if ($this->jemsettings->imageenabled != 0) : ?>
<ul class="adminformlist">
<li>
<?php /* We get field with id 'jform_userfile' and name 'jform[userfile]' */ ?>
<?php echo $this->form->getLabel('userfile'); ?> <?php echo $this->form->getInput('userfile'); ?>
<button type="button" class="button3 btn-sm btn-secondary" onclick="document.getElementById('jform_userfile').value = ''"><?php echo Text::_('JSEARCH_FILTER_CLEAR') ?></button>
<?php
if ($this->item->locimage) :
echo HTMLHelper::image('media/com_jem/images/publish_r.png', null, array('id' => 'userfile-remove', 'data-id' => $this->item->id, 'data-type' => 'venues', 'title' => Text::_('COM_JEM_REMOVE_IMAGE')));
endif;
?>
</li>
</ul>
<input type="hidden" name="removeimage" id="removeimage" value="0" />
<?php endif; ?>
</fieldset>
<?php endif; ?>
<!-- URL -->
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_URL_LEGEND'); ?></legend>
<ul class="adminformlist">
<li><?php echo $this->form->getLabel('url'); ?><?php echo $this->form->getInput('url'); ?></li>
</ul>
</fieldset>

View File

@ -0,0 +1,38 @@
<?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;
$max_custom_fields = $this->settings->get('global_editvenue_maxnumcustomfields', -1); // default to All
?>
<!-- CUSTOM FIELDS -->
<?php if ($max_custom_fields != 0) : ?>
<fieldset class="panelform">
<legend><?php echo Text::_('COM_JEM_EDITVENUE_CUSTOMFIELDS'); ?></legend>
<ul class="adminformlist">
<?php
$fields = $this->form->getFieldset('custom');
if ($max_custom_fields < 0) :
$max_custom_fields = count($fields);
endif;
$cnt = 0;
foreach($fields as $field) :
if (++$cnt <= $max_custom_fields) :
?><li><?php echo $field->label; ?><?php echo $field->input; ?></li><?php
endif;
endforeach;
?>
</ul>
</fieldset>
<?php endif; ?>

View File

@ -0,0 +1,33 @@
<?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;
//$max_custom_fields = $this->settings->get('global_editvenue_maxnumcustomfields', -1); // default to All
?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_PUBLISHING_LEGEND'); ?></legend>
<ul class="adminformlist">
<li><?php echo $this->form->getLabel('published'); ?><?php echo $this->form->getInput('published'); ?></li>
</ul>
</fieldset>
<!-- META -->
<fieldset class="">
<legend><?php echo Text::_('COM_JEM_META_HANDLING'); ?></legend>
<input type="button" class="button" value="<?php echo Text::_('COM_JEM_ADD_VENUE_CITY'); ?>" onclick="meta()" />
<?php foreach ($this->form->getFieldset('meta') as $field) : ?>
<div class="control-group">
<div class="control-label"><?php echo $field->label; ?></div>
<div class="controls"><?php echo $field->input; ?></div>
</div>
<?php endforeach; ?>
</fieldset>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,372 @@
<?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\Factory;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
$app = Factory::getApplication();
$document = $app->getDocument();
$wa = $document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
jimport('joomla.html.html.tabs');
// Create shortcut to parameters.
$params = $this->item->params;
//$settings = json_decode($this->item->attribs);
$options = array(
'onActive' => 'function(title, description){
description.setStyle("display", "block");
title.addClass("open").removeClass("closed");
}',
'onBackground' => 'function(title, description){
description.setStyle("display", "none");
title.addClass("closed").removeClass("open");
}',
'startOffset' => 0, // 0 starts on the first tab, 1 starts the second, etc...
'useCookie' => true, // this must not be a string. Don't use quotes.
);
# defining values for centering default-map
$location = JemHelper::defineCenterMap($this->form);
?>
<script>
Joomla.submitbutton = function(task) {
if (task == 'venue.cancel' || document.formvalidator.isValid(document.getElementById('venue-form'))) {
Joomla.submitform(task, document.getElementById('venue-form'));
}
}
</script>
<script>
// window.addEvent('domready', function() {
window.onload = (event) => {
setAttribute();
test();
}
function setAttribute() {
document.getElementById("tmp_form_postalCode").setAttribute("geo-data", "postal_code");
document.getElementById("tmp_form_city").setAttribute("geo-data", "locality");
document.getElementById("tmp_form_state").setAttribute("geo-data", "administrative_area_level_1");
document.getElementById("tmp_form_street").setAttribute("geo-data", "street_address");
document.getElementById("tmp_form_route").setAttribute("geo-data", "route");
document.getElementById("tmp_form_streetnumber").setAttribute("geo-data", "street_number");
document.getElementById("tmp_form_country").setAttribute("geo-data", "country_short");
document.getElementById("tmp_form_latitude").setAttribute("geo-data", "lat");
document.getElementById("tmp_form_longitude").setAttribute("geo-data", "lng");
document.getElementById("tmp_form_venue").setAttribute("geo-data", "name");
}
function meta() {
var f = document.getElementById('venue-form');
if (f.jform_meta_keywords.value != "") f.jform_meta_keywords.value += ", ";
f.jform_meta_keywords.value += f.jform_venue.value + ', ' + f.jform_city.value;
}
function test() {
var form = document.getElementById('venue-form');
var map = $('#jform_map');
var streetcheck = $(form.jform_street).hasClass('required');
// if (map && map.checked == true) {
if (map && map.is(":checked")) {
var lat = $('#jform_latitude');
var lon = $('#jform_longitude');
if (lat.val() == ('' || 0.000000) || lon.val() == ('' || 0.000000)) {
if (!streetcheck) {
addrequired();
}
} else {
if (lat.val() != ('' || 0.000000) && lon.val() != ('' || 0.000000)) {
removerequired();
}
}
$('#mapdiv').show();
}
// if (map && map.checked == false) {
if (map && !map.is(":checked")) {
removerequired();
$('#mapdiv').hide();
}
}
function addrequired() {
var form = document.getElementById('venue-form');
$(form.jform_street).addClass('required');
$(form.jform_postalCode).addClass('required');
$(form.jform_city).addClass('required');
$(form.jform_country).addClass('required');
}
function removerequired() {
var form = document.getElementById('venue-form');
$(form.jform_street).removeClass('required');
$(form.jform_postalCode).removeClass('required');
$(form.jform_city).removeClass('required');
$(form.jform_country).removeClass('required');
}
jQuery(function() {
jQuery("#geocomplete").geocomplete({
map: ".map_canvas",
<?php echo $location; ?>
details: "form ",
detailsAttribute: "geo-data",
types: ['establishment', 'geocode'],
mapOptions: {
zoom: 16,
mapTypeId: "hybrid"
},
markerOptions: {
draggable: true
}
});
jQuery("#geocomplete").bind('geocode:result', function() {
var street = jQuery("#tmp_form_street").val();
var route = jQuery("#tmp_form_route").val();
if (route) {
/* something to add */
} else {
jQuery("#tmp_form_street").val('');
}
});
jQuery("#geocomplete").bind("geocode:dragged", function(event, latLng) {
jQuery("#tmp_form_latitude").val(latLng.lat());
jQuery("#tmp_form_longitude").val(latLng.lng());
});
/* option to attach a reset function to the reset-link
jQuery("#reset").click(function(){
jQuery("#geocomplete").geocomplete("resetMarker");
jQuery("#reset").hide();
return false;
});
*/
jQuery("#find-left").click(function() {
jQuery("#geocomplete").val(jQuery("#jform_street").val() + ", " + jQuery("#jform_postalCode").val() + " " + jQuery("#jform_city").val());
jQuery("#geocomplete").trigger("geocode");
});
jQuery("#cp-latlong").click(function() {
document.getElementById("jform_latitude").value = document.getElementById("tmp_form_latitude").value;
document.getElementById("jform_longitude").value = document.getElementById("tmp_form_longitude").value;
test();
});
jQuery("#cp-address").click(function() {
document.getElementById("jform_street").value = document.getElementById("tmp_form_street").value;
document.getElementById("jform_postalCode").value = document.getElementById("tmp_form_postalCode").value;
document.getElementById("jform_city").value = document.getElementById("tmp_form_city").value;
document.getElementById("jform_state").value = document.getElementById("tmp_form_state").value;
document.getElementById("jform_country").value = document.getElementById("tmp_form_country").value;
});
jQuery("#cp-venue").click(function() {
var venue = document.getElementById("tmp_form_venue").value;
if (venue) {
document.getElementById("jform_venue").value = venue;
}
});
jQuery("#cp-all").click(function() {
jQuery("#cp-address").click();
jQuery("#cp-latlong").click();
jQuery("#cp-venue").click();
});
jQuery('#jform_map').on('keyup keypress blur change', function() {
test();
});
jQuery('#jform_latitude').on('keyup keypress blur change', function() {
test();
});
jQuery('#jform_longitude').on('keyup keypress blur change', function() {
test();
});
});
</script>
<div id="jem" class="jem_editvenue<?php echo $this->pageclass_sfx; ?>">
<div class="edit item-page">
<?php if ($params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_jem&a_id=' . (int) $this->item->id); ?>" class="form-validate" method="post" name="adminForm" id="venue-form" enctype="multipart/form-data">
<button type="submit" class="positive btn btn-primary" onclick="Joomla.submitbutton('venue.save')"><?php echo Text::_('JSAVE') ?></button>
<button type="cancel" class="negative btn btn-secondary" onclick="Joomla.submitbutton('venue.cancel')"><?php echo Text::_('JCANCEL') ?></button>
<br>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<?php endif; ?>
<?php //echo HTMLHelper::_('tabs.start', 'venueTab', $options); ?>
<!-- VENUE-DETAILS TAB -->
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_INFO_TAB'), 'venue-details'); ?>
<?php echo HTMLHelper::_('uitab.startTabSet', 'myTab', ['active' => 'venue-details', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-details', Text::_('COM_JEM_EDITVENUE_INFO_TAB')); ?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_DETAILS_LEGEND'); ?></legend>
<dl class="adminformlist jem-dl">
<dt><?php echo $this->form->getLabel('venue'); ?></dt>
<dd><?php echo $this->form->getInput('venue'); ?></dd>
<?php if (is_null($this->item->id)) : ?>
<dt><?php echo $this->form->getLabel('alias'); ?></dt>
<dd><?php echo $this->form->getInput('alias'); ?></dd>
<?php endif; ?>
<dt><?php echo $this->form->getLabel('street'); ?></dt>
<dd><?php echo $this->form->getInput('street'); ?></dd>
<dt><?php echo $this->form->getLabel('postalCode'); ?></dt>
<dd><?php echo $this->form->getInput('postalCode'); ?></dd>
<dt><?php echo $this->form->getLabel('city'); ?></dt>
<dd><?php echo $this->form->getInput('city'); ?></dd>
<dt><?php echo $this->form->getLabel('state'); ?></dt>
<dd><?php echo $this->form->getInput('state'); ?></dd>
<dt><?php echo $this->form->getLabel('country'); ?></dt>
<dd><?php echo $this->form->getInput('country'); ?></dd>
<dt><?php echo $this->form->getLabel('latitude'); ?></dt>
<dd><?php echo $this->form->getInput('latitude'); ?></dd>
<dt><?php echo $this->form->getLabel('longitude'); ?></dt>
<dd><?php echo $this->form->getInput('longitude'); ?></dd>
</dl>
</fieldset>
<p>&nbsp;</p>
<!-- VENUE-GEODATA-->
<?php
$global_show_mapserv = $this->settings->get('global_show_mapserv');
if ($global_show_mapserv == 2 || $global_show_mapserv == 3 || $global_show_mapserv == 5) : ?>
<fieldset class="adminform" id="geodata">
<legend><?php echo Text::_('COM_JEM_GEODATA_LEGEND'); ?></legend>
<dl class="adminformlist jem-dl">
<dt><?php echo $this->form->getLabel('map'); ?></dt>
<dd><?php echo $this->form->getInput('map'); ?></dd>
</dl>
<div style="clear: both;"></div>
<div id="mapdiv">
<div class="jem-row jem-justify-start">
<div><input id="geocomplete" class="form-control" type="text" size="55" placeholder="<?php echo Text::_('COM_JEM_VENUE_ADDRPLACEHOLDER'); ?>" value="" /></div>
<div><input id="find-left" class="btn" type="button" value="<?php echo Text::_('COM_JEM_VENUE_ADDR_FINDVENUEDATA'); ?>" /></div>
</div>
<div class="map_canvas"></div>
<dl class="adminformlist jem-dl">
<dt><label><?php echo Text::_('COM_JEM_STREET'); ?></label></dt>
<dd>
<input type="text" disabled="disabled" class="readonly" id="tmp_form_street" readonly="readonly" />
<input type="hidden" class="readonly" id="tmp_form_streetnumber" readonly="readonly" />
<input type="hidden" class="readonly" id="tmp_form_route" readonly="readonly" />
</dd>
<dt><label><?php echo Text::_('COM_JEM_ZIP'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_postalCode" readonly="readonly" /></dd>
<dt><label><?php echo Text::_('COM_JEM_CITY'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_city" readonly="readonly" /></dd>
<dt><label><?php echo Text::_('COM_JEM_STATE'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_state" readonly="readonly" /></dd>
<dt><label><?php echo Text::_('COM_JEM_VENUE'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_venue" readonly="readonly" /></dd>
<dt><label><?php echo Text::_('COM_JEM_COUNTRY'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_country" readonly="readonly" /></dd>
<dt><label><?php echo Text::_('COM_JEM_LATITUDE'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_latitude" readonly="readonly" /></dd>
<dt><label><?php echo Text::_('COM_JEM_LONGITUDE'); ?></label></dt>
<dd><input type="text" disabled="disabled" class="readonly" id="tmp_form_longitude" readonly="readonly" /></dd>
</dl>
<div style="clear: both;"><br /></div>
<div class="jem-row jem-justify-start">
<input id="cp-all" class="btn" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_DATA'); ?>" />
<input id="cp-address" class="btn" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_ADDRESS'); ?>" />
<input id="cp-venue" class="btn" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_VENUE'); ?>" />
<input id="cp-latlong" class="btn" type="button" value="<?php echo Text::_('COM_JEM_VENUE_COPY_COORDINATES'); ?>" />
</div>
</div>
</fieldset>
<p>&nbsp;</p>
<?php endif; ?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_DESCRIPTION_LEGEND'); ?></legend>
<div style="clear: both;"><br /></div>
<div>
<?php echo $this->form->getLabel('locdescription'); ?>
<?php echo $this->form->getInput('locdescription'); ?>
</div>
</fieldset>
<p>&nbsp;</p>
<!-- EXTENDED TAB -->
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'editvenue-extendedtab', Text::_('COM_JEM_EDITVENUE_EXTENDED_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_EXTENDED_TAB'), 'editvenue-extendedtab'); ?>
<?php echo $this->loadTemplate('extended'); ?>
<!-- PUBLISHING TAB -->
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-publishtab', Text::_('COM_JEM_EDITVENUE_PUBLISH_TAB')); ?>
<?php // echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_PUBLISH_TAB'), 'venue-publishtab'); ?>
<?php echo $this->loadTemplate('publish'); ?>
<!-- ATTACHMENTS TAB -->
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php if (!empty($this->item->attachments) || ($this->jemsettings->attachmentenabled != 0)) : ?>
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-attachments', Text::_('COM_JEM_EDITVENUE_ATTACHMENTS_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_ATTACHMENTS_TAB'), 'venue-attachmentstab'); ?>
<?php echo $this->loadTemplate('attachments'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php endif; ?>
<!-- MORE TAB -->
<?php echo HTMLHelper::_('uitab.addTab', 'myTab', 'venue-other', Text::_('COM_JEM_EDITVENUE_OTHER_TAB')); ?>
<?php //echo HTMLHelper::_('tabs.panel', Text::_('COM_JEM_EDITVENUE_OTHER_TAB'), 'venue-othertab'); ?>
<?php echo $this->loadTemplate('other'); ?>
<?php //echo HTMLHelper::_('tabs.end'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<div class="clearfix"></div>
<input type="hidden" name="country" id="country" geo-data="country_short" value="">
<input type="hidden" name="author_ip" value="<?php echo $this->item->author_ip; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
<?php echo HTMLHelper::_('form.token'); ?>
</form>
</div>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>

View File

@ -0,0 +1,90 @@
<?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\Session\Session;
?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_ATTACHMENTS_LEGEND'); ?></legend>
<table class="adminform">
<tbody>
<?php foreach ($this->item->attachments as $file) : ?>
<tr>
<td style="width: 100%;">
<dl class="jem-dl">
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_FILE'); ?></dt>
<dd><input class="form-control readonly valid form-control-success w-75" type="text" readonly="readonly" value="<?php echo $file->file; ?>" /></dd>
<dd><input type="hidden" name="attached-id[]" value="<?php echo $file->id; ?>" /></dd>
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_NAME'); ?></dt>
<?php /* name is always editable, also if attachemnt upload is not allowed */ ?>
<dd><input type="text" name="attached-name[]" value="<?php echo $file->name; ?>" /></dd>
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_DESCRIPTION'); ?></dt>
<?php /* description is always editable, also if attachemnt upload is not allowed */ ?>
<dd><input type="text" name="attached-desc[]" value="<?php echo $file->description; ?>" /></dd>
<?php if ($this->jemsettings->attachmentenabled != 0) : ?>
<?php //This button just deletes the dl because two times more getParent() in attachment.js is required
?>
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_REMOVE') . ' ' . $file->name; ?></dt>
<dd><?php echo JemOutput::removebutton(Text::_('COM_JEM_GLOBAL_REMOVE_ATTACHEMENT'), array('id' => 'attach-remove' . $file->id . ':' . Session::getFormToken(), 'class' => 'attach-remove btn', 'title' => Text::_('COM_JEM_GLOBAL_REMOVE_ATTACHEMENT'))); ?></dd>
<?php endif; ?>
</dl>
</td>
<td>
<div>
<div><?php echo Text::_('COM_JEM_ATTACHMENT_ACCESS'); ?></div>
<?php
$attribs = array('class' => 'inputbox', 'size' => '7');
/* if attachment upload is not allowed changing access level should also not possible */
if ($this->jemsettings->attachmentenabled == 0) :
$attribs['disabled'] = 'disabled';
endif;
echo HTMLHelper::_('select.genericlist', $this->access, 'attached-access[]', $attribs, 'value', 'text', $file->access);
?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p>&nbsp;</p>
<legend><?php echo Text::_('COM_JEM_ADD_USER_REGISTRATIONS') . ' ' . Text::_('COM_JEM_ATTACHMENTS_LEGEND'); ?></legend>
<table class="adminform" id="el-attachments">
<tbody>
<?php if ($this->jemsettings->attachmentenabled != 0) : ?>
<tr>
<td style="width: 100%;">
<dl class="jem-dl">
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_FILE'); ?></dt>
<dd><input type="file" name="attach[]" class="attach-field" /> <input type="reset" value="<?php echo Text::_('JSEARCH_FILTER_CLEAR') ?>" class="btn btn-primary"></dd>
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_NAME'); ?></dt>
<dd><input type="text" name="attach-name[]" class="attach-name" value="" /></dd>
<dt><?php echo Text::_('COM_JEM_ATTACHMENT_DESCRIPTION'); ?></dt>
<dd><input type="text" name="attach-desc[]" class="attach-desc" value="" /></dd>
</dl>
</td>
<td>
<div>
<div><?php echo Text::_('COM_JEM_ATTACHMENT_ACCESS'); ?></div>
<?php echo HTMLHelper::_('select.genericlist', $this->access, 'attach-access[]', array('class' => 'inputbox', 'size' => '7'), 'value', 'text', 1); ?>
</div>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</fieldset>

View File

@ -0,0 +1,51 @@
<?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;
?>
<!-- IMAGE -->
<?php if ($this->item->locimage || $this->jemsettings->imageenabled != 0) : ?>
<fieldset class="jem_fldst_image">
<legend><?php echo Text::_('COM_JEM_EDITVENUE_IMAGE_LEGEND'); ?></legend>
<?php if ($this->jemsettings->imageenabled != 0) : ?>
<dl class="adminformlist jem-dl">
<dt><?php echo $this->form->getLabel('userfile'); ?></dt>
<?php if ($this->item->locimage) : ?>
<dd>
<?php echo JEMOutput::flyer($this->item, $this->limage, 'venue', 'locimage'); ?>
<input type="hidden" name="locimage" id="locimage" value="<?php echo $this->item->locimage; ?>" />
</dd>
<dt> </dt>
<?php endif; ?>
<dd><?php echo $this->form->getInput('userfile'); ?></dd>
<dt> </dt>
<dd><button type="button" class="button3 btn" onclick="document.getElementById('jform_userfile').value = ''"><?php echo Text::_('JSEARCH_FILTER_CLEAR') ?></button></dd>
<?php if ($this->item->locimage) : ?>
<dt><?php echo Text::_('COM_JEM_REMOVE_IMAGE'); ?></dt>
<dd><?php
echo HTMLHelper::image('media/com_jem/images/publish_r.png', null, array('id' => 'userfile-remove', 'data-id' => $this->item->id, 'data-type' => 'venues', 'title' => Text::_('COM_JEM_REMOVE_IMAGE'), 'class' =>'btn')); ?>
</dd>
<?php endif; ?>
</dl>
<input type="hidden" name="removeimage" id="removeimage" value="0" />
<?php endif; ?>
</fieldset>
<?php endif; ?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_URL_LEGEND'); ?></legend>
<dl class="adminformlist jem-dl">
<dt><?php echo $this->form->getLabel('url'); ?></dt>
<dd><?php echo $this->form->getInput('url'); ?></dd>
</dl>
</fieldset>

View File

@ -0,0 +1,38 @@
<?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;
$max_custom_fields = $this->settings->get('global_editvenue_maxnumcustomfields', -1); // default to All
?>
<!-- CUSTOM FIELDS -->
<?php if ($max_custom_fields != 0) : ?>
<fieldset class="panelform">
<legend><?php echo Text::_('COM_JEM_EDITVENUE_CUSTOMFIELDS'); ?></legend>
<dl class="adminformlist jem-dl-long">
<?php
$fields = $this->form->getFieldset('custom');
if ($max_custom_fields < 0) :
$max_custom_fields = count($fields);
endif;
$cnt = 0;
foreach ($fields as $field) :
if (++$cnt <= $max_custom_fields) :
?>
<dt><?php echo $field->label; ?></dt>
<dd><?php echo $field->input; ?></dd>
<?php
endif;
endforeach;
?>
</dl>
</fieldset>
<?php endif; ?>

View File

@ -0,0 +1,35 @@
<?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;
//$max_custom_fields = $this->settings->get('global_editvenue_maxnumcustomfields', -1); // default to All
?>
<fieldset>
<legend><?php echo Text::_('COM_JEM_EDITVENUE_PUBLISHING_LEGEND'); ?></legend>
<dl class="adminformlist jem-dl">
<dt><?php echo $this->form->getLabel('published'); ?></dt>
<dd><?php echo $this->form->getInput('published'); ?></dd>
</dl>
</fieldset>
<!-- META -->
<fieldset class="">
<legend><?php echo Text::_('COM_JEM_METADATA'); ?></legend>
<input type="button" class="button btn" value="<?php echo Text::_('COM_JEM_ADD_VENUE_CITY'); ?>" onclick="meta()" />
<p>&nbsp;</p>
<?php foreach ($this->form->getFieldset('meta') as $field) : ?>
<dl class="jem-dl">
<dt class="control-label"><?php echo $field->label; ?></dt>
<dd class="controls"><?php echo $field->input; ?></dd>
</dl>
<?php endforeach; ?>
</fieldset>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,242 @@
<?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;
/**
* Editvenue-View
*/
class JemViewEditvenue extends JemView
{
protected $form;
protected $item;
protected $return_page;
protected $state;
/**
* Editvenue-View
*/
public function display($tpl = null)
{
// Initialise variables.
$jemsettings = JemHelper::config();
$settings = JemHelper::globalattribs();
$app = Factory::getApplication();
$user = JemFactory::getUser();
$document = $app->getDocument();
$model = $this->getModel();
$menu = $app->getMenu();
$menuitem = $menu->getActive();
$pathway = $app->getPathway();
$url = Uri::root();
$language = Factory::getApplication()->getLanguage();
$language = $language->getTag();
$language = substr($language, 0,2);
// Get model data.
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->params = $this->state->get('params');
// Create a shortcut for $item and params.
$item = $this->item;
$params = $this->params;
$this->form = $this->get('Form');
$this->return_page = $this->get('ReturnPage');
// check for data error
if (empty($item)) {
$app->enqueueMessage(Text::_('JERROR_AN_ERROR_HAS_OCCURRED'), 'error');
return false;
}
// check for guest
if (!$user || $user->id == 0) {
$app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
return false;
}
if (empty($item->id)) {
// Check if the user has access to the form
$authorised = $user->can('add', 'venue');
} else {
// Check if user can edit
$authorised = $user->can('edit', 'venue', $item->id, $item->created_by);
}
if ($authorised !== true) {
$app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'error');
return false;
}
// Decide which parameters should take priority
$useMenuItemParams = ($menuitem && $menuitem->query['option'] == 'com_jem'
&& $menuitem->query['view'] == 'editvenue'
&& 0 == $item->id); // menu item is always for new venues
$title = ($item->id == 0) ? Text::_('COM_JEM_EDITVENUE_VENUE_ADD')
: Text::sprintf('COM_JEM_EDITVENUE_VENUE_EDIT', $item->venue);
if ($useMenuItemParams) {
$pagetitle = $menuitem->title ? $menuitem->title : $title;
$params->def('page_title', $pagetitle);
$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 menu item if one is set else from venue if there is one set
if (isset($menuitem->query['layout'])) {
$this->setLayout($menuitem->query['layout']);
} elseif ($layout = $item->params->get('venue_layout')) {
$this->setLayout($layout);
}
$item->params->merge($params);
} else {
$pagetitle = $title;
$params->set('page_title', $pagetitle);
$params->set('page_heading', $pagetitle);
$params->set('show_page_heading', 1); // ensure page heading is shown
$params->set('introtext', ''); // there is no introtext in that case
$params->set('showintrotext', 0);
$pathway->addItem($pagetitle, ''); // link not required here so '' is ok
// Check for alternative layouts (since we are not in an edit-venue menu item)
// Load layout from venue if one is set
if ($layout = $item->params->get('venue_layout')) {
$this->setLayout($layout);
}
$temp = clone($params);
$temp->merge($item->params);
$item->params = $temp;
}
$publisher = $user->can('publish', 'venue', $item->id, $item->created_by);
if (!empty($this->item) && isset($this->item->id)) {
// $this->item->images = json_decode($this->item->images);
// $this->item->urls = json_decode($this->item->urls);
$tmp = new stdClass();
// $tmp->images = $this->item->images;
// $tmp->urls = $this->item->urls;
$this->form->bind($tmp);
}
// Check for errors.
$errors = $this->get('Errors');
if (is_array($errors) && count($errors)) {
\Joomla\CMS\Factory::getApplication()->enqueueMessage(implode("\n", $errors), 'warning');
return false;
}
$access2 = JemHelper::getAccesslevelOptions(true);
$this->access = $access2;
// Load css
JemHelper::loadCss('geostyle');
JemHelper::loadCss('jem');
JemHelper::loadCustomCss();
JemHelper::loadCustomTag();
// Load script
// HTMLHelper::_('script', 'com_jem/attachments.js', false, true);
// HTMLHelper::_('script', 'com_jem/other.js', false, true);
$document->addScript($url.'media/com_jem/js/attachments.js');
$document->addScript($url.'media/com_jem/js/other.js');
$key = trim($settings->get('global_googleapi', ''));
// $document->addScript('https://maps.googleapis.com/maps/api/js?'.(!empty($key) ? 'key='.$key.'&amp;' : '').'sensor=false&libraries=places&language='.$language);
// Noconflict
$document->addCustomTag( '<script>jQuery.noConflict();</script>' );
// JQuery scripts
$document->addScript('https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js');
// HTMLHelper::_('script', 'com_jem/jquery.geocomplete.js', false, true);
// $document->addScript($url.'media/com_jem/js/jquery.geocomplete.js');
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerScript('jem.jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js')->useScript('jem.jquery');
$wa->registerScript('jem.jquery_map', 'https://maps.googleapis.com/maps/api/js?'.(!empty($key) ? 'key='.$key.'&amp;' : '').'sensor=false&libraries=places&language='.$language)->useScript('jem.jquery_map');
$wa->registerScript('jem.geocomplete', 'com_jem/jquery.geocomplete.js')->useScript('jem.geocomplete');
// No permissions required/useful on this view
$permissions = new stdClass();
$pageclass_sfx = $item->params->get('pageclass_sfx');
$this->pageclass_sfx = $pageclass_sfx ? htmlspecialchars($pageclass_sfx) : $pageclass_sfx;
$this->jemsettings = $jemsettings;
$this->settings = $settings;
$this->permissions = $permissions;
$this->limage = JemImage::flyercreator($this->item->locimage, 'venue');
$this->infoimage = HTMLHelper::_('image', 'com_jem/icon-16-hint.png', Text::_('COM_JEM_NOTES'), NULL, true);
$this->user = $user;
if (!$publisher) {
$this->form->setFieldAttribute('published', 'default', 0);
$this->form->setFieldAttribute('published', 'readonly', 'true');
}
// configure image field: show max. file size, and possibly mark field as required
$tip = Text::_('COM_JEM_UPLOAD_IMAGE');
if ((int)$jemsettings->sizelimit > 0) {
$tip .= ' <br/>' . Text::sprintf('COM_JEM_MAX_FILE_SIZE_1', (int)$jemsettings->sizelimit);
}
$this->form->setFieldAttribute('userfile', 'description', $tip);
if ($jemsettings->imageenabled == 2) {
$this->form->setFieldAttribute('userfile', 'required', 'true');
}
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = Factory::getApplication();
$title = $this->params->get('page_title');
if ($app->get('sitename_pagetitles', 0) == 1) {
$title = Text::sprintf('JPAGETITLE', $app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2) {
$title = Text::sprintf('JPAGETITLE', $title, $app->get('sitename'));
}
$this->document->setTitle($title);
// TODO: Is it useful to have meta data in an edit view?
// Also shouldn't be "robots" set to "noindex, nofollow"?
if ($this->params->get('menu-meta_description')) {
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords')) {
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots')) {
$this->document->setMetadata('robots', $this->params->get('robots'));
}
}
}
?>