Skip to content

Commit

Permalink
Merge pull request #14 from bramwaas/develop
Browse files Browse the repository at this point in the history
Develop 2.1.4
  • Loading branch information
bramwaas authored Apr 17, 2023
2 parents aa6a7cd + df334d8 commit 218243f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: bramwaas
Tags: Event Calendar, Google Calendar, iCal, Events, Block, Calendar, iCalendar, Outlook, iCloud
Requires at least Joomla: 4.0
Tested up to: 4.2
Requires PHP: 5.3.0
Requires PHP: 7
Stable tag: trunk
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Expand Down Expand Up @@ -172,6 +172,8 @@ This project is licensed under the [GNU GPL](https://www.gnu.org/licenses/gpl-3.
* works with Joomla 4 or higher.

== Changelog ==
* 2.1.4 After a feature request of achimmm (in github on Joomla module) added optional placeholder HTML output when no upcoming events are avalable. Also added optional output after the events list (when upcoming events are available).
* 2.1.3 In response to a support issue of (@marijnvr) (on WP plugin). New lay-out for block with first date line on a higer level li. 'Start with summary' toggle-setting changed in 'layout' select-setting with options 'Startdate higher level', 'Start with summary', 'Old style'.
* 2.1.1 Solved Warning: Array to string conversion in .../Transport/Curl.php on line 183 that occured after using php 8.
* 2.1.0 Support more calendars in one module/block. Support DURATION of event. Move processing 'allowhtml' complete out Parser to template/block.
Use properties in IcsParser to limit copying of input params in several functions.
Expand Down
6 changes: 6 additions & 0 deletions language/en-GB/en-GB.mod_simple_ical_block.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ MOD_SIMPLEICALBLOCK_SFLGIA="Suffix event details class"
MOD_SIMPLEICALBLOCK_SFLGIA_DESC="Suffix event details class"
MOD_SIMPLEICALBLOCK_ALLOWHTML="Allow safe html in description and summary."
MOD_SIMPLEICALBLOCK_ALLOWHTML_DESC="Allow safe html in description and summary."
MOD_SIMPLEICALBLOCK_AFTER_EVENTS="Closing HTML after available events."
MOD_SIMPLEICALBLOCK_AFTER_EVENTS_DESC="Closing (safe) HTML after events list, when events are available."
MOD_SIMPLEICALBLOCK_NO_EVENTS="Closing HTML when no events."
MOD_SIMPLEICALBLOCK_NO_EVENTS_DESC="Closing (safe) HTML output when no events are available."
MOD_SIMPLEICALBLOCK_CCN="Clear cache."
MOD_SIMPLEICALBLOCK_CCN_DESC="Clear cache on save of settings."
MOD_SIMPLEICALBLOCK_ANCHORID="HTML anchor"
Expand Down Expand Up @@ -102,6 +106,8 @@ MOD_SIMPLEICALBLOCK_SUFFIX_LG_CLASS_HELP="Suffix to add after css-class around t
MOD_SIMPLEICALBLOCK_SUFFIX_LGI_CLASS_HELP="Suffix to add after the css-class around the event start line (list-group-item),<br>start with space to keep the original class and add another class.<br>E.g.: py-0 with leading space; standard bootstrap 4 class to set padding top and bottom to 0; ml-1 to set margin left to 0.25 rem"
MOD_SIMPLEICALBLOCK_SUFFIX_LGIA_CLASS_HELP="Suffix to add after the css-class around the event details link (ical_details),<br>start with space to keep the original class and add another class."
MOD_SIMPLEICALBLOCK_ALLOWHTML_HELP="Check checkbox to allow the use of some safe html in description and summary,<br>otherwise it will only be displayed as text."
MOD_SIMPLEICALBLOCK_AFTER_EVENTS_HELP="Closing (safe) HTML after events list, when events are available.<br>This text with simple HTML will be displayed after the events list.<br>Use &amp;lt; or &amp;gt; if you want to output &lt; or &gt; otherwise they may be removed as unknown and therefore unsafe tags.<br>E.g. &lt;hr class=&quot;module-ft&quot; &gt;"
MOD_SIMPLEICALBLOCK_NO_EVENTS_HELP="Closing (safe) HTML output when no events are available.<br>This text with simple HTML will be displayed when instead of the events list.<br>Use &amp;lt; or &amp;gt; if you want to output &lt; or &gt; otherwise they may be removed as unknown and therefore unsafe tags.<br>E.g. &lt;p class=&quot;warning&quot; &gt;&amp;lt; No events found. &amp;gt;&lt;\p&gt;&lt;hr class=&quot;module-ft&quot;&gt;"
MOD_SIMPLEICALBLOCK_CLEAR_CACHE_NOW_HELP="Check checkbox to clear calendar cache on save of settings, otherwise it will be cleared after cache time is expired."
MOD_SIMPLEICALBLOCK_ANCHORID_HELP="HTML anchor for this block.<br>Type one or two words - no spaces - to create a unique web address for this block, called an &ldquo;anchor&rdquo; Then you can link directly to this section on your page.<br>You can als use this ID to make parts of your extra css specific for this block"
MOD_SIMPLEICALBLOCK_LAYOUT_HELP="Standard only &ldquo;Default&rdquo; available, but you can add defaults in the template; see Joomla documentation"
Expand Down
6 changes: 6 additions & 0 deletions language/nl-NL/nl-NL.mod_simple_ical_block.ini
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ MOD_SIMPLEICALBLOCK_SFLGIA="Achtervoegsel class voor detail"
MOD_SIMPLEICALBLOCK_SFLGIA_DESC="Achtervoegsel class voor detail"
MOD_SIMPLEICALBLOCK_ALLOWHTML="Sta veilige html toe."
MOD_SIMPLEICALBLOCK_ALLOWHTML_DESC="Sta veilige html toe in beschrijving en samenvatting."
MOD_SIMPLEICALBLOCK_AFTER_EVENTS="Alsluitende HTML bij beschikbare gebeurtenissen."
MOD_SIMPLEICALBLOCK_AFTER_EVENTS_DESC="Afsluitende (veilige) HTML-uitvoer na gebeurtenissenlijst, als er gebeurtenissen aanwezig zijn."
MOD_SIMPLEICALBLOCK_NO_EVENTS="Afsluitende HTML bij geen gebeurtenissen."
MOD_SIMPLEICALBLOCK_NO_EVENTS_DESC="Afsluitende (veilige) HTML-uitvoer wanneer er geen gebeurtenissen beschikbaar zijn."
MOD_SIMPLEICALBLOCK_CCN="Vernieuw agenda cache."
MOD_SIMPLEICALBLOCK_CCN_DESC="Vernieuw agenda cache bij opslaan van de instellingen."
MOD_SIMPLEICALBLOCK_ANCHORID="HTML anker"
Expand Down Expand Up @@ -102,6 +106,8 @@ MOD_SIMPLEICALBLOCK_SUFFIX_LG_CLASS_HELP="Achtervoegsel achter de css-class om d
MOD_SIMPLEICALBLOCK_SUFFIX_LGI_CLASS_HELP="Achtervoegsel achter de css-class van de kopregel (list-group-item),<br>begin met spatie om originele class te behouden en andere toe te voegen.<br>Bv.: py-0 met voorloop spatie; standard bootstrap 4 class om padding top and bottom op 0 te zetten; ml-1 om linker marge op 0.25 rem te zetten."
MOD_SIMPLEICALBLOCK_SUFFIX_LGIA_CLASS_HELP="Achtervoegsel om achter de css-class van de details link (ical_details) te voegen,<br>begin met spatie om originele class te behouden en andere toe te voegen."
MOD_SIMPLEICALBLOCK_ALLOWHTML_HELP="Vink aan om enige veilige html in de beschrijving en samenvatting toe te staan,<br>anders wordt het getoond als tekst."
MOD_SIMPLEICALBLOCK_AFTER_EVENTS_HELP="Afsluitende (veilige) HTML-uitvoer na gebeurtenissenlijst, als er gebeurtenissen aanwezig zijn.<br>Deze tekst met eenvoudige HTML wordt getoond na de gebeurtenissen lijst.<br>Gebruik &amp;lt; of &amp;gt; als u &lt; of &gt; wilt tonen anders kunnen ze worden verwijderd als onbekende en dus onveilige tags.<br>Bijv. &lt;hr class=&quot;module-ft&quot; &gt;"
MOD_SIMPLEICALBLOCK_NO_EVENTS_HELP="Afsluitende (veilige) HTML-uitvoer wanneer er geen gebeurtenissen beschikbaar zijn.<br>Deze tekst met eenvoudige HTML wordt getoond in plaats van de gebeurtenissen lijst.<br>Gebruik &amp;lt; of &amp;gt; als u &lt; of &gt; wilt tonen anders kunnen ze worden verwijderd als onbekende en dus onveilige tags.<br>Bijv. &lt;p class=&quot;warning&quot; &gt;&amp;lt; Geen gebeurtenissen gevonden found. &amp;gt;&lt;\p&gt;&lt;hr class=&quot;module-ft&quot;&gt;"
MOD_SIMPLEICALBLOCK_CLEAR_CACHE_NOW_HELP="Vink aan om agenda cache nu op te schonen bij het opslaan van de instellingen, ander wordt hij opgeschoond als de cache tijd is verlopen."
MOD_SIMPLEICALBLOCK_ANCHORID_HELP="HTML anker voor dit blok.<br>Type een of twee woorden - geen spaties - om een uniek webadres te cre&euml;ren voor dit blok, een zogenaamd &ldquo;anchor&rdquo; Dan kan je rechtstreeks naar deze plaats op de pagina linken.<br>Je kan deze ID ook gebruiken om delen van je CSS specifiek te maken voor dit blok."
MOD_SIMPLEICALBLOCK_LAYOUT_HELP="Standard is alleen &ldquo;Default&rdquo; beschikbaar, maar je kan overrides toevoegen in je template; zie Joomla documentation"
Expand Down
14 changes: 12 additions & 2 deletions mod_simple_ical_block.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" client="site" method="upgrade">
<name>Simple iCal Block</name>
<creationDate>09-04-2023</creationDate>
<creationDate>16-04-2023</creationDate>
<author>A.H.C. Waasdorp</author>
<copyright>Copyright (C) 2022 - 2023 A.H.C. Waasdorp, All rights reserved.</copyright>
<license>https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>http://www.waasdorpsoekhan.nl</authorUrl>
<version>2.1.3</version>
<version>2.1.4</version>
<description><![CDATA[<div class="sib-info" style="color: #3f48cc;"><p><img class="sib-img" src="../modules/mod_simple_ical_block/assets/simpleicalicon128x128.svg" style="display: inline-block; width: 2em; height:auto; margin-right: 0.5em;"/>Simple iCal Calendar Events Block</p></div>
]]></description>
<namespace path="src">WaasdorpSoekhan\Module\Simpleicalblock</namespace>
Expand Down Expand Up @@ -68,6 +68,8 @@
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field name="after_events" type="text" default="" filter="raw" label="MOD_SIMPLEICALBLOCK_AFTER_EVENTS" description="MOD_SIMPLEICALBLOCK_AFTER_EVENTS_DESC" />
<field name="no_events" type="text" default="" filter="raw" label="MOD_SIMPLEICALBLOCK_NO_EVENTS" description="MOD_SIMPLEICALBLOCK_NO_EVENTS_DESC" />
<field name="clear_cache_now" type="radio" layout="joomla.form.field.radio.switcher"
class="switcher btn-group" default="0" validate="cleartransientnow"
label="MOD_SIMPLEICALBLOCK_CCN" description="MOD_SIMPLEICALBLOCK_CCN_DESC" >
Expand Down Expand Up @@ -184,6 +186,14 @@
label="MOD_SIMPLEICALBLOCK_ALLOWHTML"
description="MOD_SIMPLEICALBLOCK_ALLOWHTML_HELP"
/>
<field name="after_events_help" type="note"
label="MOD_SIMPLEICALBLOCK_AFTER_EVENTS"
description="MOD_SIMPLEICALBLOCK_AFTER_EVENTS_HELP"
/>
<field name="no_events_help" type="note"
label="MOD_SIMPLEICALBLOCK_NO_EVENTS"
description="MOD_SIMPLEICALBLOCK_NO_EVENTS_HELP"
/>
<field name="clear_cache_now_help" type="note"
label="MOD_SIMPLEICALBLOCK_CCN"
description="MOD_SIMPLEICALBLOCK_CLEAR_CACHE_NOW_HELP"
Expand Down
3 changes: 3 additions & 0 deletions src/Helper/SimpleicalblockHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* 0.0.3 replaced defaults for dateformats by "", because we also use empty format to skip the field.
* Added space to sanitize html class because it it also used for more classes.
* 0.0.4 removed selfmade transient functions because we now use Joomla standard cache type output to replace wp_transient.
* 2.1.4 add closing HTML output after eventlist or when no events are available.
*/
namespace WaasdorpSoekhan\Module\Simpleicalblock\Site\Helper;
// no direct access
Expand Down Expand Up @@ -94,6 +95,8 @@ static function render_attributes($block_attributes) {
'suffix_lg_class' => '',
'suffix_lgi_class' => ' py-0',
'suffix_lgia_class' => '',
'after_events' => '',
'no_events' => '',
'allowhtml' => false,
'clear_cache_now' => false,
// 'align'=>'',
Expand Down
10 changes: 8 additions & 2 deletions tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
* 2.0.1 back to static functions getData() and fetch() only instantiate object in fetch when parsing must be done (like it always was in WP)
* 2.1.0 add calendar class to list-group-item
* add htmlspecialchars() to summary, description and location when not 'allowhtml', replacing similar code from IcsParser
* 2.1.3 use select 'layout' in stead of 'start with summary' to create more lay-out options.
* 2.1.3 use select 'layout' in stead of 'start with summary' to create more lay-out options.
* 2.1.4 add closing HTML output after eventlist or when no events are available.
*/
// no direct access
defined('_JEXEC') or die ('Restricted access');
Expand All @@ -46,7 +47,7 @@
*/
static $allowed_tags = ['a','abbr', 'acronym', 'address','area','article', 'aside','audio',
'b','big','blockquote', 'br','button', 'caption','cite','code','col',
'details', 'div', 'em', 'fieldset', 'figcaption', 'figure', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6','hr',
'details', 'div', 'em', 'fieldset', 'figcaption', 'figure', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6','hr',
'i', 'img', 'li', 'label', 'legend', 'ol', 'p','q', 'section', 'small', 'span','strike', 'strong', 'u','ul'] ;
$old_timezone = date_default_timezone_get();
$tzid_ui = Factory::getApplication()->get('offset');
Expand Down Expand Up @@ -150,6 +151,11 @@
}
echo '</ul>';
date_default_timezone_set($old_timezone);
echo strip_tags($attributes['after_events'],$allowed_tags);
}
else {
echo strip_tags($attributes['no_events'],$allowed_tags);

}
echo '<br class="clear" />';
}
Expand Down

0 comments on commit 218243f

Please sign in to comment.