primo commit
This commit is contained in:
289
modules/mod_jem_cal/helper.php
Normal file
289
modules/mod_jem_cal/helper.php
Normal file
@ -0,0 +1,289 @@
|
||||
<?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\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
|
||||
use Joomla\CMS\Helper\ModuleHelper;
|
||||
|
||||
BaseDatabaseModel::addIncludePath(JPATH_SITE.'/components/com_jem/models', 'JemModel');
|
||||
|
||||
abstract class ModJemCalHelper extends ModuleHelper
|
||||
{
|
||||
/**
|
||||
* Get module by id
|
||||
*
|
||||
* Same as JModuleHelper::getModule() but checking id instead of name.
|
||||
* This is required because multiple instances with different settings
|
||||
* can be shown on same position. The only unique thing is the id.
|
||||
*
|
||||
* @param int $id The id of the module
|
||||
*
|
||||
* @return stdClass The Module object or null
|
||||
*
|
||||
* @since 2.2.3
|
||||
*/
|
||||
public static function &getModuleById($id)
|
||||
{
|
||||
$result = null;
|
||||
$modules =& static::load();
|
||||
$total = count($modules);
|
||||
|
||||
for ($i = 0; $id && $i < $total; $i++)
|
||||
{
|
||||
# Match the id of the module
|
||||
if ($modules[$i]->id == $id)
|
||||
{
|
||||
# Found it
|
||||
$result = &$modules[$i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rendered content.
|
||||
*
|
||||
* This function is called by com_ajax if user navigates through
|
||||
* calendar module's months. Url query must contain id, month, and year.
|
||||
*
|
||||
* @return string The rendered content.
|
||||
*
|
||||
* @since 2.2.3
|
||||
*/
|
||||
public static function getAjax()
|
||||
{
|
||||
$app = Factory::getApplication();
|
||||
$modid = $app->input->getInt('modjemcal_id');
|
||||
# JModuleHelper doesn't provide module by id - but we
|
||||
$module = self::getModuleById($modid);
|
||||
if (!empty($module->id) && ((int)$module->id === $modid)) {
|
||||
# Indicate ajax mode where some parts will be suppressed or rendered different.
|
||||
$module->in_ajax_call = true;
|
||||
return self::renderModule($module);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getDays($greq_year, $greq_month, &$params)
|
||||
{
|
||||
# Retrieve Eventslist model for the data
|
||||
$model = BaseDatabaseModel::getInstance('Eventslist', 'JemModel', array('ignore_request' => true));
|
||||
|
||||
# Set params for the model
|
||||
$model->setState('params', $params);
|
||||
|
||||
$db = Factory::getDbo();
|
||||
$user = JemFactory::getUser();
|
||||
$levels = $user->getAuthorisedViewLevels();
|
||||
$settings = JemHelper::globalattribs();
|
||||
|
||||
$StraightToDetails = $params->get('StraightToDetails', '1');
|
||||
$DisplayCat = $params->get('DisplayCat', '0');
|
||||
$DisplayVenue = $params->get('DisplayVenue', '0');
|
||||
$ArchivedEvents = $params->get('ArchivedEvents', '0');
|
||||
$CurrentEvents = $params->get('CurrentEvents', '1');
|
||||
$FixItemID = $params->get('FixItemID', '0');
|
||||
$defaultItemid = $settings->get('default_Itemid', '');
|
||||
$daylinkparams = ''; // collects additional params for link to day view
|
||||
$max_title_len = (int)$params->get('event_cut_title', '25');
|
||||
|
||||
# Only select events within specified date range. (choosen month)
|
||||
$monthstart = mktime(0, 0, 1, $greq_month, 1, $greq_year);
|
||||
$monthend = mktime(0, 0, -1, $greq_month + 1, 1, $greq_year);
|
||||
$filter_date_from = $db->Quote(date('Y-m-d', $monthstart));
|
||||
$filter_date_to = $db->Quote(date('Y-m-d', $monthend));
|
||||
$where_from = ' DATEDIFF(IF (a.enddates IS NOT NULL, a.enddates, a.dates), ' . $filter_date_from . ') >= 0';
|
||||
$model->setState('filter.calendar_from', $where_from);
|
||||
$where_to = ' DATEDIFF(a.dates, ' . $filter_date_to . ') <= 0';
|
||||
$model->setState('filter.calendar_to', $where_to);
|
||||
|
||||
# Clean parameter data
|
||||
$catids = JemHelper::getValidIds($params->get('catid'));
|
||||
$venids = JemHelper::getValidIds($params->get('venid'));
|
||||
|
||||
# Filter categories
|
||||
if ($catids) {
|
||||
$model->setState('filter.category_id', $catids);
|
||||
$model->setState('filter.category_id.include', true);
|
||||
$daylinkparams .= '&catids=' . implode(',', $catids);
|
||||
}
|
||||
|
||||
# Filter venues
|
||||
if ($venids) {
|
||||
$model->setState('filter.venue_id', $venids);
|
||||
$model->setState('filter.venue_id.include', true);
|
||||
$daylinkparams .= '&locids=' . implode(',', $venids);
|
||||
}
|
||||
|
||||
# Filter published
|
||||
# 0: unpublished
|
||||
# 1: published
|
||||
# 2: archived
|
||||
# -2: trashed
|
||||
|
||||
if ($CurrentEvents && $ArchivedEvents) {
|
||||
$model->setState('filter.published',array(1,2));
|
||||
$daylinkparams .= '&pub=1,2';
|
||||
} else {
|
||||
if ($CurrentEvents == 1) {
|
||||
$model->setState('filter.published',1);
|
||||
$daylinkparams .= '&pub=1';
|
||||
}
|
||||
|
||||
# Filter archived
|
||||
if ($ArchivedEvents == 1) {
|
||||
$model->setState('filter.published',2);
|
||||
$daylinkparams .= '&pub=2';
|
||||
}
|
||||
}
|
||||
|
||||
$model->setState('filter.groupby','a.id');
|
||||
|
||||
# Retrieve the available Items
|
||||
$events = $model->getItems();
|
||||
|
||||
# Create an array to catch days
|
||||
$days = array();
|
||||
|
||||
foreach ($events as $index => $event) {
|
||||
# Adding categories
|
||||
$nr = is_array($event->categories) ? count($event->categories) : 0;
|
||||
$catname = '';
|
||||
$ix = 0;
|
||||
|
||||
# Walk through categories assigned to an event
|
||||
foreach($event->categories AS $category) {
|
||||
$catname .= htmlspecialchars($category->catname, ENT_COMPAT, 'UTF-8');
|
||||
|
||||
$ix++;
|
||||
if ($ix != $nr) {
|
||||
$catname .= ', ';
|
||||
}
|
||||
}
|
||||
|
||||
# Cope with no end date set i.e. set it to same as start date
|
||||
if (is_null($event->enddates)) {
|
||||
$eyear = $event->created_year; # Note: "created_*" refers to start date
|
||||
$emonth = $event->created_month;
|
||||
$eday = $event->created_day;
|
||||
} else {
|
||||
list($eyear, $emonth, $eday) = explode('-', $event->enddates);
|
||||
}
|
||||
# The two cases for roll over the year end with an event that goes across the year boundary.
|
||||
if ($greq_year < $eyear) {
|
||||
$emonth = $emonth + 12;
|
||||
}
|
||||
|
||||
if ($event->created_year < $greq_year) {
|
||||
$event->created_month = $event->created_month - 12;
|
||||
}
|
||||
|
||||
if (($greq_year >= $event->created_year) && ($greq_year <= $eyear) &&
|
||||
($greq_month >= $event->created_month) && ($greq_month <= $emonth))
|
||||
{
|
||||
//JemHelper::addLogEntry("mod_jem_cal[$params->module_id] : Show event $event->title on $event->dates - $event->enddates");
|
||||
|
||||
# Set end day for current month
|
||||
if ($emonth > $greq_month) {
|
||||
$emonth = $greq_month;
|
||||
|
||||
$eday = date('t', mktime(0, 0, 0, $greq_month, 1, $greq_year));
|
||||
}
|
||||
|
||||
# Set start day for current month
|
||||
if ($event->created_month < $greq_month) {
|
||||
$event->created_month = $greq_month;
|
||||
$event->created_day = 1;
|
||||
}
|
||||
$stod = 1;
|
||||
|
||||
for ($count = $event->created_day; $count <= $eday; $count++) {
|
||||
|
||||
$uxdate = mktime(0, 0, 0, $greq_month, $count, $greq_year);
|
||||
$tdate = date('Ymd',$uxdate);// Toni change Joomla 1.5
|
||||
|
||||
if (empty($days[$count][1])) {
|
||||
$cut = ($max_title_len > 0) && (($l = mb_strlen($event->title)) > $max_title_len);
|
||||
$title = htmlspecialchars($cut ? mb_substr($event->title, 0, $max_title_len) . '...' : $event->title, ENT_COMPAT, 'UTF-8');
|
||||
if ($DisplayCat == 1) {
|
||||
$title = $title . ' (' . $catname . ')';
|
||||
}
|
||||
if ($DisplayVenue == 1) {
|
||||
if (isset($event->venue)) {
|
||||
$title = $title . ' @' . htmlspecialchars($event->venue, ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
}
|
||||
$stod = 1;
|
||||
} else {
|
||||
$tt = $days[$count][1];
|
||||
$cut = ($max_title_len > 0) && (($l = mb_strlen($event->title)) > $max_title_len);
|
||||
$title = $tt . '+%+%+' . htmlspecialchars($cut ? mb_substr($event->title, 0, $max_title_len) . '...' : $event->title, ENT_COMPAT, 'UTF-8');
|
||||
if ($DisplayCat == 1) {
|
||||
$title = $title . ' (' . $catname . ')';
|
||||
}
|
||||
if ($DisplayVenue == 1) {
|
||||
if (isset($event->venue)) {
|
||||
$title = $title . ' @' . htmlspecialchars($event->venue, ENT_COMPAT, 'UTF-8');
|
||||
}
|
||||
}
|
||||
$stod = 0;
|
||||
}
|
||||
if (($StraightToDetails == 1) and ($stod == 1)) {
|
||||
if ($FixItemID == 0) {
|
||||
$link = Route::_(JemHelperRoute::getEventRoute($event->slug));
|
||||
} else {
|
||||
# Create the link - copied from Route
|
||||
$evlink = JemHelperRoute::getEventRoute($event->slug).'&Itemid='.$FixItemID;
|
||||
$link = Route::_($evlink);
|
||||
}
|
||||
} else {
|
||||
/// @todo fix the getroute link
|
||||
if ($FixItemID == 0) {
|
||||
if ($defaultItemid)
|
||||
{
|
||||
$evlink = 'index.php?option=com_jem&view=day&id=' . $tdate . $daylinkparams . '&Itemid=' . $defaultItemid;
|
||||
} else {
|
||||
$evlink = 'index.php?option=com_jem&view=day&id=' . $tdate . $daylinkparams;
|
||||
}
|
||||
$link = Route::_($evlink);
|
||||
//$link = JemHelperRoute::getRoute($tdate, 'day');
|
||||
} else {
|
||||
# Create the link - copied from Route
|
||||
$evlink = 'index.php?option=com_jem&view=day&id=' . $tdate . $daylinkparams . '&Itemid=' . $FixItemID;
|
||||
$link = Route::_($evlink);
|
||||
}
|
||||
}
|
||||
$days[$count] = array($link,$title);
|
||||
}
|
||||
}
|
||||
// End of Toni modification
|
||||
else {
|
||||
JemHelper::addLogEntry("mod_jem_cal[$params->module_id] : Skip event $event->title on $event->dates - $event->enddates");
|
||||
}
|
||||
|
||||
# Check if the item-categories is empty, if so the user has no access to that event at all.
|
||||
if (empty($event->categories)) {
|
||||
unset ($events[$index]);
|
||||
}
|
||||
} // end foreach
|
||||
|
||||
return $days;
|
||||
}
|
||||
}
|
||||
1
modules/mod_jem_cal/index.html
Normal file
1
modules/mod_jem_cal/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
1
modules/mod_jem_cal/language/en-GB/index.html
Normal file
1
modules/mod_jem_cal/language/en-GB/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
74
modules/mod_jem_cal/language/en-GB/mod_jem_cal.ini
Normal file
74
modules/mod_jem_cal/language/en-GB/mod_jem_cal.ini
Normal file
@ -0,0 +1,74 @@
|
||||
; @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
|
||||
;
|
||||
; All translations can be found at https://app.transifex.com/jemproject/
|
||||
; Please join the translation team if you want to contribute your changes to the translations
|
||||
;
|
||||
; Note: All ini files need to be saved as UTF-8, no BOM
|
||||
|
||||
MOD_JEM_CAL="JEM - Calendar Module"
|
||||
MOD_JEM_CAL_XML_DESCRIPTION="Displays events as a month calendar in a module position."
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS="Show Tooltips"
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_DESC="Choose to show tooltips on mouse rollover on calendar dates."
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_TITLE="Show Tooltips Title"
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_TITLE_DESC="Choose to show the tooltips title."
|
||||
MOD_JEM_CAL_TOOLTIPS_TITLE_SINGULAR="Tooltips Title (Singular)"
|
||||
MOD_JEM_CAL_TOOLTIPS_TITLE_SINGULAR_DESC="Define the tooltips title to show if tooltip contains a single event."
|
||||
MOD_JEM_CAL_TOOLTIPS_TITLE_PLURAL="Tooltips Title (Plural)"
|
||||
MOD_JEM_CAL_TOOLTIPS_TITLE_PLURAL_DESC="Define the tooltips title to show if tooltip contains multiple events."
|
||||
MOD_JEM_CAL_TOOLTIPS_MAX_EVENTS="Max. Events in Tooltip"
|
||||
MOD_JEM_CAL_TOOLTIPS_MAX_EVENTS_DESC="Limits the number of Events shown in the tooltip, keep empty for no limit."
|
||||
MOD_JEM_CAL_TOOLTIPS_MAX_EVENT_TITLE_LENGTH="Max. Event Title Length"
|
||||
MOD_JEM_CAL_TOOLTIPS_MAX_EVENT_TITLE_LENGTH_DESC="Limits the length of event titles shown in tooltips, keep empty for no limit."
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_CATEGORY="Show Category in Tooltip"
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_CATEGORY_DESC="Display the event's category/ies in tooltips."
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_VENUE="Show Venue in Tooltip"
|
||||
MOD_JEM_CAL_SHOW_TOOLTIPS_VENUE_DESC="Display the event's venue in the tooltips."
|
||||
MOD_JEM_CAL_DAYNAME_LENGTH="Length of Day Names"
|
||||
MOD_JEM_CAL_DAYNAME_LENGTH_DESC="Select if you want to display the full day name or a short version."
|
||||
MOD_JEM_CAL_DAYNAME_DONT_DISPLAY="Don't display"
|
||||
MOD_JEM_CAL_DAYNAME_ONE_LETTER="Single character"
|
||||
MOD_JEM_CAL_DAYNAME_TWO_LETTERS="Two characters"
|
||||
MOD_JEM_CAL_DAYNAME_THREE_LETTERS="Three characters"
|
||||
MOD_JEM_CAL_DAYNAME_FULL="Full name"
|
||||
MOD_JEM_CAL_FIRST_DAY_OF_WEEK="Start Week on"
|
||||
MOD_JEM_CAL_FIRST_DAY_OF_WEEK_DESC="Specify the first day of week."
|
||||
MOD_JEM_CAL_YEAR_LENGTH="Year Length"
|
||||
MOD_JEM_CAL_YEAR_LENGTH_DESC="Select to show 2 or 4 digits."
|
||||
MOD_JEM_CAL_TWO_DIGITS="Two digits"
|
||||
MOD_JEM_CAL_FOUR_DIGITS="Four digits"
|
||||
MOD_JEM_CAL_SHORT_MONTHNAME="Short Month Names"
|
||||
MOD_JEM_CAL_SHORT_MONTHNAME_DESC="Select if you wish to display abbreviated or full month names."
|
||||
MOD_JEM_CAL_MONTH_OFFSET="Month Offset"
|
||||
MOD_JEM_CAL_MONTH_OFFSET_DESC="Initial offset. Instead of current month (offset 0) e.g. next month (offset 1) or previous month (offset -1) will be shown."
|
||||
MOD_JEM_CAL_TIME_OFFSET="Time Offset (Hours)"
|
||||
MOD_JEM_CAL_TIME_OFFSET_DESC="Use this ONLY if you need to offset your time from the server settings."
|
||||
MOD_JEM_CAL_REMEMBER="Remember"
|
||||
MOD_JEM_CAL_REMEMBER_DESC="Remember which month/year is selected on page change, no jumping back to current month."
|
||||
MOD_JEM_CAL_USE_AJAX="Use AJAX"
|
||||
MOD_JEM_CAL_USE_AJAX_DESC="If set to Yes month navigation will request module content only instead of complete page reload. Also it will fallback to complete page reload if Javascript is disabled on user's browser."
|
||||
MOD_JEM_CAL_SHOW_CURRENT_EVENTS="Show Current Events"
|
||||
MOD_JEM_CAL_SHOW_CURRENT_EVENTS_DESC="Show current events. Do not set both this and Show Archived Events to No otherwise NO events will be shown."
|
||||
MOD_JEM_CAL_SHOW_ARCHIVED_EVENTS="Show Archived Events"
|
||||
MOD_JEM_CAL_SHOW_ARCHIVED_EVENTS_DESC="Show archive events. Do not set both this and Show Current Events to No otherwise NO events will be shown."
|
||||
MOD_JEM_CAL_LIMIT_TO_CATEGORY_IDS="Limit to Categories"
|
||||
MOD_JEM_CAL_LIMIT_TO_CATEGORY_IDS_DESC="Display a calendar only for the category/ies choosen. Keep empty for no limitation."
|
||||
MOD_JEM_CAL_LIMIT_TO_VENUE_IDS="Limit to Venues"
|
||||
MOD_JEM_CAL_LIMIT_TO_VENUE_IDS_DESC="Display a calendar only for the venue(s) choosen. Keep empty for no limitation."
|
||||
MOD_JEM_CAL_STRAIGHT_TO_DETAILS="Go Straight to Details"
|
||||
MOD_JEM_CAL_STRAIGHT_TO_DETAILS_DESC="Go straight to the details page when there is only one event to choose from."
|
||||
MOD_JEM_CAL_DEFAULT_CSS="Use Default CSS"
|
||||
MOD_JEM_CAL_DEFAULT_CSS_DESC="Use the default stylesheet modules/mod_jem_cal/mod_jemcal.css"
|
||||
MOD_JEM_CAL_USER_CSS="Use Alternative CSS"
|
||||
MOD_JEM_CAL_USER_CSS_DESC="Use an alternative stylesheet, e.g. modules/mod_jem_cal/mystylesheet.css. Please fill in the full path to your css file, like in the example!"
|
||||
MOD_JEM_CAL_MODULE_CLASS_SUFFIX="Module Class Suffix"
|
||||
MOD_JEM_CAL_MODULE_CLASS_SUFFIX_DESC="A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling."
|
||||
MOD_JEM_CAL_DEFAULT_ITEM_ID="Default Menu ItemID"
|
||||
MOD_JEM_CAL_DEFAULT_ITEM_ID_DESC="Override the ItemID used when calendar link goes straight to details to a menu item of your choice."
|
||||
|
||||
MOD_JEM_CAL_EVENT="Event"
|
||||
MOD_JEM_CAL_EVENTS="Events"
|
||||
|
||||
13
modules/mod_jem_cal/language/en-GB/mod_jem_cal.sys.ini
Normal file
13
modules/mod_jem_cal/language/en-GB/mod_jem_cal.sys.ini
Normal file
@ -0,0 +1,13 @@
|
||||
; @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
|
||||
;
|
||||
; All translations can be found at https://app.transifex.com/jemproject/
|
||||
; Please join the translation team if you want to contribute your changes to the translations
|
||||
;
|
||||
; Note: All ini files need to be saved as UTF-8, no BOM
|
||||
|
||||
MOD_JEM_CAL="JEM - Calendar Module"
|
||||
MOD_JEM_CAL_XML_DESCRIPTION="This module shows events on a small monthly calendar."
|
||||
1
modules/mod_jem_cal/language/index.html
Normal file
1
modules/mod_jem_cal/language/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
81
modules/mod_jem_cal/language/it-IT/it-IT.mod_jem_cal.ini
Normal file
81
modules/mod_jem_cal/language/it-IT/it-IT.mod_jem_cal.ini
Normal file
@ -0,0 +1,81 @@
|
||||
; @version 2.1.6
|
||||
; @package JEM
|
||||
; @subpackage JEM Calendar Module
|
||||
; @copyright (C) 2008 Toni Smillie www.qivva.com
|
||||
; @copyright (C) 2013-2016 joomlaeventmanager.net
|
||||
; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||
;
|
||||
; All translations can be found at https://www.transifex.com/projects/p/JEM/
|
||||
; Please join the translation team if you want to contribute your changes to the translations
|
||||
;
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
MOD_JEM_CAL_DONTDISPLAYDAYS="Non mostrare i giorni"
|
||||
MOD_JEM_CAL_ONELETTER="Singolo carattere"
|
||||
MOD_JEM_CAL_TWOLETTERS="Due caratteri"
|
||||
MOD_JEM_CAL_THREELETTERS="Tre caratteri"
|
||||
MOD_JEM_CAL_FULLNAME="Nome intero"
|
||||
MOD_JEM_CAL="JEM - Modulo Calendario"
|
||||
MOD_JEM_CAL_TWO="Due cifre"
|
||||
MOD_JEM_CAL_FOUR="Quattro cifre"
|
||||
MOD_JEM_CALENDAR_XML_DESCRIPTION="JEM Modulo Calendario. Mostra gli eventi in un calendario posizionabile come modulo"
|
||||
MOD_JEM_CAL_DEFAULTSTYLESHEET="Utilizzare foglio di stile predefinito"
|
||||
MOD_JEM_CAL_DEFAULTSTYLESHEET_DESC="Utilizzare il foglio di stile predefinito modules/mod_jem_cal/mod_jemcal.css"
|
||||
MOD_JEM_CAL_USERSTYLESHEET="Foglio di stile dell'utente"
|
||||
MOD_JEM_CAL_USERSTYLESHEET_DESC="Utilizzare un foglio di stile alternativo per esempio modules/mod_jem_cal/mystylesheet.css. Non dimenticare di compilare il percorso completo del foglio di stile, come nell'esempio!"
|
||||
MOD_JEM_CAL_SHOWTOOLTIPS="Mostrare suggerimenti?"
|
||||
MOD_JEM_CAL_SHOWTOOLTIPS_DESC="Scegliere di visualizzare i suggerimenti con effetto rollover del mouse sulle date di calendario."
|
||||
MOD_JEM_CAL_SHOWTOOLTIPSTITLE="Mostrare titolo del suggerimento?"
|
||||
MOD_JEM_CAL_SHOWTOOLTIPSTITLE_DESC="Scegli se mostrare il titolo dell'evento nel suggerimento."
|
||||
MOD_JEM_CAL_TOOLTIPSTITLE="Titolo evento nel suggerimento (singolare)"
|
||||
MOD_JEM_CAL_TOOLTIPSTITLE_DESC="Definire il titolo evento nel suggerimento (singolare, un evento)"
|
||||
MOD_JEM_CAL_TOOLTIPSTITLEPL="Titolo evento nel suggerimento (plurale)"
|
||||
MOD_JEM_CAL_TOOLTIPSTITLEPL_DESC="Definire il titolo evento nel suggerimento (Plurale, zero o piu` eventi)"
|
||||
MOD_JEM_CAL_TOOLTIPSMAXEVENTS="Numero massimo di eventi nel suggerimento"
|
||||
MOD_JEM_CAL_TOOLTIPSMAXEVENTS_DESC="Limita il numero di eventi riportati nel suggerimento, vuoto per nessun limite."
|
||||
MOD_JEM_CAL_DISPLAYCAT="Mostrare categoria nel suggerimento?"
|
||||
MOD_JEM_CAL_DISPLAYCAT_DESC="Mostrare la/le categorie degli eventi nel suggerimento"
|
||||
MOD_JEM_CAL_DISPLAYVENUE="Mostrare sede nel suggerimento?"
|
||||
MOD_JEM_CAL_DISPLAYVENUE_DESC="Visualizzare la sede della manifestazione nel suggerimento"
|
||||
MOD_JEM_CAL_USEJOOMLALANGUAGE="Utilizzare giorni/mesi di Joomla?"
|
||||
MOD_JEM_CAL_USEJOOMLALANGUAGE_DESC="Utilizza il file di lingua usato di default da joomla per i nomi dei giorni e dei mesi?"
|
||||
MOD_JEM_CAL_DAYNAMELENGTH="Lunghezza del nome del giorno"
|
||||
MOD_JEM_CAL_DAYNAMELENGTH_DESC="Scegli se visualizzare il nome dei giorni per esteso oppure ridotto"
|
||||
MOD_JEM_CAL_FIRSTDAY="Primo giorno della settimana"
|
||||
MOD_JEM_CAL_FIRSTDAY_DESC="La settimana inizia di domenica o lunedi`"
|
||||
MOD_JEM_CAL_YEARLENGTH="Lunghezza anno"
|
||||
MOD_JEM_CAL_YEARLENGTH_DESC="Scegli se utilizzare 2 o 4 lettere"
|
||||
MOD_JEM_CAL_MONTHLENGTH="Nome corto del mese?"
|
||||
MOD_JEM_CAL_MONTHLENGTH_DESC="Scegli se visualizzare il nome dei mesi per esteso oppure ridotto"
|
||||
|
||||
|
||||
MOD_JEM_CAL_MONTHOFFSET="Ritardo mese"
|
||||
MOD_JEM_CAL_MONTHOFFSET_DESC="Compensare il mese in modo da inserire 1 per un mese prima, -1 per un mese dopo ecc"
|
||||
MOD_JEM_CAL_TIMEOFFSET="Ritardo orario (ore)"
|
||||
MOD_JEM_CAL_TIMEOFFSET_DESC="Utilizzare solo se si vuole impostare un offset temporale rispetto ai settaggi del server"
|
||||
MOD_JEM_CAL_REMEMBER="Ricorda?"
|
||||
MOD_JEM_CAL_REMEMBER_DESC="Ricorda quale mese/anno e' selezionato quando cambia la pagina, senza ritorno nella giornata attuale."
|
||||
MOD_JEM_CAL_CURRENTEVENTS="Mostra eventi attuali"
|
||||
MOD_JEM_CAL_CURRENTEVENTS_DESC="Mostra eventi attuali. Non impostare "_QQ_"NO"_QQ_" anche su eventi archiviati altrimenti non verrà mostrato alcun evento"
|
||||
MOD_JEM_CAL_ARCHIVEDEVENTS="Mostra eventi archiviati"
|
||||
MOD_JEM_CAL_ARCHIVEDEVENTS_DESC="Mostra eventi archiviati. Non impostare "_QQ_"NO"_QQ_" anche su eventi attuali altrimenti non verrà mostrato alcun evento"
|
||||
MOD_JEM_CAL_STRAIGHTTODETAILS="Proseguire per i dettagli?"
|
||||
MOD_JEM_CAL_STRAIGHTTODETAILS_DESC="Vai direttamente alla pagina dettagli se è presente un solo evento in lista"
|
||||
|
||||
MOD_JEM_CAL_MODULECLASSSFX="Suffisso classe del modulo"
|
||||
MOD_JEM_CAL_MODULECLASSSFX_DESC="Un suffisso da applicare alla classe CSS del modulo (table.moduletable), questo permette di modificare lo stile individuale del modulo"
|
||||
MOD_JEM_CAL_LOCALEOVERRIDE="Sostituzione locale"
|
||||
MOD_JEM_CAL_LOCALEOVERRIDE_DESC="Definire le impostazioni del server che si desidera usare per il calendario per ignorare l'impostazione predefinita - questa puo` essere utilizzata solo se NON si utilizza la lingua predefinita di Joomla"
|
||||
MOD_JEM_CAL_CATID="Categorie"
|
||||
MOD_JEM_CAL_CATID_DESC="Scegli categorie per limitare l'output. Lasciare vuoto se si desidera visualizzare tutti gli eventi."
|
||||
MOD_JEM_CAL_VENID="Sedi"
|
||||
MOD_JEM_CAL_VENID_DESC="Scegli categorie per limitare l'output. Lasciare vuoto se si desidera visualizzare tutti gli eventi."
|
||||
MOD_JEM_CAL_FIXEDITEMID="Sostituzione ItemID"
|
||||
MOD_JEM_CAL_FIXEDITEMID_DESC="Sostituisci l'ID oggetto utilizzato quando il collegamento del calendario va direttamente ai dettagli di una voce di menu fisso"
|
||||
|
||||
MOD_JEM_CAL_EVENT="Evento"
|
||||
MOD_JEM_CAL_EVENTS="Eventi"
|
||||
MOD_JEM_CAL_SUNDAY="Domenica"
|
||||
MOD_JEM_CAL_MONDAY="Lunedi`"
|
||||
|
||||
MOD_JEM_CAL_XML_DESCRIPTION="JEM - Modulo calendario<BR>Mostra gli eventi in un calendario posizionabile come modulo"
|
||||
14
modules/mod_jem_cal/language/it-IT/it-IT.mod_jem_cal.sys.ini
Normal file
14
modules/mod_jem_cal/language/it-IT/it-IT.mod_jem_cal.sys.ini
Normal file
@ -0,0 +1,14 @@
|
||||
; @version 2.0.0
|
||||
; @package JEM
|
||||
; @subpackage JEM Calendar Module
|
||||
; @copyright (C) 2008 Toni Smillie www.qivva.com
|
||||
; @copyright (C) 2013-2014 joomlaeventmanager.net
|
||||
; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
|
||||
;
|
||||
; All translations can be found at https://www.transifex.com/projects/p/JEM/
|
||||
; Please join the translation team if you want to contribute your changes to the translations
|
||||
;
|
||||
; Note : All ini files need to be saved as UTF-8 - No BOM
|
||||
|
||||
MOD_JEM_CAL="JEM - Modulo calendario"
|
||||
MOD_JEM_CAL_XML_DESCRIPTION="Questo modulo mostra un piccolo calendario mensile degli eventi."
|
||||
194
modules/mod_jem_cal/mod_jem_cal.css
Normal file
194
modules/mod_jem_cal/mod_jem_cal.css
Normal file
@ -0,0 +1,194 @@
|
||||
/**
|
||||
* @version 2.2
|
||||
* @package JEM
|
||||
* @subpackage JEM Calendar Module
|
||||
* @copyright (C) 2013-2017 joomlaeventmanager.net
|
||||
* @copyright (C) 2008-2009 Toni Smillie www.qivva.com
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.html 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;
|
||||
}
|
||||
.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: 0px;
|
||||
}
|
||||
|
||||
|
||||
/* 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;
|
||||
}
|
||||
171
modules/mod_jem_cal/mod_jem_cal.php
Normal file
171
modules/mod_jem_cal/mod_jem_cal.php
Normal file
@ -0,0 +1,171 @@
|
||||
<?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\Factory;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
use Joomla\CMS\Router\Route;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
require_once __DIR__ . '/helper.php';
|
||||
require_once(JPATH_SITE.'/components/com_jem/helpers/route.php');
|
||||
require_once(JPATH_SITE.'/components/com_jem/helpers/helper.php');
|
||||
require_once(JPATH_SITE.'/components/com_jem/factory.php');
|
||||
|
||||
HTMLHelper::_('bootstrap.tooltip','.hasTooltip');
|
||||
|
||||
# Create JEM's file logger (for debug)
|
||||
JemHelper::addFileLogger();
|
||||
|
||||
# Parameters
|
||||
$app = Factory::getApplication();
|
||||
$day_name_length = $params->get('day_name_length', '2');
|
||||
$first_day = $params->get('first_day', '1');
|
||||
$Year_length = $params->get('Year_length', '1');
|
||||
$Month_length = $params->get('Month_length', '0');
|
||||
$Month_offset = $params->get('Month_offset', '0');
|
||||
$Time_offset = $params->get('Time_offset', '0');
|
||||
$Show_Tooltips = $params->get('Show_Tooltips', '1');
|
||||
$Show_Tooltips_Title = $params->get('Show_Tooltips_Title', '1');
|
||||
$Remember = $params->get('Remember', '1');
|
||||
$use_ajax = $params->get('use_ajax', '1');
|
||||
$CalTooltipsTitle = $params->get('cal15q_tooltips_title', Text::_('MOD_JEM_CAL_EVENT'));
|
||||
$CalTooltipsTitlePl = $params->get('cal15q_tooltipspl_title', Text::_('MOD_JEM_CAL_EVENTS'));
|
||||
$Default_Stylesheet = $params->get('Default_Stylesheet', '1');
|
||||
$User_stylesheet = $params->get('User_stylesheet', 'modules/mod_jem_cal/tmpl/mod_jem_cal.css');
|
||||
$tooltips_max_events = $params->get('tooltips_max_events', 0);
|
||||
$Itemid = $app->input->request->getInt('Itemid', 0);
|
||||
|
||||
if($Itemid ==0){
|
||||
|
||||
$Itemid = $app->getMenu()->getActive()->id;
|
||||
}
|
||||
|
||||
# AJAX requires at least J! 3.2.7 (because we use com_ajax)
|
||||
$use_ajax &= version_compare(JVERSION, '3.2.7', 'ge');
|
||||
|
||||
# Get switch trigger
|
||||
$req_modid = $app->input->getInt('modjemcal_id');
|
||||
if ((int)$module->id === $req_modid) {
|
||||
$req_month = $app->input->request->getInt('modjemcal_month');
|
||||
$req_year = $app->input->request->getInt('modjemcal_year');
|
||||
} else {
|
||||
$req_month = $req_year = 0;
|
||||
}
|
||||
|
||||
# Remember which month / year is selected. Don't jump back to today on page change
|
||||
if ($Remember == 1) {
|
||||
if ($req_month == 0) {
|
||||
$req_month = $app->getUserState("modjemcal.month.".$module->id);
|
||||
$req_year = $app->getUserState("modjemcal.year.".$module->id);
|
||||
} else {
|
||||
$app->setUserState("modjemcal.month.".$module->id, $req_month);
|
||||
$app->setUserState("modjemcal.year.".$module->id, $req_year);
|
||||
}
|
||||
}
|
||||
|
||||
# Set today
|
||||
$config = Factory::getConfig();
|
||||
$tzoffset = $config->get('config.offset');
|
||||
$time = time() + (($tzoffset + $Time_offset) * 60 * 60);
|
||||
$today_month = date('m', $time);
|
||||
$today_year = date('Y', $time);
|
||||
$today = date('j', $time);
|
||||
|
||||
if ($req_month == 0) { $req_month = $today_month; }
|
||||
if ($req_year == 0) { $req_year = $today_year; }
|
||||
|
||||
$offset_month = $req_month + $Month_offset;
|
||||
$offset_year = $req_year;
|
||||
|
||||
if ($offset_month < 1) {
|
||||
$offset_month += 12; // Roll over year start
|
||||
--$offset_year;
|
||||
}
|
||||
|
||||
if ($offset_month > 12) {
|
||||
$offset_month -= 12; // Roll over year end
|
||||
++$offset_year;
|
||||
}
|
||||
|
||||
# Setting the previous and next month numbers
|
||||
$prev_month_year = $req_year;
|
||||
$next_month_year = $req_year;
|
||||
|
||||
$prev_month = $req_month - 1;
|
||||
if ($prev_month < 1) {
|
||||
$prev_month = 12;
|
||||
--$prev_month_year;
|
||||
}
|
||||
|
||||
$next_month = $req_month + 1;
|
||||
if ($next_month > 12) {
|
||||
$next_month = 1;
|
||||
++$next_month_year;
|
||||
}
|
||||
|
||||
$prev_year = $req_year - 1;
|
||||
$next_year = $req_year + 1;
|
||||
|
||||
# Requested URL
|
||||
$uri = Uri::getInstance();
|
||||
$myurl = $uri->toString(array('query'));
|
||||
|
||||
//08/09/09 - Added Fix for sh404sef
|
||||
if (empty($myurl)) {
|
||||
$request_link = $uri->toString(array('path')).'?';
|
||||
} else {
|
||||
# Remove modjemcal params from url
|
||||
$request_link = $uri->toString(array('path')).$myurl;
|
||||
$request_link = preg_replace('/&modjemcal_(month|year|id)=\d+/i', '', $request_link);
|
||||
}
|
||||
|
||||
$ajax_link = Uri::base().'?option=com_ajax&module=jem_cal&format=raw'.'&Itemid='.$Itemid;
|
||||
|
||||
# By default use links working on browsers with JavaScript disabled.
|
||||
# Then let a JavaScript change this to ajax links.
|
||||
$url_base_nojs = Route::_($request_link, false) . '&modjemcal_id='.$module->id;
|
||||
$url_base_ajax = Route::_($ajax_link, false) . '&modjemcal_id='.$module->id;
|
||||
|
||||
# Create link params - template must concatenate one of the url_bases above and one of the props below.
|
||||
$props_prev = '&modjemcal_month='.$prev_month.'&modjemcal_year='.$prev_month_year;
|
||||
$props_next = '&modjemcal_month='.$next_month.'&modjemcal_year='.$next_month_year;
|
||||
$props_home = '&modjemcal_month='.$today_month.'&modjemcal_year='.$today_year;
|
||||
$props_prev_year = '&modjemcal_month='.$req_month.'&modjemcal_year='.$prev_year;
|
||||
$props_next_year = '&modjemcal_month='.$req_month.'&modjemcal_year='.$next_year;
|
||||
|
||||
# Get data
|
||||
$params->set('module_id', $module->id); // used for debug log
|
||||
$days = ModJemCalHelper::getDays($offset_year, $offset_month, $params);
|
||||
|
||||
$mod_name = 'mod_jem_cal';
|
||||
|
||||
# Add css
|
||||
if ($Default_Stylesheet == 1) {
|
||||
JemHelper::loadModuleStyleSheet($mod_name, $mod_name);
|
||||
} else {
|
||||
$document = $app->getDocument();
|
||||
$document->addStyleSheet(Uri::base() . $User_stylesheet);
|
||||
}
|
||||
$wa = Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('jquery');
|
||||
# Load icon font if needed
|
||||
JemHelper::loadIconFont();
|
||||
|
||||
# Render
|
||||
require(JemHelper::getModuleLayoutPath($mod_name));
|
||||
|
||||
?>
|
||||
239
modules/mod_jem_cal/mod_jem_cal.xml
Normal file
239
modules/mod_jem_cal/mod_jem_cal.xml
Normal file
@ -0,0 +1,239 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension type="module" version="2.5" client="site" method="upgrade">
|
||||
<name>mod_jem_cal</name>
|
||||
<author>Toni Smillie, JEM Community</author>
|
||||
<authorEmail>toni@qivva.com, info@joomlaeventmanager.net</authorEmail>
|
||||
<authorUrl>https://www.qivva.com, https://www.joomlaeventmanager.net</authorUrl>
|
||||
<creationDate>October 2024</creationDate>
|
||||
<copyright>Copyright (C) 2013-2024 joomlaeventmanager.net</copyright>
|
||||
<license>https://www.gnu.org/licenses/gpl-3.0 GNU/GPL</license>
|
||||
<version>4.3.1</version>
|
||||
<description>MOD_JEM_CAL_XML_DESCRIPTION</description>
|
||||
|
||||
<scriptfile>script.php</scriptfile>
|
||||
|
||||
<files>
|
||||
<filename module="mod_jem_cal">mod_jem_cal.php</filename>
|
||||
<filename>helper.php</filename>
|
||||
<filename>script.php</filename>
|
||||
<filename>index.html</filename>
|
||||
|
||||
<folder>tmpl</folder>
|
||||
<folder>language</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/mod_jem_cal.ini</language>
|
||||
<language tag="en-GB">language/en-GB/mod_jem_cal.sys.ini</language>
|
||||
</languages>
|
||||
<help key="Modules" />
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic" addfieldpath="/administrator/components/com_jem/models/fields">
|
||||
<field name="Show_Tooltips" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_SHOW_TOOLTIPS"
|
||||
description="MOD_JEM_CAL_SHOW_TOOLTIPS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="Show_Tooltips_Title" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_SHOW_TOOLTIPS_TITLE"
|
||||
description="MOD_JEM_CAL_SHOW_TOOLTIPS_TITLE_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="cal15q_tooltips_title" type="text"
|
||||
default="Event"
|
||||
label="MOD_JEM_CAL_TOOLTIPS_TITLE_SINGULAR"
|
||||
description="MOD_JEM_CAL_TOOLTIPS_TITLE_SINGULAR_DESC"
|
||||
/>
|
||||
<field name="cal15q_tooltipspl_title" type="text"
|
||||
default="Events"
|
||||
label="MOD_JEM_CAL_TOOLTIPS_TITLE_PLURAL"
|
||||
description="MOD_JEM_CAL_TOOLTIPS_TITLE_PLURAL_DESC"
|
||||
/>
|
||||
<field name="tooltips_max_events" type="text"
|
||||
default=""
|
||||
label="MOD_JEM_CAL_TOOLTIPS_MAX_EVENTS"
|
||||
description="MOD_JEM_CAL_TOOLTIPS_MAX_EVENTS_DESC"
|
||||
/>
|
||||
<field name="event_cut_title" type="text"
|
||||
default="25"
|
||||
label="MOD_JEM_CAL_TOOLTIPS_MAX_EVENT_TITLE_LENGTH"
|
||||
description="MOD_JEM_CAL_TOOLTIPS_MAX_EVENT_TITLE_LENGTH_DESC"
|
||||
/>
|
||||
<field name="DisplayCat" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
label="MOD_JEM_CAL_SHOW_TOOLTIPS_CATEGORY"
|
||||
description="MOD_JEM_CAL_SHOW_TOOLTIPS_CATEGORY_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="DisplayVenue" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
label="MOD_JEM_CAL_SHOW_TOOLTIPS_VENUE"
|
||||
description="MOD_JEM_CAL_SHOW_TOOLTIPS_VENUE_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="spacer2" type="spacer"
|
||||
label=""
|
||||
description=""
|
||||
hr="true"
|
||||
/>
|
||||
<field name="day_name_length" type="list"
|
||||
default="2"
|
||||
label="MOD_JEM_CAL_DAYNAME_LENGTH"
|
||||
description="MOD_JEM_CAL_DAYNAME_LENGTH_DESC"
|
||||
>
|
||||
<option value="0">MOD_JEM_CAL_DAYNAME_DONT_DISPLAY</option>
|
||||
<option value="1">MOD_JEM_CAL_DAYNAME_ONE_LETTER</option>
|
||||
<option value="2">MOD_JEM_CAL_DAYNAME_TWO_LETTERS</option>
|
||||
<option value="3">MOD_JEM_CAL_DAYNAME_THREE_LETTERS</option>
|
||||
<option value="4">MOD_JEM_CAL_DAYNAME_FULL</option>
|
||||
</field>
|
||||
<field name="first_day" type="list"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_FIRST_DAY_OF_WEEK"
|
||||
description="MOD_JEM_CAL_FIRST_DAY_OF_WEEK_DESC"
|
||||
>
|
||||
<option value="0">SUNDAY</option>
|
||||
<option value="1">MONDAY</option>
|
||||
<option value="2">TUESDAY</option>
|
||||
<option value="3">WEDNESDAY</option>
|
||||
<option value="4">THURSDAY</option>
|
||||
<option value="5">FRIDAY</option>
|
||||
<option value="6">SATURDAY</option>
|
||||
</field>
|
||||
<field name="Year_length" type="list"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_YEAR_LENGTH"
|
||||
description="MOD_JEM_CAL_YEAR_LENGTH_DESC"
|
||||
>
|
||||
<option value="0">MOD_JEM_CAL_TWO_DIGITS</option>
|
||||
<option value="1">MOD_JEM_CAL_FOUR_DIGITS</option>
|
||||
</field>
|
||||
<field name="Month_length" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
label="MOD_JEM_CAL_SHORT_MONTHNAME"
|
||||
description="MOD_JEM_CAL_SHORT_MONTHNAME_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="Month_offset" type="text"
|
||||
default="0"
|
||||
label="MOD_JEM_CAL_MONTH_OFFSET"
|
||||
description="MOD_JEM_CAL_MONTH_OFFSET_DESC"
|
||||
/>
|
||||
<field name="Time_offset" type="text"
|
||||
default="0"
|
||||
label="MOD_JEM_CAL_TIME_OFFSET"
|
||||
description="MOD_JEM_CAL_TIME_OFFSET_DESC"
|
||||
/>
|
||||
<field name="spacer3" type="spacer"
|
||||
label=""
|
||||
description=""
|
||||
hr="true"
|
||||
/>
|
||||
<field name="Remember" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_REMEMBER"
|
||||
description="MOD_JEM_CAL_REMEMBER_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="use_ajax" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_USE_AJAX"
|
||||
description="MOD_JEM_CAL_USE_AJAX_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="CurrentEvents" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_SHOW_CURRENT_EVENTS"
|
||||
description="MOD_JEM_CAL_SHOW_CURRENT_EVENTS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="ArchivedEvents" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="0"
|
||||
label="MOD_JEM_CAL_SHOW_ARCHIVED_EVENTS"
|
||||
description="MOD_JEM_CAL_SHOW_ARCHIVED_EVENTS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="catid" type="categoryedit"
|
||||
default=""
|
||||
multiple="true"
|
||||
removeroot="true"
|
||||
label="MOD_JEM_CAL_LIMIT_TO_CATEGORY_IDS"
|
||||
description="MOD_JEM_CAL_LIMIT_TO_CATEGORY_IDS_DESC"
|
||||
/>
|
||||
<field name="venid" type="venueoptions"
|
||||
default=""
|
||||
multiple="true"
|
||||
label="MOD_JEM_CAL_LIMIT_TO_VENUE_IDS"
|
||||
description="MOD_JEM_CAL_LIMIT_TO_VENUE_IDS_DESC"
|
||||
/>
|
||||
<field name="StraightToDetails" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_STRAIGHT_TO_DETAILS"
|
||||
description="MOD_JEM_CAL_STRAIGHT_TO_DETAILS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="spacer4" type="spacer"
|
||||
label=""
|
||||
description=""
|
||||
hr="true"
|
||||
/>
|
||||
<field name="Default_Stylesheet" type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
default="1"
|
||||
label="MOD_JEM_CAL_DEFAULT_CSS"
|
||||
description="MOD_JEM_CAL_DEFAULT_CSS_DESC"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field name="User_stylesheet" type="text"
|
||||
default=""
|
||||
label="MOD_JEM_CAL_USER_CSS"
|
||||
description="MOD_JEM_CAL_USER_CSS_DESC"
|
||||
/>
|
||||
<field name="moduleclass_sfx" type="text"
|
||||
default=""
|
||||
label="MOD_JEM_CAL_MODULE_CLASS_SUFFIX"
|
||||
description="MOD_JEM_CAL_MODULE_CLASS_SUFFIX_DESC"
|
||||
/>
|
||||
<field name="FixItemID" type="text"
|
||||
default=""
|
||||
label="MOD_JEM_CAL_DEFAULT_ITEM_ID"
|
||||
description="MOD_JEM_CAL_DEFAULT_ITEM_ID_DESC"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
||||
208
modules/mod_jem_cal/script.php
Normal file
208
modules/mod_jem_cal/script.php
Normal file
@ -0,0 +1,208 @@
|
||||
<?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\Registry\Registry;
|
||||
|
||||
/**
|
||||
* Script file of JEM component
|
||||
*/
|
||||
class mod_jem_calInstallerScript
|
||||
{
|
||||
|
||||
private $name = 'mod_jem_cal';
|
||||
|
||||
private $oldRelease = "";
|
||||
private $newRelease = "";
|
||||
|
||||
/**
|
||||
* method to run before an install/update/uninstall method
|
||||
* (it seams method is not called on uninstall)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function preflight($type, $parent)
|
||||
{
|
||||
// abort if the release being installed is not newer than the currently installed version
|
||||
if (strtolower($type) == 'update') {
|
||||
// Installed component version
|
||||
$this->oldRelease = $this->getParam('version');
|
||||
|
||||
// Installing component version as per Manifest file
|
||||
$this->newRelease = (string) $parent->getManifest()->version;
|
||||
|
||||
if (version_compare($this->newRelease, $this->oldRelease, 'lt')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to run after an install/update/uninstall method
|
||||
* (it seams method is not called on uninstall)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function postflight($type, $parent)
|
||||
{
|
||||
if (strtolower($type) == 'update') {
|
||||
// Changes between 2.1.5 -> 2.1.6
|
||||
if (version_compare($this->oldRelease, '2.1.6-rc3', 'le') && version_compare($this->newRelease, '2.1.6-rc3', 'ge')) {
|
||||
// change category/venue/event ID lists from string to array
|
||||
$this->updateParams216();
|
||||
}
|
||||
// Changes between 2.2.2 -> 2.2.3
|
||||
if (version_compare($this->oldRelease, '2.2.3-dev1', 'le') && version_compare($this->newRelease, '2.2.3-dev1', 'ge')) {
|
||||
// add use_ajax, take over od_jem_calajax which becomes obsolete
|
||||
$this->updateParams223();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a parameter from the manifest file (actually, from the manifest cache).
|
||||
*
|
||||
* @param $name The name of the parameter
|
||||
*
|
||||
* @return The parameter
|
||||
*/
|
||||
private function getParam($name)
|
||||
{
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('manifest_cache')->from('#__extensions')->where(array("type = 'module'", "element = '".$this->name."'"));
|
||||
$db->setQuery($query);
|
||||
$manifest = json_decode($db->loadResult(), true);
|
||||
return $manifest[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment category ids in params of JEM modules.
|
||||
* (required when updating from 1.9.4 or below to 1.9.5 or newer)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function updateParams216()
|
||||
{
|
||||
// get all "mod_jem..." entries
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id, params');
|
||||
$query->from('#__modules');
|
||||
$query->where('module = "' . $this->name . '"');
|
||||
$db->setQuery($query);
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
foreach ($items as $item) {
|
||||
// Decode the item params
|
||||
$reg = new Registry;
|
||||
$reg->loadString($item->params);
|
||||
|
||||
$modified = false;
|
||||
|
||||
// catid - if string then convert to array
|
||||
$ids = $reg->get('catid');
|
||||
if (!empty($ids) && is_string($ids)) {
|
||||
$reg->set('catid', explode(',', $ids));
|
||||
$modified = true;
|
||||
}
|
||||
// venid - if string then convert to array
|
||||
$ids = $reg->get('venid');
|
||||
if (!empty($ids) && is_string($ids)) {
|
||||
$reg->set('venid', explode(',', $ids));
|
||||
$modified = true;
|
||||
}
|
||||
|
||||
// write back
|
||||
if ($modified) {
|
||||
// write changed params back into DB
|
||||
$query = $db->getQuery(true);
|
||||
$query->update('#__modules');
|
||||
$query->set('params = '.$db->quote((string)$reg));
|
||||
$query->where(array('id = '.$db->quote($item->id)));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add use_ajax,
|
||||
* take over instances from mod_jem_calajax which becomes obsolete
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function updateParams223()
|
||||
{
|
||||
// get all "mod_jem..." entries
|
||||
$db = Factory::getContainer()->get('DatabaseDriver');
|
||||
$query = $db->getQuery(true);
|
||||
$query->select('id, module, note, params');
|
||||
$query->from('#__modules');
|
||||
$query->where('module = "' . $this->name . '" OR module = "mod_jem_calajax"');
|
||||
$db->setQuery($query);
|
||||
$items = $db->loadObjectList();
|
||||
|
||||
$use_ajax = version_compare(JVERSION, '3.2.7', 'ge') ? '1' : '0';
|
||||
$obs_params = array('UseJoomlaLanguage', 'locale_override');
|
||||
$fix_params = array('cal15q_tooltips_title', 'cal15q_tooltipspl_title');
|
||||
|
||||
foreach ($items as $item) {
|
||||
// Decode the item params
|
||||
$reg = new Registry;
|
||||
$reg->loadString($item->params);
|
||||
|
||||
$mod_params = false;
|
||||
$mod_mod = $item->module == 'mod_jem_calajax';
|
||||
|
||||
// add use_ajax if missing
|
||||
if (!$reg->exists('use_ajax')) {
|
||||
$reg->set('use_ajax', $use_ajax);
|
||||
$mod_params = true;
|
||||
}
|
||||
|
||||
// adapt text defines
|
||||
foreach ($fix_params as $f) {
|
||||
$str = $reg->get($f, '');
|
||||
$str2 = mb_ereg_replace('MOD_JEM_CALAJAX_', 'MOD_JEM_CAL_', $str);
|
||||
if ($str !== $str2) {
|
||||
$reg->set($f, $str2);
|
||||
$mod_params = true;
|
||||
}
|
||||
}
|
||||
|
||||
// remove obsolete params
|
||||
foreach ($obs_params as $o) {
|
||||
if ($reg->exists($o)) {
|
||||
$reg->set($o, null);
|
||||
$mod_params = true;
|
||||
}
|
||||
}
|
||||
|
||||
// write back
|
||||
if ($mod_params || $mod_mod) {
|
||||
// write changed data back into DB
|
||||
$query = $db->getQuery(true);
|
||||
$query->update('#__modules');
|
||||
if ($mod_params) {
|
||||
$query->set('params = '.$db->quote((string)$reg));
|
||||
}
|
||||
if ($mod_mod) { // change module and append a note
|
||||
$query->set('module = '.$db->quote($this->name));
|
||||
$query->set('note = '.$db->quote(join(' -- ', array($item->note, 'PLEASE CHECK this transfered from obsolete mod_jem_calajax, then uninstall mod_jem_calajax!'))));
|
||||
}
|
||||
$query->where(array('id = '.$db->quote($item->id)));
|
||||
$db->setQuery($query);
|
||||
$db->execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
225
modules/mod_jem_cal/tmpl/default.php
Normal file
225
modules/mod_jem_cal/tmpl/default.php
Normal 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 . ' ' . $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 . '"><<</a> ') : '<< ';
|
||||
$navi_nojs .= $props_prev ? ('<a href="' . htmlspecialchars($url_base_nojs . $props_prev) . '" title="' . $the_month_prev . ' ' . $prev_month_year . '"><</a> ') : '< ';
|
||||
$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 ? (' <a href="' . htmlspecialchars($url_base_nojs . $props_next) . '" title="' . $the_month_next . ' ' . $next_month_year . '">></a>') : ' >';
|
||||
$navi_nojs .= $props_next_year ? (' <a href="' . htmlspecialchars($url_base_nojs . $props_next_year) . '" title="' . $the_month . ' ' . $next_year . '">>></a>') : ' >>';
|
||||
$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;"><<</a> ') : '<< ';
|
||||
$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;"><</a> ') : '< ';
|
||||
$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 ? (' <a href="#" title="' . $the_month_next . ' ' . $next_month_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_next) . '\'); return false;">></a>') : ' >';
|
||||
$navi_ajax .= $props_next_year ? (' <a href="#" title="' . $the_month . ' ' . $next_year . '" onClick="mod_jem_cal_click_' . $module->id . '(\'' . htmlspecialchars($url_base_ajax . $props_next_year) . '\'); return false;">>></a>') : ' >>';
|
||||
$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 . '"> ' . $dayname . ' </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 . '"> ' . mb_substr($dayname, 0, $day_name_length, 'UTF-8') . ' </th>';
|
||||
} else {
|
||||
$calendar .= '<th class="mod_jemcalq_daynames" abbr="' . $dayname . '"> ' . substr($dayname, 0, $day_name_length) . ' </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"> </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) ? ' ': '';
|
||||
|
||||
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"> </td>';
|
||||
}
|
||||
|
||||
$calendar .= "</tr>\n</table>\n";
|
||||
echo $calendar;
|
||||
|
||||
if (!$use_ajax || empty($module->in_ajax_call)) {
|
||||
echo "</div>";
|
||||
}
|
||||
1
modules/mod_jem_cal/tmpl/index.html
Normal file
1
modules/mod_jem_cal/tmpl/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
196
modules/mod_jem_cal/tmpl/mod_jem_cal.css
Normal file
196
modules/mod_jem_cal/tmpl/mod_jem_cal.css
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user