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,427 @@
<?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\Router\Route;
use Joomla\CMS\HTML\HTMLHelper;
?>
<div id="jem" class="jlcalendar jem_calendar<?php echo $this->pageclass_sfx;?>">
<div class="buttons">
<?php
$btn_params = array('print_link' => $this->print_link, 'ical_link' => $this->ical_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; ?>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<p> </p>
<?php endif; ?>
<?php
$countcatevents = array ();
$countperday = array();
$limit = $this->params->get('daylimit', 10);
$evbg_usecatcolor = $this->params->get('eventbg_usecatcolor', 0);
$currentWeek = $this->currentweek;
$firstDate = date("Y-m-d", $this->cal->getFirstDayTimeOfWeek($currentWeek));
$showtime = $this->settings->get('global_show_timedetails', 1);
foreach ($this->rows as $row) :
if (!JemHelper::isValidDate($row->dates)) {
continue; // skip, open date !
}
//get event date
$year = date('Y', strtotime($row->dates));
$month = date('m', strtotime($row->dates));
$day = date('d', strtotime($row->dates));
@$countperday[$year.$month.$day]++;
if ($countperday[$year.$month.$day] == $limit+1) {
$var1a = Route::_('index.php?option=com_jem&view=day&id='.$year.$month.$day . $this->param_topcat);
$var1b = Text::_('COM_JEM_AND_MORE');
$var1c = "<a href=\"".$var1a."\">".$var1b."</a>";
$id = 'eventandmore';
$this->cal->setEventContent($year, $month, $day, $var1c, null, $id);
continue;
} elseif ($countperday[$year.$month.$day] > $limit+1) {
continue;
}
//for time in tooltip
$timehtml = '';
if ($showtime) {
$start = JemOutput::formattime($row->times);
$end = JemOutput::formattime($row->endtimes);
if ($start != '') {
$timehtml = '<div class="time"><span class="text-label">'.Text::_('COM_JEM_TIME_SHORT').': </span>';
$timehtml .= $start;
if ($end != '') {
$timehtml .= ' - '.$end;
}
$timehtml .= '</div>';
}
}
$eventname = '<div class="eventName">'.Text::_('COM_JEM_TITLE_SHORT').': '.$this->escape($row->title).'</div>';
$detaillink = Route::_(JemHelperRoute::getEventRoute($row->slug));
$eventid = $this->escape($row->id);
//initialize variables
$multicatname = '';
$colorpic = '';
$nr = is_array($row->categories) ? count($row->categories) : 0;
$ix = 0;
$content = '';
$contentend = '';
$catcolor = array();
//walk through categories assigned to an event
foreach((array)$row->categories AS $category) {
//Currently only one id possible...so simply just pick one up...
$detaillink = Route::_(JemHelperRoute::getEventRoute($row->slug));
//wrap a div for each category around the event for show hide toggler
$content .= '<div id="catz" class="cat'.$category->id.'">';
$contentend .= '</div>';
//attach category color if any in front of the catname
if ($category->color) {
$multicatname .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>&nbsp;'.$category->catname;
} else {
$multicatname .= $category->catname;
}
$ix++;
if ($ix != $nr) {
$multicatname .= ', ';
}
//attach category color if any in front of the event title in the calendar overview
if (isset($category->color) && $category->color) {
$colorpic .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>';
$catcolor[$category->color] = $category->color; // we need to list all different colors of this event
}
/* count if not multiday or first of multiday or first visible of multiday */
if (!isset($row->multi) || ($row->multi == 'first') || ($row->dates == $firstDate)) {
if (!array_key_exists($category->id, $countcatevents)) {
$countcatevents[$category->id] = 1;
} else {
$countcatevents[$category->id]++;
}
}
}
$color = '<div id="eventcontenttop" class="eventcontenttop">';
$color .= $colorpic;
$color .= '</div>';
// multiday
$multi_mode = 0; // single day
$multi_icon = '';
if (isset($row->multi)) {
switch ($row->multi) {
case 'first': // first day
$multi_mode = 1;
$multi_icon = HTMLHelper::_("image","com_jem/arrow-left.png",'', NULL, true);
break;
case 'middle': // middle day
$multi_mode = 2;
$multi_icon = HTMLHelper::_("image","com_jem/arrow-middle.png",'', NULL, true);
break;
case 'zlast': // last day
$multi_mode = 3;
$multi_icon = HTMLHelper::_("image","com_jem/arrow-right.png",'', NULL, true);
break;
}
}
//for time in calendar
$timetp = '';
if ($showtime) {
$start = JemOutput::formattime($row->times,'',false);
$end = JemOutput::formattime($row->endtimes,'',false);
switch ($multi_mode) {
case 1:
$timetp .= $multi_icon . ' ' . $start . '<br />';
break;
case 2:
$timetp .= $multi_icon . '<br />';
break;
case 3:
$timetp .= $multi_icon . ' ' . $end . '<br />';
break;
default:
if ($start != '') {
$timetp .= $start;
if ($end != '') {
$timetp .= ' - '.$end;
}
$timetp .= '<br />';
}
break;
}
} else {
if (!empty($multi_icon)) {
$timetp .= $multi_icon . ' ';
}
}
$catname = '<div class="catname">'.$multicatname.'</div>';
$eventdate = !empty($row->multistartdate) ? JemOutput::formatdate($row->multistartdate) : JemOutput::formatdate($row->dates);
if (!empty($row->multienddate)) {
$eventdate .= ' - ' . JemOutput::formatdate($row->multienddate);
} else if ($row->enddates && $row->dates < $row->enddates) {
$eventdate .= ' - ' . JemOutput::formatdate($row->enddates);
}
//venue
if ($this->jemsettings->showlocate == 1) {
$venue = '<div class="location"><span class="text-label">'.Text::_('COM_JEM_VENUE_SHORT').': </span>';
$venue .= !empty($row->venue) ? $this->escape($row->venue) : '-';
$venue .= '</div>';
} else {
$venue = '';
}
// state if unpublished
$statusicon = '';
if (isset($row->published) && ($row->published != 1)) {
$statusicon = JemOutput::publishstateicon($row);
$eventstate = '<div class="eventstate"><span class="text-label">'.Text::_('JSTATUS').': </span>';
switch ($row->published) {
case 1: $eventstate .= Text::_('JPUBLISHED'); break;
case 0: $eventstate .= Text::_('JUNPUBLISHED'); break;
case 2: $eventstate .= Text::_('JARCHIVED'); break;
case -2: $eventstate .= Text::_('JTRASHED'); break;
}
$eventstate .= '</div>';
} else {
$eventstate = '';
}
//date in tooltip
$multidaydate = '<div class="time"><span class="text-label">'.Text::_('COM_JEM_DATE').': </span>';
switch ($multi_mode) {
case 1: // first day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
case 2: // middle day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
case 3: // last day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
default: // single day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
}
$multidaydate .= '</div>';
//create little Edit and/or Copy icon on top right corner of event if user is allowed to edit and/or create
$editicon = '';
if (!$this->print) {
$btns = array();
if ($this->params->get('show_editevent_icon', 0) && $row->params->get('access-edit', false)) {
$btns[] = JemOutput::editbutton($row, null, null, true, 'editevent');
}
if ($this->params->get('show_copyevent_icon', 0) && $this->permissions->canAddEvent) {
$btns[] = JemOutput::copybutton($row, null, null, true, 'editevent');
}
if (!empty($btns)) {
$editicon .= '<div class="inline-button-right">';
$editicon .= join(' ', $btns);
$editicon .= '</div>';
}
}
//get border for featured event
$usefeaturedborder = $this->params->get('usefeaturedborder', 0);
$featuredbordercolor = $this->params->get('featuredbordercolor', 0);
$featuredclass = '';
$featuredstyle ='';
if($usefeaturedborder && $row->featured){
$featuredclass="borderfeatured";
$featuredstyle="border-color:" . $featuredbordercolor;
}
//generate the output
// if we have exact one color from categories we can use this as background color of event
$content .= '<div class="eventcontentinner event_id' . $eventid . ' cat_id' . $category->id . ' ' . $featuredclass . '" style="' . $featuredstyle;
if (!empty($evbg_usecatcolor) && (count($catcolor) == 1)) {
$content .= '; background-color:'.array_pop($catcolor).'">';
} else {
$content .= '">' . $colorpic;
}
$content .= $editicon;
$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);
$content .= $contentend . '</div>';
$this->cal->setEventContent($year, $month, $day, $content);
endforeach;
// enable little icon right beside day number to allow event creation
if (!$this->print && $this->params->get('show_addevent_icon', 0) && !empty($this->permissions->canAddEvent)) {
$html = JemOutput::prepareAddEventButton();
$this->cal->enableNewEventLinks($html);
}
$displayLegend = (int)$this->params->get('displayLegend', 1);
if ($displayLegend == 2) : ?>
<!-- Calendar legend above -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons">
<div class="calendarButtonsToggle">
<div id="buttonshowall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_SHOWALL'); ?>
</div>
<div id="buttonhideall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_HIDEALL'); ?>
</div>
</div>
</div>
<div class="clr"></div>
<!-- Calendar Legend -->
<div class="calendarLegends">
<?php
if ($this->params->get('displayLegend')) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<div class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</div>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<?php
// print the calendar
$nrweeks = $this->params->get('nrweeks', 1);
echo $this->cal->showWeeksByID($currentWeek, $nrweeks);
?>
<?php if (($displayLegend == 1) || ($displayLegend == 0)) : ?>
<!-- Calendar legend below -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons">
<div class="calendarButtonsToggle">
<div id="buttonshowall" class="calendarButton btn btn-outline-dark me-2">
<?php echo Text::_('COM_JEM_SHOWALL'); ?>
</div>
<div id="buttonhideall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_HIDEALL'); ?>
</div>
</div>
</div>
<div class="clr"></div>
<!-- Calendar Legend -->
<div class="calendarLegends mt-4">
<?php
if ($displayLegend == 1) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<div class="eventCat btn btn-outline-dark me-2" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</div>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<div class="clr"></div>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>

