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,225 @@
<?php
/**
* @package JEM
* @subpackage JEM Calendar Module
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2008 Toni Smillie www.qivva.com
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*
* Original Eventlist calendar from Christoph Lukes
* PHP Calendar (version 2.3), written by Keith Devens
* https://keithdevens.com/software/php_calendar
* see example at https://keithdevens.com/weblog
* License: https://keithdevens.com/software/license
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;
# Ensure $use_ajax is defined and boolean
$use_ajax = !empty($use_ajax);
# Use Ajax to navigate through the months if JS is enabled on browser.
if ($use_ajax && empty($module->in_ajax_call)) { ?>
<script>
jQuery(document).ready(function(){
jQuery('#mod_jem_cal_<?php print $module->id; ?>_navi_nojs').css("display", "none");
jQuery('#mod_jem_cal_<?php print $module->id; ?>_navi_ajax').css("display", "table-caption");
});
function mod_jem_cal_click_<?php print $module->id; ?>(url) {
jQuery('#eventcalq<?php echo $module->id;?>').load(url, function () {
jQuery(".hasTooltip").tooltip({'html':true});
});
}
</script>
<?php
}
# Output
if (!$use_ajax || empty($module->in_ajax_call)) {
echo '<div class="eventcalq' . $params->get('moduleclass_sfx') . '" id="eventcalq' . $module->id . '">';
}
$calendar = '';
$year = $offset_year;
$month = $offset_month;
$uxtime_first_of_month = gmmktime(0, 0, 0, $month, 1, $year);
# Remember that mktime will automatically correct if invalid dates are entered
# for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998
# this provides a built in "rounding" feature to generate_calendar()
$month_weekday = gmdate('w', $uxtime_first_of_month);
$days_in_month = gmdate('t', $uxtime_first_of_month);
$day_names_long = array('SUNDAY', 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY');
$day_names_short = array('SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT');
$month_names = array('', 'JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER');
$month_name_short = Text::_($month_names[(int)$month] . '_SHORT');
$month_name_long = Text::_($month_names[(int)$month]);
$weekday = ($month_weekday + 7 - $first_day) % 7; # adjust for $first_day of week
$the_year = $Year_length ? $year : substr($year, -2); # full or last two digits
if (!function_exists('mb_convert_case')) {
$the_month = ucfirst(htmlentities($Month_length ? $month_name_short : $month_name_long, ENT_COMPAT, "UTF-8"));
$the_month_prev = ucfirst(htmlentities(Text::_($month_names[(int)$prev_month] . ($Month_length ? '_SHORT' : '')), ENT_COMPAT, "UTF-8"));
$the_month_next = ucfirst(htmlentities(Text::_($month_names[(int)$next_month] . ($Month_length ? '_SHORT' : '')), ENT_COMPAT, "UTF-8"));
$the_month_today = ucfirst(htmlentities(Text::_($month_names[(int)$today_month] . ($Month_length ? '_SHORT' : '')), ENT_COMPAT, "UTF-8"));
} else {
$the_month = mb_convert_case($Month_length ? $month_name_short : $month_name_long, MB_CASE_TITLE, "UTF-8");
$the_month_prev = mb_convert_case(Text::_($month_names[(int)$prev_month] . ($Month_length ? '_SHORT' : '')), MB_CASE_TITLE, "UTF-8");
$the_month_next = mb_convert_case(Text::_($month_names[(int)$next_month] . ($Month_length ? '_SHORT' : '')), MB_CASE_TITLE, "UTF-8");
$the_month_today = mb_convert_case(Text::_($month_names[(int)$today_month] . ($Month_length ? '_SHORT' : '')), MB_CASE_TITLE, "UTF-8");
}
$title = $the_month . '&nbsp;' . $the_year;
# Begin calendar. Uses a real <caption>. See https://diveintomark.org/archives/2002/07/03
$calendar .= '<table class="mod_jemcalq_calendar">' . "\n";
# Month navigation links
# use $url_base_nojs or $url_base_ajax followed by $props_prev, $props_home, or $props_next
$navi_nojs = '<caption class="mod_jemcalq_calendar-month caption-top" id="mod_jem_cal_' . $module->id . '_navi_nojs" style="display:' . (!$use_ajax || empty($module->in_ajax_call) ? 'table-caption' : 'none') . '">';
$navi_nojs .= $props_prev_year ? ('<a href="' . htmlspecialchars($url_base_nojs . $props_prev_year) . '" title="' . $the_month . ' ' . $prev_year . '">&lt;&lt;</a>&nbsp;&nbsp;') : '&lt;&lt;&nbsp;&nbsp;';
$navi_nojs .= $props_prev ? ('<a href="' . htmlspecialchars($url_base_nojs . $props_prev) . '" title="' . $the_month_prev . ' ' . $prev_month_year . '">&lt;</a>&nbsp;&nbsp;') : '&lt;&nbsp;&nbsp;';
$navi_nojs .= $props_home ? ('<span class="evtq_home"><a href="' . htmlspecialchars($url_base_nojs . $props_home) . '" title="' . $the_month_today . ' ' . $today_year . '">' . $title . '</a></span>') : $title;
$navi_nojs .= $props_next ? ('&nbsp;&nbsp;<a href="' . htmlspecialchars($url_base_nojs . $props_next) . '" title="' . $the_month_next . ' ' . $next_month_year . '">&gt;</a>') : '&nbsp;&nbsp;&gt;';
$navi_nojs .= $props_next_year ? ('&nbsp;&nbsp;<a href="' . htmlspecialchars($url_base_nojs . $props_next_year) . '" title="' . $the_month . ' ' . $next_year . '">&gt;&gt;</a>') : '&nbsp;&nbsp;&gt;&gt;';
$navi_nojs .= '</caption>';
$calendar .= $navi_nojs;
if ($use_ajax) {
$navi_ajax = '<caption class="mod_jemcalq_calendar-month caption-top" id="mod_jem_cal_' . $module->id . '_navi_ajax" style="display:' . (empty($module->in_ajax_call) ? 'none' : 'table-caption') . '">';
$navi_ajax .= $props_prev_year ? ('<a href="#" title="' . $the_month . ' ' . $prev_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_prev_year) . '\'); return false;">&lt;&lt;</a>&nbsp;&nbsp;') : '&lt;&lt;&nbsp;&nbsp;';
$navi_ajax .= $props_prev ? ('<a href="#" title="' . $the_month_prev . ' ' . $prev_month_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_prev) . '\'); return false;">&lt;</a>&nbsp;&nbsp;') : '&lt;&nbsp;&nbsp;';
$navi_ajax .= $props_home ? ('<span class="evtq_home"><a href="#" title="' . $the_month_today . ' ' . $today_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_home) . '\'); return false;">' . $title . '</a></span>') : $title;
$navi_ajax .= $props_next ? ('&nbsp;&nbsp;<a href="#" title="' . $the_month_next . ' ' . $next_month_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_next) . '\'); return false;">&gt;</a>') : '&nbsp;&nbsp;&gt;';
$navi_ajax .= $props_next_year ? ('&nbsp;&nbsp;<a href="#" title="' . $the_month . ' ' . $next_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_next_year) . '\'); return false;">&gt;&gt;</a>') : '&nbsp;&nbsp;&gt;&gt;';
$navi_ajax .= '</caption>';
$calendar .= $navi_ajax;
}
# If the day names should be shown ($day_name_length > 0)
if ($day_name_length) {
$calendar .= '<tr>';
# If day_name_length is >3, the full name of the day will be printed
if ($day_name_length > 3) {
for ($d = 0; $d < 7; ++$d) {
$dayname = Text::_($day_names_long[($d + $first_day) % 7]);
$calendar .= '<th class="mod_jemcalq_daynames" abbr="' . $dayname . '">&nbsp;' . $dayname . '&nbsp;</th>';
}
} else {
for ($d = 0; $d < 7; ++$d) {
$dayname = Text::_($day_names_short[($d + $first_day) % 7]);
if (function_exists('mb_substr')) {
$calendar .= '<th class="mod_jemcalq_daynames" abbr="' . $dayname . '">&nbsp;' . mb_substr($dayname, 0, $day_name_length, 'UTF-8') . '&nbsp;</th>';
} else {
$calendar .= '<th class="mod_jemcalq_daynames" abbr="' . $dayname . '">&nbsp;' . substr($dayname, 0, $day_name_length) . '&nbsp;</th>';
}
}
}
$calendar .= "</tr>\n";
}
# Today
$config = Factory::getConfig();
$tzoffset = $config->get('config.offset');
$time = time() + (($tzoffset + $Time_offset) * 60 * 60); //25/2/08 Change for v 0.6 to incorporate server offset into time;
$today = date('j', $time);
$currmonth = date('m', $time);
$curryear = date('Y', $time);
# Switch off tooltips if neighter title nor text should be shown
if (($Show_Tooltips_Title == 0) && ($tooltips_max_events === '0')) {
$Show_Tooltips = 0;
}
$calendar .= '<tr>';
# Initial 'empty' days
for ($counti = 0; $counti < $weekday; $counti++) {
$calendar .= '<td class="mod_jemcalq">&nbsp;</td>';
}
# The days of interest
for ($day = 1; $day <= $days_in_month; $day++, $weekday++) {
if ($weekday == 7) {
$weekday = 0; #start a new week
$calendar .= "</tr>\n<tr>";
}
$istoday = ($day == $today) && ($currmonth == $month) && ($curryear == $year);
$tdbaseclass = ($istoday) ? 'mod_jemcalq_caltoday' : 'mod_jemcalq_calday';
# Space in front of daynumber when day < 10
$space = ($day < 10) ? '&nbsp;&nbsp;': '';
if (isset($days[$day][1])) {
$link = $days[$day][0];
$title = $days[$day][1];
if ($Show_Tooltips == 1) {
$calendar .= '<td class="' . $tdbaseclass . 'link">';
if ($link) {
$tip = '';
$title = explode('+%+%+', $title);
if ($Show_Tooltips_Title == 1) {
if (count($title) > 1) {
$tipTitle = count($title) . ' ' . Text::_($CalTooltipsTitlePl);
} else {
$tipTitle = '1 ' . Text::_($CalTooltipsTitle);
}
} else {
$tipTitle = '';
}
if (version_compare(JVERSION, '3.2.7', 'lt')) {
# There is a bug in Joomla which will format complete tip text as title
# if $tipTitle is empty (because then no '::' will be added).
# So add it manually and let title param empty.
$tip = $tipTitle . '::';
$tipTitle = '';
}
# If user hadn't explicitely typed in a 0 list limited number or all events
if ($tooltips_max_events !== '0') {
$count = 0;
foreach ($title as $t) {
if (($tooltips_max_events > 0) && (++$count > $tooltips_max_events)) {
$tip .= '...';
break; // foreach
}
$tip .= trim($t) . '<br />';
}
}
# J! version < 3.2.7: title already within $tip to ensure always '::' is present
# But with J! 3.3+ is a bug in script so we need to use the bad 'hasTooltip'
# which is default of class parameter.
$calendar .= HTMLHelper::tooltip($tip, $tipTitle, 'tooltip.png', $space . $day, $link);
}
$calendar .= '</td>';
} else {
$calendar .= '<td class="' . $tdbaseclass . 'link">' . ($link ? '<a href="' . $link . '">' . $space . $day . '</a>' : $space . $day) . '</td>';
}
} else {
$calendar .= '<td class="' . $tdbaseclass . '"><span class="nolink">' . $space . $day . '</span></td>';
}
}
# Remaining 'empty' days
for ($counti = $weekday; $counti < 7; $counti++) {
$calendar .= '<td class="mod_jemcalq">&nbsp;</td>';
}
$calendar .= "</tr>\n</table>\n";
echo $calendar;
if (!$use_ajax || empty($module->in_ajax_call)) {
echo "</div>";
}

View File

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

View File

@ -0,0 +1,196 @@
/**
* @package JEM
* @subpackage JEM Calendar Module
* @copyright (C) 2013-2024 joomlaeventmanager.net
* @copyright (C) 2008-2009 Toni Smillie www.qivva.com
* @license https://www.gnu.org/licenses/gpl-3.0 GNU/GPL
*/
/* Container div Width set the same as calendar width. Setting both margins to auto centres the calendar*/
.eventcalq {
/*width: 154px;*/
max-width:220px;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
}
/* Overall calendar table properties */
.eventcalq table.mod_jemcalq_calendar {
width: 100%;
padding: 0;
margin: 0;
border-left: 1px solid #A2ADBC;
font: normal 12px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
color: #616B76;
text-align: center;
background-color: #fff;
border-spacing: 0;
border-collapse: collapse;
}
.eventcalq table.mod_jemcalq_calendar th ,
.eventcalq table.mod_jemcalq_calendar td {
padding: 0;
margin: 0;
}
/* Blank cell properties */
.eventcalq td.mod_jemcalq {
font: bold 11px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
border-right: 1px solid #A2ADBC;
border-bottom: 1px solid #A2ADBC;
width: 21px;
height: 20px;
text-align: center;
background-color: #F0F8FF;
}
/* Today cell properties */
.eventcalq td.mod_jemcalq_caltoday
{
font: bold 11px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
border-right: 1px solid #A2ADBC;
border-bottom: 1px solid #A2ADBC;
width: 21px;
height: 20px;
text-align: center;
color: #F6F4DA;
background-color: #DF9496;
}
/* Today Event day cell hover Link / Visited*/
.eventcalq td.mod_jemcalq_caltodaylink a:link,
.eventcalq td.mod_jemcalq_caltodaylink a:visited{
text-decoration: none;
/* width: 19px;
height: 18px; */
font-weight: bold;
display: block;
color: #608194;
border: 2px solid #DF9496;
}
/* Today Event day cell hover */
.eventcalq td.mod_jemcalq_caltodaylink a:hover {
text-decoration: none;
/* width: 19px;
height: 18px; */
font-weight: bold;
display: block;
color: #FFFFFF;
background-color: #0066FF;
border: 2px solid #DF9496;
}
/* Non event day cell preperties */
.eventcalq td.mod_jemcalq_calday {
font: bold 11px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
border-right: 1px solid #A2ADBC;
border-bottom: 1px solid #A2ADBC;
width: 21px;
height: 20px;
text-align: center;
background-color: #EFEFEF;
}
.eventcalq td.mod_jemcalq_calday span.nolink {
border: 2px solid transparent; /* to get always same cell size */
display: block;
}
/* Event day cell properties */
.eventcalq td.mod_jemcalq_caldaylink,
.eventcalq td.mod_jemcalq_caltodaylink {
font: bold 11px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
border-right: 1px solid #A2ADBC;
border-bottom: 1px solid #A2ADBC;
width: 21px;
height: 20px;
text-align: center;
background-color: #CCE0FF;
}
/* Event day cell hover Link / Visited*/
.eventcalq td.mod_jemcalq_caldaylink a:link,
.eventcalq td.mod_jemcalq_caldaylink a:visited{
text-decoration: none;
font-weight: bold;
display: block;
color: #608194;
background-color: #CCE0FF;
border: 2px solid transparent; /* to get always same cell size */
}
/* Event day cell hover */
.eventcalq td.mod_jemcalq_caldaylink a:hover {
text-decoration: none;
font-weight: bold;
display: block;
color: #FFFFFF;
background-color: #0066FF;
border: 2px solid transparent; /* to get always same cell size */
}
/* Month heading properies */
.eventcalq caption.mod_jemcalq_calendar-month {
font: bold 12px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
color: #ffffff;
background-color: #666666;
text-align: center;
}
/* Month heading Link / Visited properties */
.eventcalq caption.mod_jemcalq_calendar-month a,
.eventcalq caption.mod_jemcalq_calendar-month a:link,
.eventcalq caption.mod_jemcalq_calendar-month a:visited
{
color: #DFEFFF;
}
/* Month heading Hover properties */
.eventcalq caption.mod_jemcalq_calendar-month a:hover{
color: #990000;
text-decoration: none;
}
/* Day of week heading properties*/
.eventcalq th.mod_jemcalq_daynames {
font: bold 11px/20px "Trebuchet MS", Arial, Verdana, Helvetica, sans-serif;
text-align: center;
color: #616B76;
background: #D9E2E1;
padding: 0;
}
/* Tooltips */
.tool-tip {
float: left;
background: #ffc;
border: 1px solid #D4D5AA;
padding: 5px;
max-width: 300px;
}
.tool-title {
padding: 0;
margin: 0;
font-size: 100%;
font-weight: bold;
margin-top: -15px;
padding-top: 15px;
padding-bottom: 5px;
background: url(../../templates/system/images/selector-arrow.png) no-repeat;
color: #000000;
}
.tool-text {
font-size: 100%;
margin: 0;
color: #000000;
}
/* prevent problems with some site templates */
.eventcalq table.mod_jemcalq_calendar span.hasTip {
margin: 0;
}