View File

@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEM_WEEKCAL_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_JEM_WEEKCAL_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">COM_JEM_SHOW</option>
<option value="0">COM_JEM_HIDE</option>
</field>
<field type="spacer" name="myspacer2" hr="true" />
<field name="show_archived_events" type="radio"
default="0"
label="COM_JEM_SHOW_ARCHIVED_EVENTS"
description="COM_JEM_SHOW_ARCHIVED_EVENTS_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="nrweeks" type="text"
default="1"
label="COM_JEM_WKCAL_NRWEEKS"
description="COM_JEM_WKCAL_NRWEEKS_DESC"
/>
<field name="top_category" type="categories"
default="0"
label="COM_JEM_SELECT_TOP_CATEGORY"
description="COM_JEM_SELECT_TOP_CATEGORY_DESC"
/>
<field name="displayLegend" type="list"
default="1"
label="COM_JEM_DISPLAY_LEGEND"
description="COM_JEM_DISPLAY_LEGEND_DESC"
>
<option value="0">JNO</option>
<option value="2">COM_JEM_ABOVE</option>
<option value="1">COM_JEM_BELOW</option>
</field>
<field name="show_only_start" type="radio"
default="0"
label="COM_JEM_SHOWONLYSTARTDAY"
description="COM_JEM_SHOWONLYSTARTDAY_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="firstweekday" type="list"
default="1"
label="COM_JEM_SELECTFIRSTWEEKDAY"
description="COM_JEM_SELECTFIRSTWEEKDAYDESC"
>
<option value="0">COM_JEM_SUNDAY</option>
<option value="1">COM_JEM_MONDAY</option>
</field>
<field name="daylimit" type="text"
default="10"
label="COM_JEM_MAX_EVENTS_PER_DAY"
description="COM_JEM_MAX_EVENTS_PER_DAY_DESC"
/>
<field name="show_addevent_icon" type="radio"
default="0"
label="COM_JEM_SHOWADDEVENTICON"
description="COM_JEM_SHOWADDEVENTICON_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="show_editevent_icon" type="radio"
default="0"
label="COM_JEM_SHOWEDITEVENTICON"
description="COM_JEM_SHOWEDITEVENTICON_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="show_copyevent_icon" type="radio"
default="0"
label="COM_JEM_SHOWCOPYEVENTICON"
description="COM_JEM_SHOWCOPYEVENTICON_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field type="spacer" name="myspacer3" hr="true" />
<field name="eventlinkcolor" type="color"
default="#000000"
label="COM_JEM_CALENDAR_EVENTLINKCOLOR"
description="COM_JEM_CALENDAR_EVENTLINKCOLOR_DESC"
/>
<field name="eventbackgroundcolor" type="color"
default="#FFFF00"
label="COM_JEM_CALENDAR_EVENTBACKGROUNDCOLOR"
description="COM_JEM_CALENDAR_EVENTBACKGROUNDCOLOR_DESC"
/>
<field name="eventbg_usecatcolor" type="radio"
default="0"
label="COM_JEM_CALENDAR_USECATCOLOR"
description="COM_JEM_CALENDAR_USECATCOLOR_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="currentdaycolor" type="color"
default="#CCCC99"
label="COM_JEM_CALENDAR_CURRENTDAYCOLOR"
description="COM_JEM_CALENDAR_CURRENTDAYCOLOR_DESC"
/>
<field name="eventandmorecolor" type="color"
default="#FFFF00"
label="COM_JEM_CALENDAR_EVENTANDMORECOLOR"
description="COM_JEM_CALENDAR_EVENTANDMORECOLOR_DESC"
/>
<field name="usefeaturedborder" type="radio"
default="0"
label="COM_JEM_CALENDAR_USEFEATUREDBORDER"
description="COM_JEM_CALENDAR_USEFEATUREDBORDER_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="featuredbordercolor" type="color"
default="#000080"
label="COM_JEM_CALENDAR_FEATUREDBORDERCOLOR"
description="COM_JEM_CALENDAR_FEATUREDBORDERCOLOR_DESC"
/>
</fieldset>
</fields>
</metadata>

View File

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

View File

@ -0,0 +1,421 @@
<?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\Router\Route;
?>
<div id="jem" class="jlcalendar jem_calendar<?php echo $this->pageclass_sfx;?>">
<div class="buttons">
<?php
$btn_params = array('print_link' => $this->print_link, 'ical_link' => $this->ical_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; ?>
<?php if ($this->params->get('showintrotext')) : ?>
<div class="description no_space floattext">
<?php echo $this->params->get('introtext'); ?>
</div>
<p> </p>
<?php endif; ?>
<?php
$countcatevents = array ();
$countperday = array();
$limit = $this->params->get('daylimit', 10);
$evbg_usecatcolor = $this->params->get('eventbg_usecatcolor', 0);
$currentWeek = $this->currentweek;
$firstDate = date("Y-m-d", $this->cal->getFirstDayTimeOfWeek($currentWeek));
$showtime = $this->settings->get('global_show_timedetails', 1);
foreach ($this->rows as $row) :
if (!JemHelper::isValidDate($row->dates)) {
continue; // skip, open date !
}
//get event date
$year = date('Y', strtotime($row->dates));
$month = date('m', strtotime($row->dates));
$day = date('d', strtotime($row->dates));
@$countperday[$year.$month.$day]++;
if ($countperday[$year.$month.$day] == $limit+1) {
$var1a = Route::_('index.php?option=com_jem&view=day&id='.$year.$month.$day . $this->param_topcat);
$var1b = Text::_('COM_JEM_AND_MORE');
$var1c = "<a href=\"".$var1a."\">".$var1b."</a>";
$id = 'eventandmore';
$this->cal->setEventContent($year, $month, $day, $var1c, null, $id);
continue;
} elseif ($countperday[$year.$month.$day] > $limit+1) {
continue;
}
//for time in tooltip
$timehtml = '';
if ($showtime) {
$start = JemOutput::formattime($row->times);
$end = JemOutput::formattime($row->endtimes);
if ($start != '') {
$timehtml = '<div class="time"><span class="text-label">'.Text::_('COM_JEM_TIME_SHORT').': </span>';
$timehtml .= $start;
if ($end != '') {
$timehtml .= ' - '.$end;
}
$timehtml .= '</div>';
}
}
$eventname = '<div class="eventName">'.Text::_('COM_JEM_TITLE_SHORT').': '.$this->escape($row->title).'</div>';
$detaillink = Route::_(JemHelperRoute::getEventRoute($row->slug));
$eventid = $this->escape($row->id);
//initialize variables
$multicatname = '';
$colorpic = '';
$nr = is_array($row->categories) ? count($row->categories) : 0;
$ix = 0;
$content = '';
$contentend = '';
$catcolor = array();
//walk through categories assigned to an event
foreach((array)$row->categories AS $category) {
//Currently only one id possible...so simply just pick one up...
$detaillink = Route::_(JemHelperRoute::getEventRoute($row->slug));
//wrap a div for each category around the event for show hide toggler
$content .= '<div id="catz" class="cat'.$category->id.'">';
$contentend .= '</div>';
//attach category color if any in front of the catname
if ($category->color) {
$multicatname .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>&nbsp;'.$category->catname;
} else {
$multicatname .= $category->catname;
}
$ix++;
if ($ix != $nr) {
$multicatname .= ', ';
}
//attach category color if any in front of the event title in the calendar overview
if (isset($category->color) && $category->color) {
$colorpic .= '<span class="colorpic" style="width:6px; background-color: '.$category->color.';"></span>';
$catcolor[$category->color] = $category->color; // we need to list all different colors of this event
}
/* count if not multiday or first of multiday or first visible of multiday */
if (!isset($row->multi) || ($row->multi == 'first') || ($row->dates == $firstDate)) {
if (!array_key_exists($category->id, $countcatevents)) {
$countcatevents[$category->id] = 1;
} else {
$countcatevents[$category->id]++;
}
}
}
$color = '<div id="eventcontenttop" class="eventcontenttop">';
$color .= $colorpic;
$color .= '</div>';
// multiday
$multi_mode = 0; // single day
$multi_icon = '';
if (isset($row->multi)) {
switch ($row->multi) {
case 'first': // first day
$multi_mode = 1;
$multi_icon = '<i class="fa fa-step-backward" aria-hidden="true"></i>';
break;
case 'middle': // middle day
$multi_mode = 2;
$multi_icon = '<i class="fa fa-arrows-h fa-lg" aria-hidden="true"></i>';
break;
case 'zlast': // last day
$multi_mode = 3;
$multi_icon = '<i class="fa fa-step-forward" aria-hidden="true"></i>';
break;
}
}
//for time in calendar
$timetp = '';
if ($showtime) {
$start = JemOutput::formattime($row->times,'',false);
$end = JemOutput::formattime($row->endtimes,'',false);
switch ($multi_mode) {
case 1:
$timetp .= $multi_icon . ' ' . $start . '<br />';
break;
case 2:
$timetp .= $multi_icon . '<br />';
break;
case 3:
$timetp .= $multi_icon . ' ' . $end . '<br />';
break;
default:
if ($start != '') {
$timetp .= $start;
if ($end != '') {
$timetp .= ' - '.$end;
}
$timetp .= '<br />';
}
break;
}
} else {
if (!empty($multi_icon)) {
$timetp .= $multi_icon . ' ';
}
}
$catname = '<div class="catname">'.$multicatname.'</div>';
$eventdate = !empty($row->multistartdate) ? JemOutput::formatdate($row->multistartdate) : JemOutput::formatdate($row->dates);
if (!empty($row->multienddate)) {
$eventdate .= ' - ' . JemOutput::formatdate($row->multienddate);
} else if ($row->enddates && $row->dates < $row->enddates) {
$eventdate .= ' - ' . JemOutput::formatdate($row->enddates);
}
//venue
if ($this->jemsettings->showlocate == 1) {
$venue = '<div class="location"><span class="text-label">'.Text::_('COM_JEM_VENUE_SHORT').': </span>';
$venue .= !empty($row->venue) ? $this->escape($row->venue) : '-';
$venue .= '</div>';
} else {
$venue = '';
}
// state if unpublished
$statusicon = '';
if (isset($row->published) && ($row->published != 1)) {
$statusicon = JemOutput::publishstateicon($row);
$eventstate = '<div class="eventstate"><span class="text-label">'.Text::_('JSTATUS').': </span>';
switch ($row->published) {
case 1: $eventstate .= Text::_('JPUBLISHED'); break;
case 0: $eventstate .= Text::_('JUNPUBLISHED'); break;
case 2: $eventstate .= Text::_('JARCHIVED'); break;
case -2: $eventstate .= Text::_('JTRASHED'); break;
}
$eventstate .= '</div>';
} else {
$eventstate = '';
}
//date in tooltip
$multidaydate = '<div class="time"><span class="text-label">'.Text::_('COM_JEM_DATE').': </span>';
switch ($multi_mode) {
case 1: // first day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
case 2: // middle day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
case 3: // last day
$multidaydate .= JemOutput::formatShortDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->multistartdate, $row->times, $row->multienddate, $row->endtimes);
break;
default: // single day
$multidaydate .= JemOutput::formatShortDateTime($row->dates, $row->times, $row->enddates, $row->endtimes, $showtime);
$multidaydate .= JemOutput::formatSchemaOrgDateTime($row->dates, $row->times, $row->enddates, $row->endtimes);
break;
}
$multidaydate .= '</div>';
//create little Edit and/or Copy icon on top right corner of event if user is allowed to edit and/or create
$editicon = '';
if (!$this->print) {
$btns = array();
if ($this->params->get('show_editevent_icon', 0) && $row->params->get('access-edit', false)) {
$btns[] = JemOutput::editbutton($row, null, null, true, 'editevent');
}
if ($this->params->get('show_copyevent_icon', 0) && $this->permissions->canAddEvent) {
$btns[] = JemOutput::copybutton($row, null, null, true, 'editevent');
}
if (!empty($btns)) {
$editicon .= '<div class="inline-button-right">';
$editicon .= join(' ', $btns);
$editicon .= '</div>';
}
}
//get border for featured event
$usefeaturedborder = $this->params->get('usefeaturedborder', 0);
$featuredbordercolor = $this->params->get('featuredbordercolor', 0);
$featuredclass = '';
$featuredstyle ='';
if($usefeaturedborder && $row->featured){
$featuredclass="borderfeatured";
$featuredstyle="border-color:" . $featuredbordercolor;
}
//generate the output
// if we have exact one color from categories we can use this as background color of event
$content .= '<div class="eventcontentinner event_id' . $eventid . ' cat_id' . $category->id . ' ' . $featuredclass . '" style="' . $featuredstyle;
if (!empty($evbg_usecatcolor) && (count($catcolor) == 1)) {
$content .= '; background-color:'.array_pop($catcolor);
$content .= '" onclick="location.href=\''.$detaillink.'\'">';
} else {
$content .= '" onclick="location.href=\''.$detaillink.'\'">' . $colorpic;
}
$content .= $editicon;
$content .= JemHelper::caltooltip($catname.$eventname.$timehtml.$venue.$eventstate, $eventdate, $row->title . $statusicon, $detaillink, 'editlinktip hasTip', $timetp, $category->color);
$content .= $contentend . '</div>';
$this->cal->setEventContent($year, $month, $day, $content);
endforeach;
// enable little icon right beside day number to allow event creation
if (!$this->print && $this->params->get('show_addevent_icon', 0) && !empty($this->permissions->canAddEvent)) {
$html = JemOutput::prepareAddEventButton();
$this->cal->enableNewEventLinks($html);
}
$displayLegend = (int)$this->params->get('displayLegend', 1);
if ($displayLegend == 2) : ?>
<!-- Calendar legend above -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons jem-row jem-justify-start">
<button id="buttonshowall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_SHOWALL'); ?>
</button>
<button id="buttonhideall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_HIDEALL'); ?>
</button>
</div>
<!-- Calendar Legend -->
<div class="calendarLegends jem-row jem-justify-start">
<?php
if ($this->params->get('displayLegend')) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<button class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</button>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<?php
// print the calendar
$nrweeks = $this->params->get('nrweeks', 1);
echo $this->cal->showWeeksByID($currentWeek, $nrweeks);
?>
<?php if (($displayLegend == 1) || ($displayLegend == 0)) : ?>
<!-- Calendar legend below -->
<div id="jlcalendarlegend">
<!-- Calendar buttons -->
<div class="calendarButtons jem-row jem-justify-start">
<button id="buttonshowall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_SHOWALL'); ?>
</button>
<button id="buttonhideall" class="calendarButton btn btn-outline-dark">
<?php echo Text::_('COM_JEM_HIDEALL'); ?>
</button>
</div>
<!-- Calendar Legend -->
<div class="calendarLegends jem-row jem-justify-start">
<?php
if ($displayLegend == 1) {
##############
## FOR EACH ##
##############
$counter = array();
# walk through events
foreach ($this->rows as $row) {
foreach ($row->categories as $cat) {
# sort out dupes for the counter (catid-legend)
if (!in_array($cat->id, $counter)) {
# add cat id to cat counter
$counter[] = $cat->id;
# build legend
if (array_key_exists($cat->id, $countcatevents)) {
?>
<button class="eventCat btn btn-outline-dark" id="cat<?php echo $cat->id; ?>">
<?php
if (isset($cat->color) && $cat->color) {
echo '<span class="colorpic" style="background-color: '.$cat->color.';"></span>';
}
echo $cat->catname.' ('.$countcatevents[$cat->id].')';
?>
</button>
<?php
}
}
}
}
}
?>
</div>
</div>
<?php endif; ?>
<div class="clr"></div>
<div class="copyright">
<?php echo JemOutput::footer(); ?>
</div>
</div>

View File

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